repo_name
stringlengths
4
116
path
stringlengths
3
942
size
stringlengths
1
7
content
stringlengths
3
1.05M
license
stringclasses
15 values
dbmalkovsky/flowable-engine
modules/flowable-cmmn-converter/src/test/java/org/flowable/test/cmmn/converter/CasePageTaskSameDeploymentCmmnXmlConverterTest.java
2479
/* Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.flowable.test.cmmn.converter; import static org.assertj.core.api.Assertions.assertThat; import org.flowable.cmmn.model.CasePageTask; import org.flowable.cmmn.model.CmmnModel; import org.flowable.cmmn.model.PlanItemDefinition; import org.flowable.test.cmmn.converter.util.CmmnXmlConverterTest; /** * @author Filip Hrisafov */ public class CasePageTaskSameDeploymentCmmnXmlConverterTest { @CmmnXmlConverterTest("org/flowable/test/cmmn/converter/casePageTaskSameDeployment.cmmn") public void validateModel(CmmnModel cmmnModel) { assertThat(cmmnModel).isNotNull(); PlanItemDefinition casePageDefinition = cmmnModel.findPlanItemDefinition("casePageTaskSameDeployment"); assertThat(casePageDefinition) .isInstanceOfSatisfying(CasePageTask.class, task -> { assertThat(task.getFormKey()).isEqualTo("testKey"); assertThat(task.isSameDeployment()).isTrue(); }); assertThat(casePageDefinition.getAttributes()).isEmpty(); casePageDefinition = cmmnModel.findPlanItemDefinition("casePageTaskSameDeploymentFalse"); assertThat(casePageDefinition) .isInstanceOfSatisfying(CasePageTask.class, task -> { assertThat(task.getFormKey()).isEqualTo("testKey2"); assertThat(task.isSameDeployment()).isFalse(); }); assertThat(casePageDefinition.getAttributes()).isEmpty(); casePageDefinition = cmmnModel.findPlanItemDefinition("casePageTaskSameDeploymentGlobal"); assertThat(casePageDefinition) .isInstanceOfSatisfying(CasePageTask.class, task -> { assertThat(task.getFormKey()).isEqualTo("testKey3"); assertThat(task.isSameDeployment()).isTrue(); }); assertThat(casePageDefinition.getAttributes()).isEmpty(); } }
apache-2.0
cedral/aws-sdk-cpp
aws-cpp-sdk-clouddirectory/source/model/BatchUpdateObjectAttributesResponse.cpp
1706
/* * Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ #include <aws/clouddirectory/model/BatchUpdateObjectAttributesResponse.h> #include <aws/core/utils/json/JsonSerializer.h> #include <utility> using namespace Aws::Utils::Json; using namespace Aws::Utils; namespace Aws { namespace CloudDirectory { namespace Model { BatchUpdateObjectAttributesResponse::BatchUpdateObjectAttributesResponse() : m_objectIdentifierHasBeenSet(false) { } BatchUpdateObjectAttributesResponse::BatchUpdateObjectAttributesResponse(JsonView jsonValue) : m_objectIdentifierHasBeenSet(false) { *this = jsonValue; } BatchUpdateObjectAttributesResponse& BatchUpdateObjectAttributesResponse::operator =(JsonView jsonValue) { if(jsonValue.ValueExists("ObjectIdentifier")) { m_objectIdentifier = jsonValue.GetString("ObjectIdentifier"); m_objectIdentifierHasBeenSet = true; } return *this; } JsonValue BatchUpdateObjectAttributesResponse::Jsonize() const { JsonValue payload; if(m_objectIdentifierHasBeenSet) { payload.WithString("ObjectIdentifier", m_objectIdentifier); } return payload; } } // namespace Model } // namespace CloudDirectory } // namespace Aws
apache-2.0
sdgdsffdsfff/zeus
slb/src/main/java/com/ctrip/zeus/task/clean/CleanDbTask.java
1085
package com.ctrip.zeus.task.clean; import com.ctrip.zeus.clean.CleanDbManager; import com.ctrip.zeus.task.AbstractTask; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Component; import javax.annotation.Resource; /** * Created by fanqq on 2016/1/5. */ @Component("cleanDbTask") public class CleanDbTask extends AbstractTask { Logger logger = LoggerFactory.getLogger(this.getClass()); @Resource private CleanDbManager cleanDbManager; @Override public void start() { } @Override public void run() throws Exception { try { logger.info("[CleanDbTask] clean db task started."); cleanDbManager.run(); logger.info("[CleanDbTask] clean db task finished."); } catch (Exception e) { logger.warn("[clean db job] clean db exception." + e.getMessage(), e); } } @Override public void stop() { } @Override public long getInterval() { return 60000 * 30; } }
apache-2.0
vorburger/mifos-head
application/src/test/java/org/mifos/domain/builders/ClientPersonalDetailDtoBuilder.java
1421
/* * Copyright (c) 2005-2010 Grameen Foundation USA * All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or * implied. See the License for the specific language governing * permissions and limitations under the License. * * See also http://www.apache.org/licenses/LICENSE-2.0.html for an * explanation of the license and how it is applied. */ package org.mifos.domain.builders; import org.mifos.dto.screen.ClientPersonalDetailDto; public class ClientPersonalDetailDtoBuilder { private Integer ethinicity; private Integer citizenship; private Integer handicapped; private Integer businessActivities; private Integer maritalStatus; private Integer educationLevel; private Short numChildren; private Short gender; private Short povertyStatus; public ClientPersonalDetailDto build() { return new ClientPersonalDetailDto(ethinicity, citizenship, handicapped, businessActivities, maritalStatus, educationLevel, numChildren, gender, povertyStatus); } }
apache-2.0
hakanu/iftar
_posts_/vakit/YENI_ZELLANDA/HASTINGS/2017-02-01-HASTINGS.markdown
561
--- layout: vakit_dashboard title: HASTINGS, YENI ZELLANDA için iftar, namaz vakitleri ve hava durumu - ilçe/eyalet seç permalink: /YENI ZELLANDA/HASTINGS --- ## HASTINGS (YENI ZELLANDA) için iftar, namaz vakitleri ve hava durumu görmek için bir ilçe/eyalet seç Aşağıdaki listeden bir şehir ya da semt seçin * [ (HASTINGS, YENI_ZELLANDA) için iftar ve namaz vakitleri](/YENI_ZELLANDA/HASTINGS/) <script type="text/javascript"> var GLOBAL_COUNTRY = 'YENI ZELLANDA'; var GLOBAL_CITY = 'HASTINGS'; var GLOBAL_STATE = 'HASTINGS'; </script>
apache-2.0
marques-work/gocd
server/src/test-integration/java/com/thoughtworks/go/fixture/DatabaseDiskIsLow.java
1397
/* * Copyright 2021 ThoughtWorks, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.thoughtworks.go.fixture; import com.thoughtworks.go.util.GoConstants; import com.thoughtworks.go.util.SystemEnvironment; public class DatabaseDiskIsLow implements PreCondition { @Override public void onSetUp() throws Exception { new SystemEnvironment().setProperty(SystemEnvironment.DATABASE_FULL_SIZE_LIMIT, "1m"); new SystemEnvironment().setProperty(SystemEnvironment.DATABASE_WARNING_SIZE_LIMIT, "11222334m"); } @Override public void onTearDown() throws Exception { new SystemEnvironment().clearProperty(SystemEnvironment.DATABASE_FULL_SIZE_LIMIT); new SystemEnvironment().clearProperty(SystemEnvironment.DATABASE_WARNING_SIZE_LIMIT); } public long getLowLimit() { return 1 * GoConstants.MEGA_BYTE; } }
apache-2.0
onechain/fabric-explorer
explorer_client/css/api/screen.css
46460
/* Original style from softwaremaniacs.org (c) Ivan Sagalaev <[email protected]> */ .swagger-section pre code { display: block; padding: 0.5em; background: #F0F0F0; } .swagger-section pre code, .swagger-section pre .subst, .swagger-section pre .tag .title, .swagger-section pre .lisp .title, .swagger-section pre .clojure .built_in, .swagger-section pre .nginx .title { color: black; } .swagger-section pre .string, .swagger-section pre .title, .swagger-section pre .constant, .swagger-section pre .parent, .swagger-section pre .tag .value, .swagger-section pre .rules .value, .swagger-section pre .rules .value .number, .swagger-section pre .preprocessor, .swagger-section pre .ruby .symbol, .swagger-section pre .ruby .symbol .string, .swagger-section pre .aggregate, .swagger-section pre .template_tag, .swagger-section pre .django .variable, .swagger-section pre .smalltalk .class, .swagger-section pre .addition, .swagger-section pre .flow, .swagger-section pre .stream, .swagger-section pre .bash .variable, .swagger-section pre .apache .tag, .swagger-section pre .apache .cbracket, .swagger-section pre .tex .command, .swagger-section pre .tex .special, .swagger-section pre .erlang_repl .function_or_atom, .swagger-section pre .markdown .header { color: #800; } .swagger-section pre .comment, .swagger-section pre .annotation, .swagger-section pre .template_comment, .swagger-section pre .diff .header, .swagger-section pre .chunk, .swagger-section pre .markdown .blockquote { color: #888; } .swagger-section pre .number, .swagger-section pre .date, .swagger-section pre .regexp, .swagger-section pre .literal, .swagger-section pre .smalltalk .symbol, .swagger-section pre .smalltalk .char, .swagger-section pre .go .constant, .swagger-section pre .change, .swagger-section pre .markdown .bullet, .swagger-section pre .markdown .link_url { color: #080; } .swagger-section pre .label, .swagger-section pre .javadoc, .swagger-section pre .ruby .string, .swagger-section pre .decorator, .swagger-section pre .filter .argument, .swagger-section pre .localvars, .swagger-section pre .array, .swagger-section pre .attr_selector, .swagger-section pre .important, .swagger-section pre .pseudo, .swagger-section pre .pi, .swagger-section pre .doctype, .swagger-section pre .deletion, .swagger-section pre .envvar, .swagger-section pre .shebang, .swagger-section pre .apache .sqbracket, .swagger-section pre .nginx .built_in, .swagger-section pre .tex .formula, .swagger-section pre .erlang_repl .reserved, .swagger-section pre .prompt, .swagger-section pre .markdown .link_label, .swagger-section pre .vhdl .attribute, .swagger-section pre .clojure .attribute, .swagger-section pre .coffeescript .property { color: #88F; } .swagger-section pre .keyword, .swagger-section pre .id, .swagger-section pre .phpdoc, .swagger-section pre .title, .swagger-section pre .built_in, .swagger-section pre .aggregate, .swagger-section pre .css .tag, .swagger-section pre .javadoctag, .swagger-section pre .phpdoc, .swagger-section pre .yardoctag, .swagger-section pre .smalltalk .class, .swagger-section pre .winutils, .swagger-section pre .bash .variable, .swagger-section pre .apache .tag, .swagger-section pre .go .typename, .swagger-section pre .tex .command, .swagger-section pre .markdown .strong, .swagger-section pre .request, .swagger-section pre .status { font-weight: bold; } .swagger-section pre .markdown .emphasis { font-style: italic; } .swagger-section pre .nginx .built_in { font-weight: normal; } .swagger-section pre .coffeescript .javascript, .swagger-section pre .javascript .xml, .swagger-section pre .tex .formula, .swagger-section pre .xml .javascript, .swagger-section pre .xml .vbscript, .swagger-section pre .xml .css, .swagger-section pre .xml .cdata { opacity: 0.5; } .swagger-section .hljs { display: block; overflow-x: auto; padding: 0.5em; background: #F0F0F0; } .swagger-section .hljs, .swagger-section .hljs-subst { color: #444; } .swagger-section .hljs-keyword, .swagger-section .hljs-attribute, .swagger-section .hljs-selector-tag, .swagger-section .hljs-meta-keyword, .swagger-section .hljs-doctag, .swagger-section .hljs-name { font-weight: bold; } .swagger-section .hljs-built_in, .swagger-section .hljs-literal, .swagger-section .hljs-bullet, .swagger-section .hljs-code, .swagger-section .hljs-addition { color: #1F811F; } .swagger-section .hljs-regexp, .swagger-section .hljs-symbol, .swagger-section .hljs-variable, .swagger-section .hljs-template-variable, .swagger-section .hljs-link, .swagger-section .hljs-selector-attr, .swagger-section .hljs-selector-pseudo { color: #BC6060; } .swagger-section .hljs-type, .swagger-section .hljs-string, .swagger-section .hljs-number, .swagger-section .hljs-selector-id, .swagger-section .hljs-selector-class, .swagger-section .hljs-quote, .swagger-section .hljs-template-tag, .swagger-section .hljs-deletion { color: #880000; } .swagger-section .hljs-title, .swagger-section .hljs-section { color: #880000; font-weight: bold; } .swagger-section .hljs-comment { color: #888888; } .swagger-section .hljs-meta { color: #2B6EA1; } .swagger-section .hljs-emphasis { font-style: italic; } .swagger-section .hljs-strong { font-weight: bold; } .swagger-section .swagger-ui-wrap { line-height: 1; font-family: "Droid Sans", sans-serif; max-width: 960px; margin-left: auto; margin-right: auto; /* JSONEditor specific styling */ } .swagger-section .swagger-ui-wrap b, .swagger-section .swagger-ui-wrap strong { font-family: "Droid Sans", sans-serif; font-weight: bold; } .swagger-section .swagger-ui-wrap q, .swagger-section .swagger-ui-wrap blockquote { quotes: none; } .swagger-section .swagger-ui-wrap p { line-height: 1.4em; padding: 0 0 10px; color: #333333; } .swagger-section .swagger-ui-wrap q:before, .swagger-section .swagger-ui-wrap q:after, .swagger-section .swagger-ui-wrap blockquote:before, .swagger-section .swagger-ui-wrap blockquote:after { content: none; } .swagger-section .swagger-ui-wrap .heading_with_menu h1, .swagger-section .swagger-ui-wrap .heading_with_menu h2, .swagger-section .swagger-ui-wrap .heading_with_menu h3, .swagger-section .swagger-ui-wrap .heading_with_menu h4, .swagger-section .swagger-ui-wrap .heading_with_menu h5, .swagger-section .swagger-ui-wrap .heading_with_menu h6 { display: block; clear: none; float: left; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; -ms-box-sizing: border-box; box-sizing: border-box; width: 60%; } .swagger-section .swagger-ui-wrap table { border-collapse: collapse; border-spacing: 0; } .swagger-section .swagger-ui-wrap table thead tr th { padding: 5px; font-size: 0.9em; color: #666666; border-bottom: 1px solid #999999; } .swagger-section .swagger-ui-wrap table tbody tr:last-child td { border-bottom: none; } .swagger-section .swagger-ui-wrap table tbody tr.offset { background-color: #f0f0f0; } .swagger-section .swagger-ui-wrap table tbody tr td { padding: 6px; font-size: 0.9em; border-bottom: 1px solid #cccccc; vertical-align: top; line-height: 1.3em; } .swagger-section .swagger-ui-wrap ol { margin: 0px 0 10px; padding: 0 0 0 18px; list-style-type: decimal; } .swagger-section .swagger-ui-wrap ol li { padding: 5px 0px; font-size: 0.9em; color: #333333; } .swagger-section .swagger-ui-wrap ol, .swagger-section .swagger-ui-wrap ul { list-style: none; } .swagger-section .swagger-ui-wrap h1 a, .swagger-section .swagger-ui-wrap h2 a, .swagger-section .swagger-ui-wrap h3 a, .swagger-section .swagger-ui-wrap h4 a, .swagger-section .swagger-ui-wrap h5 a, .swagger-section .swagger-ui-wrap h6 a { text-decoration: none; } .swagger-section .swagger-ui-wrap h1 a:hover, .swagger-section .swagger-ui-wrap h2 a:hover, .swagger-section .swagger-ui-wrap h3 a:hover, .swagger-section .swagger-ui-wrap h4 a:hover, .swagger-section .swagger-ui-wrap h5 a:hover, .swagger-section .swagger-ui-wrap h6 a:hover { text-decoration: underline; } .swagger-section .swagger-ui-wrap h1 span.divider, .swagger-section .swagger-ui-wrap h2 span.divider, .swagger-section .swagger-ui-wrap h3 span.divider, .swagger-section .swagger-ui-wrap h4 span.divider, .swagger-section .swagger-ui-wrap h5 span.divider, .swagger-section .swagger-ui-wrap h6 span.divider { color: #aaaaaa; } .swagger-section .swagger-ui-wrap a { color: #547f00; } .swagger-section .swagger-ui-wrap a img { border: none; } .swagger-section .swagger-ui-wrap article, .swagger-section .swagger-ui-wrap aside, .swagger-section .swagger-ui-wrap details, .swagger-section .swagger-ui-wrap figcaption, .swagger-section .swagger-ui-wrap figure, .swagger-section .swagger-ui-wrap footer, .swagger-section .swagger-ui-wrap header, .swagger-section .swagger-ui-wrap hgroup, .swagger-section .swagger-ui-wrap menu, .swagger-section .swagger-ui-wrap nav, .swagger-section .swagger-ui-wrap section, .swagger-section .swagger-ui-wrap summary { display: block; } .swagger-section .swagger-ui-wrap pre { font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace; background-color: #fcf6db; border: 1px solid #e5e0c6; padding: 10px; } .swagger-section .swagger-ui-wrap pre code { line-height: 1.6em; background: none; } .swagger-section .swagger-ui-wrap .content > .content-type > div > label { clear: both; display: block; color: #0F6AB4; font-size: 1.1em; margin: 0; padding: 15px 0 5px; } .swagger-section .swagger-ui-wrap .content pre { font-size: 12px; margin-top: 5px; padding: 5px; } .swagger-section .swagger-ui-wrap .icon-btn { cursor: pointer; } .swagger-section .swagger-ui-wrap .info_title { padding-bottom: 10px; font-weight: bold; font-size: 25px; } .swagger-section .swagger-ui-wrap .footer { margin-top: 20px; } .swagger-section .swagger-ui-wrap p.big, .swagger-section .swagger-ui-wrap div.big p { font-size: 1em; margin-bottom: 10px; } .swagger-section .swagger-ui-wrap form.fullwidth ol li.string input, .swagger-section .swagger-ui-wrap form.fullwidth ol li.url input, .swagger-section .swagger-ui-wrap form.fullwidth ol li.text textarea, .swagger-section .swagger-ui-wrap form.fullwidth ol li.numeric input { width: 500px !important; } .swagger-section .swagger-ui-wrap .info_license { padding-bottom: 5px; } .swagger-section .swagger-ui-wrap .info_tos { padding-bottom: 5px; } .swagger-section .swagger-ui-wrap .message-fail { color: #cc0000; } .swagger-section .swagger-ui-wrap .info_url { padding-bottom: 5px; } .swagger-section .swagger-ui-wrap .info_email { padding-bottom: 5px; } .swagger-section .swagger-ui-wrap .info_name { padding-bottom: 5px; } .swagger-section .swagger-ui-wrap .info_description { padding-bottom: 10px; font-size: 15px; } .swagger-section .swagger-ui-wrap .markdown ol li, .swagger-section .swagger-ui-wrap .markdown ul li { padding: 3px 0px; line-height: 1.4em; color: #333333; } .swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.string input, .swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.url input, .swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.numeric input { display: block; padding: 4px; width: auto; clear: both; } .swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.string input.title, .swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.url input.title, .swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.numeric input.title { font-size: 1.3em; } .swagger-section .swagger-ui-wrap table.fullwidth { width: 100%; } .swagger-section .swagger-ui-wrap .model-signature { font-family: "Droid Sans", sans-serif; font-size: 1em; line-height: 1.5em; } .swagger-section .swagger-ui-wrap .model-signature .signature-nav a { text-decoration: none; color: #AAA; } .swagger-section .swagger-ui-wrap .model-signature .signature-nav a:hover { text-decoration: underline; color: black; } .swagger-section .swagger-ui-wrap .model-signature .signature-nav .selected { color: black; text-decoration: none; } .swagger-section .swagger-ui-wrap .model-signature .propType { color: #5555aa; } .swagger-section .swagger-ui-wrap .model-signature pre:hover { background-color: #ffffdd; } .swagger-section .swagger-ui-wrap .model-signature pre { font-size: .85em; line-height: 1.2em; overflow: auto; max-height: 200px; cursor: pointer; } .swagger-section .swagger-ui-wrap .model-signature ul.signature-nav { display: block; min-width: 230px; margin: 0; padding: 0; } .swagger-section .swagger-ui-wrap .model-signature ul.signature-nav li:last-child { padding-right: 0; border-right: none; } .swagger-section .swagger-ui-wrap .model-signature ul.signature-nav li { float: left; margin: 0 5px 5px 0; padding: 2px 5px 2px 0; border-right: 1px solid #ddd; } .swagger-section .swagger-ui-wrap .model-signature .propOpt { color: #555; } .swagger-section .swagger-ui-wrap .model-signature .snippet small { font-size: 0.75em; } .swagger-section .swagger-ui-wrap .model-signature .propOptKey { font-style: italic; } .swagger-section .swagger-ui-wrap .model-signature .description .strong { font-weight: bold; color: #000; font-size: .9em; } .swagger-section .swagger-ui-wrap .model-signature .description div { font-size: 0.9em; line-height: 1.5em; margin-left: 1em; } .swagger-section .swagger-ui-wrap .model-signature .description .stronger { font-weight: bold; color: #000; } .swagger-section .swagger-ui-wrap .model-signature .description .propWrap .optionsWrapper { border-spacing: 0; position: absolute; background-color: #ffffff; border: 1px solid #bbbbbb; display: none; font-size: 11px; max-width: 400px; line-height: 30px; color: black; padding: 5px; margin-left: 10px; } .swagger-section .swagger-ui-wrap .model-signature .description .propWrap .optionsWrapper th { text-align: center; background-color: #eeeeee; border: 1px solid #bbbbbb; font-size: 11px; color: #666666; font-weight: bold; padding: 5px; line-height: 15px; } .swagger-section .swagger-ui-wrap .model-signature .description .propWrap .optionsWrapper .optionName { font-weight: bold; } .swagger-section .swagger-ui-wrap .model-signature .description .propDesc.markdown > p:first-child, .swagger-section .swagger-ui-wrap .model-signature .description .propDesc.markdown > p:last-child { display: inline; } .swagger-section .swagger-ui-wrap .model-signature .description .propDesc.markdown > p:not(:first-child):before { display: block; content: ''; } .swagger-section .swagger-ui-wrap .model-signature .description span:last-of-type.propDesc.markdown > p:only-child { margin-right: -3px; } .swagger-section .swagger-ui-wrap .model-signature .propName { font-weight: bold; } .swagger-section .swagger-ui-wrap .model-signature .signature-container { clear: both; } .swagger-section .swagger-ui-wrap .body-textarea { width: 300px; height: 100px; border: 1px solid #aaa; } .swagger-section .swagger-ui-wrap .markdown p code, .swagger-section .swagger-ui-wrap .markdown li code { font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace; background-color: #f0f0f0; color: black; padding: 1px 3px; } .swagger-section .swagger-ui-wrap .required { font-weight: bold; } .swagger-section .swagger-ui-wrap .editor_holder { font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace; font-size: 0.9em; } .swagger-section .swagger-ui-wrap .editor_holder label { font-weight: normal!important; /* JSONEditor uses bold by default for all labels, we revert that back to normal to not give the impression that by default fields are required */ } .swagger-section .swagger-ui-wrap .editor_holder label.required { font-weight: bold!important; } .swagger-section .swagger-ui-wrap input.parameter { width: 300px; border: 1px solid #aaa; } .swagger-section .swagger-ui-wrap h1 { color: black; font-size: 1.5em; line-height: 1.3em; padding: 10px 0 10px 0; font-family: "Droid Sans", sans-serif; font-weight: bold; } .swagger-section .swagger-ui-wrap .heading_with_menu { float: none; clear: both; overflow: hidden; display: block; } .swagger-section .swagger-ui-wrap .heading_with_menu ul { display: block; clear: none; float: right; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; -ms-box-sizing: border-box; box-sizing: border-box; margin-top: 10px; } .swagger-section .swagger-ui-wrap h2 { color: black; font-size: 1.3em; padding: 10px 0 10px 0; } .swagger-section .swagger-ui-wrap h2 a { color: black; } .swagger-section .swagger-ui-wrap h2 span.sub { font-size: 0.7em; color: #999999; font-style: italic; } .swagger-section .swagger-ui-wrap h2 span.sub a { color: #777777; } .swagger-section .swagger-ui-wrap span.weak { color: #666666; } .swagger-section .swagger-ui-wrap .message-success { color: #89BF04; } .swagger-section .swagger-ui-wrap caption, .swagger-section .swagger-ui-wrap th, .swagger-section .swagger-ui-wrap td { text-align: left; font-weight: normal; vertical-align: middle; } .swagger-section .swagger-ui-wrap .code { font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace; } .swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.text textarea { font-family: "Droid Sans", sans-serif; height: 250px; padding: 4px; display: block; clear: both; } .swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.select select { display: block; clear: both; } .swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.boolean { float: none; clear: both; overflow: hidden; display: block; } .swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.boolean label { display: block; float: left; clear: none; margin: 0; padding: 0; } .swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.boolean input { display: block; float: left; clear: none; margin: 0 5px 0 0; } .swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.required label { color: black; } .swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li label { display: block; clear: both; width: auto; padding: 0 0 3px; color: #666666; } .swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li label abbr { padding-left: 3px; color: #888888; } .swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li p.inline-hints { margin-left: 0; font-style: italic; font-size: 0.9em; margin: 0; } .swagger-section .swagger-ui-wrap form.formtastic fieldset.buttons { margin: 0; padding: 0; } .swagger-section .swagger-ui-wrap span.blank, .swagger-section .swagger-ui-wrap span.empty { color: #888888; font-style: italic; } .swagger-section .swagger-ui-wrap .markdown h3 { color: #547f00; } .swagger-section .swagger-ui-wrap .markdown h4 { color: #666666; } .swagger-section .swagger-ui-wrap .markdown pre { font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace; background-color: #fcf6db; border: 1px solid #e5e0c6; padding: 10px; margin: 0 0 10px 0; } .swagger-section .swagger-ui-wrap .markdown pre code { line-height: 1.6em; } .swagger-section .swagger-ui-wrap div.gist { margin: 20px 0 25px 0 !important; } .swagger-section .swagger-ui-wrap ul#resources { font-family: "Droid Sans", sans-serif; font-size: 0.9em; } .swagger-section .swagger-ui-wrap ul#resources li.resource { border-bottom: 1px solid #dddddd; } .swagger-section .swagger-ui-wrap ul#resources li.resource:hover div.heading h2 a, .swagger-section .swagger-ui-wrap ul#resources li.resource.active div.heading h2 a { color: black; } .swagger-section .swagger-ui-wrap ul#resources li.resource:hover div.heading ul.options li a, .swagger-section .swagger-ui-wrap ul#resources li.resource.active div.heading ul.options li a { color: #555555; } .swagger-section .swagger-ui-wrap ul#resources li.resource:last-child { border-bottom: none; } .swagger-section .swagger-ui-wrap ul#resources li.resource div.heading { border: 1px solid transparent; float: none; clear: both; overflow: hidden; display: block; } .swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options { overflow: hidden; padding: 0; display: block; clear: none; float: right; margin: 14px 10px 0 0; } .swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li { float: left; clear: none; margin: 0; padding: 2px 10px; border-right: 1px solid #dddddd; color: #666666; font-size: 0.9em; } .swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li a { color: #aaaaaa; text-decoration: none; } .swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li a:hover { text-decoration: underline; color: black; } .swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li a:hover, .swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li a:active, .swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li a.active { text-decoration: underline; } .swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li:first-child, .swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li.first { padding-left: 0; } .swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li:last-child, .swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li.last { padding-right: 0; border-right: none; } .swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options:first-child, .swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options.first { padding-left: 0; } .swagger-section .swagger-ui-wrap ul#resources li.resource div.heading h2 { color: #999999; padding-left: 0; display: block; clear: none; float: left; font-family: "Droid Sans", sans-serif; font-weight: bold; } .swagger-section .swagger-ui-wrap ul#resources li.resource div.heading h2 a { color: #999999; } .swagger-section .swagger-ui-wrap ul#resources li.resource div.heading h2 a:hover { color: black; } .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation { float: none; clear: both; overflow: hidden; display: block; margin: 0 0 10px; padding: 0; } .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading { float: none; clear: both; overflow: hidden; display: block; margin: 0; padding: 0; } .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 { display: block; clear: none; float: left; width: auto; margin: 0; padding: 0; line-height: 1.1em; color: black; } .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span.path { padding-left: 10px; } .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span.path a { color: black; text-decoration: none; } .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span.path a.toggleOperation.deprecated { text-decoration: line-through; } .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span.path a:hover { text-decoration: underline; } .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span.http_method a { text-transform: uppercase; text-decoration: none; color: white; display: inline-block; width: 50px; font-size: 0.7em; text-align: center; padding: 7px 0 4px; -moz-border-radius: 2px; -webkit-border-radius: 2px; -o-border-radius: 2px; -ms-border-radius: 2px; -khtml-border-radius: 2px; border-radius: 2px; } .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span { margin: 0; padding: 0; } .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading ul.options { overflow: hidden; padding: 0; display: block; clear: none; float: right; margin: 6px 10px 0 0; } .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading ul.options li { float: left; clear: none; margin: 0; padding: 2px 10px; font-size: 0.9em; } .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading ul.options li a { text-decoration: none; } .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading ul.options li.access { color: black; } .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content { border-top: none; padding: 10px; -moz-border-radius-bottomleft: 6px; -webkit-border-bottom-left-radius: 6px; -o-border-bottom-left-radius: 6px; -ms-border-bottom-left-radius: 6px; -khtml-border-bottom-left-radius: 6px; border-bottom-left-radius: 6px; -moz-border-radius-bottomright: 6px; -webkit-border-bottom-right-radius: 6px; -o-border-bottom-right-radius: 6px; -ms-border-bottom-right-radius: 6px; -khtml-border-bottom-right-radius: 6px; border-bottom-right-radius: 6px; margin: 0 0 20px; } .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content h4 { font-size: 1.1em; margin: 0; padding: 15px 0 5px; } .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.sandbox_header { float: none; clear: both; overflow: hidden; display: block; } .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.sandbox_header a { padding: 4px 0 0 10px; display: inline-block; font-size: 0.9em; } .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.sandbox_header input.submit { display: block; clear: none; float: left; padding: 6px 8px; } .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.sandbox_header span.response_throbber { background-image: url('../../img/api/throbber.gif'); width: 128px; height: 16px; display: block; clear: none; float: right; } .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content form input[type='text'].error { outline: 2px solid black; outline-color: #cc0000; } .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content form select[name='parameterContentType'] { max-width: 300px; } .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.response div.block pre { font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace; padding: 10px; font-size: 0.9em; max-height: 400px; overflow-y: auto; } .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading { background-color: #f9f2e9; border: 1px solid #f0e0ca; } .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading h3 span.http_method a { background-color: #c5862b; } .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options li { border-right: 1px solid #dddddd; border-right-color: #f0e0ca; color: #c5862b; } .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options li a { color: #c5862b; } .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.content { background-color: #faf5ee; border: 1px solid #f0e0ca; } .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.content h4 { color: #c5862b; } .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.content div.sandbox_header a { color: #dcb67f; } .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading { background-color: #fcffcd; border: 1px solid black; border-color: #ffd20f; } .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading h3 span.http_method a { text-transform: uppercase; background-color: #ffd20f; } .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading ul.options li { border-right: 1px solid #dddddd; border-right-color: #ffd20f; color: #ffd20f; } .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading ul.options li a { color: #ffd20f; } .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.content { background-color: #fcffcd; border: 1px solid black; border-color: #ffd20f; } .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.content h4 { color: #ffd20f; } .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.content div.sandbox_header a { color: #6fc992; } .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading { background-color: #f5e8e8; border: 1px solid #e8c6c7; } .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading h3 span.http_method a { text-transform: uppercase; background-color: #a41e22; } .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options li { border-right: 1px solid #dddddd; border-right-color: #e8c6c7; color: #a41e22; } .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options li a { color: #a41e22; } .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.content { background-color: #f7eded; border: 1px solid #e8c6c7; } .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.content h4 { color: #a41e22; } .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.content div.sandbox_header a { color: #c8787a; } .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading { background-color: #e7f6ec; border: 1px solid #c3e8d1; } .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading h3 span.http_method a { background-color: #10a54a; } .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options li { border-right: 1px solid #dddddd; border-right-color: #c3e8d1; color: #10a54a; } .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options li a { color: #10a54a; } .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.content { background-color: #ebf7f0; border: 1px solid #c3e8d1; } .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.content h4 { color: #10a54a; } .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.content div.sandbox_header a { color: #6fc992; } .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading { background-color: #FCE9E3; border: 1px solid #F5D5C3; } .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading h3 span.http_method a { background-color: #D38042; } .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options li { border-right: 1px solid #dddddd; border-right-color: #f0cecb; color: #D38042; } .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options li a { color: #D38042; } .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.content { background-color: #faf0ef; border: 1px solid #f0cecb; } .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.content h4 { color: #D38042; } .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.content div.sandbox_header a { color: #dcb67f; } .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading { background-color: #e7f0f7; border: 1px solid #c3d9ec; } .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading h3 span.http_method a { background-color: #0f6ab4; } .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options li { border-right: 1px solid #dddddd; border-right-color: #c3d9ec; color: #0f6ab4; } .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options li a { color: #0f6ab4; } .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content { background-color: #ebf3f9; border: 1px solid #c3d9ec; } .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content h4 { color: #0f6ab4; } .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content div.sandbox_header a { color: #6fa5d2; } .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.heading { background-color: #e7f0f7; border: 1px solid #c3d9ec; } .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.heading h3 span.http_method a { background-color: #0f6ab4; } .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.heading ul.options li { border-right: 1px solid #dddddd; border-right-color: #c3d9ec; color: #0f6ab4; } .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.heading ul.options li a { color: #0f6ab4; } .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.content { background-color: #ebf3f9; border: 1px solid #c3d9ec; } .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.content h4 { color: #0f6ab4; } .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.content div.sandbox_header a { color: #6fa5d2; } .swagger-ui-wrap li.topic span.http_method a{ background-color: #cc2a84; } .swagger-ui-wrap li.topic div.heading { background-color: #ffe8e8; border-color: #ffcbd4; } #swagger-ui-socket-container { margin-top: 30px; } .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content, .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.content, .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.content, .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.content, .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.content, .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.content { border-top: none; } .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options li:last-child, .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options li:last-child, .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading ul.options li:last-child, .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options li:last-child, .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options li:last-child, .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options li:last-child, .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options li.last, .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options li.last, .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading ul.options li.last, .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options li.last, .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options li.last, .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options li.last { padding-right: 0; border-right: none; } .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li a:hover, .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li a:active, .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li a.active { text-decoration: underline; } .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li:first-child, .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li.first { padding-left: 0; } .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations:first-child, .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations.first { padding-left: 0; } .swagger-section .swagger-ui-wrap p#colophon { margin: 0 15px 40px 15px; padding: 10px 0; font-size: 0.8em; border-top: 1px solid #dddddd; font-family: "Droid Sans", sans-serif; color: #999999; font-style: italic; } .swagger-section .swagger-ui-wrap p#colophon a { text-decoration: none; color: #547f00; } .swagger-section .swagger-ui-wrap h3 { color: black; font-size: 1.1em; padding: 10px 0 10px 0; } .swagger-section .swagger-ui-wrap .markdown ol, .swagger-section .swagger-ui-wrap .markdown ul { font-family: "Droid Sans", sans-serif; margin: 5px 0 10px; padding: 0 0 0 18px; list-style-type: disc; } .swagger-section .swagger-ui-wrap form.form_box { background-color: #ebf3f9; border: 1px solid #c3d9ec; padding: 10px; } .swagger-section .swagger-ui-wrap form.form_box label { color: #0f6ab4 !important; } .swagger-section .swagger-ui-wrap form.form_box input[type=submit] { display: block; padding: 10px; } .swagger-section .swagger-ui-wrap form.form_box p.weak { font-size: 0.8em; } .swagger-section .swagger-ui-wrap form.form_box p { font-size: 0.9em; padding: 0 0 15px; color: #7e7b6d; } .swagger-section .swagger-ui-wrap form.form_box p a { color: #646257; } .swagger-section .swagger-ui-wrap form.form_box p strong { color: black; } .swagger-section .swagger-ui-wrap .operation-status td.markdown > p:last-child { padding-bottom: 0; } .swagger-section .title { font-style: bold; } .swagger-section .secondary_form { display: none; } .swagger-section .main_image { display: block; margin-left: auto; margin-right: auto; } .swagger-section .oauth_body { margin-left: 100px; margin-right: 100px; } .swagger-section .oauth_submit { text-align: center; } .swagger-section .api-popup-dialog { z-index: 10000; position: absolute; width: 500px; background: #FFF; padding: 20px; border: 1px solid #ccc; border-radius: 5px; display: none; font-size: 13px; color: #777; } .swagger-section .api-popup-dialog .api-popup-title { font-size: 24px; padding: 10px 0; } .swagger-section .api-popup-dialog .api-popup-title { font-size: 24px; padding: 10px 0; } .swagger-section .api-popup-dialog .error-msg { padding-left: 5px; padding-bottom: 5px; } .swagger-section .api-popup-dialog .api-popup-authbtn { height: 30px; } .swagger-section .api-popup-dialog .api-popup-cancel { height: 30px; } .swagger-section .api-popup-scopes { padding: 10px 20px; } .swagger-section .api-popup-scopes li { padding: 5px 0; line-height: 20px; } .swagger-section .api-popup-scopes li input { position: relative; top: 2px; } .swagger-section .api-popup-scopes .api-scope-desc { padding-left: 20px; font-style: italic; } .swagger-section .api-popup-actions { padding-top: 10px; } .swagger-section .access { float: right; } .swagger-section .auth { float: right; } .swagger-section .api-ic { height: 18px; vertical-align: middle; display: inline-block; background: url(../../img/api/explorer_icons.png) no-repeat; } .swagger-section .api-ic .api_information_panel { position: relative; margin-top: 20px; margin-left: -5px; background: #FFF; border: 1px solid #ccc; border-radius: 5px; display: none; font-size: 13px; max-width: 300px; line-height: 30px; color: black; padding: 5px; } .swagger-section .api-ic .api_information_panel p .api-msg-enabled { color: green; } .swagger-section .api-ic .api_information_panel p .api-msg-disabled { color: red; } .swagger-section .api-ic:hover .api_information_panel { position: absolute; display: block; } .swagger-section .ic-info { background-position: 0 0; width: 18px; margin-top: -6px; margin-left: 4px; } .swagger-section .ic-warning { background-position: -60px 0; width: 18px; margin-top: -6px; margin-left: 4px; } .swagger-section .ic-error { background-position: -30px 0; width: 18px; margin-top: -6px; margin-left: 4px; } .swagger-section .ic-off { background-position: -90px 0; width: 58px; margin-top: -4px; cursor: pointer; } .swagger-section .ic-on { background-position: -160px 0; width: 58px; margin-top: -4px; cursor: pointer; } .swagger-section #header { background-color: #89bf04; padding: 14px; } .swagger-section #input_baseUrl { width: 400px; } .swagger-section #api_selector { display: block; clear: none; float: right; } .swagger-section #api_selector .input { display: block; clear: none; float: left; margin: 0 10px 0 0; } .swagger-section #api_selector input { font-size: 0.9em; padding: 3px; margin: 0; } .swagger-section #input_apiKey { width: 200px; } .swagger-section #explore { display: block; text-decoration: none; font-weight: bold; padding: 6px 8px; font-size: 0.9em; color: white; background-color: #547f00; -moz-border-radius: 4px; -webkit-border-radius: 4px; -o-border-radius: 4px; -ms-border-radius: 4px; -khtml-border-radius: 4px; border-radius: 4px; } .swagger-section #explore:hover { background-color: #547f00; } .swagger-section #header #logo { font-size: 1.5em; font-weight: bold; text-decoration: none; background: transparent url(../../img/api/logo_small.png) no-repeat left center; padding: 20px 0 20px 40px; color: white; } .swagger-section #content_message { margin: 10px 15px; font-style: italic; color: #999999; } .swagger-section #message-bar { min-height: 30px; text-align: center; padding-top: 10px; } .swagger-section .swagger-collapse:before { content: "-"; } .swagger-section .swagger-expand:before { content: "+"; }
apache-2.0
wilebeast/FireFox-OS
B2G/gecko/layout/reftests/bugs/9458-valign-1.html
1289
<!DOCTYPE html> <html> <head> <title>CSS 2.1 Test Suite: Test for vertical alignment on inline-block</title> <link rel="author" title="L. David Baron" href="http://dbaron.org/" /> <link rel="author" title="Mozilla Corporation" href="http://mozilla.com/" /> <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#display-prop" /> <meta name="assert" content="This value causes an element to generate a block box, which itself is flowed as a single inline box, similar to a replaced element. The inside of an inline-block is formatted as a block box, and the element itself is formatted as an inline replaced element." /> <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#leading" /> <meta name="assert" content="The baseline of an 'inline-block' is the baseline of its last line box in the normal flow, unless it has either no in-flow line boxes or if its 'overflow' property has a computed value other than 'visible', in which case the baseline is the bottom margin edge." /> <meta name="flags" content="" /> <style type="text/css"> span { display: inline-block; } span > span { display: block; visibility: hidden; } </style> </head> <body> <table border height="200"><tr><td valign="bottom"> <p>a<span><span>x</span>bcd</span>e</p> </td></tr></table> </body> </html>
apache-2.0
apache/xalan-c
src/xalanc/XercesParserLiaison/Deprecated/XercesBridgeHelper.cpp
4549
/* * 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. */ #if defined(XALAN_BUILD_DEPRECATED_DOM_BRIDGE) #include "XercesBridgeHelper.hpp" #if XERCES_VERSION_MAJOR >= 2 #include <xercesc/dom/deprecated/DOM_CharacterData.hpp> #else #include <xercesc/dom/DOM_CharacterData.hpp> #endif #include <xalanc/XercesParserLiaison/XercesDOMException.hpp> namespace XALAN_CPP_NAMESPACE { void XercesBridgeHelper::setNodeValue( DOM_NodeType& theXercesNode, const XalanDOMString& nodeValue) { try { theXercesNode.setNodeValue(XalanDOMStringToXercesDOMString(nodeValue)); } catch(const DOM_DOMExceptionType& theException) { throw XercesDOMException(theException); } } void XercesBridgeHelper::normalize(DOM_NodeType& theXercesNode) { try { theXercesNode.normalize(); } catch(const DOM_DOMExceptionType& theException) { throw XercesDOMException(theException); } } bool XercesBridgeHelper::isSupported( const DOM_NodeType& theXercesNode, const XalanDOMString& feature, const XalanDOMString& version) { return theXercesNode.isSupported( XalanDOMStringToXercesDOMString(feature), XalanDOMStringToXercesDOMString(version)); } void XercesBridgeHelper::setPrefix( DOM_NodeType& theXercesNode, const XalanDOMString& prefix) { try { theXercesNode.setPrefix(XalanDOMStringToXercesDOMString(prefix)); } catch(const DOM_DOMExceptionType& theException) { throw XercesDOMException(theException); } } const XalanDOMString XercesBridgeHelper::substringData( const DOM_CharacterDataType& theXercesNode, unsigned int offset, unsigned int count) { try { const DOMStringType theString(theXercesNode.substringData(offset, count)); return XalanDOMString(theString.rawBuffer(), theString.length()); } catch(const DOM_DOMExceptionType& theException) { throw XercesDOMException(theException); } } void XercesBridgeHelper::appendData( DOM_CharacterDataType& theXercesNode, const XalanDOMString& arg) { try { theXercesNode.appendData(XalanDOMStringToXercesDOMString(arg)); } catch(const DOM_DOMExceptionType& theException) { throw XercesDOMException(theException); } } void XercesBridgeHelper::insertData( DOM_CharacterDataType& theXercesNode, unsigned int offset, const XalanDOMString& arg) { try { theXercesNode.insertData(offset, XalanDOMStringToXercesDOMString(arg)); } catch(const DOM_DOMExceptionType& theException) { throw XercesDOMException(theException); } } void XercesBridgeHelper::deleteData( DOM_CharacterDataType& theXercesNode, unsigned int offset, unsigned int count) { try { theXercesNode.deleteData(offset, count); } catch(const DOM_DOMExceptionType& theException) { throw XercesDOMException(theException); } } void XercesBridgeHelper::replaceData( DOM_CharacterDataType& theXercesNode, unsigned int offset, unsigned int count, const XalanDOMString& arg) { try { theXercesNode.replaceData(offset, count, XalanDOMStringToXercesDOMString(arg)); } catch(const DOM_DOMExceptionType& theException) { throw XercesDOMException(theException); } } } #endif //XALAN_BUILD_DEPRECATED_DOM_BRIDGE
apache-2.0
cedral/aws-sdk-cpp
aws-cpp-sdk-ds/source/model/UpdateConditionalForwarderRequest.cpp
2001
/* * Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ #include <aws/ds/model/UpdateConditionalForwarderRequest.h> #include <aws/core/utils/json/JsonSerializer.h> #include <utility> using namespace Aws::DirectoryService::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; UpdateConditionalForwarderRequest::UpdateConditionalForwarderRequest() : m_directoryIdHasBeenSet(false), m_remoteDomainNameHasBeenSet(false), m_dnsIpAddrsHasBeenSet(false) { } Aws::String UpdateConditionalForwarderRequest::SerializePayload() const { JsonValue payload; if(m_directoryIdHasBeenSet) { payload.WithString("DirectoryId", m_directoryId); } if(m_remoteDomainNameHasBeenSet) { payload.WithString("RemoteDomainName", m_remoteDomainName); } if(m_dnsIpAddrsHasBeenSet) { Array<JsonValue> dnsIpAddrsJsonList(m_dnsIpAddrs.size()); for(unsigned dnsIpAddrsIndex = 0; dnsIpAddrsIndex < dnsIpAddrsJsonList.GetLength(); ++dnsIpAddrsIndex) { dnsIpAddrsJsonList[dnsIpAddrsIndex].AsString(m_dnsIpAddrs[dnsIpAddrsIndex]); } payload.WithArray("DnsIpAddrs", std::move(dnsIpAddrsJsonList)); } return payload.View().WriteReadable(); } Aws::Http::HeaderValueCollection UpdateConditionalForwarderRequest::GetRequestSpecificHeaders() const { Aws::Http::HeaderValueCollection headers; headers.insert(Aws::Http::HeaderValuePair("X-Amz-Target", "DirectoryService_20150416.UpdateConditionalForwarder")); return headers; }
apache-2.0
opentrv/OpenTRV-Arduino-V0p2
Arduino/snapshots/20141111-r3586-V0p2-Arduino-REV2-code-snapshot-for-install/V0p2_Main/V0p2_Generic_Config.h
7058
/* The OpenTRV project licenses this file to you under the Apache Licence, Version 2.0 (the "Licence"); you may not use this file except in compliance with the Licence. You may obtain a copy of the Licence at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the Licence is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the Licence for the specific language governing permissions and limitations under the Licence. Author(s) / Copyright (s): Damon Hart-Davis 2013--2014 */ /* TRV (and boiler-node) global configuration parameters for V0.2 PCB hardware. The top part should contain one #define CONFIG_... and nothing else (uncommented). */ #ifndef V0P2_GENERIC_CONFIG_H #define V0P2_GENERIC_CONFIG_H // Define/uncomment exactly one of the CONFIG_XXX labels to enable a configuration set below. // Some can be specific to particular locations and boards, // others can be vanilla ready to be configured by the end-user one way or another. //#define CONFIG_GENERIC_ROOM_NODE //#define CONFIG_GENERIC_BOILER_NODE //#define CONFIG_GENERIC_RANDB_NODE //#define CONFIG_GENERIC_DHW_NODE // Some specific/example configs. //#define CONFIG_DHD_TESTLAB_REV0 // REV0 //#define CONFIG_Trial2013Winter_Round1 // REV1 //#define CONFIG_BH_DHW // Bo's hot water. //#define CONFIG_BH_TESTLAB #define CONFIG_Trial2013Winter_Round2 // REV2 cut4 //#define CONFIG_DHD_TESTLAB_REV4 // REV4 // ------------------------------------------------------ // PRE-DEFINED CONFIG_... BUNDLE IMPLEMENTATION/EXPANSION // Defaults for V0.2; have to be undefined if not required. //#define HALF_SECOND_RTC_SUPPORT // Wake at 2Hz for accurate 0.5-second timing for some possible extra power draw. #define SUPPLY_VOLTAGE_LOW_2AA // May require limiting clock speed and using some alternative peripherals/sensors. #define USE_RTC_INTERNAL_SIMPLE // Provide software RTC support by default. // ------------------------- #ifdef CONFIG_DHD_TESTLAB_REV0 // DHD's test lab with TRV. // Revision of V0.2 board. #define V0p2_REV 0 // REV0 covers DHD's breadboard and first V0.2 PCB. // Enable use of SHT21 RH and temp sensor. //#define SENSOR_SHT21_ENABLE // Using RoHS-compliant phototransistor in place of LDR. #define AMBIENT_LIGHT_SENSOR_PHOTOTRANS_TEPT4400 // Anticipation logic not yet ready for prime-time. //#define ENABLE_ANTICIPATION // Enable experimental voice detection. #define ENABLE_VOICE_SENSOR // Use common settings. #define COMMON_SETTINGS #endif // ------------------------- #ifdef CONFIG_DHD_TESTLAB_REV4 // DHD's test lab with TRV on REV4 board. // Revision of V0.2 board. #define V0p2_REV 4 // REV0 covers DHD's breadboard and first V0.2 PCB. // Using RoHS-compliant phototransistor in place of LDR. #define AMBIENT_LIGHT_SENSOR_PHOTOTRANS_TEPT4400 // Anticipation logic not yet ready for prime-time. //#define ENABLE_ANTICIPATION // Use common settings. #define COMMON_SETTINGS #endif // ------------------------- #ifdef CONFIG_BH_TESTLAB // BH's test lab with TRV. // Revision of V0.2 board. #define V0p2_REV 1 // Use common settings. #define COMMON_SETTINGS #endif // ------------------------- #ifdef CONFIG_Trial2013Winter_Round1 // For trial over winter of 2013--4, first round (REV1). // Revision REV1 of V0.2 board. #define V0p2_REV 1 // TODO-264 - Find out why IDLE seems to crash some REV1 boards. #define DISABLE_AVR_IDLE_MODE // Use common settings. #define COMMON_SETTINGS #endif #ifdef CONFIG_Trial2013Winter_Round2 // For trial over winter of 2013--4, second round (REV2). // Revision REV2 (cut4+) of V0.2 board. #define V0p2_REV 2 // IF DEFINED: allow for less light on sideways-pointing LDR on cut4 2014/03/17 REV2 boards (TODO-209). #define LDR_EXTRA_SENSITIVE // Use common settings. #define COMMON_SETTINGS #endif // ------------------------- // -------------------------------------------- // CONSEQUENTIAL DEFINITIONS ARISING FROM ABOVE // (Don't fiddle with these unless you are sure of module dependencies, etc!) #ifdef COMMON_SETTINGS // FOR REV0 and REV1. #if (V0p2_REV >= 1) && (V0p2_REV <= 4) // && !defined(CONFIG_DHD_TESTLAB_REV2) // All REV 1--4 PCBs use RFM23B. // IF DEFINED: RFM23 is in use in place of RFM22. #define RFM22_IS_ACTUALLY_RFM23 // Note: RFM23 used on V0.2 PCB. #endif #ifdef RFM22_IS_ACTUALLY_RFM23 // Note: All RFM23s on PCBs with good ground place. // IF DEFINED: good RF environment means that TX power level can be reduced. #define RFM22_GOOD_RF_ENV // Good ground-plane and antenna on V0.2 PCB: drop TX level. #endif // Anticipation logic not yet ready for prime-time. //#define ENABLE_ANTICIPATION // IF DEFINED: this unit supports CLI over the USB/serial connection, eg for run-time reconfig. #define SUPPORT_CLI // IF DEFINED: this unit supports BAKE mode. #define SUPPORT_BAKE // IF DEFINED: this unit may run on 2xAA cells, preferably rechargeable eg NiMH, ~2V--2.4V, and should monitor supply voltage. #define SUPPLY_VOLTAGE_LOW_2AA // May require limiting clock speed and using some alternative peripherals/sensors... // IF DEFINED: this unit can act as boiler-control hub listening to remote thermostats, possibly in addition to controlling a local TRV. #define ENABLE_BOILER_HUB // IF DEFINED: this unit will act as a thermostat controlling a local TRV (and calling for heat from the boiler). #define LOCAL_TRV // IF DEFINED: basic FROST/WARM temperatures are settable. #define SETTABLE_TARGET_TEMPERATURES // IF DEFINED: use FHT8V wireless radio module/valve. #define USE_MODULE_FHT8VSIMPLE // IF DEFINED: use simple LDR-based detection of room use/occupancy; brings in getRoomInUseFromLDR subroutine. #define USE_MODULE_LDROCCUPANCYDETECTION // If LDR is not to be used then specifically define OMIT_... as below. //#define OMIT_MODULE_LDROCCUPANCYDETECTION ; LDR 'occupancy' sensing irrelevant for DHW. // IF DEFINED: support for general timed and multi-input occupancy detection / use. #define OCCUPANCY_SUPPORT // IF DEFINED: use software RTC. #define USE_RTC_INTERNAL_SIMPLE // Provide software RTC support by default. // IF DEFINED: use active-low LEARN button(s). Needs SUPPORT_SINGLETON_SCHEDULE. #define LEARN_BUTTON_AVAILABLE // OPTIONAL ON V0.09 PCB1 // IF DEFINED: support one on and one off time per day (possibly in conjunction with 'learn' button). #define SUPPORT_SINGLETON_SCHEDULE // IF DEFINED: support temperature TX, eg traling stats message after FHT8V payload. #define SUPPORT_TEMP_TX #endif // If LEARN_BUTTON_AVAILABLE then in the absence of anything better SUPPORT_SINGLETON_SCHEDULE should be supported. #ifdef LEARN_BUTTON_AVAILABLE #ifndef SUPPORT_SINGLETON_SCHEDULE #define SUPPORT_SINGLETON_SCHEDULE #endif #endif // By default, use the RFM22/RFM23 module to talk to an FHT8V wireless radiator valve. #ifdef USE_MODULE_FHT8VSIMPLE #define USE_MODULE_RFM22RADIOSIMPLE // If this can be a hub, enable extra RX code. #ifdef ENABLE_BOILER_HUB #define USE_MODULE_FHT8VSIMPLE_RX #endif #endif #endif
apache-2.0
atomix/atomix
utils/src/main/java/io/atomix/utils/logging/DelegatingLogger.java
7703
/* * Copyright 2017-present Open Networking Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package io.atomix.utils.logging; import org.slf4j.Logger; import org.slf4j.Marker; import static com.google.common.base.MoreObjects.toStringHelper; /** * Delegating logger. */ public class DelegatingLogger implements Logger { private final Logger delegate; public DelegatingLogger(Logger delegate) { this.delegate = delegate; } @Override public String getName() { return delegate.getName(); } @Override public boolean isTraceEnabled() { return delegate.isTraceEnabled(); } @Override public void trace(String msg) { delegate.trace(msg); } @Override public void trace(String format, Object arg) { delegate.trace(format, arg); } @Override public void trace(String format, Object arg1, Object arg2) { delegate.trace(format, arg1, arg2); } @Override public void trace(String format, Object... arguments) { delegate.trace(format, arguments); } @Override public void trace(String msg, Throwable t) { delegate.trace(msg, t); } @Override public boolean isTraceEnabled(Marker marker) { return delegate.isTraceEnabled(marker); } @Override public void trace(Marker marker, String msg) { delegate.trace(marker, msg); } @Override public void trace(Marker marker, String format, Object arg) { delegate.trace(marker, format, arg); } @Override public void trace(Marker marker, String format, Object arg1, Object arg2) { delegate.trace(marker, format, arg1, arg2); } @Override public void trace(Marker marker, String format, Object... argArray) { delegate.trace(marker, format, argArray); } @Override public void trace(Marker marker, String msg, Throwable t) { delegate.trace(marker, msg, t); } @Override public boolean isDebugEnabled() { return delegate.isDebugEnabled(); } @Override public void debug(String msg) { delegate.debug(msg); } @Override public void debug(String format, Object arg) { delegate.debug(format, arg); } @Override public void debug(String format, Object arg1, Object arg2) { delegate.debug(format, arg1, arg2); } @Override public void debug(String format, Object... arguments) { delegate.debug(format, arguments); } @Override public void debug(String msg, Throwable t) { delegate.debug(msg, t); } @Override public boolean isDebugEnabled(Marker marker) { return delegate.isDebugEnabled(marker); } @Override public void debug(Marker marker, String msg) { delegate.debug(marker, msg); } @Override public void debug(Marker marker, String format, Object arg) { delegate.debug(marker, format, arg); } @Override public void debug(Marker marker, String format, Object arg1, Object arg2) { delegate.debug(marker, format, arg1, arg2); } @Override public void debug(Marker marker, String format, Object... arguments) { delegate.debug(marker, format, arguments); } @Override public void debug(Marker marker, String msg, Throwable t) { delegate.debug(marker, msg, t); } @Override public boolean isInfoEnabled() { return delegate.isInfoEnabled(); } @Override public void info(String msg) { delegate.info(msg); } @Override public void info(String format, Object arg) { delegate.info(format, arg); } @Override public void info(String format, Object arg1, Object arg2) { delegate.info(format, arg1, arg2); } @Override public void info(String format, Object... arguments) { delegate.info(format, arguments); } @Override public void info(String msg, Throwable t) { delegate.info(msg, t); } @Override public boolean isInfoEnabled(Marker marker) { return delegate.isInfoEnabled(marker); } @Override public void info(Marker marker, String msg) { delegate.info(marker, msg); } @Override public void info(Marker marker, String format, Object arg) { delegate.info(marker, format, arg); } @Override public void info(Marker marker, String format, Object arg1, Object arg2) { delegate.info(marker, format, arg1, arg2); } @Override public void info(Marker marker, String format, Object... arguments) { delegate.info(marker, format, arguments); } @Override public void info(Marker marker, String msg, Throwable t) { delegate.info(marker, msg, t); } @Override public boolean isWarnEnabled() { return delegate.isWarnEnabled(); } @Override public void warn(String msg) { delegate.warn(msg); } @Override public void warn(String format, Object arg) { delegate.warn(format, arg); } @Override public void warn(String format, Object... arguments) { delegate.warn(format, arguments); } @Override public void warn(String format, Object arg1, Object arg2) { delegate.warn(format, arg1, arg2); } @Override public void warn(String msg, Throwable t) { delegate.warn(msg, t); } @Override public boolean isWarnEnabled(Marker marker) { return delegate.isWarnEnabled(marker); } @Override public void warn(Marker marker, String msg) { delegate.warn(marker, msg); } @Override public void warn(Marker marker, String format, Object arg) { delegate.warn(marker, format, arg); } @Override public void warn(Marker marker, String format, Object arg1, Object arg2) { delegate.warn(marker, format, arg1, arg2); } @Override public void warn(Marker marker, String format, Object... arguments) { delegate.warn(marker, format, arguments); } @Override public void warn(Marker marker, String msg, Throwable t) { delegate.warn(marker, msg, t); } @Override public boolean isErrorEnabled() { return delegate.isErrorEnabled(); } @Override public void error(String msg) { delegate.error(msg); } @Override public void error(String format, Object arg) { delegate.error(format, arg); } @Override public void error(String format, Object arg1, Object arg2) { delegate.error(format, arg1, arg2); } @Override public void error(String format, Object... arguments) { delegate.error(format, arguments); } @Override public void error(String msg, Throwable t) { delegate.error(msg, t); } @Override public boolean isErrorEnabled(Marker marker) { return delegate.isErrorEnabled(marker); } @Override public void error(Marker marker, String msg) { delegate.error(marker, msg); } @Override public void error(Marker marker, String format, Object arg) { delegate.error(marker, format, arg); } @Override public void error(Marker marker, String format, Object arg1, Object arg2) { delegate.error(marker, format, arg1, arg2); } @Override public void error(Marker marker, String format, Object... arguments) { delegate.error(marker, format, arguments); } @Override public void error(Marker marker, String msg, Throwable t) { delegate.error(marker, msg, t); } @Override public String toString() { return toStringHelper(this) .addValue(delegate) .toString(); } }
apache-2.0
vishnudevk/MiBandDecompiled
Original Files/source/src/com/xiaomi/infra/galaxy/common/model/Condition.java
8239
// Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: braces fieldsfirst space lnc package com.xiaomi.infra.galaxy.common.model; import com.xiaomi.infra.galaxy.common.GalaxyClientException; import com.xiaomi.infra.galaxy.common.constants.ReturnCode; import java.util.ArrayList; import java.util.List; // Referenced classes of package com.xiaomi.infra.galaxy.common.model: // AttributeValue, Comparator, AttributeType, Verifier public class Condition { private String attributeName; private List attributeValues; private String comparator; public Condition() { } public Condition addAttributeValue(Object obj) { if (attributeValues == null) { attributeValues = new ArrayList(); } AttributeValue.putAttributeValueInList(attributeValues, obj); return this; } public boolean equals(Object obj) { if (this != obj) goto _L2; else goto _L1 _L1: boolean flag = true; _L4: return flag; _L2: flag = false; if (obj == null) goto _L4; else goto _L3 _L3: boolean flag1; flag1 = obj instanceof Condition; flag = false; if (!flag1) goto _L4; else goto _L5 _L5: Condition condition = (Condition)obj; boolean flag2; boolean flag3; boolean flag4; boolean flag7; boolean flag8; boolean flag9; if (condition.getComparator() == null) { flag2 = true; } else { flag2 = false; } if (getComparator() == null) { flag3 = true; } else { flag3 = false; } flag4 = flag2 ^ flag3; flag = false; if (flag4) goto _L4; else goto _L6 _L6: if (condition.getComparator() == null) { break; /* Loop/switch isn't completed */ } flag9 = condition.getComparator().equals(getComparator()); flag = false; if (!flag9) goto _L4; else goto _L7 _L7: boolean flag5; boolean flag6; if (condition.getAttributeValues() == null) { flag5 = true; } else { flag5 = false; } if (getAttributeValues() == null) { flag6 = true; } else { flag6 = false; } flag7 = flag5 ^ flag6; flag = false; if (flag7) goto _L4; else goto _L8 _L8: if (condition.getAttributeValues() == null) { break; /* Loop/switch isn't completed */ } flag8 = condition.getAttributeValues().equals(getAttributeValues()); flag = false; if (!flag8) goto _L4; else goto _L9 _L9: return true; } public String getAttributeName() { return attributeName; } public List getAttributeValues() { return attributeValues; } public String getComparator() { return comparator; } public int hashCode() { int i; int j; List list; int k; if (getComparator() == null) { i = 0; } else { i = getComparator().hashCode(); } j = 31 * (i + 31); list = getAttributeValues(); k = 0; if (list != null) { k = getAttributeValues().hashCode(); } return j + k; } public void setAttributeName(String s) { attributeName = s; } public void setAttributeValues(List list) { attributeValues = list; } public void setComparator(String s) { comparator = s; } public void validate() { Comparator comparator1; AttributeType attributetype; comparator1 = Comparator.fromValue(comparator); if (attributeValues == null || attributeValues.size() != 1) { throw new GalaxyClientException(ReturnCode.UNEXPECTED_NUMBER_OF_OPERANDS, "comparator can only use one attribute value"); } attributetype = AttributeType.fromValue(((AttributeValue)attributeValues.get(0)).getType()); Verifier.validateAttributeValue(attributeName, (AttributeValue)attributeValues.get(0), false); _cls1..SwitchMap.com.xiaomi.infra.galaxy.common.model.Comparator[comparator1.ordinal()]; JVM INSTR tableswitch 1 6: default 128 // 1 221 // 2 221 // 3 179 // 4 222 // 5 265 // 6 308; goto _L1 _L2 _L2 _L3 _L4 _L5 _L6 _L1: throw new GalaxyClientException(ReturnCode.UNEXPECTED_OPERAND_TYPE, (new StringBuilder()).append(attributetype.name()).append("(comparator:").append(comparator1).append(" ,attributeType").append(attributetype).append(")").toString()); _L3: if (AttributeType.BINARY != attributetype && AttributeType.STRING != attributetype && AttributeType.INT8 != attributetype && AttributeType.INT16 != attributetype && AttributeType.INT32 != attributetype && AttributeType.INT64 != attributetype) { break; /* Loop/switch isn't completed */ } _L2: return; _L4: if (AttributeType.BINARY == attributetype || AttributeType.STRING == attributetype || AttributeType.INT8 == attributetype || AttributeType.INT16 == attributetype || AttributeType.INT32 == attributetype || AttributeType.INT64 == attributetype) { return; } break; /* Loop/switch isn't completed */ _L5: if (AttributeType.BINARY == attributetype || AttributeType.STRING == attributetype || AttributeType.INT8 == attributetype || AttributeType.INT16 == attributetype || AttributeType.INT32 == attributetype || AttributeType.INT64 == attributetype) { return; } break; /* Loop/switch isn't completed */ _L6: if (AttributeType.BINARY == attributetype || AttributeType.STRING == attributetype || AttributeType.INT8 == attributetype || AttributeType.INT16 == attributetype || AttributeType.INT32 == attributetype || AttributeType.INT64 == attributetype) { return; } if (true) goto _L1; else goto _L7 _L7: } public Condition withAttributeValues(List list) { setAttributeValues(list); return this; } public Condition withComparator(Comparator comparator1) { setComparator(comparator1.name()); return this; } private class _cls1 { static final int $SwitchMap$com$xiaomi$infra$galaxy$common$model$Comparator[]; static { $SwitchMap$com$xiaomi$infra$galaxy$common$model$Comparator = new int[Comparator.values().length]; try { $SwitchMap$com$xiaomi$infra$galaxy$common$model$Comparator[Comparator.EQ.ordinal()] = 1; } catch (NoSuchFieldError nosuchfielderror) { } try { $SwitchMap$com$xiaomi$infra$galaxy$common$model$Comparator[Comparator.NE.ordinal()] = 2; } catch (NoSuchFieldError nosuchfielderror1) { } try { $SwitchMap$com$xiaomi$infra$galaxy$common$model$Comparator[Comparator.GT.ordinal()] = 3; } catch (NoSuchFieldError nosuchfielderror2) { } try { $SwitchMap$com$xiaomi$infra$galaxy$common$model$Comparator[Comparator.GE.ordinal()] = 4; } catch (NoSuchFieldError nosuchfielderror3) { } try { $SwitchMap$com$xiaomi$infra$galaxy$common$model$Comparator[Comparator.LT.ordinal()] = 5; } catch (NoSuchFieldError nosuchfielderror4) { } try { $SwitchMap$com$xiaomi$infra$galaxy$common$model$Comparator[Comparator.LE.ordinal()] = 6; } catch (NoSuchFieldError nosuchfielderror5) { return; } } } }
apache-2.0
0359xiaodong/android-progress-panel
demo/src/main/java/com/marvinlabs/widget/progresspanel/demo/DemoListActivity.java
2294
package com.marvinlabs.widget.progresspanel.demo; import android.content.Intent; import android.os.Bundle; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentActivity; import com.marvinlabs.widget.progresspanel.demo.R; public class DemoListActivity extends FragmentActivity implements DemoListFragment.OnDemoSelectedListener { private static final String TAG_LIST_FRAGMENT = "ListFragment"; private static final String TAG_DEMO_FRAGMENT = "DemoFragment"; private DemoListFragment listFragment; private boolean isDualPane; private int currentDemo; /** * Creates a fragment given a fully qualified class name and some arguments */ public static Fragment newFragmentInstance(String className, Bundle args) { try { Class<?> c = Class.forName(className); Fragment f = (Fragment) c.newInstance(); f.setArguments(args); return f; } catch (ClassNotFoundException e) { throw new RuntimeException("Cannot create fragment", e); } catch (InstantiationException e) { throw new RuntimeException("Cannot create fragment", e); } catch (IllegalAccessException e) { throw new RuntimeException("Cannot create fragment", e); } } @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_demolist); listFragment = (DemoListFragment) getSupportFragmentManager().findFragmentByTag(TAG_LIST_FRAGMENT); if (listFragment == null) { listFragment = DemoListFragment.newInstance(); getSupportFragmentManager().beginTransaction().replace(R.id.main_container, listFragment, TAG_LIST_FRAGMENT).commitAllowingStateLoss(); } } @Override protected void onStart() { super.onStart(); listFragment.setSelectable(isDualPane); } @Override public void onDemoSelected(String fragmentClass, Bundle args) { Intent i = new Intent(this, DemoActivity.class); i.putExtra(DemoActivity.EXTRA_FRAGMENT_CLASS, fragmentClass); i.putExtra(DemoActivity.EXTRA_FRAGMENT_ARGS, args); startActivity(i); } }
apache-2.0
HeidCloud/devstack
extras.d/80-opendaylight.sh
1958
# opendaylight.sh - DevStack extras script if is_service_enabled odl-server odl-compute; then # Initial source [[ "$1" == "source" ]] && source $TOP_DIR/lib/opendaylight fi if is_service_enabled odl-server; then if [[ "$1" == "source" ]]; then # no-op : elif [[ "$1" == "stack" && "$2" == "install" ]]; then install_opendaylight configure_opendaylight init_opendaylight elif [[ "$1" == "stack" && "$2" == "post-config" ]]; then # This has to start before Neutron start_opendaylight elif [[ "$1" == "stack" && "$2" == "post-extra" ]]; then # no-op : fi if [[ "$1" == "unstack" ]]; then stop_opendaylight cleanup_opendaylight fi if [[ "$1" == "clean" ]]; then # no-op : fi fi if is_service_enabled odl-compute; then if [[ "$1" == "source" ]]; then # no-op : elif [[ "$1" == "stack" && "$2" == "install" ]]; then install_opendaylight-compute elif [[ "$1" == "stack" && "$2" == "post-config" ]]; then create_nova_conf_neutron elif [[ "$1" == "stack" && "$2" == "extra" ]]; then echo_summary "Initializing OpenDaylight" ODL_LOCAL_IP=${ODL_LOCAL_IP:-$HOST_IP} ODL_MGR_PORT=${ODL_MGR_PORT:-6640} read ovstbl <<< $(sudo ovs-vsctl get Open_vSwitch . _uuid) sudo ovs-vsctl set-manager tcp:$ODL_MGR_IP:$ODL_MGR_PORT sudo ovs-vsctl set Open_vSwitch $ovstbl other_config={"local_ip"="$ODL_LOCAL_IP"} elif [[ "$1" == "stack" && "$2" == "post-extra" ]]; then # no-op : fi if [[ "$1" == "unstack" ]]; then sudo ovs-vsctl del-manager BRIDGES=$(sudo ovs-vsctl list-br) for bridge in $BRIDGES ; do sudo ovs-vsctl del-controller $bridge done stop_opendaylight-compute fi if [[ "$1" == "clean" ]]; then # no-op : fi fi
apache-2.0
googleapis/google-api-java-client-services
clients/google-api-services-containeranalysis/v1alpha1/1.31.0/com/google/api/services/containeranalysis/v1alpha1/model/Basis.java
2988
/* * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software distributed under the License * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express * or implied. See the License for the specific language governing permissions and limitations under * the License. */ /* * This code was generated by https://github.com/googleapis/google-api-java-client-services/ * Modify at your own risk. */ package com.google.api.services.containeranalysis.v1alpha1.model; /** * Basis describes the base image portion (Note) of the DockerImage relationship. Linked occurrences * are derived from this or an equivalent image via: FROM Or an equivalent reference, e.g. a tag of * the resource_url. * * <p> This is the Java data model class that specifies how to parse/serialize into the JSON that is * transmitted over HTTP when working with the Container Analysis API. For a detailed explanation * see: * <a href="https://developers.google.com/api-client-library/java/google-http-java-client/json">https://developers.google.com/api-client-library/java/google-http-java-client/json</a> * </p> * * @author Google, Inc. */ @SuppressWarnings("javadoc") public final class Basis extends com.google.api.client.json.GenericJson { /** * The fingerprint of the base image. * The value may be {@code null}. */ @com.google.api.client.util.Key private Fingerprint fingerprint; /** * The resource_url for the resource representing the basis of associated occurrence images. * The value may be {@code null}. */ @com.google.api.client.util.Key private java.lang.String resourceUrl; /** * The fingerprint of the base image. * @return value or {@code null} for none */ public Fingerprint getFingerprint() { return fingerprint; } /** * The fingerprint of the base image. * @param fingerprint fingerprint or {@code null} for none */ public Basis setFingerprint(Fingerprint fingerprint) { this.fingerprint = fingerprint; return this; } /** * The resource_url for the resource representing the basis of associated occurrence images. * @return value or {@code null} for none */ public java.lang.String getResourceUrl() { return resourceUrl; } /** * The resource_url for the resource representing the basis of associated occurrence images. * @param resourceUrl resourceUrl or {@code null} for none */ public Basis setResourceUrl(java.lang.String resourceUrl) { this.resourceUrl = resourceUrl; return this; } @Override public Basis set(String fieldName, Object value) { return (Basis) super.set(fieldName, value); } @Override public Basis clone() { return (Basis) super.clone(); } }
apache-2.0
gmilos/swift
include/swift/Driver/Job.h
6029
//===--- Job.h - Commands to Execute ----------------------------*- C++ -*-===// // // This source file is part of the Swift.org open source project // // Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See https://swift.org/LICENSE.txt for license information // See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // //===----------------------------------------------------------------------===// #ifndef SWIFT_DRIVER_JOB_H #define SWIFT_DRIVER_JOB_H #include "swift/Basic/LLVM.h" #include "swift/Driver/Action.h" #include "swift/Driver/Types.h" #include "swift/Driver/Util.h" #include "llvm/Option/Option.h" #include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/DenseMap.h" #include "llvm/ADT/PointerIntPair.h" #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/StringRef.h" #include "llvm/Support/TimeValue.h" #include "llvm/Support/raw_ostream.h" #include <memory> namespace swift { namespace driver { class Job; class JobAction; class CommandOutput { types::ID PrimaryOutputType; /// The primary output files of the command. /// Usually a command has only a single output file. Only the compiler in /// multi-threaded compilation produces multiple output files. SmallVector<std::string, 1> PrimaryOutputFilenames; /// For each primary output file there is a base input. This is the input file /// from which the output file is derived. SmallVector<StringRef, 1> BaseInputs; llvm::SmallDenseMap<types::ID, std::string, 4> AdditionalOutputsMap; public: CommandOutput(types::ID PrimaryOutputType) : PrimaryOutputType(PrimaryOutputType) { } types::ID getPrimaryOutputType() const { return PrimaryOutputType; } void addPrimaryOutput(StringRef FileName, StringRef BaseInput) { PrimaryOutputFilenames.push_back(FileName); BaseInputs.push_back(BaseInput); } // This returns a std::string instead of a StringRef so that users can rely // on the data buffer being null-terminated. const std::string &getPrimaryOutputFilename() const { assert(PrimaryOutputFilenames.size() == 1); return PrimaryOutputFilenames[0]; } ArrayRef<std::string> getPrimaryOutputFilenames() const { return PrimaryOutputFilenames; } void setAdditionalOutputForType(types::ID type, StringRef OutputFilename); const std::string &getAdditionalOutputForType(types::ID type) const; const std::string &getAnyOutputForType(types::ID type) const; StringRef getBaseInput(int Index) const { return BaseInputs[Index]; } }; class Job { public: enum class Condition { Always, RunWithoutCascading, CheckDependencies, NewlyAdded }; using EnvironmentVector = std::vector<std::pair<const char *, const char *>>; private: /// The action which caused the creation of this Job, and the conditions /// under which it must be run. llvm::PointerIntPair<const JobAction *, 2, Condition> SourceAndCondition; /// The list of other Jobs which are inputs to this Job. SmallVector<const Job *, 4> Inputs; /// The output of this command. std::unique_ptr<CommandOutput> Output; /// The executable to run. const char *Executable; /// The list of program arguments (not including the implicit first argument, /// which will be the Executable). /// /// These argument strings must be kept alive as long as the Job is alive. llvm::opt::ArgStringList Arguments; /// Additional variables to set in the process environment when running. /// /// These strings must be kept alive as long as the Job is alive. EnvironmentVector ExtraEnvironment; /// Whether the job wants a list of input or output files created. FilelistInfo FilelistFileInfo; /// The modification time of the main input file, if any. llvm::sys::TimeValue InputModTime = llvm::sys::TimeValue::MaxTime(); public: Job(const JobAction &Source, SmallVectorImpl<const Job *> &&Inputs, std::unique_ptr<CommandOutput> Output, const char *Executable, llvm::opt::ArgStringList Arguments, EnvironmentVector ExtraEnvironment = {}, FilelistInfo Info = {}) : SourceAndCondition(&Source, Condition::Always), Inputs(std::move(Inputs)), Output(std::move(Output)), Executable(Executable), Arguments(std::move(Arguments)), ExtraEnvironment(std::move(ExtraEnvironment)), FilelistFileInfo(std::move(Info)) {} const JobAction &getSource() const { return *SourceAndCondition.getPointer(); } const char *getExecutable() const { return Executable; } const llvm::opt::ArgStringList &getArguments() const { return Arguments; } FilelistInfo getFilelistInfo() const { return FilelistFileInfo; } ArrayRef<const Job *> getInputs() const { return Inputs; } const CommandOutput &getOutput() const { return *Output; } Condition getCondition() const { return SourceAndCondition.getInt(); } void setCondition(Condition Cond) { SourceAndCondition.setInt(Cond); } void setInputModTime(llvm::sys::TimeValue time) { InputModTime = time; } llvm::sys::TimeValue getInputModTime() const { return InputModTime; } ArrayRef<std::pair<const char *, const char *>> getExtraEnvironment() const { return ExtraEnvironment; } /// Print the command line for this Job to the given \p stream, /// terminating output with the given \p terminator. void printCommandLine(raw_ostream &Stream, StringRef Terminator = "\n") const; /// Print the command line for this Job to the given \p stream, /// and include any extra environment variables that will be set. /// /// \sa printCommandLine void printCommandLineAndEnvironment(raw_ostream &Stream, StringRef Terminator = "\n") const; void dump() const LLVM_ATTRIBUTE_USED; static void printArguments(raw_ostream &Stream, const llvm::opt::ArgStringList &Args); }; } // end namespace driver } // end namespace swift #endif
apache-2.0
Modesteam/Urutau
src/main/java/com/modesteam/urutau/model/system/MemberPager.java
342
package com.modesteam.urutau.model.system; public class MemberPager { private Integer page; private Integer limit; public Integer getPage() { return page; } public void setPage(Integer page) { this.page = page; } public Integer getLimit() { return limit; } public void setLimit(Integer limit) { this.limit = limit; } }
apache-2.0
nairs77/GB-Unity-Plugin
Assets/GB/Script/Common/GBCommonAndroidHelper.cs
4838
#if UNITY_ANDROID using UnityEngine; using System.Collections; namespace GB { public class GBCommonAndroidHelper : GBAndroidHelper, ICommonHelper { private static readonly string ANDROID_PLUGIN_CLASS_PACKAGE = "com.gebros.platform.unity.GBUnityPlugin"; private static readonly string ANDROID_UTILITY_PLUGIN_CLASS_PACKAGE = "com.gebros.platform.unity.ApplicationPlugin"; private static readonly string SET_ACTIVE_MARKET = "setActiveMarket"; private static readonly string GB_SET_CONFIGURE = "configureWithGameInfo"; private static readonly string GB_GLOBAL_SERVER_INFO = "requestGlobalServerInfo"; private static readonly string GB_GET_MCC = "getMCC"; private static readonly string GB_GET_LANGUAGE = "getCurrentLanguage"; private static readonly string GB_GET_DEVICE_ID = "getDeviceId"; private static readonly string GB_GET_DEVICE_MODEL = "getDeviceModel"; private static readonly string GB_SHOW_TOAST = "ShowToast"; private static readonly string GB_SHOW_ALERT = "ShowAlert"; private static readonly string GB_GET_RUNTIME_PERMISSION = "GetRuntimePermission"; private static readonly string GB_CHECK_RUNTIME_PERMISSION = "CheckRuntimePermission"; public GBCommonAndroidHelper () {} public void SetActiveMarket(GBSettings.Market market, GBRequest funcCall) { UnityActivity.Call("runOnUiThread", new AndroidJavaRunnable(() => { using (AndroidJavaClass jc = new AndroidJavaClass(ANDROID_PLUGIN_CLASS_PACKAGE)) { jc.CallStatic(SET_ACTIVE_MARKET, GBSettings.GetPlatformInfo(), funcCall.GetCallbackGameObjectName()); } })); } public void ConfigureSDKWithGameInfo(string clientSecretKey, int gameCode, GBSettings.Market market, int logLevel) { using (AndroidJavaClass jc = new AndroidJavaClass(ANDROID_PLUGIN_CLASS_PACKAGE) ) { jc.CallStatic(GB_SET_CONFIGURE, clientSecretKey, gameCode, (int)market, logLevel); } } public void ConfigureSDKWithGameInfo(string clientSecretKey, int gameCode, string platformInfo, int logLevel) { // UnityActivity.Call("runOnUiThread", new AndroidJavaRunnable(() => { // using (AndroidJavaClass jc = new AndroidJavaClass(ANDROID_PLUGIN_CLASS_PACKAGE) ) { // jc.CallStatic(GB_SET_CONFIGURE, clientSecretKey, gameCode, platformInfo, logLevel); // } // })); using (AndroidJavaClass jc = new AndroidJavaClass(ANDROID_PLUGIN_CLASS_PACKAGE) ) { jc.CallStatic(GB_SET_CONFIGURE, clientSecretKey, gameCode, platformInfo, logLevel); } } public void RequestGlobalServerInfo(string branchURL, GBRequest funcCall) { UnityActivity.Call("runOnUiThread", new AndroidJavaRunnable(() => { using (AndroidJavaClass jc = new AndroidJavaClass(ANDROID_PLUGIN_CLASS_PACKAGE)) { jc.CallStatic(GB_GLOBAL_SERVER_INFO, branchURL, GBSettings.GameCode, funcCall.GetCallbackGameObjectName()); } })); } public string GetMCC() { using (AndroidJavaClass jc = new AndroidJavaClass(ANDROID_UTILITY_PLUGIN_CLASS_PACKAGE)) { return jc.CallStatic<string>(GB_GET_MCC); } } public string GetCurrentLanguage() { using (AndroidJavaClass jc = new AndroidJavaClass(ANDROID_UTILITY_PLUGIN_CLASS_PACKAGE)) { return jc.CallStatic<string>(GB_GET_LANGUAGE); } } public string GetDeviceId() { using (AndroidJavaClass jc = new AndroidJavaClass(ANDROID_UTILITY_PLUGIN_CLASS_PACKAGE)) { return jc.CallStatic<string>(GB_GET_DEVICE_ID); } } public string GetDeviceModel() { using (AndroidJavaClass jc = new AndroidJavaClass(ANDROID_UTILITY_PLUGIN_CLASS_PACKAGE)) { return jc.CallStatic<string>(GB_GET_DEVICE_MODEL); } } public void ShowToast(string message) { UnityActivity.Call("runOnUiThread", new AndroidJavaRunnable(() => { using (AndroidJavaClass jc = new AndroidJavaClass(ANDROID_UTILITY_PLUGIN_CLASS_PACKAGE)) { jc.CallStatic(GB_SHOW_TOAST, message); } })); } public void ShowAlert() { UnityActivity.Call("runOnUiThread", new AndroidJavaRunnable(() => { using (AndroidJavaClass jc = new AndroidJavaClass(ANDROID_UTILITY_PLUGIN_CLASS_PACKAGE)) { jc.CallStatic(GB_SHOW_ALERT); } })); } public void GetRuntimePermission(string permission, bool isNecessary, GBRequest funcCall) { UnityActivity.Call("runOnUiThread", new AndroidJavaRunnable(() => { using (AndroidJavaClass jc = new AndroidJavaClass (ANDROID_PLUGIN_CLASS_PACKAGE)) { jc.CallStatic (GB_GET_RUNTIME_PERMISSION, permission, isNecessary, funcCall.GetCallbackGameObjectName()); } })); } public bool CheckRuntimePermission(string permission) { using (AndroidJavaClass jc = new AndroidJavaClass(ANDROID_PLUGIN_CLASS_PACKAGE)) { return jc.CallStatic<bool>(GB_CHECK_RUNTIME_PERMISSION, permission); } } public void SendPushMessage(string userKey, string title, string message) { /* Dummy */ } } } #endif
apache-2.0
Vudentz/zephyr
doc/custom-doxygen/customdoxygen.css
625
/* Custom CSS for Doxygen-generated HTML * Copyright (c) 2015 Intel Corporation * SPDX-License-Identifier: Apache-2.0 */ code { font-family: Monaco,Menlo,Consolas,"Courier New",monospace; background-color: #D8D8D8; padding: 0 0.25em 0 0.25em; } pre.fragment { display: block; font-family: Monaco,Menlo,Consolas,"Courier New",monospace; padding: 1rem; word-break: break-all; word-wrap: break-word; white-space: pre; background-color: #D8D8D8; } #projectlogo { vertical-align: middle; } #projectname { font: 200% Tahoma, Arial,sans-serif; color: #3D578C; } #projectbrief { color: #3D578C; }
apache-2.0
Espigah/HaxeRepo
Learning/HaxeClient/unity/out/src/cs/internal/Exceptions.cs
2036
#pragma warning disable 109, 114, 219, 429, 168, 162 namespace haxe.lang{ public class Exceptions { public Exceptions(){ unchecked { #line 25 "C:\\HaxeToolkit\\haxe\\std\\cs\\internal\\Exceptions.hx" { } } #line default } [System.ThreadStaticAttribute] public static global::System.Exception exception; } } #pragma warning disable 109, 114, 219, 429, 168, 162 namespace haxe.lang{ public class HaxeException : global::System.Exception { public HaxeException(object obj) : base(){ unchecked { #line 41 "C:\\HaxeToolkit\\haxe\\std\\cs\\internal\\Exceptions.hx" if (( obj is global::haxe.lang.HaxeException )) { #line 43 "C:\\HaxeToolkit\\haxe\\std\\cs\\internal\\Exceptions.hx" global::haxe.lang.HaxeException _obj = ((global::haxe.lang.HaxeException) (obj) ); obj = _obj.getObject(); } #line 46 "C:\\HaxeToolkit\\haxe\\std\\cs\\internal\\Exceptions.hx" this.obj = obj; } #line default } public static global::System.Exception wrap(object obj){ unchecked { #line 61 "C:\\HaxeToolkit\\haxe\\std\\cs\\internal\\Exceptions.hx" if (( obj is global::System.Exception )) { #line 61 "C:\\HaxeToolkit\\haxe\\std\\cs\\internal\\Exceptions.hx" return ((global::System.Exception) (obj) ); } #line 63 "C:\\HaxeToolkit\\haxe\\std\\cs\\internal\\Exceptions.hx" return new global::haxe.lang.HaxeException(((object) (obj) )); } #line default } public object obj; public virtual object getObject(){ unchecked { #line 51 "C:\\HaxeToolkit\\haxe\\std\\cs\\internal\\Exceptions.hx" return this.obj; } #line default } public virtual string toString(){ unchecked { #line 56 "C:\\HaxeToolkit\\haxe\\std\\cs\\internal\\Exceptions.hx" return global::haxe.lang.Runtime.concat("Haxe Exception: ", global::Std.@string(this.obj)); } #line default } public override string ToString(){ return this.toString(); } } }
apache-2.0
DynamoDS/designscript-archive
UIs/Editor/DesignScriptEditor/DesignScriptEditorCore/UnitTests/TextBufferMultilineTests.cs
835
using System; using System.Collections.Generic; using System.Linq; using System.Text; using NUnit.Framework; namespace DesignScript.Editor.Core.UnitTest { class TextBufferMultilineTests { TextBuffer textBuffer; [SetUp] public void Setup() { textBuffer = new TextBuffer( " var a = 12.34;\n" + " var b = 56.78;\n" + " var c = 90.11;\n" + " var d = 12345;\n" + " var e = 67890;\n"); } [Test] public void TestGetTextInvalidRange01() { string textInRegion = textBuffer.GetText(1, 8, 3, 25); Assert.AreEqual("b = 56.78;\n var c = 90.11;\n var d = 12345;\n", textInRegion); } } }
apache-2.0
sophieyoung717/mimir
src/main/java/mimir/context/ScanForFunctions.java
1951
/** * Identify the name of all functions invoked within a given Expression * * Descend through the expression, identify every instance of a Function * expression, and record the name of every function encountered. * * General usage is of the form * ScanForFunctions.scan(myExpression) */ package mimir.context; import java.util.ArrayList; import java.util.List; import net.sf.jsqlparser.expression.*; public class ScanForFunctions extends ExpressionScan { ArrayList<String> functions = new ArrayList<String>(); public ScanForFunctions(){ super(false); } public void visit(Function fn) { functions.add(fn.getName()); super.visit(fn); } public List<String> getFunctions(){ return functions; } /** * Compute a list of all function names in the given expression * * @param e An arbitrary expression * @returns A list of all function names in e */ public static List<String> scan(Expression e){ ScanForFunctions scan = new ScanForFunctions(); e.accept(scan); return scan.getFunctions(); } /** * Determine if a given expression contains any aggregate function calls * * @param e An arbitrary expression * @returns true if e contains any aggregate functions as determined by * the isAggregate method. */ public static boolean hasAggregate(Expression e){ for(String fn : scan(e)){ if(isAggregate(fn)){ return true; } } return false; } /** * Determine if the given function name corresponds to a standard aggregate * function. * * @param fn The name of a function * @returns true if fn corresponds to the name of an aggregate function. */ public static boolean isAggregate(String fn) { fn = fn.toUpperCase(); return "SUM".equals(fn) || "COUNT".equals(fn) || "AVG".equals(fn) || "STDDEV".equals(fn) || "MAX".equals(fn) || "MIN".equals(fn); } }
apache-2.0
microsoft/TypeScript
tests/baselines/reference/invalidTaggedTemplateEscapeSequences(target=es5).js
3182
//// [invalidTaggedTemplateEscapeSequences.ts] function tag (str: any, ...args: any[]): any { return str } const a = tag`123` const b = tag`123 ${100}` const x = tag`\u{hello} ${ 100 } \xtraordinary ${ 200 } wonderful ${ 300 } \uworld`; const y = `\u{hello} ${ 100 } \xtraordinary ${ 200 } wonderful ${ 300 } \uworld`; // should error with NoSubstitutionTemplate const z = tag`\u{hello} \xtraordinary wonderful \uworld` // should work with Tagged NoSubstitutionTemplate const a1 = tag`${ 100 }\0` // \0 const a2 = tag`${ 100 }\00` // \\00 const a3 = tag`${ 100 }\u` // \\u const a4 = tag`${ 100 }\u0` // \\u0 const a5 = tag`${ 100 }\u00` // \\u00 const a6 = tag`${ 100 }\u000` // \\u000 const a7 = tag`${ 100 }\u0000` // \u0000 const a8 = tag`${ 100 }\u{` // \\u{ const a9 = tag`${ 100 }\u{10FFFF}` // \\u{10FFFF const a10 = tag`${ 100 }\u{1f622` // \\u{1f622 const a11 = tag`${ 100 }\u{1f622}` // \u{1f622} const a12 = tag`${ 100 }\x` // \\x const a13 = tag`${ 100 }\x0` // \\x0 const a14 = tag`${ 100 }\x00` // \x00 //// [invalidTaggedTemplateEscapeSequences.js] var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) { if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } return cooked; }; function tag(str) { var args = []; for (var _i = 1; _i < arguments.length; _i++) { args[_i - 1] = arguments[_i]; } return str; } var a = tag(__makeTemplateObject(["123"], ["123"])); var b = tag(__makeTemplateObject(["123 ", ""], ["123 ", ""]), 100); var x = tag(__makeTemplateObject([void 0, void 0, " wonderful ", void 0], ["\\u{hello} ", " \\xtraordinary ", " wonderful ", " \\uworld"]), 100, 200, 300); var y = "hello} ".concat(100, " traordinary ").concat(200, " wonderful ").concat(300, " world"); // should error with NoSubstitutionTemplate var z = tag(__makeTemplateObject([void 0], ["\\u{hello} \\xtraordinary wonderful \\uworld"])); // should work with Tagged NoSubstitutionTemplate var a1 = tag(__makeTemplateObject(["", "\0"], ["", "\\0"]), 100); // \0 var a2 = tag(__makeTemplateObject(["", void 0], ["", "\\00"]), 100); // \\00 var a3 = tag(__makeTemplateObject(["", void 0], ["", "\\u"]), 100); // \\u var a4 = tag(__makeTemplateObject(["", void 0], ["", "\\u0"]), 100); // \\u0 var a5 = tag(__makeTemplateObject(["", void 0], ["", "\\u00"]), 100); // \\u00 var a6 = tag(__makeTemplateObject(["", void 0], ["", "\\u000"]), 100); // \\u000 var a7 = tag(__makeTemplateObject(["", "\0"], ["", "\\u0000"]), 100); // \u0000 var a8 = tag(__makeTemplateObject(["", void 0], ["", "\\u{"]), 100); // \\u{ var a9 = tag(__makeTemplateObject(["", "\uDBFF\uDFFF"], ["", "\\u{10FFFF}"]), 100); // \\u{10FFFF var a10 = tag(__makeTemplateObject(["", void 0], ["", "\\u{1f622"]), 100); // \\u{1f622 var a11 = tag(__makeTemplateObject(["", "\uD83D\uDE22"], ["", "\\u{1f622}"]), 100); // \u{1f622} var a12 = tag(__makeTemplateObject(["", void 0], ["", "\\x"]), 100); // \\x var a13 = tag(__makeTemplateObject(["", void 0], ["", "\\x0"]), 100); // \\x0 var a14 = tag(__makeTemplateObject(["", "\0"], ["", "\\x00"]), 100); // \x00
apache-2.0
apache/incubator-superset
superset/db_engine_specs/druid.py
4908
# 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. import json import logging from datetime import datetime from typing import Any, Dict, Optional, TYPE_CHECKING from superset import is_feature_enabled from superset.db_engine_specs.base import BaseEngineSpec from superset.exceptions import SupersetException from superset.utils import core as utils if TYPE_CHECKING: from superset.connectors.sqla.models import TableColumn from superset.models.core import Database logger = logging.getLogger() class DruidEngineSpec(BaseEngineSpec): """Engine spec for Druid.io""" engine = "druid" engine_name = "Apache Druid" allows_joins = is_feature_enabled("DRUID_JOINS") allows_subqueries = True _time_grain_expressions = { None: "{col}", "PT1S": "TIME_FLOOR(CAST({col} AS TIMESTAMP), 'PT1S')", "PT5S": "TIME_FLOOR(CAST({col} AS TIMESTAMP), 'PT5S')", "PT30S": "TIME_FLOOR(CAST({col} AS TIMESTAMP), 'PT30S')", "PT1M": "TIME_FLOOR(CAST({col} AS TIMESTAMP), 'PT1M')", "PT5M": "TIME_FLOOR(CAST({col} AS TIMESTAMP), 'PT5M')", "PT10M": "TIME_FLOOR(CAST({col} AS TIMESTAMP), 'PT10M')", "PT15M": "TIME_FLOOR(CAST({col} AS TIMESTAMP), 'PT15M')", "PT30M": "TIME_FLOOR(CAST({col} AS TIMESTAMP), 'PT30M')", "PT1H": "TIME_FLOOR(CAST({col} AS TIMESTAMP), 'PT1H')", "PT6H": "TIME_FLOOR(CAST({col} AS TIMESTAMP), 'PT6H')", "P1D": "TIME_FLOOR(CAST({col} AS TIMESTAMP), 'P1D')", "P1W": "TIME_FLOOR(CAST({col} AS TIMESTAMP), 'P1W')", "P1M": "TIME_FLOOR(CAST({col} AS TIMESTAMP), 'P1M')", "P3M": "TIME_FLOOR(CAST({col} AS TIMESTAMP), 'P3M')", "P1Y": "TIME_FLOOR(CAST({col} AS TIMESTAMP), 'P1Y')", "P1W/1970-01-03T00:00:00Z": ( "TIME_SHIFT(TIME_FLOOR(TIME_SHIFT(CAST({col} AS TIMESTAMP), " "'P1D', 1), 'P1W'), 'P1D', 5)" ), "1969-12-28T00:00:00Z/P1W": ( "TIME_SHIFT(TIME_FLOOR(TIME_SHIFT(CAST({col} AS TIMESTAMP), " "'P1D', 1), 'P1W'), 'P1D', -1)" ), } @classmethod def alter_new_orm_column(cls, orm_col: "TableColumn") -> None: if orm_col.column_name == "__time": orm_col.is_dttm = True @staticmethod def get_extra_params(database: "Database") -> Dict[str, Any]: """ For Druid, the path to a SSL certificate is placed in `connect_args`. :param database: database instance from which to extract extras :raises CertificateException: If certificate is not valid/unparseable :raises SupersetException: If database extra json payload is unparseable """ try: extra = json.loads(database.extra or "{}") except json.JSONDecodeError as ex: raise SupersetException("Unable to parse database extras") from ex if database.server_cert: engine_params = extra.get("engine_params", {}) connect_args = engine_params.get("connect_args", {}) connect_args["scheme"] = "https" path = utils.create_ssl_cert_file(database.server_cert) connect_args["ssl_verify_cert"] = path engine_params["connect_args"] = connect_args extra["engine_params"] = engine_params return extra @classmethod def convert_dttm( cls, target_type: str, dttm: datetime, db_extra: Optional[Dict[str, Any]] = None ) -> Optional[str]: tt = target_type.upper() if tt == utils.TemporalType.DATE: return f"CAST(TIME_PARSE('{dttm.date().isoformat()}') AS DATE)" if tt in (utils.TemporalType.DATETIME, utils.TemporalType.TIMESTAMP): return f"""TIME_PARSE('{dttm.isoformat(timespec="seconds")}')""" return None @classmethod def epoch_to_dttm(cls) -> str: """ Convert from number of seconds since the epoch to a timestamp. """ return "MILLIS_TO_TIMESTAMP({col} * 1000)" @classmethod def epoch_ms_to_dttm(cls) -> str: """ Convert from number of milliseconds since the epoch to a timestamp. """ return "MILLIS_TO_TIMESTAMP({col})"
apache-2.0
aaronwalker/camel
components/camel-lucene/src/main/java/org/apache/camel/component/lucene/LuceneIndexer.java
5933
/** * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.camel.component.lucene; import java.io.File; import java.io.IOException; import java.util.Map; import java.util.Map.Entry; import org.apache.camel.Exchange; import org.apache.camel.converter.IOConverter; import org.apache.lucene.analysis.Analyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.index.IndexWriter; import org.apache.lucene.index.IndexWriterConfig; import org.apache.lucene.index.IndexWriterConfig.OpenMode; import org.apache.lucene.store.NIOFSDirectory; import org.apache.lucene.util.Version; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class LuceneIndexer { private static final transient Logger LOG = LoggerFactory.getLogger(LuceneIndexer.class); private File sourceDirectory; private Analyzer analyzer; private NIOFSDirectory niofsDirectory; private IndexWriter indexWriter; private boolean sourceDirectoryIndexed; private boolean indexCreated; public LuceneIndexer(File sourceDirectory, File indexDirectory, Analyzer analyzer) throws Exception { if (indexDirectory != null) { if (!indexDirectory.exists()) { indexDirectory.mkdir(); } this.setNiofsDirectory(new NIOFSDirectory(indexDirectory)); } else { this.setNiofsDirectory(new NIOFSDirectory(new File("./indexDirectory"))); } this.setAnalyzer(analyzer); if ((sourceDirectory != null) && (!sourceDirectoryIndexed)) { this.setSourceDirectory(sourceDirectory); add(getSourceDirectory()); sourceDirectoryIndexed = true; } } public void index(Exchange exchange) throws Exception { LOG.debug("Indexing {}", exchange); openIndexWriter(); Map<String, Object> headers = exchange.getIn().getHeaders(); add("exchangeId", exchange.getExchangeId(), true); for (Entry<String, Object> entry : headers.entrySet()) { String field = entry.getKey(); String value = exchange.getContext().getTypeConverter().convertTo(String.class, entry.getValue()); add(field, value, true); } add("contents", exchange.getIn().getMandatoryBody(String.class), true); closeIndexWriter(); } public NIOFSDirectory getNiofsDirectory() { return niofsDirectory; } public void setNiofsDirectory(NIOFSDirectory niofsDirectory) { this.niofsDirectory = niofsDirectory; } public File getSourceDirectory() { return sourceDirectory; } public void setSourceDirectory(File sourceDirectory) { this.sourceDirectory = sourceDirectory; } public Analyzer getAnalyzer() { return analyzer; } public void setAnalyzer(Analyzer analyzer) { this.analyzer = analyzer; } private void add(String field, String value, boolean analyzed) throws IOException { if (LOG.isTraceEnabled()) { LOG.trace("Adding field: {}", field); LOG.trace(" value: {}", value); } Document doc = new Document(); if (!analyzed) { doc.add(new Field(field, value, Field.Store.YES, Field.Index.NOT_ANALYZED)); } else { doc.add(new Field(field, value, Field.Store.YES, Field.Index.ANALYZED)); } indexWriter.addDocument(doc); } private void add(File file) throws IOException { if (file.canRead()) { if (file.isDirectory()) { String[] files = file.list(); if (files != null) { for (String child : files) { add(new File(file.getAbsolutePath() + "/" + child)); } } } else { LOG.trace("Adding {}", file); openIndexWriter(); add("path", file.getPath(), false); add("contents", new String(IOConverter.toByteArray(file)), true); closeIndexWriter(); LOG.trace("Added {} successfully", file); } } else { LOG.warn("Directory/File " + file.getAbsolutePath() + " could not be read." + " This directory will not be indexed. Please check permissions and rebuild indexes."); } } private void openIndexWriter() throws IOException { IndexWriterConfig indexWriterConfig; if (!indexCreated) { indexWriterConfig = new IndexWriterConfig(Version.LUCENE_35, getAnalyzer()).setOpenMode(OpenMode.CREATE); indexWriter = new IndexWriter(niofsDirectory, indexWriterConfig); indexCreated = true; return; } indexWriterConfig = new IndexWriterConfig(Version.LUCENE_35, getAnalyzer()).setOpenMode(OpenMode.APPEND); indexWriter = new IndexWriter(niofsDirectory, indexWriterConfig); } private void closeIndexWriter() throws IOException { indexWriter.commit(); indexWriter.close(); } }
apache-2.0
awslabs/aws-sdk-net-samples
Talks/vslive-2015/ZipCodes/ZipCodeFinal/Areas/HelpPage/SampleGeneration/ObjectGenerator.cs
19494
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.Linq; using System.Reflection; namespace ZipCodeFinal.Areas.HelpPage { /// <summary> /// This class will create an object of a given type and populate it with sample data. /// </summary> public class ObjectGenerator { internal const int DefaultCollectionSize = 2; private readonly SimpleTypeObjectGenerator SimpleObjectGenerator = new SimpleTypeObjectGenerator(); /// <summary> /// Generates an object for a given type. The type needs to be public, have a public default constructor and settable public properties/fields. Currently it supports the following types: /// Simple types: <see cref="int"/>, <see cref="string"/>, <see cref="Enum"/>, <see cref="DateTime"/>, <see cref="Uri"/>, etc. /// Complex types: POCO types. /// Nullables: <see cref="Nullable{T}"/>. /// Arrays: arrays of simple types or complex types. /// Key value pairs: <see cref="KeyValuePair{TKey,TValue}"/> /// Tuples: <see cref="Tuple{T1}"/>, <see cref="Tuple{T1,T2}"/>, etc /// Dictionaries: <see cref="IDictionary{TKey,TValue}"/> or anything deriving from <see cref="IDictionary{TKey,TValue}"/>. /// Collections: <see cref="IList{T}"/>, <see cref="IEnumerable{T}"/>, <see cref="ICollection{T}"/>, <see cref="IList"/>, <see cref="IEnumerable"/>, <see cref="ICollection"/> or anything deriving from <see cref="ICollection{T}"/> or <see cref="IList"/>. /// Queryables: <see cref="IQueryable"/>, <see cref="IQueryable{T}"/>. /// </summary> /// <param name="type">The type.</param> /// <returns>An object of the given type.</returns> public object GenerateObject(Type type) { return GenerateObject(type, new Dictionary<Type, object>()); } [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Here we just want to return null if anything goes wrong.")] private object GenerateObject(Type type, Dictionary<Type, object> createdObjectReferences) { try { if (SimpleTypeObjectGenerator.CanGenerateObject(type)) { return SimpleObjectGenerator.GenerateObject(type); } if (type.IsArray) { return GenerateArray(type, DefaultCollectionSize, createdObjectReferences); } if (type.IsGenericType) { return GenerateGenericType(type, DefaultCollectionSize, createdObjectReferences); } if (type == typeof(IDictionary)) { return GenerateDictionary(typeof(Hashtable), DefaultCollectionSize, createdObjectReferences); } if (typeof(IDictionary).IsAssignableFrom(type)) { return GenerateDictionary(type, DefaultCollectionSize, createdObjectReferences); } if (type == typeof(IList) || type == typeof(IEnumerable) || type == typeof(ICollection)) { return GenerateCollection(typeof(ArrayList), DefaultCollectionSize, createdObjectReferences); } if (typeof(IList).IsAssignableFrom(type)) { return GenerateCollection(type, DefaultCollectionSize, createdObjectReferences); } if (type == typeof(IQueryable)) { return GenerateQueryable(type, DefaultCollectionSize, createdObjectReferences); } if (type.IsEnum) { return GenerateEnum(type); } if (type.IsPublic || type.IsNestedPublic) { return GenerateComplexObject(type, createdObjectReferences); } } catch { // Returns null if anything fails return null; } return null; } private static object GenerateGenericType(Type type, int collectionSize, Dictionary<Type, object> createdObjectReferences) { Type genericTypeDefinition = type.GetGenericTypeDefinition(); if (genericTypeDefinition == typeof(Nullable<>)) { return GenerateNullable(type, createdObjectReferences); } if (genericTypeDefinition == typeof(KeyValuePair<,>)) { return GenerateKeyValuePair(type, createdObjectReferences); } if (IsTuple(genericTypeDefinition)) { return GenerateTuple(type, createdObjectReferences); } Type[] genericArguments = type.GetGenericArguments(); if (genericArguments.Length == 1) { if (genericTypeDefinition == typeof(IList<>) || genericTypeDefinition == typeof(IEnumerable<>) || genericTypeDefinition == typeof(ICollection<>)) { Type collectionType = typeof(List<>).MakeGenericType(genericArguments); return GenerateCollection(collectionType, collectionSize, createdObjectReferences); } if (genericTypeDefinition == typeof(IQueryable<>)) { return GenerateQueryable(type, collectionSize, createdObjectReferences); } Type closedCollectionType = typeof(ICollection<>).MakeGenericType(genericArguments[0]); if (closedCollectionType.IsAssignableFrom(type)) { return GenerateCollection(type, collectionSize, createdObjectReferences); } } if (genericArguments.Length == 2) { if (genericTypeDefinition == typeof(IDictionary<,>)) { Type dictionaryType = typeof(Dictionary<,>).MakeGenericType(genericArguments); return GenerateDictionary(dictionaryType, collectionSize, createdObjectReferences); } Type closedDictionaryType = typeof(IDictionary<,>).MakeGenericType(genericArguments[0], genericArguments[1]); if (closedDictionaryType.IsAssignableFrom(type)) { return GenerateDictionary(type, collectionSize, createdObjectReferences); } } if (type.IsPublic || type.IsNestedPublic) { return GenerateComplexObject(type, createdObjectReferences); } return null; } private static object GenerateTuple(Type type, Dictionary<Type, object> createdObjectReferences) { Type[] genericArgs = type.GetGenericArguments(); object[] parameterValues = new object[genericArgs.Length]; bool failedToCreateTuple = true; ObjectGenerator objectGenerator = new ObjectGenerator(); for (int i = 0; i < genericArgs.Length; i++) { parameterValues[i] = objectGenerator.GenerateObject(genericArgs[i], createdObjectReferences); failedToCreateTuple &= parameterValues[i] == null; } if (failedToCreateTuple) { return null; } object result = Activator.CreateInstance(type, parameterValues); return result; } private static bool IsTuple(Type genericTypeDefinition) { return genericTypeDefinition == typeof(Tuple<>) || genericTypeDefinition == typeof(Tuple<,>) || genericTypeDefinition == typeof(Tuple<,,>) || genericTypeDefinition == typeof(Tuple<,,,>) || genericTypeDefinition == typeof(Tuple<,,,,>) || genericTypeDefinition == typeof(Tuple<,,,,,>) || genericTypeDefinition == typeof(Tuple<,,,,,,>) || genericTypeDefinition == typeof(Tuple<,,,,,,,>); } private static object GenerateKeyValuePair(Type keyValuePairType, Dictionary<Type, object> createdObjectReferences) { Type[] genericArgs = keyValuePairType.GetGenericArguments(); Type typeK = genericArgs[0]; Type typeV = genericArgs[1]; ObjectGenerator objectGenerator = new ObjectGenerator(); object keyObject = objectGenerator.GenerateObject(typeK, createdObjectReferences); object valueObject = objectGenerator.GenerateObject(typeV, createdObjectReferences); if (keyObject == null && valueObject == null) { // Failed to create key and values return null; } object result = Activator.CreateInstance(keyValuePairType, keyObject, valueObject); return result; } private static object GenerateArray(Type arrayType, int size, Dictionary<Type, object> createdObjectReferences) { Type type = arrayType.GetElementType(); Array result = Array.CreateInstance(type, size); bool areAllElementsNull = true; ObjectGenerator objectGenerator = new ObjectGenerator(); for (int i = 0; i < size; i++) { object element = objectGenerator.GenerateObject(type, createdObjectReferences); result.SetValue(element, i); areAllElementsNull &= element == null; } if (areAllElementsNull) { return null; } return result; } private static object GenerateDictionary(Type dictionaryType, int size, Dictionary<Type, object> createdObjectReferences) { Type typeK = typeof(object); Type typeV = typeof(object); if (dictionaryType.IsGenericType) { Type[] genericArgs = dictionaryType.GetGenericArguments(); typeK = genericArgs[0]; typeV = genericArgs[1]; } object result = Activator.CreateInstance(dictionaryType); MethodInfo addMethod = dictionaryType.GetMethod("Add") ?? dictionaryType.GetMethod("TryAdd"); MethodInfo containsMethod = dictionaryType.GetMethod("Contains") ?? dictionaryType.GetMethod("ContainsKey"); ObjectGenerator objectGenerator = new ObjectGenerator(); for (int i = 0; i < size; i++) { object newKey = objectGenerator.GenerateObject(typeK, createdObjectReferences); if (newKey == null) { // Cannot generate a valid key return null; } bool containsKey = (bool)containsMethod.Invoke(result, new object[] { newKey }); if (!containsKey) { object newValue = objectGenerator.GenerateObject(typeV, createdObjectReferences); addMethod.Invoke(result, new object[] { newKey, newValue }); } } return result; } private static object GenerateEnum(Type enumType) { Array possibleValues = Enum.GetValues(enumType); if (possibleValues.Length > 0) { return possibleValues.GetValue(0); } return null; } private static object GenerateQueryable(Type queryableType, int size, Dictionary<Type, object> createdObjectReferences) { bool isGeneric = queryableType.IsGenericType; object list; if (isGeneric) { Type listType = typeof(List<>).MakeGenericType(queryableType.GetGenericArguments()); list = GenerateCollection(listType, size, createdObjectReferences); } else { list = GenerateArray(typeof(object[]), size, createdObjectReferences); } if (list == null) { return null; } if (isGeneric) { Type argumentType = typeof(IEnumerable<>).MakeGenericType(queryableType.GetGenericArguments()); MethodInfo asQueryableMethod = typeof(Queryable).GetMethod("AsQueryable", new[] { argumentType }); return asQueryableMethod.Invoke(null, new[] { list }); } return Queryable.AsQueryable((IEnumerable)list); } private static object GenerateCollection(Type collectionType, int size, Dictionary<Type, object> createdObjectReferences) { Type type = collectionType.IsGenericType ? collectionType.GetGenericArguments()[0] : typeof(object); object result = Activator.CreateInstance(collectionType); MethodInfo addMethod = collectionType.GetMethod("Add"); bool areAllElementsNull = true; ObjectGenerator objectGenerator = new ObjectGenerator(); for (int i = 0; i < size; i++) { object element = objectGenerator.GenerateObject(type, createdObjectReferences); addMethod.Invoke(result, new object[] { element }); areAllElementsNull &= element == null; } if (areAllElementsNull) { return null; } return result; } private static object GenerateNullable(Type nullableType, Dictionary<Type, object> createdObjectReferences) { Type type = nullableType.GetGenericArguments()[0]; ObjectGenerator objectGenerator = new ObjectGenerator(); return objectGenerator.GenerateObject(type, createdObjectReferences); } private static object GenerateComplexObject(Type type, Dictionary<Type, object> createdObjectReferences) { object result = null; if (createdObjectReferences.TryGetValue(type, out result)) { // The object has been created already, just return it. This will handle the circular reference case. return result; } if (type.IsValueType) { result = Activator.CreateInstance(type); } else { ConstructorInfo defaultCtor = type.GetConstructor(Type.EmptyTypes); if (defaultCtor == null) { // Cannot instantiate the type because it doesn't have a default constructor return null; } result = defaultCtor.Invoke(new object[0]); } createdObjectReferences.Add(type, result); SetPublicProperties(type, result, createdObjectReferences); SetPublicFields(type, result, createdObjectReferences); return result; } private static void SetPublicProperties(Type type, object obj, Dictionary<Type, object> createdObjectReferences) { PropertyInfo[] properties = type.GetProperties(BindingFlags.Public | BindingFlags.Instance); ObjectGenerator objectGenerator = new ObjectGenerator(); foreach (PropertyInfo property in properties) { if (property.CanWrite) { object propertyValue = objectGenerator.GenerateObject(property.PropertyType, createdObjectReferences); property.SetValue(obj, propertyValue, null); } } } private static void SetPublicFields(Type type, object obj, Dictionary<Type, object> createdObjectReferences) { FieldInfo[] fields = type.GetFields(BindingFlags.Public | BindingFlags.Instance); ObjectGenerator objectGenerator = new ObjectGenerator(); foreach (FieldInfo field in fields) { object fieldValue = objectGenerator.GenerateObject(field.FieldType, createdObjectReferences); field.SetValue(obj, fieldValue); } } private class SimpleTypeObjectGenerator { private long _index = 0; private static readonly Dictionary<Type, Func<long, object>> DefaultGenerators = InitializeGenerators(); [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Justification = "These are simple type factories and cannot be split up.")] private static Dictionary<Type, Func<long, object>> InitializeGenerators() { return new Dictionary<Type, Func<long, object>> { { typeof(Boolean), index => true }, { typeof(Byte), index => (Byte)64 }, { typeof(Char), index => (Char)65 }, { typeof(DateTime), index => DateTime.Now }, { typeof(DateTimeOffset), index => new DateTimeOffset(DateTime.Now) }, { typeof(DBNull), index => DBNull.Value }, { typeof(Decimal), index => (Decimal)index }, { typeof(Double), index => (Double)(index + 0.1) }, { typeof(Guid), index => Guid.NewGuid() }, { typeof(Int16), index => (Int16)(index % Int16.MaxValue) }, { typeof(Int32), index => (Int32)(index % Int32.MaxValue) }, { typeof(Int64), index => (Int64)index }, { typeof(Object), index => new object() }, { typeof(SByte), index => (SByte)64 }, { typeof(Single), index => (Single)(index + 0.1) }, { typeof(String), index => { return String.Format(CultureInfo.CurrentCulture, "sample string {0}", index); } }, { typeof(TimeSpan), index => { return TimeSpan.FromTicks(1234567); } }, { typeof(UInt16), index => (UInt16)(index % UInt16.MaxValue) }, { typeof(UInt32), index => (UInt32)(index % UInt32.MaxValue) }, { typeof(UInt64), index => (UInt64)index }, { typeof(Uri), index => { return new Uri(String.Format(CultureInfo.CurrentCulture, "http://webapihelppage{0}.com", index)); } }, }; } public static bool CanGenerateObject(Type type) { return DefaultGenerators.ContainsKey(type); } public object GenerateObject(Type type) { return DefaultGenerators[type](++_index); } } } }
apache-2.0
xasx/assertj-core
src/test/java/org/assertj/core/api/bigdecimal/BigDecimalAssert_usingDefaultComparator_Test.java
1806
/* * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. * * Copyright 2012-2019 the original author or authors. */ package org.assertj.core.api.bigdecimal; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.MockitoAnnotations.initMocks; import java.math.BigDecimal; import java.util.Comparator; import org.assertj.core.api.BigDecimalAssert; import org.assertj.core.api.BigDecimalAssertBaseTest; import org.assertj.core.internal.BigDecimals; import org.assertj.core.internal.Objects; import org.junit.jupiter.api.BeforeEach; import org.mockito.Mock; /** * Tests for <code>{@link BigDecimalAssert#usingDefaultComparator()}</code>. * * @author Joel Costigliola * @author Mikhail Mazursky */ public class BigDecimalAssert_usingDefaultComparator_Test extends BigDecimalAssertBaseTest { @Mock private Comparator<BigDecimal> comparator; @BeforeEach public void before() { initMocks(this); assertions.usingComparator(comparator); } @Override protected BigDecimalAssert invoke_api_method() { return assertions.usingDefaultComparator(); } @Override protected void verify_internal_effects() { assertThat(Objects.instance()).isSameAs(getObjects(assertions)); assertThat(BigDecimals.instance()).isSameAs(getComparables(assertions)); } }
apache-2.0
googleapis/google-cloud-dotnet
apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.GeneratedSnippets/InstanceGroupManagersClient.InsertRequestObjectAsyncSnippet.g.cs
2871
// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // https://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. // Generated code. DO NOT EDIT! namespace Google.Cloud.Compute.V1.Snippets { // [START compute_v1_generated_InstanceGroupManagers_Insert_async] using Google.Cloud.Compute.V1; using System.Threading.Tasks; using lro = Google.LongRunning; public sealed partial class GeneratedInstanceGroupManagersClientSnippets { /// <summary>Snippet for InsertAsync</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public async Task InsertRequestObjectAsync() { // Create client InstanceGroupManagersClient instanceGroupManagersClient = await InstanceGroupManagersClient.CreateAsync(); // Initialize request argument(s) InsertInstanceGroupManagerRequest request = new InsertInstanceGroupManagerRequest { Zone = "", RequestId = "", Project = "", InstanceGroupManagerResource = new InstanceGroupManager(), }; // Make the request lro::Operation<Operation, Operation> response = await instanceGroupManagersClient.InsertAsync(request); // Poll until the returned long-running operation is complete lro::Operation<Operation, Operation> completedResponse = await response.PollUntilCompletedAsync(); // Retrieve the operation result Operation result = completedResponse.Result; // Or get the name of the operation string operationName = response.Name; // This name can be stored, then the long-running operation retrieved later by name lro::Operation<Operation, Operation> retrievedResponse = await instanceGroupManagersClient.PollOnceInsertAsync(operationName); // Check if the retrieved long-running operation has completed if (retrievedResponse.IsCompleted) { // If it has completed, then access the result Operation retrievedResult = retrievedResponse.Result; } } } // [END compute_v1_generated_InstanceGroupManagers_Insert_async] }
apache-2.0
gitpan/GOOGLE-ADWORDS-PERL-CLIENT
lib/Google/Ads/AdWords/v201409/CampaignSharedSetService/mutate.pm
2022
package Google::Ads::AdWords::v201409::CampaignSharedSetService::mutate; use strict; use warnings; { # BLOCK to scope variables sub get_xmlns { 'https://adwords.google.com/api/adwords/cm/v201409' } __PACKAGE__->__set_name('mutate'); __PACKAGE__->__set_nillable(); __PACKAGE__->__set_minOccurs(); __PACKAGE__->__set_maxOccurs(); __PACKAGE__->__set_ref(); use base qw( SOAP::WSDL::XSD::Typelib::Element Google::Ads::SOAP::Typelib::ComplexType ); our $XML_ATTRIBUTE_CLASS; undef $XML_ATTRIBUTE_CLASS; sub __get_attr_class { return $XML_ATTRIBUTE_CLASS; } use Class::Std::Fast::Storable constructor => 'none'; use base qw(Google::Ads::SOAP::Typelib::ComplexType); { # BLOCK to scope variables my %operations_of :ATTR(:get<operations>); __PACKAGE__->_factory( [ qw( operations ) ], { 'operations' => \%operations_of, }, { 'operations' => 'Google::Ads::AdWords::v201409::CampaignSharedSetOperation', }, { 'operations' => 'operations', } ); } # end BLOCK } # end of BLOCK 1; =pod =head1 NAME Google::Ads::AdWords::v201409::CampaignSharedSetService::mutate =head1 DESCRIPTION Perl data type class for the XML Schema defined element mutate from the namespace https://adwords.google.com/api/adwords/cm/v201409. Applies the list of mutate operations. @param operations the operations to apply @return the modified list of CampaignSharedSet associations @throws ApiException =head1 PROPERTIES The following properties may be accessed using get_PROPERTY / set_PROPERTY methods: =over =item * operations $element->set_operations($data); $element->get_operations(); =back =head1 METHODS =head2 new my $element = Google::Ads::AdWords::v201409::CampaignSharedSetService::mutate->new($data); Constructor. The following data structure may be passed to new(): { operations => $a_reference_to, # see Google::Ads::AdWords::v201409::CampaignSharedSetOperation }, =head1 AUTHOR Generated by SOAP::WSDL =cut
apache-2.0
barmalei/zebkit
apidoc/light/classes/zebkit.ui.event.FocusEvent.html
93098
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>zebkit.ui.event.FocusEvent - zebkit</title> <link rel="stylesheet" href="http://yui.yahooapis.com/3.9.1/build/cssgrids/cssgrids-min.css"> <link rel="stylesheet" href="../assets/vendor/prettify/prettify-min.css"> <link rel="stylesheet" href="../assets/css/dune-light.css"> <link rel="stylesheet" href="../assets/css/main.light.css" id="site_styles"> <script src="http://yui.yahooapis.com/combo?3.9.1/build/yui/yui-min.js"></script> </head> <body class="yui3-skin-sam"> <div id="doc" style="padding-top:16px;"> <div class="yui3-g"> <table style="width:auto"> <tr style="background:none"> <td valign="top" align="left" > <div id="sidebar" class="yui3-u"> <div id="classes" class="sidebox"> <div class="hd"> <h2 class="no-toc">All packages</h2> </div> <div class="bd"> <ul> <li> <a href="../classes/environment.html">environment</a> </li> <li> <a href="../classes/zebkit.html">zebkit</a> </li> <li> <a href="../classes/zebkit.data.html">zebkit.data</a> </li> <li> <a href="../classes/zebkit.draw.html">zebkit.draw</a> </li> <li> <a href="../classes/zebkit.io.html">zebkit.io</a> </li> <li> <a href="../classes/zebkit.layout.html">zebkit.layout</a> </li> <li> <a href="../classes/zebkit.ui.html">zebkit.ui</a> </li> <li> <a href="../classes/zebkit.ui.date.html">zebkit.ui.date</a> </li> <li> <a href="../classes/zebkit.ui.design.html">zebkit.ui.design</a> </li> <li> <a href="../classes/zebkit.ui.event.html">zebkit.ui.event</a> </li> <li> <a href="../classes/zebkit.ui.grid.html">zebkit.ui.grid</a> </li> <li> <a href="../classes/zebkit.ui.tree.html">zebkit.ui.tree</a> </li> <li> <a href="../classes/zebkit.ui.vk.html">zebkit.ui.vk</a> </li> <li> <a href="../classes/zebkit.ui.web.html">zebkit.ui.web</a> </li> <li> <a href="../classes/zebkit.util.html">zebkit.util</a> </li> <li> <a href="../classes/zebkit.web.html">zebkit.web</a> </li> </ul> </div> </div> <div id="classes" class="sidebox"> <div class="hd"> <table border="0" cellpadding="0" cellspecing="0"> <tr> <td> <h2 class="no-toc">All classes</h2> </td> <td> <input id="search" style="width:95%;" type=text value=""/> </td> </tr> </table> </div> <div class="bd"> <table id="allClasses" style="background:none;" border="0"> <tr class="classNameCell" className="zebkit.Class" name="allClassesItem"> <td> <a href="../classes/zebkit.Class.html">zebkit.Class</a> </td> </tr> <tr class="classNameCell" className="zebkit.Class.zObject" name="allClassesItem"> <td> <a href="../classes/zebkit.Class.zObject.html">zebkit.Class.zObject</a> </td> </tr> <tr class="classNameCell" className="zebkit.data.DataModel" name="allClassesItem"> <td> <a href="../classes/zebkit.data.DataModel.html">zebkit.data.DataModel</a> </td> </tr> <tr class="classNameCell" className="zebkit.data.Item" name="allClassesItem"> <td> <a href="../classes/zebkit.data.Item.html">zebkit.data.Item</a> </td> </tr> <tr class="classNameCell" className="zebkit.data.ListModel" name="allClassesItem"> <td> <a href="../classes/zebkit.data.ListModel.html">zebkit.data.ListModel</a> </td> </tr> <tr class="classNameCell" className="zebkit.data.Matrix" name="allClassesItem"> <td> <a href="../classes/zebkit.data.Matrix.html">zebkit.data.Matrix</a> </td> </tr> <tr class="classNameCell" className="zebkit.data.SingleLineTxt" name="allClassesItem"> <td> <a href="../classes/zebkit.data.SingleLineTxt.html">zebkit.data.SingleLineTxt</a> </td> </tr> <tr class="classNameCell" className="zebkit.data.Text" name="allClassesItem"> <td> <a href="../classes/zebkit.data.Text.html">zebkit.data.Text</a> </td> </tr> <tr class="classNameCell" className="zebkit.data.TextEvent" name="allClassesItem"> <td> <a href="../classes/zebkit.data.TextEvent.html">zebkit.data.TextEvent</a> </td> </tr> <tr class="classNameCell" className="zebkit.data.TextModel" name="allClassesItem"> <td> <a href="../classes/zebkit.data.TextModel.html">zebkit.data.TextModel</a> </td> </tr> <tr class="classNameCell" className="zebkit.data.TreeModel" name="allClassesItem"> <td> <a href="../classes/zebkit.data.TreeModel.html">zebkit.data.TreeModel</a> </td> </tr> <tr class="classNameCell" className="zebkit.DoIt" name="allClassesItem"> <td> <a href="../classes/zebkit.DoIt.html">zebkit.DoIt</a> </td> </tr> <tr class="classNameCell" className="zebkit.draw.ArrowView" name="allClassesItem"> <td> <a href="../classes/zebkit.draw.ArrowView.html">zebkit.draw.ArrowView</a> </td> </tr> <tr class="classNameCell" className="zebkit.draw.BaseTextRender" name="allClassesItem"> <td> <a href="../classes/zebkit.draw.BaseTextRender.html">zebkit.draw.BaseTextRender</a> </td> </tr> <tr class="classNameCell" className="zebkit.draw.BaseViewProvider" name="allClassesItem"> <td> <a href="../classes/zebkit.draw.BaseViewProvider.html">zebkit.draw.BaseViewProvider</a> </td> </tr> <tr class="classNameCell" className="zebkit.draw.Border" name="allClassesItem"> <td> <a href="../classes/zebkit.draw.Border.html">zebkit.draw.Border</a> </td> </tr> <tr class="classNameCell" className="zebkit.draw.CheckboxView" name="allClassesItem"> <td> <a href="../classes/zebkit.draw.CheckboxView.html">zebkit.draw.CheckboxView</a> </td> </tr> <tr class="classNameCell" className="zebkit.draw.CompositeView" name="allClassesItem"> <td> <a href="../classes/zebkit.draw.CompositeView.html">zebkit.draw.CompositeView</a> </td> </tr> <tr class="classNameCell" className="zebkit.draw.CutStringRender" name="allClassesItem"> <td> <a href="../classes/zebkit.draw.CutStringRender.html">zebkit.draw.CutStringRender</a> </td> </tr> <tr class="classNameCell" className="zebkit.draw.DecoratedTextRender" name="allClassesItem"> <td> <a href="../classes/zebkit.draw.DecoratedTextRender.html">zebkit.draw.DecoratedTextRender</a> </td> </tr> <tr class="classNameCell" className="zebkit.draw.Dotted" name="allClassesItem"> <td> <a href="../classes/zebkit.draw.Dotted.html">zebkit.draw.Dotted</a> </td> </tr> <tr class="classNameCell" className="zebkit.draw.Etched" name="allClassesItem"> <td> <a href="../classes/zebkit.draw.Etched.html">zebkit.draw.Etched</a> </td> </tr> <tr class="classNameCell" className="zebkit.draw.FunctionRender" name="allClassesItem"> <td> <a href="../classes/zebkit.draw.FunctionRender.html">zebkit.draw.FunctionRender</a> </td> </tr> <tr class="classNameCell" className="zebkit.draw.Gradient" name="allClassesItem"> <td> <a href="../classes/zebkit.draw.Gradient.html">zebkit.draw.Gradient</a> </td> </tr> <tr class="classNameCell" className="zebkit.draw.Line" name="allClassesItem"> <td> <a href="../classes/zebkit.draw.Line.html">zebkit.draw.Line</a> </td> </tr> <tr class="classNameCell" className="zebkit.draw.PasswordText" name="allClassesItem"> <td> <a href="../classes/zebkit.draw.PasswordText.html">zebkit.draw.PasswordText</a> </td> </tr> <tr class="classNameCell" className="zebkit.draw.Pattern" name="allClassesItem"> <td> <a href="../classes/zebkit.draw.Pattern.html">zebkit.draw.Pattern</a> </td> </tr> <tr class="classNameCell" className="zebkit.draw.PentahedronShape" name="allClassesItem"> <td> <a href="../classes/zebkit.draw.PentahedronShape.html">zebkit.draw.PentahedronShape</a> </td> </tr> <tr class="classNameCell" className="zebkit.draw.Picture" name="allClassesItem"> <td> <a href="../classes/zebkit.draw.Picture.html">zebkit.draw.Picture</a> </td> </tr> <tr class="classNameCell" className="zebkit.draw.Radial" name="allClassesItem"> <td> <a href="../classes/zebkit.draw.Radial.html">zebkit.draw.Radial</a> </td> </tr> <tr class="classNameCell" className="zebkit.draw.RadioView" name="allClassesItem"> <td> <a href="../classes/zebkit.draw.RadioView.html">zebkit.draw.RadioView</a> </td> </tr> <tr class="classNameCell" className="zebkit.draw.Raised" name="allClassesItem"> <td> <a href="../classes/zebkit.draw.Raised.html">zebkit.draw.Raised</a> </td> </tr> <tr class="classNameCell" className="zebkit.draw.Render" name="allClassesItem"> <td> <a href="../classes/zebkit.draw.Render.html">zebkit.draw.Render</a> </td> </tr> <tr class="classNameCell" className="zebkit.draw.rgb" name="allClassesItem"> <td> <a href="../classes/zebkit.draw.rgb.html">zebkit.draw.rgb</a> </td> </tr> <tr class="classNameCell" className="zebkit.draw.RoundBorder" name="allClassesItem"> <td> <a href="../classes/zebkit.draw.RoundBorder.html">zebkit.draw.RoundBorder</a> </td> </tr> <tr class="classNameCell" className="zebkit.draw.Shape" name="allClassesItem"> <td> <a href="../classes/zebkit.draw.Shape.html">zebkit.draw.Shape</a> </td> </tr> <tr class="classNameCell" className="zebkit.draw.StringRender" name="allClassesItem"> <td> <a href="../classes/zebkit.draw.StringRender.html">zebkit.draw.StringRender</a> </td> </tr> <tr class="classNameCell" className="zebkit.draw.Sunken" name="allClassesItem"> <td> <a href="../classes/zebkit.draw.Sunken.html">zebkit.draw.Sunken</a> </td> </tr> <tr class="classNameCell" className="zebkit.draw.TextRender" name="allClassesItem"> <td> <a href="../classes/zebkit.draw.TextRender.html">zebkit.draw.TextRender</a> </td> </tr> <tr class="classNameCell" className="zebkit.draw.ThumbView" name="allClassesItem"> <td> <a href="../classes/zebkit.draw.ThumbView.html">zebkit.draw.ThumbView</a> </td> </tr> <tr class="classNameCell" className="zebkit.draw.TitledBorder" name="allClassesItem"> <td> <a href="../classes/zebkit.draw.TitledBorder.html">zebkit.draw.TitledBorder</a> </td> </tr> <tr class="classNameCell" className="zebkit.draw.ToggleView" name="allClassesItem"> <td> <a href="../classes/zebkit.draw.ToggleView.html">zebkit.draw.ToggleView</a> </td> </tr> <tr class="classNameCell" className="zebkit.draw.TriangleShape" name="allClassesItem"> <td> <a href="../classes/zebkit.draw.TriangleShape.html">zebkit.draw.TriangleShape</a> </td> </tr> <tr class="classNameCell" className="zebkit.draw.View" name="allClassesItem"> <td> <a href="../classes/zebkit.draw.View.html">zebkit.draw.View</a> </td> </tr> <tr class="classNameCell" className="zebkit.draw.ViewSet" name="allClassesItem"> <td> <a href="../classes/zebkit.draw.ViewSet.html">zebkit.draw.ViewSet</a> </td> </tr> <tr class="classNameCell" className="zebkit.draw.WrappedTextRender" name="allClassesItem"> <td> <a href="../classes/zebkit.draw.WrappedTextRender.html">zebkit.draw.WrappedTextRender</a> </td> </tr> <tr class="classNameCell" className="zebkit.Dummy" name="allClassesItem"> <td> <a href="../classes/zebkit.Dummy.html">zebkit.Dummy</a> </td> </tr> <tr class="classNameCell" className="zebkit.Event" name="allClassesItem"> <td> <a href="../classes/zebkit.Event.html">zebkit.Event</a> </td> </tr> <tr class="classNameCell" className="zebkit.EventProducer" name="allClassesItem"> <td> <a href="../classes/zebkit.EventProducer.html">zebkit.EventProducer</a> </td> </tr> <tr class="classNameCell" className="zebkit.Font" name="allClassesItem"> <td> <a href="../classes/zebkit.Font.html">zebkit.Font</a> </td> </tr> <tr class="classNameCell" className="zebkit.Interface" name="allClassesItem"> <td> <a href="../classes/zebkit.Interface.html">zebkit.Interface</a> </td> </tr> <tr class="classNameCell" className="zebkit.io.HTTP" name="allClassesItem"> <td> <a href="../classes/zebkit.io.HTTP.html">zebkit.io.HTTP</a> </td> </tr> <tr class="classNameCell" className="zebkit.io.JRPC" name="allClassesItem"> <td> <a href="../classes/zebkit.io.JRPC.html">zebkit.io.JRPC</a> </td> </tr> <tr class="classNameCell" className="zebkit.io.Service" name="allClassesItem"> <td> <a href="../classes/zebkit.io.Service.html">zebkit.io.Service</a> </td> </tr> <tr class="classNameCell" className="zebkit.io.XRPC" name="allClassesItem"> <td> <a href="../classes/zebkit.io.XRPC.html">zebkit.io.XRPC</a> </td> </tr> <tr class="classNameCell" className="zebkit.layout.BorderLayout" name="allClassesItem"> <td> <a href="../classes/zebkit.layout.BorderLayout.html">zebkit.layout.BorderLayout</a> </td> </tr> <tr class="classNameCell" className="zebkit.layout.Constraints" name="allClassesItem"> <td> <a href="../classes/zebkit.layout.Constraints.html">zebkit.layout.Constraints</a> </td> </tr> <tr class="classNameCell" className="zebkit.layout.FlowLayout" name="allClassesItem"> <td> <a href="../classes/zebkit.layout.FlowLayout.html">zebkit.layout.FlowLayout</a> </td> </tr> <tr class="classNameCell" className="zebkit.layout.GridLayout" name="allClassesItem"> <td> <a href="../classes/zebkit.layout.GridLayout.html">zebkit.layout.GridLayout</a> </td> </tr> <tr class="classNameCell" className="zebkit.layout.Layout" name="allClassesItem"> <td> <a href="../classes/zebkit.layout.Layout.html">zebkit.layout.Layout</a> </td> </tr> <tr class="classNameCell" className="zebkit.layout.Layoutable" name="allClassesItem"> <td> <a href="../classes/zebkit.layout.Layoutable.html">zebkit.layout.Layoutable</a> </td> </tr> <tr class="classNameCell" className="zebkit.layout.ListLayout" name="allClassesItem"> <td> <a href="../classes/zebkit.layout.ListLayout.html">zebkit.layout.ListLayout</a> </td> </tr> <tr class="classNameCell" className="zebkit.layout.PercentLayout" name="allClassesItem"> <td> <a href="../classes/zebkit.layout.PercentLayout.html">zebkit.layout.PercentLayout</a> </td> </tr> <tr class="classNameCell" className="zebkit.layout.RasterLayout" name="allClassesItem"> <td> <a href="../classes/zebkit.layout.RasterLayout.html">zebkit.layout.RasterLayout</a> </td> </tr> <tr class="classNameCell" className="zebkit.layout.StackLayout" name="allClassesItem"> <td> <a href="../classes/zebkit.layout.StackLayout.html">zebkit.layout.StackLayout</a> </td> </tr> <tr class="classNameCell" className="zebkit.Listeners" name="allClassesItem"> <td> <a href="../classes/zebkit.Listeners.html">zebkit.Listeners</a> </td> </tr> <tr class="classNameCell" className="zebkit.Package" name="allClassesItem"> <td> <a href="../classes/zebkit.Package.html">zebkit.Package</a> </td> </tr> <tr class="classNameCell" className="zebkit.PathSearch" name="allClassesItem"> <td> <a href="../classes/zebkit.PathSearch.html">zebkit.PathSearch</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.ArrowButton" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.ArrowButton.html">zebkit.ui.ArrowButton</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.BaseList" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.BaseList.html">zebkit.ui.BaseList</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.BoldLabel" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.BoldLabel.html">zebkit.ui.BoldLabel</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.BorderPan" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.BorderPan.html">zebkit.ui.BorderPan</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.Button" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.Button.html">zebkit.ui.Button</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.Checkbox" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.Checkbox.html">zebkit.ui.Checkbox</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.Checkbox.Box" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.Checkbox.Box.html">zebkit.ui.Checkbox.Box</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.CollapsiblePan" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.CollapsiblePan.html">zebkit.ui.CollapsiblePan</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.Combo" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.Combo.html">zebkit.ui.Combo</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.Combo.ComboPadPan" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.Combo.ComboPadPan.html">zebkit.ui.Combo.ComboPadPan</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.Combo.ContentPan" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.Combo.ContentPan.html">zebkit.ui.Combo.ContentPan</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.Combo.EditableContentPan" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.Combo.EditableContentPan.html">zebkit.ui.Combo.EditableContentPan</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.Combo.ReadonlyContentPan" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.Combo.ReadonlyContentPan.html">zebkit.ui.Combo.ReadonlyContentPan</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.CompList" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.CompList.html">zebkit.ui.CompList</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.CompRender" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.CompRender.html">zebkit.ui.CompRender</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.Cursor" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.Cursor.html">zebkit.ui.Cursor</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.date.Calendar" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.date.Calendar.html">zebkit.ui.date.Calendar</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.date.Calendar.MonthsCombo" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.date.Calendar.MonthsCombo.html">zebkit.ui.date.Calendar.MonthsCombo</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.date.DateInputField" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.date.DateInputField.html">zebkit.ui.date.DateInputField</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.date.DateRangeInput" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.date.DateRangeInput.html">zebkit.ui.date.DateRangeInput</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.date.DateTextField" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.date.DateTextField.html">zebkit.ui.date.DateTextField</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.date.MonthDaysGrid" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.date.MonthDaysGrid.html">zebkit.ui.date.MonthDaysGrid</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.date.MonthDaysGrid.DayPan" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.date.MonthDaysGrid.DayPan.html">zebkit.ui.date.MonthDaysGrid.DayPan</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.date.PopupCalendarMix" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.date.PopupCalendarMix.html">zebkit.ui.date.PopupCalendarMix</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.design.FormTreeModel" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.design.FormTreeModel.html">zebkit.ui.design.FormTreeModel</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.design.ShaperBorder" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.design.ShaperBorder.html">zebkit.ui.design.ShaperBorder</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.design.ShaperPan" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.design.ShaperPan.html">zebkit.ui.design.ShaperPan</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.DrawFocusMarker" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.DrawFocusMarker.html">zebkit.ui.DrawFocusMarker</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.event.Clipboard" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.event.Clipboard.html">zebkit.ui.event.Clipboard</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.event.CompEvent" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.event.CompEvent.html">zebkit.ui.event.CompEvent</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.event.CursorManager" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.event.CursorManager.html">zebkit.ui.event.CursorManager</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.event.EventManager" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.event.EventManager.html">zebkit.ui.event.EventManager</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.event.FocusEvent" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.event.FocusEvent.html">zebkit.ui.event.FocusEvent</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.event.FocusManager" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.event.FocusManager.html">zebkit.ui.event.FocusManager</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.event.KeyEvent" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.event.KeyEvent.html">zebkit.ui.event.KeyEvent</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.event.Manager" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.event.Manager.html">zebkit.ui.event.Manager</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.event.MenuEvent" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.event.MenuEvent.html">zebkit.ui.event.MenuEvent</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.event.PointerEvent" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.event.PointerEvent.html">zebkit.ui.event.PointerEvent</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.event.ShortcutEvent" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.event.ShortcutEvent.html">zebkit.ui.event.ShortcutEvent</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.event.ShortcutManager" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.event.ShortcutManager.html">zebkit.ui.event.ShortcutManager</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.event.TrackInputEventState" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.event.TrackInputEventState.html">zebkit.ui.event.TrackInputEventState</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.event.WinEvent" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.event.WinEvent.html">zebkit.ui.event.WinEvent</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.EvStatePan" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.EvStatePan.html">zebkit.ui.EvStatePan</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.FireEventRepeatedly" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.FireEventRepeatedly.html">zebkit.ui.FireEventRepeatedly</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.grid.BaseCaption" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.grid.BaseCaption.html">zebkit.ui.grid.BaseCaption</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.grid.CaptionViewProvider" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.grid.CaptionViewProvider.html">zebkit.ui.grid.CaptionViewProvider</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.grid.CellSelectMode" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.grid.CellSelectMode.html">zebkit.ui.grid.CellSelectMode</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.grid.CellsVisibility" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.grid.CellsVisibility.html">zebkit.ui.grid.CellsVisibility</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.grid.ColSelectMode" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.grid.ColSelectMode.html">zebkit.ui.grid.ColSelectMode</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.grid.CompGridCaption" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.grid.CompGridCaption.html">zebkit.ui.grid.CompGridCaption</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.grid.CompGridCaption.TitlePan" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.grid.CompGridCaption.TitlePan.html">zebkit.ui.grid.CompGridCaption.TitlePan</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.grid.DefEditors" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.grid.DefEditors.html">zebkit.ui.grid.DefEditors</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.grid.DefViews" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.grid.DefViews.html">zebkit.ui.grid.DefViews</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.grid.Grid" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.grid.Grid.html">zebkit.ui.grid.Grid</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.grid.GridCaption" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.grid.GridCaption.html">zebkit.ui.grid.GridCaption</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.grid.GridStretchPan" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.grid.GridStretchPan.html">zebkit.ui.grid.GridStretchPan</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.grid.LeftCompGridCaption" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.grid.LeftCompGridCaption.html">zebkit.ui.grid.LeftCompGridCaption</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.grid.LeftGridCaption" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.grid.LeftGridCaption.html">zebkit.ui.grid.LeftGridCaption</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.grid.Metrics" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.grid.Metrics.html">zebkit.ui.grid.Metrics</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.grid.RowSelectMode" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.grid.RowSelectMode.html">zebkit.ui.grid.RowSelectMode</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.grid.StrippedRows" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.grid.StrippedRows.html">zebkit.ui.grid.StrippedRows</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.Group" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.Group.html">zebkit.ui.Group</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.HostDecorativeViews" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.HostDecorativeViews.html">zebkit.ui.HostDecorativeViews</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.ImageLabel" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.ImageLabel.html">zebkit.ui.ImageLabel</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.ImagePan" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.ImagePan.html">zebkit.ui.ImagePan</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.Label" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.Label.html">zebkit.ui.Label</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.Line" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.Line.html">zebkit.ui.Line</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.LinearRulerPan" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.LinearRulerPan.html">zebkit.ui.LinearRulerPan</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.Link" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.Link.html">zebkit.ui.Link</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.List" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.List.html">zebkit.ui.List</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.List.ViewProvider" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.List.ViewProvider.html">zebkit.ui.List.ViewProvider</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.Menu" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.Menu.html">zebkit.ui.Menu</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.Menubar" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.Menubar.html">zebkit.ui.Menubar</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.MenuItem" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.MenuItem.html">zebkit.ui.MenuItem</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.MobileScrollMan" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.MobileScrollMan.html">zebkit.ui.MobileScrollMan</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.Panel" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.Panel.html">zebkit.ui.Panel</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.PassTextField" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.PassTextField.html">zebkit.ui.PassTextField</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.PointRulerPan" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.PointRulerPan.html">zebkit.ui.PointRulerPan</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.PointRulerPan.DeltaPointsGenerator" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.PointRulerPan.DeltaPointsGenerator.html">zebkit.ui.PointRulerPan.DeltaPointsGenerator</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.PointRulerPan.PointsGenerator" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.PointRulerPan.PointsGenerator.html">zebkit.ui.PointRulerPan.PointsGenerator</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.PopupLayer" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.PopupLayer.html">zebkit.ui.PopupLayer</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.PopupLayerMix" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.PopupLayerMix.html">zebkit.ui.PopupLayerMix</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.Progress" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.Progress.html">zebkit.ui.Progress</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.Radiobox" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.Radiobox.html">zebkit.ui.Radiobox</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.RootLayer" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.RootLayer.html">zebkit.ui.RootLayer</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.RootLayerMix" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.RootLayerMix.html">zebkit.ui.RootLayerMix</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.RulerPan" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.RulerPan.html">zebkit.ui.RulerPan</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.RulerPan.NumLabels" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.RulerPan.NumLabels.html">zebkit.ui.RulerPan.NumLabels</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.RulerPan.PercentageLabels" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.RulerPan.PercentageLabels.html">zebkit.ui.RulerPan.PercentageLabels</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.Scroll" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.Scroll.html">zebkit.ui.Scroll</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.ScrollManager" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.ScrollManager.html">zebkit.ui.ScrollManager</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.ScrollPan" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.ScrollPan.html">zebkit.ui.ScrollPan</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.Slider" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.Slider.html">zebkit.ui.Slider</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.SplitPan" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.SplitPan.html">zebkit.ui.SplitPan</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.StackPan" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.StackPan.html">zebkit.ui.StackPan</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.StatePan" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.StatePan.html">zebkit.ui.StatePan</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.StatusBarPan" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.StatusBarPan.html">zebkit.ui.StatusBarPan</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.Tabs" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.Tabs.html">zebkit.ui.Tabs</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.Tabs.TabView" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.Tabs.TabView.html">zebkit.ui.Tabs.TabView</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.TextArea" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.TextArea.html">zebkit.ui.TextArea</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.TextField" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.TextField.html">zebkit.ui.TextField</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.TextField.HintRender" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.TextField.HintRender.html">zebkit.ui.TextField.HintRender</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.Toolbar" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.Toolbar.html">zebkit.ui.Toolbar</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.Tooltip" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.Tooltip.html">zebkit.ui.Tooltip</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.TooltipManager" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.TooltipManager.html">zebkit.ui.TooltipManager</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.tree.BaseTree" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.tree.BaseTree.html">zebkit.ui.tree.BaseTree</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.tree.CompTree" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.tree.CompTree.html">zebkit.ui.tree.CompTree</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.tree.DefEditors" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.tree.DefEditors.html">zebkit.ui.tree.DefEditors</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.tree.DefViews" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.tree.DefViews.html">zebkit.ui.tree.DefViews</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.tree.Tree" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.tree.Tree.html">zebkit.ui.tree.Tree</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.ViewPan" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.ViewPan.html">zebkit.ui.ViewPan</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.web.CursorManager" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.web.CursorManager.html">zebkit.ui.web.CursorManager</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.web.HtmlCanvas" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.web.HtmlCanvas.html">zebkit.ui.web.HtmlCanvas</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.web.HtmlElement" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.web.HtmlElement.html">zebkit.ui.web.HtmlElement</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.web.HtmlFocusableElement" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.web.HtmlFocusableElement.html">zebkit.ui.web.HtmlFocusableElement</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.web.HtmlLayer" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.web.HtmlLayer.html">zebkit.ui.web.HtmlLayer</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.web.HtmlLink" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.web.HtmlLink.html">zebkit.ui.web.HtmlLink</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.web.HtmlScrollContent" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.web.HtmlScrollContent.html">zebkit.ui.web.HtmlScrollContent</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.web.HtmlTextArea" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.web.HtmlTextArea.html">zebkit.ui.web.HtmlTextArea</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.web.HtmlTextField" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.web.HtmlTextField.html">zebkit.ui.web.HtmlTextField</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.web.HtmlTextInput" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.web.HtmlTextInput.html">zebkit.ui.web.HtmlTextInput</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.web.HtmlWindow" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.web.HtmlWindow.html">zebkit.ui.web.HtmlWindow</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.web.PopupLayer" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.web.PopupLayer.html">zebkit.ui.web.PopupLayer</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.web.RootLayer" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.web.RootLayer.html">zebkit.ui.web.RootLayer</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.web.VideoPan" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.web.VideoPan.html">zebkit.ui.web.VideoPan</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.web.WinLayer" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.web.WinLayer.html">zebkit.ui.web.WinLayer</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.Window" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.Window.html">zebkit.ui.Window</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.WinLayer" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.WinLayer.html">zebkit.ui.WinLayer</a> </td> </tr> <tr class="classNameCell" className="zebkit.ui.zCanvas" name="allClassesItem"> <td> <a href="../classes/zebkit.ui.zCanvas.html">zebkit.ui.zCanvas</a> </td> </tr> <tr class="classNameCell" className="zebkit.URI" name="allClassesItem"> <td> <a href="../classes/zebkit.URI.html">zebkit.URI</a> </td> </tr> <tr class="classNameCell" className="zebkit.util.Position" name="allClassesItem"> <td> <a href="../classes/zebkit.util.Position.html">zebkit.util.Position</a> </td> </tr> <tr class="classNameCell" className="zebkit.util.Position.Metric" name="allClassesItem"> <td> <a href="../classes/zebkit.util.Position.Metric.html">zebkit.util.Position.Metric</a> </td> </tr> <tr class="classNameCell" className="zebkit.util.SingleColPosition" name="allClassesItem"> <td> <a href="../classes/zebkit.util.SingleColPosition.html">zebkit.util.SingleColPosition</a> </td> </tr> <tr class="classNameCell" className="zebkit.util.TasksSet" name="allClassesItem"> <td> <a href="../classes/zebkit.util.TasksSet.html">zebkit.util.TasksSet</a> </td> </tr> <tr class="classNameCell" className="zebkit.util.TasksSet.Task" name="allClassesItem"> <td> <a href="../classes/zebkit.util.TasksSet.Task.html">zebkit.util.TasksSet.Task</a> </td> </tr> <tr class="classNameCell" className="zebkit.web.Clipboard" name="allClassesItem"> <td> <a href="../classes/zebkit.web.Clipboard.html">zebkit.web.Clipboard</a> </td> </tr> <tr class="classNameCell" className="zebkit.web.KeyEvent" name="allClassesItem"> <td> <a href="../classes/zebkit.web.KeyEvent.html">zebkit.web.KeyEvent</a> </td> </tr> <tr class="classNameCell" className="zebkit.web.KeyEventUninfier" name="allClassesItem"> <td> <a href="../classes/zebkit.web.KeyEventUninfier.html">zebkit.web.KeyEventUninfier</a> </td> </tr> <tr class="classNameCell" className="zebkit.web.MouseWheelSupport" name="allClassesItem"> <td> <a href="../classes/zebkit.web.MouseWheelSupport.html">zebkit.web.MouseWheelSupport</a> </td> </tr> <tr class="classNameCell" className="zebkit.web.PointerEvent" name="allClassesItem"> <td> <a href="../classes/zebkit.web.PointerEvent.html">zebkit.web.PointerEvent</a> </td> </tr> <tr class="classNameCell" className="zebkit.web.PointerEventUnifier" name="allClassesItem"> <td> <a href="../classes/zebkit.web.PointerEventUnifier.html">zebkit.web.PointerEventUnifier</a> </td> </tr> <tr class="classNameCell" className="zebkit.Zson" name="allClassesItem"> <td> <a href="../classes/zebkit.Zson.html">zebkit.Zson</a> </td> </tr> </table> </div> </div> <script> var root = document.getElementById("allClasses"); document.getElementById("search").addEventListener('input', function(e) { var items = document.getElementsByName("allClassesItem"), value = this.value.trim().toLowerCase(); for(var i = 0; i < items.length; i++) { var item = items[i]; if (value.length < 3 || item.getAttribute("className").toLowerCase().indexOf(value) >= 0) { item.style.display = "block"; } else { item.style.display = "none"; }; } }); </script> </div> </td> <td valign="top" align="left"> <div id="main" class="yui3-u"> <div class="content"> <div class="hd"> <table width="100%"> <tr> <td> <strong> Class </strong> <strong class="name""> zebkit.ui.event.FocusEvent </strong> <br/> <strong> extends </strong> <span class="type">&lt;<a href="../classes/zebkit.Event.html" class="crosslink">zebkit.Event</a>&gt;</span> </td> <td align="right" valign="top"> <a href="../classes/zebkit.ui.event.html"> &lt;zebkit.ui.event&gt; </a> </td> <tr> </table> </div> <br/> <div class="intro"> <p>Focus event class.</p> </div> <strong>Constructor:</strong><a name="methods_zebkit.ui.event.FocusEvent"></a> <div class="method item"> <span class="foundat"> </span> <strong class="name"><code>zebkit.ui.event.FocusEvent</code> (<code> </code>)</strong> <br/> </div> <br/> <br/> <div id="classdocs"> <ul> <li> <a href="#attrs"> Attributes </a> </li> </ul> <div> <div id="attrs"> <br/><br/> <div class="attrs"> <strong>Inherited attributes:</strong> <br/> <div style="padding:6px;"> <small style="white-space: nowrap;"> <strong> public </strong> <img title="readonly" width="14" height="14" src="../assets/css/lock.png" /> <strong class="type"> <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object" class="crosslink external" target="_blank">Object</a> </strong> <a href="zebkit.Event.html#atttrs_source"> source </a> </small> &nbsp;&nbsp; </div> <br/><br/> </div> <br/> <table> <tr> <td> <a name="attrs_related"></a> <div class="attrs item"> <strong> public </strong> <img title="readonly" width="18" height="18" src="../assets/css/lock.png" /> <strong class="type"> &lt;<a href="../classes/zebkit.ui.Panel.html" class="crosslink">zebkit.ui.Panel</a>&gt; </strong> <strong class="name" style="color:orange;"> <code>related</code> </strong> <br> <p>Related to the event component. For focus gained event it should be a component that lost focus. For focus lost event it should be a component that is going to get a focus.</p> </div> </td> </tr> <tr> <td> </td> </tr> </table> </div> </div> </div> </div> </div> </td> </tr> </table> </div> </div> <script src="../assets/vendor/prettify/prettify-min.js"></script> <script>prettyPrint();</script> <script src="../assets/js/yui-prettify.js"></script> <script src="../assets/js/tabs.js"></script> </body> </html>
apache-2.0
calonso-conabio/intranet
protected/humhub/modules/admin/messages/de/views_module_info.php
230
<?php return array ( '<strong>Module</strong> details' => '<strong>Modul</strong> Informationen ', 'This module doesn\'t provide further informations.' => 'Dieses Modul stellt keine weiteren Informationen zur Verfügung.', );
apache-2.0
bazelbuild/tulsi
site/docs/faq.md
4853
--- layout: default title: FAQ --- # How do I build for debug or release? Tulsi generated projects behave just like Xcode projects in this respect. You simply change the build configuration for your target scheme. Note that Tulsi does not support Bazel's fastbuild compilation mode due to debugging limitations. 1. Open up the scheme editor. You can do this via cmd-< or through the UI. 2. Change the current build configuration in the "Info" pane. # I'm trying to profile my app and am getting a `permission denied` error. What's wrong? If Instruments reports an error along the lines of ``` Target failed to run: Permission to debug <your_app_id> was denied. The app must be signed with a development identity (e.g. iOS Developer). ``` it usually means that your entitlements are missing `get-task-allow`. To fix this, you will want to add ``` <key>get-task-allow</key><true/> ``` to your entitlements file for builds which you do not plan to submit to Apple for signing. # I'm attempting to debug Objective-C projects with Xcode 8 or later and breakpoints aren't working. Why? Xcode 8 fixes a bug preventing the use of LLDB's target.source-map setting via `~/.lldbinit-Xcode` files. Tulsi makes use of this feature to remove the need to inject environment-specific information into Bazel-generated binaries. Unfortunately, the lldbinit file is parsed by Xcode once and then cached until Xcode restarts, meaning that loading additional projects without restarting Xcode will lead to incorrect behavior. Anytime you load a different Tulsi-generated Xcode project and find that breakpoints no longer work, you should close any other projects and restart Xcode in order to resolve the issue. As background: the use of `.lldbinit` was initially an attempt to fix Swift debugging but various other issues were discovered, necessitating the addition of a dSYM post-processor which may someday replace Tulsi's use of lldbinit entirely. # How do I set Bazel options for my project (like --config=awesome)? The Tulsi options pane provides settings for flags that can be passed through to Bazel. # What should I check in to source control? As mentioned in the user guide "The project bundle is entirely shareable apart from the `tulsiconf-user` files, which contain settings that are likely to be user specific (such as absolute paths)." So you'll want to `.gitignore` `.tulsiconf-user` files but otherwise the entire `.tulsiproj` bundle is encouraged to be revision controlled and shared across your team. # How can I run all of my tests in a single Xcode scheme? Tests can be grouped via Bazel's `test_suite` rule, with one small caveat. Tests that are not xctest-based (where the `xctest` attribute is set to the non-default `0`) must be run as standalone targets. When building the Xcode scheme for a `test_suite` rule, Tulsi will print a warning and ignore any non-xctest tests that are included in the suite. # Somebody asked me for a "full Xcode build log," where do I get that? The Tulsi build script produces a ton of interesting debugging data that isn't shown by default in the Xcode UI. Luckily it's very simple to retrieve: ## To expand everything: Open up the Xcode Report navigator, right click anyplace in the build log and select "Expand All Transcripts." ## To expand one particular action: Open up the Xcode Report navigator, scroll down to the action you'd like to expand, and click on the expander button on the right hand side. ![Getting to the Report navigator](/images/FAQ_Expanded_Build_Log_01.png "Expanding the build log") Once things are expanded, you can right click on the build log and select "Copy Transcript for Shown Results" to copy everything to the pasteboard. ![After expansion](/images/FAQ_Expanded_Build_Log_02.png "After expansion") # Somebody asked me for a simulator log, where do I get that? Simulator logs may be retrieved via Console.app (`/Applications/Utilities`) or by grabbing the files directly. Generally you'll need to provide two logs, both of which may be found under `~/Library/Logs`. * `CoreSimulator.log` * `<simulator ID>/system.log` Where `<simulator ID>` is the GUID of the simulator you were using when you encountered a problem. If you don't know the simulator ID, you can retrieve it through the "Devices" window in Xcode (under the `Window` menu or shift+cmd+2). # Somebody asked me for a device log, where do I get that? Device logs may be retrieved via the Xcode "Devices" window (under the `Window` menu or shift+cmd+2 in Xcode). If the console log is not already showing, you can click the disclosure button on the lower right to open it. ![Opening the console log](/images/FAQ_Device_Log_01.png "Opening the console log") # Why the name "tulsi"? tulsi - /ˈto͝olsē/ A kind of [basil](http://bazel.build) that is venerated by Hindus as a sacred plant.
apache-2.0
ahennr/shogun2
src/shogun-core-main/src/main/java/de/terrestris/shoguncore/dao/LayerDataSourceDao.java
668
package de.terrestris.shoguncore.dao; import de.terrestris.shoguncore.model.layer.source.LayerDataSource; import org.springframework.stereotype.Repository; @Repository("layerDataSourceDao") public class LayerDataSourceDao<E extends LayerDataSource> extends GenericHibernateDao<E, Integer> { /** * Public default constructor for this DAO. */ @SuppressWarnings("unchecked") public LayerDataSourceDao() { super((Class<E>) LayerDataSource.class); } /** * Constructor that has to be called by subclasses. * * @param clazz */ protected LayerDataSourceDao(Class<E> clazz) { super(clazz); } }
apache-2.0
vmware/kubernetes
staging/src/k8s.io/apiserver/pkg/endpoints/handlers/rest.go
11462
/* Copyright 2014 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package handlers import ( "context" "encoding/hex" "fmt" "io" "io/ioutil" "net/http" "net/url" goruntime "runtime" "strings" "time" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/api/meta" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1beta1 "k8s.io/apimachinery/pkg/apis/meta/v1beta1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apiserver/pkg/admission" "k8s.io/apiserver/pkg/authorization/authorizer" "k8s.io/apiserver/pkg/endpoints/handlers/fieldmanager" "k8s.io/apiserver/pkg/endpoints/handlers/responsewriters" "k8s.io/apiserver/pkg/endpoints/metrics" "k8s.io/apiserver/pkg/endpoints/request" "k8s.io/apiserver/pkg/registry/rest" "k8s.io/klog" utiltrace "k8s.io/utils/trace" ) // RequestScope encapsulates common fields across all RESTful handler methods. type RequestScope struct { Namer ScopeNamer Serializer runtime.NegotiatedSerializer runtime.ParameterCodec Creater runtime.ObjectCreater Convertor runtime.ObjectConvertor Defaulter runtime.ObjectDefaulter Typer runtime.ObjectTyper UnsafeConvertor runtime.ObjectConvertor Authorizer authorizer.Authorizer Trace *utiltrace.Trace TableConvertor rest.TableConvertor FieldManager *fieldmanager.FieldManager Resource schema.GroupVersionResource Kind schema.GroupVersionKind Subresource string MetaGroupVersion schema.GroupVersion // HubGroupVersion indicates what version objects read from etcd or incoming requests should be converted to for in-memory handling. HubGroupVersion schema.GroupVersion MaxRequestBodyBytes int64 } func (scope *RequestScope) err(err error, w http.ResponseWriter, req *http.Request) { responsewriters.ErrorNegotiated(err, scope.Serializer, scope.Kind.GroupVersion(), w, req) } func (scope *RequestScope) AllowsConversion(gvk schema.GroupVersionKind) bool { // TODO: this is temporary, replace with an abstraction calculated at endpoint installation time if gvk.GroupVersion() == metav1beta1.SchemeGroupVersion { switch gvk.Kind { case "Table": return scope.TableConvertor != nil case "PartialObjectMetadata", "PartialObjectMetadataList": // TODO: should delineate between lists and non-list endpoints return true default: return false } } return false } func (scope *RequestScope) AllowsServerVersion(version string) bool { return version == scope.MetaGroupVersion.Version } func (scope *RequestScope) AllowsStreamSchema(s string) bool { return s == "watch" } // ConnectResource returns a function that handles a connect request on a rest.Storage object. func ConnectResource(connecter rest.Connecter, scope RequestScope, admit admission.Interface, restPath string, isSubresource bool) http.HandlerFunc { return func(w http.ResponseWriter, req *http.Request) { if isDryRun(req.URL) { scope.err(errors.NewBadRequest("dryRun is not supported"), w, req) return } namespace, name, err := scope.Namer.Name(req) if err != nil { scope.err(err, w, req) return } ctx := req.Context() ctx = request.WithNamespace(ctx, namespace) ae := request.AuditEventFrom(ctx) admit = admission.WithAudit(admit, ae) opts, subpath, subpathKey := connecter.NewConnectOptions() if err := getRequestOptions(req, scope, opts, subpath, subpathKey, isSubresource); err != nil { err = errors.NewBadRequest(err.Error()) scope.err(err, w, req) return } if admit != nil && admit.Handles(admission.Connect) { userInfo, _ := request.UserFrom(ctx) // TODO: remove the mutating admission here as soon as we have ported all plugin that handle CONNECT if mutatingAdmission, ok := admit.(admission.MutationInterface); ok { err = mutatingAdmission.Admit(admission.NewAttributesRecord(opts, nil, scope.Kind, namespace, name, scope.Resource, scope.Subresource, admission.Connect, false, userInfo)) if err != nil { scope.err(err, w, req) return } } if validatingAdmission, ok := admit.(admission.ValidationInterface); ok { err = validatingAdmission.Validate(admission.NewAttributesRecord(opts, nil, scope.Kind, namespace, name, scope.Resource, scope.Subresource, admission.Connect, false, userInfo)) if err != nil { scope.err(err, w, req) return } } } requestInfo, _ := request.RequestInfoFrom(ctx) metrics.RecordLongRunning(req, requestInfo, metrics.APIServerComponent, func() { handler, err := connecter.Connect(ctx, name, opts, &responder{scope: scope, req: req, w: w}) if err != nil { scope.err(err, w, req) return } handler.ServeHTTP(w, req) }) } } // responder implements rest.Responder for assisting a connector in writing objects or errors. type responder struct { scope RequestScope req *http.Request w http.ResponseWriter } func (r *responder) Object(statusCode int, obj runtime.Object) { responsewriters.WriteObject(statusCode, r.scope.Kind.GroupVersion(), r.scope.Serializer, obj, r.w, r.req) } func (r *responder) Error(err error) { r.scope.err(err, r.w, r.req) } // resultFunc is a function that returns a rest result and can be run in a goroutine type resultFunc func() (runtime.Object, error) // finishRequest makes a given resultFunc asynchronous and handles errors returned by the response. // An api.Status object with status != success is considered an "error", which interrupts the normal response flow. func finishRequest(timeout time.Duration, fn resultFunc) (result runtime.Object, err error) { // these channels need to be buffered to prevent the goroutine below from hanging indefinitely // when the select statement reads something other than the one the goroutine sends on. ch := make(chan runtime.Object, 1) errCh := make(chan error, 1) panicCh := make(chan interface{}, 1) go func() { // panics don't cross goroutine boundaries, so we have to handle ourselves defer func() { panicReason := recover() if panicReason != nil { const size = 64 << 10 buf := make([]byte, size) buf = buf[:goruntime.Stack(buf, false)] panicReason = strings.TrimSuffix(fmt.Sprintf("%v\n%s", panicReason, string(buf)), "\n") // Propagate to parent goroutine panicCh <- panicReason } }() if result, err := fn(); err != nil { errCh <- err } else { ch <- result } }() select { case result = <-ch: if status, ok := result.(*metav1.Status); ok { if status.Status != metav1.StatusSuccess { return nil, errors.FromObject(status) } } return result, nil case err = <-errCh: return nil, err case p := <-panicCh: panic(p) case <-time.After(timeout): return nil, errors.NewTimeoutError(fmt.Sprintf("request did not complete within requested timeout %s", timeout), 0) } } // transformDecodeError adds additional information when a decode fails. func transformDecodeError(typer runtime.ObjectTyper, baseErr error, into runtime.Object, gvk *schema.GroupVersionKind, body []byte) error { objGVKs, _, err := typer.ObjectKinds(into) if err != nil { return err } objGVK := objGVKs[0] if gvk != nil && len(gvk.Kind) > 0 { return errors.NewBadRequest(fmt.Sprintf("%s in version %q cannot be handled as a %s: %v", gvk.Kind, gvk.Version, objGVK.Kind, baseErr)) } summary := summarizeData(body, 30) return errors.NewBadRequest(fmt.Sprintf("the object provided is unrecognized (must be of type %s): %v (%s)", objGVK.Kind, baseErr, summary)) } // setSelfLink sets the self link of an object (or the child items in a list) to the base URL of the request // plus the path and query generated by the provided linkFunc func setSelfLink(obj runtime.Object, requestInfo *request.RequestInfo, namer ScopeNamer) error { // TODO: SelfLink generation should return a full URL? uri, err := namer.GenerateLink(requestInfo, obj) if err != nil { return nil } return namer.SetSelfLink(obj, uri) } func hasUID(obj runtime.Object) (bool, error) { if obj == nil { return false, nil } accessor, err := meta.Accessor(obj) if err != nil { return false, errors.NewInternalError(err) } if len(accessor.GetUID()) == 0 { return false, nil } return true, nil } // checkName checks the provided name against the request func checkName(obj runtime.Object, name, namespace string, namer ScopeNamer) error { objNamespace, objName, err := namer.ObjectName(obj) if err != nil { return errors.NewBadRequest(fmt.Sprintf( "the name of the object (%s based on URL) was undeterminable: %v", name, err)) } if objName != name { return errors.NewBadRequest(fmt.Sprintf( "the name of the object (%s) does not match the name on the URL (%s)", objName, name)) } if len(namespace) > 0 { if len(objNamespace) > 0 && objNamespace != namespace { return errors.NewBadRequest(fmt.Sprintf( "the namespace of the object (%s) does not match the namespace on the request (%s)", objNamespace, namespace)) } } return nil } // setObjectSelfLink sets the self link of an object as needed. func setObjectSelfLink(ctx context.Context, obj runtime.Object, req *http.Request, namer ScopeNamer) error { if !meta.IsListType(obj) { requestInfo, ok := request.RequestInfoFrom(ctx) if !ok { return fmt.Errorf("missing requestInfo") } return setSelfLink(obj, requestInfo, namer) } uri, err := namer.GenerateListLink(req) if err != nil { return err } if err := namer.SetSelfLink(obj, uri); err != nil { klog.V(4).Infof("Unable to set self link on object: %v", err) } requestInfo, ok := request.RequestInfoFrom(ctx) if !ok { return fmt.Errorf("missing requestInfo") } count := 0 err = meta.EachListItem(obj, func(obj runtime.Object) error { count++ return setSelfLink(obj, requestInfo, namer) }) if count == 0 { if err := meta.SetList(obj, []runtime.Object{}); err != nil { return err } } return err } func summarizeData(data []byte, maxLength int) string { switch { case len(data) == 0: return "<empty>" case data[0] == '{': if len(data) > maxLength { return string(data[:maxLength]) + " ..." } return string(data) default: if len(data) > maxLength { return hex.EncodeToString(data[:maxLength]) + " ..." } return hex.EncodeToString(data) } } func limitedReadBody(req *http.Request, limit int64) ([]byte, error) { defer req.Body.Close() if limit <= 0 { return ioutil.ReadAll(req.Body) } lr := &io.LimitedReader{ R: req.Body, N: limit + 1, } data, err := ioutil.ReadAll(lr) if err != nil { return nil, err } if lr.N <= 0 { return nil, errors.NewRequestEntityTooLargeError(fmt.Sprintf("limit is %d", limit)) } return data, nil } func parseTimeout(str string) time.Duration { if str != "" { timeout, err := time.ParseDuration(str) if err == nil { return timeout } klog.Errorf("Failed to parse %q: %v", str, err) } return 30 * time.Second } func isDryRun(url *url.URL) bool { return len(url.Query()["dryRun"]) != 0 }
apache-2.0
speedy01/Openfire
xmppserver/src/main/java/org/jivesoftware/openfire/pep/PEPServiceInfo.java
1128
/* * Copyright (C) 2017 Ignite Realtime Foundation. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package org.jivesoftware.openfire.pep; import org.jivesoftware.openfire.pubsub.PubSubServiceInfo; import org.xmpp.packet.JID; /** * A PubSubService manager that is specific to the implemenation of XEP-163: Personal Eventing Protocol. * * @author Guus der Kinderen, [email protected] */ public class PEPServiceInfo extends PubSubServiceInfo { public PEPServiceInfo( JID owner ) { super( new PEPServiceManager().getPEPService( owner.toBareJID() ) ); } }
apache-2.0
TeMoMuKo/AutoStopRace
app/src/main/java/pl/temomuko/autostoprace/ui/teamslocationsmap/adapter/map/TeamLocationInfoWindowAdapter.java
1400
package pl.temomuko.autostoprace.ui.teamslocationsmap.adapter.map; import android.content.Context; import android.view.LayoutInflater; import android.view.View; import android.widget.TextView; import com.google.android.gms.maps.GoogleMap; import com.google.android.gms.maps.model.Marker; import javax.inject.Inject; import butterknife.BindView; import butterknife.ButterKnife; import pl.temomuko.autostoprace.R; import pl.temomuko.autostoprace.injection.AppContext; /** * Created by Rafał Naniewicz on 02.04.2016. */ public class TeamLocationInfoWindowAdapter implements GoogleMap.InfoWindowAdapter { @BindView(R.id.tv_location_record_date) TextView mLocationRecordDateTextView; @BindView(R.id.tv_location_record_message) TextView mLocationRecordMessageTextView; private final View mContentsView; @Inject public TeamLocationInfoWindowAdapter(@AppContext Context context) { mContentsView = LayoutInflater.from(context).inflate(R.layout.adapter_team_location_info_window, null, false); ButterKnife.bind(this, mContentsView); } @Override public View getInfoWindow(Marker marker) { return null; } @Override public View getInfoContents(Marker marker) { mLocationRecordMessageTextView.setText(marker.getTitle()); mLocationRecordDateTextView.setText(marker.getSnippet()); return mContentsView; } }
apache-2.0
ua-eas/ksd-kc5.2.1-rice2.3.6-ua
rice-middleware/core/framework/src/main/java/org/kuali/rice/core/framework/persistence/jpa/metadata/ManyToOneDescriptor.java
2029
/** * Copyright 2005-2014 The Kuali Foundation * * Licensed under the Educational Community 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.opensource.org/licenses/ecl2.php * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.kuali.rice.core.framework.persistence.jpa.metadata; import javax.persistence.CascadeType; /** * @author Kuali Rice Team ([email protected]) */ public class ManyToOneDescriptor extends ObjectDescriptor implements java.io.Serializable { private static final long serialVersionUID = -1277621663465909764L; public String toString() { StringBuffer sb = new StringBuffer(); sb.append("ManyToOneDescriptor = [ "); sb.append("targetEntity:").append(targetEntity.getName()).append(", "); sb.append("cascade = { "); for (CascadeType ct : cascade) { sb.append(ct).append(" "); } sb.append("}, "); sb.append("fetch:").append(fetch).append(", "); sb.append("optional:").append(optional); if (!joinColumnDescriptors.isEmpty()) { sb.append(", join columns = { "); for (JoinColumnDescriptor joinColumnDescriptor : joinColumnDescriptors) { sb.append(" jc = { "); sb.append("name:").append(joinColumnDescriptor.getName()).append(", "); sb.append("insertable:").append(joinColumnDescriptor.isInsertable()).append(", "); sb.append("nullable:").append(joinColumnDescriptor.isNullable()).append(", "); sb.append("unique:").append(joinColumnDescriptor.isUnique()).append(", "); sb.append("updateable:").append(joinColumnDescriptor.isUpdateable()); sb.append(" }"); } sb.append(" } "); } sb.append(" ]"); return sb.toString(); } }
apache-2.0
LiangYue1981816/CrossEngine
Tools/MaxExporter/MaxSDKs/2012/include/ipoint2.h
5515
/********************************************************************** *< FILE: ipoint2.h DESCRIPTION: Class definintion for IPoint2: Integer 2D point. CREATED BY: Dan Silva HISTORY: *> Copyright (c) 1994, All Rights Reserved. **********************************************************************/ #pragma once #include "GeomExport.h" #include "maxheap.h" #include <iosfwd> #include <math.h> /*! \sa Class Point2.\n\n \par Description: This class describes a 2D point using int x and y coordinates. Methods are provided to add and subtract points, multiply and divide by scalars, normalize and compute the dot product of two IPoint2s. All methods are implemented by the system. \par Data Members: <b>int x,y;</b> */ class IPoint2 : public MaxHeapOperators { public: int x,y; // Constructors /*! \remarks Constructor. */ IPoint2(){} /*! \remarks Constructor. Data members are initialized to X and Y. */ IPoint2(int X, int Y) { x = X; y = Y; } /*! \remarks Constructor. Data members are initialized to a.x and a.y. */ IPoint2(const IPoint2& a) { x = a.x; y = a.y; } /*! \remarks Constructor. Data members are initialized as x = af[0] and y = af[1]. */ IPoint2(int af[2]) { x = af[0]; y = af[1]; } // Access operators /*! \remarks Allows access to x, y using the subscript operator. \return An index of 0 will return x, 1 will return y. */ int& operator[](int i) { return (&x)[i]; } /*! \remarks Allows access to x, y using the subscript operator. \return An index of 0 will return x, 1 will return y. */ const int& operator[](int i) const { return (&x)[i]; } // Conversion function /*! \remarks Returns the address of the IPoint2.x. */ operator int*() { return(&x); } // Unary operators /*! \remarks Unary -. Negates both x and y. */ IPoint2 operator-() const { return(IPoint2(-x,-y)); } /*! \remarks Unary +. Returns the Ipoint2 unaltered. */ IPoint2 operator+() const { return *this; } // Assignment operators /*! \remarks Subtracts a IPoint2 from this IPoint2. */ IPoint2& operator-=(const IPoint2&); /*! \remarks Adds a IPoint2 to this IPoint2. */ IPoint2& operator+=(const IPoint2&); /*! \remarks Multiplies this IPoint2 by an integer value. */ GEOMEXPORT IPoint2& operator*=(int); /*! \remarks Divides this IPoint2 by an integer value. */ GEOMEXPORT IPoint2& operator/=(int); // Binary operators /*! \remarks Subtracts a IPoint2 from a IPoint2. */ GEOMEXPORT IPoint2 operator-(const IPoint2&) const; /*! \remarks Adds a IPoint2 to a IPoint2. */ GEOMEXPORT IPoint2 operator+(const IPoint2&) const; /*! \remarks Returns the dot product of two IPoint2's. This is the sum of both x values multiplied together and both y values multiplied together. \par Operators: */ GEOMEXPORT int DotProd(const IPoint2&) const; // DOT PRODUCT /*! \remarks Returns the dot product of two IPoint2's. This is the sum of both x values multiplied together and both y values multiplied together. */ GEOMEXPORT int operator*(const IPoint2&) const; // DOT PRODUCT // Relational operators /*! \remarks Equality operator. Compare two IPoint2's. \return Nonzero if the IPoint2's are equal; otherwise 0.\n\n */ int operator==(const IPoint2& p) const { return (x == p.x && y == p.y); } int operator!=(const IPoint2& p) const { return (x != p.x || y != p.y); } }; /*! \remarks Returns the length of the IPoint2, ie:\n\n <b>sqrt(v.x*v.x+v.y*v.y);</b> */ GEOMEXPORT int Length(const IPoint2&); /*! \remarks Returns a unit vector. This is an IPoint2 with each component divided by the point <b>Length()</b>. */ GEOMEXPORT IPoint2 Normalize(const IPoint2&); // Return a unit vector. /*! \remarks Returns an IPoint2 multiplied by a scalar. */ GEOMEXPORT IPoint2 operator*(int, const IPoint2&); // multiply by scalar /*! \remarks Returns an IPoint2 multiplied by a scalar. */ GEOMEXPORT IPoint2 operator*(const IPoint2&, int); // multiply by scalar /*! \remarks Returns an IPoint2 whose x and y members are divided by a scalar. */ GEOMEXPORT IPoint2 operator/(const IPoint2&, int); // divide by scalar GEOMEXPORT std::ostream &operator<<(std::ostream&, const IPoint2&); // Inlines: /*! \remarks Returns the component with the minimum abs value. 0=x, 1=y. */ inline int MaxComponent(const IPoint2& p) { return(p.x>p.y?0:1); } /*! \remarks Returns the component with the minimum abs value. 0=x, 1=y. */ inline int MinComponent(const IPoint2& p) { return(p.x<p.y?0:1); } inline int Length(const IPoint2& v) { return (int)sqrt((double)(v.x*v.x+v.y*v.y)); } inline IPoint2& IPoint2::operator-=(const IPoint2& a) { x -= a.x; y -= a.y; return *this; } inline IPoint2& IPoint2::operator+=(const IPoint2& a) { x += a.x; y += a.y; return *this; } inline IPoint2& IPoint2::operator*=(int f) { x *= f; y *= f; return *this; } inline IPoint2& IPoint2::operator/=(int f) { x /= f; y /= f; return *this; } inline IPoint2 IPoint2::operator-(const IPoint2& b) const{ return(IPoint2(x-b.x,y-b.y)); } inline IPoint2 IPoint2::operator+(const IPoint2& b) const { return(IPoint2(x+b.x,y+b.y)); } inline int IPoint2::DotProd(const IPoint2& b) const{ return(x*b.x+y*b.y); } inline int IPoint2::operator*(const IPoint2& b)const { return(x*b.x+y*b.y); } inline IPoint2 operator*(int f, const IPoint2& a) { return(IPoint2(a.x*f, a.y*f)); } inline IPoint2 operator*(const IPoint2& a, int f) { return(IPoint2(a.x*f, a.y*f)); } inline IPoint2 operator/(const IPoint2& a, int f) { return(IPoint2(a.x/f, a.y/f)); }
apache-2.0
boneman1231/org.apache.felix
trunk/bundleplugin/src/main/java/org/apache/felix/obrplugin/ObrUpdate.java
11514
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.apache.felix.obrplugin; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStreamWriter; import java.io.Writer; import java.lang.reflect.Method; import java.net.URI; import java.util.regex.Pattern; import org.apache.felix.bundlerepository.Resource; import org.apache.felix.bundlerepository.impl.DataModelHelperImpl; import org.apache.felix.bundlerepository.impl.PullParser; import org.apache.felix.bundlerepository.impl.RepositoryImpl; import org.apache.felix.bundlerepository.impl.RepositoryParser; import org.apache.felix.bundlerepository.impl.ResourceImpl; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.logging.Log; import org.apache.maven.project.MavenProject; import org.codehaus.plexus.util.FileUtils; import org.kxml2.io.KXmlParser; import org.xmlpull.v1.XmlPullParser; /** * this class parse the old repository.xml file build the bundle resource description and update the repository. * @author <a href="mailto:[email protected]">Felix Project Team</a> */ public class ObrUpdate { private static Pattern TIMESTAMP = Pattern.compile( "-[0-9]{8}\\.[0-9]{6}-[0-9]+" ); private static Method setURI; static { try { setURI = RepositoryImpl.class.getDeclaredMethod( "setURI", String.class ); setURI.setAccessible( true ); } catch ( Exception e ) { setURI = null; } } /** * logger for this plugin. */ private Log m_logger; /** * name and path to the repository descriptor file. */ private URI m_repositoryXml; /** * name and path to the obr.xml file. */ private URI m_obrXml; /** * maven project description. */ private MavenProject m_project; /** * user configuration information. */ private Config m_userConfig; /** * root on parent document. */ private RepositoryImpl m_repository; /** * used to store bundle information. */ private ResourceImpl m_resourceBundle; /** * base URI used to relativize bundle URIs. */ private URI m_baseURI; /** * initialize information. * @param repositoryXml path to the repository descriptor file * @param obrXml path and filename to the obr.xml file * @param project maven project description * @param mavenRepositoryPath path to the local maven repository * @param userConfig user information * @param logger plugin logger */ public ObrUpdate( URI repositoryXml, URI obrXml, MavenProject project, String mavenRepositoryPath, Config userConfig, Log logger ) { m_repositoryXml = repositoryXml; m_obrXml = obrXml; m_project = project; m_logger = logger; m_userConfig = userConfig; if ( userConfig.isRemoteFile() ) { m_baseURI = ObrUtils.toFileURI( mavenRepositoryPath ); } else { m_baseURI = m_repositoryXml; } } /** * update the repository descriptor file. parse the old repository descriptor file, * get the old reference of the bundle or determine the id for a new bundle, extract * information from bindex set the new information in descriptor file and save it. * * @param bundleJar path to the bundle jar file * @param sourceJar path to the source jar file * @param docJar path to the docs jar file * * @throws MojoExecutionException if the plugin failed */ public void updateRepository( URI bundleJar, URI sourceJar, URI docJar ) throws MojoExecutionException { m_logger.debug( " (f) repositoryXml = " + m_repositoryXml ); m_logger.debug( " (f) bundleJar = " + bundleJar ); m_logger.debug( " (f) sourceJar = " + sourceJar ); m_logger.debug( " (f) docJar = " + docJar ); m_logger.debug( " (f) obrXml = " + m_obrXml ); if ( m_repository == null ) { return; } // get the file size File bundleFile = new File( bundleJar ); if ( !bundleFile.exists() ) { String snapshot = TIMESTAMP.matcher( bundleFile.getName() ).replaceFirst( "-SNAPSHOT" ); bundleFile = new File( bundleFile.getParentFile(), snapshot ); } if ( bundleFile.exists() ) { URI resourceURI = m_userConfig.getRemoteBundle(); if ( null == resourceURI ) { resourceURI = bundleJar; if ( m_userConfig.isPathRelative() ) { resourceURI = ObrUtils.getRelativeURI( m_baseURI, resourceURI ); } } if ( m_userConfig.isRemoteFile() ) { m_logger.info( "Deploying " + resourceURI ); } else { m_logger.info( "Installing " + resourceURI ); } try { m_resourceBundle = ( ResourceImpl ) new DataModelHelperImpl().createResource( bundleFile.toURI().toURL() ); if ( m_resourceBundle == null ) { return; } } catch ( IOException e ) { throw new MojoExecutionException( "Unable to load resource information", e ); } m_resourceBundle.put( Resource.SIZE, String.valueOf( bundleFile.length() ) ); m_resourceBundle.put( Resource.URI, resourceURI.toASCIIString() ); } else { m_logger.error( "file doesn't exist: " + bundleJar ); return; } // parse the obr.xml file if ( m_obrXml != null ) { m_logger.info( "Adding " + m_obrXml ); // URL url = getClass().getResource("/SchemaObr.xsd"); // TODO validate obr.xml file // add contents to resource bundle parseObrXml(); } String sourcePath = relativisePath( sourceJar ); String docPath = relativisePath( docJar ); // m_resourceBundle.construct( m_project, bindexExtractor, sourcePath, docPath ); // TODO: rebuild wrt m_project m_repository.addResource( m_resourceBundle ); m_repository.setLastModified( System.currentTimeMillis() ); } private String relativisePath( URI uri ) { if ( null != uri ) { if ( m_userConfig.isPathRelative() ) { return ObrUtils.getRelativeURI( m_baseURI, uri ).toASCIIString(); } return uri.toASCIIString(); } return null; } public void writeRepositoryXml() throws MojoExecutionException { m_logger.info( "Writing OBR metadata" ); File file = null; Writer writer; try { file = File.createTempFile( "repository", ".xml" ); writer = new OutputStreamWriter( new FileOutputStream( file ) ); } catch ( IOException e ) { m_logger.error( "Unable to write to file: " + file.getName() ); e.printStackTrace(); throw new MojoExecutionException( "Unable to write to file: " + file.getName() + " : " + e.getMessage() ); } try { new DataModelHelperImpl().writeRepository( m_repository, writer ); } catch ( IOException e ) { throw new MojoExecutionException( "Unable to write repository xml", e ); } try { writer.flush(); writer.close(); File outputFile = new File( m_repositoryXml ); outputFile.getParentFile().mkdirs(); FileUtils.rename( file, outputFile ); } catch ( IOException e ) { e.printStackTrace(); throw new MojoExecutionException( "IOException" ); } } /** * Parse the repository descriptor file. * * @throws MojoExecutionException if the plugin failed */ public void parseRepositoryXml() throws MojoExecutionException { File fout = new File( m_repositoryXml ); if ( !fout.exists() ) { m_repository = new RepositoryImpl(); writeRepositoryXml(); } else { try { m_repository = ( RepositoryImpl ) new DataModelHelperImpl().repository( m_repositoryXml.toURL() ); if ( setURI != null ) { setURI.invoke( m_repository, ( String ) null ); } } catch ( Exception e ) { throw new MojoExecutionException( "Unable to read repository xml: " + m_repositoryXml, e ); } } } /** * put the information from obr.xml into ressourceBundle object. */ private void parseObrXml() throws MojoExecutionException { try { InputStream is = new FileInputStream( new File( m_obrXml ) ); try { KXmlParser kxp = new KXmlParser(); kxp.setInput( is, null ); kxp.nextTag(); // skip top level element kxp.nextTag(); // go to first child element parseObrXml( kxp ); } finally { is.close(); } } catch ( Exception e ) { throw new MojoExecutionException( "Unable to parse obr xml: " + m_obrXml, e ); } } private void parseObrXml( KXmlParser kxp ) throws Exception { PullParser parser = new PullParser(); while ( kxp.getEventType() == XmlPullParser.START_TAG ) { if ( RepositoryParser.CATEGORY.equals( kxp.getName() ) ) { m_resourceBundle.addCategory( parser.parseCategory( kxp ) ); } else if ( RepositoryParser.REQUIRE.equals( kxp.getName() ) ) { m_resourceBundle.addRequire( parser.parseRequire( kxp ) ); } else if ( RepositoryParser.CAPABILITY.equals( kxp.getName() ) ) { m_resourceBundle.addCapability( parser.parseCapability( kxp ) ); } else { kxp.nextTag(); parseObrXml( kxp ); } kxp.nextTag(); } } }
apache-2.0
simonlaroche/akka.net
src/core/Akka.Persistence.TestKit/Journal/IJournalInterceptor.cs
961
//----------------------------------------------------------------------- // <copyright file="IJournalInterceptor.cs" company="Akka.NET Project"> // Copyright (C) 2009-2020 Lightbend Inc. <http://www.lightbend.com> // Copyright (C) 2013-2020 .NET Foundation <https://github.com/akkadotnet/akka.net> // </copyright> //----------------------------------------------------------------------- namespace Akka.Persistence.TestKit { using System.Threading.Tasks; /// <summary> /// Interface to object which will intercept written and recovered messages in <see cref="TestJournal"/>. /// </summary> public interface IJournalInterceptor { /// <summary> /// Method will be called for each individual message before it is written or recovered. /// </summary> /// <param name="message">Written or recovered message.</param> Task InterceptAsync(IPersistentRepresentation message); } }
apache-2.0
gsoundar/mambo-ec2-deploy
packages/tachyon-0.5.0/core/src/main/java/tachyon/worker/WorkerSpaceCounter.java
2787
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.apache.org/licenses/LICENSE-2.0 * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package tachyon.worker; /** * The worker space counter, in charge of counting and granting spaces in a worker daemon. */ public class WorkerSpaceCounter { private final long CAPACITY_BYTES; private long mUsedBytes; /** * @param capacityBytes * The maximum memory space the TachyonWorker can use, in bytes */ public WorkerSpaceCounter(long capacityBytes) { CAPACITY_BYTES = capacityBytes; mUsedBytes = 0; } /** * @return The available space size, in bytes */ public synchronized long getAvailableBytes() { return CAPACITY_BYTES - mUsedBytes; } /** * @return The maximum memory space the TachyonWorker can use, in bytes */ public long getCapacityBytes() { return CAPACITY_BYTES; } /** * @return The bytes that have been used */ public synchronized long getUsedBytes() { return mUsedBytes; } /** * Request space * * @param requestSpaceBytes * The requested space size, in bytes * @return */ public synchronized boolean requestSpaceBytes(long requestSpaceBytes) { if (getAvailableBytes() < requestSpaceBytes) { return false; } mUsedBytes += requestSpaceBytes; return true; } /** * Return used space size * * @param returnUsedBytes * The returned space size, in bytes */ public synchronized void returnUsedBytes(long returnUsedBytes) { mUsedBytes -= returnUsedBytes; } @Override public synchronized String toString() { StringBuilder sb = new StringBuilder("WorkerSpaceCounter("); sb.append(" TOTAL_BYTES: ").append(CAPACITY_BYTES); sb.append(", mUsedBytes: ").append(mUsedBytes); sb.append(", mAvailableBytes: ").append(CAPACITY_BYTES - mUsedBytes); sb.append(" )"); return sb.toString(); } /** * Update the used bytes * * @param usedBytes * The new used bytes */ public synchronized void updateUsedBytes(long usedBytes) { mUsedBytes = usedBytes; } }
apache-2.0
bclozel/spring-boot
spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/context/SpringBootTestContextBootstrapper.java
15659
/* * Copyright 2012-2018 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.springframework.boot.test.context; import java.lang.annotation.Annotation; import java.util.ArrayList; import java.util.Arrays; import java.util.HashSet; import java.util.List; import java.util.Set; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.boot.SpringBootConfiguration; import org.springframework.boot.WebApplicationType; import org.springframework.boot.context.properties.bind.Bindable; import org.springframework.boot.context.properties.bind.Binder; import org.springframework.boot.context.properties.source.ConfigurationPropertySource; import org.springframework.boot.context.properties.source.MapConfigurationPropertySource; import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; import org.springframework.core.annotation.AnnotatedElementUtils; import org.springframework.core.annotation.AnnotationUtils; import org.springframework.core.env.Environment; import org.springframework.core.io.support.SpringFactoriesLoader; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.ContextConfigurationAttributes; import org.springframework.test.context.ContextHierarchy; import org.springframework.test.context.ContextLoader; import org.springframework.test.context.MergedContextConfiguration; import org.springframework.test.context.TestContext; import org.springframework.test.context.TestContextBootstrapper; import org.springframework.test.context.TestExecutionListener; import org.springframework.test.context.support.DefaultTestContextBootstrapper; import org.springframework.test.context.support.TestPropertySourceUtils; import org.springframework.test.context.web.WebAppConfiguration; import org.springframework.test.context.web.WebMergedContextConfiguration; import org.springframework.util.Assert; import org.springframework.util.ClassUtils; import org.springframework.util.ObjectUtils; import org.springframework.util.StringUtils; /** * {@link TestContextBootstrapper} for Spring Boot. Provides support for * {@link SpringBootTest @SpringBootTest} and may also be used directly or subclassed. * Provides the following features over and above {@link DefaultTestContextBootstrapper}: * <ul> * <li>Uses {@link SpringBootContextLoader} as the * {@link #getDefaultContextLoaderClass(Class) default context loader}.</li> * <li>Automatically searches for a * {@link SpringBootConfiguration @SpringBootConfiguration} when required.</li> * <li>Allows custom {@link Environment} {@link #getProperties(Class)} to be defined.</li> * <li>Provides support for different {@link WebEnvironment webEnvironment} modes.</li> * </ul> * * @author Phillip Webb * @author Andy Wilkinson * @author Brian Clozel * @author Madhura Bhave * @since 1.4.0 * @see SpringBootTest * @see TestConfiguration */ public class SpringBootTestContextBootstrapper extends DefaultTestContextBootstrapper { private static final String[] WEB_ENVIRONMENT_CLASSES = { "javax.servlet.Servlet", "org.springframework.web.context.ConfigurableWebApplicationContext" }; private static final String REACTIVE_WEB_ENVIRONMENT_CLASS = "org.springframework." + "web.reactive.DispatcherHandler"; private static final String MVC_WEB_ENVIRONMENT_CLASS = "org.springframework." + "web.servlet.DispatcherServlet"; private static final String ACTIVATE_SERVLET_LISTENER = "org.springframework.test." + "context.web.ServletTestExecutionListener.activateListener"; private static final Log logger = LogFactory .getLog(SpringBootTestContextBootstrapper.class); @Override public TestContext buildTestContext() { TestContext context = super.buildTestContext(); verifyConfiguration(context.getTestClass()); WebEnvironment webEnvironment = getWebEnvironment(context.getTestClass()); if (webEnvironment == WebEnvironment.MOCK && deduceWebApplicationType() == WebApplicationType.SERVLET) { context.setAttribute(ACTIVATE_SERVLET_LISTENER, true); } else if (webEnvironment != null && webEnvironment.isEmbedded()) { context.setAttribute(ACTIVATE_SERVLET_LISTENER, false); } return context; } @Override protected Set<Class<? extends TestExecutionListener>> getDefaultTestExecutionListenerClasses() { Set<Class<? extends TestExecutionListener>> listeners = super.getDefaultTestExecutionListenerClasses(); List<DefaultTestExecutionListenersPostProcessor> postProcessors = SpringFactoriesLoader .loadFactories(DefaultTestExecutionListenersPostProcessor.class, getClass().getClassLoader()); for (DefaultTestExecutionListenersPostProcessor postProcessor : postProcessors) { listeners = postProcessor.postProcessDefaultTestExecutionListeners(listeners); } return listeners; } @Override protected ContextLoader resolveContextLoader(Class<?> testClass, List<ContextConfigurationAttributes> configAttributesList) { Class<?>[] classes = getClasses(testClass); if (!ObjectUtils.isEmpty(classes)) { for (ContextConfigurationAttributes configAttributes : configAttributesList) { addConfigAttributesClasses(configAttributes, classes); } } return super.resolveContextLoader(testClass, configAttributesList); } private void addConfigAttributesClasses( ContextConfigurationAttributes configAttributes, Class<?>[] classes) { List<Class<?>> combined = new ArrayList<>(); combined.addAll(Arrays.asList(classes)); if (configAttributes.getClasses() != null) { combined.addAll(Arrays.asList(configAttributes.getClasses())); } configAttributes.setClasses(ClassUtils.toClassArray(combined)); } @Override protected Class<? extends ContextLoader> getDefaultContextLoaderClass( Class<?> testClass) { return SpringBootContextLoader.class; } @Override protected MergedContextConfiguration processMergedContextConfiguration( MergedContextConfiguration mergedConfig) { Class<?>[] classes = getOrFindConfigurationClasses(mergedConfig); List<String> propertySourceProperties = getAndProcessPropertySourceProperties( mergedConfig); mergedConfig = createModifiedConfig(mergedConfig, classes, StringUtils.toStringArray(propertySourceProperties)); WebEnvironment webEnvironment = getWebEnvironment(mergedConfig.getTestClass()); if (webEnvironment != null && isWebEnvironmentSupported(mergedConfig)) { WebApplicationType webApplicationType = getWebApplicationType(mergedConfig); if (webApplicationType == WebApplicationType.SERVLET && (webEnvironment.isEmbedded() || webEnvironment == WebEnvironment.MOCK)) { WebAppConfiguration webAppConfiguration = AnnotatedElementUtils .findMergedAnnotation(mergedConfig.getTestClass(), WebAppConfiguration.class); String resourceBasePath = (webAppConfiguration != null ? webAppConfiguration.value() : "src/main/webapp"); mergedConfig = new WebMergedContextConfiguration(mergedConfig, resourceBasePath); } else if (webApplicationType == WebApplicationType.REACTIVE && (webEnvironment.isEmbedded() || webEnvironment == WebEnvironment.MOCK)) { return new ReactiveWebMergedContextConfiguration(mergedConfig); } } return mergedConfig; } private WebApplicationType getWebApplicationType( MergedContextConfiguration configuration) { ConfigurationPropertySource source = new MapConfigurationPropertySource( TestPropertySourceUtils.convertInlinedPropertiesToMap( configuration.getPropertySourceProperties())); Binder binder = new Binder(source); return binder .bind("spring.main.web-application-type", Bindable.of(WebApplicationType.class)) .orElseGet(this::deduceWebApplicationType); } private WebApplicationType deduceWebApplicationType() { if (ClassUtils.isPresent(REACTIVE_WEB_ENVIRONMENT_CLASS, null) && !ClassUtils.isPresent(MVC_WEB_ENVIRONMENT_CLASS, null)) { return WebApplicationType.REACTIVE; } for (String className : WEB_ENVIRONMENT_CLASSES) { if (!ClassUtils.isPresent(className, null)) { return WebApplicationType.NONE; } } return WebApplicationType.SERVLET; } private boolean isWebEnvironmentSupported(MergedContextConfiguration mergedConfig) { Class<?> testClass = mergedConfig.getTestClass(); ContextHierarchy hierarchy = AnnotationUtils.getAnnotation(testClass, ContextHierarchy.class); if (hierarchy == null || hierarchy.value().length == 0) { return true; } ContextConfiguration[] configurations = hierarchy.value(); return isFromConfiguration(mergedConfig, configurations[configurations.length - 1]); } private boolean isFromConfiguration(MergedContextConfiguration candidateConfig, ContextConfiguration configuration) { ContextConfigurationAttributes attributes = new ContextConfigurationAttributes( candidateConfig.getTestClass(), configuration); Set<Class<?>> configurationClasses = new HashSet<>( Arrays.asList(attributes.getClasses())); for (Class<?> candidate : candidateConfig.getClasses()) { if (configurationClasses.contains(candidate)) { return true; } } return false; } protected Class<?>[] getOrFindConfigurationClasses( MergedContextConfiguration mergedConfig) { Class<?>[] classes = mergedConfig.getClasses(); if (containsNonTestComponent(classes) || mergedConfig.hasLocations()) { return classes; } Class<?> found = new SpringBootConfigurationFinder() .findFromClass(mergedConfig.getTestClass()); Assert.state(found != null, "Unable to find a @SpringBootConfiguration, you need to use " + "@ContextConfiguration or @SpringBootTest(classes=...) " + "with your test"); logger.info("Found @SpringBootConfiguration " + found.getName() + " for test " + mergedConfig.getTestClass()); return merge(found, classes); } private boolean containsNonTestComponent(Class<?>[] classes) { for (Class<?> candidate : classes) { if (!AnnotatedElementUtils.isAnnotated(candidate, TestConfiguration.class)) { return true; } } return false; } private Class<?>[] merge(Class<?> head, Class<?>[] existing) { Class<?>[] result = new Class<?>[existing.length + 1]; result[0] = head; System.arraycopy(existing, 0, result, 1, existing.length); return result; } private List<String> getAndProcessPropertySourceProperties( MergedContextConfiguration mergedConfig) { List<String> propertySourceProperties = new ArrayList<>( Arrays.asList(mergedConfig.getPropertySourceProperties())); String differentiator = getDifferentiatorPropertySourceProperty(); if (differentiator != null) { propertySourceProperties.add(differentiator); } processPropertySourceProperties(mergedConfig, propertySourceProperties); return propertySourceProperties; } /** * Return a "differentiator" property to ensure that there is something to * differentiate regular tests and bootstrapped tests. Without this property a cached * context could be returned that wasn't created by this bootstrapper. By default uses * the bootstrapper class as a property. * @return the differentiator or {@code null} */ protected String getDifferentiatorPropertySourceProperty() { return getClass().getName() + "=true"; } /** * Post process the property source properties, adding or removing elements as * required. * @param mergedConfig the merged context configuration * @param propertySourceProperties the property source properties to process */ protected void processPropertySourceProperties( MergedContextConfiguration mergedConfig, List<String> propertySourceProperties) { Class<?> testClass = mergedConfig.getTestClass(); String[] properties = getProperties(testClass); if (!ObjectUtils.isEmpty(properties)) { // Added first so that inlined properties from @TestPropertySource take // precedence propertySourceProperties.addAll(0, Arrays.asList(properties)); } if (getWebEnvironment(testClass) == WebEnvironment.RANDOM_PORT) { propertySourceProperties.add("server.port=0"); } } /** * Return the {@link WebEnvironment} type for this test or null if undefined. * @param testClass the source test class * @return the {@link WebEnvironment} or {@code null} */ protected WebEnvironment getWebEnvironment(Class<?> testClass) { SpringBootTest annotation = getAnnotation(testClass); return (annotation != null ? annotation.webEnvironment() : null); } protected Class<?>[] getClasses(Class<?> testClass) { SpringBootTest annotation = getAnnotation(testClass); return (annotation != null ? annotation.classes() : null); } protected String[] getProperties(Class<?> testClass) { SpringBootTest annotation = getAnnotation(testClass); return (annotation != null ? annotation.properties() : null); } protected SpringBootTest getAnnotation(Class<?> testClass) { return AnnotatedElementUtils.getMergedAnnotation(testClass, SpringBootTest.class); } protected void verifyConfiguration(Class<?> testClass) { SpringBootTest springBootTest = getAnnotation(testClass); if (springBootTest != null && (springBootTest.webEnvironment() == WebEnvironment.DEFINED_PORT || springBootTest.webEnvironment() == WebEnvironment.RANDOM_PORT) && getAnnotation(WebAppConfiguration.class, testClass) != null) { throw new IllegalStateException("@WebAppConfiguration should only be used " + "with @SpringBootTest when @SpringBootTest is configured with a " + "mock web environment. Please remove @WebAppConfiguration or " + "reconfigure @SpringBootTest."); } } private <T extends Annotation> T getAnnotation(Class<T> annotationType, Class<?> testClass) { return AnnotatedElementUtils.getMergedAnnotation(testClass, annotationType); } /** * Create a new {@link MergedContextConfiguration} with different classes. * @param mergedConfig the source config * @param classes the replacement classes * @return a new {@link MergedContextConfiguration} */ protected final MergedContextConfiguration createModifiedConfig( MergedContextConfiguration mergedConfig, Class<?>[] classes) { return createModifiedConfig(mergedConfig, classes, mergedConfig.getPropertySourceProperties()); } /** * Create a new {@link MergedContextConfiguration} with different classes and * properties. * @param mergedConfig the source config * @param classes the replacement classes * @param propertySourceProperties the replacement properties * @return a new {@link MergedContextConfiguration} */ protected final MergedContextConfiguration createModifiedConfig( MergedContextConfiguration mergedConfig, Class<?>[] classes, String[] propertySourceProperties) { return new MergedContextConfiguration(mergedConfig.getTestClass(), mergedConfig.getLocations(), classes, mergedConfig.getContextInitializerClasses(), mergedConfig.getActiveProfiles(), mergedConfig.getPropertySourceLocations(), propertySourceProperties, mergedConfig.getContextCustomizers(), mergedConfig.getContextLoader(), getCacheAwareContextLoaderDelegate(), mergedConfig.getParent()); } }
apache-2.0
bgd-point/point-app-test
packages/point/point-sales/src/views/app/sales/point/pos/report/pdf.blade.php
1787
<!DOCTYPE html> <html> <head> <title>Sales Report</title> <link rel="stylesheet" href="{{asset('core/themes/appui-backend/css/bootstrap.min.css')}}"> </head> <body> <div class="h3 text-center">Sales Report</div> <div class="text-center">Period : {{ $period }}</div> <br> <table class="table tabble-striped table-bordered" cellpadding="0" cellspacing="0" border="0" > <thead> <tr> <th width="30px" class="text-center">No.</th> <th width="100px">Form Number</th> <th width="125px">Form Date</th> <th>Customer</th> <th>Sales</th> <th class="text-right">Total</th> </tr> </thead> <tbody> <?php $total_sales = 0; $i=0?> @foreach($list_sales as $sales) <tr id="list-{{$sales->id}}" @if($sales->formulir->form_status == -1) style="text-decoration: line-through;" @endif> <td class="text-center">{{++$i}}</td> <td>{{ $sales->formulir->form_number }}</td> <td>{{ date_format_view($sales->formulir->form_date, true) }}</td> <td>{{ $sales->customer->codeName }}</td> <td>{{ $sales->formulir->createdBy->name }}</td> <td class="text-right">{{ number_format_accounting($sales->total) }}</td> </tr> @if($sales->formulir->form_status != -1) <?php $total_sales += $sales->total;?> @endif @endforeach </tbody> <tfoot> <tr> <td colspan="5" class="text-right"><strong>Total</strong></td> <td class="text-right"><strong>{{ number_format_accounting($total_sales) }}</strong></td> </tr> </tfoot> </table> </body> </html>
apache-2.0
iriscouch/browserid_couchdb
example/node_modules/static-plus/node_modules/fixed-event/README.md
3377
# Fixed Event: Once and forever event emitter Fixed Event is a Javascript and Node.js package for a common `EventEmitter` problem: 1. Run a start-up or initialization function, e.g. connect to the DB, load the configuration, etc. 1. Fire an event when it is done 1. Later, you have code that depends on the start-up routing finishing. Should you subscribe to the event? What you want is this: * If it has not finished yet, just subscribe to it normally * If it has finished, execute your callback immediately with the original result Fixed Event is available as an NPM module. $ npm install fixed-event ## Example ```javascript var fixed = require('fixed-event') var status = new fixed.EventEmitter // Listening before the event fires status.on('ready', function(result) { console.log('Ready first listener: ' + result) }) // Like .emit() but fixes the result in place status.fixed('ready', "Awesome!") // Listening after the event fires setTimeout(late_listener, 1000) function late_listener() { status.on('ready', function(result) { console.log('Ready second listener: ' + result) }) } ``` Output Ready first listener: Awesome! Ready second listener: Awesome! ## Details A Fixed EventEmitter is a normal EventEmitter, with a few extra methods: * **fix("event_name")** | Fix *event_name*. The next emit for "event_name" works normally; but all subsequently-added listeners will fire immediately * **fixed("event_name", [val1], [val2])** | Fix *event_name* and also emit the event, with *val1*, *val2*, etc. as parameters ## Defaults Fixed Event is [defaultable][def]. The default option `fixed` allows pre-setting event names. ```javascript var fixed = require('fixed-event') , done_is_fixed = fixed.defaults({ events:"done" }) , ducks_are_fixed = fixed.defaults({ events:["Huey", "Dewey", "Louie"] }) , values_are_fixed = fixed.defaults({ events:{ enter: "You entered!" , exit : ["You", "exited"] }}) ``` The `events` default supports different data types * **string** | Automatically runs `.fix()` for that name (no events fired yet) * **array** | Automatically run `.fix()` for all those names (no events fired yet) * **object** | Every key is both fixed, and emitted with the value indicated Thus, the above code could be used like so ```javascript var state = new done_is_fixed.EventEmitter state.emit('done', 'Hi, listener below me!') state.on('done', function(hi) { console.log('Loud and clear.') }) // Fires var bros = new ducks_are_fixed.EventEmitter bros.emit('Dewey', 'Duck') bros.on('Dewey', function() { 'Dewey event fired' }) // Fires bros.on('Dewey', function() { 'Dewey fired again' }) // Also fires // This will fire immediately var room = new values_are_fixed.EventEmitter room.on('enter', function(msg) { console.log(msg) }) // output: "You entered!" ``` ## Tests Follow uses [node-tap][tap]. If you clone this Git repository, tap is included. $ ./node_modules/.bin/tap test ok test/event.js ...................................... 19/19 ok test/once.js ................................... 5011/5011 total ............................................. 5032/5032 ok ## License Apache 2.0 [tap]: https://github.com/isaacs/node-tap [def]: https://github.com/iriscouch/defaultable
apache-2.0
semonte/intellij-community
platform/projectModel-impl/src/com/intellij/openapi/roots/impl/RootIndex.java
31099
/* * Copyright 2000-2017 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.intellij.openapi.roots.impl; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.extensions.Extensions; import com.intellij.openapi.fileTypes.FileTypeRegistry; import com.intellij.openapi.module.Module; import com.intellij.openapi.module.ModuleManager; import com.intellij.openapi.project.Project; import com.intellij.openapi.roots.*; import com.intellij.openapi.roots.impl.libraries.LibraryEx; import com.intellij.openapi.roots.libraries.Library; import com.intellij.openapi.util.Pair; import com.intellij.openapi.util.text.StringUtil; import com.intellij.openapi.vfs.VfsUtilCore; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.openapi.vfs.VirtualFileWithId; import com.intellij.openapi.vfs.newvfs.events.VFileEvent; import com.intellij.util.CollectionQuery; import com.intellij.util.Query; import com.intellij.util.containers.ContainerUtil; import com.intellij.util.containers.MultiMap; import com.intellij.util.containers.SLRUMap; import gnu.trove.TObjectIntHashMap; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.jetbrains.jps.model.module.JpsModuleSourceRootType; import java.util.*; public class RootIndex { public static final Comparator<OrderEntry> BY_OWNER_MODULE = (o1, o2) -> { String name1 = o1.getOwnerModule().getName(); String name2 = o2.getOwnerModule().getName(); return name1.compareTo(name2); }; private static final Logger LOG = Logger.getInstance("#com.intellij.openapi.roots.impl.RootIndex"); private static final FileTypeRegistry ourFileTypes = FileTypeRegistry.getInstance(); private final Map<VirtualFile, String> myPackagePrefixByRoot = ContainerUtil.newHashMap(); private final InfoCache myInfoCache; private final List<JpsModuleSourceRootType<?>> myRootTypes = ContainerUtil.newArrayList(); private final TObjectIntHashMap<JpsModuleSourceRootType<?>> myRootTypeId = new TObjectIntHashMap<>(); @NotNull private final Project myProject; private final PackageDirectoryCache myPackageDirectoryCache; private OrderEntryGraph myOrderEntryGraph; // made public for Upsource public RootIndex(@NotNull Project project, @NotNull InfoCache cache) { myProject = project; myInfoCache = cache; final RootInfo info = buildRootInfo(project); MultiMap<String, VirtualFile> rootsByPackagePrefix = MultiMap.create(); Set<VirtualFile> allRoots = info.getAllRoots(); for (VirtualFile root : allRoots) { List<VirtualFile> hierarchy = getHierarchy(root, allRoots, info); Pair<DirectoryInfo, String> pair = hierarchy != null ? calcDirectoryInfo(root, hierarchy, info) : new Pair<>(NonProjectDirectoryInfo.IGNORED, null); cacheInfos(root, root, pair.first); rootsByPackagePrefix.putValue(pair.second, root); myPackagePrefixByRoot.put(root, pair.second); } myPackageDirectoryCache = new PackageDirectoryCache(rootsByPackagePrefix) { @Override protected boolean isPackageDirectory(@NotNull VirtualFile dir, @NotNull String packageName) { return getInfoForFile(dir).isInProject() && packageName.equals(getPackageName(dir)); } }; } public void onLowMemory() { myPackageDirectoryCache.onLowMemory(); } @NotNull private RootInfo buildRootInfo(@NotNull Project project) { final RootInfo info = new RootInfo(); for (final Module module : ModuleManager.getInstance(project).getModules()) { final ModuleRootManager moduleRootManager = ModuleRootManager.getInstance(module); for (final VirtualFile contentRoot : moduleRootManager.getContentRoots()) { if (!info.contentRootOf.containsKey(contentRoot) && ensureValid(contentRoot, module)) { info.contentRootOf.put(contentRoot, module); } } for (ContentEntry contentEntry : moduleRootManager.getContentEntries()) { if (!(contentEntry instanceof ContentEntryImpl) || !((ContentEntryImpl)contentEntry).isDisposed()) { for (VirtualFile excludeRoot : contentEntry.getExcludeFolderFiles()) { if (!ensureValid(excludeRoot, contentEntry)) continue; info.excludedFromModule.put(excludeRoot, module); } } // Init module sources for (final SourceFolder sourceFolder : contentEntry.getSourceFolders()) { final VirtualFile sourceFolderRoot = sourceFolder.getFile(); if (sourceFolderRoot != null && ensureValid(sourceFolderRoot, sourceFolder)) { info.rootTypeId.put(sourceFolderRoot, getRootTypeId(sourceFolder.getRootType())); info.classAndSourceRoots.add(sourceFolderRoot); info.sourceRootOf.putValue(sourceFolderRoot, module); info.packagePrefix.put(sourceFolderRoot, sourceFolder.getPackagePrefix()); } } } for (OrderEntry orderEntry : moduleRootManager.getOrderEntries()) { if (orderEntry instanceof LibraryOrSdkOrderEntry) { final LibraryOrSdkOrderEntry entry = (LibraryOrSdkOrderEntry)orderEntry; final VirtualFile[] sourceRoots = entry.getRootFiles(OrderRootType.SOURCES); final VirtualFile[] classRoots = entry.getRootFiles(OrderRootType.CLASSES); // Init library sources for (final VirtualFile sourceRoot : sourceRoots) { if (!ensureValid(sourceRoot, entry)) continue; info.classAndSourceRoots.add(sourceRoot); info.libraryOrSdkSources.add(sourceRoot); info.packagePrefix.put(sourceRoot, ""); } // init library classes for (final VirtualFile classRoot : classRoots) { if (!ensureValid(classRoot, entry)) continue; info.classAndSourceRoots.add(classRoot); info.libraryOrSdkClasses.add(classRoot); info.packagePrefix.put(classRoot, ""); } if (orderEntry instanceof LibraryOrderEntry) { Library library = ((LibraryOrderEntry)orderEntry).getLibrary(); if (library != null) { for (VirtualFile root : ((LibraryEx)library).getExcludedRoots()) { if (!ensureValid(root, library)) continue; info.excludedFromLibraries.putValue(root, library); } for (VirtualFile root : sourceRoots) { if (!ensureValid(root, library)) continue; info.sourceOfLibraries.putValue(root, library); } for (VirtualFile root : classRoots) { if (!ensureValid(root, library)) continue; info.classOfLibraries.putValue(root, library); } } } } } } for (AdditionalLibraryRootsProvider provider : Extensions.getExtensions(AdditionalLibraryRootsProvider.EP_NAME)) { Collection<SyntheticLibrary> libraries = provider.getAdditionalProjectLibraries(project); for (SyntheticLibrary descriptor : libraries) { for (VirtualFile root : descriptor.getSourceRoots()) { if (!ensureValid(root, project)) continue; info.libraryOrSdkSources.add(root); info.classAndSourceRoots.add(root); info.sourceOfLibraries.putValue(root, descriptor); } for (VirtualFile file : descriptor.getExcludedRoots()) { if (!ensureValid(file, project)) continue; info.excludedFromLibraries.putValue(file, descriptor); } } } for (DirectoryIndexExcludePolicy policy : Extensions.getExtensions(DirectoryIndexExcludePolicy.EP_NAME, project)) { info.excludedFromProject.addAll(ContainerUtil.filter(policy.getExcludeRootsForProject(), file -> ensureValid(file, policy))); } return info; } private static boolean ensureValid(@NotNull VirtualFile file, @NotNull Object container) { if (!(file instanceof VirtualFileWithId)) { //skip roots from unsupported file systems (e.g. http) return false; } if (!file.isValid()) { LOG.error("Invalid root " + file + " in " + container); return false; } return true; } @NotNull private synchronized OrderEntryGraph getOrderEntryGraph() { if (myOrderEntryGraph == null) { RootInfo rootInfo = buildRootInfo(myProject); myOrderEntryGraph = new OrderEntryGraph(myProject, rootInfo); } return myOrderEntryGraph; } /** * A reverse dependency graph of (library, jdk, module, module source) -> (module). * * <p>Each edge carries with it the associated OrderEntry that caused the dependency. */ private static class OrderEntryGraph { private static class Edge { Module myKey; ModuleOrderEntry myOrderEntry; // Order entry from myKey -> the node containing the edge boolean myRecursive; // Whether this edge should be descended into during graph walk public Edge(Module key, ModuleOrderEntry orderEntry, boolean recursive) { myKey = key; myOrderEntry = orderEntry; myRecursive = recursive; } @Override public String toString() { return myOrderEntry.toString(); } } private static class Node { Module myKey; List<Edge> myEdges = new ArrayList<>(); @Override public String toString() { return myKey.toString(); } } private static class Graph { Map<Module, Node> myNodes = new HashMap<>(); } final Project myProject; final RootInfo myRootInfo; final Set<VirtualFile> myAllRoots; Graph myGraph; MultiMap<VirtualFile, Node> myRoots; // Map of roots to their root nodes, eg. library jar -> library node final SynchronizedSLRUCache<VirtualFile, List<OrderEntry>> myCache; private MultiMap<VirtualFile, OrderEntry> myLibClassRootEntries; private MultiMap<VirtualFile, OrderEntry> myLibSourceRootEntries; public OrderEntryGraph(Project project, RootInfo rootInfo) { myProject = project; myRootInfo = rootInfo; myAllRoots = myRootInfo.getAllRoots(); int cacheSize = Math.max(25, (myAllRoots.size() / 100) * 2); myCache = new SynchronizedSLRUCache<VirtualFile, List<OrderEntry>>(cacheSize, cacheSize) { @NotNull @Override public List<OrderEntry> createValue(VirtualFile key) { return collectOrderEntries(key); } }; initGraph(); initLibraryRoots(); } private void initGraph() { Graph graph = new Graph(); MultiMap<VirtualFile, Node> roots = MultiMap.createSmart(); for (final Module module : ModuleManager.getInstance(myProject).getModules()) { final ModuleRootManager moduleRootManager = ModuleRootManager.getInstance(module); List<OrderEnumerationHandler> handlers = OrderEnumeratorBase.getCustomHandlers(module); for (OrderEntry orderEntry : moduleRootManager.getOrderEntries()) { if (orderEntry instanceof ModuleOrderEntry) { ModuleOrderEntry moduleOrderEntry = (ModuleOrderEntry)orderEntry; final Module depModule = moduleOrderEntry.getModule(); if (depModule != null) { Node node = graph.myNodes.get(depModule); OrderEnumerator en = OrderEnumerator.orderEntries(depModule).exportedOnly(); if (node == null) { node = new Node(); node.myKey = depModule; graph.myNodes.put(depModule, node); VirtualFile[] importedClassRoots = en.classes().usingCache().getRoots(); for (VirtualFile importedClassRoot : importedClassRoots) { roots.putValue(importedClassRoot, node); } VirtualFile[] importedSourceRoots = en.sources().usingCache().getRoots(); for (VirtualFile sourceRoot : importedSourceRoots) { roots.putValue(sourceRoot, node); } } boolean shouldRecurse = en.recursively().shouldRecurse(moduleOrderEntry, handlers); node.myEdges.add(new Edge(module, moduleOrderEntry, shouldRecurse)); } } } } myGraph = graph; myRoots = roots; } private void initLibraryRoots() { MultiMap<VirtualFile, OrderEntry> libClassRootEntries = MultiMap.createSmart(); MultiMap<VirtualFile, OrderEntry> libSourceRootEntries = MultiMap.createSmart(); for (final Module module : ModuleManager.getInstance(myProject).getModules()) { final ModuleRootManager moduleRootManager = ModuleRootManager.getInstance(module); for (OrderEntry orderEntry : moduleRootManager.getOrderEntries()) { if (orderEntry instanceof LibraryOrSdkOrderEntry) { final LibraryOrSdkOrderEntry entry = (LibraryOrSdkOrderEntry)orderEntry; for (final VirtualFile sourceRoot : entry.getRootFiles(OrderRootType.SOURCES)) { libSourceRootEntries.putValue(sourceRoot, orderEntry); } for (final VirtualFile classRoot : entry.getRootFiles(OrderRootType.CLASSES)) { libClassRootEntries.putValue(classRoot, orderEntry); } } } } myLibClassRootEntries = libClassRootEntries; myLibSourceRootEntries = libSourceRootEntries; } private List<OrderEntry> getOrderEntries(@NotNull VirtualFile file) { return myCache.get(file); } /** * Traverses the graph from the given file, collecting all encountered order entries. */ private List<OrderEntry> collectOrderEntries(@NotNull VirtualFile file) { List<VirtualFile> roots = getHierarchy(file, myAllRoots, myRootInfo); if (roots == null) { return Collections.emptyList(); } List<OrderEntry> result = new ArrayList<>(); Stack<Node> stack = new Stack<>(); for (VirtualFile root : roots) { Collection<Node> nodes = myRoots.get(root); for (Node node : nodes) { stack.push(node); } } Set<Node> seen = new HashSet<>(); while (!stack.isEmpty()) { Node node = stack.pop(); if (seen.contains(node)) { continue; } seen.add(node); for (Edge edge : node.myEdges) { result.add(edge.myOrderEntry); if (edge.myRecursive) { Node targetNode = myGraph.myNodes.get(edge.myKey); if (targetNode != null) { stack.push(targetNode); } } } } @Nullable VirtualFile libraryClassRoot = myRootInfo.findLibraryRootInfo(roots, false); @Nullable VirtualFile librarySourceRoot = myRootInfo.findLibraryRootInfo(roots, true); result.addAll(myRootInfo.getLibraryOrderEntries(roots, libraryClassRoot, librarySourceRoot, myLibClassRootEntries, myLibSourceRootEntries)); VirtualFile moduleContentRoot = myRootInfo.findNearestContentRoot(roots); if (moduleContentRoot != null) { ContainerUtil.addIfNotNull(result, myRootInfo.getModuleSourceEntry(roots, moduleContentRoot, myLibClassRootEntries)); } Collections.sort(result, BY_OWNER_MODULE); return result; } } private int getRootTypeId(@NotNull JpsModuleSourceRootType<?> rootType) { if (myRootTypeId.containsKey(rootType)) { return myRootTypeId.get(rootType); } int id = myRootTypes.size(); if (id > DirectoryInfoImpl.MAX_ROOT_TYPE_ID) { LOG.error("Too many different types of module source roots (" + id + ") registered: " + myRootTypes); } myRootTypes.add(rootType); myRootTypeId.put(rootType, id); return id; } @NotNull public DirectoryInfo getInfoForFile(@NotNull VirtualFile file) { if (!file.isValid()) { return NonProjectDirectoryInfo.INVALID; } VirtualFile dir; if (!file.isDirectory()) { DirectoryInfo info = myInfoCache.getCachedInfo(file); if (info != null) { return info; } if (ourFileTypes.isFileIgnored(file)) { return NonProjectDirectoryInfo.IGNORED; } dir = file.getParent(); } else { dir = file; } int count = 0; for (VirtualFile root = dir; root != null; root = root.getParent()) { if (++count > 1000) { throw new IllegalStateException("Possible loop in tree, started at " + dir.getName()); } DirectoryInfo info = myInfoCache.getCachedInfo(root); if (info != null) { if (!dir.equals(root)) { cacheInfos(dir, root, info); } return info; } if (ourFileTypes.isFileIgnored(root)) { return cacheInfos(dir, root, NonProjectDirectoryInfo.IGNORED); } } return cacheInfos(dir, null, NonProjectDirectoryInfo.NOT_UNDER_PROJECT_ROOTS); } @NotNull private DirectoryInfo cacheInfos(VirtualFile dir, @Nullable VirtualFile stopAt, @NotNull DirectoryInfo info) { while (dir != null) { myInfoCache.cacheInfo(dir, info); if (dir.equals(stopAt)) { break; } dir = dir.getParent(); } return info; } @NotNull public Query<VirtualFile> getDirectoriesByPackageName(@NotNull final String packageName, final boolean includeLibrarySources) { // Note that this method is used in upsource as well, hence, don't reduce this method's visibility. List<VirtualFile> result = myPackageDirectoryCache.getDirectoriesByPackageName(packageName); if (!includeLibrarySources) { result = ContainerUtil.filter(result, file -> { DirectoryInfo info = getInfoForFile(file); return info.isInProject() && (!info.isInLibrarySource() || info.isInModuleSource() || info.hasLibraryClassRoot()); }); } return new CollectionQuery<>(result); } @Nullable public String getPackageName(@NotNull final VirtualFile dir) { if (dir.isDirectory()) { if (ourFileTypes.isFileIgnored(dir)) { return null; } if (myPackagePrefixByRoot.containsKey(dir)) { return myPackagePrefixByRoot.get(dir); } final VirtualFile parent = dir.getParent(); if (parent != null) { return getPackageNameForSubdir(getPackageName(parent), dir.getName()); } } return null; } @Nullable protected static String getPackageNameForSubdir(@Nullable String parentPackageName, @NotNull String subdirName) { if (parentPackageName == null) return null; return parentPackageName.isEmpty() ? subdirName : parentPackageName + "." + subdirName; } @Nullable public JpsModuleSourceRootType<?> getSourceRootType(@NotNull DirectoryInfo directoryInfo) { return myRootTypes.get(directoryInfo.getSourceRootTypeId()); } boolean resetOnEvents(@NotNull List<? extends VFileEvent> events) { for (VFileEvent event : events) { VirtualFile file = event.getFile(); if (file == null || file.isDirectory()) { return true; } } return false; } @Nullable("returns null only if dir is under ignored folder") private static List<VirtualFile> getHierarchy(VirtualFile dir, @NotNull Set<VirtualFile> allRoots, @NotNull RootInfo info) { List<VirtualFile> hierarchy = ContainerUtil.newArrayList(); boolean hasContentRoots = false; while (dir != null) { hasContentRoots |= info.contentRootOf.get(dir) != null; if (!hasContentRoots && ourFileTypes.isFileIgnored(dir)) { return null; } if (allRoots.contains(dir)) { hierarchy.add(dir); } dir = dir.getParent(); } return hierarchy; } private static class RootInfo { // getDirectoriesByPackageName used to be in this order, some clients might rely on that @NotNull final LinkedHashSet<VirtualFile> classAndSourceRoots = ContainerUtil.newLinkedHashSet(); @NotNull final Set<VirtualFile> libraryOrSdkSources = ContainerUtil.newHashSet(); @NotNull final Set<VirtualFile> libraryOrSdkClasses = ContainerUtil.newHashSet(); @NotNull final Map<VirtualFile, Module> contentRootOf = ContainerUtil.newHashMap(); @NotNull final MultiMap<VirtualFile, Module> sourceRootOf = MultiMap.createSet(); @NotNull final TObjectIntHashMap<VirtualFile> rootTypeId = new TObjectIntHashMap<>(); @NotNull final MultiMap<VirtualFile, /*Library|SyntheticLibrary*/ Object> excludedFromLibraries = MultiMap.createSmart(); @NotNull final MultiMap<VirtualFile, Library> classOfLibraries = MultiMap.createSmart(); @NotNull final MultiMap<VirtualFile, /*Library|SyntheticLibrary*/ Object> sourceOfLibraries = MultiMap.createSmart(); @NotNull final Set<VirtualFile> excludedFromProject = ContainerUtil.newHashSet(); @NotNull final Map<VirtualFile, Module> excludedFromModule = ContainerUtil.newHashMap(); @NotNull final Map<VirtualFile, String> packagePrefix = ContainerUtil.newHashMap(); @NotNull Set<VirtualFile> getAllRoots() { LinkedHashSet<VirtualFile> result = ContainerUtil.newLinkedHashSet(); result.addAll(classAndSourceRoots); result.addAll(contentRootOf.keySet()); result.addAll(excludedFromLibraries.keySet()); result.addAll(excludedFromModule.keySet()); result.addAll(excludedFromProject); return result; } /** * Returns nearest content root for a file by its parent directories hierarchy. If the file is excluded (i.e. located under an excluded * root and there are no source roots on the path to the excluded root) returns {@code null}. */ @Nullable private VirtualFile findNearestContentRoot(@NotNull List<VirtualFile> hierarchy) { Collection<Module> sourceRootOwners = null; boolean underExcludedSourceRoot = false; for (VirtualFile root : hierarchy) { Module module = contentRootOf.get(root); Module excludedFrom = excludedFromModule.get(root); if (module != null && (excludedFrom != module || underExcludedSourceRoot && sourceRootOwners.contains(module))) { return root; } if (excludedFrom != null || excludedFromProject.contains(root)) { if (sourceRootOwners != null) { underExcludedSourceRoot = true; } else { return null; } } if (!underExcludedSourceRoot && sourceRootOf.containsKey(root)) { Collection<Module> modulesForSourceRoot = sourceRootOf.get(root); if (!modulesForSourceRoot.isEmpty()) { if (sourceRootOwners == null) { sourceRootOwners = modulesForSourceRoot; } else { sourceRootOwners = ContainerUtil.union(sourceRootOwners, modulesForSourceRoot); } } } } return null; } @Nullable private VirtualFile findNearestContentRootForExcluded(@NotNull List<VirtualFile> hierarchy) { for (VirtualFile root : hierarchy) { if (contentRootOf.containsKey(root)) { return root; } } return null; } @Nullable private VirtualFile findLibraryRootInfo(@NotNull List<VirtualFile> hierarchy, boolean source) { Set<Object> librariesToIgnore = ContainerUtil.newHashSet(); for (VirtualFile root : hierarchy) { librariesToIgnore.addAll(excludedFromLibraries.get(root)); if (source && libraryOrSdkSources.contains(root) && (!sourceOfLibraries.containsKey(root) || !librariesToIgnore.containsAll(sourceOfLibraries.get(root)))) { return root; } else if (!source && libraryOrSdkClasses.contains(root) && (!classOfLibraries.containsKey(root) || !librariesToIgnore.containsAll(classOfLibraries.get(root)))) { return root; } } return null; } private String calcPackagePrefix(@NotNull VirtualFile root, @NotNull List<VirtualFile> hierarchy, VirtualFile moduleContentRoot, VirtualFile libraryClassRoot, VirtualFile librarySourceRoot) { VirtualFile packageRoot = findPackageRootInfo(hierarchy, moduleContentRoot, libraryClassRoot, librarySourceRoot); String prefix = packagePrefix.get(packageRoot); if (prefix != null && !root.equals(packageRoot)) { assert packageRoot != null; String relative = VfsUtilCore.getRelativePath(root, packageRoot, '.'); prefix = StringUtil.isEmpty(prefix) ? relative : prefix + '.' + relative; } return prefix; } @Nullable private VirtualFile findPackageRootInfo(@NotNull List<VirtualFile> hierarchy, VirtualFile moduleContentRoot, VirtualFile libraryClassRoot, VirtualFile librarySourceRoot) { for (VirtualFile root : hierarchy) { if (moduleContentRoot != null && sourceRootOf.get(root).contains(contentRootOf.get(moduleContentRoot)) && librarySourceRoot == null) { return root; } if (root.equals(libraryClassRoot) || root.equals(librarySourceRoot)) { return root; } if (root.equals(moduleContentRoot) && !sourceRootOf.containsKey(root) && librarySourceRoot == null && libraryClassRoot == null) { return null; } } return null; } @NotNull private LinkedHashSet<OrderEntry> getLibraryOrderEntries(@NotNull List<VirtualFile> hierarchy, @Nullable VirtualFile libraryClassRoot, @Nullable VirtualFile librarySourceRoot, @NotNull MultiMap<VirtualFile, OrderEntry> libClassRootEntries, @NotNull MultiMap<VirtualFile, OrderEntry> libSourceRootEntries) { LinkedHashSet<OrderEntry> orderEntries = ContainerUtil.newLinkedHashSet(); for (VirtualFile root : hierarchy) { if (root.equals(libraryClassRoot) && !sourceRootOf.containsKey(root)) { orderEntries.addAll(libClassRootEntries.get(root)); } if (root.equals(librarySourceRoot) && libraryClassRoot == null) { orderEntries.addAll(libSourceRootEntries.get(root)); } if (libClassRootEntries.containsKey(root) || sourceRootOf.containsKey(root) && librarySourceRoot == null) { break; } } return orderEntries; } @Nullable private ModuleSourceOrderEntry getModuleSourceEntry(@NotNull List<VirtualFile> hierarchy, @NotNull VirtualFile moduleContentRoot, @NotNull MultiMap<VirtualFile, OrderEntry> libClassRootEntries) { Module module = contentRootOf.get(moduleContentRoot); for (VirtualFile root : hierarchy) { if (sourceRootOf.get(root).contains(module)) { return ContainerUtil.findInstance(ModuleRootManager.getInstance(module).getOrderEntries(), ModuleSourceOrderEntry.class); } if (libClassRootEntries.containsKey(root)) { return null; } } return null; } } @NotNull private static Pair<DirectoryInfo, String> calcDirectoryInfo(@NotNull final VirtualFile root, @NotNull final List<VirtualFile> hierarchy, @NotNull RootInfo info) { VirtualFile moduleContentRoot = info.findNearestContentRoot(hierarchy); VirtualFile libraryClassRoot = info.findLibraryRootInfo(hierarchy, false); VirtualFile librarySourceRoot = info.findLibraryRootInfo(hierarchy, true); boolean inProject = moduleContentRoot != null || libraryClassRoot != null || librarySourceRoot != null; VirtualFile nearestContentRoot; if (inProject) { nearestContentRoot = moduleContentRoot; } else { nearestContentRoot = info.findNearestContentRootForExcluded(hierarchy); if (nearestContentRoot == null) { return new Pair<>(NonProjectDirectoryInfo.EXCLUDED, null); } } VirtualFile sourceRoot = info.findPackageRootInfo(hierarchy, moduleContentRoot, null, librarySourceRoot); VirtualFile moduleSourceRoot = info.findPackageRootInfo(hierarchy, moduleContentRoot, null, null); boolean inModuleSources = moduleSourceRoot != null; boolean inLibrarySource = librarySourceRoot != null; int typeId = moduleSourceRoot != null ? info.rootTypeId.get(moduleSourceRoot) : 0; Module module = info.contentRootOf.get(nearestContentRoot); DirectoryInfo directoryInfo = new DirectoryInfoImpl(root, module, nearestContentRoot, sourceRoot, libraryClassRoot, inModuleSources, inLibrarySource, !inProject, typeId); String packagePrefix = info.calcPackagePrefix(root, hierarchy, moduleContentRoot, libraryClassRoot, librarySourceRoot); return Pair.create(directoryInfo, packagePrefix); } @NotNull public List<OrderEntry> getOrderEntries(@NotNull DirectoryInfo info) { if (!(info instanceof DirectoryInfoImpl)) return Collections.emptyList(); return getOrderEntryGraph().getOrderEntries(((DirectoryInfoImpl)info).getRoot()); } public interface InfoCache { @Nullable DirectoryInfo getCachedInfo(@NotNull VirtualFile dir); void cacheInfo(@NotNull VirtualFile dir, @NotNull DirectoryInfo info); } /** * An LRU cache with synchronization around the primary cache operations (get() and insertion * of a newly created value). Other map operations are not synchronized. */ abstract static class SynchronizedSLRUCache<K, V> extends SLRUMap<K,V> { protected final Object myLock = new Object(); protected SynchronizedSLRUCache(final int protectedQueueSize, final int probationalQueueSize) { super(protectedQueueSize, probationalQueueSize); } @NotNull public abstract V createValue(K key); @Override @NotNull public V get(K key) { V value; synchronized (myLock) { value = super.get(key); if (value != null) { return value; } } value = createValue(key); synchronized (myLock) { put(key, value); } return value; } } }
apache-2.0
an4967/TizenRT
os/include/tinyara/debug/sysdbg.h
3405
/**************************************************************************** * * Copyright 2017 Samsung Electronics All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, * either express or implied. See the License for the specific * language governing permissions and limitations under the License. * ****************************************************************************/ #ifndef __INCLUDE_DEBUG_SYSDBG_H #define __INCLUDE_DEBUG_SYSDBG_H /**************************************************************************** * Included Files ****************************************************************************/ #include <tinyara/config.h> #include <tinyara/sched.h> #include <sys/types.h> #include <stdint.h> #include <semaphore.h> /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ /* Reducing the size intentionally for debug purpose to avoid memory crunch */ #define TASK_NAME_SIZE 15 #define SEMAPHORE_STATUS_SIZE 2 /**************************************************************************** * Public Types ****************************************************************************/ #ifndef __ASSEMBLY__ #undef EXTERN #if defined(__cplusplus) #define EXTERN extern "C" extern "C" { #else #define EXTERN extern #endif /**************************************************************************** * system debug Function Declarations ****************************************************************************/ int sysdbg_init(void); /* Important data structures to save the task and irq history */ struct sched_history_s { clock_t time; #if CONFIG_TASK_NAME_SIZE > 0 char task[TASK_NAME_SIZE + 1]; #endif pid_t pid; uint8_t sched_priority; struct tcb_s *ptcb; }; typedef struct sched_history_s sched_history_t; struct irq_history_s { clock_t time; uint32_t irq; void *fn; }; typedef struct irq_history_s irq_history_t; struct sem_history_s { clock_t time; char status[SEMAPHORE_STATUS_SIZE + 1]; #if CONFIG_TASK_NAME_SIZE > 0 char task_name[TASK_NAME_SIZE + 1]; #endif sem_t *sem; void *ptcb; pid_t pid; }; typedef struct sem_history_s sem_history_t; enum sem_status_s { SEM_INIT = 0, SEM_ACQUIRE, SEM_RELEASE, SEM_WAITING, SEM_DESTROY, }; typedef enum sem_status_s sem_status_t; struct sysdbg_s { #ifdef CONFIG_TASK_SCHED_HISTORY sched_history_t *sched; int task_lastindex; #endif #ifdef CONFIG_IRQ_SCHED_HISTORY irq_history_t *irq; int irq_lastindex; #endif #ifdef CONFIG_SEMAPHORE_HISTORY sem_history_t *sem_log; int sem_lastindex; #endif }; typedef struct sysdbg_s sysdbg_t; extern void save_task_scheduling_status(struct tcb_s *tcb); extern void save_irq_scheduling_status(uint32_t irq, void *fn); extern void save_semaphore_history(FAR sem_t *sem, void *addr, sem_status_t status); #undef EXTERN #ifdef __cplusplus } #endif #endif /* __ASSEMBLY__ */ #endif /* __INCLUDE_DEBUG_SYSDBG_H */
apache-2.0
wisechengyi/intellij-pants-plugin
tests/com/twitter/intellij/pants/execution/PantsMakeMessageTest.java
3201
// Copyright 2017 Pants project contributors (see CONTRIBUTORS.md). // Licensed under the Apache License, Version 2.0 (see LICENSE). package com.twitter.intellij.pants.execution; import com.intellij.openapi.vfs.LocalFileSystem; import com.twitter.intellij.pants.testFramework.OSSPantsIntegrationTest; import com.twitter.intellij.pants.util.TempFile; import java.io.IOException; import java.util.Optional; import static com.twitter.intellij.pants.execution.PantsMakeBeforeRun.ERROR_TAG; // Need to extned `OSSPantsIntegrationTest` because LocalFileSystem needs to be initialized. public class PantsMakeMessageTest extends OSSPantsIntegrationTest { public void testErrorMessageWithFilePath() { try (TempFile tempFile = TempFile.create("pants_export_run", ".out")) { Optional<PantsMakeBeforeRun.ParseResult> result = PantsMakeBeforeRun.ParseResult.parseErrorLocation( " [error] " + tempFile.getFile().getAbsolutePath() + ":23:1: cannot find symbol", ERROR_TAG ); assertTrue(result.isPresent()); assertEquals( LocalFileSystem.getInstance() .findFileByIoFile(tempFile.getFile()), result.get().getFile() ); assertEquals(23, result.get().getLineNumber()); assertEquals(1, result.get().getColumnNumber()); } catch (IOException e) { // Fall-through to handle outside the block. } } public void testErrorMessageWithStrangerFilePath() { try (TempFile filePathWithSpace = TempFile.create("pants_exp ort_run", ".out")) { Optional<PantsMakeBeforeRun.ParseResult> result = PantsMakeBeforeRun.ParseResult.parseErrorLocation( " [error] " + filePathWithSpace.getFile().getAbsolutePath() + ":23:1: cannot find symbol", ERROR_TAG ); assertTrue(result.isPresent()); assertEquals( LocalFileSystem.getInstance() .findFileByIoFile(filePathWithSpace.getFile()), result.get().getFile() ); assertEquals(23, result.get().getLineNumber()); assertEquals(1, result.get().getColumnNumber()); } catch (IOException e) { // Fall-through to handle outside the block. } } public void testErrorMessageWithInvalidFilePath() { Optional<PantsMakeBeforeRun.ParseResult> result = PantsMakeBeforeRun.ParseResult.parseErrorLocation( " [error] /non/existent/file/path:23:1: cannot find symbol", ERROR_TAG ); assertFalse(result.isPresent()); } public void testErrorMessageWithNoFilePath() { Optional<PantsMakeBeforeRun.ParseResult> result = PantsMakeBeforeRun.ParseResult.parseErrorLocation( " [error] String greeting = Greeting.greetFromRXesource(\"org/pantsbuild/example/hello/world.txt\");\n", ERROR_TAG ); assertFalse(result.isPresent()); } public void testErrorMessageWithTwoColons() { Optional<PantsMakeBeforeRun.ParseResult> result = PantsMakeBeforeRun.ParseResult.parseErrorLocation( "[error] Assert.assertEquals(\"0:00:00.000\", ManagementUtils.getAverageAge(d0));", ERROR_TAG ); assertFalse(result.isPresent()); } }
apache-2.0
NYPL/building-inspector
app/assets/javascripts/lib/vendor/leaflet-editable-polygon.js
23188
L.Polygon.polygonEditor = L.Polygon.extend({ _prepareMapIfNeeded: function() { var that = this; if(this._map._editablePolygons != null) { return; } // Container for all editable polylines on this map: this._map._editablePolygons = []; // Click anywhere on map to add a new point-polyline: if(this._options.newPolygons) { // console.log('click na map'); that._map.on('click', function(event) { // console.log('click, target=' + (event.target == that._map) + ' type=' + event.type); if(that.isBusy()) return; that._setBusy(true); var latLng = event.latlng; if(that._options.newPolygonConfirmMessage) if(!confirm(that._options.newPolygonConfirmMessage)) return var contexts = [{'originalPolygonNo': null, 'originalPointNo': null}]; L.Polygon.PolygonEditor([latLng], that._options, contexts).addTo(that._map); that._setBusy(false); that._showBoundMarkers(); }); } }, /** * Will add all needed methods to this polyline. */ _addMethods: function() { var that = this; this._init = function(options, contexts) { this._prepareMapIfNeeded(); /* * Utility method added to this map to retreive editable * polylines. */ if(!this._map.getEditablePolylines) { this._map.getEditablePolylines = function() { return that._map._editablePolygons; } } /** * Since all point editing is done by marker events, markers * will be the main holder of the polyline points locations. * Every marker contains a reference to the newPointMarker * *before* him (=> the first marker has newPointMarker=null). */ this._parseOptions(options); this._setMarkers(); var map = this._map; this._map.on("zoomend", function(e) { that._showBoundMarkers(); }); this._map.on("moveend", function(e) { that._showBoundMarkers(); }); this._lastMouseEvent = undefined; if('_desiredPolygonNo' in this) { this._map._editablePolygons.splice(this._desiredPolygonNo, 0, this); } else { this._map._editablePolygons.push(this); } }; /** * Check if there is *any* busy editable polyline on this map. */ this.isBusy = function() { for(var i = 0; i < that._map._editablePolygons.length; i++) if(that._map._editablePolygons[i]._isBusy()) return true; return false; }; /** * Check if is busy adding/moving new nodes. Note, there may be * *other* editable polylines on the same map which *are* busy. */ this._isBusy = function() { return that._busy; }; this._setBusy = function(busy) { that._busy = busy; }; /** * Get markers for this polyline. */ this.getPoints = function() { return this._markers; }; this._parseOptions = function(options) { if(!options) options = {}; // Do not show edit markers if more than maxMarkers would be shown: if(!('maxMarkers' in options)) { options.maxMarkers = 100; } this.maxMarkers = options.maxMarkers; // Do not allow edges to be destroyed (split polygon in two) if(!('deletableEdges' in options)) { options.deletableEdges = false; } this.deletableEdges = options.deletableEdges; // Icons: if(options.pointIcon) { this.pointIcon = options.pointIcon; } else { this.pointIcon = L.icon({ iconUrl: 'editmarker.png', iconSize: [11, 11], iconAnchor: [6, 6] }); } if(options.newPointIcon) { this.newPointIcon = options.newPointIcon; } else { this.newPointIcon = L.icon({ iconUrl: 'editmarker2.png', iconSize: [11, 11], iconAnchor: [6, 6] }); } }; /** * Show only markers in current map bounds *is* there are only a certain * number of markers. This method is called on eventy that change map * bounds. */ this._showBoundMarkers = function() { if(that.isBusy()) { //console.log('Do not show because busy!'); return; } var bounds = that._map.getBounds(); var found = 0; for(var polygonNo in that._map._editablePolygons) { var polyline = that._map._editablePolygons[polygonNo]; for(var markerNo in polyline._markers) { var marker = polyline._markers[markerNo]; if(bounds.contains(marker.getLatLng())) found += 1; } } //console.log('found=' + found); for(var polygonNo in that._map._editablePolygons) { var polyline = that._map._editablePolygons[polygonNo]; for(var markerNo in polyline._markers) { var marker = polyline._markers[markerNo]; if(found < that.maxMarkers) { that._setMarkerVisible(marker, bounds.contains(marker.getLatLng())); that._setMarkerVisible(marker.newPointMarker, bounds.contains(marker.getLatLng())); } else { that._setMarkerVisible(marker, false); that._setMarkerVisible(marker.newPointMarker, false); } } } }; /** * Used when adding/moving points in order to disable the user to mess * with other markers (+ easier to decide where to put the point * without too many markers). */ this._hideAll = function(except) { for(var polygonNo in that._map._editablePolygons) { //console.log("hide " + polygonNo + " markers"); var polyline = that._map._editablePolygons[polygonNo]; for(var markerNo in polyline._markers) { var marker = polyline._markers[markerNo]; if(except == null || except != marker) polyline._setMarkerVisible(marker, false); if(except == null || except != marker.newPointMarker) polyline._setMarkerVisible(marker.newPointMarker, false); } } } /** * Show/hide marker. */ this._setMarkerVisible = function(marker, show) { if(!marker) return; var map = this._map; if(show) { if(!marker._visible) { if(!marker._map) { // First show fo this marker: marker.addTo(map); } else { // Marker was already shown and hidden: map.addLayer(marker); } marker._map = map; } marker._visible = true; } else { if(marker._visible) { map.removeLayer(marker); } marker._visible = false; } }; this.updateLatLngs = function (latlngs) { this._eraseMarkers(); this.setLatLngs(latlngs); that._setMarkers(); this._reloadPolygon(); return this; } /** * Reload polyline. If it is busy, then the bound markers will not be * shown. Call _setBusy(false) before this method! */ this._reloadPolygon = function(fixAroundPointNo) { // that._setMarkers(); that.setLatLngs(that._getMarkerLatLngs()); if(fixAroundPointNo != null) that._fixNeighbourPositions(fixAroundPointNo); that._showBoundMarkers(); } /** * Reload polyline. If it is busy, then the bound markers will not be * shown. Call _setBusy(false) before this method! */ this._setMarkers = function() { this._markers = []; var that = this; var points = this.getLatLngs(); var length = points.length; for(var i = 0; i < length; i++) { var marker = this._addMarkers(i, points[i]); if(! ('context' in marker)) { marker.context = {} if(that._contexts != null) { marker.context = contexts[i]; } } if(marker.context && ! ('originalPointNo' in marker.context)) marker.context.originalPointNo = i; if(marker.context && ! ('originalPolygonNo' in marker.context)) marker.context.originalPolygonNo = that._map._editablePolygons.length; } } /** * Reload polyline. If it is busy, then the bound markers will not be * shown. Call _setBusy(false) before this method! */ this._eraseMarkers = function() { var that = this; var points = this._markers; var length = points.length; for(var i = 0; i < length; i++) { var marker = points[i]; this._map.removeLayer(marker.newPointMarker); this._map.removeLayer(marker); } this._markers = []; } /** * Add two markers (a point marker and his newPointMarker) for a * single point. * * Markers are not added on the map here, the marker.addTo(map) is called * only later when needed first time because of performance issues. */ this._addMarkers = function(pointNo, latLng, fixNeighbourPositions) { var that = this; var points = this.getLatLngs(); var marker = L.marker(latLng, {draggable: true, icon: this.pointIcon}); marker.newPointMarker = null; marker.on('mousedown', function (e) { that._lastMouseEvent = e.originalEvent; }); marker.on('dragstart', function(event) { var pointNo = that._getPointNo(event.target); //console.log("pointNo", pointNo); var previousPoint = pointNo == null ? null : (pointNo - 1 >= 0 ? that._markers[pointNo - 1].getLatLng() : that._markers[that._markers.length - 1].getLatLng()); var nextPoint = pointNo < that._markers.length - 1 ? that._markers[pointNo + 1].getLatLng() : that._markers[0].getLatLng(); that._edited = true; that._setupDragLines(marker, previousPoint, nextPoint); that._setBusy(true); that._hideAll(marker); }); marker.on('dragend', function(event) { that._lastMouseEvent = undefined; var marker = event.target; var pointNo = that._getPointNo(event.target); setTimeout(function() { that._setBusy(false); that._reloadPolygon(pointNo); }, 25); }); // deleting in click and context menu to allow for touch device tap-to-remove marker.on('contextmenu dblclick', function(event) { var corners = that._markers.length; if (corners <= 3) return; var marker = event.target; var pointNo = that._getPointNo(event.target); //console.log("corners:", corners, "pointNo:", pointNo); that._edited = true; that._map.removeLayer(marker); that._map.removeLayer(newPointMarker); that._markers.splice(pointNo, 1); that._reloadPolygon(pointNo); }); var previousPoint = points[pointNo == 0 ? points.length - 1 : pointNo - 1]; var newPointMarker = L.marker([(latLng.lat + previousPoint.lat) / 2., (latLng.lng + previousPoint.lng) / 2.], {draggable: true, icon: this.newPointIcon}); marker.newPointMarker = newPointMarker; newPointMarker.on('dragstart', function(event) { that._lastMouseEvent = event.originalEvent; var pointNo = that._getPointNo(event.target); //console.log("pointNo", pointNo); var previousPoint = pointNo - 1 >= 0 ? that._markers[pointNo - 1].getLatLng() : that._markers[that._markers.length - 1].getLatLng(); var nextPoint = that._markers[pointNo].getLatLng(); that._edited = true; that._setupDragLines(marker.newPointMarker, previousPoint, nextPoint); that._setBusy(true); that._hideAll(marker.newPointMarker); }); newPointMarker.on('dragend', function(event) { // console.log("dragend", event); var marker = event.target; var pointNo = that._getPointNo(event.target); that._addMarkers(pointNo, marker.getLatLng(), true); setTimeout(function() { that._setBusy(false); that._reloadPolygon(); }, 25); }); newPointMarker.on('click', function(event) { // console.log("click", event); var marker = event.target; var pointNo = that._getPointNo(event.target); that._addMarkers(pointNo, marker.getLatLng(), true); setTimeout(function() { that._reloadPolygon(); }, 25); }); // if (this._options.deletableEdges) { // newPointMarker.on('contextmenu', function(event) { // // 1. Remove this polyline from map // var marker = event.target; // var pointNo = that._getPointNo(marker); // var markers = that.getPoints(); // that._hideAll(); // var secondPartMarkers = that._markers.slice(pointNo, pointNo.length); // that._markers.splice(pointNo, that._markers.length - pointNo); // that._reloadPolygon(); // var points = []; // var contexts = []; // for(var i = 0; i < secondPartMarkers.length; i++) { // var marker = secondPartMarkers[i]; // points.push(marker.getLatLng()); // contexts.push(marker.context); // } // //console.log('points:' + points); // //console.log('contexts:' + contexts); // // Need to know the current polyline order numbers, because // // the splitted one need to be inserted immediately after: // var originalPolygonNo = that._map._editablePolygons.indexOf(that); // var newPolygon = L.Polygon.PolygonEditor(points, that._options, contexts, originalPolygonNo + 1) // .addTo(that._map); // that._showBoundMarkers(); // //console.log('Done split, _editablePolygons now:' + that._map._editablePolygons.length); // }); // } this._markers.splice(pointNo, 0, marker); if(fixNeighbourPositions) { this._fixNeighbourPositions(pointNo); } return marker; }; /** * Fix nearby new point markers when the new point is created. */ this._fixNeighbourPositions = function(pointNo) { var previousMarker = pointNo == 0 ? this._markers[this._markers.length - 1] : this._markers[pointNo - 1]; var marker = this._markers[pointNo]; var nextMarker = pointNo < this._markers.length - 1 ? this._markers[pointNo + 1] : this._markers[0]; //console.log("_fixNeighbourPositions:", pointNo, this._markers.length); //console.log("markers:", marker, previousMarker, nextMarker); if(!marker && previousMarker && nextMarker) { // //console.log("last point deleted!"); nextMarker.newPointMarker.setLatLng([(previousMarker.getLatLng().lat + nextMarker.getLatLng().lat) / 2., (previousMarker.getLatLng().lng + nextMarker.getLatLng().lng) / 2.]); } if(marker && previousMarker) { // //console.log("marker && previousMarker"); marker.newPointMarker.setLatLng([(previousMarker.getLatLng().lat + marker.getLatLng().lat) / 2., (previousMarker.getLatLng().lng + marker.getLatLng().lng) / 2.]); } if(marker && nextMarker) { // //console.log("marker && nextMarker"); nextMarker.newPointMarker.setLatLng([(marker.getLatLng().lat + nextMarker.getLatLng().lat) / 2., (marker.getLatLng().lng + nextMarker.getLatLng().lng) / 2.]); } }; /** * Find the order number of the marker. */ this._getPointNo = function(marker) { for(var i = 0; i < this._markers.length; i++) { if(marker == this._markers[i] || marker == this._markers[i].newPointMarker) { return i; } } return -1; }; /** * Get polyline latLngs based on marker positions. */ this._getMarkerLatLngs = function() { var result = []; for(var i = 0; i < this._markers.length; i++) result.push(this._markers[i].getLatLng()); return result; }; this._setupDragLines = function(marker, point1, point2) { // //console.log("_setupDragLines", marker, point1, point2); var line1 = null; var line2 = null; var markerLatlng = marker.getLatLng(); var offsetLat = 0; var offsetLng = 0; if (this._lastMouseEvent) { var mousePoint = this._map.mouseEventToLatLng(this._lastMouseEvent); offsetLat = markerLatlng.lat - mousePoint.lat; offsetLng = markerLatlng.lng - mousePoint.lng; // console.log(markerLatlng, mouseLatlng); } // console.log(markerLatlng, this._lastMouseEvent); if(point1) line1 = L.polyline([markerLatlng, point1], {dashArray: "5,5", weight: 1}) .addTo(that._map); if(point2) line2 = L.polyline([markerLatlng, point1], {dashArray: "5,5", weight: 1}) .addTo(that._map); var moveHandler = function(event) { // add the offsets from the marker // so aux lines appear in the tip of the marker var latlngPoint = L.latLng(event.latlng.lat + offsetLat, event.latlng.lng + offsetLng); if(line1) line1.setLatLngs([latlngPoint, point1]); if(line2) line2.setLatLngs([latlngPoint, point2]); }; var stopHandler = function(event) { that._map.off('mousemove', moveHandler); marker.off('dragend', stopHandler); if(line1) that._map.removeLayer(line1); if(line2) that._map.removeLayer(line2); //console.log('STOPPED'); if(event.target != that._map) { that._map.fire('click', event); } }; that._map.on('mousemove', moveHandler); marker.on('dragend', stopHandler); that._map.once('click', stopHandler); marker.once('click', stopHandler); if(line1) line1.once('click', stopHandler); if(line2) line2.once('click', stopHandler); } } }); L.Polygon.polygonEditor.addInitHook(function () { // Hack to keep reference to map: this.originalAddTo = this.addTo; this.addTo = function(map) { this.originalAddTo(map); this._map = map; this._addMethods(); /** * When addint a new point we must disable the user to mess with other * markers. One way is to check everywhere if the user is busy. The * other is to just remove other markers when the user is doing * somethinng. * * TODO: Decide the right way to do this and then leave only _busy or * _hideAll(). */ this._busy = false; this._initialized = false; this._edited = false; this._init(this._options, this._contexts); this._initialized = true; return this; }; }); /** * Construct a new editable polyline. * * latlngs ... a list of points (or two-element tuples with coordinates) * options ... polyline options * contexts ... custom contexts for every point in the polyline. Must have the * same number of elements as latlngs and this data will be * preserved when new points are added or polylines splitted. * polygonNo ... insert this polyline in a specific order (used when splitting). * * More about contexts: * This is an array of objects that will be kept as "context" for every * point. Marker will keep this value as marker.context. New markers will * have context set to null. * * Contexts must be the same size as the polyline size! * * By default, even without calling this method -- every marker will have * context with one value: marker.context.originalPointNo with the * original order number of this point. The order may change if some * markers before this one are delted or new added. */ L.Polygon.PolygonEditor = function(latlngs, options, contexts, polygonNo) { var result = new L.Polygon.polygonEditor(latlngs, options); result._options = options; result._contexts = contexts; result._desiredPolygonNo = polygonNo return result; };
apache-2.0
yonglehou/Akka.Persistence.ServiceFabric
src/ServiceFabricPersistence/ServiceFabricSnapshotStore.cs
4298
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the Apache 2 License. using System; using System.Collections.Generic; using System.Linq; using System.Threading; using System.Threading.Tasks; using ServiceFabricPersistence.Interfaces; using Microsoft.ServiceFabric; using Microsoft.ServiceFabric.Actors; namespace ServiceFabricPersistence { public class ServiceFabricSnapshotStore : Actor<ServiceFabricSnapshotStoreState>, IServiceFabricSnapshotStore { public override Task OnActivateAsync() { if (this.State == null) { this.State = new ServiceFabricSnapshotStoreState(); } ActorEventSource.Current.ActorMessage(this, "State initialized to {0}", this.State); return Task.FromResult(true); } public Task<SnapshotEntry> SelectSnapshotAsync(long maxSequenceNr, DateTime maxTimeStamp) { IEnumerable<KeyValuePair<long, SnapshotEntry>> snapshots = State.snapshotStore; ActorEventSource.Current.ActorMessage(this, "selectSnapshotAsync {0}-{1}", maxSequenceNr, maxTimeStamp); if (maxSequenceNr > 0 && maxSequenceNr < long.MaxValue) { snapshots = from e in this.State.snapshotStore where e.Key <= maxSequenceNr select e; } if(maxTimeStamp > DateTime.MinValue && maxTimeStamp < DateTime.MaxValue) { snapshots = from e in snapshots where e.Value.Timestamp == maxTimeStamp select e; } //TODO: Double-check selection criteria var snapshot = snapshots.ToList<KeyValuePair<long, SnapshotEntry>>(); var retValue = snapshot.Any() ? snapshot.Last().Value : null; return Task.FromResult(retValue); } public Task WriteSnapshotAsync(SnapshotEntry s) { ActorEventSource.Current.ActorMessage(this, "writeSnapshot {0}-{1}", s.SequenceNr, s.Timestamp); State.snapshotStore.Add(s.SequenceNr, s); return Task.FromResult(true); } public Task DeleteSnapshotAsync(long maxSequenceNr, DateTime maxTimeStamp) { IEnumerable<KeyValuePair<long, SnapshotEntry>> snapshots = State.snapshotStore; ActorEventSource.Current.ActorMessage(this, "deleteSnapshot {0}-{1}", maxSequenceNr, maxTimeStamp); ActorEventSource.Current.ActorMessage(this, "DeleteSnapshot {0}-{1}-{2}", maxSequenceNr, maxTimeStamp); if (maxSequenceNr > 0 && maxSequenceNr < long.MaxValue) { snapshots = from e in this.State.snapshotStore where e.Key <= maxSequenceNr select e; } if (maxTimeStamp > DateTime.MinValue && maxTimeStamp < DateTime.MaxValue) { snapshots = from e in snapshots where e.Value.Timestamp == maxTimeStamp select e; } foreach (var s in snapshots) State.snapshotStore.Remove(s.Key); return Task.FromResult(true); } public Task DeleteSnapshotManyAsync(long maxSequenceNr, DateTime maxTimeStamp) { ActorEventSource.Current.ActorMessage(this, "DeleteSnapshotMany {0}-{1}", maxSequenceNr, maxTimeStamp); if (maxSequenceNr > 0 && maxSequenceNr < long.MaxValue) { var snapshot = from e in this.State.snapshotStore where e.Key == maxSequenceNr select e; State.snapshotStore.Remove(snapshot.First().Key); } if (maxTimeStamp > DateTime.MinValue && maxTimeStamp < DateTime.MaxValue) { var snapshot = from e in this.State.snapshotStore where e.Value.Timestamp == maxTimeStamp select e; State.snapshotStore.Remove(snapshot.First().Key); } return Task.FromResult(true); } } }
apache-2.0
vbehar/rundeck-api-java-client
src/main/java/org/rundeck/api/domain/RundeckJobsImportResult.java
3268
/* * Copyright 2011 Vincent Behar * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.rundeck.api.domain; import java.io.Serializable; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; /** * Result of importing some jobs into RunDeck * * @author Vincent Behar */ public class RundeckJobsImportResult implements Serializable { private static final long serialVersionUID = 1L; private final List<RundeckJob> succeededJobs = new ArrayList<RundeckJob>(); private final List<RundeckJob> skippedJobs = new ArrayList<RundeckJob>(); private final Map<RundeckJob, String> failedJobs = new HashMap<RundeckJob, String>(); public void addSucceededJob(RundeckJob job) { succeededJobs.add(job); } public void addSkippedJob(RundeckJob job) { skippedJobs.add(job); } public void addFailedJob(RundeckJob job, String errorMessage) { failedJobs.put(job, errorMessage); } public List<RundeckJob> getSucceededJobs() { return succeededJobs; } public List<RundeckJob> getSkippedJobs() { return skippedJobs; } public Map<RundeckJob, String> getFailedJobs() { return failedJobs; } @Override public String toString() { return "RundeckJobsImportResult [succeededJobs=" + succeededJobs + ", skippedJobs=" + skippedJobs + ", failedJobs=" + failedJobs + "]"; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((failedJobs == null) ? 0 : failedJobs.hashCode()); result = prime * result + ((skippedJobs == null) ? 0 : skippedJobs.hashCode()); result = prime * result + ((succeededJobs == null) ? 0 : succeededJobs.hashCode()); return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; RundeckJobsImportResult other = (RundeckJobsImportResult) obj; if (failedJobs == null) { if (other.failedJobs != null) return false; } else if (!failedJobs.equals(other.failedJobs)) return false; if (skippedJobs == null) { if (other.skippedJobs != null) return false; } else if (!skippedJobs.equals(other.skippedJobs)) return false; if (succeededJobs == null) { if (other.succeededJobs != null) return false; } else if (!succeededJobs.equals(other.succeededJobs)) return false; return true; } }
apache-2.0
techdocscn/storm
source/apidocs/storm/trident/operation/builtin/class-use/FirstN.html
6169
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!--NewPage--> <HTML> <HEAD> <!-- Generated by javadoc (build 1.6.0_65) on Tue Feb 04 13:29:26 EST 2014 --> <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> <TITLE> Uses of Class storm.trident.operation.builtin.FirstN (Storm Core 0.9.1-incubating-SNAPSHOT API) </TITLE> <META NAME="date" CONTENT="2014-02-04"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Class storm.trident.operation.builtin.FirstN (Storm Core 0.9.1-incubating-SNAPSHOT API)"; } } </SCRIPT> <NOSCRIPT> </NOSCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <HR> <!-- ========= START OF TOP NAVBAR ======= --> <A NAME="navbar_top"><!-- --></A> <A HREF="#skip-navbar_top" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_top_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../storm/trident/operation/builtin/FirstN.html" title="class in storm.trident.operation.builtin"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;PREV&nbsp; &nbsp;NEXT</FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../index.html?storm/trident/operation/builtin//class-useFirstN.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="FirstN.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_top"></A> <!-- ========= END OF TOP NAVBAR ========= --> <HR> <CENTER> <H2> <B>Uses of Class<br>storm.trident.operation.builtin.FirstN</B></H2> </CENTER> No usage of storm.trident.operation.builtin.FirstN <P> <HR> <!-- ======= START OF BOTTOM NAVBAR ====== --> <A NAME="navbar_bottom"><!-- --></A> <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_bottom_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../storm/trident/operation/builtin/FirstN.html" title="class in storm.trident.operation.builtin"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;PREV&nbsp; &nbsp;NEXT</FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../index.html?storm/trident/operation/builtin//class-useFirstN.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="FirstN.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_bottom"></A> <!-- ======== END OF BOTTOM NAVBAR ======= --> <HR> Copyright &#169; 2014 <a href="http://www.apache.org/">The Apache Software Foundation</a>. All Rights Reserved. </BODY> </HTML>
apache-2.0
sipplified/forge
forge/_version.py
18448
# This file helps to compute a version number in source trees obtained from # git-archive tarball (such as those provided by githubs download-from-tag # feature). Distribution tarballs (built by setup.py sdist) and build # directories (produced by setup.py build) will contain a much shorter file # that just contains the computed version number. # This file is released into the public domain. Generated by # versioneer-0.18 (https://github.com/warner/python-versioneer) """Git implementation of _version.py.""" import errno import os import re import subprocess import sys def get_keywords(): """Get the keywords needed to look up the version information.""" # these strings will be replaced by git during git-archive. # setup.py/versioneer.py will grep for the variable names, so they must # each be defined on a line of their own. _version.py will just call # get_keywords(). git_refnames = "$Format:%d$" git_full = "$Format:%H$" git_date = "$Format:%ci$" keywords = {"refnames": git_refnames, "full": git_full, "date": git_date} return keywords class VersioneerConfig: """Container for Versioneer configuration parameters.""" def get_config(): """Create, populate and return the VersioneerConfig() object.""" # these strings are filled in when 'setup.py versioneer' creates # _version.py cfg = VersioneerConfig() cfg.VCS = "git" cfg.style = "pep440" cfg.tag_prefix = "" cfg.parentdir_prefix = "forge-" cfg.versionfile_source = "forge/_version.py" cfg.verbose = False return cfg class NotThisMethod(Exception): """Exception raised if a method is not valid for the current scenario.""" LONG_VERSION_PY = {} HANDLERS = {} def register_vcs_handler(vcs, method): # decorator """Decorator to mark a method as the handler for a particular VCS.""" def decorate(f): """Store f in HANDLERS[vcs][method].""" if vcs not in HANDLERS: HANDLERS[vcs] = {} HANDLERS[vcs][method] = f return f return decorate def run_command(commands, args, cwd=None, verbose=False, hide_stderr=False, env=None): """Call the given command(s).""" assert isinstance(commands, list) p = None for c in commands: try: dispcmd = str([c] + args) # remember shell=False, so use git.cmd on windows, not just git p = subprocess.Popen([c] + args, cwd=cwd, env=env, stdout=subprocess.PIPE, stderr=(subprocess.PIPE if hide_stderr else None)) break except EnvironmentError: e = sys.exc_info()[1] if e.errno == errno.ENOENT: continue if verbose: print("unable to run %s" % dispcmd) print(e) return None, None else: if verbose: print("unable to find command, tried %s" % (commands,)) return None, None stdout = p.communicate()[0].strip() if sys.version_info[0] >= 3: stdout = stdout.decode() if p.returncode != 0: if verbose: print("unable to run %s (error)" % dispcmd) print("stdout was %s" % stdout) return None, p.returncode return stdout, p.returncode def versions_from_parentdir(parentdir_prefix, root, verbose): """Try to determine the version from the parent directory name. Source tarballs conventionally unpack into a directory that includes both the project name and a version string. We will also support searching up two directory levels for an appropriately named parent directory """ rootdirs = [] for i in range(3): dirname = os.path.basename(root) if dirname.startswith(parentdir_prefix): return {"version": dirname[len(parentdir_prefix):], "full-revisionid": None, "dirty": False, "error": None, "date": None} else: rootdirs.append(root) root = os.path.dirname(root) # up a level if verbose: print("Tried directories %s but none started with prefix %s" % (str(rootdirs), parentdir_prefix)) raise NotThisMethod("rootdir doesn't start with parentdir_prefix") @register_vcs_handler("git", "get_keywords") def git_get_keywords(versionfile_abs): """Extract version information from the given file.""" # the code embedded in _version.py can just fetch the value of these # keywords. When used from setup.py, we don't want to import _version.py, # so we do it with a regexp instead. This function is not used from # _version.py. keywords = {} try: f = open(versionfile_abs, "r") for line in f.readlines(): if line.strip().startswith("git_refnames ="): mo = re.search(r'=\s*"(.*)"', line) if mo: keywords["refnames"] = mo.group(1) if line.strip().startswith("git_full ="): mo = re.search(r'=\s*"(.*)"', line) if mo: keywords["full"] = mo.group(1) if line.strip().startswith("git_date ="): mo = re.search(r'=\s*"(.*)"', line) if mo: keywords["date"] = mo.group(1) f.close() except EnvironmentError: pass return keywords @register_vcs_handler("git", "keywords") def git_versions_from_keywords(keywords, tag_prefix, verbose): """Get version information from git keywords.""" if not keywords: raise NotThisMethod("no keywords at all, weird") date = keywords.get("date") if date is not None: # git-2.2.0 added "%cI", which expands to an ISO-8601 -compliant # datestamp. However we prefer "%ci" (which expands to an "ISO-8601 # -like" string, which we must then edit to make compliant), because # it's been around since git-1.5.3, and it's too difficult to # discover which version we're using, or to work around using an # older one. date = date.strip().replace(" ", "T", 1).replace(" ", "", 1) refnames = keywords["refnames"].strip() if refnames.startswith("$Format"): if verbose: print("keywords are unexpanded, not using") raise NotThisMethod("unexpanded keywords, not a git-archive tarball") refs = set([r.strip() for r in refnames.strip("()").split(",")]) # starting in git-1.8.3, tags are listed as "tag: foo-1.0" instead of # just "foo-1.0". If we see a "tag: " prefix, prefer those. TAG = "tag: " tags = set([r[len(TAG):] for r in refs if r.startswith(TAG)]) if not tags: # Either we're using git < 1.8.3, or there really are no tags. We use # a heuristic: assume all version tags have a digit. The old git %d # expansion behaves like git log --decorate=short and strips out the # refs/heads/ and refs/tags/ prefixes that would let us distinguish # between branches and tags. By ignoring refnames without digits, we # filter out many common branch names like "release" and # "stabilization", as well as "HEAD" and "master". tags = set([r for r in refs if re.search(r'\d', r)]) if verbose: print("discarding '%s', no digits" % ",".join(refs - tags)) if verbose: print("likely tags: %s" % ",".join(sorted(tags))) for ref in sorted(tags): # sorting will prefer e.g. "2.0" over "2.0rc1" if ref.startswith(tag_prefix): r = ref[len(tag_prefix):] if verbose: print("picking %s" % r) return {"version": r, "full-revisionid": keywords["full"].strip(), "dirty": False, "error": None, "date": date} # no suitable tags, so version is "0+unknown", but full hex is still there if verbose: print("no suitable tags, using unknown + full revision id") return {"version": "0+unknown", "full-revisionid": keywords["full"].strip(), "dirty": False, "error": "no suitable tags", "date": None} @register_vcs_handler("git", "pieces_from_vcs") def git_pieces_from_vcs(tag_prefix, root, verbose, run_command=run_command): """Get version from 'git describe' in the root of the source tree. This only gets called if the git-archive 'subst' keywords were *not* expanded, and _version.py hasn't already been rewritten with a short version string, meaning we're inside a checked out source tree. """ GITS = ["git"] if sys.platform == "win32": GITS = ["git.cmd", "git.exe"] out, rc = run_command(GITS, ["rev-parse", "--git-dir"], cwd=root, hide_stderr=True) if rc != 0: if verbose: print("Directory %s not under git control" % root) raise NotThisMethod("'git rev-parse --git-dir' returned error") # if there is a tag matching tag_prefix, this yields TAG-NUM-gHEX[-dirty] # if there isn't one, this yields HEX[-dirty] (no NUM) describe_out, rc = run_command(GITS, ["describe", "--tags", "--dirty", "--always", "--long", "--match", "%s*" % tag_prefix], cwd=root) # --long was added in git-1.5.5 if describe_out is None: raise NotThisMethod("'git describe' failed") describe_out = describe_out.strip() full_out, rc = run_command(GITS, ["rev-parse", "HEAD"], cwd=root) if full_out is None: raise NotThisMethod("'git rev-parse' failed") full_out = full_out.strip() pieces = {} pieces["long"] = full_out pieces["short"] = full_out[:7] # maybe improved later pieces["error"] = None # parse describe_out. It will be like TAG-NUM-gHEX[-dirty] or HEX[-dirty] # TAG might have hyphens. git_describe = describe_out # look for -dirty suffix dirty = git_describe.endswith("-dirty") pieces["dirty"] = dirty if dirty: git_describe = git_describe[:git_describe.rindex("-dirty")] # now we have TAG-NUM-gHEX or HEX if "-" in git_describe: # TAG-NUM-gHEX mo = re.search(r'^(.+)-(\d+)-g([0-9a-f]+)$', git_describe) if not mo: # unparseable. Maybe git-describe is misbehaving? pieces["error"] = ("unable to parse git-describe output: '%s'" % describe_out) return pieces # tag full_tag = mo.group(1) if not full_tag.startswith(tag_prefix): if verbose: fmt = "tag '%s' doesn't start with prefix '%s'" print(fmt % (full_tag, tag_prefix)) pieces["error"] = ("tag '%s' doesn't start with prefix '%s'" % (full_tag, tag_prefix)) return pieces pieces["closest-tag"] = full_tag[len(tag_prefix):] # distance: number of commits since tag pieces["distance"] = int(mo.group(2)) # commit: short hex revision ID pieces["short"] = mo.group(3) else: # HEX: no tags pieces["closest-tag"] = None count_out, rc = run_command(GITS, ["rev-list", "HEAD", "--count"], cwd=root) pieces["distance"] = int(count_out) # total number of commits # commit date: see ISO-8601 comment in git_versions_from_keywords() date = run_command(GITS, ["show", "-s", "--format=%ci", "HEAD"], cwd=root)[0].strip() pieces["date"] = date.strip().replace(" ", "T", 1).replace(" ", "", 1) return pieces def plus_or_dot(pieces): """Return a + if we don't already have one, else return a .""" if "+" in pieces.get("closest-tag", ""): return "." return "+" def render_pep440(pieces): """Build up version string, with post-release "local version identifier". Our goal: TAG[+DISTANCE.gHEX[.dirty]] . Note that if you get a tagged build and then dirty it, you'll get TAG+0.gHEX.dirty Exceptions: 1: no tags. git_describe was just HEX. 0+untagged.DISTANCE.gHEX[.dirty] """ if pieces["closest-tag"]: rendered = pieces["closest-tag"] if pieces["distance"] or pieces["dirty"]: rendered += plus_or_dot(pieces) rendered += "%d.g%s" % (pieces["distance"], pieces["short"]) if pieces["dirty"]: rendered += ".dirty" else: # exception #1 rendered = "0+untagged.%d.g%s" % (pieces["distance"], pieces["short"]) if pieces["dirty"]: rendered += ".dirty" return rendered def render_pep440_pre(pieces): """TAG[.post.devDISTANCE] -- No -dirty. Exceptions: 1: no tags. 0.post.devDISTANCE """ if pieces["closest-tag"]: rendered = pieces["closest-tag"] if pieces["distance"]: rendered += ".post.dev%d" % pieces["distance"] else: # exception #1 rendered = "0.post.dev%d" % pieces["distance"] return rendered def render_pep440_post(pieces): """TAG[.postDISTANCE[.dev0]+gHEX] . The ".dev0" means dirty. Note that .dev0 sorts backwards (a dirty tree will appear "older" than the corresponding clean one), but you shouldn't be releasing software with -dirty anyways. Exceptions: 1: no tags. 0.postDISTANCE[.dev0] """ if pieces["closest-tag"]: rendered = pieces["closest-tag"] if pieces["distance"] or pieces["dirty"]: rendered += ".post%d" % pieces["distance"] if pieces["dirty"]: rendered += ".dev0" rendered += plus_or_dot(pieces) rendered += "g%s" % pieces["short"] else: # exception #1 rendered = "0.post%d" % pieces["distance"] if pieces["dirty"]: rendered += ".dev0" rendered += "+g%s" % pieces["short"] return rendered def render_pep440_old(pieces): """TAG[.postDISTANCE[.dev0]] . The ".dev0" means dirty. Eexceptions: 1: no tags. 0.postDISTANCE[.dev0] """ if pieces["closest-tag"]: rendered = pieces["closest-tag"] if pieces["distance"] or pieces["dirty"]: rendered += ".post%d" % pieces["distance"] if pieces["dirty"]: rendered += ".dev0" else: # exception #1 rendered = "0.post%d" % pieces["distance"] if pieces["dirty"]: rendered += ".dev0" return rendered def render_git_describe(pieces): """TAG[-DISTANCE-gHEX][-dirty]. Like 'git describe --tags --dirty --always'. Exceptions: 1: no tags. HEX[-dirty] (note: no 'g' prefix) """ if pieces["closest-tag"]: rendered = pieces["closest-tag"] if pieces["distance"]: rendered += "-%d-g%s" % (pieces["distance"], pieces["short"]) else: # exception #1 rendered = pieces["short"] if pieces["dirty"]: rendered += "-dirty" return rendered def render_git_describe_long(pieces): """TAG-DISTANCE-gHEX[-dirty]. Like 'git describe --tags --dirty --always -long'. The distance/hash is unconditional. Exceptions: 1: no tags. HEX[-dirty] (note: no 'g' prefix) """ if pieces["closest-tag"]: rendered = pieces["closest-tag"] rendered += "-%d-g%s" % (pieces["distance"], pieces["short"]) else: # exception #1 rendered = pieces["short"] if pieces["dirty"]: rendered += "-dirty" return rendered def render(pieces, style): """Render the given version pieces into the requested style.""" if pieces["error"]: return {"version": "unknown", "full-revisionid": pieces.get("long"), "dirty": None, "error": pieces["error"], "date": None} if not style or style == "default": style = "pep440" # the default if style == "pep440": rendered = render_pep440(pieces) elif style == "pep440-pre": rendered = render_pep440_pre(pieces) elif style == "pep440-post": rendered = render_pep440_post(pieces) elif style == "pep440-old": rendered = render_pep440_old(pieces) elif style == "git-describe": rendered = render_git_describe(pieces) elif style == "git-describe-long": rendered = render_git_describe_long(pieces) else: raise ValueError("unknown style '%s'" % style) return {"version": rendered, "full-revisionid": pieces["long"], "dirty": pieces["dirty"], "error": None, "date": pieces.get("date")} def get_versions(): """Get version information or return default if unable to do so.""" # I am in _version.py, which lives at ROOT/VERSIONFILE_SOURCE. If we have # __file__, we can work backwards from there to the root. Some # py2exe/bbfreeze/non-CPython implementations don't do __file__, in which # case we can only use expanded keywords. cfg = get_config() verbose = cfg.verbose try: return git_versions_from_keywords(get_keywords(), cfg.tag_prefix, verbose) except NotThisMethod: pass try: root = os.path.realpath(__file__) # versionfile_source is the relative path from the top of the source # tree (where the .git directory might live) to this file. Invert # this to find the root from __file__. for i in cfg.versionfile_source.split('/'): root = os.path.dirname(root) except NameError: return {"version": "0+unknown", "full-revisionid": None, "dirty": None, "error": "unable to find root of source tree", "date": None} try: pieces = git_pieces_from_vcs(cfg.tag_prefix, root, verbose) return render(pieces, cfg.style) except NotThisMethod: pass try: if cfg.parentdir_prefix: return versions_from_parentdir(cfg.parentdir_prefix, root, verbose) except NotThisMethod: pass return {"version": "0+unknown", "full-revisionid": None, "dirty": None, "error": "unable to compute version", "date": None}
apache-2.0
eladfein/facebook-android-sdk-3.22.0
docs/com/facebook/android/package-frame.html
2911
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (version 1.7.0_60) on Tue Dec 23 14:56:36 PST 2014 --> <title>com.facebook.android</title> <meta name="date" content="2014-12-23"> <link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style"> </head> <body> <h1 class="bar"><a href="../../../com/facebook/android/package-summary.html" target="classFrame">com.facebook.android</a></h1> <div class="indexContainer"> <h2 title="Interfaces">Interfaces</h2> <ul title="Interfaces"> <li><a href="AsyncFacebookRunner.RequestListener.html" title="interface in com.facebook.android" target="classFrame"><i>AsyncFacebookRunner.RequestListener</i></a></li> <li><a href="Facebook.DialogListener.html" title="interface in com.facebook.android" target="classFrame"><i>Facebook.DialogListener</i></a></li> <li><a href="Facebook.ServiceListener.html" title="interface in com.facebook.android" target="classFrame"><i>Facebook.ServiceListener</i></a></li> </ul> <h2 title="Classes">Classes</h2> <ul title="Classes"> <li><a href="AsyncFacebookRunner.html" title="class in com.facebook.android" target="classFrame">AsyncFacebookRunner</a></li> <li><a href="DialogError.html" title="class in com.facebook.android" target="classFrame">DialogError</a></li> <li><a href="Facebook.html" title="class in com.facebook.android" target="classFrame">Facebook</a></li> <li><a href="FbDialog.html" title="class in com.facebook.android" target="classFrame">FbDialog</a></li> <li><a href="R.html" title="class in com.facebook.android" target="classFrame">R</a></li> <li><a href="R.attr.html" title="class in com.facebook.android" target="classFrame">R.attr</a></li> <li><a href="R.color.html" title="class in com.facebook.android" target="classFrame">R.color</a></li> <li><a href="R.dimen.html" title="class in com.facebook.android" target="classFrame">R.dimen</a></li> <li><a href="R.drawable.html" title="class in com.facebook.android" target="classFrame">R.drawable</a></li> <li><a href="R.id.html" title="class in com.facebook.android" target="classFrame">R.id</a></li> <li><a href="R.layout.html" title="class in com.facebook.android" target="classFrame">R.layout</a></li> <li><a href="R.string.html" title="class in com.facebook.android" target="classFrame">R.string</a></li> <li><a href="R.style.html" title="class in com.facebook.android" target="classFrame">R.style</a></li> <li><a href="R.styleable.html" title="class in com.facebook.android" target="classFrame">R.styleable</a></li> <li><a href="Util.html" title="class in com.facebook.android" target="classFrame">Util</a></li> </ul> <h2 title="Exceptions">Exceptions</h2> <ul title="Exceptions"> <li><a href="FacebookError.html" title="class in com.facebook.android" target="classFrame">FacebookError</a></li> </ul> </div> </body> </html>
apache-2.0
Hodorable/0602
horizon/static/framework/widgets/help-panel/help-panel.js
321
(function () { 'use strict'; angular.module('horizon.framework.widgets.help-panel', []) .directive('helpPanel', ['horizon.framework.widgets.basePath', function (path) { return { templateUrl: path + 'help-panel/help-panel.html', transclude: true }; } ]); })();
apache-2.0
niknokseyer/formdev
application/views/proj_milestones_edit.php
2067
<script> $(document).ready(function () { $(function() { $( "#datepicker" ).datepicker({ changeMonth: true, changeYear: true, dateFormat: "yy-mm-dd", yearRange: "c-50,c" }); }); }); function check_input(){ var temp = $('#milestone').val(); var temp1 = $('#datepicker').val(); if(temp != '' && temp1 != '') return true; else return false; } </script> <div id="com_proj_container"> <div id="title_container" class="title_post"> <div id="title">Edit Project Milestone Details</div> </div> <br /> <div class="body_post"> <?php $str = str_replace(' ','_',$committee_info->name); $str1 = str_replace(' ','_',$project_info->project);?> <?php $attr = array('onsubmit' => 'return check_input()'); echo form_open('committees/project_milestones/'.$str.'/'.$str1.'/update/'.$proj_milestone->id, $attr);?> <table style="width:100%"> <tr> <td colspan="3"> <?php echo form_label('Milestone:', 'milestone').' '; echo form_input('milestone', $proj_milestone->milestone, 'id="milestone" style="width:540px;"'); ?> </td> </tr> <tr> <td> <?php echo form_label('Date Due:', 'date_due').' '; echo form_input('date_due', $proj_milestone->date_due, 'id="datepicker" style="width:110px;"'); ?> </td> <td> <?php echo form_label('Faci:', 'user_list').' '; echo form_dropdown('user_list',$user_list,$faci_id, 'class="user_dropdown" style="width:200px;"'); ?> </td> <td> <?php $status = array( 'Pending' => 'Pending', 'Done' => 'Done' ); echo form_label('Status:', 'status').' '; echo form_dropdown('status',$status,$proj_milestone->status, 'class="status" style="width:110px;"'); ?> </td> </tr> <tr> <td> &nbsp; </td> </tr> <tr> <td colspan='3' align="center"> <input class="readmore_button" type="submit" value="GO!" /> </td> </tr> </table> <?php echo '</form>';?> </div> </div>
apache-2.0
cedral/aws-sdk-cpp
aws-cpp-sdk-servicecatalog/include/aws/servicecatalog/model/CreateProvisionedProductPlanResult.h
7687
/* * Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file 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. */ #pragma once #include <aws/servicecatalog/ServiceCatalog_EXPORTS.h> #include <aws/core/utils/memory/stl/AWSString.h> #include <utility> namespace Aws { template<typename RESULT_TYPE> class AmazonWebServiceResult; namespace Utils { namespace Json { class JsonValue; } // namespace Json } // namespace Utils namespace ServiceCatalog { namespace Model { class AWS_SERVICECATALOG_API CreateProvisionedProductPlanResult { public: CreateProvisionedProductPlanResult(); CreateProvisionedProductPlanResult(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result); CreateProvisionedProductPlanResult& operator=(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result); /** * <p>The name of the plan.</p> */ inline const Aws::String& GetPlanName() const{ return m_planName; } /** * <p>The name of the plan.</p> */ inline void SetPlanName(const Aws::String& value) { m_planName = value; } /** * <p>The name of the plan.</p> */ inline void SetPlanName(Aws::String&& value) { m_planName = std::move(value); } /** * <p>The name of the plan.</p> */ inline void SetPlanName(const char* value) { m_planName.assign(value); } /** * <p>The name of the plan.</p> */ inline CreateProvisionedProductPlanResult& WithPlanName(const Aws::String& value) { SetPlanName(value); return *this;} /** * <p>The name of the plan.</p> */ inline CreateProvisionedProductPlanResult& WithPlanName(Aws::String&& value) { SetPlanName(std::move(value)); return *this;} /** * <p>The name of the plan.</p> */ inline CreateProvisionedProductPlanResult& WithPlanName(const char* value) { SetPlanName(value); return *this;} /** * <p>The plan identifier.</p> */ inline const Aws::String& GetPlanId() const{ return m_planId; } /** * <p>The plan identifier.</p> */ inline void SetPlanId(const Aws::String& value) { m_planId = value; } /** * <p>The plan identifier.</p> */ inline void SetPlanId(Aws::String&& value) { m_planId = std::move(value); } /** * <p>The plan identifier.</p> */ inline void SetPlanId(const char* value) { m_planId.assign(value); } /** * <p>The plan identifier.</p> */ inline CreateProvisionedProductPlanResult& WithPlanId(const Aws::String& value) { SetPlanId(value); return *this;} /** * <p>The plan identifier.</p> */ inline CreateProvisionedProductPlanResult& WithPlanId(Aws::String&& value) { SetPlanId(std::move(value)); return *this;} /** * <p>The plan identifier.</p> */ inline CreateProvisionedProductPlanResult& WithPlanId(const char* value) { SetPlanId(value); return *this;} /** * <p>The product identifier.</p> */ inline const Aws::String& GetProvisionProductId() const{ return m_provisionProductId; } /** * <p>The product identifier.</p> */ inline void SetProvisionProductId(const Aws::String& value) { m_provisionProductId = value; } /** * <p>The product identifier.</p> */ inline void SetProvisionProductId(Aws::String&& value) { m_provisionProductId = std::move(value); } /** * <p>The product identifier.</p> */ inline void SetProvisionProductId(const char* value) { m_provisionProductId.assign(value); } /** * <p>The product identifier.</p> */ inline CreateProvisionedProductPlanResult& WithProvisionProductId(const Aws::String& value) { SetProvisionProductId(value); return *this;} /** * <p>The product identifier.</p> */ inline CreateProvisionedProductPlanResult& WithProvisionProductId(Aws::String&& value) { SetProvisionProductId(std::move(value)); return *this;} /** * <p>The product identifier.</p> */ inline CreateProvisionedProductPlanResult& WithProvisionProductId(const char* value) { SetProvisionProductId(value); return *this;} /** * <p>The user-friendly name of the provisioned product.</p> */ inline const Aws::String& GetProvisionedProductName() const{ return m_provisionedProductName; } /** * <p>The user-friendly name of the provisioned product.</p> */ inline void SetProvisionedProductName(const Aws::String& value) { m_provisionedProductName = value; } /** * <p>The user-friendly name of the provisioned product.</p> */ inline void SetProvisionedProductName(Aws::String&& value) { m_provisionedProductName = std::move(value); } /** * <p>The user-friendly name of the provisioned product.</p> */ inline void SetProvisionedProductName(const char* value) { m_provisionedProductName.assign(value); } /** * <p>The user-friendly name of the provisioned product.</p> */ inline CreateProvisionedProductPlanResult& WithProvisionedProductName(const Aws::String& value) { SetProvisionedProductName(value); return *this;} /** * <p>The user-friendly name of the provisioned product.</p> */ inline CreateProvisionedProductPlanResult& WithProvisionedProductName(Aws::String&& value) { SetProvisionedProductName(std::move(value)); return *this;} /** * <p>The user-friendly name of the provisioned product.</p> */ inline CreateProvisionedProductPlanResult& WithProvisionedProductName(const char* value) { SetProvisionedProductName(value); return *this;} /** * <p>The identifier of the provisioning artifact.</p> */ inline const Aws::String& GetProvisioningArtifactId() const{ return m_provisioningArtifactId; } /** * <p>The identifier of the provisioning artifact.</p> */ inline void SetProvisioningArtifactId(const Aws::String& value) { m_provisioningArtifactId = value; } /** * <p>The identifier of the provisioning artifact.</p> */ inline void SetProvisioningArtifactId(Aws::String&& value) { m_provisioningArtifactId = std::move(value); } /** * <p>The identifier of the provisioning artifact.</p> */ inline void SetProvisioningArtifactId(const char* value) { m_provisioningArtifactId.assign(value); } /** * <p>The identifier of the provisioning artifact.</p> */ inline CreateProvisionedProductPlanResult& WithProvisioningArtifactId(const Aws::String& value) { SetProvisioningArtifactId(value); return *this;} /** * <p>The identifier of the provisioning artifact.</p> */ inline CreateProvisionedProductPlanResult& WithProvisioningArtifactId(Aws::String&& value) { SetProvisioningArtifactId(std::move(value)); return *this;} /** * <p>The identifier of the provisioning artifact.</p> */ inline CreateProvisionedProductPlanResult& WithProvisioningArtifactId(const char* value) { SetProvisioningArtifactId(value); return *this;} private: Aws::String m_planName; Aws::String m_planId; Aws::String m_provisionProductId; Aws::String m_provisionedProductName; Aws::String m_provisioningArtifactId; }; } // namespace Model } // namespace ServiceCatalog } // namespace Aws
apache-2.0
processone/google-wave-api
wave-model/src/test/java/org/waveprotocol/wave/model/document/indexed/IndexedDocumentImplTest.java
48115
// Copyright 2008 Google Inc. All Rights Reserved. package org.waveprotocol.wave.model.document.indexed; import junit.framework.TestCase; import org.waveprotocol.wave.model.document.AnnotationInterval; import org.waveprotocol.wave.model.document.DocumentTestCases; import org.waveprotocol.wave.model.document.MutableDocument; import org.waveprotocol.wave.model.document.RangedAnnotation; import org.waveprotocol.wave.model.document.operation.AnnotationBoundaryMapBuilder; import org.waveprotocol.wave.model.document.operation.Attributes; import org.waveprotocol.wave.model.document.operation.Automatons; import org.waveprotocol.wave.model.document.operation.BufferedDocOp; import org.waveprotocol.wave.model.document.operation.DocInitialization; import org.waveprotocol.wave.model.document.operation.Nindo; import org.waveprotocol.wave.model.document.operation.algorithm.DocOpInverter; import org.waveprotocol.wave.model.document.operation.automaton.DocOpAutomaton.ViolationCollector; import org.waveprotocol.wave.model.document.operation.automaton.DocumentSchema; import org.waveprotocol.wave.model.document.operation.impl.AttributesImpl; import org.waveprotocol.wave.model.document.operation.impl.DocInitializationBuilder; import org.waveprotocol.wave.model.document.operation.impl.DocOpBuilder; import org.waveprotocol.wave.model.document.operation.impl.DocOpUtil; import org.waveprotocol.wave.model.document.operation.impl.DocOpValidator; import org.waveprotocol.wave.model.document.raw.TextNodeOrganiser; import org.waveprotocol.wave.model.document.raw.impl.Element; import org.waveprotocol.wave.model.document.raw.impl.Node; import org.waveprotocol.wave.model.document.raw.impl.RawDocumentImpl; import org.waveprotocol.wave.model.document.raw.impl.Text; import org.waveprotocol.wave.model.document.util.Annotations; import org.waveprotocol.wave.model.document.util.ContextProviders; import org.waveprotocol.wave.model.document.util.ContextProviders.TestDocumentContext; import org.waveprotocol.wave.model.document.util.DocProviders; import org.waveprotocol.wave.model.document.util.LocalDocument; import org.waveprotocol.wave.model.document.util.XmlStringBuilder; import org.waveprotocol.wave.model.operation.OperationException; import org.waveprotocol.wave.model.operation.OperationRuntimeException; import org.waveprotocol.wave.model.util.CollectionUtils; import java.util.Collections; import java.util.Iterator; /** * Tests for IndexedDocumentImpl. * * */ public class IndexedDocumentImplTest extends TestCase { /** * A parser for documents. */ public static final NindoTestCases.DocumentParser< IndexedDocumentImpl<Node, Element, Text, ?>> nindoDocumentParser = new NindoTestCases.DocumentParser<IndexedDocumentImpl<Node, Element, Text, ?>>() { public IndexedDocumentImpl<Node, Element, Text, ?> parseDocument(String documentString) { return doParseDocument(documentString); } public String asString(IndexedDocumentImpl<Node, Element, Text, ?> document) { return document.toString(); } @Override public IndexedDocumentImpl<Node, Element, Text, ?> copyDocument( IndexedDocumentImpl<Node, Element, Text, ?> other) { return doCopyDocument(other); } }; /** * A parser for documents. */ public static final DocumentTestCases.DocumentParser< IndexedDocumentImpl<Node, Element, Text, ?>> documentParser = new DocumentTestCases.DocumentParser<IndexedDocumentImpl<Node, Element, Text, ?>>() { public IndexedDocumentImpl<Node, Element, Text, ?> parseDocument(String documentString) { return doParseDocument(documentString); } public String asString(IndexedDocumentImpl<Node, Element, Text, ?> document) { return document.toString(); } @Override public IndexedDocumentImpl<Node, Element, Text, ?> copyDocument( IndexedDocumentImpl<Node, Element, Text, ?> other) { return doCopyDocument(other); } }; private static IndexedDocumentImpl<Node, Element, Text, ?> doParseDocument(String documentString) { IndexedDocumentImpl<Node, Element, Text, ?> doc = new IndexedDocumentImpl<Node, Element, Text, Void>( RawDocumentImpl.PROVIDER.parse("<blah>" + documentString + "</blah>"), null, DocumentSchema.NO_SCHEMA_CONSTRAINTS); return doc; } private static IndexedDocumentImpl<Node, Element, Text, ?> doCopyDocument( IndexedDocumentImpl<Node, Element, Text, ?> other) { IndexedDocumentImpl<Node, Element, Text, ?> doc = new IndexedDocumentImpl<Node, Element, Text, Void>( RawDocumentImpl.PROVIDER.create("doc", Attributes.EMPTY_MAP), null, DocumentSchema.NO_SCHEMA_CONSTRAINTS); try { doc.consume(other.asOperation()); } catch (OperationException e) { throw new OperationRuntimeException("Copy should not fail", e); } return doc; } /** * Runs the tests for the insertion of text. */ public void testNindoTextInsertion() { NindoTestCases.runTextInsertionTests(nindoDocumentParser); } /** * Runs the tests for the deletion of text. */ public void testNindoTextDeletion() { NindoTestCases.runTextDeletionTests(nindoDocumentParser); } /** * Runs the tests for the insertion of elements. */ public void testNindoElementInsertion() { NindoTestCases.runElementInsertionTests(nindoDocumentParser); } /** * Runs the tests for the deletion of elements. */ public void testNindoElementDeletion() { NindoTestCases.runElementDeletionTests(nindoDocumentParser); } /** * Runs the tests for the setting and removal of attributes. */ public void testNindoAttributes() { NindoTestCases.runAttributeTests(nindoDocumentParser); } /** * Runs a miscellany of tests. */ public void testNindoMiscellaneous() { NindoTestCases.runMiscellaneousTests(nindoDocumentParser); } /** * Runs the tests for the insertion of text. */ public void testTextInsertion() { DocumentTestCases.runTextInsertionTests(documentParser); } /** * Runs the tests for the deletion of text. */ public void testTextDeletion() { DocumentTestCases.runTextDeletionTests(documentParser); } /** * Runs the tests for the insertion of elements. */ public void testElementInsertion() { DocumentTestCases.runElementInsertionTests(documentParser); } /** * Runs the tests for the deletion of elements. */ public void testElementDeletion() { DocumentTestCases.runElementDeletionTests(documentParser); } /** * Runs the tests for the setting and removal of attributes. */ public void testAttributes() { DocumentTestCases.runAttributeTests(documentParser); } /** * Runs a miscellany of tests. */ public void testMiscellaneous() { DocumentTestCases.runMiscellaneousTests(documentParser); } /** * Tests the asOperation method. */ public void testAsOperation() { IndexedDocumentImpl<Node, Element, Text, ?> document = documentParser.parseDocument( "<blip><p><i>ab</i>cd<b>ef</b>gh</p></blip>"); DocInitialization expected = new DocInitializationBuilder() .elementStart("blip", Attributes.EMPTY_MAP) .elementStart("p", Attributes.EMPTY_MAP) .elementStart("i", Attributes.EMPTY_MAP) .characters("ab") .elementEnd() .characters("cd") .elementStart("b", Attributes.EMPTY_MAP) .characters("ef") .elementEnd() .characters("gh") .elementEnd() .elementEnd() .build(); document.asOperation(); assertEquals( DocOpUtil.toConciseString(expected), DocOpUtil.toConciseString(document.asOperation())); } private void checkApply(IndexedDocument<Node, Element, Text> doc, Nindo op) throws OperationException { System.out.println(""); System.out.println("============================================"); DocInitialization docAsOp = doc.asOperation(); String initial = DocOpUtil.toXmlString(docAsOp); IndexedDocument<Node, Element, Text> copy = DocProviders.POJO.build(docAsOp, DocumentSchema.NO_SCHEMA_CONSTRAINTS); System.out.println(doc); BufferedDocOp docOp = doc.consumeAndReturnInvertible(op); System.out.println(op + "==========> " + docOp); ViolationCollector v = new ViolationCollector(); if (!DocOpValidator.validate(v, DocumentSchema.NO_SCHEMA_CONSTRAINTS, Automatons.fromReadable(copy), docOp).isValid()) { v.printDescriptions(System.err); fail("Invalid operation"); } copy.consume(docOp); System.out.println("=======" + doc + " --------- " + copy); assertEquals( DocOpUtil.toXmlString(doc.asOperation()), DocOpUtil.toXmlString(copy.asOperation())); BufferedDocOp inverted = DocOpInverter.invert(docOp); v = new ViolationCollector(); if (!DocOpValidator.validate(v, DocumentSchema.NO_SCHEMA_CONSTRAINTS, Automatons.fromReadable(copy), inverted).isValid()) { v.printDescriptions(System.err); fail("Invalid operation"); } copy.consume(inverted); assertEquals(initial, DocOpUtil.toXmlString(copy.asOperation())); } public void testReverseAnnotations() throws OperationException { IndexedDocument<Node, Element, Text> doc = DocProviders.POJO.parse("<a></a>"); Nindo.Builder b; b = new Nindo.Builder(); b.skip(1); b.startAnnotation("a", "1"); b.characters("x"); b.endAnnotation("a"); checkApply(doc, b.build()); // mutating into: // <a> // x{a=2} b = new Nindo.Builder(); b.skip(1); b.startAnnotation("a", "2"); b.skip(1); b.endAnnotation("a"); checkApply(doc, b.build()); // mutating into: // <a> // w{a=2} // x{a=2, b=1} // y{a=3, b=1} // z{a=3, b=2} b = new Nindo.Builder(); b.skip(1); b.startAnnotation("a", "2"); b.characters("w"); b.endAnnotation("a"); b.startAnnotation("b", "1"); b.skip(1); b.startAnnotation("a", "3"); b.characters("y"); b.startAnnotation("b", "2"); b.characters("z"); b.endAnnotation("a"); b.endAnnotation("b"); checkApply(doc, b.build()); // mutating into: // <a> // y{a=4, b=1} b = new Nindo.Builder(); b.skip(1); b.deleteCharacters(2); b.startAnnotation("a", "4"); b.skip(1); b.deleteCharacters(1); b.endAnnotation("a"); checkApply(doc, b.build()); } public void testAnnotationThroughInsertionEndingInDeletion() throws OperationException { IndexedDocument<Node, Element, Text> doc = DocProviders.POJO.parse("abcdefg"); Nindo.Builder b; b = new Nindo.Builder(); b.skip(1); b.startAnnotation("a", "2"); b.skip(1); b.endAnnotation("a"); checkApply(doc, b.build()); b = new Nindo.Builder(); b.skip(1); b.startAnnotation("a", "1"); b.characters("x"); b.deleteCharacters(1); b.endAnnotation("a"); checkApply(doc, b.build()); } public void testAnnotationThroughInsertionFollowedByDeletion() throws OperationException { IndexedDocument<Node, Element, Text> doc = DocProviders.POJO.parse("abcdefg"); Nindo.Builder b; b = new Nindo.Builder(); b.skip(1); b.startAnnotation("a", "2"); b.skip(1); b.endAnnotation("a"); checkApply(doc, b.build()); b = new Nindo.Builder(); b.skip(1); b.startAnnotation("a", "1"); b.characters("x"); b.endAnnotation("a"); b.deleteCharacters(1); checkApply(doc, b.build()); } public void testInsertionThenDeletionWithAnnotations() throws OperationException { IndexedDocument<Node, Element, Text> doc = DocProviders.POJO.parse("abcdefg"); Nindo.Builder b; b = new Nindo.Builder(); b.skip(1); b.startAnnotation("a", "2"); b.skip(2); b.endAnnotation("a"); checkApply(doc, b.build()); b = new Nindo.Builder(); b.skip(1); b.startAnnotation("a", null); b.characters("x"); b.deleteCharacters(1); b.skip(1); b.endAnnotation("a"); checkApply(doc, b.build()); } public void testReAnnotate() throws OperationException { IndexedDocument<Node, Element, Text> doc = DocProviders.POJO.parse("abcdefg"); Nindo.Builder b; b = new Nindo.Builder(); b.skip(1); b.startAnnotation("a", "2"); b.skip(1); b.startAnnotation("a", "3"); b.skip(1); b.endAnnotation("a"); checkApply(doc, b.build()); b = new Nindo.Builder(); b.skip(1); b.startAnnotation("a", "3"); b.skip(2); b.endAnnotation("a"); checkApply(doc, b.build()); } public void testEndBeforeAndStartAfterDeletion() throws OperationException { IndexedDocument<Node, Element, Text> doc = DocProviders.POJO.parse("abcdefg"); Nindo.Builder b; b = new Nindo.Builder(); b.skip(1); b.startAnnotation("a", null); b.skip(1); b.endAnnotation("a"); b.deleteCharacters(1); b.startAnnotation("a", "1"); b.skip(1); b.endAnnotation("a"); checkApply(doc, b.build()); } public void testEndBeforeAndStartAfterDeletionThenInsertion() throws OperationException { IndexedDocument<Node, Element, Text> doc = DocProviders.POJO.parse("abcdefg"); Nindo.Builder b; b = new Nindo.Builder(); b.skip(1); b.startAnnotation("a", null); b.skip(1); b.endAnnotation("a"); b.deleteCharacters(1); b.startAnnotation("a", "1"); b.characters("x"); b.endAnnotation("a"); checkApply(doc, b.build()); } public void testChangeBetweenInsertionAndDeletion() throws OperationException { IndexedDocument<Node, Element, Text> doc = DocProviders.POJO.parse("abcdefg"); Nindo.Builder b; b = new Nindo.Builder(); b.skip(1); b.startAnnotation("a", "1"); b.characters("x"); b.startAnnotation("a", "2"); b.deleteCharacters(1); b.skip(1); b.endAnnotation("a"); checkApply(doc, b.build()); } public void testOpenClose() throws OperationException { IndexedDocument<Node, Element, Text> doc = DocProviders.POJO.parse("abcdefg"); Nindo.Builder b; b = new Nindo.Builder(); b.skip(1); b.startAnnotation("a", "1"); b.startAnnotation("b", "2"); b.startAnnotation("c", "3"); b.endAnnotation("a"); b.endAnnotation("c"); b.endAnnotation("b"); checkApply(doc, b.build()); } public void testOpenInsertOpenClose() throws OperationException { IndexedDocument<Node, Element, Text> doc = DocProviders.POJO.parse("abcdefg"); Nindo.Builder b; b = new Nindo.Builder(); b.skip(1); b.startAnnotation("a", "1"); b.characters("xyz"); b.startAnnotation("a", "1"); b.endAnnotation("a"); checkApply(doc, b.build()); } public void testOpenDuringInsertionThenUpdate() throws OperationException { IndexedDocument<Node, Element, Text> doc = DocProviders.POJO.parse("<q><r/></q>abcdefghijkl"); Nindo.Builder b; b = new Nindo.Builder(); b.startAnnotation("a", "1"); b.skip(7); b.endAnnotation("a"); checkApply(doc, b.build()); b = new Nindo.Builder(); b.elementStart("p", Attributes.EMPTY_MAP); b.startAnnotation("a", null); b.elementEnd(); b.updateAttributes(Collections.singletonMap("u", "v")); b.replaceAttributes(new AttributesImpl("v", "u")); b.skip(1); b.endAnnotation("a"); checkApply(doc, b.build()); } public void testOpenDuringInsertionThenUpdate2() throws OperationException { IndexedDocument<Node, Element, Text> doc = DocProviders.POJO.parse("abcdef<q><r/></q>ghijkl"); Nindo.Builder b; b = new Nindo.Builder(); b.skip(8); b.startAnnotation("a", "1"); b.skip(5); b.endAnnotation("a"); checkApply(doc, b.build()); b = new Nindo.Builder(); b.startAnnotation("a", "1"); b.skip(7); b.updateAttributes(Collections.singletonMap("u", "v")); //b.replaceAttributes(new AttributesImpl("v", "u")); b.skip(3); b.endAnnotation("a"); checkApply(doc, b.build()); } public void testDeletionResets() throws OperationException { IndexedDocument<Node, Element, Text> doc = DocProviders.POJO.parse("abcdefghijkl"); Nindo.Builder b; b = new Nindo.Builder(); b.startAnnotation("a", "1"); b.skip(3); b.deleteCharacters(3); b.skip(3); b.endAnnotation("a"); checkApply(doc, b.build()); } public void testRedundantAnnotationsPreserved() throws OperationException { IndexedDocument<Node, Element, Text> doc = DocProviders.POJO.parse("abcdefg"); IndexedDocument<Node, Element, Text> doc2 = DocProviders.POJO.parse("abcdefg"); Nindo.Builder b; b = new Nindo.Builder(); b.startAnnotation("a", "1"); b.skip(7); b.endAnnotation("a"); checkApply(doc2, b.build()); b = new Nindo.Builder(); b.startAnnotation("a", null); b.skip(2); b.startAnnotation("a", "2"); b.skip(2); b.startAnnotation("a", null); b.skip(3); b.endAnnotation("a"); BufferedDocOp docOp = doc.consumeAndReturnInvertible(b.build()); doc2.consumeAndReturnInvertible(Nindo.fromDocOp(docOp, true)); assertEquals( DocOpUtil.toXmlString(doc.asOperation()), DocOpUtil.toXmlString(doc2.asOperation())); } public void testNoRedundantSkips() throws OperationException { IndexedDocument<Node, Element, Text> doc = DocProviders.POJO.parse("abcdefghijkl"); Nindo.Builder b; b = new Nindo.Builder(); b.skip(1); b.startAnnotation("a", "1"); b.skip(1); b.startAnnotation("b", "1"); b.skip(1); b.endAnnotation("a"); b.skip(1); b.startAnnotation("c", "1"); b.skip(1); b.endAnnotation("c"); b.skip(1); b.endAnnotation("b"); b.skip(1); b.startAnnotation("c", "1"); b.skip(1); b.endAnnotation("c"); checkApply(doc, b.build()); b = new Nindo.Builder(); b.startAnnotation("z", "1"); b.skip(doc.size()); b.endAnnotation("z"); BufferedDocOp docOp = doc.consumeAndReturnInvertible(b.build()); assertEquals(3, docOp.size()); } public void testBug1() throws OperationException { IndexedDocumentImpl<Node, Element, Text, ?> d = nindoDocumentParser.parseDocument( "<a>a</a>"); Nindo.Builder b = new Nindo.Builder(); b.skip(1); b.deleteCharacters(1); checkApply(d, b.build()); } // // public void testReverseBug1() throws OperationException { // IndexedDocumentImpl<Node, Element, Text, ?> d = // new IndexedDocumentImpl<Node, Element, Text, Void>(RawDocumentImpl.BUILDER, // new AnnotationTree<Object>("a", "b", null)); // d.begin(); // d.elementStart("a", Attributes.EMPTY_MAP); // d.startAnnotation("b", "3"); // d.characters("abc"); // d.endAnnotation("b"); // d.elementEnd(); // d.finish(); // // OperationContainer reverseSink = new OperationContainer(); // d.registerReverseSink(reverseSink); // String beforeXml = OperationXmlifier.xmlify(d); // // d.begin(); // d.skip(2); // d.startAnnotation("a", "2"); // d.characters("abcd"); // d.deleteCharacters(1); // d.endAnnotation("a"); // d.finish(); // // String afterXml = OperationXmlifier.xmlify(d); // DocumentMutation reverse = reverseSink.operation; // reverse.apply(d); // String reversedXml = OperationXmlifier.xmlify(d); // // assertEquals(beforeXml, reversedXml); // // DocumentOperationChecker.Recorder r = new DocumentOperationChecker.Recorder(); // r.begin(); // r.skip(2); // r.deleteCharacters(4); // r.startAnnotation("a", null); // r.startAnnotation("b", "3"); // r.characters("b"); // r.endAnnotation("a"); // r.endAnnotation("b"); // r.finish(); // DocumentOperationChecker checker = r.finishRecording(); // reverse.apply(checker); // } // // public void testReverseBug2() throws OperationException { // IndexedDocumentImpl<Node, Element, Text, ?> d = // new IndexedDocumentImpl<Node, Element, Text, Void>(RawDocumentImpl.BUILDER, // new AnnotationTree<Object>("a", "b", null)); // d.begin(); // d.elementStart("a", Attributes.EMPTY_MAP); // d.characters("ababa"); // d.startAnnotation("e", "2"); // d.characters("d"); // d.startAnnotation("a", "1"); // d.characters("abcd"); // d.endAnnotation("a"); // d.characters("babc"); // d.endAnnotation("e"); // d.characters("de"); // d.elementEnd(); // d.finish(); // // OperationContainer reverseSink = new OperationContainer(); // d.registerReverseSink(reverseSink); // // d.begin(); // d.skip(1); // d.skip(14); // d.deleteCharacters(1); // d.startAnnotation("d", "2"); // d.startAnnotation("b", null); // d.endAnnotation("d"); // d.endAnnotation("b"); // d.finish(); // // DocumentOperationChecker.Recorder r = new DocumentOperationChecker.Recorder(); // r.begin(); // r.skip(15); // r.startAnnotation("a", null); // r.startAnnotation("e", null); // r.characters("d"); // r.endAnnotation("a"); // r.endAnnotation("e"); // r.finish(); // DocumentOperationChecker checker = r.finishRecording(); // reverseSink.operation.apply(checker); // } // // public void testReverseBug3() throws OperationException { // IndexedDocumentImpl<Node, Element, Text, ?> d = // new IndexedDocumentImpl<Node, Element, Text, Void>(RawDocumentImpl.BUILDER, // new AnnotationTree<Object>("a", "b", null)); // d.begin(); // d.elementStart("a", Attributes.EMPTY_MAP); // d.characters("babcdefabcdabfabcdefabcdefghabcdefgh"); // d.startAnnotation("d", "3"); // d.characters("gab"); // d.startAnnotation("e", "1"); // d.characters("gababcabcefghidefghefaababcdefghiabcdefgh"); // d.endAnnotation("d"); // d.characters("defghi"); // d.startAnnotation("a", "1"); // d.characters("abcd"); // d.endAnnotation("e"); // d.characters("efg"); // d.endAnnotation("a"); // d.characters("cdefe"); // d.startAnnotation("b", "3"); // d.characters("f"); // d.endAnnotation("b"); // d.elementEnd(); // d.finish(); // // OperationContainer reverseSink = new OperationContainer(); // d.registerReverseSink(reverseSink); // // String beforeXml = OperationXmlifier.xmlify(d); // // d.begin(); // d.skip(1); // d.skip(15); // d.startAnnotation("e", "1"); // d.skip(3); // d.characters("abcd"); // d.skip(2); // d.characters("abcdefgh"); // d.deleteCharacters(1); // d.startAnnotation("a", "2"); // d.skip(24); // d.startAnnotation("e", "3"); // d.skip(4); // d.characters("abcd"); // d.startAnnotation("a", "1"); // d.deleteCharacters(1); // d.skip(3); // d.characters("abcdefghi"); // d.deleteCharacters(1); // d.skip(13); // d.startAnnotation("b", "1"); // d.endAnnotation("e"); // d.endAnnotation("b"); // d.endAnnotation("a"); // d.finish(); // // String afterXml = OperationXmlifier.xmlify(d); // DocumentMutation reverse = reverseSink.operation; // reverse.apply(d); // String reversedXml = OperationXmlifier.xmlify(d); // // assertEquals(beforeXml, reversedXml); // // DocumentOperationChecker.Recorder r = new DocumentOperationChecker.Recorder(); // r.begin(); // r.skip(16); // r.startAnnotation("e", null); // r.skip(3); // r.deleteCharacters(4); // r.skip(2); // r.deleteCharacters(8); // r.startAnnotation("a", null); // r.startAnnotation("b", null); // r.startAnnotation("d", null); // r.characters("a"); // r.endAnnotation("b"); // r.endAnnotation("d"); // r.skip(18); // r.endAnnotation("e"); // r.skip(6); // r.startAnnotation("e", "1"); // r.skip(4); // r.deleteCharacters(4); // r.startAnnotation("b", null); // r.startAnnotation("d", "3"); // r.characters("f"); // r.endAnnotation("b"); // r.endAnnotation("d"); // r.skip(3); // r.deleteCharacters(9); // r.startAnnotation("b", null); // r.startAnnotation("d", "3"); // r.characters("d"); // r.endAnnotation("b"); // r.endAnnotation("d"); // r.skip(13); // r.endAnnotation("a"); // r.endAnnotation("e"); // r.finish(); // DocumentOperationChecker checker = r.finishRecording(); // reverse.apply(checker); // // assertEquals(beforeXml, reversedXml); // } // // public void testReverseBug4() throws OperationException { // IndexedDocumentImpl<Node, Element, Text, ?> d = // new IndexedDocumentImpl<Node, Element, Text, Void>(RawDocumentImpl.BUILDER, // new AnnotationTree<Object>("a", "b", null)); // d.begin(); // d.elementStart("a", Attributes.EMPTY_MAP); // d.characters("a"); // d.startAnnotation("d", "2"); // d.characters("bc"); // d.endAnnotation("d"); // d.elementEnd(); // d.finish(); // // OperationContainer reverseSink = new OperationContainer(); // d.registerReverseSink(reverseSink); // // String beforeXml = OperationXmlifier.xmlify(d); // // d.begin(); // d.skip(1); // d.startAnnotation("e", "3"); // d.skip(1); // d.endAnnotation("e"); // d.characters("x"); // d.deleteCharacters(1); // d.finish(); // // String afterXml = OperationXmlifier.xmlify(d); // DocumentMutation reverse = reverseSink.operation; // reverse.apply(d); // String reversedXml = OperationXmlifier.xmlify(d); // // DocumentOperationChecker.Recorder r = new DocumentOperationChecker.Recorder(); // r.begin(); // r.skip(1); // r.startAnnotation("e", null); // r.skip(1); // r.deleteCharacters(1); // r.startAnnotation("d", "2"); // r.characters("b"); // r.endAnnotation("d"); // r.endAnnotation("e"); // r.finish(); // DocumentOperationChecker checker = r.finishRecording(); // reverse.apply(checker); // // assertEquals(beforeXml, reversedXml); // } // // public void testReverseBug5() throws OperationException { // IndexedDocumentImpl<Node, Element, Text, ?> d = // new IndexedDocumentImpl<Node, Element, Text, Void>(RawDocumentImpl.BUILDER, // new AnnotationTree<Object>("a", "b", null)); // d.begin(); // d.elementStart("a", Attributes.EMPTY_MAP); // d.startAnnotation("e", "1"); // d.characters("aab"); // d.endAnnotation("e"); // d.characters("c"); // d.elementEnd(); // d.finish(); // // OperationContainer reverseSink = new OperationContainer(); // d.registerReverseSink(reverseSink); // // String beforeXml = OperationXmlifier.xmlify(d); // // d.begin(); // d.skip(1); // d.skip(1); // d.startAnnotation("e", "2"); // d.characters("a"); // d.deleteCharacters(1); // d.skip(1); // d.deleteCharacters(1); // d.endAnnotation("e"); // d.finish(); // // String afterXml = OperationXmlifier.xmlify(d); // DocumentMutation reverse = reverseSink.operation; // reverse.apply(d); // String reversedXml = OperationXmlifier.xmlify(d); // // assertEquals(beforeXml, reversedXml); // // DocumentOperationChecker.Recorder r = new DocumentOperationChecker.Recorder(); // r.begin(); // r.skip(2); // r.deleteCharacters(1); // r.startAnnotation("e", "1"); // r.characters("a"); // r.skip(1); // r.startAnnotation("e", null); // r.characters("c"); // r.endAnnotation("e"); // r.finish(); // DocumentOperationChecker checker = r.finishRecording(); // reverse.apply(checker); // } // // public void testReverseBug6() throws OperationException { // IndexedDocumentImpl<Node, Element, Text, ?> d = // new IndexedDocumentImpl<Node, Element, Text, Void>(RawDocumentImpl.BUILDER, // new AnnotationTree<Object>("a", "b", null)); // d.begin(); // d.elementStart("a", Attributes.EMPTY_MAP); // d.startAnnotation("d", "2"); // d.characters("a"); // d.startAnnotation("e", "1"); // d.characters("b"); // d.endAnnotation("d"); // d.endAnnotation("e"); // d.characters("b"); // d.elementEnd(); // d.finish(); // OperationContainer reverseSink = new OperationContainer(); // d.registerReverseSink(reverseSink); // // String beforeXml = OperationXmlifier.xmlify(d); // // d.begin(); // d.skip(1); // d.startAnnotation("e", null); // d.skip(2); // d.endAnnotation("e"); // d.deleteCharacters(1); // d.finish(); // // String afterXml = OperationXmlifier.xmlify(d); // DocumentMutation reverse = reverseSink.operation; // reverse.apply(d); // String reversedXml = OperationXmlifier.xmlify(d); // // assertEquals(beforeXml, reversedXml); // // DocumentOperationChecker.Recorder r = new DocumentOperationChecker.Recorder(); // r.begin(); // r.skip(2); // r.startAnnotation("e", "1"); // r.skip(1); // r.startAnnotation("d", null); // r.startAnnotation("e", null); // r.characters("b"); // r.endAnnotation("d"); // r.endAnnotation("e"); // r.finish(); // DocumentOperationChecker checker = r.finishRecording(); // reverse.apply(checker); // } // // public void testConcurrentModificationException() throws OperationException { // // The test is that this doesn't throw a ConcurrentModificationException. // IndexedDocumentImpl<Node, Element, Text, ?> d = // new IndexedDocumentImpl<Node, Element, Text, Void>(RawDocumentImpl.PROVIDER, // new AnnotationTree<Object>("a", "b", null)); // // initial // d.begin(); // d.elementStart("blip", Attributes.EMPTY_MAP); // { // Map<String, String> a = new HashMap<String, String>(); // a.put("_t", "title"); // a.put("t", "h1"); // d.elementStart("p", new Attributes(a)); // } // d.elementEnd(); // d.elementEnd(); // d.finish(); // // mutation // d.begin(); // d.skip(1); // d.setAttributes(new Attributes("_t", "title")); // d.finish(); // } // // public void testNPE1() throws OperationException { // // The test is that this doesn't throw a NullPointerException. // IndexedDocumentImpl<Node, Element, Text, ?> d = // new IndexedDocumentImpl<Node, Element, Text, Void>( // RawDocumentImpl.PROVIDER, // new AnnotationTree<Object>("a", "b", null)); // // // initialization steps // d.begin(); // d.elementStart("blip", Attributes.EMPTY_MAP); // d.elementStart("p", new Attributes("_t", "title")); // // d.elementEnd(); // d.elementStart("p", Attributes.EMPTY_MAP); // d.characters("a"); // d.elementEnd(); // d.elementStart("p", Attributes.EMPTY_MAP); // // d.elementEnd(); // d.elementStart("p", new Attributes("_t", "title")); // d.elementEnd(); // d.elementStart("p", Attributes.EMPTY_MAP); // d.elementEnd(); // d.elementEnd(); // d.finish(); // // d.begin(); // d.skip(2); // d.deleteAntiElementStart(); // d.deleteElementStart(); // d.deleteCharacters(1); // d.deleteElementEnd(); // d.deleteAntiElementEnd(new Attributes("t", "")); // d.finish(); // // d.begin(); // d.skip(1); // d.deleteElementStart(); // d.deleteElementEnd(); // d.finish(); // // d.begin(); // d.skip(5); // d.elementStart("p", Attributes.EMPTY_MAP); // d.elementEnd(); // d.finish(); // // // mutation that crashes // // current state: <blip><p _t=title></p><p></p><p></p></blip> // d.begin(); // d.skip(4); // d.deleteAntiElementStart(); // d.deleteAntiElementEnd(Attributes.EMPTY_MAP); // d.antiElementStart(); // d.antiElementEnd(Attributes.EMPTY_MAP); // d.finish(); // } public void testAnnotationIntervalIterator() throws OperationException { IndexedDocumentImpl<Node, Element, Text, ?> doc = new IndexedDocumentImpl<Node, Element, Text, Void>( RawDocumentImpl.PROVIDER.parse("<doc><x><p>abcdefgh</p></x></doc>"), new AnnotationTree<Object>("a", "b", null), DocumentSchema.NO_SCHEMA_CONSTRAINTS); // 1-3: a=1, c=1 // 3-5: a=1, b=1, c=1 // 5-6: a=2, b=1, c=1 // 6-8: b=1, c=1 doc.consumeAndReturnInvertible(Nindo.setAnnotation(1, 5, "a", "1")); doc.consumeAndReturnInvertible(Nindo.setAnnotation(5, 6, "a", "2")); doc.consumeAndReturnInvertible(Nindo.setAnnotation(3, 8, "b", "1")); doc.consumeAndReturnInvertible(Nindo.setAnnotation(1, 8, "c", "1")); { Iterator<AnnotationInterval<String>> iterator = doc.annotationIntervals(2, 10, CollectionUtils.newStringSet("a")).iterator(); { AnnotationInterval<String> i = iterator.next(); assertEquals(2, i.start()); assertEquals(5, i.end()); assertEquals(1, CollectionUtils.newJavaMap(i.annotations()).size()); assertEquals("1", i.annotations().get("a", "x")); assertEquals(0, CollectionUtils.newJavaMap(i.diffFromLeft()).size()); assertEquals("x", i.diffFromLeft().get("a", "x")); } { AnnotationInterval<String> i = iterator.next(); assertEquals(5, i.start()); assertEquals(6, i.end()); assertEquals(1, CollectionUtils.newJavaMap(i.annotations()).size()); assertEquals("2", i.annotations().get("a", "x")); assertEquals(1, CollectionUtils.newJavaMap(i.diffFromLeft()).size()); assertEquals("2", i.diffFromLeft().get("a", "x")); } { AnnotationInterval<String> i = iterator.next(); assertEquals(6, i.start()); assertEquals(10, i.end()); assertEquals(1, CollectionUtils.newJavaMap(i.annotations()).size()); assertEquals(null, i.annotations().get("a", "x")); assertEquals(1, CollectionUtils.newJavaMap(i.diffFromLeft()).size()); assertEquals(null, i.diffFromLeft().get("a", "x")); } assertFalse(iterator.hasNext()); } // 1-3: a=1, c=1 // 3-5: a=1, b=1, c=1 // 5-6: a=2, b=1, c=1 // 6-8: b=1, c=1 { Iterator<AnnotationInterval<String>> iterator = doc.annotationIntervals(2, 10, null).iterator(); { AnnotationInterval<String> i = iterator.next(); assertEquals(2, i.start()); assertEquals(3, i.end()); assertEquals(3, CollectionUtils.newJavaMap(i.annotations()).size()); assertEquals("1", i.annotations().get("a", "x")); assertEquals(null, i.annotations().get("b", "x")); assertEquals("1", i.annotations().get("c", "x")); assertEquals(0, CollectionUtils.newJavaMap(i.diffFromLeft()).size()); assertEquals("x", i.diffFromLeft().get("a", "x")); assertEquals("x", i.diffFromLeft().get("b", "x")); assertEquals("x", i.diffFromLeft().get("c", "x")); } { AnnotationInterval<String> i = iterator.next(); assertEquals(3, i.start()); assertEquals(5, i.end()); assertEquals(3, CollectionUtils.newJavaMap(i.annotations()).size()); assertEquals("1", i.annotations().get("a", "x")); assertEquals("1", i.annotations().get("b", "x")); assertEquals("1", i.annotations().get("c", "x")); assertEquals(1, CollectionUtils.newJavaMap(i.diffFromLeft()).size()); assertEquals("x", i.diffFromLeft().get("a", "x")); assertEquals("1", i.diffFromLeft().get("b", "x")); assertEquals("x", i.diffFromLeft().get("c", "x")); } { AnnotationInterval<String> i = iterator.next(); assertEquals(5, i.start()); assertEquals(6, i.end()); assertEquals(3, CollectionUtils.newJavaMap(i.annotations()).size()); assertEquals("2", i.annotations().get("a", "x")); assertEquals("1", i.annotations().get("b", "x")); assertEquals("1", i.annotations().get("c", "x")); assertEquals(1, CollectionUtils.newJavaMap(i.diffFromLeft()).size()); assertEquals("2", i.diffFromLeft().get("a", "x")); } { AnnotationInterval<String> i = iterator.next(); assertEquals(6, i.start()); assertEquals(8, i.end()); assertEquals(3, CollectionUtils.newJavaMap(i.annotations()).size()); assertEquals(null, i.annotations().get("a", "x")); assertEquals("1", i.annotations().get("b", "x")); assertEquals("1", i.annotations().get("c", "x")); assertEquals(1, CollectionUtils.newJavaMap(i.diffFromLeft()).size()); assertEquals(null, i.diffFromLeft().get("a", "x")); assertEquals("x", i.diffFromLeft().get("b", "x")); assertEquals("x", i.diffFromLeft().get("c", "x")); } { AnnotationInterval<String> i = iterator.next(); assertEquals(8, i.start()); assertEquals(10, i.end()); assertEquals(3, CollectionUtils.newJavaMap(i.annotations()).size()); assertEquals(null, i.annotations().get("a", "x")); assertEquals(null, i.annotations().get("b", "x")); assertEquals(null, i.annotations().get("c", "x")); assertEquals(2, CollectionUtils.newJavaMap(i.diffFromLeft()).size()); assertEquals("x", i.diffFromLeft().get("a", "x")); assertEquals(null, i.diffFromLeft().get("b", "x")); assertEquals(null, i.diffFromLeft().get("c", "x")); } assertFalse(iterator.hasNext()); } // 1-3: a=1, c=1 // 3-5: a=1, b=1, c=1 // 5-6: a=2, b=1, c=1 // 6-8: b=1, c=1 { Iterator<AnnotationInterval<String>> iterator = doc.annotationIntervals(3, 4, null).iterator(); { AnnotationInterval<String> i = iterator.next(); assertEquals(3, i.start()); assertEquals(4, i.end()); assertEquals(3, CollectionUtils.newJavaMap(i.annotations()).size()); assertEquals("1", i.annotations().get("a", "x")); assertEquals("1", i.annotations().get("b", "x")); assertEquals("1", i.annotations().get("c", "x")); assertEquals(1, CollectionUtils.newJavaMap(i.diffFromLeft()).size()); assertEquals("x", i.diffFromLeft().get("a", "x")); assertEquals("1", i.diffFromLeft().get("b", "x")); assertEquals("x", i.diffFromLeft().get("c", "x")); } assertFalse(iterator.hasNext()); } { Iterator<AnnotationInterval<String>> iterator = doc.annotationIntervals(3, 3, null).iterator(); assertFalse(iterator.hasNext()); } } public void testRangedAnnotationIterator() throws OperationException { IndexedDocumentImpl<Node, Element, Text, ?> doc = new IndexedDocumentImpl<Node, Element, Text, Void>( RawDocumentImpl.PROVIDER.parse("<doc><x><p>abcdefgh</p></x></doc>"), new AnnotationTree<Object>("a", "b", null), DocumentSchema.NO_SCHEMA_CONSTRAINTS); // 1-3: a=1, c=1 // 3-5: a=1, b=1, c=1 // 5-6: a=2, b=1, c=1 // 6-8: b=1, c=1 doc.consumeAndReturnInvertible(Nindo.setAnnotation(1, 5, "a", "1")); doc.consumeAndReturnInvertible(Nindo.setAnnotation(5, 6, "a", "2")); doc.consumeAndReturnInvertible(Nindo.setAnnotation(3, 8, "b", "1")); doc.consumeAndReturnInvertible(Nindo.setAnnotation(1, 8, "c", "1")); { Iterator<RangedAnnotation<String>> iterator = doc.rangedAnnotations(2, 10, CollectionUtils.newStringSet("a")).iterator(); { RangedAnnotation<String> r = iterator.next(); assertEquals("a", r.key()); assertEquals("1", r.value()); assertEquals(1, r.start()); assertEquals(5, r.end()); } { RangedAnnotation<String> r = iterator.next(); assertEquals("a", r.key()); assertEquals("2", r.value()); assertEquals(5, r.start()); assertEquals(6, r.end()); } { RangedAnnotation<String> r = iterator.next(); assertEquals("a", r.key()); assertEquals(null, r.value()); assertEquals(6, r.start()); assertEquals(12, r.end()); } assertFalse(iterator.hasNext()); } { Iterator<RangedAnnotation<String>> iterator = doc.rangedAnnotations(2, 10, null).iterator(); { RangedAnnotation<String> r = iterator.next(); assertEquals("b", r.key()); assertEquals(null, r.value()); assertEquals(0, r.start()); assertEquals(3, r.end()); } { RangedAnnotation<String> r = iterator.next(); RangedAnnotation<String> r2 = iterator.next(); // Order of these two ranges is unspecified; normalize it. if ("c".equals(r.key())) { RangedAnnotation<String> tmp = r2; r2 = r; r = tmp; } assertEquals("a", r.key()); assertEquals("1", r.value()); assertEquals(1, r.start()); assertEquals(5, r.end()); assertEquals("c", r2.key()); assertEquals("1", r2.value()); assertEquals(1, r2.start()); assertEquals(8, r2.end()); } { RangedAnnotation<String> r = iterator.next(); assertEquals("b", r.key()); assertEquals("1", r.value()); assertEquals(3, r.start()); assertEquals(8, r.end()); } { RangedAnnotation<String> r = iterator.next(); assertEquals("a", r.key()); assertEquals("2", r.value()); assertEquals(5, r.start()); assertEquals(6, r.end()); } { RangedAnnotation<String> r = iterator.next(); assertEquals("a", r.key()); assertEquals(null, r.value()); assertEquals(6, r.start()); assertEquals(12, r.end()); } { RangedAnnotation<String> r = iterator.next(); RangedAnnotation<String> r2 = iterator.next(); // Order of these two ranges is unspecified; normalize it. if ("c".equals(r.key())) { RangedAnnotation<String> tmp = r2; r2 = r; r = tmp; } assertEquals("b", r.key()); assertEquals(null, r.value()); assertEquals(8, r.start()); assertEquals(12, r.end()); assertEquals("c", r2.key()); assertEquals(null, r2.value()); assertEquals(8, r2.start()); assertEquals(12, r2.end()); } assertFalse(iterator.hasNext()); } { Iterator<AnnotationInterval<String>> iterator = doc.annotationIntervals(3, 3, null).iterator(); assertFalse(iterator.hasNext()); } } public void testRangedAnnotationIteratorWithNonStrings() throws OperationException { AnnotationTree<Object> annotations = new AnnotationTree<Object>( "a", "b", null); IndexedDocumentImpl<Node, Element, Text, ?> doc = new IndexedDocumentImpl<Node, Element, Text, Void>( RawDocumentImpl.PROVIDER.parse("<doc><x><p>abcdefgh</p></x></doc>"), annotations, DocumentSchema.NO_SCHEMA_CONSTRAINTS); // 1-3: a=1, @c=Object // 3-5: a=1 doc.consumeAndReturnInvertible(Nindo.setAnnotation(1, 5, "a", "1")); annotations.begin(false); annotations.skip(1); String c = Annotations.makeLocal("c"); annotations.startAnnotation(c, new Object()); annotations.skip(2); annotations.endAnnotation(c); annotations.finish(); { Iterator<RangedAnnotation<String>> iterator = doc.rangedAnnotations(2, 10, CollectionUtils.newStringSet("a")).iterator(); { RangedAnnotation<String> r = iterator.next(); assertEquals("a", r.key()); assertEquals("1", r.value()); assertEquals(1, r.start()); assertEquals(5, r.end()); } { RangedAnnotation<String> r = iterator.next(); assertEquals("a", r.key()); assertEquals(null, r.value()); assertEquals(5, r.start()); assertEquals(12, r.end()); } assertFalse(iterator.hasNext()); } { Iterator<RangedAnnotation<String>> iterator = doc.rangedAnnotations(2, 10, null).iterator(); { RangedAnnotation<String> r = iterator.next(); assertEquals("a", r.key()); assertEquals("1", r.value()); assertEquals(1, r.start()); assertEquals(5, r.end()); } { RangedAnnotation<String> r = iterator.next(); assertEquals("a", r.key()); assertEquals(null, r.value()); assertEquals(5, r.start()); assertEquals(12, r.end()); } assertFalse(iterator.hasNext()); } { Iterator<AnnotationInterval<String>> iterator = doc.annotationIntervals(3, 3, null).iterator(); assertFalse(iterator.hasNext()); } } public void testSplitTextNeverReturnsSibling() { TestDocumentContext<Node, Element, Text> cxt = ContextProviders.createTestPojoContext( DocProviders.POJO.parse("ab").asOperation(), null, null, null, DocumentSchema.NO_SCHEMA_CONSTRAINTS); TextNodeOrganiser<Text> organiser = cxt.textNodeOrganiser(); MutableDocument<Node, Element, Text> doc = cxt.document(); Text first = (Text) doc.getFirstChild(doc.getDocumentElement()); Text text = organiser.splitText(first, 1); LocalDocument<Node, Element, Text> local = cxt.annotatableContent(); Element tr = local.transparentCreate("l", Attributes.EMPTY_MAP, doc.getDocumentElement(), text); local.transparentMove(tr, text, null, null); assertNull(cxt.getIndexedDoc().splitText(first, 1)); assertNull(organiser.splitText(first, 1)); assertSame(first, organiser.splitText(first, 0)); assertSame(first, organiser.splitText(first, 0)); assertEquals("a<l>b</l>", XmlStringBuilder.innerXml(local).toString()); assertEquals("ab", XmlStringBuilder.innerXml(doc).toString()); } public void testCantGetLocationOfInvalidNode() throws OperationException { AnnotationTree<Object> annotations = new AnnotationTree<Object>( "a", "b", null); RawDocumentImpl rawDoc = RawDocumentImpl.PROVIDER.parse("<doc><p></p></doc>"); IndexedDocumentImpl<Node, Element, Text, ?> doc = new IndexedDocumentImpl<Node, Element, Text, Void>(rawDoc, annotations, DocumentSchema.NO_SCHEMA_CONSTRAINTS); Node element = doc.getDocumentElement().getFirstChild(); // element is valid assertEquals(0, doc.getLocation(element)); doc.consumeAndReturnInvertible(Nindo.deleteElement(0)); // element was deleted try { doc.getLocation(element); fail("Expected: IllegalArgumentException"); } catch (IllegalArgumentException iae) { // OK } // element that was never valid to begin with try { doc.getLocation(rawDoc.createElement("abc", Collections.<String, String>emptyMap(), doc.getDocumentElement(), null)); fail("Expected: IllegalArgumentException"); } catch (IllegalArgumentException iae) { // OK } } public void testCheckRetainPerformace() throws OperationException { final int length = 10000000; StringBuilder b = new StringBuilder(); for (int i = 0; i < length; i++) { b.append("z"); } AnnotationTree<Object> annotations = new AnnotationTree<Object>( "a", "b", null); IndexedDocumentImpl<Node, Element, Text, ?> doc = new IndexedDocumentImpl<Node, Element, Text, Void>( RawDocumentImpl.PROVIDER.parse("<doc><p></p></doc>"), annotations, DocumentSchema.NO_SCHEMA_CONSTRAINTS); doc.consume(new DocOpBuilder().annotationBoundary( new AnnotationBoundaryMapBuilder().change("a", null, "0").build()) .characters(b.toString()).retain(2) .annotationBoundary(new AnnotationBoundaryMapBuilder().end("a").build()).build()); long startTime = System.currentTimeMillis(); final int reps = 10000; for (int i = 0; i < reps; i++) { assertTrue( // The test is that this doesn't time out. DocOpValidator.validate(null, DocumentSchema.NO_SCHEMA_CONSTRAINTS, Automatons.fromReadable(doc), new DocOpBuilder().annotationBoundary( new AnnotationBoundaryMapBuilder().change("a", "0", "1").build()) .retain(length + 2) .annotationBoundary(new AnnotationBoundaryMapBuilder().end("a").build()).build()) .isValid()); } long endTime = System.currentTimeMillis(); long elapsed = endTime - startTime; System.err.println("millis per rep: " + (((float) elapsed) / reps)); } }
apache-2.0
Peppe/vaadin-components-examples
vaadin-grid/details.html
5498
<!doctype html> <html> <head> <title>vaadin-grid Code Examples – Formatting data</title> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1" /> <script src="../bower_components/webcomponentsjs/webcomponents-lite.js"></script> <link rel="import" href="common.html"> <style type="text/css"> .userdetailswrapper { padding: 10px; width: 100%; box-sizing: border-box; } .userdetails { padding: 10px; width: 100%; box-sizing: border-box; -webkit-box-shadow: 0px 0px 15px -3px rgba(0,0,0,0.75); -moz-box-shadow: 0px 0px 15px -3px rgba(0,0,0,0.75); box-shadow: 0px 0px 15px -3px rgba(0,0,0,0.75); } .userdetails img { margin-right: 10px; } .userdetails small { color: #AAA; font-weight: 100; padding-bottom: 2px; } .userdetails div { text-transform: capitalize; } </style> </head> <body unresolved> <section> <h1><a href="./">vaadin-grid</a> <span>Row Details</span> </h1> <table-of-contents select="h3" class="toc"></table-of-contents> </section> <section> <h3>Row details</h3> <p>The <code>vaadin-grid</code> can on request show any content below any row, e.g. detailed information about the row contents.</p> <p>Select a row to open user details.</p> <code-example source> <div> <vaadin-grid demo hidden> <table> <colgroup> <col name="user.name.first" header-text="First Name"> <col name="user.name.last" header-text="Last Name"> <col name="user.email" header-text="Email" flex> </colgroup> </table> </vaadin-grid> <div id="templatewrapper" style="display: none;"> <template is="dom-bind"> <style>.userdata {-webkit-flex: 1; flex: 1; max-height: 20px;} .usercolumn { display: -webkit-flex; display: flex; -webkit-flex-direction: column; flex-direction: column; }</style> <div class="userdetails" style="display: -webkit-flex; display: flex; height: 170px;"> <img src="{{user.picture.medium}}" style="height: 100px; width: 100px;" /> <div class="usercolumn"> <small>Name</small> <div class="userdata">{{user.name.first}}</div> <small>Surname</small> <div class="userdata">{{user.name.last}}</div> <small>Title</small> <div class="userdata">Designer</div> <small>Hire date</small> <div class="userdata">10th August 2015</div> </div> <div class="usercolumn"> <small>City</small> <div class="userdata">{{user.location.city}}</div> <small>Street</small> <div class="userdata">{{user.location.street}}</div> <small>Phone</small> <div class="userdata">{{user.phone}}</div> <div style="display: -webkit-flex; display: flex;"> <button class="demo-button">MESSAGE</BUTTON> <button class="demo-button whitebutton">EDIT</BUTTON> </div> </div> </div> </template> </div> </div> <code hidden demo-var="grid"> var templateWrapper = document.getElementById("templatewrapper"); var template = templateWrapper.querySelector("template"); function getUserDetails(user) { template.user = user; return templateWrapper.querySelector(".userdetails").outerHTML; } </code> <code demo-var="grid"> var grid = grid || document.querySelector("vaadin-grid"); HTMLImports.whenReady(function() { var dataSourceSize = 1000; grid.data.source = function(req) { // Fetch the JSON data from a URL var xhr = new XMLHttpRequest(); xhr.onreadystatechange = function() { if (xhr.readyState == XMLHttpRequest.DONE ) { if(xhr.status == 200){ var json = JSON.parse(xhr.responseText); req.success(json.results, dataSourceSize); } } } var rowsNeeded = req.count > 0 ? req.count : 10; xhr.open("GET", "http://api.randomuser.me/?results=" + rowsNeeded, true); xhr.send(); }; // code // Add a row details generator grid.rowDetailsGenerator = function(rowIndex) { var elem = document.createElement('div'); elem.setAttribute('class', 'userdetailswrapper'); grid.data.getItem(rowIndex, function(error, item) { if (!error) { elem.innerHTML = getUserDetails(item.user); } }); return elem; } var detailsOpenIndex = -1; // Show details for the selected row grid.addEventListener('select', function() { grid.setRowDetailsVisible(detailsOpenIndex, false); var selected = grid.selection.selected(); if (selected.length == 1) { grid.setRowDetailsVisible(selected[0], true); detailsOpenIndex = selected[0]; } }); // end-code }); </code> </code-example> </section> </body> </html>
apache-2.0
jgiara/sap
SAP_SQL.sql
52326
-- phpMyAdmin SQL Dump -- version 4.4.10 -- http://www.phpmyadmin.net -- -- Host: localhost:8889 -- Generation Time: Aug 25, 2016 at 09:21 PM -- Server version: 5.5.42 -- PHP Version: 7.0.0 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; -- -- Database: `SAP` -- -- -------------------------------------------------------- -- -- Table structure for table `Attendance` -- CREATE TABLE `Attendance` ( `attendance_id` int(10) NOT NULL, `user` int(8) NOT NULL, `program` int(10) NOT NULL, `present` varchar(10) NOT NULL, `week` int(10) NOT NULL, `note` varchar(50) DEFAULT NULL, `shift_day` varchar(10) NOT NULL, `shift_time` varchar(10) NOT NULL ) ENGINE=InnoDB AUTO_INCREMENT=89 DEFAULT CHARSET=latin1; -- -- Dumping data for table `Attendance` -- INSERT INTO `Attendance` (`attendance_id`, `user`, `program`, `present`, `week`, `note`, `shift_day`, `shift_time`) VALUES (1, 76280038, 1, '', 1, NULL, 'Thursday', '12:00 PM'), (2, 70108661, 1, '', 1, NULL, 'Tuesday', '2:00 PM'), (3, 15831854, 1, '', 1, NULL, 'Tuesday', '10:00 AM'), (4, 86647814, 1, '', 1, NULL, 'Monday', '2:00 PM'), (5, 30355187, 1, '', 1, NULL, 'Tuesday', '2:00 PM'), (6, 12345678, 1, '', 1, NULL, 'Friday', '10:00 AM'), (7, 77799508, 1, '', 1, '', 'Thursday', '10:00 AM'), (8, 35010404, 1, '', 1, NULL, 'Tuesday', '10:00 AM'), (9, 47707086, 1, '', 1, NULL, 'Tuesday', '2:00 PM'), (10, 10489983, 1, '', 1, NULL, 'Wednesday', '2:00 PM'), (11, 85718351, 1, '', 1, NULL, 'Tuesday', '2:00 PM'), (12, 43481125, 1, '', 1, NULL, 'Thursday', '2:00 PM'), (13, 57301413, 1, '', 1, NULL, 'Monday', '2:00 PM'), (14, 55623363, 1, '', 1, NULL, 'Thursday', '10:00 AM'), (15, 70733046, 1, '', 1, NULL, 'Monday', '12:00 PM'), (16, 29064982, 1, '', 1, NULL, 'Wednesday', '10:00 AM'), (17, 73246858, 1, '', 1, NULL, 'Monday', '2:00 PM'), (18, 52208065, 1, '', 1, NULL, 'Wednesday', '12:00 PM'), (19, 31677322, 1, '', 1, NULL, 'Thursday', '12:00 PM'), (20, 71941792, 1, '', 1, NULL, 'Friday', '12:00 PM'), (21, 59219640, 1, '', 1, NULL, 'Tuesday', '10:00 AM'), (22, 25647221, 1, '', 1, NULL, 'Tuesday', '12:00 PM'), (23, 56787568, 1, '', 1, NULL, 'Wednesday', '2:00 PM'), (24, 30108431, 1, '', 1, NULL, 'Thursday', '12:00 PM'), (25, 26225313, 1, '', 1, NULL, 'Wednesday', '10:00 AM'), (26, 51792355, 1, '', 1, NULL, 'Friday', '12:00 PM'), (27, 16114836, 1, '', 1, NULL, 'Wednesday', '10:00 AM'), (28, 89489351, 1, '', 1, NULL, 'Monday', '12:00 PM'), (29, 29094838, 1, '', 1, NULL, 'Thursday', '12:00 PM'), (30, 69690543, 1, '', 1, NULL, 'Wednesday', '2:00 PM'), (31, 24903731, 1, '', 1, NULL, 'Wednesday', '10:00 AM'), (32, 38587263, 1, '', 1, NULL, 'Friday', '10:00 AM'), (33, 65614588, 1, '', 1, NULL, 'Monday', '12:00 PM'), (34, 89526734, 1, '', 1, NULL, 'Monday', '10:00 AM'), (35, 40514398, 1, '', 1, NULL, 'Thursday', '12:00 PM'), (36, 37115976, 1, '', 1, NULL, 'Friday', '2:00 PM'), (37, 46062270, 1, '', 1, NULL, 'Monday', '12:00 PM'), (38, 34066991, 1, '', 1, NULL, 'Wednesday', '12:00 PM'), (39, 15544102, 1, '', 1, NULL, 'Tuesday', '12:00 PM'), (40, 73776341, 1, '', 1, NULL, 'Friday', '10:00 AM'), (41, 77192728, 1, '', 1, NULL, 'Thursday', '10:00 AM'), (42, 14086675, 1, '', 1, NULL, 'Tuesday', '2:00 PM'), (43, 47990081, 1, '', 1, NULL, 'Friday', '10:00 AM'), (44, 41207308, 1, '', 1, NULL, 'Wednesday', '2:00 PM'), (45, 66129491, 1, '', 1, NULL, 'Wednesday', '2:00 PM'), (46, 43493736, 1, '', 1, NULL, 'Tuesday', '12:00 PM'), (47, 65660894, 1, '', 1, NULL, 'Tuesday', '12:00 PM'), (48, 83777646, 1, '', 1, NULL, 'Wednesday', '12:00 PM'), (49, 74422102, 1, '', 1, NULL, 'Tuesday', '12:00 PM'), (50, 70561877, 1, '', 1, NULL, 'Monday', '2:00 PM'), (51, 66307656, 1, '', 1, NULL, 'Monday', '2:00 PM'), (52, 41368026, 1, '', 1, NULL, 'Friday', '10:00 AM'), (53, 74156951, 1, '', 1, NULL, 'Monday', '10:00 AM'), (54, 17718355, 1, '', 1, NULL, 'Tuesday', '10:00 AM'), (55, 39220356, 1, '', 1, NULL, 'Friday', '2:00 PM'), (56, 30852077, 1, '', 1, NULL, 'Monday', '10:00 AM'), (57, 65420998, 1, '', 1, NULL, 'Wednesday', '12:00 PM'), (58, 67374033, 1, '', 1, NULL, 'Friday', '12:00 PM'), (59, 69739536, 1, '', 1, NULL, 'Thursday', '10:00 AM'), (60, 13162138, 1, '', 1, NULL, 'Thursday', '2:00 PM'), (61, 74612856, 1, '', 1, NULL, 'Thursday', '10:00 AM'), (62, 29542691, 1, '', 1, NULL, 'Friday', '10:00 AM'), (63, 78927017, 1, '', 1, NULL, 'Friday', '12:00 PM'), (64, 31063274, 1, '', 1, NULL, 'Thursday', '2:00 PM'), (65, 18487091, 1, '', 1, NULL, 'Friday', '10:00 AM'), (66, 65837597, 1, '', 1, NULL, 'Wednesday', '12:00 PM'), (67, 51326910, 1, '', 1, NULL, 'Wednesday', '2:00 PM'), (68, 48486971, 1, '', 1, NULL, 'Monday', '12:00 PM'), (69, 26095476, 1, '', 1, NULL, 'Wednesday', '12:00 PM'), (70, 43587808, 1, '', 1, NULL, 'Friday', '2:00 PM'), (71, 56981046, 1, '', 1, NULL, 'Friday', '12:00 PM'), (72, 36598285, 1, '', 1, NULL, 'Friday', '2:00 PM'), (73, 14322497, 1, '', 1, NULL, 'Monday', '12:00 PM'), (74, 34943837, 1, '', 1, NULL, 'Monday', '10:00 AM'), (75, 16733250, 1, '', 1, NULL, 'Tuesday', '10:00 AM'), (76, 80920157, 1, '', 1, NULL, 'Wednesday', '10:00 AM'), (77, 74096291, 1, '', 1, NULL, 'Friday', '2:00 PM'), (78, 41831267, 1, '', 1, NULL, 'Tuesday', '2:00 PM'), (79, 41686018, 1, '', 1, NULL, 'Thursday', '10:00 AM'), (80, 63715072, 1, '', 1, NULL, 'Friday', '12:00 PM'), (81, 84508817, 1, '', 1, NULL, 'Monday', '2:00 PM'), (82, 23107465, 1, '', 1, NULL, 'Thursday', '12:00 PM'), (83, 86000815, 1, '', 1, NULL, 'Wednesday', '2:00 PM'), (84, 78585952, 1, '', 1, NULL, 'Tuesday', '10:00 AM'), (85, 60425370, 1, '', 1, NULL, 'Thursday', '2:00 PM'), (86, 37260652, 1, '', 1, NULL, 'Monday', '10:00 AM'), (87, 34834116, 1, '', 1, NULL, 'Friday', '2:00 PM'), (88, 55876566, 1, '', 1, NULL, 'Tuesday', '2:00 PM'); -- -------------------------------------------------------- -- -- Table structure for table `Council` -- CREATE TABLE `Council` ( `council_id` int(10) NOT NULL, `academic_year` varchar(10) NOT NULL ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1; -- -- Dumping data for table `Council` -- INSERT INTO `Council` (`council_id`, `academic_year`) VALUES (1, '2016-2017'); -- -------------------------------------------------------- -- -- Table structure for table `Council_Members` -- CREATE TABLE `Council_Members` ( `council_member_id` int(10) NOT NULL, `user` int(8) NOT NULL, `council_id` int(10) NOT NULL, `position` varchar(40) NOT NULL ) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=latin1; -- -- Dumping data for table `Council_Members` -- INSERT INTO `Council_Members` (`council_member_id`, `user`, `council_id`, `position`) VALUES (1, 16114836, 1, 'Head Coordinator'), (2, 56981046, 1, 'Admitted Eagle Day Coordinator'), (3, 49705582, 1, 'Eagle for a Day Coordinator'), (4, 56226194, 1, 'Eagle for a Day Coordinator'), (5, 50917926, 1, 'Tours Coordinator'), (6, 38587263, 1, 'International Outreach Coordinator'), (7, 71939373, 1, 'AHANA Outreach Coordinator'), (8, 80627466, 1, 'Media Coordinator'), (9, 34834116, 1, 'Eagle for a Day Coordinator'), (10, 10263464, 1, 'Transfer Outreach Coordinator'), (11, 36598285, 1, 'Office Management Coordinator'), (12, 29542691, 1, 'Greeting Coordinator'), (13, 84462221, 1, 'Outreach/HS Visits Coordinator'), (14, 70733046, 1, 'Panels Coordinator'); -- -------------------------------------------------------- -- -- Table structure for table `Groups` -- CREATE TABLE `Groups` ( `group_id` int(10) NOT NULL, `group_name` varchar(20) NOT NULL ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1; -- -- Dumping data for table `Groups` -- INSERT INTO `Groups` (`group_id`, `group_name`) VALUES (1, 'Council'), (2, 'Volunteer'), (3, 'Staff'), (4, 'Admin'); -- -------------------------------------------------------- -- -- Table structure for table `Group_Members` -- CREATE TABLE `Group_Members` ( `group_member_id` int(10) NOT NULL, `user` int(8) NOT NULL, `group_id` int(10) NOT NULL, `access` varchar(10) NOT NULL ) ENGINE=InnoDB AUTO_INCREMENT=113 DEFAULT CHARSET=latin1; -- -- Dumping data for table `Group_Members` -- INSERT INTO `Group_Members` (`group_member_id`, `user`, `group_id`, `access`) VALUES (1, 16114836, 1, 'edit'), (2, 16114836, 2, 'edit'), (3, 56981046, 1, 'edit'), (4, 56981046, 2, 'edit'), (5, 49705582, 1, 'edit'), (6, 49705582, 2, 'edit'), (7, 56226194, 1, 'edit'), (8, 56226194, 2, 'edit'), (9, 50917926, 1, 'edit'), (10, 50917926, 2, 'edit'), (11, 38587263, 1, 'edit'), (12, 38587263, 2, 'edit'), (13, 71939373, 1, 'edit'), (14, 71939373, 2, 'edit'), (15, 80627466, 1, 'edit'), (16, 80627466, 2, 'edit'), (17, 34834116, 1, 'edit'), (18, 34834116, 2, 'edit'), (19, 10263464, 1, 'edit'), (20, 10263464, 2, 'edit'), (21, 36598285, 1, 'edit'), (22, 36598285, 2, 'edit'), (23, 29542691, 1, 'edit'), (24, 29542691, 2, 'edit'), (25, 84462221, 1, 'edit'), (26, 84462221, 2, 'edit'), (27, 70733046, 1, 'edit'), (28, 70733046, 2, 'edit'), (29, 76280038, 2, 'view'), (30, 70108661, 2, 'view'), (31, 15831854, 2, 'view'), (32, 86647814, 2, 'view'), (33, 30355187, 2, 'view'), (34, 77799508, 2, 'view'), (35, 35010404, 2, 'view'), (36, 47707086, 2, 'view'), (37, 10489983, 2, 'view'), (38, 85718351, 2, 'view'), (39, 43481125, 2, 'view'), (40, 57301413, 2, 'view'), (41, 55623363, 2, 'view'), (42, 29064982, 2, 'view'), (43, 73246858, 2, 'view'), (44, 52208065, 2, 'view'), (45, 31677322, 2, 'view'), (46, 71941792, 2, 'view'), (47, 59219640, 2, 'view'), (48, 25647221, 2, 'view'), (49, 56787568, 2, 'view'), (50, 30108431, 2, 'view'), (51, 26225313, 2, 'view'), (52, 51792355, 2, 'view'), (53, 89489351, 2, 'view'), (54, 29094838, 2, 'view'), (55, 69690543, 2, 'view'), (56, 24903731, 2, 'view'), (57, 14021842, 2, 'view'), (58, 65614588, 2, 'view'), (59, 89526734, 2, 'view'), (60, 40514398, 2, 'view'), (61, 24402947, 2, 'view'), (62, 37115976, 2, 'view'), (63, 46062270, 2, 'view'), (64, 34066991, 2, 'view'), (65, 15544102, 2, 'view'), (66, 73776341, 2, 'view'), (67, 77192728, 2, 'view'), (68, 14086675, 2, 'view'), (69, 47990081, 2, 'view'), (70, 41207308, 2, 'view'), (71, 66129491, 2, 'view'), (72, 43493736, 2, 'view'), (73, 65660894, 2, 'view'), (74, 83777646, 2, 'view'), (75, 74422102, 2, 'view'), (76, 70561877, 2, 'view'), (77, 66307656, 2, 'view'), (78, 41368026, 2, 'view'), (79, 74156951, 2, 'view'), (80, 17718355, 2, 'view'), (81, 39220356, 2, 'view'), (82, 30852077, 2, 'view'), (83, 65420998, 2, 'view'), (84, 67374033, 2, 'view'), (85, 69739536, 2, 'view'), (86, 13162138, 2, 'view'), (87, 74612856, 2, 'view'), (88, 78927017, 2, 'view'), (89, 31063274, 2, 'view'), (90, 18487091, 2, 'view'), (91, 65837597, 2, 'view'), (92, 51326910, 2, 'view'), (93, 48486971, 2, 'view'), (94, 26095476, 2, 'view'), (95, 43587808, 2, 'view'), (96, 14322497, 2, 'view'), (97, 34943837, 2, 'view'), (98, 16733250, 2, 'view'), (99, 80920157, 2, 'view'), (100, 74096291, 2, 'view'), (101, 41831267, 2, 'view'), (102, 42428621, 2, 'view'), (103, 41686018, 2, 'view'), (104, 63715072, 2, 'view'), (105, 84508817, 2, 'view'), (106, 23107465, 2, 'view'), (107, 86000815, 2, 'view'), (108, 78585952, 2, 'view'), (109, 60425370, 2, 'view'), (110, 37260652, 2, 'view'), (111, 55876566, 2, 'view'), (112, 12345678, 2, 'view'); -- -------------------------------------------------------- -- -- Table structure for table `Notes` -- CREATE TABLE `Notes` ( `note_id` int(10) NOT NULL, `user` int(8) NOT NULL, `submitted_by` int(8) NOT NULL, `submitted` datetime NOT NULL, `program` int(10) DEFAULT NULL, `comments` text NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Table structure for table `Programming_Weeks` -- CREATE TABLE `Programming_Weeks` ( `week_id` int(10) NOT NULL, `week_number` int(2) NOT NULL, `semester` varchar(6) NOT NULL, `year` int(4) NOT NULL, `sunday_date` date NOT NULL, `monday_date` date NOT NULL, `tuesday_date` date NOT NULL, `wednesday_date` date NOT NULL, `thursday_date` date NOT NULL, `friday_date` date NOT NULL, `saturday_date` date NOT NULL ) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=latin1; -- -- Dumping data for table `Programming_Weeks` -- INSERT INTO `Programming_Weeks` (`week_id`, `week_number`, `semester`, `year`, `sunday_date`, `monday_date`, `tuesday_date`, `wednesday_date`, `thursday_date`, `friday_date`, `saturday_date`) VALUES (1, 1, 'Spring', 2016, '2016-02-07', '2016-02-08', '2016-02-09', '2016-02-10', '2016-02-11', '2016-02-12', '2016-02-13'), (4, 1, 'Fall', 2016, '2016-09-18', '2016-09-19', '2016-09-20', '2016-09-21', '2016-09-21', '2016-09-22', '2016-09-23'), (5, 2, 'Fall', 2016, '2016-09-25', '2016-09-26', '2016-09-27', '2016-09-28', '2016-09-29', '2016-09-30', '2016-10-01'); -- -------------------------------------------------------- -- -- Table structure for table `Programs` -- CREATE TABLE `Programs` ( `program_id` int(10) NOT NULL, `program_name` varchar(30) NOT NULL, `coordinator` int(8) NOT NULL, `semester` varchar(6) NOT NULL, `year` int(4) NOT NULL, `requirements` text NOT NULL ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1; -- -- Dumping data for table `Programs` -- INSERT INTO `Programs` (`program_id`, `program_name`, `coordinator`, `semester`, `year`, `requirements`) VALUES (1, 'Panels', 12345678, 'Spring', 2016, '2 Extra Panels'); -- -------------------------------------------------------- -- -- Table structure for table `Program_Members` -- CREATE TABLE `Program_Members` ( `member_id` int(10) NOT NULL, `user` int(8) NOT NULL, `program` int(10) NOT NULL, `title` varchar(20) DEFAULT NULL, `shift_day` varchar(10) DEFAULT NULL, `shift_time` varchar(15) DEFAULT NULL, `requirements_status` varchar(10) NOT NULL ) ENGINE=InnoDB AUTO_INCREMENT=179 DEFAULT CHARSET=latin1; -- -- Dumping data for table `Program_Members` -- INSERT INTO `Program_Members` (`member_id`, `user`, `program`, `title`, `shift_day`, `shift_time`, `requirements_status`) VALUES (91, 76280038, 1, NULL, 'Thursday', '12:00 PM', 'Complete'), (92, 70108661, 1, NULL, 'Tuesday', '2:00 PM', 'Complete'), (93, 15831854, 1, NULL, 'Tuesday', '10:00 AM', 'Complete'), (94, 86647814, 1, NULL, 'Monday', '2:00 PM', 'Complete'), (95, 30355187, 1, NULL, 'Tuesday', '2:00 PM', 'Complete'), (96, 12345678, 1, NULL, 'Friday', '10:00 AM', 'Complete'), (97, 77799508, 1, NULL, 'Thursday', '10:00 AM', 'Complete'), (98, 35010404, 1, NULL, 'Tuesday', '10:00 AM', 'Complete'), (99, 47707086, 1, NULL, 'Tuesday', '2:00 PM', 'Complete'), (100, 10489983, 1, NULL, 'Wednesday', '2:00 PM', 'Complete'), (101, 85718351, 1, NULL, 'Tuesday', '2:00 PM', 'Complete'), (102, 43481125, 1, NULL, 'Thursday', '2:00 PM', 'Complete'), (103, 57301413, 1, NULL, 'Monday', '2:00 PM', 'Complete'), (104, 55623363, 1, NULL, 'Thursday', '10:00 AM', 'Complete'), (105, 70733046, 1, NULL, 'Monday', '12:00 PM', 'Complete'), (106, 29064982, 1, NULL, 'Wednesday', '10:00 AM', 'Complete'), (107, 73246858, 1, NULL, 'Monday', '2:00 PM', 'Complete'), (108, 52208065, 1, NULL, 'Wednesday', '12:00 PM', 'Complete'), (109, 31677322, 1, NULL, 'Thursday', '12:00 PM', 'Complete'), (110, 71941792, 1, NULL, 'Friday', '12:00 PM', 'Complete'), (111, 59219640, 1, NULL, 'Tuesday', '10:00 AM', 'Complete'), (112, 25647221, 1, NULL, 'Tuesday', '12:00 PM', 'Complete'), (113, 56787568, 1, NULL, 'Wednesday', '2:00 PM', 'Complete'), (114, 30108431, 1, NULL, 'Thursday', '12:00 PM', 'Complete'), (115, 26225313, 1, NULL, 'Monday', '10:00 AM', 'Complete'), (116, 51792355, 1, NULL, 'Friday', '12:00 PM', 'Complete'), (117, 16114836, 1, NULL, 'Wednesday', '10:00 AM', 'Complete'), (118, 89489351, 1, NULL, 'Monday', '12:00 PM', 'Complete'), (119, 29094838, 1, NULL, 'Thursday', '12:00 PM', 'Complete'), (120, 69690543, 1, NULL, 'Tuesday', '2:00 PM', 'Complete'), (121, 24903731, 1, NULL, 'Wednesday', '10:00 AM', 'Complete'), (122, 38587263, 1, NULL, 'Friday', '10:00 AM', 'Complete'), (123, 65614588, 1, NULL, 'Monday', '12:00 PM', 'Complete'), (124, 89526734, 1, NULL, 'Monday', '10:00 AM', 'Complete'), (125, 40514398, 1, NULL, 'Thursday', '12:00 PM', 'Complete'), (126, 37115976, 1, NULL, 'Friday', '2:00 PM', 'Complete'), (127, 46062270, 1, NULL, 'Monday', '12:00 PM', 'Complete'), (128, 34066991, 1, NULL, 'Wednesday', '12:00 PM', 'Complete'), (129, 15544102, 1, NULL, 'Tuesday', '12:00 PM', 'Complete'), (130, 73776341, 1, NULL, 'Friday', '10:00 AM', 'Complete'), (131, 77192728, 1, NULL, 'Thursday', '10:00 AM', 'Complete'), (132, 14086675, 1, NULL, 'Tuesday', '2:00 PM', 'Complete'), (133, 47990081, 1, NULL, 'Friday', '10:00 AM', 'Complete'), (134, 41207308, 1, NULL, 'Wednesday', '2:00 PM', 'Complete'), (135, 66129491, 1, NULL, 'Wednesday', '2:00 PM', 'Complete'), (136, 43493736, 1, NULL, 'Tuesday', '12:00 PM', 'Complete'), (137, 65660894, 1, NULL, 'Tuesday', '12:00 PM', 'Complete'), (138, 83777646, 1, NULL, 'Wednesday', '12:00 PM', 'Complete'), (139, 74422102, 1, NULL, 'Tuesday', '12:00 PM', 'Complete'), (140, 70561877, 1, NULL, 'Monday', '2:00 PM', 'Complete'), (141, 66307656, 1, NULL, 'Monday', '2:00 PM', 'Complete'), (142, 41368026, 1, NULL, 'Friday', '10:00 AM', 'Complete'), (143, 74156951, 1, NULL, 'Monday', '10:00 AM', 'Complete'), (144, 17718355, 1, NULL, 'Tuesday', '10:00 AM', 'Complete'), (145, 39220356, 1, NULL, 'Friday', '2:00 PM', 'Complete'), (146, 30852077, 1, NULL, 'Monday', '10:00 AM', 'Complete'), (147, 65420998, 1, NULL, 'Wednesday', '12:00 PM', 'Complete'), (148, 67374033, 1, NULL, 'Friday', '12:00 PM', 'Complete'), (149, 69739536, 1, NULL, 'Thursday', '10:00 AM', 'Complete'), (150, 13162138, 1, NULL, 'Thursday', '2:00 PM', 'Complete'), (151, 74612856, 1, NULL, 'Thursday', '10:00 AM', 'Complete'), (152, 29542691, 1, NULL, 'Friday', '10:00 AM', 'Complete'), (153, 78927017, 1, NULL, 'Friday', '12:00 PM', 'Complete'), (154, 31063274, 1, NULL, 'Thursday', '2:00 PM', 'Complete'), (155, 18487091, 1, NULL, 'Friday', '10:00 AM', 'Complete'), (156, 65837597, 1, NULL, 'Wednesday', '12:00 PM', 'Complete'), (157, 51326910, 1, NULL, 'Wednesday', '2:00 PM', 'Complete'), (158, 48486971, 1, NULL, 'Monday', '12:00 PM', 'Complete'), (159, 26095476, 1, NULL, 'Wednesday', '12:00 PM', 'Complete'), (160, 43587808, 1, NULL, 'Friday', '2:00 PM', 'Complete'), (161, 56981046, 1, NULL, 'Friday', '12:00 PM', 'Complete'), (162, 36598285, 1, NULL, 'Friday', '2:00 PM', 'Complete'), (163, 14322497, 1, NULL, 'Monday', '12:00 PM', 'Complete'), (164, 34943837, 1, NULL, 'Monday', '10:00 AM', 'Complete'), (165, 16733250, 1, NULL, 'Tuesday', '10:00 AM', 'Complete'), (166, 80920157, 1, NULL, 'Wednesday', '10:00 AM', 'Complete'), (167, 74096291, 1, NULL, 'Friday', '2:00 PM', 'Complete'), (168, 41831267, 1, NULL, 'Tuesday', '2:00 PM', 'Complete'), (169, 41686018, 1, NULL, 'Thursday', '10:00 AM', 'Complete'), (170, 63715072, 1, NULL, 'Friday', '12:00 PM', 'Complete'), (171, 84508817, 1, NULL, 'Monday', '2:00 PM', 'Complete'), (172, 23107465, 1, NULL, 'Thursday', '12:00 PM', 'Complete'), (173, 86000815, 1, NULL, 'Wednesday', '2:00 PM', 'Complete'), (174, 78585952, 1, NULL, 'Tuesday', '10:00 AM', 'Complete'), (175, 60425370, 1, NULL, 'Thursday', '2:00 PM', 'Complete'), (176, 37260652, 1, NULL, 'Monday', '10:00 AM', 'Complete'), (177, 34834116, 1, NULL, 'Friday', '2:00 PM', 'Complete'), (178, 55876566, 1, NULL, 'Monday', '2:00 PM', 'Complete'); -- -------------------------------------------------------- -- -- Table structure for table `Users` -- CREATE TABLE `Users` ( `eagle_id` int(8) NOT NULL, `first_name` varchar(30) NOT NULL, `last_name` varchar(30) NOT NULL, `sex` varchar(1) NOT NULL, `class` int(4) NOT NULL, `school` varchar(4) NOT NULL, `major` varchar(40) NOT NULL, `minor` varchar(40) DEFAULT NULL, `hometown` varchar(30) NOT NULL, `state_country` varchar(20) NOT NULL, `international` varchar(3) NOT NULL, `ahana` varchar(3) NOT NULL, `transfer` varchar(3) NOT NULL, `phone` varchar(15) NOT NULL, `email` varchar(30) NOT NULL, `local_address` varchar(100) NOT NULL, `password` varchar(40) NOT NULL, `position` varchar(40) NOT NULL, `updated` datetime NOT NULL, `joined` date NOT NULL, `applied_tours` int(1) DEFAULT NULL, `applied_panels` int(1) DEFAULT NULL, `applied_council` int(1) DEFAULT NULL, `applied_summer` int(1) DEFAULT NULL, `active` varchar(15) NOT NULL, `Time` varchar(50) NOT NULL, `Ip` varchar(50) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `Users` -- INSERT INTO `Users` (`eagle_id`, `first_name`, `last_name`, `sex`, `class`, `school`, `major`, `minor`, `hometown`, `state_country`, `international`, `ahana`, `transfer`, `phone`, `email`, `local_address`, `password`, `position`, `updated`, `joined`, `applied_tours`, `applied_panels`, `applied_council`, `applied_summer`, `active`, `Time`, `Ip`) VALUES (10263464, 'Beth', 'Yarze', 'F', 2017, 'MCAS', 'Political Science & Philosophy', 'N/A', 'Queensbury', 'NY', 'No', 'No', 'Yes', '518-260-6911', '[email protected]', 'Iggy A22', '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', 'Transfer Outreach Coordinator', '2016-07-28 23:19:22', '2016-07-28', 0, 0, 0, 0, 'Yes', '', ''), (10489983, 'Maxwell', 'Bechtold', 'M', 2018, 'MCAS', 'History', '', 'Madison', 'CT', 'No', 'No', 'No', '2034949700', 'bechtolm', '', '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', 'Volunteer', '0000-00-00 00:00:00', '0000-00-00', 0, 0, 0, 0, 'Yes', '', ''), (12345678, 'Thomas', 'Banfield', 'M', 2017, 'MCAS', 'English', '', 'Westchester', 'NY', 'No', 'No', 'No', '914-318-9294', '[email protected]', '', '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', 'Panels Coordinator', '0000-00-00 00:00:00', '0000-00-00', 0, 0, 0, 0, '', '', ''), (13162138, 'Laurie', 'O''Riordan', 'F', 2016, 'CSOM', 'Marketing, Business Analytics', 'History, International Studies', 'Parma Heights', 'OH', 'No', 'No', 'No', '(216) 906-33', '[email protected]', '', '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', 'Volunteer', '0000-00-00 00:00:00', '0000-00-00', 0, 0, 0, 0, 'Graduated', '', ''), (14021842, 'Emma', 'Harney', 'F', 2017, 'CSOM', 'Management and Leadership, Business Anal', 'Studio Art', 'South Yarmouth', 'MA', 'No', 'No', 'No', '5082218839', '[email protected]', '', '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', 'Volunteer', '0000-00-00 00:00:00', '0000-00-00', 0, 0, 0, 0, 'Yes', '', ''), (14086675, 'Shea', 'Kuhl', 'F', 2017, 'CSON', 'Nursing ', '', 'Bedford', 'MA', 'No', 'No', 'No', '6178510644', '[email protected]', '', '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', 'Volunteer', '0000-00-00 00:00:00', '0000-00-00', 0, 0, 0, 0, 'Yes', '', ''), (14322497, 'Nicholas', 'Reed', 'M', 2017, 'MCAS', 'Economics', 'History', 'Newton', 'MA', 'No', 'No', 'Yes', '(617) 875-38', '[email protected]', '', '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', 'Volunteer', '0000-00-00 00:00:00', '0000-00-00', 0, 0, 0, 0, 'Yes', '', ''), (15544102, 'Nate', 'Kennelly', 'M', 2016, 'MCAS', 'Economics', 'History', 'Ramsey', 'NJ', 'No', 'No', 'No', '(201) 316-52', '[email protected]', '', '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', 'Volunteer', '0000-00-00 00:00:00', '0000-00-00', 0, 0, 0, 0, 'Graduated', '', ''), (15831854, 'Jonathan', 'Amdur', 'M', 2016, 'MCAS', 'Math', 'Philosophy', 'Babylon', 'NY', 'No', 'No', 'No', '6319437890', '[email protected]', '', '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', 'Volunteer', '0000-00-00 00:00:00', '0000-00-00', 0, 0, 0, 0, 'Graduated', '', ''), (16114836, 'Jon', 'Giara', 'M', 2017, 'MCAS', 'Computer Science', 'Bioinformatics', 'Attleboro', 'MA', 'No', 'No', 'No', '508-838-7443', '[email protected]', '14 Hammondswood Rd', '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', 'Head Coordinator', '2016-07-28 23:19:22', '2016-07-28', 2, 2, 2, 1, 'Yes', '', ''), (16733250, 'Eric', 'Sanfilippo', 'M', 2018, 'MCAS', 'Biology', 'French', 'East Lyme', 'CT', 'No', 'No', 'No', '8604603849', '[email protected]', '', '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', 'Volunteer', '0000-00-00 00:00:00', '0000-00-00', 0, 0, 0, 0, 'Yes', '', ''), (17718355, 'Sarah', 'Moore', 'F', 2017, 'MCAS', 'English', 'Hispanic Studies', 'Olney', 'MD', 'No', 'No', 'No', '(301)452-246', '[email protected]', '', '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', 'Volunteer', '0000-00-00 00:00:00', '0000-00-00', 0, 0, 0, 0, 'Yes', '', ''), (18487091, 'Erica', 'Pascocello', 'F', 2018, 'CSOM', 'Accounting', 'French', 'Haddonfield', 'NJ', 'No', 'No', 'No', '8566697238', '[email protected]', '', '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', 'Volunteer', '0000-00-00 00:00:00', '0000-00-00', 0, 0, 0, 0, 'Yes', '', ''), (23107465, 'Matthew', 'Ulrich', 'M', 2017, 'MCAS', 'Mathematics and Economics', 'Philosophy', 'Clinton', 'NJ', 'No', 'No', 'No', '(908) 894-22', '[email protected]', '', '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', 'Volunteer', '0000-00-00 00:00:00', '0000-00-00', 0, 0, 0, 0, 'Yes', '', ''), (24402947, 'Debbie', 'Jean-Philippe', 'F', 2016, 'CSOM', 'Accounting', 'Pre-Law', 'Waltham', 'MA', 'No', 'Yes', 'No', '7818128956', '[email protected]', '', '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', 'Volunteer', '0000-00-00 00:00:00', '0000-00-00', 0, 0, 0, 0, 'Graduated', '', ''), (24903731, 'Jacqueline', 'Hannon', 'F', 2016, 'LSOE', 'Elementary Ed/ APHD', '', 'Middlebury', 'CT', 'No', 'No', 'No', '(203) 560-48', '[email protected]', '', '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', 'Volunteer', '0000-00-00 00:00:00', '0000-00-00', 0, 0, 0, 0, 'Graduated', '', ''), (25647221, 'Anne', 'Dovolis', 'F', 2018, 'CSOM', 'Accounting, Business Analytics', '', 'Edina', 'MN', 'No', 'No', 'No', '(612) 940-39', '[email protected]', '', '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', 'Volunteer', '0000-00-00 00:00:00', '0000-00-00', 0, 0, 0, 0, 'Yes', '', ''), (26095476, 'William', 'Pisano', 'M', 2018, 'MCAS', 'Biochemistry', 'Economics', 'Tarpon Springs', 'FL', 'No', 'No', 'No', '(727)-433-27', '[email protected]', '', '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', 'Volunteer', '0000-00-00 00:00:00', '0000-00-00', 0, 0, 0, 0, 'Yes', '', ''), (26225313, 'Ashlynn', 'Fields', 'F', 2016, 'LSOE', 'Applied Psychology & Human Development; ', '', 'West Orange', 'NJ', 'No', 'Yes', 'No', '(201)463-406', '[email protected]', '', '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', 'Volunteer', '0000-00-00 00:00:00', '0000-00-00', 0, 0, 0, 0, 'Graduated', '', ''), (29064982, 'Emma ', 'Catranis', 'F', 2018, 'MCAS', 'Communication', 'English', 'Toms River', 'NJ', 'No', 'No', 'No', '732-998-0524', '[email protected]', '', '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', 'Volunteer', '0000-00-00 00:00:00', '0000-00-00', 0, 0, 0, 0, 'Yes', '', ''), (29094838, 'Hilary', 'Gould', 'F', 2018, 'CSOM', 'Undecided', 'International Studies', 'Winnetka', 'IL', 'No', 'No', 'No', '(847) 363-49', '[email protected]', '', '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', 'Volunteer', '0000-00-00 00:00:00', '0000-00-00', 0, 0, 0, 0, 'Yes', '', ''), (29542691, 'Emi', 'Omick', 'F', 2017, 'CSOM', 'Management; Concentration in Finance', 'Faith, Peach and Justice Studies', 'Tucson', 'AZ', 'No', 'No', 'No', '520-401-5151', '[email protected]', 'Ruby C24', '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', 'Greeting Coordinator', '2016-07-28 23:19:22', '2016-07-28', 0, 0, 0, 0, 'Yes', '', ''), (30108431, 'Elizabeth ', 'Farrenkopf ', 'F', 2016, 'MCAS', 'International Relations, Political Scien', '', 'Lynnfield', 'Ma', 'No', 'No', 'No', '7815800019', '[email protected]', '', '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', 'Volunteer', '0000-00-00 00:00:00', '0000-00-00', 0, 0, 0, 0, 'Graduated', '', ''), (30355187, 'Sophia', 'Andreadis', 'F', 2016, 'CSOM', 'Marketing, Management & Leadership', '', 'Warren', 'RI', 'No', 'No', 'No', '401-440-9654', '[email protected]', '', '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', 'Volunteer', '0000-00-00 00:00:00', '0000-00-00', 0, 0, 0, 0, 'Graduated', '', ''), (30852077, 'Daniel', 'Moren', 'M', 2016, 'MCAS', 'Biology', 'Math', 'Warwick', 'RI', 'No', 'No', 'No', '401-529-4012', '[email protected]', '', '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', 'Volunteer', '0000-00-00 00:00:00', '0000-00-00', 0, 0, 0, 0, 'Graduated', '', ''), (31063274, 'Jordan', 'Panza', 'F', 2017, 'CSOM', 'Marketing, Information Systems', '', 'Watertown', 'MA', 'No', 'No', 'No', '6174582071', '[email protected]', '', '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', 'Volunteer', '0000-00-00 00:00:00', '0000-00-00', 0, 0, 0, 0, 'Yes', '', ''), (31677322, 'Vanessa', 'Contratto', 'F', 2018, 'MCAS', 'International Studies', 'Spanish', 'Palos Verdes', 'CA', 'No', 'No', 'No', '3109442666', '[email protected]', '', '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', 'Volunteer', '0000-00-00 00:00:00', '0000-00-00', 0, 0, 0, 0, 'Yes', '', ''), (34066991, 'Megan', 'Kelly', 'F', 2017, 'CSOM', 'Marketing / Management & Leadership', 'Women''s and Gender Studies', 'Cleveland', 'OH', 'No', 'No', 'No', '(440) 539-94', '[email protected]', '', '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', 'Volunteer', '0000-00-00 00:00:00', '0000-00-00', 0, 0, 0, 0, 'Yes', '', ''), (34834116, 'Haydn', 'White', 'F', 2018, 'MCAS', 'Psychology', 'Biology', 'Lexington', 'KY', 'No', 'No', 'No', '859-779-8754', '[email protected]', '2000 Comm Ave', '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', 'EFAD Coordinator', '2016-07-28 23:19:22', '2016-07-28', 0, 0, 0, 0, 'Yes', '', ''), (34943837, 'Sloan', 'Renfro', 'F', 2016, 'MCAS', 'History', 'Medical Humanities', 'Greenville', 'SC', 'No', 'No', 'No', '8649795899', '[email protected]', '', '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', 'Volunteer', '0000-00-00 00:00:00', '0000-00-00', 0, 0, 0, 0, 'Graduated', '', ''), (35010404, 'Brooke', 'Bartlett', 'F', 2017, 'CSOM', 'Finance and Operations Management ', '', 'Lincolnshire', 'IL', 'No', 'No', 'No', '(847) 682-84', '[email protected]', '', '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', 'Volunteer', '0000-00-00 00:00:00', '0000-00-00', 0, 0, 0, 0, 'Yes', '', ''), (36598285, 'Kevin', 'Reardon', 'M', 2018, 'CSOM', 'Accounting', 'History', 'Wilmington', 'DE', 'No', 'No', 'No', '302-668-3437', '[email protected]', 'Off campus (64 Undine Rd)', '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', 'OM Coordinator', '2016-07-28 23:19:22', '2016-07-28', 0, 0, 0, 0, 'Yes', '', ''), (37115976, 'Elizabeth', 'Joseph', 'F', 2019, 'MCAS', 'psychology ', '', 'Natick', 'MA', 'No', 'No', 'No', '(774)270-279', '[email protected] ', '', '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', 'Volunteer', '0000-00-00 00:00:00', '0000-00-00', 0, 0, 0, 0, 'Yes', '', ''), (37260652, 'Kira', 'Welcenbach', 'F', 2018, 'CSOM', 'Finance, Economics', 'History', 'Milwaukee', 'WI', 'No', 'No', 'No', '(414) 708-74', '[email protected]', '', '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', 'Volunteer', '0000-00-00 00:00:00', '0000-00-00', 0, 0, 0, 0, 'Yes', '', ''), (38587263, 'Will', 'Hennessy', 'M', 2017, 'CSOM', 'Computer Science CSOM', 'n/a', 'New Canaan', 'CT', 'No', 'No', 'No', '203-803-8450', '[email protected]', 'Rubi', '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', 'IO Coordinator', '2016-07-28 23:19:22', '2016-07-28', 0, 0, 0, 0, 'Yes', '', ''), (39220356, 'Pedro', 'Mora', 'M', 2016, 'CSOM', 'Finance, Corporate Reporting', 'Hispanic Studies', 'Shrewsbury', 'MA', 'No', 'Yes', 'No', '508-523-3335', '[email protected]', '', '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', 'Volunteer', '0000-00-00 00:00:00', '0000-00-00', 0, 0, 0, 0, 'Graduated', '', ''), (40514398, 'Solina', 'Jean-Louis', 'F', 2018, 'MCAS', 'International Studies, German', '', 'Atlanta', 'GA', 'No', 'Yes', 'No', '(404) 713-69', '[email protected]', '', '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', 'Volunteer', '0000-00-00 00:00:00', '0000-00-00', 0, 0, 0, 0, 'Yes', '', ''), (41207308, 'Kristen', 'Leach', 'F', 2018, 'MCAS', 'Biology', 'Mathematics', 'Peachtree Corners', 'GA', 'No', 'No', 'No', '(770)595-395', '[email protected]', '', '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', 'Volunteer', '0000-00-00 00:00:00', '0000-00-00', 0, 0, 0, 0, 'Yes', '', ''), (41368026, 'Claire', 'Messina', 'F', 2017, 'LSOE', 'Elementary Education and Math/Computer S', 'Middle School Math', 'Cold Spring Harbor', 'NY', 'No', 'No', 'No', '(516) 946-16', '[email protected]', '', '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', 'Volunteer', '0000-00-00 00:00:00', '0000-00-00', 0, 0, 0, 0, 'Yes', '', ''), (41686018, 'Laura', 'Stateler', 'F', 2018, 'MCAS', 'International Studies and Philosophy ', 'Political Science ', 'Golden', 'CO', 'No', 'No', 'No', '303-396-8206', '[email protected]', '', '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', 'Volunteer', '0000-00-00 00:00:00', '0000-00-00', 0, 0, 0, 0, 'Yes', '', ''), (41831267, 'Russell', 'Simons', 'M', 2017, 'MCAS', 'Biology', 'Medical Humanities', 'Larchmont', 'NY', 'No', 'No', 'No', '9149608925', '[email protected]', '', '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', 'Volunteer', '0000-00-00 00:00:00', '0000-00-00', 0, 0, 0, 0, 'Yes', '', ''), (42428621, 'Kaitlyn ', 'Solano', 'F', 2017, 'MCAS', 'Linguistics. International Studies', '', 'Norwalk', 'CT', 'No', 'No', 'No', '(203) 913-59', '[email protected]', '', '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', 'Volunteer', '0000-00-00 00:00:00', '0000-00-00', 0, 0, 0, 0, 'Yes', '', ''), (43481125, 'James', 'Berkman', 'M', 2016, 'MCAS', 'History', 'IS', 'Bernardsville', 'NJ', 'No', 'No', 'No', '9086259338', '[email protected]', '', '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', 'Volunteer', '0000-00-00 00:00:00', '0000-00-00', 0, 0, 0, 0, 'Graduated', '', ''), (43493736, 'Bobby', 'Looney', 'M', 2017, 'CSOM', 'Finance and Marketing', '', 'Mansfield', 'MA', 'No', 'No', 'No', '5082696109', '[email protected]', '', '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', 'Volunteer', '0000-00-00 00:00:00', '0000-00-00', 0, 0, 0, 0, 'Yes', '', ''), (43587808, 'Katherine', 'Quinn', 'F', 2016, 'MCAS', 'Biology; Theology', '', 'Queenstown', 'MD', 'No', 'No', 'No', '4439888143', '[email protected]', '', '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', 'Volunteer', '0000-00-00 00:00:00', '0000-00-00', 0, 0, 0, 0, 'Graduated', '', ''), (46062270, 'Joe', 'Kelly', 'M', 2016, 'CSOM', 'Finance and Economics', '', 'Colts Neck', 'NJ', 'No', 'No', 'No', '908-907-8671', '[email protected]', '', '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', 'Volunteer', '0000-00-00 00:00:00', '0000-00-00', 0, 0, 0, 0, 'Graduated', '', ''), (47707086, 'Joshua ', 'Beauregard', 'M', 2017, 'MCAS', 'Communication', 'American Studies', 'Northbridge', 'MA', 'No', 'No', 'No', '(774)482-041', '[email protected]', '', '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', 'Volunteer', '0000-00-00 00:00:00', '0000-00-00', 0, 0, 0, 0, 'Yes', '', ''), (47990081, 'Matthew', 'Lavelle', 'M', 2017, 'CSOM', 'Management', 'Finance and Marketing', 'Worcester', 'MA', 'No', 'No', 'No', '508-688-5768', '[email protected]', '', '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', 'Volunteer', '0000-00-00 00:00:00', '0000-00-00', 0, 0, 0, 0, 'Yes', '', ''), (48486971, 'Sade', 'Phipps', 'F', 2016, 'LSOE', 'Applied Psychology and Human Development', 'Sociology and African and African Diaspo', 'Boston', 'MA', 'No', 'Yes', 'No', '(617) 602-52', '[email protected]', '', '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', 'Volunteer', '0000-00-00 00:00:00', '0000-00-00', 0, 0, 0, 0, 'Graduated', '', ''), (49705582, 'Chloe', 'Mansour', 'F', 2017, 'LSOE', 'Applied Psychology and Human Development', 'Management and Leadership', 'Laguna Beach', 'CA', 'No', 'No', 'No', '949-280-7923', '[email protected]', 'Ruby', '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', 'EFAD Coordinator', '2016-07-28 23:19:22', '2016-07-28', 0, 0, 0, 0, 'Yes', '', ''), (50917926, 'Kristin', 'Morisseau', 'F', 2017, 'MCAS', 'Economics &a communication', 'None', 'Verona', 'NJ', 'No', 'No', 'No', '862-220-5093', '[email protected]', 'MOD 24A', '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', 'Tours Coordinator', '2016-07-28 23:19:22', '2016-07-28', 0, 0, 0, 0, 'Yes', '', ''), (51326910, 'Paola', 'Perez', 'F', 2016, 'CSOM', 'Accounting, French ', '', 'San Juan', 'Puerto Rico ', 'No', 'Yes', 'No', '7876747126', '[email protected]', '', '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', 'Volunteer', '0000-00-00 00:00:00', '0000-00-00', 0, 0, 0, 0, 'Graduated', '', ''), (51792355, 'Brandon', 'Gallagher', 'M', 2017, 'CSOM', 'Accounting', 'Theology', 'Annandale', 'NJ', 'No', 'No', 'No', '(908) 566-57', '[email protected]', '', '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', 'Volunteer', '0000-00-00 00:00:00', '0000-00-00', 0, 0, 0, 0, 'Yes', '', ''), (52208065, 'Kim ', 'Chook', 'F', 2018, 'MCAS', 'Communication', 'English / Leadership and Management', 'Sharon', 'MA', 'No', 'Yes', 'No', '781-686-6222', '[email protected]', '', '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', 'Volunteer', '0000-00-00 00:00:00', '0000-00-00', 0, 0, 0, 0, 'Yes', '', ''), (55623363, 'Deven', 'Bhattacharya', 'M', 2019, 'MCAS', 'Political Science', '', 'Freehold', 'NJ', 'No', 'No', 'No', '(732) 915-74', '[email protected]', '', '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', 'Volunteer', '0000-00-00 00:00:00', '0000-00-00', 0, 0, 0, 0, 'Yes', '', ''), (55876566, 'Aoyi', 'Yang', 'F', 2018, 'LSOE', 'Applied Psychology and Human Development', 'Music', 'Shanghai', 'China', 'Yes', 'Yes', 'No', '6177687413', '[email protected]', '', '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', 'Volunteer', '0000-00-00 00:00:00', '0000-00-00', 0, 0, 0, 0, 'Yes', '', ''), (56226194, 'Olivia', 'Palmer', 'F', 2019, 'MCAS', 'Biology', 'None (yet)', 'Cheshire', 'CT', 'No', 'No', 'No', '203-623-8576', '[email protected]', 'Walsh', '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', 'EFAD Coordinator', '2016-07-28 23:19:22', '2016-07-28', 0, 0, 0, 0, 'Yes', '', ''), (56787568, 'Nicolette', 'Esposito', 'F', 2016, 'CSOM', 'Finance and Accounting', '', 'Holmdel', 'NJ', 'No', 'No', 'No', '7327788324', '[email protected]', '', '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', 'Volunteer', '0000-00-00 00:00:00', '0000-00-00', 0, 0, 0, 0, 'Graduated', '', ''), (56981046, 'Nick', 'Raposo', 'M', 2018, 'CSON', 'Nursing', 'Medical Humanities; Leadership in Higher', 'Fall River', 'MA', 'No', 'No', 'No', '774-955-8389', '[email protected]', 'Fitzpatrick 108', '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', 'AED Coordinator', '2016-07-28 23:19:22', '2016-07-28', 0, 0, 0, 0, 'Yes', '', ''), (57301413, 'Lawrence ', 'Berrill', 'M', 2016, 'CSOM', 'Marketing, psycholgy', '', 'West Windsor', 'NJ', 'No', 'No', 'No', '7323103453', '[email protected]', '', '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', 'Volunteer', '0000-00-00 00:00:00', '0000-00-00', 0, 0, 0, 0, 'Graduated', '', ''), (59219640, 'Natalie', 'Dolphin', 'F', 2016, 'MCAS', 'Political Science and History', '', 'Minneapolis', 'MN', 'No', 'No', 'No', '(612)964-454', '[email protected]', '', '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', 'Volunteer', '0000-00-00 00:00:00', '0000-00-00', 0, 0, 0, 0, 'Graduated', '', ''), (60425370, 'John', 'Walsh', 'M', 2017, 'CSOM', 'Accounting & Theology', '', 'Franklin', 'MA', 'No', 'No', 'No', '(774) 571-37', '[email protected]', '', '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', 'Volunteer', '0000-00-00 00:00:00', '0000-00-00', 0, 0, 0, 0, 'Yes', '', ''), (63715072, 'Sarah', 'Stefanski', 'F', 2018, 'CSOM', 'Accounting', 'Theology', 'Baltimore', 'MD', 'No', 'No', 'No', '443-250-2165', '[email protected]', '', '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', 'Volunteer', '0000-00-00 00:00:00', '0000-00-00', 0, 0, 0, 0, 'Yes', '', ''), (65420998, 'Matthew', 'Munfakh', 'M', 2016, 'CSOM', 'Finance', 'Math', 'St. Louis', 'MO', 'No', 'No', 'No', '(314) 856-50', '[email protected]', '', '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', 'Volunteer', '0000-00-00 00:00:00', '0000-00-00', 0, 0, 0, 0, 'Graduated', '', ''), (65614588, 'Lindsey', 'Hunt', 'F', 2018, 'CSOM', 'Finance and Political Science', '', 'Crofton', 'MD', 'No', 'No', 'No', '301-801-3996', '[email protected]', '', '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', 'Volunteer', '0000-00-00 00:00:00', '0000-00-00', 0, 0, 0, 0, 'Yes', '', ''), (65660894, 'Paige', 'Lou', 'F', 2018, 'LSOE', 'Applied Psychology and Human Development', 'Sociology', 'Shanghai', 'China', 'Yes', 'Yes', 'No', '(224)633-676', '[email protected]', '', '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', 'Volunteer', '0000-00-00 00:00:00', '0000-00-00', 0, 0, 0, 0, 'Yes', '', ''), (65837597, 'Caitlyn', 'Passaretti', 'F', 2016, 'MCAS', 'Sociology', 'Faith Peace and Justice ', 'South Hamilton', 'MA', 'No', 'No', 'No', '9789985288', '[email protected]', '', '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', 'Volunteer', '0000-00-00 00:00:00', '0000-00-00', 0, 0, 0, 0, 'Graduated', '', ''), (66129491, 'Melanie', 'Logan', 'F', 2016, 'MCAS', 'B.S. Psychology', 'Medical Humanities', 'Columbus', 'OH', 'No', 'No', 'No', '6144486817', '[email protected]', '', '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', 'Volunteer', '0000-00-00 00:00:00', '0000-00-00', 0, 0, 0, 0, 'Graduated', '', ''), (66307656, 'Katie ', 'McGirney', 'F', 2018, 'MCAS', 'Communication', 'Journalism ', 'Tampa', 'FL', 'No', 'No', 'No', '8139432179', '[email protected]', '', '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', 'Volunteer', '0000-00-00 00:00:00', '0000-00-00', 0, 0, 0, 0, 'Yes', '', ''), (67374033, 'Molly', 'Nuell', 'F', 2016, 'LSOE', 'Elementary Education, Theology', '', 'Miami', 'FL', 'No', 'No', 'No', '786-693-3705', '[email protected]', '', '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', 'Volunteer', '0000-00-00 00:00:00', '0000-00-00', 0, 0, 0, 0, 'Graduated', '', ''), (69690543, 'Armen', 'Grigorian', 'M', 2017, 'MCAS', 'History, Communication', '', 'Belmont', 'MA', 'No', 'No', 'No', '617-460-4094', '[email protected]', '', '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', 'Volunteer', '0000-00-00 00:00:00', '0000-00-00', 0, 0, 0, 0, 'Yes', '', ''), (69739536, 'Kaitlin', 'O''Donnell', 'F', 2016, 'MCAS', 'International Studies', 'Hispanic Studies', 'Portland', 'OR', 'No', 'No', 'No', '(503) 473-92', '[email protected]', '', '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', 'Volunteer', '0000-00-00 00:00:00', '0000-00-00', 0, 0, 0, 0, 'Graduated', '', ''), (70108661, 'Meghan', 'Allen', 'F', 2016, 'CSOM', 'Finance, Economics, Political Science', '', 'Scotch Plains', 'NJ', 'No', 'No', 'No', '(908) 380-39', '[email protected]', '', '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', 'Volunteer', '0000-00-00 00:00:00', '0000-00-00', 0, 0, 0, 0, 'Graduated', '', ''), (70561877, 'Alicia', 'McCormick', 'F', 2017, 'MCAS', 'Psychology', 'Leadership in Higher Education', 'Melrose', 'MA', 'No', 'No', 'No', '781-835-6069', '[email protected]', '', '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', 'Volunteer', '0000-00-00 00:00:00', '0000-00-00', 0, 0, 0, 0, 'Yes', '', ''), (70733046, 'Gail', 'Brown', 'F', 2018, 'MCAS', 'Political Science and Economics', 'Management and Leadership', 'Iowa City', 'IA', 'No', 'No', 'No', '319-321-3350', '[email protected]', '309 2000', '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', 'Panels Coordinator', '2016-07-28 23:19:22', '2016-07-28', 0, 0, 0, 0, 'Yes', '', ''), (71939373, 'Priscilla', 'Nyarko', 'F', 2018, 'CSON', 'Nursing', 'Psychology', 'Bronx', 'NY', 'No', 'Yes', 'No', '201-640-1715', '[email protected]', 'Stayer Hall', '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', 'AHANA Outreach Coordinator', '2016-07-28 23:19:22', '2016-07-28', 0, 0, 0, 0, 'Yes', '', ''), (71941792, 'Frank', 'DiMartino', 'M', 2017, 'MCAS', 'Economics and Philosophy', '', 'Lawrenceville', 'NJ', 'No', 'No', 'No', '(609) 802-84', '[email protected]', '', '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', 'Volunteer', '0000-00-00 00:00:00', '0000-00-00', 0, 0, 0, 0, 'Yes', '', ''), (73246858, 'Tucker', 'Charette', 'M', 2018, 'CSOM', 'Finance, Marketing', '', 'West Hartford', 'CT', 'No', 'No', 'No', '(860) 250-38', '[email protected]', '', '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', 'Volunteer', '0000-00-00 00:00:00', '0000-00-00', 0, 0, 0, 0, 'Yes', '', ''), (73776341, 'Brendan', 'Kolon', 'M', 2017, 'CSOM', 'Marketing, Business Analytics', 'Philosophy', 'Moorestown', 'NJ', 'No', 'No', 'No', '(609) 304-95', '[email protected]', '', '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', 'Volunteer', '0000-00-00 00:00:00', '0000-00-00', 0, 0, 0, 0, 'Yes', '', ''), (74096291, 'Colleen', 'Sheridan', 'F', 2017, 'MCAS', 'International Studies, Concentration in ', 'History and Management & Leadership', 'Westfield', 'NJ', 'No', 'No', 'No', '(908) 327-59', '[email protected]', '', '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', 'Volunteer', '0000-00-00 00:00:00', '0000-00-00', 0, 0, 0, 0, 'Yes', '', ''), (74156951, 'Jacob', 'Monk', 'M', 2016, 'CSOM', 'Accounting', 'Theology', 'Parker', 'CO', 'No', 'No', 'No', '303 518-0382', '[email protected]', '', '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', 'Volunteer', '0000-00-00 00:00:00', '0000-00-00', 0, 0, 0, 0, 'Graduated', '', ''), (74422102, 'Shannon', 'Lydon', 'F', 2018, 'MCAS', 'Political Science', 'Philosophy', 'Bethesda', 'MD', 'No', 'No', 'No', '301-312-4430', '[email protected]', '', '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', 'Volunteer', '0000-00-00 00:00:00', '0000-00-00', 0, 0, 0, 0, 'Yes', '', ''), (74612856, 'Kanwal ', 'Ojha', 'F', 2019, 'MCAS', 'Biology', 'Women''s Studies', 'Rocky Hill', 'CT', 'No', 'Yes', 'No', '(860) 987-80', '[email protected]', '', '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', 'Volunteer', '0000-00-00 00:00:00', '0000-00-00', 0, 0, 0, 0, 'Yes', '', ''), (76280038, 'Kaitlin', 'Adams', 'F', 2016, 'CSOM', 'Marketing/Business Analytics', '', 'Boca Raton', 'FL', 'No', 'No', 'No', '(561) 251-72', '[email protected]', '', '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', 'Volunteer', '0000-00-00 00:00:00', '0000-00-00', 0, 0, 0, 0, 'Graduated', '', ''), (77192728, 'MaryEllen', 'Krah', 'F', 2017, 'LSOE', 'Elementary Education; Math/Computer Scie', 'Middle School Math', 'Medfield', 'MA', 'No', 'No', 'No', '(508) 641-68', '[email protected]', '', '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', 'Volunteer', '0000-00-00 00:00:00', '0000-00-00', 0, 0, 0, 0, 'Yes', '', ''), (77799508, 'Carolyn', 'Barrett', 'F', 2016, 'MCAS', 'Political Science', 'Medical Humanities and Culture', 'Wakefield', 'MA', 'No', 'No', 'Yes', '7814394946', '[email protected]', '', '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', 'Volunteer', '0000-00-00 00:00:00', '0000-00-00', 0, 0, 0, 0, 'Graduated', '', ''), (78585952, 'Emma', 'Vitale', 'F', 2016, 'MCAS', 'International Studies', 'Management & Leadership', 'Minneapolis', 'MN', 'No', 'No', 'No', '(952) 220-19', '[email protected]', '', '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', 'Volunteer', '0000-00-00 00:00:00', '0000-00-00', 0, 0, 0, 0, 'Graduated', '', ''), (78927017, 'Julie', 'Orenstein', 'F', 2016, 'MCAS', 'Political Science', 'International Studies', 'West Hartford', 'CT', 'No', 'No', 'No', '(860) 808-78', '[email protected]', '', '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', 'Volunteer', '0000-00-00 00:00:00', '0000-00-00', 0, 0, 0, 0, 'Graduated', '', ''), (80627466, 'Robyn', 'Naragon', 'F', 2019, 'MCAS', 'Communications', 'International Studies', 'Campbell', 'CA', 'No', 'No', 'No', '408-963-8367', '[email protected]', 'Walsh 801A', '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', 'Media Coordinator', '2016-07-28 23:19:22', '2016-07-28', 0, 0, 0, 0, 'Yes', '', ''), (80920157, 'Maggie', 'Shepard', 'F', 2016, 'MCAS', 'Economics', 'Faith, Peace, and Justice', 'Yorba Linda', 'CA', 'No', 'No', 'No', '(714) 944-76', '[email protected]', '', '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', 'Volunteer', '0000-00-00 00:00:00', '0000-00-00', 0, 0, 0, 0, 'Graduated', '', ''), (83777646, 'Kyra', 'Luck', 'F', 2018, 'MCAS', 'International Studies', 'History', 'Boston', 'MA', 'No', 'No', 'No', '(603) 714-97', '[email protected]', '', '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', 'Volunteer', '0000-00-00 00:00:00', '0000-00-00', 0, 0, 0, 0, 'Yes', '', ''), (84462221, 'Jessica', 'Ilaria', 'F', 2017, 'MCAS', 'Political Science', 'Medical Humanities', 'Zionsville', 'IN', 'No', 'No', 'No', '317-260-8840', '[email protected]', '2150/New Dorm', '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', 'Outreach/HS Visits Coordinator', '2016-07-28 23:19:22', '2016-07-28', 0, 0, 0, 0, 'Yes', '', ''), (84508817, 'Katie', 'Tisinger', 'F', 2018, 'CSOM', 'Marketing and Information Systems', 'Faith, Peace, and Justice', 'Carrollton', 'GA', 'No', 'No', 'No', '(770) 842-75', '[email protected]', '', '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', 'Volunteer', '0000-00-00 00:00:00', '0000-00-00', 0, 0, 0, 0, 'Yes', '', ''), (85718351, 'Brittney', 'Bentivegna', 'F', 2017, 'CSON', 'Nursing', '', 'Fairfield', 'CT', 'No', 'No', 'No', '2037671634', '[email protected]', '', '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', 'Volunteer', '0000-00-00 00:00:00', '0000-00-00', 0, 0, 0, 0, 'Yes', '', ''), (86000815, 'Erica', 'Ursin-Smith', 'F', 2017, 'MCAS', 'Economics and English', '', 'Pacific Palisades', 'CA', 'No', 'No', 'No', '(415) 948-46', '[email protected]', '', '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', 'Volunteer', '0000-00-00 00:00:00', '0000-00-00', 0, 0, 0, 0, 'Yes', '', ''), (86647814, 'Avita', 'Anand', 'F', 2019, 'MCAS', 'International Studies', 'Business Law, Gender Studies', 'Dallas', 'TX', 'No', 'Yes', 'No', '9725679272', '[email protected]', '', '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', 'Volunteer', '0000-00-00 00:00:00', '0000-00-00', 0, 0, 0, 0, 'Yes', '', ''), (89489351, 'Meagan', 'Gonzalez', 'F', 2017, 'CSOM', 'Finance & Computer Science', '', 'Tampa', 'FL', 'No', 'Yes', 'No', '(813) 928-07', '[email protected]', '', '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', 'Volunteer', '0000-00-00 00:00:00', '0000-00-00', 0, 0, 0, 0, 'Yes', '', ''), (89526734, 'Alexis', 'Iderman', 'F', 2018, 'CSOM', 'Finance and Operations Management', 'French and Hispanic Studies', 'Bethesda', 'MD', 'No', 'No', 'No', '(240)515-854', '[email protected]', '', '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', 'Volunteer', '0000-00-00 00:00:00', '0000-00-00', 0, 0, 0, 0, 'Yes', '', ''); -- -------------------------------------------------------- -- -- Table structure for table `User_Audit` -- CREATE TABLE `User_Audit` ( `audit_id` int(10) NOT NULL, `field` varchar(15) NOT NULL, `old_value` varchar(100) NOT NULL, `new_value` varchar(100) NOT NULL, `updated` datetime NOT NULL, `updated_by` int(8) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Indexes for dumped tables -- -- -- Indexes for table `Attendance` -- ALTER TABLE `Attendance` ADD PRIMARY KEY (`attendance_id`); -- -- Indexes for table `Council` -- ALTER TABLE `Council` ADD PRIMARY KEY (`council_id`); -- -- Indexes for table `Council_Members` -- ALTER TABLE `Council_Members` ADD PRIMARY KEY (`council_member_id`); -- -- Indexes for table `Groups` -- ALTER TABLE `Groups` ADD PRIMARY KEY (`group_id`); -- -- Indexes for table `Group_Members` -- ALTER TABLE `Group_Members` ADD PRIMARY KEY (`group_member_id`); -- -- Indexes for table `Notes` -- ALTER TABLE `Notes` ADD PRIMARY KEY (`note_id`); -- -- Indexes for table `Programming_Weeks` -- ALTER TABLE `Programming_Weeks` ADD PRIMARY KEY (`week_id`); -- -- Indexes for table `Programs` -- ALTER TABLE `Programs` ADD PRIMARY KEY (`program_id`); -- -- Indexes for table `Program_Members` -- ALTER TABLE `Program_Members` ADD PRIMARY KEY (`member_id`); -- -- Indexes for table `Users` -- ALTER TABLE `Users` ADD PRIMARY KEY (`eagle_id`); -- -- Indexes for table `User_Audit` -- ALTER TABLE `User_Audit` ADD PRIMARY KEY (`audit_id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `Attendance` -- ALTER TABLE `Attendance` MODIFY `attendance_id` int(10) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=89; -- -- AUTO_INCREMENT for table `Council` -- ALTER TABLE `Council` MODIFY `council_id` int(10) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=2; -- -- AUTO_INCREMENT for table `Council_Members` -- ALTER TABLE `Council_Members` MODIFY `council_member_id` int(10) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=15; -- -- AUTO_INCREMENT for table `Groups` -- ALTER TABLE `Groups` MODIFY `group_id` int(10) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=5; -- -- AUTO_INCREMENT for table `Group_Members` -- ALTER TABLE `Group_Members` MODIFY `group_member_id` int(10) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=113; -- -- AUTO_INCREMENT for table `Notes` -- ALTER TABLE `Notes` MODIFY `note_id` int(10) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `Programming_Weeks` -- ALTER TABLE `Programming_Weeks` MODIFY `week_id` int(10) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=6; -- -- AUTO_INCREMENT for table `Programs` -- ALTER TABLE `Programs` MODIFY `program_id` int(10) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=2; -- -- AUTO_INCREMENT for table `Program_Members` -- ALTER TABLE `Program_Members` MODIFY `member_id` int(10) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=179; -- -- AUTO_INCREMENT for table `User_Audit` -- ALTER TABLE `User_Audit` MODIFY `audit_id` int(10) NOT NULL AUTO_INCREMENT;
apache-2.0
venukb/any23
any23-core/src/test/java/org/deri/any23/extractor/html/HRecipeExtractorTest.java
1895
package org.deri.any23.extractor.html; import org.deri.any23.extractor.ExtractorFactory; import org.deri.any23.vocab.HRECIPE; import org.deri.any23.vocab.SINDICE; import org.junit.Test; import org.openrdf.model.Value; import org.openrdf.model.vocabulary.RDF; import org.openrdf.repository.RepositoryException; /** * Test case for {@link HRecipeExtractor}. * * @author Michele Mostarda ([email protected]) */ public class HRecipeExtractorTest extends AbstractExtractorTestCase { private static final SINDICE vSINDICE = SINDICE.getInstance(); private static final HRECIPE vHRECIPE = HRECIPE.getInstance(); @Override protected ExtractorFactory<?> getExtractorFactory() { return HRecipeExtractor.factory; } @Test public void testNoMicroformats() throws RepositoryException { assertExtracts("html/html-without-uf.html"); assertModelEmpty(); } @Test public void testExtraction() throws RepositoryException { assertExtracts("microformats/hrecipe/01-spec.html"); assertModelNotEmpty(); assertStatementsSize(RDF.TYPE, vHRECIPE.Recipe , 1); assertStatementsSize(RDF.TYPE, vHRECIPE.Ingredient, 3); assertStatementsSize(RDF.TYPE, vHRECIPE.Duration , 2); assertStatementsSize(RDF.TYPE, vHRECIPE.Nutrition , 2); assertStatementsSize(vHRECIPE.fn, (String) null, 1); assertStatementsSize(vHRECIPE.yield, (String) null, 1); assertStatementsSize(vHRECIPE.instructions, (String) null, 1); assertStatementsSize(vHRECIPE.photo, (String) null, 1); assertStatementsSize(vHRECIPE.summary, (String) null, 1); assertStatementsSize(vHRECIPE.author, (String) null, 2); assertStatementsSize(vHRECIPE.published, (String) null, 1); assertStatementsSize(vHRECIPE.tag, (String) null, 2); } }
apache-2.0
xingwu1/azure-sdk-for-node
lib/services/hdInsightManagement/lib/models/clusterMonitoringRequest.js
1464
/* * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for * license information. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is * regenerated. */ 'use strict'; /** * The Operations Management Suite (OMS) parameters. * */ class ClusterMonitoringRequest { /** * Create a ClusterMonitoringRequest. * @property {string} [workspaceId] The Operations Management Suite (OMS) * workspace ID. * @property {string} [primaryKey] The Operations Management Suite (OMS) * workspace key. */ constructor() { } /** * Defines the metadata of ClusterMonitoringRequest * * @returns {object} metadata of ClusterMonitoringRequest * */ mapper() { return { required: false, serializedName: 'ClusterMonitoringRequest', type: { name: 'Composite', className: 'ClusterMonitoringRequest', modelProperties: { workspaceId: { required: false, serializedName: 'workspaceId', type: { name: 'String' } }, primaryKey: { required: false, serializedName: 'primaryKey', type: { name: 'String' } } } } }; } } module.exports = ClusterMonitoringRequest;
apache-2.0
spyhunter99/mil-sym-android
renderer/src/main/java/armyc2/c2sd/renderer/utilities/SinglePointLookupInfo.java
2634
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package armyc2.c2sd.renderer.utilities; /** * * @author michael.spinelli */ public class SinglePointLookupInfo { private String _SymbolID = ""; private String _Description = ""; private int _mappingP = 0; private int _mappingA = 0; private int _height = 0; private int _width = 0; public SinglePointLookupInfo(String basicSymbolID, String description, String mappingP, String mappingA,String width,String height) { _SymbolID = basicSymbolID; _Description = description; if(mappingP != null && mappingP.equals("") == false) _mappingP = Integer.valueOf(mappingP); if(mappingA != null && mappingA.equals("") == false) _mappingA = Integer.valueOf(mappingA); if(height != null && height.equals("") == false) _height = Integer.valueOf(height); if(width != null && width.equals("") == false) _width = Integer.valueOf(width); } public String getBasicSymbolID() { return _SymbolID; } public String getDescription() { return _Description; } public int getMappingP() { return _mappingP; } public int getMappingA() { return _mappingA; } public int getHeight() { return _height; } public int getWidth() { return _width; } /** * * @return The newly cloned SPSymbolDef */ @Override public SinglePointLookupInfo clone() { SinglePointLookupInfo defReturn; defReturn = new SinglePointLookupInfo(_SymbolID, _Description, String.valueOf(getMappingP()), String.valueOf(getMappingA()), String.valueOf(getWidth()), String.valueOf(getHeight())); return defReturn; } public String toXML() { String symbolId = "<SYMBOLID>" + getBasicSymbolID() + "</SYMBOLID>"; String mappingP = "<MAPPINGP>" + String.valueOf(getMappingP()) + "</MAPPINGP>"; String mappingA = "<MAPPINGA>" + String.valueOf(getMappingA()) + "</MAPPINGA>"; String description = "<DESCRIPTION>" + getDescription() + "</DESCRIPTION>"; String width = "<WIDTH>" + String.valueOf(getWidth()) + "</WIDTH>"; String height = "<HEIGHT>" + String.valueOf(getHeight()) + "</HEIGHT>"; String xml = symbolId + mappingP + mappingA + description + width + height; return xml; } }
apache-2.0
cedricbellet/lighthouse
lighthouse-core/test/audits/dobetterweb/external-anchors-use-rel-noopener-test.js
2145
/** * Copyright 2016 Google Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ 'use strict'; const ExternalAnchorsAudit = require('../../../audits/dobetterweb/external-anchors-use-rel-noopener.js'); const assert = require('assert'); const URL = 'https://google.com/test'; /* eslint-env mocha */ describe('External anchors use rel="noopener"', () => { it('passes when links are from same hosts as the page host', () => { const auditResult = ExternalAnchorsAudit.audit({ AnchorsWithNoRelNoopener: [ {href: 'https://google.com/test'}, {href: 'https://google.com/test1'} ], URL: {finalUrl: URL}, }); assert.equal(auditResult.rawValue, true); assert.equal(auditResult.extendedInfo.value.length, 0); }); it('fails when links are from different hosts than the page host', () => { const auditResult = ExternalAnchorsAudit.audit({ AnchorsWithNoRelNoopener: [ {href: 'https://example.com/test'}, {href: 'https://example.com/test1'} ], URL: {finalUrl: URL}, }); assert.equal(auditResult.rawValue, false); assert.equal(auditResult.extendedInfo.value.length, 2); }); it('handles links with no href attribute', () => { const auditResult = ExternalAnchorsAudit.audit({ AnchorsWithNoRelNoopener: [ {href: ''}, {href: 'http://'}, {href: 'http:'} ], URL: {finalUrl: URL}, }); assert.equal(auditResult.rawValue, false); assert.equal(auditResult.extendedInfo.value.length, 3); assert.ok(auditResult.debugString, 'includes debugString'); }); });
apache-2.0
alien4cloud/alien4cloud
alien4cloud-core/src/main/java/org/alien4cloud/alm/deployment/configuration/services/LocalDeploymentConfigurationRepositoryCleaner.java
1050
package org.alien4cloud.alm.deployment.configuration.services; import javax.inject.Inject; import org.alien4cloud.alm.events.BeforeApplicationEnvironmentDeleted; import org.alien4cloud.alm.events.BeforeApplicationTopologyVersionDeleted; import org.springframework.context.event.EventListener; import org.springframework.stereotype.Component; /** * Clean local git repository when environment or topology is deleted */ @Component public class LocalDeploymentConfigurationRepositoryCleaner { @Inject private DeploymentConfigurationDao deploymentConfigurationDao; @EventListener public void handleDeleteTopologyVersion(BeforeApplicationTopologyVersionDeleted event) { deploymentConfigurationDao.deleteAllByTopologyVersionId(event.getApplicationId(), event.getTopologyVersion()); } @EventListener public void handleDeleteEnvironment(BeforeApplicationEnvironmentDeleted event) { deploymentConfigurationDao.deleteAllByEnvironmentId(event.getApplicationId(), event.getApplicationEnvironmentId()); } }
apache-2.0
huahuajjh/ppx
src/extensions/oauth/qq.php
11607
<?php /* * user_info */ function get_user_info($config, $oauth_data) { $aConfig = array ( 'appid' => $config['appid'], 'appkey' => $config['appkey'], 'api' => 'get_user_info,add_topic,add_one_blog,add_album,upload_pic,list_album,add_share,check_page_fans,add_t,add_pic_t,del_t,get_repost_list,get_info,get_other_info,get_fanslist,get_idollist,add_idol,del_idol,get_tenpay_addr' ); $sUrl = "https://graph.qq.com/user/get_user_info"; $aGetParam = array( "access_token" => $oauth_data["access_token"], "oauth_consumer_key" => $aConfig["appid"], "openid" => $oauth_data["oauth_openid"], "format" => "json" ); $sContent = get($sUrl, $aGetParam); if($sContent!==FALSE){ $user = json_decode($sContent, true); return array("name"=>$user["nickname"], "avatar"=>$user["figureurl_1"]); } } /* * Logout */ function oauth_logout() { unset($_SESSION["state"]); unset($_SESSION["URI"]); $session = new session(); $session->delete('oauth_data'); } /* * Login */ function oauth_login($config) { if (!function_exists("curl_init")) { echo "<h1>腾讯开放平台提示:请先开启curl支持</h1>"; echo " 开启php curl函数库的步骤(for windows)<br /> 1).去掉windows/php.ini 文件里;extension=php_curl.dll前面的; /*用 echo phpinfo();查看php.ini的路径*/<br /> 2).把php5/libeay32.dll,ssleay32.dll复制到系统目录windows/下<br /> 3).重启apache<br /> "; exit(); } $aConfig = array ( 'appid' => $config['appid'], 'appkey' => $config['appkey'], 'api' => 'get_user_info,add_topic,add_one_blog,add_album,upload_pic,list_album,add_share,check_page_fans,add_t,add_pic_t,del_t,get_repost_list,get_info,get_other_info,get_fanslist,get_idollist,add_idol,del_idol,get_tenpay_addr' ); $sState = md5(date('YmdHis' . getip())); $_SESSION['state'] = $sState; $server_name = strtolower($_SERVER['SERVER_NAME']); $server_port = ($_SERVER['SERVER_PORT'] == '80') ? '' : ':' . (int)$_SERVER['SERVER_PORT']; $secure = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 1 : 0; $callback = ($secure ? 'https://' : 'http://') . $server_name . $server_port; $callback = $callback . url('member/register/callback', array('app'=>'qq')); $_SESSION['URI'] = $callback; $aParam = array( "response_type" => 'code', "client_id" => $aConfig["appid"], "redirect_uri" => $callback, "scope" => $aConfig["api"], "state" => $sState ); $aGet = array(); foreach($aParam as $key=>$val){ $aGet[] = $key . '=' . urlencode($val); } $sUrl = "https://graph.qq.com/oauth2.0/authorize?"; $sUrl .= join("&", $aGet); header("location:" . $sUrl); } /* * callback */ function oauth_callback($config) { $aConfig = array ( 'appid' => $config['appid'], 'appkey' => $config['appkey'], 'api' => 'get_user_info,add_topic,add_one_blog,add_album,upload_pic,list_album,add_share,check_page_fans,add_t,add_pic_t,del_t,get_repost_list,get_info,get_other_info,get_fanslist,get_idollist,add_idol,del_idol,get_tenpay_addr' ); $sUrl = "https://graph.qq.com/oauth2.0/token"; $aGetParam = array( "grant_type" => "authorization_code", "client_id" => $aConfig["appid"], "client_secret" => $aConfig["appkey"], "code" => $_GET["code"], "state" => $_GET["state"], "redirect_uri" => $_SESSION["URI"] ); unset($_SESSION["state"]); unset($_SESSION["URI"]); $sContent = get($sUrl,$aGetParam); if($sContent!==FALSE){ $aTemp = explode("&", $sContent); $aParam = $oauth_data = array(); foreach($aTemp as $val){ $aTemp2 = explode("=", $val); $aParam[$aTemp2[0]] = $aTemp2[1]; } $oauth_data["access_token"] = $aParam["access_token"]; $sUrl = "https://graph.qq.com/oauth2.0/me"; $aGetParam = array( "access_token" => $aParam["access_token"] ); $sContent = get($sUrl, $aGetParam); if($sContent!==FALSE){ $aTemp = array(); preg_match('/callback\(\s+(.*?)\s+\)/i', $sContent,$aTemp); $aResult = json_decode($aTemp[1],true); $session = new session(); $oauth_data['oauth_openid'] = $aResult["openid"]; $session->set('oauth_data', $oauth_data); } } } /* * 获取IP */ function getip() { if (isset ( $_SERVER )) { if (isset ( $_SERVER ['HTTP_X_FORWARDED_FOR'] )) { $aIps = explode ( ',', $_SERVER ['HTTP_X_FORWARDED_FOR'] ); foreach ( $aIps as $sIp ) { $sIp = trim ( $sIp ); if ($sIp != 'unknown') { $sRealIp = $sIp; break; } } } elseif (isset ( $_SERVER ['HTTP_CLIENT_IP'] )) { $sRealIp = $_SERVER ['HTTP_CLIENT_IP']; } else { if (isset ( $_SERVER ['REMOTE_ADDR'] )) { $sRealIp = $_SERVER ['REMOTE_ADDR']; } else { $sRealIp = '0.0.0.0'; } } } else { if (getenv ( 'HTTP_X_FORWARDED_FOR' )) { $sRealIp = getenv ( 'HTTP_X_FORWARDED_FOR' ); } elseif (getenv ( 'HTTP_CLIENT_IP' )) { $sRealIp = getenv ( 'HTTP_CLIENT_IP' ); } else { $sRealIp = getenv ( 'REMOTE_ADDR' ); } } return $sRealIp; } /* * GET请求 */ function get($sUrl,$aGetParam){ global $aConfig; $oCurl = curl_init(); if(stripos($sUrl,"https://")!==FALSE){ curl_setopt($oCurl, CURLOPT_SSL_VERIFYPEER, FALSE); curl_setopt($oCurl, CURLOPT_SSL_VERIFYHOST, FALSE); } $aGet = array(); foreach($aGetParam as $key=>$val){ $aGet[] = $key."=".urlencode($val); } curl_setopt($oCurl, CURLOPT_URL, $sUrl."?".join("&",$aGet)); curl_setopt($oCurl, CURLOPT_RETURNTRANSFER, 1 ); $sContent = curl_exec($oCurl); $aStatus = curl_getinfo($oCurl); curl_close($oCurl); if(intval($aConfig["debug"])===1){ echo "<tr><td class='narrow-label'>请求地址:</td><td><pre>".$sUrl."</pre></td></tr>"; echo "<tr><td class='narrow-label'>GET参数:</td><td><pre>".var_export($aGetParam,true)."</pre></td></tr>"; echo "<tr><td class='narrow-label'>请求信息:</td><td><pre>".var_export($aStatus,true)."</pre></td></tr>"; if(intval($aStatus["http_code"])==200){ echo "<tr><td class='narrow-label'>返回结果:</td><td><pre>".$sContent."</pre></td></tr>"; if((@$aResult = json_decode($sContent,true))){ echo "<tr><td class='narrow-label'>结果集合解析:</td><td><pre>".var_export($aResult,true)."</pre></td></tr>"; } } } if(intval($aStatus["http_code"])==200){ return $sContent; }else{ echo "<tr><td class='narrow-label'>返回出错:</td><td><pre>".$aStatus["http_code"].",请检查参数或者确实是腾讯服务器出错咯。</pre></td></tr>"; return FALSE; } } /* * POST 请求 */ function post($sUrl,$aPOSTParam){ global $aConfig; $oCurl = curl_init(); if(stripos($sUrl,"https://")!==FALSE){ curl_setopt($oCurl, CURLOPT_SSL_VERIFYPEER, FALSE); curl_setopt($oCurl, CURLOPT_SSL_VERIFYHOST, false); } $aPOST = array(); foreach($aPOSTParam as $key=>$val){ $aPOST[] = $key."=".urlencode($val); } curl_setopt($oCurl, CURLOPT_URL, $sUrl); curl_setopt($oCurl, CURLOPT_RETURNTRANSFER, 1 ); curl_setopt($oCurl, CURLOPT_POST,true); curl_setopt($oCurl, CURLOPT_POSTFIELDS, join("&", $aPOST)); $sContent = curl_exec($oCurl); $aStatus = curl_getinfo($oCurl); curl_close($oCurl); if(intval($aConfig["debug"])===1){ echo "<tr><td class='narrow-label'>请求地址:</td><td><pre>".$sUrl."</pre></td></tr>"; echo "<tr><td class='narrow-label'>POST参数:</td><td><pre>".var_export($aPOSTParam,true)."</pre></td></tr>"; echo "<tr><td class='narrow-label'>请求信息:</td><td><pre>".var_export($aStatus,true)."</pre></td></tr>"; if(intval($aStatus["http_code"])==200){ echo "<tr><td class='narrow-label'>返回结果:</td><td><pre>".$sContent."</pre></td></tr>"; if((@$aResult = json_decode($sContent,true))){ echo "<tr><td class='narrow-label'>结果集合解析:</td><td><pre>".var_export($aResult,true)."</pre></td></tr>"; } } } if(intval($aStatus["http_code"])==200){ return $sContent; }else{ echo "<tr><td class='narrow-label'>返回出错:</td><td><pre>".$aStatus["http_code"].",请检查参数或者确实是腾讯服务器出错咯。</pre></td></tr>"; return FALSE; } } /* * 上传图片 */ function upload($sUrl,$aPOSTParam,$aFileParam){ //防止请求超时 global $aConfig; set_time_limit(0); $oCurl = curl_init(); if(stripos($sUrl,"https://")!==FALSE){ curl_setopt($oCurl, CURLOPT_SSL_VERIFYPEER, FALSE); curl_setopt($oCurl, CURLOPT_SSL_VERIFYHOST, false); } $aPOSTField = array(); foreach($aPOSTParam as $key=>$val){ $aPOSTField[$key]= $val; } foreach($aFileParam as $key=>$val){ $aPOSTField[$key] = "@".$val; //此处对应的是文件的绝对地址 } curl_setopt($oCurl, CURLOPT_URL, $sUrl); curl_setopt($oCurl, CURLOPT_POST, true); curl_setopt($oCurl, CURLOPT_RETURNTRANSFER, 1 ); curl_setopt($oCurl, CURLOPT_POSTFIELDS, $aPOSTField); $sContent = curl_exec($oCurl); $aStatus = curl_getinfo($oCurl); curl_close($oCurl); if(intval($aConfig["debug"])===1){ echo "<tr><td class='narrow-label'>请求地址:</td><td><pre>".$sUrl."</pre></td></tr>"; echo "<tr><td class='narrow-label'>POST参数:</td><td><pre>".var_export($aPOSTParam,true)."</pre></td></tr>"; echo "<tr><td class='narrow-label'>文件参数:</td><td><pre>".var_export($aFileParam,true)."</pre></td></tr>"; echo "<tr><td class='narrow-label'>请求信息:</td><td><pre>".var_export($aStatus,true)."</pre></td></tr>"; if(intval($aStatus["http_code"])==200){ echo "<tr><td class='narrow-label'>返回结果:</td><td><pre>".$sContent."</pre></td></tr>"; if((@$aResult = json_decode($sContent,true))){ echo "<tr><td class='narrow-label'>结果集合解析:</td><td><pre>".var_export($aResult,true)."</pre></td></tr>"; } } } if(intval($aStatus["http_code"])==200){ return $sContent; }else{ echo "<tr><td class='narrow-label'>返回出错:</td><td><pre>".$aStatus["http_code"].",请检查参数或者确实是腾讯服务器出错咯。</pre></td></tr>"; return FALSE; } } function download($sUrl,$sFileName){ $oCurl = curl_init(); global $aConfig; set_time_limit(0); $oCurl = curl_init(); if(stripos($sUrl,"https://")!==FALSE){ curl_setopt($oCurl, CURLOPT_SSL_VERIFYPEER, FALSE); curl_setopt($oCurl, CURLOPT_SSL_VERIFYHOST, false); } curl_setopt($oCurl, CURLOPT_USERAGENT, $_SERVER["USER_AGENT"] ? $_SERVER["USER_AGENT"] : "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.7) Gecko/20100625 Firefox/3.6.7"); curl_setopt($oCurl, CURLOPT_URL, $sUrl); curl_setopt($oCurl, CURLOPT_REFERER, $sUrl); curl_setopt($oCurl, CURLOPT_AUTOREFERER, true); curl_setopt($oCurl, CURLOPT_RETURNTRANSFER, 1 ); $sContent = curl_exec($oCurl); $aStatus = curl_getinfo($oCurl); curl_close($oCurl); file_put_contents($sFileName,$sContent); if(intval($aConfig["debug"])===1){ echo "<tr><td class='narrow-label'>请求地址:</td><td><pre>".$sUrl."</pre></td></tr>"; echo "<tr><td class='narrow-label'>请求信息:</td><td><pre>".var_export($aStatus,true)."</pre></td></tr>"; } return(intval($aStatus["http_code"])==200); }
apache-2.0
devjin24/howtomcatworks
bookrefer/jakarta-tomcat-5.0.18-src/jakarta-servletapi-5/jsr154/src/share/javax/servlet/http/HttpServletRequest.java
20909
/* * The Apache Software License, Version 1.1 * * Copyright (c) 1999 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * 3. The end-user documentation included with the redistribution, if * any, must include the following acknowlegement: * "This product includes software developed by the * Apache Software Foundation (http://www.apache.org/)." * Alternately, this acknowlegement may appear in the software itself, * if and wherever such third-party acknowlegements normally appear. * * 4. The names "The Jakarta Project", "Tomcat", and "Apache Software * Foundation" must not be used to endorse or promote products derived * from this software without prior written permission. For written * permission, please contact [email protected]. * * 5. Products derived from this software may not be called "Apache" * nor may "Apache" appear in their names without prior written * permission of the Apache Group. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * ==================================================================== * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * <http://www.apache.org/>. * * ==================================================================== * * This source code implements specifications defined by the Java * Community Process. In order to remain compliant with the specification * DO NOT add / change / or delete method signatures! */ package javax.servlet.http; import javax.servlet.ServletRequest; import java.util.Enumeration; /** * * Extends the {@link javax.servlet.ServletRequest} interface * to provide request information for HTTP servlets. * * <p>The servlet container creates an <code>HttpServletRequest</code> * object and passes it as an argument to the servlet's service * methods (<code>doGet</code>, <code>doPost</code>, etc). * * * @author Various * @version $Version$ * * */ public interface HttpServletRequest extends ServletRequest { /** * String identifier for Basic authentication. Value "BASIC" */ public static final String BASIC_AUTH = "BASIC"; /** * String identifier for Form authentication. Value "FORM" */ public static final String FORM_AUTH = "FORM"; /** * String identifier for Client Certificate authentication. Value "CLIENT_CERT" */ public static final String CLIENT_CERT_AUTH = "CLIENT_CERT"; /** * String identifier for Digest authentication. Value "DIGEST" */ public static final String DIGEST_AUTH = "DIGEST"; /** * Returns the name of the authentication scheme used to protect * the servlet. All servlet containers support basic, form and client * certificate authentication, and may additionally support digest * authentication. * If the servlet is not authenticated <code>null</code> is returned. * * <p>Same as the value of the CGI variable AUTH_TYPE. * * * @return one of the static members BASIC_AUTH, * FORM_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH * (suitable for == comparison) or * the container-specific string indicating * the authentication scheme, or * <code>null</code> if the request was * not authenticated. * */ public String getAuthType(); /** * * Returns an array containing all of the <code>Cookie</code> * objects the client sent with this request. * This method returns <code>null</code> if no cookies were sent. * * @return an array of all the <code>Cookies</code> * included with this request, or <code>null</code> * if the request has no cookies * * */ public Cookie[] getCookies(); /** * * Returns the value of the specified request header * as a <code>long</code> value that represents a * <code>Date</code> object. Use this method with * headers that contain dates, such as * <code>If-Modified-Since</code>. * * <p>The date is returned as * the number of milliseconds since January 1, 1970 GMT. * The header name is case insensitive. * * <p>If the request did not have a header of the * specified name, this method returns -1. If the header * can't be converted to a date, the method throws * an <code>IllegalArgumentException</code>. * * @param name a <code>String</code> specifying the * name of the header * * @return a <code>long</code> value * representing the date specified * in the header expressed as * the number of milliseconds * since January 1, 1970 GMT, * or -1 if the named header * was not included with the * request * * @exception IllegalArgumentException If the header value * can't be converted * to a date * */ public long getDateHeader(String name); /** * * Returns the value of the specified request header * as a <code>String</code>. If the request did not include a header * of the specified name, this method returns <code>null</code>. * If there are multiple headers with the same name, this method * returns the first head in the request. * The header name is case insensitive. You can use * this method with any request header. * * @param name a <code>String</code> specifying the * header name * * @return a <code>String</code> containing the * value of the requested * header, or <code>null</code> * if the request does not * have a header of that name * */ public String getHeader(String name); /** * * Returns all the values of the specified request header * as an <code>Enumeration</code> of <code>String</code> objects. * * <p>Some headers, such as <code>Accept-Language</code> can be sent * by clients as several headers each with a different value rather than * sending the header as a comma separated list. * * <p>If the request did not include any headers * of the specified name, this method returns an empty * <code>Enumeration</code>. * The header name is case insensitive. You can use * this method with any request header. * * @param name a <code>String</code> specifying the * header name * * @return an <code>Enumeration</code> containing * the values of the requested header. If * the request does not have any headers of * that name return an empty * enumeration. If * the container does not allow access to * header information, return null * */ public Enumeration getHeaders(String name); /** * * Returns an enumeration of all the header names * this request contains. If the request has no * headers, this method returns an empty enumeration. * * <p>Some servlet containers do not allow * servlets to access headers using this method, in * which case this method returns <code>null</code> * * @return an enumeration of all the * header names sent with this * request; if the request has * no headers, an empty enumeration; * if the servlet container does not * allow servlets to use this method, * <code>null</code> * * */ public Enumeration getHeaderNames(); /** * * Returns the value of the specified request header * as an <code>int</code>. If the request does not have a header * of the specified name, this method returns -1. If the * header cannot be converted to an integer, this method * throws a <code>NumberFormatException</code>. * * <p>The header name is case insensitive. * * @param name a <code>String</code> specifying the name * of a request header * * @return an integer expressing the value * of the request header or -1 * if the request doesn't have a * header of this name * * @exception NumberFormatException If the header value * can't be converted * to an <code>int</code> */ public int getIntHeader(String name); /** * * Returns the name of the HTTP method with which this * request was made, for example, GET, POST, or PUT. * Same as the value of the CGI variable REQUEST_METHOD. * * @return a <code>String</code> * specifying the name * of the method with which * this request was made * */ public String getMethod(); /** * * Returns any extra path information associated with * the URL the client sent when it made this request. * The extra path information follows the servlet path * but precedes the query string and will start with * a "/" character. * * <p>This method returns <code>null</code> if there * was no extra path information. * * <p>Same as the value of the CGI variable PATH_INFO. * * * @return a <code>String</code>, decoded by the * web container, specifying * extra path information that comes * after the servlet path but before * the query string in the request URL; * or <code>null</code> if the URL does not have * any extra path information * */ public String getPathInfo(); /** * * Returns any extra path information after the servlet name * but before the query string, and translates it to a real * path. Same as the value of the CGI variable PATH_TRANSLATED. * * <p>If the URL does not have any extra path information, * this method returns <code>null</code> or the servlet container * cannot translate the virtual path to a real path for any reason * (such as when the web application is executed from an archive). * * The web container does not decode this string. * * * @return a <code>String</code> specifying the * real path, or <code>null</code> if * the URL does not have any extra path * information * * */ public String getPathTranslated(); /** * * Returns the portion of the request URI that indicates the context * of the request. The context path always comes first in a request * URI. The path starts with a "/" character but does not end with a "/" * character. For servlets in the default (root) context, this method * returns "". The container does not decode this string. * * * @return a <code>String</code> specifying the * portion of the request URI that indicates the context * of the request * * */ public String getContextPath(); /** * * Returns the query string that is contained in the request * URL after the path. This method returns <code>null</code> * if the URL does not have a query string. Same as the value * of the CGI variable QUERY_STRING. * * @return a <code>String</code> containing the query * string or <code>null</code> if the URL * contains no query string. The value is not * decoded by the container. * */ public String getQueryString(); /** * * Returns the login of the user making this request, if the * user has been authenticated, or <code>null</code> if the user * has not been authenticated. * Whether the user name is sent with each subsequent request * depends on the browser and type of authentication. Same as the * value of the CGI variable REMOTE_USER. * * @return a <code>String</code> specifying the login * of the user making this request, or <code>null</code> * if the user login is not known * */ public String getRemoteUser(); /** * * Returns a boolean indicating whether the authenticated user is included * in the specified logical "role". Roles and role membership can be * defined using deployment descriptors. If the user has not been * authenticated, the method returns <code>false</code>. * * @param role a <code>String</code> specifying the name * of the role * * @return a <code>boolean</code> indicating whether * the user making this request belongs to a given role; * <code>false</code> if the user has not been * authenticated * */ public boolean isUserInRole(String role); /** * * Returns a <code>java.security.Principal</code> object containing * the name of the current authenticated user. If the user has not been * authenticated, the method returns <code>null</code>. * * @return a <code>java.security.Principal</code> containing * the name of the user making this request; * <code>null</code> if the user has not been * authenticated * */ public java.security.Principal getUserPrincipal(); /** * * Returns the session ID specified by the client. This may * not be the same as the ID of the current valid session * for this request. * If the client did not specify a session ID, this method returns * <code>null</code>. * * * @return a <code>String</code> specifying the session * ID, or <code>null</code> if the request did * not specify a session ID * * @see #isRequestedSessionIdValid * */ public String getRequestedSessionId(); /** * * Returns the part of this request's URL from the protocol * name up to the query string in the first line of the HTTP request. * The web container does not decode this String. * For example: * * * <table summary="Examples of Returned Values"> * <tr align=left><th>First line of HTTP request </th> * <th> Returned Value</th> * <tr><td>POST /some/path.html HTTP/1.1<td><td>/some/path.html * <tr><td>GET http://foo.bar/a.html HTTP/1.0 * <td><td>/a.html * <tr><td>HEAD /xyz?a=b HTTP/1.1<td><td>/xyz * </table> * * <p>To reconstruct an URL with a scheme and host, use * {@link HttpUtils#getRequestURL}. * * @return a <code>String</code> containing * the part of the URL from the * protocol name up to the query string * * @see HttpUtils#getRequestURL * */ public String getRequestURI(); /** * * Reconstructs the URL the client used to make the request. * The returned URL contains a protocol, server name, port * number, and server path, but it does not include query * string parameters. * * <p>Because this method returns a <code>StringBuffer</code>, * not a string, you can modify the URL easily, for example, * to append query parameters. * * <p>This method is useful for creating redirect messages * and for reporting errors. * * @return a <code>StringBuffer</code> object containing * the reconstructed URL * */ public StringBuffer getRequestURL(); /** * * Returns the part of this request's URL that calls * the servlet. This path starts with a "/" character * and includes either the servlet name or a path to * the servlet, but does not include any extra path * information or a query string. Same as the value of * the CGI variable SCRIPT_NAME. * * <p>This method will return an empty string ("") if the * servlet used to process this request was matched using * the "/*" pattern. * * @return a <code>String</code> containing * the name or path of the servlet being * called, as specified in the request URL, * decoded, or an empty string if the servlet * used to process the request is matched * using the "/*" pattern. * */ public String getServletPath(); /** * * Returns the current <code>HttpSession</code> * associated with this request or, if there is no * current session and <code>create</code> is true, returns * a new session. * * <p>If <code>create</code> is <code>false</code> * and the request has no valid <code>HttpSession</code>, * this method returns <code>null</code>. * * <p>To make sure the session is properly maintained, * you must call this method before * the response is committed. If the container is using cookies * to maintain session integrity and is asked to create a new session * when the response is committed, an IllegalStateException is thrown. * * * * * @param create <code>true</code> to create * a new session for this request if necessary; * <code>false</code> to return <code>null</code> * if there's no current session * * * @return the <code>HttpSession</code> associated * with this request or <code>null</code> if * <code>create</code> is <code>false</code> * and the request has no valid session * * @see #getSession() * * */ public HttpSession getSession(boolean create); /** * * Returns the current session associated with this request, * or if the request does not have a session, creates one. * * @return the <code>HttpSession</code> associated * with this request * * @see #getSession(boolean) * */ public HttpSession getSession(); /** * * Checks whether the requested session ID is still valid. * * @return <code>true</code> if this * request has an id for a valid session * in the current session context; * <code>false</code> otherwise * * @see #getRequestedSessionId * @see #getSession * @see HttpSessionContext * */ public boolean isRequestedSessionIdValid(); /** * * Checks whether the requested session ID came in as a cookie. * * @return <code>true</code> if the session ID * came in as a * cookie; otherwise, <code>false</code> * * * @see #getSession * */ public boolean isRequestedSessionIdFromCookie(); /** * * Checks whether the requested session ID came in as part of the * request URL. * * @return <code>true</code> if the session ID * came in as part of a URL; otherwise, * <code>false</code> * * * @see #getSession * */ public boolean isRequestedSessionIdFromURL(); /** * * @deprecated As of Version 2.1 of the Java Servlet * API, use {@link #isRequestedSessionIdFromURL} * instead. * */ public boolean isRequestedSessionIdFromUrl(); }
apache-2.0
5hawnknight/selenium
java/client/src/org/openqa/selenium/internal/BuildInfo.java
995
// Licensed to the Software Freedom Conservancy (SFC) under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The SFC licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may not use this file except in compliance // with the License. You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, // software distributed under the License is distributed on an // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY // KIND, either express or implied. See the License for the // specific language governing permissions and limitations // under the License. package org.openqa.selenium.internal; /** * @deprecated Use {@link org.openqa.selenium.BuildInfo} instead. */ @Deprecated public class BuildInfo extends org.openqa.selenium.BuildInfo { }
apache-2.0
dhermes/google-cloud-python
dataproc/google/cloud/dataproc_v1beta2/gapic/transports/workflow_template_service_grpc_transport.py
8646
# -*- coding: utf-8 -*- # # Copyright 2018 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://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. import google.api_core.grpc_helpers import google.api_core.operations_v1 from google.cloud.dataproc_v1beta2.proto import workflow_templates_pb2_grpc class WorkflowTemplateServiceGrpcTransport(object): """gRPC transport class providing stubs for google.cloud.dataproc.v1beta2 WorkflowTemplateService API. The transport provides access to the raw gRPC stubs, which can be used to take advantage of advanced features of gRPC. """ # The scopes needed to make gRPC calls to all of the methods defined # in this service. _OAUTH_SCOPES = ("https://www.googleapis.com/auth/cloud-platform",) def __init__( self, channel=None, credentials=None, address="dataproc.googleapis.com:443" ): """Instantiate the transport class. Args: channel (grpc.Channel): A ``Channel`` instance through which to make calls. This argument is mutually exclusive with ``credentials``; providing both will raise an exception. credentials (google.auth.credentials.Credentials): The authorization credentials to attach to requests. These credentials identify this application to the service. If none are specified, the client will attempt to ascertain the credentials from the environment. address (str): The address where the service is hosted. """ # If both `channel` and `credentials` are specified, raise an # exception (channels come with credentials baked in already). if channel is not None and credentials is not None: raise ValueError( "The `channel` and `credentials` arguments are mutually " "exclusive." ) # Create the channel. if channel is None: channel = self.create_channel(address=address, credentials=credentials) self._channel = channel # gRPC uses objects called "stubs" that are bound to the # channel and provide a basic method for each RPC. self._stubs = { "workflow_template_service_stub": workflow_templates_pb2_grpc.WorkflowTemplateServiceStub( channel ) } # Because this API includes a method that returns a # long-running operation (proto: google.longrunning.Operation), # instantiate an LRO client. self._operations_client = google.api_core.operations_v1.OperationsClient( channel ) @classmethod def create_channel(cls, address="dataproc.googleapis.com:443", credentials=None): """Create and return a gRPC channel object. Args: address (str): The host for the channel to use. credentials (~.Credentials): The authorization credentials to attach to requests. These credentials identify this application to the service. If none are specified, the client will attempt to ascertain the credentials from the environment. Returns: grpc.Channel: A gRPC channel object. """ return google.api_core.grpc_helpers.create_channel( address, credentials=credentials, scopes=cls._OAUTH_SCOPES ) @property def channel(self): """The gRPC channel used by the transport. Returns: grpc.Channel: A gRPC channel object. """ return self._channel @property def create_workflow_template(self): """Return the gRPC stub for {$apiMethod.name}. Creates new workflow template. Returns: Callable: A callable which accepts the appropriate deserialized request object and returns a deserialized response object. """ return self._stubs["workflow_template_service_stub"].CreateWorkflowTemplate @property def get_workflow_template(self): """Return the gRPC stub for {$apiMethod.name}. Retrieves the latest workflow template. Can retrieve previously instantiated template by specifying optional version parameter. Returns: Callable: A callable which accepts the appropriate deserialized request object and returns a deserialized response object. """ return self._stubs["workflow_template_service_stub"].GetWorkflowTemplate @property def instantiate_workflow_template(self): """Return the gRPC stub for {$apiMethod.name}. Instantiates a template and begins execution. The returned Operation can be used to track execution of workflow by polling ``operations.get``. The Operation will complete when entire workflow is finished. The running workflow can be aborted via ``operations.cancel``. This will cause any inflight jobs to be cancelled and workflow-owned clusters to be deleted. The ``Operation.metadata`` will be ``WorkflowMetadata``. On successful completion, ``Operation.response`` will be ``Empty``. Returns: Callable: A callable which accepts the appropriate deserialized request object and returns a deserialized response object. """ return self._stubs["workflow_template_service_stub"].InstantiateWorkflowTemplate @property def instantiate_inline_workflow_template(self): """Return the gRPC stub for {$apiMethod.name}. Instantiates a template and begins execution. This method is equivalent to executing the sequence ``CreateWorkflowTemplate``, ``InstantiateWorkflowTemplate``, ``DeleteWorkflowTemplate``. The returned Operation can be used to track execution of workflow by polling ``operations.get``. The Operation will complete when entire workflow is finished. The running workflow can be aborted via ``operations.cancel``. This will cause any inflight jobs to be cancelled and workflow-owned clusters to be deleted. The ``Operation.metadata`` will be ``WorkflowMetadata``. On successful completion, ``Operation.response`` will be ``Empty``. Returns: Callable: A callable which accepts the appropriate deserialized request object and returns a deserialized response object. """ return self._stubs[ "workflow_template_service_stub" ].InstantiateInlineWorkflowTemplate @property def update_workflow_template(self): """Return the gRPC stub for {$apiMethod.name}. Updates (replaces) workflow template. The updated template must contain version that matches the current server version. Returns: Callable: A callable which accepts the appropriate deserialized request object and returns a deserialized response object. """ return self._stubs["workflow_template_service_stub"].UpdateWorkflowTemplate @property def list_workflow_templates(self): """Return the gRPC stub for {$apiMethod.name}. Lists workflows that match the specified filter in the request. Returns: Callable: A callable which accepts the appropriate deserialized request object and returns a deserialized response object. """ return self._stubs["workflow_template_service_stub"].ListWorkflowTemplates @property def delete_workflow_template(self): """Return the gRPC stub for {$apiMethod.name}. Deletes a workflow template. It does not cancel in-progress workflows. Returns: Callable: A callable which accepts the appropriate deserialized request object and returns a deserialized response object. """ return self._stubs["workflow_template_service_stub"].DeleteWorkflowTemplate
apache-2.0
Kitware/cumulus
tests/cases/fixtures/job/sge_submission_script_gpus.sh
360
#!/bin/sh # _ # | | # ___ _ _ _ __ ___ _ _| |_ _ ___ # / __| | | | '_ ` _ \| | | | | | | / __| # | (__| |_| | | | | | | |_| | | |_| \__ \ # \___|\__,_|_| |_| |_|\__,_|_|\__,_|___/ # # #$ -S /bin/bash #$ -N dummy-123432423 #$ -l gpus=2 cd $SGE_O_WORKDIR ls sleep 20 mpirun -n 1000000 parallel
apache-2.0
wecacuee/modern-occupancy-grid
src/two_assumption_alg.cpp
4475
#include "OccupancyGrid/occgrid.hpp" #include "OccupancyGrid/cvmat_serialization.h" #include <opencv2/opencv.hpp> #include <boost/format.hpp> /// Override class to override is_occupied function so that it can copy the /// ground truth map everytime a laser crosses a cell. template<typename real_t, typename int_t> class OccupancyGrid2DInverseSensor : public OccupancyGrid2D<real_t, int_t> { public: using OccupancyGrid2D<real_t, int_t>::og_; using OccupancyGrid2D<real_t, int_t>::cell_size_; using OccupancyGrid2D<real_t, int_t>::min_pt_; using OccupancyGrid2D<real_t, int_t>::FREE; int_t observed_manh_range_; cv::Vec<int_t, 2> robot_position_; cv::Mat_<real_t> log_odds_map_; const real_t LOG_ODDS_OCCUPIED; const real_t LOG_ODDS_FREE; OccupancyGrid2DInverseSensor(real_t min_x, real_t min_y, real_t cell_size_x, real_t cell_size_y, int_t ncells_x, int_t ncells_y) : OccupancyGrid2D<real_t, int_t>(min_x, min_y, cell_size_x, cell_size_y, ncells_x, ncells_y), observed_manh_range_(), robot_position_(), log_odds_map_(ncells_x, ncells_y, 0.0L), LOG_ODDS_OCCUPIED(1.3863), LOG_ODDS_FREE(-1.3863) { }; void set_up_ray_trace( real_t px, real_t py, real_t ptheta, real_t observed_range) { robot_position_(0) = (int)floor((px - min_pt_(0)) / cell_size_(0)); robot_position_(1) = (int)floor((py - min_pt_(1)) / cell_size_(1)); real_t dx_abs = fabs(cos(ptheta)); real_t dy_abs = fabs(sin(ptheta)); real_t dmag = sqrt(dx_abs * dx_abs + dy_abs * dy_abs); observed_manh_range_ = floor(observed_range * dx_abs / dmag / cell_size_(0)) + floor(observed_range * dy_abs / dmag / cell_size_(1)); //printf("-----------------\n"); } inline int_t manh_distance(int_t i, int_t j) { return std::abs(i - robot_position_(0)) + std::abs(j - robot_position_(1)); } virtual bool is_occupied(int_t i, int_t j) { uint8_t val = og_.ptr(i)[j]; bool retval = (val != FREE); int_t d = manh_distance(i, j); // update step // printf("%d < %d\n", d, observed_manh_range_); log_odds_map_(i, j) += (d < observed_manh_range_) ? LOG_ODDS_FREE : (d == observed_manh_range_) ? LOG_ODDS_OCCUPIED : 0; // unknown return retval; } inline void show(int r) { cv::Mat vis; cv::exp(log_odds_map_, vis); vis = 1 / (1 + vis); vis *= 255; vis.convertTo(vis, CV_8U); cv::imshow("c", vis); //cv::imwrite((boost::format("out-%d.png") % r).str(), vis); cv::waitKey(1); cv::imwrite("/tmp/two_assumption_algo.png", vis); } }; int main(int argc, char** argv) { if (argc != 4) { std::cout << "Sample Usage:" << std::endl; std::cout << "bin/two_assumption_alg Data/player_sim/laser_pose_all.bin Data/player_sim/laser_range_all.bin Data/player_sim/scan_angles_all.bin" << std::endl; exit(1); } cv::Mat laser_pose; loadMat(laser_pose, argv[1]); cv::Mat laser_ranges; loadMat(laser_ranges, argv[2]); cv::Mat scan_angles; loadMat(scan_angles, argv[3]); cv::Vec2d min_pt(-9, -9); cv::Vec2d range = -2 * min_pt; cv::Vec2i gridsize(100, 100); cv::Vec2d cellsize; cv::divide(range, gridsize, cellsize); //std::cout << cellsize(0) << cellsize(1) << std::endl; cv::Vec2i ncells; cv::divide(min_pt, cellsize, ncells, -2); //std::cout << ncells(0) << ncells(1) << std::endl; OccupancyGrid2DInverseSensor<double, int> map( min_pt(0), min_pt(1), cellsize(0), cellsize(1), ncells(0), ncells(1)); double MAX_RANGE = 8; int r; for (r = 0; r < laser_pose.rows; r++) { double* pose = laser_pose.ptr<double>(r); double* ranges = laser_ranges.ptr<double>(r); double* angles = scan_angles.ptr<double>(r); double robot_angle = pose[2]; for (int c = 0; c < scan_angles.cols; c++) { double total_angle = robot_angle + angles[c]; cv::Vec2d final_pos; map.set_up_ray_trace(pose[0], pose[1], total_angle, ranges[c]); bool reflectance; map.ray_trace(pose[0], pose[1], total_angle, MAX_RANGE, final_pos, reflectance); } } map.show(r); }
apache-2.0
bradsokol/migrations
src/main/java/org/apache/ibatis/migration/commands/InfoCommand.java
3217
/** * Copyright 2010-2015 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.ibatis.migration.commands; import java.io.IOException; import java.io.InputStream; import java.io.PrintStream; import java.util.Properties; public final class InfoCommand implements Command { private final PrintStream out; public InfoCommand(PrintStream out) { this.out = out; } public void execute(String... params) { Properties properties = new Properties(); InputStream input = getClass().getClassLoader().getResourceAsStream( "META-INF/maven/org.mybatis/mybatis-migrations/pom.properties"); if (input != null) { try { properties.load(input); } catch (IOException e) { // ignore, just don't load the properties } finally { try { input.close(); } catch (IOException e) { // close quietly } } } out.printf("%s %s (%s)%n", properties.getProperty("name"), properties.getProperty("version"), properties.getProperty("build")); out.printf("Java version: %s, vendor: %s%n", System.getProperty("java.version"), System.getProperty("java.vendor")); out.printf("Java home: %s%n", System.getProperty("java.home")); out.printf("Default locale: %s_%s, platform encoding: %s%n", System.getProperty("user.language"), System.getProperty("user.country"), System.getProperty("sun.jnu.encoding")); out.printf("OS name: \"%s\", version: \"%s\", arch: \"%s\", family: \"%s\"%n", System.getProperty("os.name"), System.getProperty("os.version"), System.getProperty("os.arch"), getOsFamily()); } private static final String getOsFamily() { String osName = System.getProperty("os.name").toLowerCase(); String pathSep = System.getProperty("path.separator"); if (osName.indexOf("windows") != -1) { return "windows"; } else if (osName.indexOf("os/2") != -1) { return "os/2"; } else if (osName.indexOf("z/os") != -1 || osName.indexOf("os/390") != -1) { return "z/os"; } else if (osName.indexOf("os/400") != -1) { return "os/400"; } else if (pathSep.equals(";")) { return "dos"; } else if (osName.indexOf("mac") != -1) { if (osName.endsWith("x")) { return "mac"; // MACOSX } return "unix"; } else if (osName.indexOf("nonstop_kernel") != -1) { return "tandem"; } else if (osName.indexOf("openvms") != -1) { return "openvms"; } else if (pathSep.equals(":")) { return "unix"; } return "undefined"; } }
apache-2.0
argv0/cloudstack
server/src/com/cloud/resource/ResourceManager.java
5753
// Licensed to the Apache Software Foundation (ASF) under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may not use this file except in compliance // with the License. You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, // software distributed under the License is distributed on an // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY // KIND, either express or implied. See the License for the // specific language governing permissions and limitations // under the License. package com.cloud.resource; import java.util.List; import java.util.Map; import java.util.Set; import com.cloud.agent.api.StartupCommand; import com.cloud.agent.api.StartupRoutingCommand; import com.cloud.dc.DataCenterVO; import com.cloud.dc.HostPodVO; import com.cloud.dc.PodCluster; import com.cloud.exception.AgentUnavailableException; import com.cloud.host.Host; import com.cloud.host.Host.Type; import com.cloud.host.HostStats; import com.cloud.host.HostVO; import com.cloud.host.Status; import com.cloud.hypervisor.Hypervisor.HypervisorType; import com.cloud.resource.ResourceState.Event; import com.cloud.service.ServiceOfferingVO; import com.cloud.template.VirtualMachineTemplate; import com.cloud.utils.Pair; import com.cloud.utils.fsm.NoTransitionException; /** * ResourceManager manages how physical resources are organized within the * CloudStack. It also manages the life cycle of the physical resources. */ public interface ResourceManager extends ResourceService{ /** * Register a listener for different types of resource life cycle events. * There can only be one type of listener per type of host. * * @param Event type see ResourceListener.java, allow combination of multiple events. * @param listener the listener to notify. */ public void registerResourceEvent(Integer event, ResourceListener listener); public void unregisterResourceEvent(ResourceListener listener); /** * * @param name of adapter * @param adapter * @param hates, a list of names which will be eliminated by this adapter. Especially for the case where * can be only one adapter responds to an event, e.g. startupCommand */ public void registerResourceStateAdapter(String name, ResourceStateAdapter adapter); public void unregisterResourceStateAdapter(String name); public Host createHostAndAgent(Long hostId, ServerResource resource, Map<String, String> details, boolean old, List<String> hostTags, boolean forRebalance); public Host addHost(long zoneId, ServerResource resource, Type hostType, Map<String, String> hostDetails); public HostVO createHostVOForConnectedAgent(StartupCommand[] cmds); public void checkCIDR(HostPodVO pod, DataCenterVO dc, String serverPrivateIP, String serverPrivateNetmask); public HostVO fillRoutingHostVO(HostVO host, StartupRoutingCommand ssCmd, HypervisorType hyType, Map<String, String> details, List<String> hostTags); public void deleteRoutingHost(HostVO host, boolean isForced, boolean forceDestroyStorage) throws UnableDeleteHostException; public boolean executeUserRequest(long hostId, ResourceState.Event event) throws AgentUnavailableException; boolean resourceStateTransitTo(Host host, Event event, long msId) throws NoTransitionException; boolean umanageHost(long hostId); boolean maintenanceFailed(long hostId); public boolean maintain(final long hostId) throws AgentUnavailableException; @Override public boolean deleteHost(long hostId, boolean isForced, boolean isForceDeleteStorage); public List<HostVO> findDirectlyConnectedHosts(); public List<HostVO> listAllUpAndEnabledHosts(Host.Type type, Long clusterId, Long podId, long dcId); public List<HostVO> listAllHostsInCluster(long clusterId); public List<HostVO> listHostsInClusterByStatus(long clusterId, Status status); public List<HostVO> listAllUpAndEnabledHostsInOneZoneByType(Host.Type type, long dcId); public List<HostVO> listAllHostsInOneZoneByType(Host.Type type, long dcId); public List<HostVO> listAllHostsInAllZonesByType(Type type); public List<HypervisorType> listAvailHypervisorInZone(Long hostId, Long zoneId); public HostVO findHostByGuid(String guid); public HostVO findHostByName(String name); public List<HostVO> listHostsByNameLike(String name); /** * Find a pod based on the user id, template, and data center. * * @param template * @param dc * @param userId * @return */ Pair<HostPodVO, Long> findPod(VirtualMachineTemplate template, ServiceOfferingVO offering, DataCenterVO dc, long accountId, Set<Long> avoids); HostStats getHostStatistics(long hostId); Long getGuestOSCategoryId(long hostId); String getHostTags(long hostId); List<PodCluster> listByDataCenter(long dcId); List<HostVO> listAllNotInMaintenanceHostsInOneZone(Type type, Long dcId); HypervisorType getDefaultHypervisor(long zoneId); HypervisorType getAvailableHypervisor(long zoneId); Discoverer getMatchingDiscover(HypervisorType hypervisorType); List<HostVO> findHostByGuid(long dcId, String guid); /** * @param type * @param clusterId * @param podId * @param dcId * @return */ List<HostVO> listAllUpAndEnabledNonHAHosts(Type type, Long clusterId, Long podId, long dcId); }
apache-2.0
awslabs/aws-sdk-cpp
aws-cpp-sdk-securityhub/source/model/AwsEcsTaskDefinitionInferenceAcceleratorsDetails.cpp
1594
/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #include <aws/securityhub/model/AwsEcsTaskDefinitionInferenceAcceleratorsDetails.h> #include <aws/core/utils/json/JsonSerializer.h> #include <utility> using namespace Aws::Utils::Json; using namespace Aws::Utils; namespace Aws { namespace SecurityHub { namespace Model { AwsEcsTaskDefinitionInferenceAcceleratorsDetails::AwsEcsTaskDefinitionInferenceAcceleratorsDetails() : m_deviceNameHasBeenSet(false), m_deviceTypeHasBeenSet(false) { } AwsEcsTaskDefinitionInferenceAcceleratorsDetails::AwsEcsTaskDefinitionInferenceAcceleratorsDetails(JsonView jsonValue) : m_deviceNameHasBeenSet(false), m_deviceTypeHasBeenSet(false) { *this = jsonValue; } AwsEcsTaskDefinitionInferenceAcceleratorsDetails& AwsEcsTaskDefinitionInferenceAcceleratorsDetails::operator =(JsonView jsonValue) { if(jsonValue.ValueExists("DeviceName")) { m_deviceName = jsonValue.GetString("DeviceName"); m_deviceNameHasBeenSet = true; } if(jsonValue.ValueExists("DeviceType")) { m_deviceType = jsonValue.GetString("DeviceType"); m_deviceTypeHasBeenSet = true; } return *this; } JsonValue AwsEcsTaskDefinitionInferenceAcceleratorsDetails::Jsonize() const { JsonValue payload; if(m_deviceNameHasBeenSet) { payload.WithString("DeviceName", m_deviceName); } if(m_deviceTypeHasBeenSet) { payload.WithString("DeviceType", m_deviceType); } return payload; } } // namespace Model } // namespace SecurityHub } // namespace Aws
apache-2.0
robojukie/myrobotlab
javadoc/org/myrobotlab/chess/class-use/Constants.html
8043
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc --> <title>Uses of Interface org.myrobotlab.chess.Constants</title> <link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style"> <script type="text/javascript" src="../../../../script.js"></script> </head> <body> <script type="text/javascript"><!-- try { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Interface org.myrobotlab.chess.Constants"; } } catch(err) { } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar.top"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.top.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../org/myrobotlab/chess/Constants.html" title="interface in org.myrobotlab.chess">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../package-tree.html">Tree</a></li> <li><a href="../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../index-files/index-1.html">Index</a></li> <li><a href="../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../index.html?org/myrobotlab/chess/class-use/Constants.html" target="_top">Frames</a></li> <li><a href="Constants.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip.navbar.top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <div class="header"> <h2 title="Uses of Interface org.myrobotlab.chess.Constants" class="title">Uses of Interface<br>org.myrobotlab.chess.Constants</h2> </div> <div class="classUseContainer"> <ul class="blockList"> <li class="blockList"> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing packages, and an explanation"> <caption><span>Packages that use <a href="../../../../org/myrobotlab/chess/Constants.html" title="interface in org.myrobotlab.chess">Constants</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Package</th> <th class="colLast" scope="col">Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><a href="#org.myrobotlab.chess">org.myrobotlab.chess</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="#org.myrobotlab.control">org.myrobotlab.control</a></td> <td class="colLast">&nbsp;</td> </tr> </tbody> </table> </li> <li class="blockList"> <ul class="blockList"> <li class="blockList"><a name="org.myrobotlab.chess"> <!-- --> </a> <h3>Uses of <a href="../../../../org/myrobotlab/chess/Constants.html" title="interface in org.myrobotlab.chess">Constants</a> in <a href="../../../../org/myrobotlab/chess/package-summary.html">org.myrobotlab.chess</a></h3> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing classes, and an explanation"> <caption><span>Classes in <a href="../../../../org/myrobotlab/chess/package-summary.html">org.myrobotlab.chess</a> that implement <a href="../../../../org/myrobotlab/chess/Constants.html" title="interface in org.myrobotlab.chess">Constants</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Class and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code>class&nbsp;</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/myrobotlab/chess/Board.html" title="class in org.myrobotlab.chess">Board</a></span></code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><code>class&nbsp;</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/myrobotlab/chess/ChessApp.html" title="class in org.myrobotlab.chess">ChessApp</a></span></code>&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><code>class&nbsp;</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/myrobotlab/chess/HMove.html" title="class in org.myrobotlab.chess">HMove</a></span></code>&nbsp;</td> </tr> </tbody> </table> </li> <li class="blockList"><a name="org.myrobotlab.control"> <!-- --> </a> <h3>Uses of <a href="../../../../org/myrobotlab/chess/Constants.html" title="interface in org.myrobotlab.chess">Constants</a> in <a href="../../../../org/myrobotlab/control/package-summary.html">org.myrobotlab.control</a></h3> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing classes, and an explanation"> <caption><span>Classes in <a href="../../../../org/myrobotlab/control/package-summary.html">org.myrobotlab.control</a> that implement <a href="../../../../org/myrobotlab/chess/Constants.html" title="interface in org.myrobotlab.chess">Constants</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Class and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code>class&nbsp;</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/myrobotlab/control/ChessGameGUI.html" title="class in org.myrobotlab.control">ChessGameGUI</a></span></code>&nbsp;</td> </tr> </tbody> </table> </li> </ul> </li> </ul> </div> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar.bottom"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.bottom.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../org/myrobotlab/chess/Constants.html" title="interface in org.myrobotlab.chess">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../package-tree.html">Tree</a></li> <li><a href="../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../index-files/index-1.html">Index</a></li> <li><a href="../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../index.html?org/myrobotlab/chess/class-use/Constants.html" target="_top">Frames</a></li> <li><a href="Constants.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip.navbar.bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> </body> </html>
apache-2.0
martinwicke/tensorflow
tensorflow/g3doc/api_docs/python/functions_and_classes/shard1/tf.Tensor.md
24104
Represents one of the outputs of an `Operation`. A `Tensor` is a symbolic handle to one of the outputs of an `Operation`. It does not hold the values of that operation's output, but instead provides a means of computing those values in a TensorFlow [`Session`](../../api_docs/python/client.md#Session). This class has two primary purposes: 1. A `Tensor` can be passed as an input to another `Operation`. This builds a dataflow connection between operations, which enables TensorFlow to execute an entire `Graph` that represents a large, multi-step computation. 2. After the graph has been launched in a session, the value of the `Tensor` can be computed by passing it to [`Session.run()`](../../api_docs/python/client.md#Session.run). `t.eval()` is a shortcut for calling `tf.get_default_session().run(t)`. In the following example, `c`, `d`, and `e` are symbolic `Tensor` objects, whereas `result` is a numpy array that stores a concrete value: ```python # Build a dataflow graph. c = tf.constant([[1.0, 2.0], [3.0, 4.0]]) d = tf.constant([[1.0, 1.0], [0.0, 1.0]]) e = tf.matmul(c, d) # Construct a `Session` to execute the graph. sess = tf.Session() # Execute the graph and store the value that `e` represents in `result`. result = sess.run(e) ``` - - - #### `tf.Tensor.dtype` {#Tensor.dtype} The `DType` of elements in this tensor. - - - #### `tf.Tensor.name` {#Tensor.name} The string name of this tensor. - - - #### `tf.Tensor.value_index` {#Tensor.value_index} The index of this tensor in the outputs of its `Operation`. - - - #### `tf.Tensor.graph` {#Tensor.graph} The `Graph` that contains this tensor. - - - #### `tf.Tensor.op` {#Tensor.op} The `Operation` that produces this tensor as an output. - - - #### `tf.Tensor.consumers()` {#Tensor.consumers} Returns a list of `Operation`s that consume this tensor. ##### Returns: A list of `Operation`s. - - - #### `tf.Tensor.eval(feed_dict=None, session=None)` {#Tensor.eval} Evaluates this tensor in a `Session`. Calling this method will execute all preceding operations that produce the inputs needed for the operation that produces this tensor. *N.B.* Before invoking `Tensor.eval()`, its graph must have been launched in a session, and either a default session must be available, or `session` must be specified explicitly. ##### Args: * <b>`feed_dict`</b>: A dictionary that maps `Tensor` objects to feed values. See [`Session.run()`](../../api_docs/python/client.md#Session.run) for a description of the valid feed values. * <b>`session`</b>: (Optional.) The `Session` to be used to evaluate this tensor. If none, the default session will be used. ##### Returns: A numpy array corresponding to the value of this tensor. - - - #### `tf.Tensor.get_shape()` {#Tensor.get_shape} Returns the `TensorShape` that represents the shape of this tensor. The shape is computed using shape inference functions that are registered in the Op for each `Operation`. See [`TensorShape`](../../api_docs/python/framework.md#TensorShape) for more details of what a shape represents. The inferred shape of a tensor is used to provide shape information without having to launch the graph in a session. This can be used for debugging, and providing early error messages. For example: ```python c = tf.constant([[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]]) print(c.get_shape()) ==> TensorShape([Dimension(2), Dimension(3)]) d = tf.constant([[1.0, 0.0], [0.0, 1.0], [1.0, 0.0], [0.0, 1.0]]) print(d.get_shape()) ==> TensorShape([Dimension(4), Dimension(2)]) # Raises a ValueError, because `c` and `d` do not have compatible # inner dimensions. e = tf.matmul(c, d) f = tf.matmul(c, d, transpose_a=True, transpose_b=True) print(f.get_shape()) ==> TensorShape([Dimension(3), Dimension(4)]) ``` In some cases, the inferred shape may have unknown dimensions. If the caller has additional information about the values of these dimensions, `Tensor.set_shape()` can be used to augment the inferred shape. ##### Returns: A `TensorShape` representing the shape of this tensor. - - - #### `tf.Tensor.set_shape(shape)` {#Tensor.set_shape} Updates the shape of this tensor. This method can be called multiple times, and will merge the given `shape` with the current shape of this tensor. It can be used to provide additional information about the shape of this tensor that cannot be inferred from the graph alone. For example, this can be used to provide additional information about the shapes of images: ```python _, image_data = tf.TFRecordReader(...).read(...) image = tf.image.decode_png(image_data, channels=3) # The height and width dimensions of `image` are data dependent, and # cannot be computed without executing the op. print(image.get_shape()) ==> TensorShape([Dimension(None), Dimension(None), Dimension(3)]) # We know that each image in this dataset is 28 x 28 pixels. image.set_shape([28, 28, 3]) print(image.get_shape()) ==> TensorShape([Dimension(28), Dimension(28), Dimension(3)]) ``` ##### Args: * <b>`shape`</b>: A `TensorShape` representing the shape of this tensor. ##### Raises: * <b>`ValueError`</b>: If `shape` is not compatible with the current shape of this tensor. #### Other Methods - - - #### `tf.Tensor.__abs__(x, name=None)` {#Tensor.__abs__} Computes the absolute value of a tensor. Given a tensor of real numbers `x`, this operation returns a tensor containing the absolute value of each element in `x`. For example, if x is an input element and y is an output element, this operation computes \\(y = |x|\\). See [`tf.complex_abs()`](#tf_complex_abs) to compute the absolute value of a complex number. ##### Args: * <b>`x`</b>: A `Tensor` or `SparseTensor` of type `float32`, `float64`, `int32`, or `int64`. * <b>`name`</b>: A name for the operation (optional). ##### Returns: A `Tensor` or `SparseTensor` the same size and type as `x` with absolute values. - - - #### `tf.Tensor.__add__(x, y)` {#Tensor.__add__} Returns x + y element-wise. *NOTE*: `Add` supports broadcasting. `AddN` does not. More about broadcasting [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html) ##### Args: * <b>`x`</b>: A `Tensor`. Must be one of the following types: `half`, `float32`, `float64`, `uint8`, `int8`, `int16`, `int32`, `int64`, `complex64`, `complex128`, `string`. * <b>`y`</b>: A `Tensor`. Must have the same type as `x`. * <b>`name`</b>: A name for the operation (optional). ##### Returns: A `Tensor`. Has the same type as `x`. - - - #### `tf.Tensor.__and__(x, y)` {#Tensor.__and__} Returns the truth value of x AND y element-wise. *NOTE*: `LogicalAnd` supports broadcasting. More about broadcasting [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html) ##### Args: * <b>`x`</b>: A `Tensor` of type `bool`. * <b>`y`</b>: A `Tensor` of type `bool`. * <b>`name`</b>: A name for the operation (optional). ##### Returns: A `Tensor` of type `bool`. - - - #### `tf.Tensor.__bool__()` {#Tensor.__bool__} Dummy method to prevent a tensor from being used as a Python `bool`. This overload raises a `TypeError` when the user inadvertently treats a `Tensor` as a boolean (e.g. in an `if` statement). For example: ```python if tf.constant(True): # Will raise. # ... if tf.constant(5) < tf.constant(7): # Will raise. # ... ``` This disallows ambiguities between testing the Python value vs testing the dynamic condition of the `Tensor`. ##### Raises: `TypeError`. - - - #### `tf.Tensor.__div__(x, y)` {#Tensor.__div__} - - - #### `tf.Tensor.__eq__(other)` {#Tensor.__eq__} - - - #### `tf.Tensor.__floordiv__(x, y)` {#Tensor.__floordiv__} Divides `x / y` elementwise, rounding toward the most negative integer. The same as `tf.div(x,y)` for integers, but uses `tf.floor(tf.div(x,y))` for floating point arguments so that the result is always an integer (though possibly an integer represented as floating point). This op is generated by `x // y` floor division in Python 3 and in Python 2.7 with `from __future__ import division`. Note that for efficiency, `floordiv` uses C semantics for negative numbers (unlike Python and Numpy). `x` and `y` must have the same type, and the result will have the same type as well. ##### Args: * <b>`x`</b>: `Tensor` numerator of real numeric type. * <b>`y`</b>: `Tensor` denominator of real numeric type. * <b>`name`</b>: A name for the operation (optional). ##### Returns: `x / y` rounded down (except possibly towards zero for negative integers). ##### Raises: * <b>`TypeError`</b>: If the inputs are complex. - - - #### `tf.Tensor.__ge__(x, y, name=None)` {#Tensor.__ge__} Returns the truth value of (x >= y) element-wise. *NOTE*: `GreaterEqual` supports broadcasting. More about broadcasting [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html) ##### Args: * <b>`x`</b>: A `Tensor`. Must be one of the following types: `float32`, `float64`, `int32`, `int64`, `uint8`, `int16`, `int8`, `uint16`, `half`. * <b>`y`</b>: A `Tensor`. Must have the same type as `x`. * <b>`name`</b>: A name for the operation (optional). ##### Returns: A `Tensor` of type `bool`. - - - #### `tf.Tensor.__getitem__(tensor, slice_spec, var=None)` {#Tensor.__getitem__} Overload for Tensor.__getitem__. This operation extracts the specified region from the tensor. The notation is similar to NumPy with the restriction that currently only support basic indexing. That means that using a tensor as input is not currently allowed Some useful examples: ```python # strip leading and trailing 2 elements foo = tf.constant([1,2,3,4,5,6]) print(foo[2:-2].eval()) # => [3,4] # skip every row and reverse every column foo = tf.constant([[1,2,3], [4,5,6], [7,8,9]]) print(foo[::2,::-1].eval()) # => [[3,2,1], [9,8,7]] # Insert another dimension foo = tf.constant([[1,2,3], [4,5,6], [7,8,9]]) print(foo[tf.newaxis, :, :].eval()) # => [[[3,2,1], [9,8,7]]] print(foo[:, tf.newaxis, :].eval()) # => [[[3,2,1]], [[9,8,7]]] print(foo[:, :, tf.newaxis].eval()) # => [[[3],[2],[1]], [[9],[8],[7]]] # Ellipses (3 equivalent operations) print(foo[tf.newaxis, :, :].eval()) # => [[[3,2,1], [9,8,7]]] print(foo[tf.newaxis, ...].eval()) # => [[[3,2,1], [9,8,7]]] print(foo[tf.newaxis].eval()) # => [[[3,2,1], [9,8,7]]] ``` ##### Notes: - `tf.newaxis` is `None` as in NumPy. - An implicit ellipsis is placed at the end of the `slice_spec` - NumPy advanced indexing is currently not supported. ##### Args: * <b>`tensor`</b>: An ops.Tensor object. * <b>`slice_spec`</b>: The arguments to Tensor.__getitem__. * <b>`var`</b>: In the case of variable slice assignment, the Variable object to slice (i.e. tensor is the read-only view of this variable). ##### Returns: The appropriate slice of "tensor", based on "slice_spec". ##### Raises: * <b>`ValueError`</b>: If a slice range is negative size. * <b>`TypeError`</b>: If the slice indices aren't int, slice, or Ellipsis. - - - #### `tf.Tensor.__gt__(x, y, name=None)` {#Tensor.__gt__} Returns the truth value of (x > y) element-wise. *NOTE*: `Greater` supports broadcasting. More about broadcasting [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html) ##### Args: * <b>`x`</b>: A `Tensor`. Must be one of the following types: `float32`, `float64`, `int32`, `int64`, `uint8`, `int16`, `int8`, `uint16`, `half`. * <b>`y`</b>: A `Tensor`. Must have the same type as `x`. * <b>`name`</b>: A name for the operation (optional). ##### Returns: A `Tensor` of type `bool`. - - - #### `tf.Tensor.__hash__()` {#Tensor.__hash__} - - - #### `tf.Tensor.__init__(op, value_index, dtype)` {#Tensor.__init__} Creates a new `Tensor`. ##### Args: * <b>`op`</b>: An `Operation`. `Operation` that computes this tensor. * <b>`value_index`</b>: An `int`. Index of the operation's endpoint that produces this tensor. * <b>`dtype`</b>: A `DType`. Type of elements stored in this tensor. ##### Raises: * <b>`TypeError`</b>: If the op is not an `Operation`. - - - #### `tf.Tensor.__invert__(x, name=None)` {#Tensor.__invert__} Returns the truth value of NOT x element-wise. ##### Args: * <b>`x`</b>: A `Tensor` of type `bool`. * <b>`name`</b>: A name for the operation (optional). ##### Returns: A `Tensor` of type `bool`. - - - #### `tf.Tensor.__iter__()` {#Tensor.__iter__} Dummy method to prevent iteration. Do not call. NOTE(mrry): If we register __getitem__ as an overloaded operator, Python will valiantly attempt to iterate over the Tensor from 0 to infinity. Declaring this method prevents this unintended behavior. ##### Raises: * <b>`TypeError`</b>: when invoked. - - - #### `tf.Tensor.__le__(x, y, name=None)` {#Tensor.__le__} Returns the truth value of (x <= y) element-wise. *NOTE*: `LessEqual` supports broadcasting. More about broadcasting [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html) ##### Args: * <b>`x`</b>: A `Tensor`. Must be one of the following types: `float32`, `float64`, `int32`, `int64`, `uint8`, `int16`, `int8`, `uint16`, `half`. * <b>`y`</b>: A `Tensor`. Must have the same type as `x`. * <b>`name`</b>: A name for the operation (optional). ##### Returns: A `Tensor` of type `bool`. - - - #### `tf.Tensor.__lt__(x, y, name=None)` {#Tensor.__lt__} Returns the truth value of (x < y) element-wise. *NOTE*: `Less` supports broadcasting. More about broadcasting [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html) ##### Args: * <b>`x`</b>: A `Tensor`. Must be one of the following types: `float32`, `float64`, `int32`, `int64`, `uint8`, `int16`, `int8`, `uint16`, `half`. * <b>`y`</b>: A `Tensor`. Must have the same type as `x`. * <b>`name`</b>: A name for the operation (optional). ##### Returns: A `Tensor` of type `bool`. - - - #### `tf.Tensor.__mod__(x, y)` {#Tensor.__mod__} Returns element-wise remainder of division. When `x < 0` xor `y < 0` is true, this follows Python semantics in that the result here is consistent with a flooring divide. E.g. `floor(x / y) * y + mod(x, y) = x`. *NOTE*: `FloorMod` supports broadcasting. More about broadcasting [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html) ##### Args: * <b>`x`</b>: A `Tensor`. Must be one of the following types: `int32`, `int64`, `float32`, `float64`. * <b>`y`</b>: A `Tensor`. Must have the same type as `x`. * <b>`name`</b>: A name for the operation (optional). ##### Returns: A `Tensor`. Has the same type as `x`. - - - #### `tf.Tensor.__mul__(x, y)` {#Tensor.__mul__} Dispatches cwise mul for "Dense*Dense" and "Dense*Sparse". - - - #### `tf.Tensor.__neg__(x, name=None)` {#Tensor.__neg__} Computes numerical negative value element-wise. I.e., \\(y = -x\\). ##### Args: * <b>`x`</b>: A `Tensor`. Must be one of the following types: `half`, `float32`, `float64`, `int32`, `int64`, `complex64`, `complex128`. * <b>`name`</b>: A name for the operation (optional). ##### Returns: A `Tensor`. Has the same type as `x`. - - - #### `tf.Tensor.__nonzero__()` {#Tensor.__nonzero__} Dummy method to prevent a tensor from being used as a Python `bool`. This is the Python 2.x counterpart to `__bool__()` above. ##### Raises: `TypeError`. - - - #### `tf.Tensor.__or__(x, y)` {#Tensor.__or__} Returns the truth value of x OR y element-wise. *NOTE*: `LogicalOr` supports broadcasting. More about broadcasting [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html) ##### Args: * <b>`x`</b>: A `Tensor` of type `bool`. * <b>`y`</b>: A `Tensor` of type `bool`. * <b>`name`</b>: A name for the operation (optional). ##### Returns: A `Tensor` of type `bool`. - - - #### `tf.Tensor.__pow__(x, y)` {#Tensor.__pow__} Computes the power of one value to another. Given a tensor `x` and a tensor `y`, this operation computes \\(x^y\\) for corresponding elements in `x` and `y`. For example: ``` # tensor 'x' is [[2, 2], [3, 3]] # tensor 'y' is [[8, 16], [2, 3]] tf.pow(x, y) ==> [[256, 65536], [9, 27]] ``` ##### Args: * <b>`x`</b>: A `Tensor` of type `float32`, `float64`, `int32`, `int64`, `complex64`, or `complex128`. * <b>`y`</b>: A `Tensor` of type `float32`, `float64`, `int32`, `int64`, `complex64`, or `complex128`. * <b>`name`</b>: A name for the operation (optional). ##### Returns: A `Tensor`. - - - #### `tf.Tensor.__radd__(y, x)` {#Tensor.__radd__} Returns x + y element-wise. *NOTE*: `Add` supports broadcasting. `AddN` does not. More about broadcasting [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html) ##### Args: * <b>`x`</b>: A `Tensor`. Must be one of the following types: `half`, `float32`, `float64`, `uint8`, `int8`, `int16`, `int32`, `int64`, `complex64`, `complex128`, `string`. * <b>`y`</b>: A `Tensor`. Must have the same type as `x`. * <b>`name`</b>: A name for the operation (optional). ##### Returns: A `Tensor`. Has the same type as `x`. - - - #### `tf.Tensor.__rand__(y, x)` {#Tensor.__rand__} Returns the truth value of x AND y element-wise. *NOTE*: `LogicalAnd` supports broadcasting. More about broadcasting [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html) ##### Args: * <b>`x`</b>: A `Tensor` of type `bool`. * <b>`y`</b>: A `Tensor` of type `bool`. * <b>`name`</b>: A name for the operation (optional). ##### Returns: A `Tensor` of type `bool`. - - - #### `tf.Tensor.__rdiv__(y, x)` {#Tensor.__rdiv__} - - - #### `tf.Tensor.__repr__()` {#Tensor.__repr__} - - - #### `tf.Tensor.__rfloordiv__(y, x)` {#Tensor.__rfloordiv__} Divides `x / y` elementwise, rounding toward the most negative integer. The same as `tf.div(x,y)` for integers, but uses `tf.floor(tf.div(x,y))` for floating point arguments so that the result is always an integer (though possibly an integer represented as floating point). This op is generated by `x // y` floor division in Python 3 and in Python 2.7 with `from __future__ import division`. Note that for efficiency, `floordiv` uses C semantics for negative numbers (unlike Python and Numpy). `x` and `y` must have the same type, and the result will have the same type as well. ##### Args: * <b>`x`</b>: `Tensor` numerator of real numeric type. * <b>`y`</b>: `Tensor` denominator of real numeric type. * <b>`name`</b>: A name for the operation (optional). ##### Returns: `x / y` rounded down (except possibly towards zero for negative integers). ##### Raises: * <b>`TypeError`</b>: If the inputs are complex. - - - #### `tf.Tensor.__rmod__(y, x)` {#Tensor.__rmod__} Returns element-wise remainder of division. When `x < 0` xor `y < 0` is true, this follows Python semantics in that the result here is consistent with a flooring divide. E.g. `floor(x / y) * y + mod(x, y) = x`. *NOTE*: `FloorMod` supports broadcasting. More about broadcasting [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html) ##### Args: * <b>`x`</b>: A `Tensor`. Must be one of the following types: `int32`, `int64`, `float32`, `float64`. * <b>`y`</b>: A `Tensor`. Must have the same type as `x`. * <b>`name`</b>: A name for the operation (optional). ##### Returns: A `Tensor`. Has the same type as `x`. - - - #### `tf.Tensor.__rmul__(y, x)` {#Tensor.__rmul__} Dispatches cwise mul for "Dense*Dense" and "Dense*Sparse". - - - #### `tf.Tensor.__ror__(y, x)` {#Tensor.__ror__} Returns the truth value of x OR y element-wise. *NOTE*: `LogicalOr` supports broadcasting. More about broadcasting [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html) ##### Args: * <b>`x`</b>: A `Tensor` of type `bool`. * <b>`y`</b>: A `Tensor` of type `bool`. * <b>`name`</b>: A name for the operation (optional). ##### Returns: A `Tensor` of type `bool`. - - - #### `tf.Tensor.__rpow__(y, x)` {#Tensor.__rpow__} Computes the power of one value to another. Given a tensor `x` and a tensor `y`, this operation computes \\(x^y\\) for corresponding elements in `x` and `y`. For example: ``` # tensor 'x' is [[2, 2], [3, 3]] # tensor 'y' is [[8, 16], [2, 3]] tf.pow(x, y) ==> [[256, 65536], [9, 27]] ``` ##### Args: * <b>`x`</b>: A `Tensor` of type `float32`, `float64`, `int32`, `int64`, `complex64`, or `complex128`. * <b>`y`</b>: A `Tensor` of type `float32`, `float64`, `int32`, `int64`, `complex64`, or `complex128`. * <b>`name`</b>: A name for the operation (optional). ##### Returns: A `Tensor`. - - - #### `tf.Tensor.__rsub__(y, x)` {#Tensor.__rsub__} Returns x - y element-wise. *NOTE*: `Sub` supports broadcasting. More about broadcasting [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html) ##### Args: * <b>`x`</b>: A `Tensor`. Must be one of the following types: `half`, `float32`, `float64`, `int32`, `int64`, `complex64`, `complex128`. * <b>`y`</b>: A `Tensor`. Must have the same type as `x`. * <b>`name`</b>: A name for the operation (optional). ##### Returns: A `Tensor`. Has the same type as `x`. - - - #### `tf.Tensor.__rtruediv__(y, x)` {#Tensor.__rtruediv__} Divides x / y elementwise, always producing floating point results. The same as `tf.div` for floating point arguments, but casts integer arguments to floating point before dividing so that the result is always floating point. This op is generated by normal `x / y` division in Python 3 and in Python 2.7 with `from __future__ import division`. If you want integer division that rounds down, use `x // y` or `tf.floordiv`. `x` and `y` must have the same numeric type. If the inputs are floating point, the output will have the same type. If the inputs are integral, the inputs are cast to `float32` for `int8` and `int16` and `float64` for `int32` and `int64` (matching the behavior of Numpy). ##### Args: * <b>`x`</b>: `Tensor` numerator of numeric type. * <b>`y`</b>: `Tensor` denominator of numeric type. * <b>`name`</b>: A name for the operation (optional). ##### Returns: `x / y` evaluated in floating point. ##### Raises: * <b>`TypeError`</b>: If `x` and `y` have different dtypes. - - - #### `tf.Tensor.__rxor__(y, x)` {#Tensor.__rxor__} x ^ y = (x | y) & ~(x & y). - - - #### `tf.Tensor.__str__()` {#Tensor.__str__} - - - #### `tf.Tensor.__sub__(x, y)` {#Tensor.__sub__} Returns x - y element-wise. *NOTE*: `Sub` supports broadcasting. More about broadcasting [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html) ##### Args: * <b>`x`</b>: A `Tensor`. Must be one of the following types: `half`, `float32`, `float64`, `int32`, `int64`, `complex64`, `complex128`. * <b>`y`</b>: A `Tensor`. Must have the same type as `x`. * <b>`name`</b>: A name for the operation (optional). ##### Returns: A `Tensor`. Has the same type as `x`. - - - #### `tf.Tensor.__truediv__(x, y)` {#Tensor.__truediv__} Divides x / y elementwise, always producing floating point results. The same as `tf.div` for floating point arguments, but casts integer arguments to floating point before dividing so that the result is always floating point. This op is generated by normal `x / y` division in Python 3 and in Python 2.7 with `from __future__ import division`. If you want integer division that rounds down, use `x // y` or `tf.floordiv`. `x` and `y` must have the same numeric type. If the inputs are floating point, the output will have the same type. If the inputs are integral, the inputs are cast to `float32` for `int8` and `int16` and `float64` for `int32` and `int64` (matching the behavior of Numpy). ##### Args: * <b>`x`</b>: `Tensor` numerator of numeric type. * <b>`y`</b>: `Tensor` denominator of numeric type. * <b>`name`</b>: A name for the operation (optional). ##### Returns: `x / y` evaluated in floating point. ##### Raises: * <b>`TypeError`</b>: If `x` and `y` have different dtypes. - - - #### `tf.Tensor.__xor__(x, y)` {#Tensor.__xor__} x ^ y = (x | y) & ~(x & y). - - - #### `tf.Tensor.device` {#Tensor.device} The name of the device on which this tensor will be produced, or None.
apache-2.0
viggyprabhu/geowave
geowave-analytics/src/main/java/mil/nga/giat/geowave/analytics/kmeans/mapreduce/KMeansDistortionMapReduce.java
9638
package mil.nga.giat.geowave.analytics.kmeans.mapreduce; import java.io.IOException; import java.util.List; import mil.nga.giat.geowave.accumulo.mapreduce.GeoWaveWritableInputMapper; import mil.nga.giat.geowave.accumulo.mapreduce.input.GeoWaveInputKey; import mil.nga.giat.geowave.analytics.clustering.CentroidManagerGeoWave; import mil.nga.giat.geowave.analytics.clustering.CentroidPairing; import mil.nga.giat.geowave.analytics.clustering.NestedGroupCentroidAssignment; import mil.nga.giat.geowave.analytics.extract.CentroidExtractor; import mil.nga.giat.geowave.analytics.extract.SimpleFeatureCentroidExtractor; import mil.nga.giat.geowave.analytics.kmeans.AssociationNotification; import mil.nga.giat.geowave.analytics.parameters.CentroidParameters; import mil.nga.giat.geowave.analytics.parameters.JumpParameters; import mil.nga.giat.geowave.analytics.tools.AnalyticItemWrapper; import mil.nga.giat.geowave.analytics.tools.AnalyticItemWrapperFactory; import mil.nga.giat.geowave.analytics.tools.ConfigurationWrapper; import mil.nga.giat.geowave.analytics.tools.SimpleFeatureItemWrapperFactory; import mil.nga.giat.geowave.analytics.tools.mapreduce.CountofDoubleWritable; import mil.nga.giat.geowave.analytics.tools.mapreduce.JobContextConfigurationWrapper; import mil.nga.giat.geowave.index.StringUtils; import org.apache.accumulo.core.data.Mutation; import org.apache.accumulo.core.data.Value; import org.apache.hadoop.io.ObjectWritable; import org.apache.hadoop.io.Text; import org.apache.hadoop.mapreduce.Mapper; import org.apache.hadoop.mapreduce.Reducer; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.vividsolutions.jts.geom.Point; /** * Calculate the distortation. * <p/> * See Catherine A. Sugar and Gareth M. James (2003). * "Finding the number of clusters in a data set: An information theoretic approach" * Journal of the American Statistical Association 98 (January): 750–763 * * @formatter:off Context configuration parameters include: * <p/> * "KMeansDistortionMapReduce.Common.DistanceFunctionClass" -> * {@link mil.nga.giat.geowave.analytics.distance.DistanceFn} * used to determine distance to centroid * <p/> * "KMeansDistortionMapReduce.Centroid.WrapperFactoryClass" -> * {@link AnalyticItemWrapperFactory} to extract wrap spatial * objects with Centroid management functions * <p/> * "KMeansDistortionMapReduce.Centroid.ExtractorClass" -> * {@link mil.nga.giat.geowave.analytics.extract.CentroidExtractor} * <p/> * "KMeansDistortionMapReduce.Jump.CountOfCentroids" -> May be * different from actual. * @formatter:on * @see CentroidManagerGeoWave */ public class KMeansDistortionMapReduce { protected static final Logger LOGGER = LoggerFactory.getLogger(KMeansDistortionMapReduce.class); public static class KMeansDistortionMapper extends GeoWaveWritableInputMapper<Text, CountofDoubleWritable> { private NestedGroupCentroidAssignment<Object> nestedGroupCentroidAssigner; private final Text outputKeyWritable = new Text( "1"); private final CountofDoubleWritable outputValWritable = new CountofDoubleWritable(); private CentroidExtractor<Object> centroidExtractor; private AnalyticItemWrapperFactory<Object> itemWrapperFactory; AssociationNotification<Object> centroidAssociationFn = new AssociationNotification<Object>() { @Override public void notify( final CentroidPairing<Object> pairing ) { outputKeyWritable.set(pairing.getCentroid().getGroupID()); final double extraFromItem[] = pairing.getPairedItem().getDimensionValues(); final double extraCentroid[] = pairing.getCentroid().getDimensionValues(); final Point p = centroidExtractor.getCentroid(pairing.getPairedItem().getWrappedItem()); final Point centroid = centroidExtractor.getCentroid(pairing.getCentroid().getWrappedItem()); // calculate error for dp // using identity matrix for the common covariance, therefore // E[(p - c)^-1 * cov * (p - c)] => (px - cx)^2 + (py - cy)^2 double expectation = 0.0; for (int i = 0; i < extraCentroid.length; i++) { expectation += Math.pow( extraFromItem[i] - extraCentroid[i], 2); } expectation += (Math.pow( p.getCoordinate().x - centroid.getCoordinate().x, 2) + Math.pow( p.getCoordinate().y - centroid.getCoordinate().y, 2)); // + Math.pow( // p.getCoordinate().z - centroid.getCoordinate().z, // 2)); outputValWritable.set( expectation, 1); } }; @Override protected void mapNativeValue( final GeoWaveInputKey key, final Object value, final org.apache.hadoop.mapreduce.Mapper<GeoWaveInputKey, ObjectWritable, Text, CountofDoubleWritable>.Context context ) throws IOException, InterruptedException { nestedGroupCentroidAssigner.findCentroidForLevel( itemWrapperFactory.create(value), centroidAssociationFn); context.write( outputKeyWritable, outputValWritable); } @SuppressWarnings("unchecked") @Override protected void setup( final Mapper<GeoWaveInputKey, ObjectWritable, Text, CountofDoubleWritable>.Context context ) throws IOException, InterruptedException { super.setup(context); final ConfigurationWrapper config = new JobContextConfigurationWrapper( context, KMeansDistortionMapReduce.LOGGER); try { nestedGroupCentroidAssigner = new NestedGroupCentroidAssignment<Object>( config); } catch (final Exception e1) { throw new IOException( e1); } try { centroidExtractor = config.getInstance( CentroidParameters.Centroid.EXTRACTOR_CLASS, KMeansDistortionMapReduce.class, CentroidExtractor.class, SimpleFeatureCentroidExtractor.class); } catch (final Exception e1) { throw new IOException( e1); } try { itemWrapperFactory = config.getInstance( CentroidParameters.Centroid.WRAPPER_FACTORY_CLASS, KMeansDistortionMapReduce.class, AnalyticItemWrapperFactory.class, SimpleFeatureItemWrapperFactory.class); } catch (final Exception e1) { throw new IOException( e1); } } } public static class KMeansDistorationCombiner extends Reducer<Text, CountofDoubleWritable, Text, CountofDoubleWritable> { final CountofDoubleWritable outputValue = new CountofDoubleWritable(); @Override public void reduce( final Text key, final Iterable<CountofDoubleWritable> values, final Reducer<Text, CountofDoubleWritable, Text, CountofDoubleWritable>.Context context ) throws IOException, InterruptedException { double expectation = 0; double ptCount = 0; for (final CountofDoubleWritable value : values) { expectation += value.getValue(); ptCount += value.getCount(); } outputValue.set( expectation, ptCount); context.write( key, outputValue); } } public static class KMeansDistortionReduce extends Reducer<Text, CountofDoubleWritable, Text, Mutation> { private String expectedK = null; final protected Text output = new Text( ""); private CentroidManagerGeoWave<Object> centroidManager; @Override public void reduce( final Text key, final Iterable<CountofDoubleWritable> values, final Reducer<Text, CountofDoubleWritable, Text, Mutation>.Context context ) throws IOException, InterruptedException { double expectation = 0.0; final List<AnalyticItemWrapper<Object>> centroids = centroidManager.getCentroidsForGroup(key.toString()); // it is possible that the number of items in a group are smaller // than the cluster final String kCount = expectedK == null ? Integer.toString(centroids.size()) : expectedK; if (centroids.size() == 0) { return; } final double numDimesions = 2 + centroids.get( 0).getExtraDimensions().length; double ptCount = 0; for (final CountofDoubleWritable value : values) { expectation += value.getValue(); ptCount += value.getCount(); } if (ptCount > 0) { expectation /= ptCount; final Double distortion = Math.pow( expectation / numDimesions, -(numDimesions / 2)); // key: group ID | "DISTORTION" | K // value: distortion value final Mutation m = new Mutation( key.toString()); m.put( new Text( "dt"), new Text( kCount), new Value( distortion.toString().getBytes( StringUtils.UTF8_CHAR_SET))); // write distortion to accumulo, defaults to table given to // AccumuloOutputFormat, in driver context.write( output, // default table m); } } @Override protected void setup( final Reducer<Text, CountofDoubleWritable, Text, Mutation>.Context context ) throws IOException, InterruptedException { super.setup(context); final ConfigurationWrapper config = new JobContextConfigurationWrapper( context, KMeansDistortionMapReduce.LOGGER); final int k = config.getInt( JumpParameters.Jump.COUNT_OF_CENTROIDS, KMeansDistortionMapReduce.class, -1); if (k > 0) { expectedK = Integer.toString(k); } try { centroidManager = new CentroidManagerGeoWave<Object>( config); } catch (final Exception e) { KMeansDistortionMapReduce.LOGGER.warn( "Unable to initialize centroid manager", e); throw new IOException( "Unable to initialize centroid manager"); } } } }
apache-2.0
PDX-Flamingo/codoncount-prototype-c
trie_codon.c
8066
/* Copyright (c) 2005-2008, Simon Howard Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ /* Trie: fast mapping of strings to values */ #include <stdlib.h> #include <string.h> #include "trie_codon.h" typedef struct _TrieNode TrieNode; struct _TrieNode { TrieValue data; unsigned int use_count; TrieNode *next[256]; }; struct _Trie { TrieNode *root_node; }; Trie *trie_new(void) { Trie *new_trie; new_trie = (Trie *) malloc(sizeof(Trie)); if (new_trie == NULL) { return NULL; } new_trie->root_node = NULL; return new_trie; } static void trie_free_list_push(TrieNode **list, TrieNode *node) { node->data = *list; *list = node; } static TrieNode *trie_free_list_pop(TrieNode **list) { TrieNode *result; result = *list; *list = result->data; return result; } void trie_free(Trie *trie) { TrieNode *free_list; TrieNode *node; int i; free_list = NULL; /* Start with the root node */ if (trie->root_node != NULL) { trie_free_list_push(&free_list, trie->root_node); } /* Go through the free list, freeing nodes. We add new nodes as * we encounter them; in this way, all the nodes are freed * non-recursively. */ while (free_list != NULL) { node = trie_free_list_pop(&free_list); /* Add all children of this node to the free list */ for (i=0; i<256; ++i) { if (node->next[i] != NULL) { trie_free_list_push(&free_list, node->next[i]); } } /* Free the node */ free(node); } /* Free the trie */ free(trie); } static TrieNode *trie_find_end(Trie *trie, char *key) { TrieNode *node; char *p; int c; /* Search down the trie until the end of string is reached */ node = trie->root_node; for (p=key; *p != '\0'; ++p) { if (node == NULL) { /* Not found in the tree. Return. */ return NULL; } /* Jump to the next node */ c = *p; node = node->next[c]; } /* This key is present if the value at the last node is not NULL */ return node; } /* Roll back an insert operation after a failed malloc() call. */ static void trie_insert_rollback(Trie *trie, char *key) { TrieNode *node; TrieNode **prev_ptr; TrieNode *next_node; TrieNode **next_prev_ptr; char *p; /* Follow the chain along. We know that we will never reach the * end of the string because trie_insert never got that far. As a * result, it is not necessary to check for the end of string * delimiter (NUL) */ node = trie->root_node; prev_ptr = &trie->root_node; p = key; while (node != NULL) { /* Find the next node now. We might free this node. */ next_prev_ptr = &node->next[(int) *p]; next_node = *next_prev_ptr; ++p; /* Decrease the use count and free the node if it * reaches zero. */ --node->use_count; if (node->use_count == 0) { free(node); if (prev_ptr != NULL) { *prev_ptr = NULL; } next_prev_ptr = NULL; } /* Update pointers */ node = next_node; prev_ptr = next_prev_ptr; } } int trie_insert(Trie *trie, char *key, TrieValue value) { TrieNode **rover; TrieNode *node; char *p; int c; /* Cannot insert NULL values */ if (value == TRIE_NULL) { return 0; } /* Search to see if this is already in the tree */ node = trie_find_end(trie, key); /* Already in the tree? If so, replace the existing value and * return success. */ if (node != NULL && node->data != TRIE_NULL) { node->data = value; return 1; } /* Search down the trie until we reach the end of string, * creating nodes as necessary */ rover = &trie->root_node; p = key; for (;;) { node = *rover; if (node == NULL) { /* Node does not exist, so create it */ node = (TrieNode *) calloc(1, sizeof(TrieNode)); if (node == NULL) { /* Allocation failed. Go back and undo * what we have done so far. */ trie_insert_rollback(trie, key); return 0; } node->data = TRIE_NULL; /* Link in to the trie */ *rover = node; } /* Increase the node use count */ ++node->use_count; /* Current character */ c = *p; /* Reached the end of string? If so, we're finished. */ if (c == '\0') { /* Set the data at the node we have reached */ node->data = value; break; } /* Advance to the next node in the chain */ rover = &node->next[c]; ++p; } return 1; } int trie_increment(Trie *trie, char *key) { TrieNode **rover; TrieNode *node; char *p; int c; /* Search to see if this is already in the tree */ node = trie_find_end(trie, key); /* Already in the tree? If so, replace the existing value and * return success. */ if (node != NULL && node->data != TRIE_NULL) { node->data = ++node->data; return 1; } /* Search down the trie until we reach the end of string, * creating nodes as necessary */ rover = &trie->root_node; p = key; for (;;) { node = *rover; if (node == NULL) { /* Node does not exist, so create it */ node = (TrieNode *) calloc(1, sizeof(TrieNode)); if (node == NULL) { /* Allocation failed. Go back and undo * what we have done so far. */ trie_insert_rollback(trie, key); return 0; } node->data = TRIE_NULL; /* Link in to the trie */ *rover = node; } /* Increase the node use count */ ++node->use_count; /* Current character */ c = *p; /* Reached the end of string? If so, we're finished. */ if (c == '\0') { /* Set the data at the node we have reached */ node->data = ++node->data; break; } /* Advance to the next node in the chain */ rover = &node->next[c]; ++p; } return 1; } int trie_remove(Trie *trie, char *key) { TrieNode *node; TrieNode *next; TrieNode **last_next_ptr; char *p; int c; /* Find the end node and remove the value */ node = trie_find_end(trie, key); if (node != NULL && node->data != TRIE_NULL) { node->data = TRIE_NULL; } else { return 0; } /* Now traverse the tree again as before, decrementing the use * count of each node. Free back nodes as necessary. */ node = trie->root_node; last_next_ptr = &trie->root_node; p = key; for (;;) { /* Find the next node */ c = *p; next = node->next[c]; /* Free this node if necessary */ --node->use_count; if (node->use_count <= 0) { free(node); /* Set the "next" pointer on the previous node to NULL, * to unlink the freed node from the tree. This only * needs to be done once in a remove. After the first * unlink, all further nodes are also going to be * free'd. */ if (last_next_ptr != NULL) { *last_next_ptr = NULL; last_next_ptr = NULL; } } /* Go to the next character or finish */ if (c == '\0') { break; } else { ++p; } /* If necessary, save the location of the "next" pointer * so that it may be set to NULL on the next iteration if * the next node visited is freed. */ if (last_next_ptr != NULL) { last_next_ptr = &node->next[c]; } /* Jump to the next node */ node = next; } /* Removed successfully */ return 1; } TrieValue trie_lookup(Trie *trie, char *key) { TrieNode *node; node = trie_find_end(trie, key); if (node != NULL) { return node->data; } else { return TRIE_NULL; } } int trie_num_entries(Trie *trie) { /* To find the number of entries, simply look at the use count * of the root node. */ if (trie->root_node == NULL) { return 0; } else { return trie->root_node->use_count; } }
apache-2.0
gomex/devopsdays-web
static/events/2017-berlin/speakers/jan-nabbefeld/index.html
13949
<!DOCTYPE html> <html itemscope lang="en-us"> <head><meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta charset="utf-8"> <meta name="HandheldFriendly" content="True"> <meta name="MobileOptimized" content="320"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><meta name="generator" content="Hugo 0.57.2" /> <meta property="og:title" content="Jan Nabbefeld" /> <meta name="twitter:title" content="Jan Nabbefeld"/> <meta itemprop="name" content="Jan Nabbefeld"><meta property="og:description" content="" /> <meta name="twitter:description" content="" /> <meta itemprop="description" content=""><meta name="twitter:site" content="@devopsdays"> <meta property="og:type" content="speaker" /> <meta property="og:url" content="/events/2017-berlin/speakers/jan-nabbefeld/" /><meta name="twitter:label1" value="Event" /> <meta name="twitter:data1" value="devopsdays Berlin 2017" /><meta name="twitter:label2" value="Dates" /> <meta name="twitter:data2" value="October 18 - 19, 2017" /><meta property="og:image" content="https://www.devopsdays.org/img/sharing.jpg" /> <meta name="twitter:card" content="summary_large_image" /> <meta name="twitter:image" content="https://www.devopsdays.org/img/sharing.jpg" /> <meta itemprop="image" content="https://www.devopsdays.org/img/sharing.jpg" /> <meta property="fb:app_id" content="1904065206497317" /><meta itemprop="wordCount" content="0"> <title>Jan Nabbefeld - devopsdays Berlin 2017 </title> <script> window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date; ga('create', 'UA-9713393-1', 'auto'); ga('send', 'pageview'); </script> <script async src='https://www.google-analytics.com/analytics.js'></script> <link href="/css/site.css" rel="stylesheet"> <link href="https://fonts.googleapis.com/css?family=Roboto+Condensed:300,400,700" rel="stylesheet"><link rel="apple-touch-icon" sizes="57x57" href="/apple-icon-57x57.png"> <link rel="apple-touch-icon" sizes="60x60" href="/apple-icon-60x60.png"> <link rel="apple-touch-icon" sizes="72x72" href="/apple-icon-72x72.png"> <link rel="apple-touch-icon" sizes="76x76" href="/apple-icon-76x76.png"> <link rel="apple-touch-icon" sizes="114x114" href="/apple-icon-114x114.png"> <link rel="apple-touch-icon" sizes="120x120" href="/apple-icon-120x120.png"> <link rel="apple-touch-icon" sizes="144x144" href="/apple-icon-144x144.png"> <link rel="apple-touch-icon" sizes="152x152" href="/apple-icon-152x152.png"> <link rel="apple-touch-icon" sizes="180x180" href="/apple-icon-180x180.png"> <link rel="icon" type="image/png" sizes="192x192" href="/android-icon-192x192.png"> <link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png"> <link rel="icon" type="image/png" sizes="96x96" href="/favicon-96x96.png"> <link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png"> <link rel="manifest" href="/manifest.json"> <meta name="msapplication-TileColor" content="#ffffff"> <meta name="msapplication-TileImage" content="/ms-icon-144x144.png"> <meta name="theme-color" content="#ffffff"> <link href="/events/index.xml" rel="alternate" type="application/rss+xml" title="DevOpsDays" /> <link href="/events/index.xml" rel="feed" type="application/rss+xml" title="DevOpsDays" /> <script src=/js/devopsdays-min.js></script></head> <body lang=""> <nav class="navbar navbar-expand-md navbar-light"> <a class="navbar-brand" href="/"> <img src="/img/devopsdays-brain.png" height="30" class="d-inline-block align-top" alt="devopsdays Logo"> DevOpsDays </a> <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation"> <span class="navbar-toggler-icon"></span> </button> <div class="collapse navbar-collapse" id="navbarSupportedContent"> <ul class="navbar-nav mr-auto"><li class="nav-item global-navigation"><a class = "nav-link" href="/events">events</a></li><li class="nav-item global-navigation"><a class = "nav-link" href="/blog">blog</a></li><li class="nav-item global-navigation"><a class = "nav-link" href="/sponsor">sponsor</a></li><li class="nav-item global-navigation"><a class = "nav-link" href="/speaking">speaking</a></li><li class="nav-item global-navigation"><a class = "nav-link" href="/organizing">organizing</a></li><li class="nav-item global-navigation"><a class = "nav-link" href="/about">about</a></li></ul> </div> </nav> <nav class="navbar event-navigation navbar-expand-md navbar-light"> <a href="/events/2017-berlin" class="nav-link">Berlin</a> <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbar2"> <span class="navbar-toggler-icon"></span> </button> <div class="navbar-collapse collapse" id="navbar2"> <ul class="navbar-nav"><li class="nav-item active"> <a class="nav-link" href="/events/2017-berlin/speakers">speakers</a> </li><li class="nav-item active"> <a class="nav-link" href="/events/2017-berlin/program">program</a> </li><li class="nav-item active"> <a class="nav-link" href="/events/2017-berlin/location">location</a> </li><li class="nav-item active"> <a class="nav-link" href="/events/2017-berlin/sponsor">sponsor</a> </li><li class="nav-item active"> <a class="nav-link" href="/events/2017-berlin/contact">contact</a> </li><li class="nav-item active"> <a class="nav-link" href="/events/2017-berlin/conduct">conduct</a> </li></ul> </div> </nav> <div class="container-fluid"> <div class="row"> <div class="col-md-12"><div class = "row"> <div class = "col-md-12 offset-md-1"> <h2 class="speaker-page">Jan Nabbefeld</h2> </div> </div> <div class = "row"> <div class = "col-md-4 offset-md-1"> <span class="speaker-page content-text"> </span> <div class="speaker-bio-talks"> <h3>Jan Nabbefeld at Berlin 2017</h3> <ul class="list-group"> </ul> </div> </div> <div class = "col-md-3 offset-md-1"><img src = /img/speaker-default.jpg class="speaker-page" alt="Jan Nabbefeld"/><br /></div> </div> <div class="row cta-row"> <div class="col-md-12"><h4 class="sponsor-cta">Evening Event Sponsors</h4></div> </div><div class="row sponsor-row"><div class = "col-lg-1 col-md-2 col-4"> <a href = "https://www.noris.de/"><img src = "/img/sponsors/2016-norisnetwork.png" alt = "noris network AG" title = "noris network AG" class="img-fluid"></a> </div></div><div class="row cta-row"> <div class="col-md-12"><h4 class="sponsor-cta">Platinum Sponsors</h4></div> </div><div class="row sponsor-row"><div class = "col-lg-1 col-md-2 col-4"> <a href = "https://gocd.org/"><img src = "/img/sponsors/thoughtworks-gocd-before-20190213.png" alt = "GoCD" title = "GoCD" class="img-fluid"></a> </div><div class = "col-lg-1 col-md-2 col-4"> <a href = "http://logz.io"><img src = "/img/sponsors/logz.png" alt = "logz" title = "logz" class="img-fluid"></a> </div><div class = "col-lg-1 col-md-2 col-4"> <a href = "http://www.idealo.de/"><img src = "/img/sponsors/2016-idealo.png" alt = "Idealo" title = "Idealo" class="img-fluid"></a> </div><div class = "col-lg-1 col-md-2 col-4"> <a href = "http://www.opsgenie.com"><img src = "/img/sponsors/opsgenie.png" alt = "OpsGenie" title = "OpsGenie" class="img-fluid"></a> </div></div><div class="row cta-row"> <div class="col-md-12"><h4 class="sponsor-cta">Gold Sponsors</h4></div> </div><div class="row sponsor-row"><div class = "col-lg-1 col-md-2 col-4"> <a href = "https://www.codecentric.de"><img src = "/img/sponsors/codecentric.png" alt = "Codecentric" title = "Codecentric" class="img-fluid"></a> </div><div class = "col-lg-1 col-md-2 col-4"> <a href = "https://kreuzwerker.de"><img src = "/img/sponsors/kreuzwerker.png" alt = "kreuzwerker" title = "kreuzwerker" class="img-fluid"></a> </div><div class = "col-lg-1 col-md-2 col-4"> <a href = "http://chef.io"><img src = "/img/sponsors/chef.png" alt = "Chef Software, Inc" title = "Chef Software, Inc" class="img-fluid"></a> </div></div><div class="row cta-row"> <div class="col-md-12"><h4 class="sponsor-cta">Silver Sponsors</h4></div> </div><div class="row sponsor-row"><div class = "col-lg-1 col-md-2 col-4"> <a href = "https://www.solarisbank.de"><img src = "/img/sponsors/solarisbank.png" alt = "solarisBank" title = "solarisBank" class="img-fluid"></a> </div><div class = "col-lg-1 col-md-2 col-4"> <a href = "https://www.burda-forward.de"><img src = "/img/sponsors/burdaforward.png" alt = "BurdaForward" title = "BurdaForward" class="img-fluid"></a> </div></div><div class="row cta-row"> <div class="col-md-12"><h4 class="sponsor-cta">Partner Sponsors</h4></div> </div><div class="row sponsor-row"><div class = "col-lg-1 col-md-2 col-4"> <a href = "http://www.linux-magazin.de"><img src = "/img/sponsors/linuxmagazin.png" alt = "linuxmagazin" title = "linuxmagazin" class="img-fluid"></a> </div><div class = "col-lg-1 col-md-2 col-4"> <a href = "http://www.netways.de"><img src = "/img/sponsors/netways.png" alt = "NETWAYS GmbH" title = "NETWAYS GmbH" class="img-fluid"></a> </div><div class = "col-lg-1 col-md-2 col-4"> <a href = "http://www.admin-magazine.com/DevOps"><img src = "/img/sponsors/admin-magazine.png" alt = "admin-magazine" title = "admin-magazine" class="img-fluid"></a> </div></div><br /> </div></div> </div> <nav class="navbar bottom navbar-light footer-nav-row" style="background-color: #bfbfc1;"> <div class = "row"> <div class = "col-md-12 footer-nav-background"> <div class = "row"> <div class = "col-md-6 col-lg-3 footer-nav-col"> <h3 class="footer-nav">@DEVOPSDAYS</h3> <div> <a class="twitter-timeline" data-dnt="true" href="https://twitter.com/devopsdays/lists/devopsdays" data-chrome="noheader" height="440"></a> <script> ! function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0], p = /^http:/.test(d.location) ? 'http' : 'https'; if (!d.getElementById(id)) { js = d.createElement(s); js.id = id; js.src = p + "://platform.twitter.com/widgets.js"; fjs.parentNode.insertBefore(js, fjs); } }(document, "script", "twitter-wjs"); </script> </div> </div> <div class="col-md-6 col-lg-3 footer-nav-col footer-content"> <h3 class="footer-nav">BLOG</h3><a href = "https://www.devopsdays.org/blog/2019/05/10/10-years-of-devopsdays/"><h1 class = "footer-heading">10 years of devopsdays</h1></a><h2 class="footer-heading">by Kris Buytaert - 10 May, 2019</h2><p class="footer-content">It&rsquo;s hard to believe but it is almost 10 years ago since #devopsdays happened for the first time in Gent. Back then there were almost 70 of us talking about topics that were of interest to both Operations and Development, we were exchanging our ideas and experiences `on how we were improving the quality of software delivery. Our ideas got started on the crossroads of Open Source, Agile and early Cloud Adoption.</p><a href = "https://www.devopsdays.org/blog/"><h1 class = "footer-heading">Blogs</h1></a><h2 class="footer-heading">10 May, 2019</h2><p class="footer-content"></p><a href="https://www.devopsdays.org/blog/index.xml">Feed</a> </div> <div class="col-md-6 col-lg-3 footer-nav-col"> <h3 class="footer-nav">CFP OPEN</h3><a href = "/events/2019-campinas" class = "footer-content">Campinas</a><br /><a href = "/events/2019-macapa" class = "footer-content">Macapá</a><br /><a href = "/events/2019-shanghai" class = "footer-content">Shanghai</a><br /><a href = "/events/2019-recife" class = "footer-content">Recife</a><br /><a href = "/events/2020-charlotte" class = "footer-content">Charlotte</a><br /><a href = "/events/2020-prague" class = "footer-content">Prague</a><br /><a href = "/events/2020-tokyo" class = "footer-content">Tokyo</a><br /><a href = "/events/2020-salt-lake-city" class = "footer-content">Salt Lake City</a><br /> <br />Propose a talk at an event near you!<br /> </div> <div class="col-md-6 col-lg-3 footer-nav-col"> <h3 class="footer-nav">About</h3> devopsdays is a worldwide community conference series for anyone interested in IT improvement.<br /><br /> <a href="/about/" class = "footer-content">About devopsdays</a><br /> <a href="/privacy/" class = "footer-content">Privacy Policy</a><br /> <a href="/conduct/" class = "footer-content">Code of Conduct</a> <br /> <br /> <a href="https://www.netlify.com"> <img src="/img/netlify-light.png" alt="Deploys by Netlify"> </a> </div> </div> </div> </div> </nav> <script> $(document).ready(function () { $("#share").jsSocials({ shares: ["email", {share: "twitter", via: ''}, "facebook", "linkedin"], text: 'devopsdays Berlin - 2017', showLabel: false, showCount: false }); }); </script> </body> </html>
apache-2.0
tapglue/android_sdk
v1/tapglue-android-sdk/tapglue-android-sdk/src/main/java/com/tapglue/managers/TGFeedManagerImpl.java
8313
/* * Copyright (c) 2015-2016 Tapglue (https://www.tapglue.com/). All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package com.tapglue.managers; import android.content.Context; import android.content.SharedPreferences; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import com.google.gson.Gson; import com.google.gson.reflect.TypeToken; import com.tapglue.Tapglue; import com.tapglue.model.TGEventsList; import com.tapglue.model.TGFeed; import com.tapglue.model.TGFeedCount; import com.tapglue.model.TGPostsList; import com.tapglue.model.queries.TGQuery; import com.tapglue.networking.requests.TGRequestCallback; import com.tapglue.networking.requests.TGRequestErrorType; public class TGFeedManagerImpl extends AbstractTGManager implements TGFeedManager { private static final String CACHE_KEY = "FEED_CACHE"; public TGFeedManagerImpl(Tapglue instance) { super(instance); } /** * Get feed from cache * * @param callback */ @Override public void cachedFeedForCurrentUser(@NonNull final TGRequestCallback<TGFeed> callback) { if (instance.getUserManager().getCurrentUser() == null) { callback.onRequestError(new TGRequestErrorType(TGRequestErrorType.ErrorType.USER_NOT_LOGGED_IN)); return; } getCachedFeedIfAvailable(callback); } /** * Return cached feed * * @param callback */ @Override public void getCachedFeedIfAvailable(@NonNull final TGRequestCallback<TGFeed> callback) { SharedPreferences cache = instance.getContext().getSharedPreferences(TGFeedManagerImpl.class.toString(), Context.MODE_PRIVATE); if (!cache.contains(CACHE_KEY)) { callback.onRequestError(new TGRequestErrorType(TGRequestErrorType.ErrorType.NO_CACHE_OBJECT)); return; } TGFeed feed = new Gson().fromJson(cache.getString(CACHE_KEY, null), new TypeToken<TGFeed>() {}.getType()); callback.onRequestFinished(feed, false); } @Override public void retrieveEventsFeedForCurrentUser(@NonNull final TGRequestCallback<TGEventsList> callback) { retrieveEventsFeedForCurrentUser(null, callback); } @Override public void retrieveEventsFeedForCurrentUser(@Nullable TGQuery whereParameters, @NonNull final TGRequestCallback<TGEventsList> callback) { if (instance.getUserManager().getCurrentUser() == null) { callback.onRequestError(new TGRequestErrorType(TGRequestErrorType.ErrorType.USER_NOT_LOGGED_IN)); return; } instance.createRequest().getEvents(whereParameters, callback); } @Override public void retrieveEventsForCurrentUser(@NonNull final TGRequestCallback<TGEventsList> callback) { retrieveEventsForCurrentUser(null, callback); } @Override public void retrieveEventsForCurrentUser(@Nullable TGQuery whereParameters, @NonNull final TGRequestCallback<TGEventsList> callback) { if (instance.getUserManager().getCurrentUser() == null) { callback.onRequestError(new TGRequestErrorType(TGRequestErrorType.ErrorType.USER_NOT_LOGGED_IN)); return; } instance.createRequest().getEvents(whereParameters, callback); } @Override public void retrieveEventsForUser(@NonNull Long userId, @NonNull final TGRequestCallback<TGEventsList> callback) { retrieveEventsForUser(userId, null, callback); } @Override public void retrieveEventsForUser(@NonNull Long userId, TGQuery whereParameters, @NonNull final TGRequestCallback<TGEventsList> callback) { if (userId == null) { callback.onRequestError(new TGRequestErrorType(TGRequestErrorType.ErrorType.NULL_INPUT)); return; } else if (instance.getUserManager().getCurrentUser() == null) { callback.onRequestError(new TGRequestErrorType(TGRequestErrorType.ErrorType.USER_NOT_LOGGED_IN)); return; } instance.createRequest().getEvents(userId, whereParameters, callback); } @Override public void retrieveNewsFeedForCurrentUser(@NonNull final TGRequestCallback<TGFeed> callback) { retrieveNewsFeedForCurrentUser(null, callback); } @Override public void retrieveNewsFeedForCurrentUser(@Nullable TGQuery whereParameters, @NonNull final TGRequestCallback<TGFeed> callback) { instance.createRequest().getFeed(whereParameters, new TGRequestCallback<TGFeed>() { @Override public boolean callbackIsEnabled() { return callback.callbackIsEnabled(); } @Override public void onRequestError(TGRequestErrorType cause) { callback.onRequestError(cause); } @Override public void onRequestFinished(TGFeed output, boolean changeDoneOnline) { saveFeedToCache(output); callback.onRequestFinished(output, changeDoneOnline); } }); } @Override public void retrievePostsFeedForCurrentUser(@NonNull final TGRequestCallback<TGPostsList> callback) { if (instance.getUserManager().getCurrentUser() == null) { callback.onRequestError(new TGRequestErrorType(TGRequestErrorType.ErrorType.USER_NOT_LOGGED_IN)); return; } instance.createRequest().getMyPosts(callback); } @Override public void retrievePostsForCurrentUser(@NonNull final TGRequestCallback<TGPostsList> callback) { if (instance.getUserManager().getCurrentUser() == null) { callback.onRequestError(new TGRequestErrorType(TGRequestErrorType.ErrorType.USER_NOT_LOGGED_IN)); return; } instance.createRequest().getMyPosts(callback); } @Override public void retrievePostsForUser(@NonNull Long userId, @NonNull final TGRequestCallback<TGPostsList> callback) { if (userId == null) { callback.onRequestError(new TGRequestErrorType(TGRequestErrorType.ErrorType.NULL_INPUT)); return; } else if (instance.getUserManager().getCurrentUser() == null) { callback.onRequestError(new TGRequestErrorType(TGRequestErrorType.ErrorType.USER_NOT_LOGGED_IN)); return; } instance.createRequest().getUserPosts(userId, callback); } @Override public void retrieveUnreadCountForCurrentUser(@NonNull final TGRequestCallback<TGFeedCount> callback) { if (instance.getUserManager().getCurrentUser() == null) { callback.onRequestError(new TGRequestErrorType(TGRequestErrorType.ErrorType.USER_NOT_LOGGED_IN)); return; } instance.createRequest().getFeedCount(callback); } @Override public void retrieveUnreadFeedForCurrentUser(@NonNull final TGRequestCallback<TGFeed> callback) { if (instance.getUserManager().getCurrentUser() == null) { callback.onRequestError(new TGRequestErrorType(TGRequestErrorType.ErrorType.USER_NOT_LOGGED_IN)); return; } instance.createRequest().getUnreadFeed(callback); } /** * Save feed to cache * * @param output */ private void saveFeedToCache(@Nullable TGFeed output) { SharedPreferences cache = instance.getContext().getSharedPreferences(TGFeedManagerImpl.class.toString(), Context.MODE_PRIVATE); if (output == null) { if (cache.contains(CACHE_KEY)) { cache.edit().remove(CACHE_KEY).apply(); } } else { cache.edit().putString(CACHE_KEY, new Gson().toJson(output, new TypeToken<TGFeed>() { }.getType())).apply(); } } }
apache-2.0
kinverarity1/geotransect
profile_plot.py
4222
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Defines various data containers for plotting a transect. This file is not used in the current version of `geotransect` but is kept here in case it's useful later. :copyright: 2015 Agile Geoscience :license: Apache 2.0 """ import sys import os import numpy as np from scipy import fft import matplotlib.pyplot as plt import matplotlib.cm as cm import obspy from plot_utils import add_subplot_axes filename = sys.argv[1] segyfile = os.path.basename(filename) # Read all traces. section = obspy.read(filename) r_elevs = [] s_elevs = [] esp = [] # energy source point number ens = [] # ensemble number for t in section.traces: nsamples = t.stats.segy.trace_header.number_of_samples_in_this_trace dt = t.stats.segy.trace_header.sample_interval_in_ms_for_this_trace if dt > 100: dt /= 1000. r_elevs.append(t.stats.segy.trace_header.datum_elevation_at_receiver_group) s_elevs.append(t.stats.segy.trace_header.receiver_group_elevation) esp.append(t.stats.segy.trace_header.energy_source_point_number) ens.append(t.stats.segy.trace_header.ensemble_number) ntraces = len(section.traces) tbase = np.arange(0, nsamples * dt, dt) tstart = 0 tend = tbase[-1] aspect = float(ntraces) / float(nsamples) nf = 1.0 print 'ntraces', ntraces print 'nsamples', nsamples print 'dt', dt/nf data = np.zeros((nsamples, ntraces)) for i, trace in enumerate(section.traces): data[:, i] = trace.data line_extents = {'first_trace': 1, 'last_trace': ntraces, 'start_time': tstart, 'end_time': tend } clip_val = np.percentile(data, 99.0) print "clip_val", clip_val print "max_val", np.amax(data) print "min_val", np.amin(data) print "tstart", tstart print "tend", tend largest = max(np.amax(data), abs(np.amin(data))) # MAIN PLOT h = (tend-tstart) / 250.0 w = ntraces / 250.0 fig = plt.figure(figsize=(10, 10), facecolor='w') # Seismic data ax = fig.add_axes([0.05, 0.05, 0.9, 0.95]) im = ax.imshow(data, cmap=cm.gray, origin='upper', vmin=-clip_val, vmax=clip_val, extent=(line_extents['first_trace'], line_extents['last_trace'], line_extents['end_time'], line_extents['start_time']), aspect = aspect * 0.5 ) ax.set_ylabel('Two-way time [ms]') ax.set_xlabel('Trace no.') ax.grid() ax.set_title(segyfile) # Colourbar extreme = max(np.amax(data), abs(np.amin(data))) colorbar_ax = add_subplot_axes(ax, [0.075, 0.075, 0.025, 0.15]) fig.colorbar(im, cax=colorbar_ax) colorbar_ax.text(1.15, 1.1, '%3.0f' % -extreme, transform=colorbar_ax.transAxes, ha='left', va='top') colorbar_ax.text(1.15, -0.05, '%3.0f' % extreme, transform=colorbar_ax.transAxes, ha='left', fontsize=10) colorbar_ax.set_axis_off() # Power spectrum S = abs(fft(data[:, 1])) faxis = np.fft.fftfreq(len(data[:, 1]), d=(1/nf)*dt*1e-6) spec_ax = add_subplot_axes(ax, [0.50, 0.075, 0.2, 0.15]) spec_ax.plot(faxis[:len(faxis)//4], np.log10(S[0:len(faxis)//4]), 'b', lw=2) spec_ax.set_xlabel('frequency [Hz]', fontsize=10) spec_ax.set_xticklabels([0, 100, 200, 300], fontsize=10) # spec_ax.set_xticklabels(spec_ax.get_xticks(), fontsize=10) spec_ax.set_yticklabels(spec_ax.get_yticks(), fontsize=10) spec_ax.set_yticks([]) spec_ax.set_yticklabels([]) spec_ax.text(.95, .9, 'Power spectrum', horizontalalignment='right', transform=spec_ax.transAxes, fontsize=10 ) spec_ax.grid('on') # Histogram hist_ax = add_subplot_axes(ax, [0.75, 0.075, 0.2, 0.15]) hist_line = hist_ax.hist(np.ravel(data), bins=int(100.0 / (clip_val/largest))) hist_ax.set_xlim(-clip_val, clip_val) # hist_ax.set_xticklabels([]) hist_ax.set_yticks([]) hist_ax.set_xticklabels([]) hist_ax.set_ylim(hist_ax.get_ylim()[0], hist_ax.get_ylim()[1]), hist_ax.set_yticks([]) hist_ax.text(.95, .9, 'Histogram', horizontalalignment='right', transform=hist_ax.transAxes, fontsize=10 ) plt.show()
apache-2.0
deepu105/generator-jhipster
generators/client/templates/angular/src/main/webapp/app/admin/logs/_logs.component.html
2509
<%# Copyright 2013-2017 the original author or authors from the JHipster project. This file is part of the JHipster project, see http://www.jhipster.tech/ for more information. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -%> <div class="table-responsive" *ngIf="loggers"> <h2 jhiTranslate="logs.title">Logs</h2> <p jhiTranslate="logs.nbloggers" translateValues="{total: '{{ loggers.length }}'}">There are {{ loggers.length }} loggers.</p> <span jhiTranslate="logs.filter">Filter</span> <input type="text" [(ngModel)]="filter" class="form-control"> <table class="table table-sm table-striped table-bordered"> <thead> <tr title="click to order"> <th (click)="orderProp = 'name'; reverse=!reverse"><span jhiTranslate="logs.table.name">Name</span></th> <th (click)="orderProp = 'level'; reverse=!reverse"><span jhiTranslate="logs.table.level">Level</span></th> </tr> </thead> <tr *ngFor="let logger of (loggers | pureFilter:filter:'name' | orderBy:orderProp:reverse)"> <td><small>{{logger.name | slice:0:140}}</small></td> <td> <button (click)="changeLevel(logger.name, 'TRACE')" [ngClass]="(logger.level=='TRACE') ? 'btn-danger' : 'btn-light'" class="btn btn-sm">TRACE</button> <button (click)="changeLevel(logger.name, 'DEBUG')" [ngClass]="(logger.level=='DEBUG') ? 'btn-warning' : 'btn-light'" class="btn btn-sm">DEBUG</button> <button (click)="changeLevel(logger.name, 'INFO')" [ngClass]="(logger.level=='INFO') ? 'btn-info' : 'btn-light'" class="btn btn-sm">INFO</button> <button (click)="changeLevel(logger.name, 'WARN')" [ngClass]="(logger.level=='WARN') ? 'btn-success' : 'btn-light'" class="btn btn-sm">WARN</button> <button (click)="changeLevel(logger.name, 'ERROR')" [ngClass]="(logger.level=='ERROR') ? 'btn-primary' : 'btn-light'" class="btn btn-sm">ERROR</button> </td> </tr> </table> </div>
apache-2.0
vkhatri/chef-icinga2
resources/idomysqlconnection.rb
1543
# # Cookbook Name:: icinga2 # Resource:: idomysqlconnection # # Copyright 2014, Virender Khatri # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # actions :create, :delete default_action :create attribute :library, :kind_of => String, :default => 'db_ido_mysql' attribute :host, :kind_of => String, :default => 'localhost' attribute :port, :kind_of => [String, Integer], :default => '3306' attribute :user, :kind_of => String, :default => 'icinga' attribute :password, :kind_of => String, :default => 'icinga' attribute :database, :kind_of => String, :default => 'icinga' attribute :table_prefix, :kind_of => String, :default => 'icinga_' attribute :instance_name, :kind_of => String, :default => 'default' attribute :instance_description, :kind_of => String, :default => nil attribute :enable_ha, :kind_of => [TrueClass, FalseClass], :default => nil attribute :failover_timeout, :kind_of => String, :default => '60s' attribute :cleanup, :kind_of => Hash, :default => nil attribute :categories, :kind_of => Array, :default => nil
apache-2.0
xasx/assertj-core
src/test/java/org/assertj/core/util/CaseInsensitiveStringComparator.java
1076
/* * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. * * Copyright 2012-2019 the original author or authors. */ package org.assertj.core.util; import java.util.Comparator; public class CaseInsensitiveStringComparator implements Comparator<String> { public final static CaseInsensitiveStringComparator instance = new CaseInsensitiveStringComparator(); @Override public int compare(String s1, String s2) { if (s1 == null && s2 == null) return 0; if (s1 == null) return -1; if (s2 == null) return 1; return s1.toLowerCase().compareTo(s2.toLowerCase()); } }
apache-2.0
arunkumarsekar06/megam_api
lib/megam/core/components.rb
6597
# Copyright:: Copyright (c) 2012, 2014 Megam Systems # License:: Apache License, Version 2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # module Megam class Components < Megam::ServerAPI def initialize(email=nil, api_key=nil, host=nil) @id = nil @name =nil @tosca_type = nil @inputs = [] @outputs = [] @artifacts = {} @artifact_type = nil @content = nil @artifact_requirements = [] @related_components = [] @operations = [] @status = nil @created_at = nil super(email, api_key, host) end def components self end def id(arg=nil) if arg != nil @id = arg else @id end end def name(arg=nil) if arg != nil @name = arg else @name end end def tosca_type(arg=nil) if arg != nil @tosca_type = arg else @tosca_type end end def inputs(arg=[]) if arg != [] @inputs = arg else @inputs end end def outputs(arg=[]) if arg != [] @outputs = arg else @outputs end end def artifacts(arg=nil) if arg != nil @artifacts = arg else @artifacts end end def artifact_type(arg=nil) if arg != nil @artifact_type = arg else @artifact_type end end def content(arg=nil) if arg != nil @content = arg else @content end end def artifact_requirements(arg=[]) if arg != [] @artifact_requirements = arg else @artifact_requirements end end def related_components(arg=[]) if arg != [] @related_components = arg else @related_components end end def operations(arg=[]) if arg != [] @operations = arg else @operations end end def status(arg=nil) if arg != nil @status = arg else @status end end def created_at(arg=nil) if arg != nil @created_at = arg else @created_at end end def error? crocked = true if (some_msg.has_key?(:msg_type) && some_msg[:msg_type] == "error") end # Transform the ruby obj -> to a Hash def to_hash index_hash = Hash.new index_hash["json_claz"] = self.class.name index_hash["id"] = id index_hash["name"] = name index_hash["tosca_type"] = tosca_type index_hash["inputs"] = inputs index_hash["outputs"] = outputs index_hash["artifacts"] = artifacts index_hash["related_components"] = related_components index_hash["operations"] = operations index_hash["status"] = status index_hash["created_at"] = created_at index_hash end # Serialize this object as a hash: called from JsonCompat. # Verify if this called from JsonCompat during testing. def to_json(*a) for_json.to_json(*a) end def for_json result = { "id" => id, "name" => name, "tosca_type" => tosca_type, "inputs" => inputs, "outputs" => outputs, "artifacts" => artifacts, "related_components" => related_components, "operations" => operations, "status" => status, "created_at" => created_at } result end def self.json_create(o) asm = new asm.id(o["id"]) if o.has_key?("id") asm.name(o["name"]) if o.has_key?("name") asm.tosca_type(o["tosca_type"]) if o.has_key?("tosca_type") asm.inputs(o["inputs"]) if o.has_key?("inputs") asm.outputs(o["outputs"]) if o.has_key?("outputs") ar = o["artifacts"] asm.artifacts[:artifact_type] = ar["artifact_type"] if ar && ar.has_key?("artifact_type") asm.artifacts[:content] = ar["content"] if ar && ar.has_key?("content") asm.artifacts[:artifact_requirements] = ar["artifact_requirements"] if ar && ar.has_key?("artifact_requirements") asm.related_components(o["related_components"]) if o.has_key?("related_components") asm.operations(o["operations"]) if o.has_key?("operations") asm.status(o["status"]) if o.has_key?("status") asm.created_at(o["created_at"]) if o.has_key?("created_at") asm end def self.from_hash(o,tmp_email=nil, tmp_api_key=nil, tmp_host=nil) asm = self.new(tmp_email, tmp_api_key, tmp_host) asm.from_hash(o) asm end def from_hash(o) @id = o["id"] if o.has_key?("id") @name = o["name"] if o.has_key?("name") @tosca_type = o["tosca_type"] if o.has_key?("tosca_type") @inputs = o["inputs"] if o.has_key?("inputs") @outputs = o["outputs"] if o.has_key?("outputs") @artifacts = o["artifacts"] if o.has_key?("artifacts") @related_components = o["related_components"] if o.has_key?("related_components") @operations = o["operations"] if o.has_key?("operations") @status = o["status"] if o.has_key?("status") @created_at = o["created_at"] if o.has_key?("created_at") self end def self.create(params) asm = from_hash(params, params["email"], params["api_key"], params["host"]) asm.create end # Load a account by email_p def self.show(params) asm = self.new(params["email"], params["api_key"], params["host"]) asm.megam_rest.get_components(params["id"]) end def self.update(params) asm = from_hash(params, params["email"] || params[:email], params["api_key"] || params[:api_key], params["host"] || params[:host]) asm.update end # Create the node via the REST API def update megam_rest.update_component(to_hash) end def to_s Megam::Stuff.styled_hash(to_hash) end end end
apache-2.0
WeRockStar/iosched
lib/src/main/java/com/google/samples/apps/iosched/provider/ScheduleProvider.java
51535
/* * Copyright 2015 Google Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.google.samples.apps.iosched.provider; import android.app.SearchManager; import android.content.ContentProvider; import android.content.ContentProviderOperation; import android.content.ContentProviderResult; import android.content.ContentValues; import android.content.Context; import android.content.OperationApplicationException; import android.database.Cursor; import android.database.MatrixCursor; import android.database.sqlite.SQLiteConstraintException; import android.database.sqlite.SQLiteDatabase; import android.net.Uri; import android.os.ParcelFileDescriptor; import android.provider.BaseColumns; import android.text.TextUtils; import android.util.Log; import com.google.samples.apps.iosched.Config; import com.google.samples.apps.iosched.appwidget.ScheduleWidgetProvider; import com.google.samples.apps.iosched.provider.ScheduleContract.Announcements; import com.google.samples.apps.iosched.provider.ScheduleContract.Blocks; import com.google.samples.apps.iosched.provider.ScheduleContract.Feedback; import com.google.samples.apps.iosched.provider.ScheduleContract.HashtagColumns; import com.google.samples.apps.iosched.provider.ScheduleContract.Hashtags; import com.google.samples.apps.iosched.provider.ScheduleContract.MyFeedbackSubmitted; import com.google.samples.apps.iosched.provider.ScheduleContract.MyReservationColumns; import com.google.samples.apps.iosched.provider.ScheduleContract.MyReservations; import com.google.samples.apps.iosched.provider.ScheduleContract.MySchedule; import com.google.samples.apps.iosched.provider.ScheduleContract.MyScheduleColumns; import com.google.samples.apps.iosched.provider.ScheduleContract.MyViewedVideos; import com.google.samples.apps.iosched.provider.ScheduleContract.Rooms; import com.google.samples.apps.iosched.provider.ScheduleContract.SearchSuggest; import com.google.samples.apps.iosched.provider.ScheduleContract.SearchTopicsSessions; import com.google.samples.apps.iosched.provider.ScheduleContract.Sessions; import com.google.samples.apps.iosched.provider.ScheduleContract.Speakers; import com.google.samples.apps.iosched.provider.ScheduleContract.Tags; import com.google.samples.apps.iosched.provider.ScheduleContract.VideoColumns; import com.google.samples.apps.iosched.provider.ScheduleContract.Videos; import com.google.samples.apps.iosched.provider.ScheduleDatabase.SessionsSearchColumns; import com.google.samples.apps.iosched.provider.ScheduleDatabase.SessionsSpeakers; import com.google.samples.apps.iosched.provider.ScheduleDatabase.Tables; import com.google.samples.apps.iosched.settings.SettingsUtils; import com.google.samples.apps.iosched.util.AccountUtils; import com.google.samples.apps.iosched.util.SelectionBuilder; import java.io.FileDescriptor; import java.io.FileNotFoundException; import java.io.PrintWriter; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import static com.google.samples.apps.iosched.util.LogUtils.LOGD; import static com.google.samples.apps.iosched.util.LogUtils.LOGE; import static com.google.samples.apps.iosched.util.LogUtils.LOGV; import static com.google.samples.apps.iosched.util.LogUtils.makeLogTag; /** * {@link android.content.ContentProvider} that stores {@link ScheduleContract} data. Data is * usually inserted by {@link com.google.samples.apps.iosched.sync.SyncHelper}, and queried using * {@link android.support.v4.app.LoaderManager} pattern. */ public class ScheduleProvider extends ContentProvider { private static final String TAG = makeLogTag(ScheduleProvider.class); private ScheduleDatabase mOpenHelper; private ScheduleProviderUriMatcher mUriMatcher; /** * Providing important state information to be included in bug reports. * * !!! Remember !!! Any important data logged to {@code writer} shouldn't contain personally * identifiable information as it can be seen in bugreports. */ @Override public void dump(FileDescriptor fd, PrintWriter writer, String[] args) { Context context = getContext(); // Using try/catch block in case there are issues retrieving information to log. try { // Calling append in multiple calls is typically better than creating net new strings to // pass to method invocations. writer.print("Last sync attempted: "); writer.println(new java.util.Date(SettingsUtils.getLastSyncAttemptedTime(context))); writer.print("Last sync successful: "); writer.println(new java.util.Date(SettingsUtils.getLastSyncSucceededTime(context))); writer.print("Current sync interval: "); writer.println(SettingsUtils.getCurSyncInterval(context)); writer.print("Is an account active: "); writer.println(AccountUtils.hasActiveAccount(context)); boolean canGetAuthToken = !TextUtils.isEmpty(AccountUtils.getAuthToken(context)); writer.print("Can an auth token be retrieved: "); writer.println(canGetAuthToken); } catch (Exception exception) { writer.append("Exception while dumping state: "); exception.printStackTrace(writer); } } @Override public boolean onCreate() { mOpenHelper = new ScheduleDatabase(getContext()); mUriMatcher = new ScheduleProviderUriMatcher(); return true; } private void deleteDatabase() { // TODO: wait for content provider operations to finish, then tear down mOpenHelper.close(); Context context = getContext(); ScheduleDatabase.deleteDatabase(context); mOpenHelper = new ScheduleDatabase(getContext()); } /** {@inheritDoc} */ @Override public String getType(Uri uri) { ScheduleUriEnum matchingUriEnum = mUriMatcher.matchUri(uri); return matchingUriEnum.contentType; } /** * Returns a tuple of question marks. For example, if {@code count} is 3, returns "(?,?,?)". */ private String makeQuestionMarkTuple(int count) { if (count < 1) { return "()"; } StringBuilder stringBuilder = new StringBuilder(); stringBuilder.append("(?"); for (int i = 1; i < count; i++) { stringBuilder.append(",?"); } stringBuilder.append(")"); return stringBuilder.toString(); } /** * Adds the {@code tagsFilter} query parameter to the given {@code builder}. This query * parameter is used when the user makes a selection containing multiple filters. */ private void addTagsFilter(SelectionBuilder builder, String tagsFilter, String numCategories) { // Note: for context, remember that session queries are done on a join of sessions // and the sessions_tags relationship table, and are GROUP'ed BY the session ID. String[] requiredTags = tagsFilter.split(","); if (requiredTags.length == 0) { // filtering by 0 tags -- no-op return; } else if (requiredTags.length == 1) { // filtering by only one tag, so a simple WHERE clause suffices builder.where(Tags.TAG_ID + "=?", requiredTags[0]); } else { // Filtering by multiple tags, so we must add a WHERE clause with an IN operator, // and add a HAVING statement to exclude groups that fall short of the number // of required tags. For example, if requiredTags is { "X", "Y", "Z" }, and a certain // session only has tags "X" and "Y", it will be excluded by the HAVING statement. int categories = 1; if (numCategories != null && TextUtils.isDigitsOnly(numCategories)) { try { categories = Integer.parseInt(numCategories); LOGD(TAG, "Categories being used " + categories); } catch (Exception ex) { LOGE(TAG, "exception parsing categories ", ex); } } String questionMarkTuple = makeQuestionMarkTuple(requiredTags.length); builder.where(Tags.TAG_ID + " IN " + questionMarkTuple, requiredTags); builder.having( "COUNT(" + Qualified.SESSIONS_SESSION_ID + ") >= " + categories); } } /** {@inheritDoc} */ @Override public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder) { final SQLiteDatabase db = mOpenHelper.getReadableDatabase(); String tagsFilter = uri.getQueryParameter(Sessions.QUERY_PARAMETER_TAG_FILTER); String categories = uri.getQueryParameter(Sessions.QUERY_PARAMETER_CATEGORIES); ScheduleUriEnum matchingUriEnum = mUriMatcher.matchUri(uri); // Avoid the expensive string concatenation below if not loggable. if (Log.isLoggable(TAG, Log.VERBOSE)) { LOGV(TAG, "uri=" + uri + " code=" + matchingUriEnum.code + " proj=" + Arrays.toString(projection) + " selection=" + selection + " args=" + Arrays.toString(selectionArgs) + ")"); } switch (matchingUriEnum) { default: { // Most cases are handled with simple SelectionBuilder. final SelectionBuilder builder = buildExpandedSelection(uri, matchingUriEnum.code); // If a special filter was specified, try to apply it. if (!TextUtils.isEmpty(tagsFilter) && !TextUtils.isEmpty(categories)) { addTagsFilter(builder, tagsFilter, categories); } boolean distinct = ScheduleContractHelper.isQueryDistinct(uri); Cursor cursor = builder .where(selection, selectionArgs) .query(db, distinct, projection, sortOrder, null); Context context = getContext(); if (null != context) { cursor.setNotificationUri(context.getContentResolver(), uri); } return cursor; } case SEARCH_SUGGEST: { final SelectionBuilder builder = new SelectionBuilder(); // Adjust incoming query to become SQL text match. selectionArgs[0] = selectionArgs[0] + "%"; builder.table(Tables.SEARCH_SUGGEST); builder.where(selection, selectionArgs); builder.map(SearchManager.SUGGEST_COLUMN_QUERY, SearchManager.SUGGEST_COLUMN_TEXT_1); projection = new String[]{ BaseColumns._ID, SearchManager.SUGGEST_COLUMN_TEXT_1, SearchManager.SUGGEST_COLUMN_QUERY }; final String limit = uri.getQueryParameter(SearchManager.SUGGEST_PARAMETER_LIMIT); return builder.query(db, false, projection, SearchSuggest.DEFAULT_SORT, limit); } case SEARCH_TOPICS_SESSIONS: { if (selectionArgs == null || selectionArgs.length == 0) { return createMergedSearchCursor(null, null); } String selectionArg = selectionArgs[0] == null ? "" : selectionArgs[0]; // First we query the Tags table to find any tags that match the given query Cursor tags = query(Tags.CONTENT_URI, SearchTopicsSessions.TOPIC_TAG_PROJECTION, SearchTopicsSessions.TOPIC_TAG_SELECTION, new String[] {Config.Tags.CATEGORY_TRACK, selectionArg + "%"}, SearchTopicsSessions.TOPIC_TAG_SORT); // Then we query the sessions_search table and get a list of sessions that match // the given keywords. Cursor search = null; if (selectionArgs[0] != null) { // dont query if there was no selectionArg. search = query(ScheduleContract.Sessions.buildSearchUri(selectionArg), SearchTopicsSessions.SEARCH_SESSIONS_PROJECTION, null, null, ScheduleContract.Sessions.SORT_BY_TYPE_THEN_TIME); } // Now that we have two cursors, we merge the cursors and return a unified view // of the two result sets. return createMergedSearchCursor(tags, search); } } } /** * Create a {@link MatrixCursor} given the tags and search cursors. * * @param tags Cursor with the projection {@link SearchTopicsSessions#TOPIC_TAG_PROJECTION}. * @param search Cursor with the projection * {@link SearchTopicsSessions#SEARCH_SESSIONS_PROJECTION}. * @return Returns a MatrixCursor always with {@link SearchTopicsSessions#DEFAULT_PROJECTION} */ private Cursor createMergedSearchCursor(Cursor tags, Cursor search) { // How big should our MatrixCursor be? int maxCount = (tags == null ? 0 : tags.getCount()) + (search == null ? 0 : search.getCount()); MatrixCursor matrixCursor = new MatrixCursor( SearchTopicsSessions.DEFAULT_PROJECTION, maxCount); // Iterate over the tags cursor and add rows. if (tags != null && tags.moveToFirst()) { do { matrixCursor.addRow( new Object[]{ tags.getLong(0), tags.getString(1), /*tag_id*/ "{" + tags.getString(2) + "}", /*search_snippet*/ 1}); /*is_topic_tag*/ } while (tags.moveToNext()); } // Iterate over the search cursor and add rows. if (search != null && search.moveToFirst()) { do { matrixCursor.addRow( new Object[]{ search.getLong(0), search.getString(1), search.getString(2), /*search_snippet*/ 0}); /*is_topic_tag*/ } while (search.moveToNext()); } return matrixCursor; } /** {@inheritDoc} */ @Override public Uri insert(Uri uri, ContentValues values) { LOGV(TAG, "insert(uri=" + uri + ", values=" + values.toString() + ", account=" + getCurrentAccountName(uri, false) + ")"); final SQLiteDatabase db = mOpenHelper.getWritableDatabase(); ScheduleUriEnum matchingUriEnum = mUriMatcher.matchUri(uri); if (matchingUriEnum.table != null) { try { db.insertOrThrow(matchingUriEnum.table, null, values); notifyChange(uri); } catch (SQLiteConstraintException exception) { // Leaving this here as it's handy to to breakpoint on this throw when debugging a // bootstrap file issue. throw exception; } } switch (matchingUriEnum) { case BLOCKS: { return Blocks.buildBlockUri(values.getAsString(Blocks.BLOCK_ID)); } case CARDS: { return ScheduleContract.Cards.buildCardUri(values.getAsString( ScheduleContract.Cards.CARD_ID)); } case TAGS: { return Tags.buildTagUri(values.getAsString(Tags.TAG_ID)); } case ROOMS: { return Rooms.buildRoomUri(values.getAsString(Rooms.ROOM_ID)); } case SESSIONS: { return Sessions.buildSessionUri(values.getAsString(Sessions.SESSION_ID)); } case SESSIONS_ID_SPEAKERS: { return Speakers.buildSpeakerUri(values.getAsString(SessionsSpeakers.SPEAKER_ID)); } case SESSIONS_ID_TAGS: { return Tags.buildTagUri(values.getAsString(Tags.TAG_ID)); } case SESSIONS_ID_RELATED: { values.put(Sessions.SESSION_ID, Sessions.getSessionId(uri)); db.insertOrThrow(Tables.RELATED_SESSIONS, null, values); notifyChange(uri); return uri; } case MY_SCHEDULE: { values.put(MySchedule.MY_SCHEDULE_ACCOUNT_NAME, getCurrentAccountName(uri, false)); db.insertOrThrow(Tables.MY_SCHEDULE, null, values); notifyChange(uri); Uri sessionUri = Sessions.buildSessionUri( values.getAsString(MyScheduleColumns.SESSION_ID)); notifyChange(sessionUri); // Queries for sessions in user's schedule are affected by this change. notifyChange(Sessions.CONTENT_MY_SCHEDULE_URI); return sessionUri; } case MY_RESERVATIONS: { values.put(MyReservations.MY_RESERVATION_ACCOUNT_NAME, getCurrentAccountName(uri, false)); db.insertOrThrow(Tables.MY_RESERVATIONS, null, values); notifyChange(uri); Uri sessionUri = Sessions.buildSessionUri( values.getAsString(MyReservationColumns.SESSION_ID)); notifyChange(sessionUri); // Queries for sessions in user's schedule are affected by this change. notifyChange(Sessions.CONTENT_MY_SCHEDULE_URI); return sessionUri; } case MY_VIEWED_VIDEOS: { values.put(MyViewedVideos.MY_VIEWED_VIDEOS_ACCOUNT_NAME, getCurrentAccountName(uri, false)); db.insertOrThrow(Tables.MY_VIEWED_VIDEO, null, values); notifyChange(uri); Uri videoUri = Videos.buildVideoUri( values.getAsString(MyViewedVideos.VIDEO_ID)); notifyChange(videoUri); return videoUri; } case MY_FEEDBACK_SUBMITTED: { values.put(MyFeedbackSubmitted.MY_FEEDBACK_SUBMITTED_ACCOUNT_NAME, getCurrentAccountName(uri, false)); db.insertOrThrow(Tables.MY_FEEDBACK_SUBMITTED, null, values); notifyChange(uri); Uri sessionUri = Sessions.buildSessionUri( values.getAsString(MyFeedbackSubmitted.SESSION_ID)); notifyChange(sessionUri); return sessionUri; } case SPEAKERS: { return Speakers.buildSpeakerUri(values.getAsString(Speakers.SPEAKER_ID)); } case ANNOUNCEMENTS: { return Announcements.buildAnnouncementUri(values .getAsString(Announcements.ANNOUNCEMENT_ID)); } case SEARCH_SUGGEST: { return SearchSuggest.CONTENT_URI; } case MAPGEOJSON: { return ScheduleContract.MapGeoJson.buildGeoJsonUri(); } case MAPTILES: { return ScheduleContract.MapTiles.buildFloorUri(values.getAsString( ScheduleContract.MapTiles.TILE_FLOOR)); } case FEEDBACK_FOR_SESSION: { return Feedback.buildFeedbackUri(values.getAsString(Feedback.SESSION_ID)); } case HASHTAGS: { return Hashtags.buildHashtagUri(values.getAsString(Hashtags.HASHTAG_NAME)); } case VIDEOS: { return Videos.buildVideoUri(values.getAsString(Videos.VIDEO_ID)); } default: { throw new UnsupportedOperationException("Unknown insert uri: " + uri); } } } /** {@inheritDoc} */ @Override public int update(Uri uri, ContentValues values, String selection, String[] selectionArgs) { String accountName = getCurrentAccountName(uri, false); Uri notifyUri = null; LOGV(TAG, "update(uri=" + uri + ", values=" + values.toString() + ", account=" + accountName + ")"); boolean isAccountUpdateAllowed = ScheduleContractHelper.isAccountUpdateAllowed(uri); final SQLiteDatabase db = mOpenHelper.getWritableDatabase(); ScheduleUriEnum matchingUriEnum = mUriMatcher.matchUri(uri); if (matchingUriEnum == ScheduleUriEnum.SEARCH_INDEX) { // update the search index ScheduleDatabase.updateSessionSearchIndex(db); return 1; } final SelectionBuilder builder = buildSimpleSelection(uri); if (matchingUriEnum == ScheduleUriEnum.SESSIONS_ID_RELATED) { // update not supported return 0; } if (matchingUriEnum == ScheduleUriEnum.MY_SCHEDULE) { if (!isAccountUpdateAllowed) { values.remove(MySchedule.MY_SCHEDULE_ACCOUNT_NAME); } builder.where(MySchedule.MY_SCHEDULE_ACCOUNT_NAME + "=?", accountName); // Also notify session listeners. notifyUri = Sessions.CONTENT_MY_SCHEDULE_URI; } if (matchingUriEnum == ScheduleUriEnum.MY_RESERVATIONS) { values.remove(MyReservations.MY_RESERVATION_ACCOUNT_NAME); builder.where(MyReservations.MY_RESERVATION_ACCOUNT_NAME + "=?", accountName); } if (matchingUriEnum == ScheduleUriEnum.MY_VIEWED_VIDEOS) { values.remove(MyViewedVideos.MY_VIEWED_VIDEOS_ACCOUNT_NAME); builder.where(MyViewedVideos.MY_VIEWED_VIDEOS_ACCOUNT_NAME + "=?", accountName); } if (matchingUriEnum == ScheduleUriEnum.MY_FEEDBACK_SUBMITTED) { if (!isAccountUpdateAllowed) { values.remove(MyFeedbackSubmitted.MY_FEEDBACK_SUBMITTED_ACCOUNT_NAME); } builder.where(MyFeedbackSubmitted.MY_FEEDBACK_SUBMITTED_ACCOUNT_NAME + "=?", accountName); } int retVal = builder.where(selection, selectionArgs).update(db, values); if (retVal > 0) { notifyChange(uri); if (null != notifyUri) notifyChange(notifyUri); } return retVal; } /** {@inheritDoc} */ @Override public int delete(Uri uri, String selection, String[] selectionArgs) { String accountName = getCurrentAccountName(uri, false); LOGV(TAG, "delete(uri=" + uri + ", account=" + accountName + ")"); if (uri == ScheduleContract.BASE_CONTENT_URI) { // Handle whole database deletes (e.g. when signing out) deleteDatabase(); notifyChange(uri); return 1; } final SQLiteDatabase db = mOpenHelper.getWritableDatabase(); final SelectionBuilder builder = buildSimpleSelection(uri); ScheduleUriEnum matchingUriEnum = mUriMatcher.matchUri(uri); if (matchingUriEnum == ScheduleUriEnum.MY_SCHEDULE) { builder.where(MySchedule.MY_SCHEDULE_ACCOUNT_NAME + "=?", accountName); } if (matchingUriEnum == ScheduleUriEnum.MY_RESERVATIONS) { builder.where(MyReservations.MY_RESERVATION_ACCOUNT_NAME + "=?", accountName); } if (matchingUriEnum == ScheduleUriEnum.MY_VIEWED_VIDEOS) { builder.where(MyViewedVideos.MY_VIEWED_VIDEOS_ACCOUNT_NAME + "=?", accountName); } if (matchingUriEnum == ScheduleUriEnum.MY_FEEDBACK_SUBMITTED) { builder.where( MyFeedbackSubmitted.MY_FEEDBACK_SUBMITTED_ACCOUNT_NAME + "=?", accountName); } int retVal = builder.where(selection, selectionArgs).delete(db); if (retVal > 0) { notifyChange(uri); } return retVal; } /** * Notifies the system that the given {@code uri} data has changed. * <p/> * We only notify changes if the uri wasn't called by the sync adapter, to avoid issuing a large * amount of notifications while doing a sync. The * {@link com.google.samples.apps.iosched.sync.ConferenceDataHandler} notifies all top level * conference paths once the conference data sync is done, and the * {@link com.google.samples.apps.iosched.sync.userdata.AbstractUserDataSyncHelper} notifies all * user data related paths once the user data sync is done. */ private void notifyChange(Uri uri) { if (!ScheduleContractHelper.isUriCalledFromSyncAdapter(uri)) { Context context = getContext(); context.getContentResolver().notifyChange(uri, null); // Widgets can't register content observers so we refresh widgets separately. context.sendBroadcast(ScheduleWidgetProvider.getRefreshBroadcastIntent(context, false)); } } /** * Apply the given set of {@link ContentProviderOperation}, executing inside * a {@link SQLiteDatabase} transaction. All changes will be rolled back if * any single one fails. */ @Override public ContentProviderResult[] applyBatch(ArrayList<ContentProviderOperation> operations) throws OperationApplicationException { final SQLiteDatabase db = mOpenHelper.getWritableDatabase(); db.beginTransaction(); try { final int numOperations = operations.size(); final ContentProviderResult[] results = new ContentProviderResult[numOperations]; for (int i = 0; i < numOperations; i++) { results[i] = operations.get(i).apply(this, results, i); } db.setTransactionSuccessful(); return results; } finally { db.endTransaction(); } } /** * Build a simple {@link SelectionBuilder} to match the requested * {@link Uri}. This is usually enough to support {@link #insert}, * {@link #update}, and {@link #delete} operations. */ private SelectionBuilder buildSimpleSelection(Uri uri) { final SelectionBuilder builder = new SelectionBuilder(); ScheduleUriEnum matchingUriEnum = mUriMatcher.matchUri(uri); // The main Uris, corresponding to the root of each type of Uri, do not have any selection // criteria so the full table is used. The others apply a selection criteria. switch (matchingUriEnum) { case BLOCKS: case CARDS: case TAGS: case ROOMS: case SESSIONS: case SPEAKERS: case ANNOUNCEMENTS: case MAPGEOJSON: case MAPTILES: case SEARCH_SUGGEST: case HASHTAGS: case VIDEOS: return builder.table(matchingUriEnum.table); case BLOCKS_ID: { final String blockId = Blocks.getBlockId(uri); return builder.table(Tables.BLOCKS) .where(Blocks.BLOCK_ID + "=?", blockId); } case TAGS_ID: { final String tagId = Tags.getTagId(uri); return builder.table(Tables.TAGS) .where(Tags.TAG_ID + "=?", tagId); } case ROOMS_ID: { final String roomId = Rooms.getRoomId(uri); return builder.table(Tables.ROOMS) .where(Rooms.ROOM_ID + "=?", roomId); } case SESSIONS_ID: { final String sessionId = Sessions.getSessionId(uri); return builder.table(Tables.SESSIONS) .where(Sessions.SESSION_ID + "=?", sessionId); } case SESSIONS_ID_SPEAKERS: { final String sessionId = Sessions.getSessionId(uri); return builder.table(Tables.SESSIONS_SPEAKERS) .where(Sessions.SESSION_ID + "=?", sessionId); } case SESSIONS_ID_TAGS: { final String sessionId = Sessions.getSessionId(uri); return builder.table(Tables.SESSIONS_TAGS) .where(Sessions.SESSION_ID + "=?", sessionId); } case SESSIONS_ID_RELATED: { final String sessionId = Sessions.getSessionId(uri); return builder.table(Tables.RELATED_SESSIONS) .where(Sessions.SESSION_ID + "=?", sessionId); } case SESSIONS_MY_SCHEDULE: { final String sessionId = Sessions.getSessionId(uri); return builder.table(Tables.MY_SCHEDULE) .where(ScheduleContract.MyScheduleColumns.SESSION_ID + "=?", sessionId); } case MY_SCHEDULE: { return builder.table(Tables.MY_SCHEDULE) .where(MySchedule.MY_SCHEDULE_ACCOUNT_NAME + "=?", getCurrentAccountName(uri, false)); } case MY_RESERVATIONS: { return builder.table(Tables.MY_RESERVATIONS) .where(MyReservations.MY_RESERVATION_ACCOUNT_NAME + "=?", getCurrentAccountName(uri, false)); } case MY_VIEWED_VIDEOS: { return builder.table(Tables.MY_VIEWED_VIDEO) .where(MyViewedVideos.MY_VIEWED_VIDEOS_ACCOUNT_NAME + "=?", getCurrentAccountName(uri, false)); } case MY_FEEDBACK_SUBMITTED: { return builder.table(Tables.MY_FEEDBACK_SUBMITTED) .where(MyFeedbackSubmitted.MY_FEEDBACK_SUBMITTED_ACCOUNT_NAME + "=?", getCurrentAccountName(uri, false)); } case SPEAKERS_ID: { final String speakerId = Speakers.getSpeakerId(uri); return builder.table(Tables.SPEAKERS) .where(Speakers.SPEAKER_ID + "=?", speakerId); } case ANNOUNCEMENTS_ID: { final String announcementId = Announcements.getAnnouncementId(uri); return builder.table(Tables.ANNOUNCEMENTS) .where(Announcements.ANNOUNCEMENT_ID + "=?", announcementId); } case FEEDBACK_FOR_SESSION: { final String session_id = Feedback.getSessionId(uri); return builder.table(Tables.FEEDBACK) .where(Feedback.SESSION_ID + "=?", session_id); } case FEEDBACK_ALL: { return builder.table(Tables.FEEDBACK); } case HASHTAGS_NAME: { final String hashtagName = Hashtags.getHashtagName(uri); return builder.table(Tables.HASHTAGS) .where(Hashtags.HASHTAG_NAME + "=?", hashtagName); } case VIDEOS_ID: { final String videoId = Videos.getVideoId(uri); return builder.table(Tables.VIDEOS).where(Videos.VIDEO_ID + "=?", videoId); } default: { throw new UnsupportedOperationException("Unknown uri for " + uri); } } } private String getCurrentAccountName(Uri uri, boolean sanitize) { String accountName = ScheduleContractHelper.getOverrideAccountName(uri); if (accountName == null) { accountName = AccountUtils.getActiveAccountName(getContext()); } if (sanitize) { // sanitize accountName when concatenating (http://xkcd.com/327/) accountName = (accountName != null) ? accountName.replace("'", "''") : null; } return accountName; } /** * Build an advanced {@link SelectionBuilder} to match the requested * {@link Uri}. This is usually only used by {@link #query}, since it * performs table joins useful for {@link Cursor} data. */ private SelectionBuilder buildExpandedSelection(Uri uri, int match) { final SelectionBuilder builder = new SelectionBuilder(); ScheduleUriEnum matchingUriEnum = mUriMatcher.matchCode(match); if (matchingUriEnum == null) { throw new UnsupportedOperationException("Unknown uri: " + uri); } String accountName = getCurrentAccountName(uri, true); switch (matchingUriEnum) { case BLOCKS: { return builder.table(Tables.BLOCKS); } case BLOCKS_BETWEEN: { final List<String> segments = uri.getPathSegments(); final String startTime = segments.get(2); final String endTime = segments.get(3); return builder.table(Tables.BLOCKS) .where(Blocks.BLOCK_START + ">=?", startTime) .where(Blocks.BLOCK_START + "<=?", endTime); } case BLOCKS_ID: { final String blockId = Blocks.getBlockId(uri); return builder.table(Tables.BLOCKS) .where(Blocks.BLOCK_ID + "=?", blockId); } case CARDS: { return builder.table(Tables.CARDS); } case TAGS: { return builder.table(Tables.TAGS); } case TAGS_ID: { final String tagId = Tags.getTagId(uri); return builder.table(Tables.TAGS) .where(Tags.TAG_ID + "=?", tagId); } case ROOMS: { return builder.table(Tables.ROOMS); } case ROOMS_ID: { final String roomId = Rooms.getRoomId(uri); return builder.table(Tables.ROOMS) .where(Rooms.ROOM_ID + "=?", roomId); } case ROOMS_ID_SESSIONS: { final String roomId = Rooms.getRoomId(uri); return builder.table(Tables.SESSIONS_JOIN_ROOMS, accountName, accountName) .mapToTable(Sessions._ID, Tables.SESSIONS) .mapToTable(Sessions.ROOM_ID, Tables.SESSIONS) .where(Qualified.SESSIONS_ROOM_ID + "=?", roomId) .groupBy(Qualified.SESSIONS_SESSION_ID); } case SESSIONS: { // We query sessions on the joined table of sessions with rooms and tags. // Since there may be more than one tag per session, we GROUP BY session ID. // The starred sessions ("my schedule") are associated with a user, so we // use the current user to select them properly. Reserved sessions are handled // similarly. return builder .table(Tables.SESSIONS_JOIN_ROOMS_TAGS, accountName, accountName) .mapToTable(Sessions._ID, Tables.SESSIONS) .mapToTable(Sessions.ROOM_ID, Tables.SESSIONS) .mapToTable(Sessions.SESSION_ID, Tables.SESSIONS) .map(Sessions.SESSION_IN_MY_SCHEDULE, "IFNULL(in_schedule, 0)") .map(Sessions.SESSION_RESERVATION_STATUS, "IFNULL(" + MyReservations. MY_RESERVATION_STATUS + ", -1)") .groupBy(Qualified.SESSIONS_SESSION_ID); } case SESSIONS_COUNTER: { return builder .table(Tables.SESSIONS_JOIN_MYSCHEDULE, accountName, accountName) .map(Sessions.SESSION_INTERVAL_COUNT, "count(1)") .map(Sessions.SESSION_IN_MY_SCHEDULE, "IFNULL(in_schedule, 0)") .map(Sessions.SESSION_RESERVATION_STATUS, "IFNULL(" + MyReservations. MY_RESERVATION_STATUS + ", -1)") .groupBy(Sessions.SESSION_START + ", " + Sessions.SESSION_END); } case SESSIONS_MY_SCHEDULE: { return builder.table(Tables.SESSIONS_JOIN_ROOMS_TAGS_FEEDBACK_MYSCHEDULE, accountName, accountName) .mapToTable(Sessions._ID, Tables.SESSIONS) .mapToTable(Sessions.ROOM_ID, Tables.SESSIONS) .mapToTable(Sessions.SESSION_ID, Tables.SESSIONS) .map(Sessions.HAS_GIVEN_FEEDBACK, Subquery.SESSION_HAS_GIVEN_FEEDBACK) .map(Sessions.SESSION_IN_MY_SCHEDULE, "IFNULL(in_schedule, 0)") .map(Sessions.SESSION_RESERVATION_STATUS, "IFNULL(" + MyReservations. MY_RESERVATION_STATUS + ", -1)") .where(Sessions.IN_SCHEDULE_SELECTION) .groupBy(Qualified.SESSIONS_SESSION_ID); } case SESSIONS_UNSCHEDULED: { final long[] interval = Sessions.getInterval(uri); return builder.table(Tables.SESSIONS_JOIN_ROOMS_TAGS_FEEDBACK_MYSCHEDULE, accountName, accountName) .mapToTable(Sessions._ID, Tables.SESSIONS) .mapToTable(Sessions.ROOM_ID, Tables.SESSIONS) .mapToTable(Sessions.SESSION_ID, Tables.SESSIONS) .map(Sessions.SESSION_IN_MY_SCHEDULE, "IFNULL(in_schedule, 0)") .map(Sessions.SESSION_RESERVATION_STATUS, "IFNULL(" + MyReservations. MY_RESERVATION_STATUS + ", -1)") .where(Sessions.NOT_IN_SCHEDULE_SELECTION) .where(Sessions.SESSION_START + ">=?", String.valueOf(interval[0])) .where(Sessions.SESSION_START + "<?", String.valueOf(interval[1])) .groupBy(Qualified.SESSIONS_SESSION_ID); } case SESSIONS_SEARCH: { final String query = Sessions.getSearchQuery(uri); return builder.table(Tables.SESSIONS_SEARCH_JOIN_SESSIONS_ROOMS, accountName, accountName) .map(Sessions.SEARCH_SNIPPET, Subquery.SESSIONS_SNIPPET) .mapToTable(Sessions._ID, Tables.SESSIONS) .mapToTable(Sessions.SESSION_ID, Tables.SESSIONS) .mapToTable(Sessions.ROOM_ID, Tables.SESSIONS) .map(Sessions.SESSION_IN_MY_SCHEDULE, "IFNULL(in_schedule, 0)") .map(Sessions.SESSION_RESERVATION_STATUS, "IFNULL(" + MyReservations. MY_RESERVATION_STATUS + ", -1)") .where(SessionsSearchColumns.BODY + " MATCH ?", query); } case SESSIONS_AT: { final List<String> segments = uri.getPathSegments(); final String time = segments.get(2); return builder.table(Tables.SESSIONS_JOIN_ROOMS, accountName, accountName) .mapToTable(Sessions._ID, Tables.SESSIONS) .mapToTable(Sessions.ROOM_ID, Tables.SESSIONS) .where(Sessions.SESSION_START + "<=?", time) .where(Sessions.SESSION_END + ">=?", time); } case SESSIONS_ID: { final String sessionId = Sessions.getSessionId(uri); return builder.table(Tables.SESSIONS_JOIN_ROOMS, accountName, accountName) .mapToTable(Sessions._ID, Tables.SESSIONS) .mapToTable(Sessions.ROOM_ID, Tables.SESSIONS) .mapToTable(Sessions.SESSION_ID, Tables.SESSIONS) .map(Sessions.SESSION_IN_MY_SCHEDULE, "IFNULL(in_schedule, 0)") .map(Sessions.SESSION_RESERVATION_STATUS, "IFNULL(" + MyReservations. MY_RESERVATION_STATUS + ", -1)") .where(Qualified.SESSIONS_SESSION_ID + "=?", sessionId); } case SESSIONS_ID_SPEAKERS: { final String sessionId = Sessions.getSessionId(uri); return builder.table(Tables.SESSIONS_SPEAKERS_JOIN_SPEAKERS) .mapToTable(Speakers._ID, Tables.SPEAKERS) .mapToTable(Speakers.SPEAKER_ID, Tables.SPEAKERS) .where(Qualified.SESSIONS_SPEAKERS_SESSION_ID + "=?", sessionId); } case SESSIONS_ID_TAGS: { final String sessionId = Sessions.getSessionId(uri); return builder.table(Tables.SESSIONS_TAGS_JOIN_TAGS) .mapToTable(Tags._ID, Tables.TAGS) .mapToTable(Tags.TAG_ID, Tables.TAGS) .where(Qualified.SESSIONS_TAGS_SESSION_ID + "=?", sessionId); } case SESSIONS_ID_RELATED: { final String sessionId = Sessions.getSessionId(uri); return builder .table(Tables.SESSIONS_JOIN_ROOMS_TAGS, accountName, accountName) .mapToTable(Sessions._ID, Tables.SESSIONS) .mapToTable(Sessions.ROOM_ID, Tables.SESSIONS) .mapToTable(Sessions.SESSION_ID, Tables.SESSIONS) .map(Sessions.SESSION_IN_MY_SCHEDULE, "IFNULL(in_schedule, 0)") .map(Sessions.SESSION_RESERVATION_STATUS, "IFNULL(" + ScheduleContract .MyReservations.MY_RESERVATION_STATUS + ", -1)") .map(Sessions.HAS_GIVEN_FEEDBACK, Subquery.SESSION_HAS_GIVEN_FEEDBACK) .where(Subquery.RELATED_SESSIONS_SELECTION, sessionId) .groupBy(Qualified.SESSIONS_SESSION_ID); } case SESSIONS_ROOM_AFTER: { final String room = Sessions.getRoom(uri); final String time = Sessions.getAfterForRoom(uri); return builder.table(Tables.SESSIONS_JOIN_ROOMS_TAGS, accountName, accountName) .mapToTable(Sessions._ID, Tables.SESSIONS) .mapToTable(Sessions.ROOM_ID, Tables.SESSIONS) .mapToTable(Sessions.SESSION_ID, Tables.SESSIONS) .where(Qualified.SESSIONS_ROOM_ID + "=?", room) .where("(" + Sessions.SESSION_START + "<= ? AND " + Sessions.SESSION_END + " >= ?) OR (" + Sessions.SESSION_START + " >= ?)", time, time, time) .map(Sessions.SESSION_IN_MY_SCHEDULE, "IFNULL(in_schedule, 0)") .map(Sessions.SESSION_RESERVATION_STATUS, "IFNULL(" + ScheduleContract .MyReservations.MY_RESERVATION_STATUS + ", -1)") .groupBy(Qualified.SESSIONS_SESSION_ID); } case SESSIONS_AFTER: { final String time = Sessions.getAfter(uri); return builder.table(Tables.SESSIONS_JOIN_ROOMS_TAGS, accountName, accountName) .mapToTable(Sessions._ID, Tables.SESSIONS) .mapToTable(Sessions.SESSION_ID, Tables.SESSIONS) .mapToTable(Sessions.ROOM_ID, Tables.SESSIONS) .map(Sessions.SESSION_IN_MY_SCHEDULE, "IFNULL(in_schedule, 0)") .map(Sessions.SESSION_RESERVATION_STATUS, "IFNULL(" + ScheduleContract .MyReservations.MY_RESERVATION_STATUS + ", -1)") .where("(" + Sessions.SESSION_START + "<= ? AND " + Sessions.SESSION_END + " >= ?) OR (" + Sessions.SESSION_START + " >= ?)", time, time, time) .groupBy(Qualified.SESSIONS_SESSION_ID); } case SPEAKERS: { return builder.table(Tables.SPEAKERS); } case MY_SCHEDULE: { // force a where condition to avoid leaking schedule info to another account // Note that, since SelectionBuilder always join multiple where calls using AND, // even if malicious code specifying additional conditions on account_name won't // be able to fetch data from a different account. return builder.table(Tables.MY_SCHEDULE) .where(MySchedule.MY_SCHEDULE_ACCOUNT_NAME + "=?", accountName); } case MY_RESERVATIONS: { // force a where condition to avoid leaking reservation info to another account // Note that, since SelectionBuilder always join multiple where calls using AND, // even if malicious code specifying additional conditions on account_name won't // be able to fetch data from a different account. return builder.table(Tables.MY_RESERVATIONS) .where(MyReservations.MY_RESERVATION_ACCOUNT_NAME + "=?", accountName); } case MY_FEEDBACK_SUBMITTED: { // force a where condition to avoid leaking schedule info to another account // Note that, since SelectionBuilder always join multiple where calls using AND, // even if malicious code specifying additional conditions on account_name won't // be able to fetch data from a different account. return builder.table(Tables.MY_FEEDBACK_SUBMITTED) .where(MyFeedbackSubmitted.MY_FEEDBACK_SUBMITTED_ACCOUNT_NAME + "=?", accountName); } case MY_VIEWED_VIDEOS: { // force a where condition to avoid leaking schedule info to another account // Note that, since SelectionBuilder always join multiple where calls using AND, // even if malicious code specifying additional conditions on account_name won't // be able to fetch data from a different account. return builder.table(Tables.MY_VIEWED_VIDEO) .where(MyViewedVideos.MY_VIEWED_VIDEOS_ACCOUNT_NAME + "=?", accountName); } case SPEAKERS_ID: { final String speakerId = Speakers.getSpeakerId(uri); return builder.table(Tables.SPEAKERS) .where(Speakers.SPEAKER_ID + "=?", speakerId); } case SPEAKERS_ID_SESSIONS: { final String speakerId = Speakers.getSpeakerId(uri); return builder.table(Tables.SESSIONS_SPEAKERS_JOIN_SESSIONS_ROOMS, accountName, accountName) .mapToTable(Sessions._ID, Tables.SESSIONS) .mapToTable(Sessions.SESSION_ID, Tables.SESSIONS) .mapToTable(Sessions.ROOM_ID, Tables.SESSIONS) .map(Sessions.SESSION_IN_MY_SCHEDULE, "IFNULL(in_schedule, 0)") .map(Sessions.SESSION_RESERVATION_STATUS, "IFNULL(" + MyReservations. MY_RESERVATION_STATUS + ", -1)") .where(Qualified.SESSIONS_SPEAKERS_SPEAKER_ID + "=?", speakerId); } case ANNOUNCEMENTS: { return builder.table(Tables.ANNOUNCEMENTS); } case ANNOUNCEMENTS_ID: { final String announcementId = Announcements.getAnnouncementId(uri); return builder.table(Tables.ANNOUNCEMENTS) .where(Announcements.ANNOUNCEMENT_ID + "=?", announcementId); } case MAPGEOJSON: { return builder.table(Tables.MAPGEOJSON); } case MAPTILES: { return builder.table(Tables.MAPTILES); } case FEEDBACK_FOR_SESSION: { final String sessionId = Feedback.getSessionId(uri); return builder.table(Tables.FEEDBACK) .where(Feedback.SESSION_ID + "=?", sessionId); } case FEEDBACK_ALL: { return builder.table(Tables.FEEDBACK); } case HASHTAGS: { return builder.table(Tables.HASHTAGS); } case HASHTAGS_NAME: { final String hashtagName = Hashtags.getHashtagName(uri); return builder.table(Tables.HASHTAGS) .where(HashtagColumns.HASHTAG_NAME + "=?", hashtagName); } case VIDEOS: { return builder.table(Tables.VIDEOS); } case VIDEOS_ID: { final String videoId = Videos.getVideoId(uri); return builder.table(Tables.VIDEOS) .where(VideoColumns.VIDEO_ID + "=?", videoId); } default: { throw new UnsupportedOperationException("Unknown uri: " + uri); } } } @Override public ParcelFileDescriptor openFile(Uri uri, String mode) throws FileNotFoundException { throw new UnsupportedOperationException("openFile is not supported for " + uri); } private interface Subquery { String SESSION_HAS_GIVEN_FEEDBACK = "(SELECT COUNT(1) FROM " + Tables.FEEDBACK + " WHERE " + Qualified.FEEDBACK_SESSION_ID + "=" + Qualified.SESSIONS_SESSION_ID + ")"; String SESSIONS_SNIPPET = "snippet(" + Tables.SESSIONS_SEARCH + ",'{','}','\u2026')"; String RELATED_SESSIONS_SELECTION = Qualified.SESSIONS_SESSION_ID + " IN (SELECT " + Sessions.RELATED_SESSION_ID + " FROM " + Tables.RELATED_SESSIONS + " WHERE " + Sessions.SESSION_ID + " = ?)"; } /** * {@link ScheduleContract} fields that are fully qualified with a specific * parent {@link Tables}. Used when needed to work around SQL ambiguity. */ private interface Qualified { String SESSIONS_SESSION_ID = Tables.SESSIONS + "." + Sessions.SESSION_ID; String SESSIONS_ROOM_ID = Tables.SESSIONS + "." + Sessions.ROOM_ID; String SESSIONS_TAGS_SESSION_ID = Tables.SESSIONS_TAGS + "." + ScheduleDatabase.SessionsTags.SESSION_ID; String SESSIONS_SPEAKERS_SESSION_ID = Tables.SESSIONS_SPEAKERS + "." + SessionsSpeakers.SESSION_ID; String SESSIONS_SPEAKERS_SPEAKER_ID = Tables.SESSIONS_SPEAKERS + "." + SessionsSpeakers.SPEAKER_ID; String FEEDBACK_SESSION_ID = Tables.FEEDBACK + "." + Feedback.SESSION_ID; } }
apache-2.0
LucasGandel/ITK
Modules/ThirdParty/HDF5/src/itkhdf5/src/H5Epubgen.h
21996
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * * the COPYING file, which can be found at the root of the source code * * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * * If you do not have access to either file, you may request a copy from * * [email protected]. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* Generated automatically by bin/make_err -- do not edit */ /* Add new errors to H5err.txt file */ #ifndef _H5Epubgen_H #define _H5Epubgen_H #ifdef __cplusplus extern "C" { #endif /*********************/ /* Major error codes */ /*********************/ #define H5E_FUNC (H5OPEN H5E_FUNC_g) #define H5E_FILE (H5OPEN H5E_FILE_g) #define H5E_SOHM (H5OPEN H5E_SOHM_g) #define H5E_SYM (H5OPEN H5E_SYM_g) #define H5E_PLUGIN (H5OPEN H5E_PLUGIN_g) #define H5E_VFL (H5OPEN H5E_VFL_g) #define H5E_INTERNAL (H5OPEN H5E_INTERNAL_g) #define H5E_BTREE (H5OPEN H5E_BTREE_g) #define H5E_REFERENCE (H5OPEN H5E_REFERENCE_g) #define H5E_DATASPACE (H5OPEN H5E_DATASPACE_g) #define H5E_RESOURCE (H5OPEN H5E_RESOURCE_g) #define H5E_RS (H5OPEN H5E_RS_g) #define H5E_FARRAY (H5OPEN H5E_FARRAY_g) #define H5E_HEAP (H5OPEN H5E_HEAP_g) #define H5E_ATTR (H5OPEN H5E_ATTR_g) #define H5E_IO (H5OPEN H5E_IO_g) #define H5E_EFL (H5OPEN H5E_EFL_g) #define H5E_TST (H5OPEN H5E_TST_g) #define H5E_PAGEBUF (H5OPEN H5E_PAGEBUF_g) #define H5E_FSPACE (H5OPEN H5E_FSPACE_g) #define H5E_DATASET (H5OPEN H5E_DATASET_g) #define H5E_STORAGE (H5OPEN H5E_STORAGE_g) #define H5E_LINK (H5OPEN H5E_LINK_g) #define H5E_PLIST (H5OPEN H5E_PLIST_g) #define H5E_DATATYPE (H5OPEN H5E_DATATYPE_g) #define H5E_OHDR (H5OPEN H5E_OHDR_g) #define H5E_ATOM (H5OPEN H5E_ATOM_g) #define H5E_NONE_MAJOR (H5OPEN H5E_NONE_MAJOR_g) #define H5E_SLIST (H5OPEN H5E_SLIST_g) #define H5E_ARGS (H5OPEN H5E_ARGS_g) #define H5E_CONTEXT (H5OPEN H5E_CONTEXT_g) #define H5E_EARRAY (H5OPEN H5E_EARRAY_g) #define H5E_PLINE (H5OPEN H5E_PLINE_g) #define H5E_ERROR (H5OPEN H5E_ERROR_g) #define H5E_CACHE (H5OPEN H5E_CACHE_g) H5_DLLVAR hid_t H5E_FUNC_g; /* Function entry/exit */ H5_DLLVAR hid_t H5E_FILE_g; /* File accessibilty */ H5_DLLVAR hid_t H5E_SOHM_g; /* Shared Object Header Messages */ H5_DLLVAR hid_t H5E_SYM_g; /* Symbol table */ H5_DLLVAR hid_t H5E_PLUGIN_g; /* Plugin for dynamically loaded library */ H5_DLLVAR hid_t H5E_VFL_g; /* Virtual File Layer */ H5_DLLVAR hid_t H5E_INTERNAL_g; /* Internal error (too specific to document in detail) */ H5_DLLVAR hid_t H5E_BTREE_g; /* B-Tree node */ H5_DLLVAR hid_t H5E_REFERENCE_g; /* References */ H5_DLLVAR hid_t H5E_DATASPACE_g; /* Dataspace */ H5_DLLVAR hid_t H5E_RESOURCE_g; /* Resource unavailable */ H5_DLLVAR hid_t H5E_RS_g; /* Reference Counted Strings */ H5_DLLVAR hid_t H5E_FARRAY_g; /* Fixed Array */ H5_DLLVAR hid_t H5E_HEAP_g; /* Heap */ H5_DLLVAR hid_t H5E_ATTR_g; /* Attribute */ H5_DLLVAR hid_t H5E_IO_g; /* Low-level I/O */ H5_DLLVAR hid_t H5E_EFL_g; /* External file list */ H5_DLLVAR hid_t H5E_TST_g; /* Ternary Search Trees */ H5_DLLVAR hid_t H5E_PAGEBUF_g; /* Page Buffering */ H5_DLLVAR hid_t H5E_FSPACE_g; /* Free Space Manager */ H5_DLLVAR hid_t H5E_DATASET_g; /* Dataset */ H5_DLLVAR hid_t H5E_STORAGE_g; /* Data storage */ H5_DLLVAR hid_t H5E_LINK_g; /* Links */ H5_DLLVAR hid_t H5E_PLIST_g; /* Property lists */ H5_DLLVAR hid_t H5E_DATATYPE_g; /* Datatype */ H5_DLLVAR hid_t H5E_OHDR_g; /* Object header */ H5_DLLVAR hid_t H5E_ATOM_g; /* Object atom */ H5_DLLVAR hid_t H5E_NONE_MAJOR_g; /* No error */ H5_DLLVAR hid_t H5E_SLIST_g; /* Skip Lists */ H5_DLLVAR hid_t H5E_ARGS_g; /* Invalid arguments to routine */ H5_DLLVAR hid_t H5E_CONTEXT_g; /* API Context */ H5_DLLVAR hid_t H5E_EARRAY_g; /* Extensible Array */ H5_DLLVAR hid_t H5E_PLINE_g; /* Data filters */ H5_DLLVAR hid_t H5E_ERROR_g; /* Error API */ H5_DLLVAR hid_t H5E_CACHE_g; /* Object cache */ /*********************/ /* Minor error codes */ /*********************/ /* Generic low-level file I/O errors */ #define H5E_SEEKERROR (H5OPEN H5E_SEEKERROR_g) #define H5E_READERROR (H5OPEN H5E_READERROR_g) #define H5E_WRITEERROR (H5OPEN H5E_WRITEERROR_g) #define H5E_CLOSEERROR (H5OPEN H5E_CLOSEERROR_g) #define H5E_OVERFLOW (H5OPEN H5E_OVERFLOW_g) #define H5E_FCNTL (H5OPEN H5E_FCNTL_g) H5_DLLVAR hid_t H5E_SEEKERROR_g; /* Seek failed */ H5_DLLVAR hid_t H5E_READERROR_g; /* Read failed */ H5_DLLVAR hid_t H5E_WRITEERROR_g; /* Write failed */ H5_DLLVAR hid_t H5E_CLOSEERROR_g; /* Close failed */ H5_DLLVAR hid_t H5E_OVERFLOW_g; /* Address overflowed */ H5_DLLVAR hid_t H5E_FCNTL_g; /* File control (fcntl) failed */ /* Resource errors */ #define H5E_NOSPACE (H5OPEN H5E_NOSPACE_g) #define H5E_CANTALLOC (H5OPEN H5E_CANTALLOC_g) #define H5E_CANTCOPY (H5OPEN H5E_CANTCOPY_g) #define H5E_CANTFREE (H5OPEN H5E_CANTFREE_g) #define H5E_ALREADYEXISTS (H5OPEN H5E_ALREADYEXISTS_g) #define H5E_CANTLOCK (H5OPEN H5E_CANTLOCK_g) #define H5E_CANTUNLOCK (H5OPEN H5E_CANTUNLOCK_g) #define H5E_CANTGC (H5OPEN H5E_CANTGC_g) #define H5E_CANTGETSIZE (H5OPEN H5E_CANTGETSIZE_g) #define H5E_OBJOPEN (H5OPEN H5E_OBJOPEN_g) H5_DLLVAR hid_t H5E_NOSPACE_g; /* No space available for allocation */ H5_DLLVAR hid_t H5E_CANTALLOC_g; /* Can't allocate space */ H5_DLLVAR hid_t H5E_CANTCOPY_g; /* Unable to copy object */ H5_DLLVAR hid_t H5E_CANTFREE_g; /* Unable to free object */ H5_DLLVAR hid_t H5E_ALREADYEXISTS_g; /* Object already exists */ H5_DLLVAR hid_t H5E_CANTLOCK_g; /* Unable to lock object */ H5_DLLVAR hid_t H5E_CANTUNLOCK_g; /* Unable to unlock object */ H5_DLLVAR hid_t H5E_CANTGC_g; /* Unable to garbage collect */ H5_DLLVAR hid_t H5E_CANTGETSIZE_g; /* Unable to compute size */ H5_DLLVAR hid_t H5E_OBJOPEN_g; /* Object is already open */ /* Heap errors */ #define H5E_CANTRESTORE (H5OPEN H5E_CANTRESTORE_g) #define H5E_CANTCOMPUTE (H5OPEN H5E_CANTCOMPUTE_g) #define H5E_CANTEXTEND (H5OPEN H5E_CANTEXTEND_g) #define H5E_CANTATTACH (H5OPEN H5E_CANTATTACH_g) #define H5E_CANTUPDATE (H5OPEN H5E_CANTUPDATE_g) #define H5E_CANTOPERATE (H5OPEN H5E_CANTOPERATE_g) H5_DLLVAR hid_t H5E_CANTRESTORE_g; /* Can't restore condition */ H5_DLLVAR hid_t H5E_CANTCOMPUTE_g; /* Can't compute value */ H5_DLLVAR hid_t H5E_CANTEXTEND_g; /* Can't extend heap's space */ H5_DLLVAR hid_t H5E_CANTATTACH_g; /* Can't attach object */ H5_DLLVAR hid_t H5E_CANTUPDATE_g; /* Can't update object */ H5_DLLVAR hid_t H5E_CANTOPERATE_g; /* Can't operate on object */ /* Function entry/exit interface errors */ #define H5E_CANTINIT (H5OPEN H5E_CANTINIT_g) #define H5E_ALREADYINIT (H5OPEN H5E_ALREADYINIT_g) #define H5E_CANTRELEASE (H5OPEN H5E_CANTRELEASE_g) H5_DLLVAR hid_t H5E_CANTINIT_g; /* Unable to initialize object */ H5_DLLVAR hid_t H5E_ALREADYINIT_g; /* Object already initialized */ H5_DLLVAR hid_t H5E_CANTRELEASE_g; /* Unable to release object */ /* Property list errors */ #define H5E_CANTGET (H5OPEN H5E_CANTGET_g) #define H5E_CANTSET (H5OPEN H5E_CANTSET_g) #define H5E_DUPCLASS (H5OPEN H5E_DUPCLASS_g) #define H5E_SETDISALLOWED (H5OPEN H5E_SETDISALLOWED_g) H5_DLLVAR hid_t H5E_CANTGET_g; /* Can't get value */ H5_DLLVAR hid_t H5E_CANTSET_g; /* Can't set value */ H5_DLLVAR hid_t H5E_DUPCLASS_g; /* Duplicate class name in parent class */ H5_DLLVAR hid_t H5E_SETDISALLOWED_g; /* Disallowed operation */ /* Free space errors */ #define H5E_CANTMERGE (H5OPEN H5E_CANTMERGE_g) #define H5E_CANTREVIVE (H5OPEN H5E_CANTREVIVE_g) #define H5E_CANTSHRINK (H5OPEN H5E_CANTSHRINK_g) H5_DLLVAR hid_t H5E_CANTMERGE_g; /* Can't merge objects */ H5_DLLVAR hid_t H5E_CANTREVIVE_g; /* Can't revive object */ H5_DLLVAR hid_t H5E_CANTSHRINK_g; /* Can't shrink container */ /* Object header related errors */ #define H5E_LINKCOUNT (H5OPEN H5E_LINKCOUNT_g) #define H5E_VERSION (H5OPEN H5E_VERSION_g) #define H5E_ALIGNMENT (H5OPEN H5E_ALIGNMENT_g) #define H5E_BADMESG (H5OPEN H5E_BADMESG_g) #define H5E_CANTDELETE (H5OPEN H5E_CANTDELETE_g) #define H5E_BADITER (H5OPEN H5E_BADITER_g) #define H5E_CANTPACK (H5OPEN H5E_CANTPACK_g) #define H5E_CANTRESET (H5OPEN H5E_CANTRESET_g) #define H5E_CANTRENAME (H5OPEN H5E_CANTRENAME_g) H5_DLLVAR hid_t H5E_LINKCOUNT_g; /* Bad object header link count */ H5_DLLVAR hid_t H5E_VERSION_g; /* Wrong version number */ H5_DLLVAR hid_t H5E_ALIGNMENT_g; /* Alignment error */ H5_DLLVAR hid_t H5E_BADMESG_g; /* Unrecognized message */ H5_DLLVAR hid_t H5E_CANTDELETE_g; /* Can't delete message */ H5_DLLVAR hid_t H5E_BADITER_g; /* Iteration failed */ H5_DLLVAR hid_t H5E_CANTPACK_g; /* Can't pack messages */ H5_DLLVAR hid_t H5E_CANTRESET_g; /* Can't reset object */ H5_DLLVAR hid_t H5E_CANTRENAME_g; /* Unable to rename object */ /* System level errors */ #define H5E_SYSERRSTR (H5OPEN H5E_SYSERRSTR_g) H5_DLLVAR hid_t H5E_SYSERRSTR_g; /* System error message */ /* I/O pipeline errors */ #define H5E_NOFILTER (H5OPEN H5E_NOFILTER_g) #define H5E_CALLBACK (H5OPEN H5E_CALLBACK_g) #define H5E_CANAPPLY (H5OPEN H5E_CANAPPLY_g) #define H5E_SETLOCAL (H5OPEN H5E_SETLOCAL_g) #define H5E_NOENCODER (H5OPEN H5E_NOENCODER_g) #define H5E_CANTFILTER (H5OPEN H5E_CANTFILTER_g) H5_DLLVAR hid_t H5E_NOFILTER_g; /* Requested filter is not available */ H5_DLLVAR hid_t H5E_CALLBACK_g; /* Callback failed */ H5_DLLVAR hid_t H5E_CANAPPLY_g; /* Error from filter 'can apply' callback */ H5_DLLVAR hid_t H5E_SETLOCAL_g; /* Error from filter 'set local' callback */ H5_DLLVAR hid_t H5E_NOENCODER_g; /* Filter present but encoding disabled */ H5_DLLVAR hid_t H5E_CANTFILTER_g; /* Filter operation failed */ /* Group related errors */ #define H5E_CANTOPENOBJ (H5OPEN H5E_CANTOPENOBJ_g) #define H5E_CANTCLOSEOBJ (H5OPEN H5E_CANTCLOSEOBJ_g) #define H5E_COMPLEN (H5OPEN H5E_COMPLEN_g) #define H5E_PATH (H5OPEN H5E_PATH_g) H5_DLLVAR hid_t H5E_CANTOPENOBJ_g; /* Can't open object */ H5_DLLVAR hid_t H5E_CANTCLOSEOBJ_g; /* Can't close object */ H5_DLLVAR hid_t H5E_COMPLEN_g; /* Name component is too long */ H5_DLLVAR hid_t H5E_PATH_g; /* Problem with path to object */ /* No error */ #define H5E_NONE_MINOR (H5OPEN H5E_NONE_MINOR_g) H5_DLLVAR hid_t H5E_NONE_MINOR_g; /* No error */ /* Plugin errors */ #define H5E_OPENERROR (H5OPEN H5E_OPENERROR_g) H5_DLLVAR hid_t H5E_OPENERROR_g; /* Can't open directory or file */ /* File accessibilty errors */ #define H5E_FILEEXISTS (H5OPEN H5E_FILEEXISTS_g) #define H5E_FILEOPEN (H5OPEN H5E_FILEOPEN_g) #define H5E_CANTCREATE (H5OPEN H5E_CANTCREATE_g) #define H5E_CANTOPENFILE (H5OPEN H5E_CANTOPENFILE_g) #define H5E_CANTCLOSEFILE (H5OPEN H5E_CANTCLOSEFILE_g) #define H5E_NOTHDF5 (H5OPEN H5E_NOTHDF5_g) #define H5E_BADFILE (H5OPEN H5E_BADFILE_g) #define H5E_TRUNCATED (H5OPEN H5E_TRUNCATED_g) #define H5E_MOUNT (H5OPEN H5E_MOUNT_g) H5_DLLVAR hid_t H5E_FILEEXISTS_g; /* File already exists */ H5_DLLVAR hid_t H5E_FILEOPEN_g; /* File already open */ H5_DLLVAR hid_t H5E_CANTCREATE_g; /* Unable to create file */ H5_DLLVAR hid_t H5E_CANTOPENFILE_g; /* Unable to open file */ H5_DLLVAR hid_t H5E_CANTCLOSEFILE_g; /* Unable to close file */ H5_DLLVAR hid_t H5E_NOTHDF5_g; /* Not an HDF5 file */ H5_DLLVAR hid_t H5E_BADFILE_g; /* Bad file ID accessed */ H5_DLLVAR hid_t H5E_TRUNCATED_g; /* File has been truncated */ H5_DLLVAR hid_t H5E_MOUNT_g; /* File mount error */ /* Object atom related errors */ #define H5E_BADATOM (H5OPEN H5E_BADATOM_g) #define H5E_BADGROUP (H5OPEN H5E_BADGROUP_g) #define H5E_CANTREGISTER (H5OPEN H5E_CANTREGISTER_g) #define H5E_CANTINC (H5OPEN H5E_CANTINC_g) #define H5E_CANTDEC (H5OPEN H5E_CANTDEC_g) #define H5E_NOIDS (H5OPEN H5E_NOIDS_g) H5_DLLVAR hid_t H5E_BADATOM_g; /* Unable to find atom information (already closed?) */ H5_DLLVAR hid_t H5E_BADGROUP_g; /* Unable to find ID group information */ H5_DLLVAR hid_t H5E_CANTREGISTER_g; /* Unable to register new atom */ H5_DLLVAR hid_t H5E_CANTINC_g; /* Unable to increment reference count */ H5_DLLVAR hid_t H5E_CANTDEC_g; /* Unable to decrement reference count */ H5_DLLVAR hid_t H5E_NOIDS_g; /* Out of IDs for group */ /* Cache related errors */ #define H5E_CANTFLUSH (H5OPEN H5E_CANTFLUSH_g) #define H5E_CANTUNSERIALIZE (H5OPEN H5E_CANTUNSERIALIZE_g) #define H5E_CANTSERIALIZE (H5OPEN H5E_CANTSERIALIZE_g) #define H5E_CANTTAG (H5OPEN H5E_CANTTAG_g) #define H5E_CANTLOAD (H5OPEN H5E_CANTLOAD_g) #define H5E_PROTECT (H5OPEN H5E_PROTECT_g) #define H5E_NOTCACHED (H5OPEN H5E_NOTCACHED_g) #define H5E_SYSTEM (H5OPEN H5E_SYSTEM_g) #define H5E_CANTINS (H5OPEN H5E_CANTINS_g) #define H5E_CANTPROTECT (H5OPEN H5E_CANTPROTECT_g) #define H5E_CANTUNPROTECT (H5OPEN H5E_CANTUNPROTECT_g) #define H5E_CANTPIN (H5OPEN H5E_CANTPIN_g) #define H5E_CANTUNPIN (H5OPEN H5E_CANTUNPIN_g) #define H5E_CANTMARKDIRTY (H5OPEN H5E_CANTMARKDIRTY_g) #define H5E_CANTMARKCLEAN (H5OPEN H5E_CANTMARKCLEAN_g) #define H5E_CANTMARKUNSERIALIZED (H5OPEN H5E_CANTMARKUNSERIALIZED_g) #define H5E_CANTMARKSERIALIZED (H5OPEN H5E_CANTMARKSERIALIZED_g) #define H5E_CANTDIRTY (H5OPEN H5E_CANTDIRTY_g) #define H5E_CANTCLEAN (H5OPEN H5E_CANTCLEAN_g) #define H5E_CANTEXPUNGE (H5OPEN H5E_CANTEXPUNGE_g) #define H5E_CANTRESIZE (H5OPEN H5E_CANTRESIZE_g) #define H5E_CANTDEPEND (H5OPEN H5E_CANTDEPEND_g) #define H5E_CANTUNDEPEND (H5OPEN H5E_CANTUNDEPEND_g) #define H5E_CANTNOTIFY (H5OPEN H5E_CANTNOTIFY_g) #define H5E_LOGGING (H5OPEN H5E_LOGGING_g) #define H5E_LOGFAIL (H5OPEN H5E_LOGFAIL_g) #define H5E_CANTCORK (H5OPEN H5E_CANTCORK_g) #define H5E_CANTUNCORK (H5OPEN H5E_CANTUNCORK_g) H5_DLLVAR hid_t H5E_CANTFLUSH_g; /* Unable to flush data from cache */ H5_DLLVAR hid_t H5E_CANTUNSERIALIZE_g; /* Unable to mark metadata as unserialized */ H5_DLLVAR hid_t H5E_CANTSERIALIZE_g; /* Unable to serialize data from cache */ H5_DLLVAR hid_t H5E_CANTTAG_g; /* Unable to tag metadata in the cache */ H5_DLLVAR hid_t H5E_CANTLOAD_g; /* Unable to load metadata into cache */ H5_DLLVAR hid_t H5E_PROTECT_g; /* Protected metadata error */ H5_DLLVAR hid_t H5E_NOTCACHED_g; /* Metadata not currently cached */ H5_DLLVAR hid_t H5E_SYSTEM_g; /* Internal error detected */ H5_DLLVAR hid_t H5E_CANTINS_g; /* Unable to insert metadata into cache */ H5_DLLVAR hid_t H5E_CANTPROTECT_g; /* Unable to protect metadata */ H5_DLLVAR hid_t H5E_CANTUNPROTECT_g; /* Unable to unprotect metadata */ H5_DLLVAR hid_t H5E_CANTPIN_g; /* Unable to pin cache entry */ H5_DLLVAR hid_t H5E_CANTUNPIN_g; /* Unable to un-pin cache entry */ H5_DLLVAR hid_t H5E_CANTMARKDIRTY_g; /* Unable to mark a pinned entry as dirty */ H5_DLLVAR hid_t H5E_CANTMARKCLEAN_g; /* Unable to mark a pinned entry as clean */ H5_DLLVAR hid_t H5E_CANTMARKUNSERIALIZED_g; /* Unable to mark an entry as unserialized */ H5_DLLVAR hid_t H5E_CANTMARKSERIALIZED_g; /* Unable to mark an entry as serialized */ H5_DLLVAR hid_t H5E_CANTDIRTY_g; /* Unable to mark metadata as dirty */ H5_DLLVAR hid_t H5E_CANTCLEAN_g; /* Unable to mark metadata as clean */ H5_DLLVAR hid_t H5E_CANTEXPUNGE_g; /* Unable to expunge a metadata cache entry */ H5_DLLVAR hid_t H5E_CANTRESIZE_g; /* Unable to resize a metadata cache entry */ H5_DLLVAR hid_t H5E_CANTDEPEND_g; /* Unable to create a flush dependency */ H5_DLLVAR hid_t H5E_CANTUNDEPEND_g; /* Unable to destroy a flush dependency */ H5_DLLVAR hid_t H5E_CANTNOTIFY_g; /* Unable to notify object about action */ H5_DLLVAR hid_t H5E_LOGGING_g; /* Failure in the cache logging framework */ H5_DLLVAR hid_t H5E_LOGFAIL_g; /* old H5E_LOGGING_g (maintained for binary compatibility) */ H5_DLLVAR hid_t H5E_CANTCORK_g; /* Unable to cork an object */ H5_DLLVAR hid_t H5E_CANTUNCORK_g; /* Unable to uncork an object */ /* Link related errors */ #define H5E_TRAVERSE (H5OPEN H5E_TRAVERSE_g) #define H5E_NLINKS (H5OPEN H5E_NLINKS_g) #define H5E_NOTREGISTERED (H5OPEN H5E_NOTREGISTERED_g) #define H5E_CANTMOVE (H5OPEN H5E_CANTMOVE_g) #define H5E_CANTSORT (H5OPEN H5E_CANTSORT_g) H5_DLLVAR hid_t H5E_TRAVERSE_g; /* Link traversal failure */ H5_DLLVAR hid_t H5E_NLINKS_g; /* Too many soft links in path */ H5_DLLVAR hid_t H5E_NOTREGISTERED_g; /* Link class not registered */ H5_DLLVAR hid_t H5E_CANTMOVE_g; /* Can't move object */ H5_DLLVAR hid_t H5E_CANTSORT_g; /* Can't sort objects */ /* Parallel MPI errors */ #define H5E_MPI (H5OPEN H5E_MPI_g) #define H5E_MPIERRSTR (H5OPEN H5E_MPIERRSTR_g) #define H5E_CANTRECV (H5OPEN H5E_CANTRECV_g) #define H5E_CANTGATHER (H5OPEN H5E_CANTGATHER_g) #define H5E_NO_INDEPENDENT (H5OPEN H5E_NO_INDEPENDENT_g) H5_DLLVAR hid_t H5E_MPI_g; /* Some MPI function failed */ H5_DLLVAR hid_t H5E_MPIERRSTR_g; /* MPI Error String */ H5_DLLVAR hid_t H5E_CANTRECV_g; /* Can't receive data */ H5_DLLVAR hid_t H5E_CANTGATHER_g; /* Can't gather data */ H5_DLLVAR hid_t H5E_NO_INDEPENDENT_g; /* Can't perform independent IO */ /* Dataspace errors */ #define H5E_CANTCLIP (H5OPEN H5E_CANTCLIP_g) #define H5E_CANTCOUNT (H5OPEN H5E_CANTCOUNT_g) #define H5E_CANTSELECT (H5OPEN H5E_CANTSELECT_g) #define H5E_CANTNEXT (H5OPEN H5E_CANTNEXT_g) #define H5E_BADSELECT (H5OPEN H5E_BADSELECT_g) #define H5E_CANTCOMPARE (H5OPEN H5E_CANTCOMPARE_g) #define H5E_CANTAPPEND (H5OPEN H5E_CANTAPPEND_g) H5_DLLVAR hid_t H5E_CANTCLIP_g; /* Can't clip hyperslab region */ H5_DLLVAR hid_t H5E_CANTCOUNT_g; /* Can't count elements */ H5_DLLVAR hid_t H5E_CANTSELECT_g; /* Can't select hyperslab */ H5_DLLVAR hid_t H5E_CANTNEXT_g; /* Can't move to next iterator location */ H5_DLLVAR hid_t H5E_BADSELECT_g; /* Invalid selection */ H5_DLLVAR hid_t H5E_CANTCOMPARE_g; /* Can't compare objects */ H5_DLLVAR hid_t H5E_CANTAPPEND_g; /* Can't append object */ /* Argument errors */ #define H5E_UNINITIALIZED (H5OPEN H5E_UNINITIALIZED_g) #define H5E_UNSUPPORTED (H5OPEN H5E_UNSUPPORTED_g) #define H5E_BADTYPE (H5OPEN H5E_BADTYPE_g) #define H5E_BADRANGE (H5OPEN H5E_BADRANGE_g) #define H5E_BADVALUE (H5OPEN H5E_BADVALUE_g) H5_DLLVAR hid_t H5E_UNINITIALIZED_g; /* Information is uinitialized */ H5_DLLVAR hid_t H5E_UNSUPPORTED_g; /* Feature is unsupported */ H5_DLLVAR hid_t H5E_BADTYPE_g; /* Inappropriate type */ H5_DLLVAR hid_t H5E_BADRANGE_g; /* Out of range */ H5_DLLVAR hid_t H5E_BADVALUE_g; /* Bad value */ /* B-tree related errors */ #define H5E_NOTFOUND (H5OPEN H5E_NOTFOUND_g) #define H5E_EXISTS (H5OPEN H5E_EXISTS_g) #define H5E_CANTENCODE (H5OPEN H5E_CANTENCODE_g) #define H5E_CANTDECODE (H5OPEN H5E_CANTDECODE_g) #define H5E_CANTSPLIT (H5OPEN H5E_CANTSPLIT_g) #define H5E_CANTREDISTRIBUTE (H5OPEN H5E_CANTREDISTRIBUTE_g) #define H5E_CANTSWAP (H5OPEN H5E_CANTSWAP_g) #define H5E_CANTINSERT (H5OPEN H5E_CANTINSERT_g) #define H5E_CANTLIST (H5OPEN H5E_CANTLIST_g) #define H5E_CANTMODIFY (H5OPEN H5E_CANTMODIFY_g) #define H5E_CANTREMOVE (H5OPEN H5E_CANTREMOVE_g) H5_DLLVAR hid_t H5E_NOTFOUND_g; /* Object not found */ H5_DLLVAR hid_t H5E_EXISTS_g; /* Object already exists */ H5_DLLVAR hid_t H5E_CANTENCODE_g; /* Unable to encode value */ H5_DLLVAR hid_t H5E_CANTDECODE_g; /* Unable to decode value */ H5_DLLVAR hid_t H5E_CANTSPLIT_g; /* Unable to split node */ H5_DLLVAR hid_t H5E_CANTREDISTRIBUTE_g; /* Unable to redistribute records */ H5_DLLVAR hid_t H5E_CANTSWAP_g; /* Unable to swap records */ H5_DLLVAR hid_t H5E_CANTINSERT_g; /* Unable to insert object */ H5_DLLVAR hid_t H5E_CANTLIST_g; /* Unable to list node */ H5_DLLVAR hid_t H5E_CANTMODIFY_g; /* Unable to modify record */ H5_DLLVAR hid_t H5E_CANTREMOVE_g; /* Unable to remove object */ /* Datatype conversion errors */ #define H5E_CANTCONVERT (H5OPEN H5E_CANTCONVERT_g) #define H5E_BADSIZE (H5OPEN H5E_BADSIZE_g) H5_DLLVAR hid_t H5E_CANTCONVERT_g; /* Can't convert datatypes */ H5_DLLVAR hid_t H5E_BADSIZE_g; /* Bad size for object */ #ifdef __cplusplus } #endif #endif /* H5Epubgen_H */
apache-2.0
adishavit/RaftLib
docs/html/class_port_exception-members.html
4832
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta name="generator" content="Doxygen 1.8.8"/> <title>RaftLib: Member List</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="search/searchdata.js"></script> <script type="text/javascript" src="search/search.js"></script> <script type="text/javascript"> $(document).ready(function() { init_search(); }); </script> <link href="doxygen.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td style="padding-left: 0.5em;"> <div id="projectname">RaftLib &#160;<span id="projectnumber">0.3a</span> </div> <div id="projectbrief">C++ Stream Processing Template Library</div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.8 --> <script type="text/javascript"> var searchBox = new SearchBox("searchBox", "search",false,'Search'); </script> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main&#160;Page</span></a></li> <li><a href="pages.html"><span>Related&#160;Pages</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li class="current"><a href="annotated.html"><span>Classes</span></a></li> <li><a href="files.html"><span>Files</span></a></li> <li> <div id="MSearchBox" class="MSearchBoxInactive"> <span class="left"> <img id="MSearchSelect" src="search/mag_sel.png" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" alt=""/> <input type="text" id="MSearchField" value="Search" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)" onkeyup="searchBox.OnSearchFieldChange(event)"/> </span><span class="right"> <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a> </span> </div> </li> </ul> </div> <div id="navrow2" class="tabs2"> <ul class="tablist"> <li><a href="annotated.html"><span>Class&#160;List</span></a></li> <li><a href="classes.html"><span>Class&#160;Index</span></a></li> <li><a href="inherits.html"><span>Class&#160;Hierarchy</span></a></li> <li><a href="functions.html"><span>Class&#160;Members</span></a></li> </ul> </div> <!-- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> </div> <!-- iframe showing the search results (closed by default) --> <div id="MSearchResultsWindow"> <iframe src="javascript:void(0)" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> </div><!-- top --> <div class="header"> <div class="headertitle"> <div class="title">PortException Member List</div> </div> </div><!--header--> <div class="contents"> <p>This is the complete list of members for <a class="el" href="class_port_exception.html">PortException</a>, including all inherited members.</p> <table class="directory"> <tr class="even"><td class="entry"><a class="el" href="class_port_exception.html#aec6ea14772ec4e06739ca2ae87115cbf">PortException</a>(const std::string message)</td><td class="entry"><a class="el" href="class_port_exception.html">PortException</a></td><td class="entry"></td></tr> <tr bgcolor="#f0f0f0"><td class="entry"><b>what</b>() const noexcept (defined in <a class="el" href="class_port_exception.html">PortException</a>)</td><td class="entry"><a class="el" href="class_port_exception.html">PortException</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr> </table></div><!-- contents --> <!-- start footer part --> <hr class="footer"/><address class="footer"><small> Generated on Thu Mar 19 2015 14:14:01 for RaftLib by &#160;<a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/> </a> 1.8.8 </small></address> </body> </html>
apache-2.0
codecentric/spring-boot-admin
spring-boot-admin-server-ui/src/main/frontend/views/instances/details/process-uptime.js
1540
/* * Copyright 2014-2018 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import subscribing from '@/mixins/subscribing'; import {timer} from '@/utils/rxjs'; import moment from 'moment'; export default { props: ['value'], mixins: [subscribing], data: () => ({ startTs: null, offset: null }), render() { return this._v(this.clock); }, computed: { clock() { if (!this.value) { return null; } const duration = moment.duration(this.value + this.offset); return `${Math.floor(duration.asDays())}d ${duration.hours()}h ${duration.minutes()}m ${duration.seconds()}s`; } }, watch: { value: 'subscribe' }, methods: { createSubscription() { if (this.value) { const vm = this; vm.startTs = moment(); vm.offset = 0; return timer(0, 1000).subscribe({ next: () => { vm.offset = moment().valueOf() - vm.startTs.valueOf(); } }) } } } }
apache-2.0
songeunwoo/ngrinder
ngrinder-controller/src/main/java/org/ngrinder/script/handler/ScriptHandler.java
10936
/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.ngrinder.script.handler; import freemarker.template.Configuration; import freemarker.template.DefaultObjectWrapper; import freemarker.template.Template; import org.apache.commons.io.FilenameUtils; import org.ngrinder.common.constant.ControllerConstants; import org.ngrinder.common.util.FileUtils; import org.ngrinder.common.util.PathUtils; import org.ngrinder.common.util.PropertiesWrapper; import org.ngrinder.model.User; import org.ngrinder.script.model.FileEntry; import org.ngrinder.script.model.FileType; import org.ngrinder.script.repository.FileEntryRepository; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.core.io.ClassPathResource; import java.io.File; import java.io.StringWriter; import java.util.List; import java.util.Map; import static org.apache.commons.lang.StringUtils.startsWithIgnoreCase; import static org.ngrinder.common.util.CollectionUtils.newArrayList; import static org.ngrinder.common.util.ExceptionUtils.processException; /** * Script per language handler. This is the superclass for all sub * {@link ScriptHandler}s which implements the specific processing of each * language. * * @author JunHo Yoon * @since 3.2 */ public abstract class ScriptHandler implements ControllerConstants { protected static final Logger LOGGER = LoggerFactory.getLogger(JythonScriptHandler.class); private final String codemirrorKey; private final String title; private final String extension; private final String key; /** * Constructor. * * @param key key of the script handler * @param extension extension * @param title title of the handler * @param codeMirrorKey code mirror key */ public ScriptHandler(String key, String extension, String title, String codeMirrorKey) { this.key = key; this.extension = extension; this.title = title; this.codemirrorKey = codeMirrorKey; } @Autowired private FileEntryRepository fileEntryRepository; /** * Get the display order of {@link ScriptHandler}s. * * @return order */ public abstract Integer displayOrder(); public String getCodemirrorKey() { return codemirrorKey; } /** * Check if the given fileEntry can be handled by this handler. * * @param fileEntry fileEntry to be checked * @return true if the given fileEntry can be handled */ public boolean canHandle(FileEntry fileEntry) { return FilenameUtils.isExtension(fileEntry.getPath(), getExtension()); } public String getExtension() { return extension; } /** * Get the handler resolution order. * <p/> * Less is more prioritized. * * @return the order of handler resolution */ protected abstract Integer order(); @SuppressWarnings("SpellCheckingInspection") public boolean isValidatable() { return true; } /** * Return if it's project handler which implements {@link ProjectHandler}. * * @return true if it is. */ @SuppressWarnings("UnusedDeclaration") public boolean isProjectHandler() { return (this instanceof ProjectHandler); } /** * Prepare the distribution. * * @param testCaseId id of the test case. This is for the log identification. * @param user user who will distribute the script. * @param scriptEntry script to be distributed. * @param distDir distribution target dir. * @param properties properties set which is used for detailed distribution control. * @param processingResult processing result holder. */ public void prepareDist(Long testCaseId, User user, // FileEntry scriptEntry, File distDir, PropertiesWrapper properties, ProcessingResultPrintStream processingResult) { prepareDefaultFile(distDir, properties); List<FileEntry> fileEntries = getLibAndResourceEntries(user, scriptEntry, -1); if (scriptEntry.getRevision() != 0) { fileEntries.add(scriptEntry); } String basePath = getBasePath(scriptEntry); // Distribute each files in that folder. for (FileEntry each : fileEntries) { // Directory is not subject to be distributed. if (each.getFileType() == FileType.DIR) { continue; } File toDir = new File(distDir, calcDistSubPath(basePath, each)); processingResult.printf("%s is being written.\n", each.getPath()); LOGGER.info("{} is being written in {} for test {}", new Object[]{each.getPath(), toDir, testCaseId}); getFileEntryRepository().writeContentTo(user, each.getPath(), toDir); } processingResult.setSuccess(true); prepareDistMore(testCaseId, user, scriptEntry, distDir, properties, processingResult); } /** * Prepare script creation. This method is subject to be extended by the * subclasses. * <p/> * This method is the perfect place if it's necessary to include additional * files. * * @param user user * @param path base path * @param fileName fileName * @param name name * @param url url * @param createLibAndResources true if lib and resources should be created * @return true if process more. */ public boolean prepareScriptEnv(User user, String path, String fileName, String name, String url, boolean createLibAndResources, String scriptContent) { return true; } /** * Prepare the distribution more. This method is subject to be extended by * the subclass. * * @param testCaseId test case id. This is for the log identification. * @param user user * @param script script entry to be distributed. * @param distDir distribution directory * @param properties properties * @param processingResult processing result holder */ protected void prepareDistMore(Long testCaseId, User user, FileEntry script, File distDir, PropertiesWrapper properties, ProcessingResultPrintStream processingResult) { } /** * Get the appropriated distribution path for the given file entry. * * @param basePath distribution base path * @param fileEntry fileEntry to be distributed * @return the resolved destination path. */ protected String calcDistSubPath(String basePath, FileEntry fileEntry) { String path = FilenameUtils.getPath(fileEntry.getPath()); path = path.substring(basePath.length()); return path; } /** * Get all resources and lib entries belonging to the given user and * scriptEntry. * * @param user user * @param scriptEntry script entry * @param revision revision of the script entry. * @return file entry list */ public List<FileEntry> getLibAndResourceEntries(User user, FileEntry scriptEntry, long revision) { String path = FilenameUtils.getPath(scriptEntry.getPath()); List<FileEntry> fileList = newArrayList(); for (FileEntry eachFileEntry : getFileEntryRepository().findAll(user, path + "lib/", revision, true)) { // Skip jython 2.5... it's already included. if (startsWithIgnoreCase(eachFileEntry.getFileName(), "jython-2.5.") || startsWithIgnoreCase(eachFileEntry.getFileName(), "jython-standalone-2.5.")) { continue; } FileType fileType = eachFileEntry.getFileType(); if (fileType.isLibDistributable()) { fileList.add(eachFileEntry); } } for (FileEntry eachFileEntry : getFileEntryRepository().findAll(user, path + "resources/", revision, true)) { FileType fileType = eachFileEntry.getFileType(); if (fileType.isResourceDistributable()) { fileList.add(eachFileEntry); } } return fileList; } protected void prepareDefaultFile(File distDir, PropertiesWrapper properties) { if (properties.getPropertyBoolean(PROP_CONTROLLER_DIST_LOGBACK)) { FileUtils.copyResourceToFile("/logback/logback-worker.xml", new File(distDir, "logback-worker.xml")); } } protected String getBasePath(FileEntry script) { return getBasePath(script.getPath()); } /** * Get the base path of the given path. * * @param path path * @return base path */ public String getBasePath(String path) { return FilenameUtils.getPath(path); } /** * Get executable script path. * * @param svnPath path in svn * @return path executable in agent. */ public String getScriptExecutePath(String svnPath) { return FilenameUtils.getName(svnPath); } /** * Check syntax errors for the given content. * * @param path path * @param content content * @return syntax error messages. null if none. */ public abstract String checkSyntaxErrors(String path, String content); /** * Get the initial script with the given value map. * * @param values map of initial script referencing values. * @return generated string */ public String getScriptTemplate(Map<String, Object> values) { try { Configuration freemarkerConfig = new Configuration(); ClassPathResource cpr = new ClassPathResource("script_template"); freemarkerConfig.setDirectoryForTemplateLoading(cpr.getFile()); freemarkerConfig.setObjectWrapper(new DefaultObjectWrapper()); Template template = freemarkerConfig.getTemplate("basic_template_" + getExtension() + ".ftl"); StringWriter writer = new StringWriter(); template.process(values, writer); return writer.toString(); } catch (Exception e) { throw processException("Error while fetching the script template.", e); } } public String getTitle() { return title; } public String getKey() { return key; } FileEntryRepository getFileEntryRepository() { return fileEntryRepository; } void setFileEntryRepository(FileEntryRepository fileEntryRepository) { this.fileEntryRepository = fileEntryRepository; } /** * Get the default quick test file. * * @param basePath base path * @return quick test file */ public FileEntry getDefaultQuickTestFilePath(String basePath) { FileEntry fileEntry = new FileEntry(); fileEntry.setPath(PathUtils.join(basePath, "TestRunner." + getExtension())); return fileEntry; } }
apache-2.0
alfredo777/btmglobalconsulting
plugins/phonegap-plugin-push/scripts/copyAndroidFile.js
856
module.exports = function(ctx) { var fs = ctx.requireCordovaModule('fs'), path = ctx.requireCordovaModule('path'), os = require("os"), readline = require("readline"), deferral = ctx.requireCordovaModule('q').defer(); var lineReader = readline.createInterface({ terminal: false, input : fs.createReadStream('platforms/android/build.gradle') }); lineReader.on("line", function(line) { fs.appendFileSync('./build.gradle', line.toString() + os.EOL); if (/.*\ dependencies \{.*/.test(line)) { fs.appendFileSync('./build.gradle', '\t\tclasspath "com.google.gms:google-services:3.0.0"' + os.EOL); } }).on("close", function () { fs.rename('./build.gradle', 'platforms/android/build.gradle', deferral.resolve); }); return deferral.promise; };
apache-2.0
apache/jena
jena-arq/src/main/java/org/apache/jena/sparql/exec/http/QueryExecHTTP.java
24139
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.jena.sparql.exec.http; import static org.apache.jena.http.HttpLib.*; import java.io.ByteArrayInputStream; import java.io.InputStream; import java.net.http.HttpClient; import java.net.http.HttpRequest; import java.net.http.HttpRequest.BodyPublishers; import java.net.http.HttpResponse; import java.nio.charset.StandardCharsets; import java.util.*; import java.util.concurrent.TimeUnit; import org.apache.jena.atlas.RuntimeIOException; import org.apache.jena.atlas.io.IO; import org.apache.jena.atlas.iterator.Iter; import org.apache.jena.atlas.json.JSON; import org.apache.jena.atlas.json.JsonArray; import org.apache.jena.atlas.json.JsonObject; import org.apache.jena.atlas.lib.InternalErrorException; import org.apache.jena.atlas.lib.Pair; import org.apache.jena.atlas.logging.Log; import org.apache.jena.atlas.web.HttpException; import org.apache.jena.graph.Graph; import org.apache.jena.graph.Triple; import org.apache.jena.http.HttpEnv; import org.apache.jena.http.HttpLib; import org.apache.jena.query.*; import org.apache.jena.riot.*; import org.apache.jena.riot.resultset.ResultSetLang; import org.apache.jena.riot.resultset.ResultSetReaderRegistry; import org.apache.jena.riot.web.HttpNames; import org.apache.jena.sparql.ARQException; import org.apache.jena.sparql.core.DatasetGraph; import org.apache.jena.sparql.core.DatasetGraphFactory; import org.apache.jena.sparql.core.Quad; import org.apache.jena.sparql.engine.http.HttpParams; import org.apache.jena.sparql.engine.http.QueryExceptionHTTP; import org.apache.jena.sparql.exec.QueryExec; import org.apache.jena.sparql.exec.RowSet; import org.apache.jena.sparql.util.Context; /** * A {@link QueryExec} implementation where queries are executed against a remote * service over HTTP. */ public class QueryExecHTTP implements QueryExec { /** @deprecated Use {@link #newBuilder} */ @Deprecated public static QueryExecHTTPBuilder create() { return newBuilder() ; } public static QueryExecHTTPBuilder newBuilder() { return QueryExecHTTPBuilder.create(); } public static QueryExecHTTPBuilder service(String serviceURL) { return QueryExecHTTP.newBuilder().endpoint(serviceURL); } //public static final String QUERY_MIME_TYPE = WebContent.contentTypeSPARQLQuery; private final Query query; private final String queryString; private final String service; private final Context context; // Params private Params params = null; private final QuerySendMode sendMode; private int urlLimit = HttpEnv.urlLimit; // Protocol private List<String> defaultGraphURIs = new ArrayList<>(); private List<String> namedGraphURIs = new ArrayList<>(); private boolean closed = false; // Timeout of query execution. private long readTimeout = -1; private TimeUnit readTimeoutUnit = TimeUnit.MILLISECONDS; // Content Types: these list the standard formats and also include */*. private final String selectAcceptheader = WebContent.defaultSparqlResultsHeader; private final String askAcceptHeader = WebContent.defaultSparqlAskHeader; private final String describeAcceptHeader = WebContent.defaultGraphAcceptHeader; private final String constructAcceptHeader = WebContent.defaultGraphAcceptHeader; private final String datasetAcceptHeader = WebContent.defaultDatasetAcceptHeader; // If this is non-null, it overrides the use of any Content-Type above. private String appProvidedAcceptHeader = null; // Received content type private String httpResponseContentType = null; // Releasing HTTP input streams is important. We remember this for SELECT result // set streaming, and will close it when the execution is closed private InputStream retainedConnection = null; private HttpClient httpClient = HttpEnv.getDftHttpClient(); private Map<String, String> httpHeaders; public QueryExecHTTP(String serviceURL, Query query, String queryString, int urlLimit, HttpClient httpClient, Map<String, String> httpHeaders, Params params, Context context, List<String> defaultGraphURIs, List<String> namedGraphURIs, QuerySendMode sendMode, String explicitAcceptHeader, long timeout, TimeUnit timeoutUnit) { this.context = ( context == null ) ? ARQ.getContext().copy() : context.copy(); this.service = serviceURL; this.query = query; this.queryString = queryString; this.urlLimit = urlLimit; this.httpHeaders = httpHeaders; this.defaultGraphURIs = defaultGraphURIs; this.namedGraphURIs = namedGraphURIs; this.sendMode = Objects.requireNonNull(sendMode); this.appProvidedAcceptHeader = explicitAcceptHeader; // Important - handled as special case because the defaults vary by query type. if ( httpHeaders.containsKey(HttpNames.hAccept) ) { if ( this.appProvidedAcceptHeader != null ) this.appProvidedAcceptHeader = httpHeaders.get(HttpNames.hAccept); this.httpHeaders.remove(HttpNames.hAccept); } this.httpHeaders = httpHeaders; this.params = params; this.readTimeout = timeout; this.readTimeoutUnit = timeoutUnit; this.httpClient = HttpLib.dft(httpClient, HttpEnv.getDftHttpClient()); } /** The Content-Type response header received (null before the remote operation is attempted). */ public String getHttpResponseContentType() { return httpResponseContentType; } @Override public RowSet select() { checkNotClosed(); check(QueryType.SELECT); RowSet rs = execRowSet(); return rs; } private RowSet execRowSet() { // Use the explicitly given header or the default selectAcceptheader String thisAcceptHeader = dft(appProvidedAcceptHeader, selectAcceptheader); HttpResponse<InputStream> response = performQuery(thisAcceptHeader); InputStream in = HttpLib.getInputStream(response); // Don't assume the endpoint actually gives back the content type we asked for String actualContentType = responseHeader(response, HttpNames.hContentType); // Remember the response. httpResponseContentType = actualContentType; // More reliable to use the format-defined charsets e.g. JSON -> UTF-8 actualContentType = removeCharset(actualContentType); if (false) { byte b[] = IO.readWholeFile(in); String str = new String(b); System.out.println(str); in = new ByteArrayInputStream(b); } retainedConnection = in; // This will be closed on close() if (actualContentType == null || actualContentType.equals("")) actualContentType = WebContent.contentTypeResultsXML; // Map to lang, with pragmatic alternatives. Lang lang = WebContent.contentTypeToLangResultSet(actualContentType); if ( lang == null ) throw new QueryException("Endpoint returned Content-Type: " + actualContentType + " which is not recognized for SELECT queries"); if ( !ResultSetReaderRegistry.isRegistered(lang) ) throw new QueryException("Endpoint returned Content-Type: " + actualContentType + " which is not supported for SELECT queries"); // This returns a streaming result set for some formats. // Do not close the InputStream at this point. ResultSet result = ResultSetMgr.read(in, lang); return RowSet.adapt(result); } @Override public boolean ask() { checkNotClosed(); check(QueryType.ASK); String thisAcceptHeader = dft(appProvidedAcceptHeader, askAcceptHeader); HttpResponse<InputStream> response = performQuery(thisAcceptHeader); InputStream in = HttpLib.getInputStream(response); String actualContentType = responseHeader(response, HttpNames.hContentType); httpResponseContentType = actualContentType; actualContentType = removeCharset(actualContentType); // If the server fails to return a Content-Type then we will assume // the server returned the type we asked for if (actualContentType == null || actualContentType.equals("")) actualContentType = askAcceptHeader; Lang lang = RDFLanguages.contentTypeToLang(actualContentType); if ( lang == null ) { // Any specials : // application/xml for application/sparql-results+xml // application/json for application/sparql-results+json if (actualContentType.equals(WebContent.contentTypeXML)) lang = ResultSetLang.RS_XML; else if ( actualContentType.equals(WebContent.contentTypeJSON)) lang = ResultSetLang.RS_JSON; } if ( lang == null ) throw new QueryException("Endpoint returned Content-Type: " + actualContentType + " which is not supported for ASK queries"); boolean result = ResultSetMgr.readBoolean(in, lang); finish(in); return result; } private String removeCharset(String contentType) { int idx = contentType.indexOf(';'); if ( idx < 0 ) return contentType; return contentType.substring(0,idx); } @Override public Graph construct(Graph graph) { checkNotClosed(); check(QueryType.CONSTRUCT); return execGraph(graph, constructAcceptHeader); } @Override public Iterator<Triple> constructTriples() { checkNotClosed(); check(QueryType.CONSTRUCT); return execTriples(constructAcceptHeader); } @Override public Iterator<Quad> constructQuads(){ checkNotClosed(); return execQuads(); } @Override public DatasetGraph constructDataset(){ checkNotClosed(); return constructDataset(DatasetGraphFactory.createTxnMem()); } @Override public DatasetGraph constructDataset(DatasetGraph dataset){ checkNotClosed(); check(QueryType.CONSTRUCT); return execDataset(dataset); } @Override public Graph describe(Graph graph) { checkNotClosed(); check(QueryType.DESCRIBE); return execGraph(graph, describeAcceptHeader); } @Override public Iterator<Triple> describeTriples() { checkNotClosed(); return execTriples(describeAcceptHeader); } private Graph execGraph(Graph graph, String acceptHeader) { Pair<InputStream, Lang> p = execRdfWorker(acceptHeader, WebContent.contentTypeRDFXML); InputStream in = p.getLeft(); Lang lang = p.getRight(); try { RDFDataMgr.read(graph, in, lang); } catch (RiotException ex) { HttpLib.finish(in); throw ex; } return graph; } private DatasetGraph execDataset(DatasetGraph dataset) { Pair<InputStream, Lang> p = execRdfWorker(datasetAcceptHeader, WebContent.contentTypeNQuads); InputStream in = p.getLeft(); Lang lang = p.getRight(); try { RDFDataMgr.read(dataset, in, lang); } catch (RiotException ex) { finish(in); throw ex; } return dataset; } @SuppressWarnings("deprecation") private Iterator<Triple> execTriples(String acceptHeader) { Pair<InputStream, Lang> p = execRdfWorker(acceptHeader, WebContent.contentTypeRDFXML); InputStream input = p.getLeft(); Lang lang = p.getRight(); // Base URI? // Unless N-Triples, this creates a thread. Iterator<Triple> iter = RDFDataMgr.createIteratorTriples(input, lang, null); return Iter.onCloseIO(iter, input); } @SuppressWarnings("deprecation") private Iterator<Quad> execQuads() { checkNotClosed(); Pair<InputStream, Lang> p = execRdfWorker(datasetAcceptHeader, WebContent.contentTypeNQuads); InputStream input = p.getLeft(); Lang lang = p.getRight(); // Unless N-Quads, this creates a thread. Iterator<Quad> iter = RDFDataMgr.createIteratorQuads(input, lang, null); return Iter.onCloseIO(iter, input); } // Any RDF data back (CONSTRUCT, DESCRIBE, QUADS) // ifNoContentType - some wild guess at the content type. private Pair<InputStream, Lang> execRdfWorker(String contentType, String ifNoContentType) { checkNotClosed(); String thisAcceptHeader = dft(appProvidedAcceptHeader, contentType); HttpResponse<InputStream> response = performQuery(thisAcceptHeader); InputStream in = HttpLib.getInputStream(response); // Don't assume the endpoint actually gives back the content type we asked for String actualContentType = responseHeader(response, HttpNames.hContentType); httpResponseContentType = actualContentType; actualContentType = removeCharset(actualContentType); // If the server fails to return a Content-Type then we will assume // the server returned the type we asked for if (actualContentType == null || actualContentType.equals("")) actualContentType = ifNoContentType; Lang lang = RDFLanguages.contentTypeToLang(actualContentType); if ( ! RDFLanguages.isQuads(lang) && ! RDFLanguages.isTriples(lang) ) throw new QueryException("Endpoint returned Content Type: " + actualContentType + " which is not a valid RDF syntax"); return Pair.create(in, lang); } @Override public JsonArray execJson() { checkNotClosed(); check(QueryType.CONSTRUCT_JSON); String thisAcceptHeader = dft(appProvidedAcceptHeader, WebContent.contentTypeJSON); HttpResponse<InputStream> response = performQuery(thisAcceptHeader); InputStream in = HttpLib.getInputStream(response); try { return JSON.parseAny(in).getAsArray(); } finally { finish(in); } } @Override public Iterator<JsonObject> execJsonItems() { JsonArray array = execJson().getAsArray(); List<JsonObject> x = new ArrayList<>(array.size()); array.forEach(elt->{ if ( ! elt.isObject()) throw new QueryExecException("Item in an array from a JSON query isn't an object"); x.add(elt.getAsObject()); }); return x.iterator(); } private void checkNotClosed() { if ( closed ) throw new QueryExecException("HTTP QueryExecHTTP has been closed"); } private void check(QueryType queryType) { if ( query == null ) { // Pass through the queryString. return; } if ( query.queryType() != queryType ) throw new QueryExecException("Not the right form of query. Expected "+queryType+" but got "+query.queryType()); } @Override public Context getContext() { return context; } @Override public DatasetGraph getDataset() { return null; } // This may be null - if we were created form a query string, // we don't guarantee to parse it so we let through non-SPARQL // extensions to the far end. @Override public Query getQuery() { if ( query != null ) return query; if ( queryString != null ) { // Object not created with a Query object, may be because there is foreign // syntax in the query or may be because the query string was available and the app // didn't want the overhead of parsing it every time. // Try to parse it else return null; try { return QueryFactory.create(queryString, Syntax.syntaxARQ); } catch (QueryParseException ex) {} return null; } return null; } /** * Return the query string. If this was supplied as a string, * there is no guarantee this is legal SPARQL syntax. */ @Override public String getQueryString() { return queryString; } private static long asMillis(long duration, TimeUnit timeUnit) { return (duration < 0) ? duration : timeUnit.toMillis(duration); } /** * Make a query over HTTP. * The response is returned after status code processing so the caller can assume the * query execution was successful and return 200. * Use {@link HttpLib#getInputStream} to access the body. */ private HttpResponse<InputStream> performQuery(String reqAcceptHeader) { if (closed) throw new ARQException("HTTP execution already closed"); // SERVICE specials. Params thisParams = Params.create(params); if ( defaultGraphURIs != null ) { for ( String dft : defaultGraphURIs ) thisParams.add( HttpParams.pDefaultGraph, dft ); } if ( namedGraphURIs != null ) { for ( String name : namedGraphURIs ) thisParams.add( HttpParams.pNamedGraph, name ); } HttpLib.modifyByService(service, context, thisParams, httpHeaders); HttpRequest request = makeRequest(thisParams, reqAcceptHeader); return executeQuery(request); } private HttpRequest makeRequest(Params thisParams, String reqAcceptHeader) { QuerySendMode actualSendMode = actualSendMode(); HttpRequest.Builder requestBuilder; switch(actualSendMode) { case asGetAlways : requestBuilder = executeQueryGet(thisParams, reqAcceptHeader); break; case asPostForm : requestBuilder = executeQueryPostForm(thisParams, reqAcceptHeader); break; case asPost : requestBuilder = executeQueryPostBody(thisParams, reqAcceptHeader); break; default : // Should not happen! throw new InternalErrorException("Invalid value for 'actualSendMode' "+actualSendMode); } return requestBuilder.build(); } private HttpResponse<InputStream> executeQuery(HttpRequest request) { logQuery(queryString, request); try { HttpResponse<InputStream> response = execute(httpClient, request); HttpLib.handleHttpStatusCode(response); return response; } catch (HttpException httpEx) { throw QueryExceptionHTTP.rewrap(httpEx); } } private QuerySendMode actualSendMode() { int thisLengthLimit = urlLimit; switch(sendMode) { case asGetAlways : case asPostForm : case asPost : return sendMode; case asGetWithLimitBody : case asGetWithLimitForm : break; } // Only QuerySendMode.asGetWithLimitBody and QuerySendMode.asGetWithLimitForm here. String requestURL = service; // Other params (query= has not been added at this point) int paramsLength = params.httpString().length(); int qEncodedLength = calcEncodeStringLength(queryString); // URL Length, including service (for safety) int length = service.length() + /* ?query= */ 1 + HttpParams.pQuery.length() + /* encoded query */ qEncodedLength + /* &other params*/ 1 + paramsLength; if ( length <= thisLengthLimit ) return QuerySendMode.asGetAlways; return (sendMode==QuerySendMode.asGetWithLimitBody) ? QuerySendMode.asPost : QuerySendMode.asPostForm; } private static int calcEncodeStringLength(String str) { // Could approximate by counting non-queryString character and adding that *2 to the length of the string. String qs = HttpLib.urlEncodeQueryString(str); int encodedLength = qs.length(); return encodedLength; } private HttpRequest.Builder executeQueryGet(Params thisParams, String acceptHeader) { thisParams.add(HttpParams.pQuery, queryString); String requestURL = requestURL(service, thisParams.httpString()); HttpRequest.Builder builder = HttpLib.requestBuilder(requestURL, httpHeaders, readTimeout, readTimeoutUnit); acceptHeader(builder, acceptHeader); return builder.GET(); } private HttpRequest.Builder executeQueryPostForm(Params thisParams, String acceptHeader) { thisParams.add(HttpParams.pQuery, queryString); String requestURL = service; String formBody = thisParams.httpString(); HttpRequest.Builder builder = HttpLib.requestBuilder(requestURL, httpHeaders, readTimeout, readTimeoutUnit); acceptHeader(builder, acceptHeader); // Use an HTML form. contentTypeHeader(builder, WebContent.contentTypeHTMLForm); // Already UTF-8 encoded to ASCII. return builder.POST(BodyPublishers.ofString(formBody, StandardCharsets.US_ASCII)); } // Use SPARQL query body and MIME type. private HttpRequest.Builder executeQueryPostBody(Params thisParams, String acceptHeader) { // Use thisParams (for default-graph-uri etc) String requestURL = requestURL(service, thisParams.httpString()); HttpRequest.Builder builder = HttpLib.requestBuilder(requestURL, httpHeaders, readTimeout, readTimeoutUnit); contentTypeHeader(builder, WebContent.contentTypeSPARQLQuery); acceptHeader(builder, acceptHeader); return builder.POST(BodyPublishers.ofString(queryString)); } private static void logQuery(String queryString, HttpRequest request) {} /** * Cancel query evaluation */ public void cancel() { closed = true; } @Override public void abort() { try { close(); } catch (Exception ex) { Log.warn(this, "Error during abort", ex); } } @Override public void close() { closed = true; if (retainedConnection != null) { try { // This call may take a long time if the response has not been consumed // as HTTP client will consume the remaining response so it can re-use the // connection. If we're closing when we're not at the end of the stream then // issue a warning to the logs if (retainedConnection.read() != -1) Log.warn(this, "HTTP response not fully consumed, if HTTP Client is reusing connections (its default behaviour) then it will consume the remaining response data which may take a long time and cause this application to become unresponsive"); retainedConnection.close(); } catch (RuntimeIOException | java.io.IOException e) { // If we are closing early and the underlying stream is chunk encoded // the close() can result in a IOException. TypedInputStream catches // and re-wraps that and we want to suppress both forms. } finally { retainedConnection = null; } } } @Override public boolean isClosed() { return closed; } }
apache-2.0
daisy/pipeline-issues
modules/scripts-utils/zedai-utils/src/main/resources/xml/schema/z3998-book-1.0-latest/schemadoc/subfiles/e-lngroup02.html
6522
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>Schema Documentation: the lngroup element</title> <link href="../schemadoc.css" rel="stylesheet" type="text/css" /> </head> <body> <div class="top-banner">Schema Documentation - Book Profile<span class="titlesub"><br /> version 1.0</span></div> <!--Used to have a nav box with link to toc, and prev/next element. Not included yet--> <h1>The <span class="element-variant">lngroup</span> variant of the <span class="element">lngroup</span> element </h1> <div class="elementInformation"> <div class="element-toc-container"><strong>On this page:</strong><ul class="element-toc"> <li id="link-to-main-menu"><a href="../index.html">Back to<br /> main menu</a></li> <li class="h2"><a href="#d120e10">Usage Example</a></li> <li class="h2"><a href="#d120e14">Allowed parents</a></li> <li class="h2"><a href="#d120e29">Allowed children</a></li> <li class="h2"><a href="#d120e58">Content model</a></li> <li class="h2"><a href="#d120e171">Variants</a></li> <li class="h2"><a href="#d120e179">Namespace</a></li> </ul> </div> <div class="element-coreinfo"> <div class="main-description"> <p class="description ">The <code>lngroup</code> element represents a group of <a href="e-ln02.html">lines</a>. </p> </div> <h2 id="d120e10">Usage Example</h2><pre> &lt;lngroup&gt; &lt;ln&gt;&lt;lnum&gt;1&lt;/lnum&gt;Of Man's first disobedience, and the fruit&lt;/ln&gt; &lt;ln&gt;Of that forbidden tree whose mortal taste&lt;/ln&gt; &lt;ln&gt;Brought death into the World, and all our woe,&lt;/ln&gt; &lt;/lngroup&gt; </pre><h2 id="d120e14">Allowed parents</h2> <p><a class="element" href="e-address01.html">address</a>, <a class="element" href="e-quote01.html">quote</a>, <a class="element" href="e-section02.html">section</a> and <a class="element" href="e-verse01.html">verse</a> </p> <h2 id="d120e29">Allowed children</h2> <p>This element <em>must not</em> contain text. </p> <p>This element <em>must</em> contain the following children: <a class="element" href="e-ln02.html">ln</a> </p> <p>This element <em>may</em> contain the following children: <a class="element" href="e-annotation02.html">annotation</a>, <a class="element" href="e-note02.html">note</a> and <a class="element" href="e-pagebreak01.html">pagebreak</a> </p> <h2 id="d120e58">Content model</h2> <div class="element-content-model"> <div class="rng-optional-attributes">optional attributes: <a class="attribute" href="attributes.html#about01">@about</a>, <a class="attribute" href="attributes.html#by01">@by</a>, <a class="attribute" href="attributes.html#class01">@class</a>, <a class="attribute" href="attributes.html#content01">@content</a>, <a class="attribute" href="attributes.html#continuation01">@continuation</a>, <a class="attribute" href="attributes.html#datatype01">@datatype</a>, <a class="attribute" href="attributes.html#desc01">@desc</a>, <a class="attribute" href="attributes.html#dir01">@its:dir</a>, <a class="attribute" href="attributes.html#translate01">@its:translate</a>, <a class="attribute" href="attributes.html#property01">@property</a>, <a class="attribute" href="attributes.html#rel01">@rel</a>, <a class="attribute" href="attributes.html#resource01">@resource</a>, <a class="attribute" href="attributes.html#rev01">@rev</a>, <a class="attribute" href="attributes.html#role11">@role</a>, <a class="attribute" href="attributes.html#selid01">@sel:selid</a>, <a class="attribute" href="attributes.html#onlangfailure01">@ssml:onlangfailure</a>, <a class="attribute" href="attributes.html#typeof01">@typeof</a>, <a class="attribute" href="attributes.html#base01">@xml:base</a>, <a class="attribute" href="attributes.html#id01">@xml:id</a>, <a class="attribute" href="attributes.html#lang01">@xml:lang</a> and <a class="attribute" href="attributes.html#space01">@xml:space</a></div> <div class="rng"><span class="rng-term">a mix of</span> <div class="rng">• <span class="rng-term">zero or more of </span> <a class="element" href="e-note02.html">note</a> </div> <div class="rng">• <span class="rng-term">zero or more of </span> <a class="element" href="e-annotation02.html">annotation</a> </div> <div class="rng">• <span class="rng-term">one or more of </span> <a class="element" href="e-ln02.html">ln</a> </div> <div class="rng">• <span class="rng-term">zero or more of </span> <a class="element" href="e-pagebreak01.html">pagebreak</a> </div> <span class="rng-term">end of mix</span></div> </div> <h2 id="d120e171">Variants</h2> <p>This element exists in 2 variants. The other variant is the <a href="e-lngroup01.html"><span class="element-variant">code</span> variant.</a></p> <h2 id="d120e179">Namespace</h2> <p><span class="namespace">http://www.daisy.org/ns/z3998/authoring/</span></p> </div> </div> </body> </html>
apache-2.0
jorgebay/tinkerpop
gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Connection.java
18349
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.apache.tinkerpop.gremlin.driver; import io.netty.handler.codec.CodecException; import org.apache.tinkerpop.gremlin.driver.exception.ConnectionException; import org.apache.tinkerpop.gremlin.driver.message.RequestMessage; import io.netty.bootstrap.Bootstrap; import io.netty.channel.Channel; import io.netty.channel.ChannelPromise; import io.netty.channel.socket.nio.NioSocketChannel; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.IOException; import java.net.URI; import java.util.UUID; import java.util.concurrent.CompletableFuture; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.ScheduledFuture; import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicReference; /** * A single connection to a Gremlin Server instance. * * @author Stephen Mallette (http://stephen.genoprime.com) */ final class Connection { private static final Logger logger = LoggerFactory.getLogger(Connection.class); private final Channel channel; private final URI uri; private final ConcurrentMap<UUID, ResultQueue> pending = new ConcurrentHashMap<>(); private final Cluster cluster; private final Client client; private final ConnectionPool pool; private final long keepAliveInterval; public static final int MAX_IN_PROCESS = 4; public static final int MIN_IN_PROCESS = 1; public static final int MAX_WAIT_FOR_CONNECTION = 3000; public static final int MAX_WAIT_FOR_SESSION_CLOSE = 3000; public static final int MAX_CONTENT_LENGTH = 65536; public static final int RECONNECT_INTERVAL = 1000; public static final int RESULT_ITERATION_BATCH_SIZE = 64; public static final long KEEP_ALIVE_INTERVAL = 1800000; /** * When a {@code Connection} is borrowed from the pool, this number is incremented to indicate the number of * times it has been taken and is decremented when it is returned. This number is one indication as to how * busy a particular {@code Connection} is. */ public final AtomicInteger borrowed = new AtomicInteger(0); private final AtomicReference<Class<Channelizer>> channelizerClass = new AtomicReference<>(null); private volatile boolean isDead = false; private final int maxInProcess; private final String connectionLabel; private final Channelizer channelizer; private final AtomicReference<CompletableFuture<Void>> closeFuture = new AtomicReference<>(); private final AtomicBoolean shutdownInitiated = new AtomicBoolean(false); private final AtomicReference<ScheduledFuture> keepAliveFuture = new AtomicReference<>(); public Connection(final URI uri, final ConnectionPool pool, final int maxInProcess) throws ConnectionException { this.uri = uri; this.cluster = pool.getCluster(); this.client = pool.getClient(); this.pool = pool; this.maxInProcess = maxInProcess; this.keepAliveInterval = pool.settings().keepAliveInterval; connectionLabel = String.format("Connection{host=%s}", pool.host); if (cluster.isClosing()) throw new IllegalStateException("Cannot open a connection with the cluster after close() is called"); final Bootstrap b = this.cluster.getFactory().createBootstrap(); try { if (channelizerClass.get() == null) { channelizerClass.compareAndSet(null, (Class<Channelizer>) Class.forName(cluster.connectionPoolSettings().channelizer)); } channelizer = channelizerClass.get().newInstance(); channelizer.init(this); b.channel(NioSocketChannel.class).handler(channelizer); channel = b.connect(uri.getHost(), uri.getPort()).sync().channel(); channelizer.connected(); logger.info("Created new connection for {}", uri); } catch (Exception ie) { logger.debug("Error opening connection on {}", uri); throw new ConnectionException(uri, "Could not open connection", ie); } } /** * A connection can only have so many things in process happening on it at once, where "in process" refers to * the maximum number of in-process requests less the number of pending responses. */ public int availableInProcess() { // no need for a negative available amount - not sure that the pending size can ever exceed maximum, but // better to avoid the negatives that would ensue if it did return Math.max(0, maxInProcess - pending.size()); } public boolean isDead() { return isDead; } boolean isClosing() { return closeFuture.get() != null; } URI getUri() { return uri; } Cluster getCluster() { return cluster; } Client getClient() { return client; } ConcurrentMap<UUID, ResultQueue> getPending() { return pending; } public synchronized CompletableFuture<Void> closeAsync() { if (isClosing()) return closeFuture.get(); final CompletableFuture<Void> future = new CompletableFuture<>(); closeFuture.set(future); // stop any pings being sent at the server for keep-alive final ScheduledFuture keepAlive = keepAliveFuture.get(); if (keepAlive != null) keepAlive.cancel(true); // make sure all requests in the queue are fully processed before killing. if they are then shutdown // can be immediate. if not this method will signal the readCompleted future defined in the write() // operation to check if it can close. in this way the connection no longer receives writes, but // can continue to read. If a request never comes back the future won't get fulfilled and the connection // will maintain a "pending" request, that won't quite ever go away. The build up of such a dead requests // on a connection in the connection pool will force the pool to replace the connection for a fresh one. if (isOkToClose()) { if (null == channel) future.complete(null); else shutdown(future); } else { // there may be some pending requests. schedule a job to wait for those to complete and then shutdown new CheckForPending(future).runUntilDone(cluster.executor(), 1000, TimeUnit.MILLISECONDS); } return future; } public void close() { try { closeAsync().get(); } catch (Exception ex) { throw new RuntimeException(ex); } } public ChannelPromise write(final RequestMessage requestMessage, final CompletableFuture<ResultSet> future) { // once there is a completed write, then create a traverser for the result set and complete // the promise so that the client knows that that it can start checking for results. final Connection thisConnection = this; final ChannelPromise requestPromise = channel.newPromise() .addListener(f -> { if (!f.isSuccess()) { if (logger.isDebugEnabled()) logger.debug(String.format("Write on connection %s failed", thisConnection.getConnectionInfo()), f.cause()); thisConnection.isDead = true; thisConnection.returnToPool(); cluster.executor().submit(() -> future.completeExceptionally(f.cause())); } else { final LinkedBlockingQueue<Result> resultLinkedBlockingQueue = new LinkedBlockingQueue<>(); final CompletableFuture<Void> readCompleted = new CompletableFuture<>(); // the callback for when the read was successful, meaning that ResultQueue.markComplete() // was called readCompleted.thenAcceptAsync(v -> { thisConnection.returnToPool(); tryShutdown(); }, cluster.executor()); // the callback for when the read failed. a failed read means the request went to the server // and came back with a server-side error of some sort. it means the server is responsive // so this isn't going to be like a dead host situation which is handled above on a failed // write operation. // // in the event of an IOException (typically means that the Connection might have // been closed from the server side - this is typical in situations like when a request is // sent that exceeds maxContentLength and the server closes the channel on its side) or other // exceptions that indicate a non-recoverable state for the Connection object // (a netty CorruptedFrameException is a good example of that), the Connection cannot simply // be returned to the pool as future uses will end with refusal from the server and make it // appear as a dead host as the write will not succeed. instead, the Connection needs to be // replaced in these scenarios which destroys the dead channel on the client and allows a new // one to be reconstructed. readCompleted.exceptionally(t -> { if (t instanceof IOException || t instanceof CodecException) { if (pool != null) pool.replaceConnection(thisConnection); } else { thisConnection.returnToPool(); } // close was signaled in closeAsync() but there were pending messages at that time. attempt // the shutdown if the returned result cleared up the last pending message tryShutdown(); return null; }); final ResultQueue handler = new ResultQueue(resultLinkedBlockingQueue, readCompleted); pending.put(requestMessage.getRequestId(), handler); cluster.executor().submit(() -> future.complete( new ResultSet(handler, cluster.executor(), readCompleted, requestMessage, pool.host))); } }); channel.writeAndFlush(requestMessage, requestPromise); // try to keep the connection alive if the channel allows such things - websockets will if (channelizer.supportsKeepAlive() && keepAliveInterval > 0) { final ScheduledFuture oldKeepAliveFuture = keepAliveFuture.getAndSet(cluster.executor().scheduleAtFixedRate(() -> { logger.debug("Request sent to server to keep {} alive", thisConnection); try { channel.writeAndFlush(channelizer.createKeepAliveMessage()); } catch (Exception ex) { // will just log this for now - a future real request can be responsible for the failure that // marks the host as dead. this also may not mean the host is actually dead. more robust handling // is in play for real requests, not this simple ping logger.warn(String.format("Keep-alive did not succeed on %s", thisConnection), ex); } }, keepAliveInterval, keepAliveInterval, TimeUnit.MILLISECONDS)); // try to cancel the old future if it's still un-executed - no need to ping since a new write has come // through on the connection if (oldKeepAliveFuture != null) oldKeepAliveFuture.cancel(true); } return requestPromise; } public void returnToPool() { try { if (pool != null) pool.returnConnection(this); } catch (ConnectionException ce) { if (logger.isDebugEnabled()) logger.debug("Returned {} connection to {} but an error occurred - {}", this.getConnectionInfo(), pool, ce.getMessage()); } } private boolean isOkToClose() { return pending.isEmpty() || (channel !=null && !channel.isOpen()) || !pool.host.isAvailable(); } /** * Close was signaled in closeAsync() but there were pending messages at that time. This method attempts the * shutdown if the returned result cleared up the last pending message. */ private void tryShutdown() { if (isClosing() && isOkToClose()) shutdown(closeFuture.get()); } private synchronized void shutdown(final CompletableFuture<Void> future) { // shutdown can be called directly from closeAsync() or after write() and therefore this method should only // be called once. once shutdown is initiated, it shouldn't be executed a second time or else it sends more // messages at the server and leads to ugly log messages over there. if (shutdownInitiated.compareAndSet(false, true)) { // maybe this should be delegated back to the Client implementation??? kinda weird to instanceof here..... if (client instanceof Client.SessionedClient) { final boolean forceClose = client.getSettings().getSession().get().isForceClosed(); final RequestMessage closeMessage = client.buildMessage( RequestMessage.build(Tokens.OPS_CLOSE).addArg(Tokens.ARGS_FORCE, forceClose)).create(); final CompletableFuture<ResultSet> closed = new CompletableFuture<>(); write(closeMessage, closed); try { // make sure we get a response here to validate that things closed as expected. on error, we'll let // the server try to clean up on its own. the primary error here should probably be related to // protocol issues which should not be something a user has to fuss with. closed.join().all().get(cluster.connectionPoolSettings().maxWaitForSessionClose, TimeUnit.MILLISECONDS); } catch (TimeoutException ex) { final String msg = String.format( "Timeout while trying to close connection on %s - force closing - server will close session on shutdown or expiration.", ((Client.SessionedClient) client).getSessionId()); logger.warn(msg, ex); } catch (Exception ex) { final String msg = String.format( "Encountered an error trying to close connection on %s - force closing - server will close session on shutdown or expiration.", ((Client.SessionedClient) client).getSessionId()); logger.warn(msg, ex); } } channelizer.close(channel); final ChannelPromise promise = channel.newPromise(); promise.addListener(f -> { if (f.cause() != null) future.completeExceptionally(f.cause()); else future.complete(null); }); channel.close(promise); } } public String getConnectionInfo() { return String.format("Connection{host=%s, isDead=%s, borrowed=%s, pending=%s}", pool.host, isDead, borrowed, pending.size()); } @Override public String toString() { return connectionLabel; } /** * Self-cancelling tasks that periodically checks for the pending queue to clear before shutting down the * {@code Connection}. Once it does that, it self cancels the scheduled job in the executor. */ private final class CheckForPending implements Runnable { private volatile ScheduledFuture<?> self; private final CompletableFuture<Void> future; CheckForPending(final CompletableFuture<Void> future) { this.future = future; } @Override public void run() { logger.info("Checking for pending messages to complete before close on {}", this); if (isOkToClose()) { shutdown(future); boolean interrupted = false; try { while(null == self) { try { Thread.sleep(1); } catch (InterruptedException e) { interrupted = true; } } self.cancel(false); } finally { if(interrupted) { Thread.currentThread().interrupt(); } } } } void runUntilDone(final ScheduledExecutorService executor, final long period, final TimeUnit unit) { self = executor.scheduleAtFixedRate(this, period, period, unit); } } }
apache-2.0
asurve/arvind-sysml
src/test/java/org/apache/sysml/test/integration/functions/compress/BasicGetValueTest.java
4624
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.apache.sysml.test.integration.functions.compress; import org.apache.sysml.runtime.compress.CompressedMatrixBlock; import org.apache.sysml.runtime.matrix.data.MatrixBlock; import org.apache.sysml.runtime.util.DataConverter; import org.apache.sysml.test.integration.AutomatedTestBase; import org.apache.sysml.test.utils.TestUtils; import org.junit.Assert; import org.junit.Test; /** * */ public class BasicGetValueTest extends AutomatedTestBase { private static final int rows = 1023; private static final int cols = 20; private static final double sparsity1 = 0.9; private static final double sparsity2 = 0.1; private static final double sparsity3 = 0.0; public enum SparsityType { DENSE, SPARSE, EMPTY, } public enum ValueType { RAND, RAND_ROUND, CONST, } @Override public void setUp() { } @Test public void testDenseRandDataCompression() { runGetValueTest(SparsityType.DENSE, ValueType.RAND, true); } @Test public void testSparseRandDataCompression() { runGetValueTest(SparsityType.SPARSE, ValueType.RAND, true); } @Test public void testEmptyCompression() { runGetValueTest(SparsityType.EMPTY, ValueType.RAND, true); } @Test public void testDenseRoundRandDataCompression() { runGetValueTest(SparsityType.DENSE, ValueType.RAND_ROUND, true); } @Test public void testSparseRoundRandDataCompression() { runGetValueTest(SparsityType.SPARSE, ValueType.RAND_ROUND, true); } @Test public void testDenseConstantDataCompression() { runGetValueTest(SparsityType.DENSE, ValueType.CONST, true); } @Test public void testSparseConstDataCompression() { runGetValueTest(SparsityType.SPARSE, ValueType.CONST, true); } @Test public void testDenseRandDataNoCompression() { runGetValueTest(SparsityType.DENSE, ValueType.RAND, false); } @Test public void testSparseRandDataNoCompression() { runGetValueTest(SparsityType.SPARSE, ValueType.RAND, false); } @Test public void testEmptyNoCompression() { runGetValueTest(SparsityType.EMPTY, ValueType.RAND, false); } @Test public void testDenseRoundRandDataNoCompression() { runGetValueTest(SparsityType.DENSE, ValueType.RAND_ROUND, false); } @Test public void testSparseRoundRandDataNoCompression() { runGetValueTest(SparsityType.SPARSE, ValueType.RAND_ROUND, false); } @Test public void testDenseConstDataNoCompression() { runGetValueTest(SparsityType.DENSE, ValueType.CONST, false); } @Test public void testSparseConstDataNoCompression() { runGetValueTest(SparsityType.SPARSE, ValueType.CONST, false); } /** * * @param mb */ private void runGetValueTest(SparsityType sptype, ValueType vtype, boolean compress) { try { //prepare sparsity for input data double sparsity = -1; switch( sptype ){ case DENSE: sparsity = sparsity1; break; case SPARSE: sparsity = sparsity2; break; case EMPTY: sparsity = sparsity3; break; } //generate input data double min = (vtype==ValueType.CONST)? 10 : -10; double[][] input = TestUtils.generateTestMatrix(rows, cols, min, 10, sparsity, 7); if( vtype==ValueType.RAND_ROUND ) input = TestUtils.round(input); MatrixBlock mb = DataConverter.convertToMatrixBlock(input); //compress given matrix block CompressedMatrixBlock cmb = new CompressedMatrixBlock(mb); if( compress ) cmb.compress(); //iterate over all cells, get and compare for(int i=0; i<rows; i++) for(int j=0; j<cols; j++) { double ulaVal = mb.getValue(i, j); //calls quickGetValue internally double claVal = cmb.getValue(i, j); //calls quickGetValue internally Assert.assertTrue("Get returned wrong value: "+claVal+" (expected: "+ulaVal+")", ulaVal==claVal); } } catch(Exception ex) { throw new RuntimeException(ex); } } }
apache-2.0
crazypoo/SkyCalendarPriceView
SkyCalendarPriceViewTest/SkyCalendarPriceViewTest/AppDelegate.h
291
// // AppDelegate.h // SkyCalendarPriceViewTest // // Created by skytoup on 15/7/24. // Copyright (c) 2015年 skytoup. All rights reserved. // #import <UIKit/UIKit.h> @interface AppDelegate : UIResponder <UIApplicationDelegate> @property (strong, nonatomic) UIWindow *window; @end
apache-2.0
skoulouzis/lobcder
milton2/milton-server-ce/src/main/java/io/milton/http/values/HrefListValueWriter.java
2213
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package io.milton.http.values; import io.milton.http.XmlWriter; import io.milton.http.XmlWriter.Element; import io.milton.http.webdav.WebDavProtocol; import java.util.Map; /** * Supports HrefList objects, and writes them out as a list of <href>...</href> elements * * Currently readonly, but should support writing * * @author brad */ public class HrefListValueWriter implements ValueWriter { @Override public boolean supports(String nsUri, String localName, Class c) { boolean b = HrefList.class.isAssignableFrom(c); return b; } @Override public void writeValue(XmlWriter writer, String nsUri, String prefix, String localName, Object val, String href, Map<String, String> nsPrefixes) { if (val instanceof HrefList) { Element outerEl = writer.begin(prefix, localName).open(); HrefList list = (HrefList) val; if (list != null) { for (String s : list) { Element hrefEl = writer.begin(WebDavProtocol.DAV_PREFIX + ":href").open(false); hrefEl.writeText(s); hrefEl.close(); } } outerEl.close(); } else { if (val != null) { throw new RuntimeException("Value is not correct type. Is a: " + val.getClass()); } } } @Override public Object parse(String namespaceURI, String localPart, String value) { throw new UnsupportedOperationException("Not supported yet."); } }
apache-2.0
thotro/arduino-dw1000
src/DW1000Time.h
4856
/** * Copyright (c) 2015 by Thomas Trojer <[email protected]> * Copyright (c) 2016 by Ludwig Grill (www.rotzbua.de); refactored class * Decawave DW1000 library for arduino. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @file DW1000Time.h * Arduino driver library timestamp wrapper (header file) for the Decawave * DW1000 UWB transceiver IC. * * @TODO * - avoid/remove floating operations, expensive on most microprocessors * * @note * comments in cpp file, makes .h smaller and gives a better overview about * available methods and variables. */ #ifndef DW1000TIME_H #define DW1000TIME_H #include <Arduino.h> #include <stdint.h> #include <inttypes.h> #include "DW1000CompileOptions.h" #include "deprecated.h" #include "require_cpp11.h" #if DW1000TIME_H_PRINTABLE class DW1000Time : public Printable { #else class DW1000Time { #endif // DW1000Time_H_PRINTABLE public: // Time resolution in micro-seconds of time based registers/values. // Each bit in a timestamp counts for a period of approx. 15.65ps static constexpr float TIME_RES = 0.000015650040064103f; static constexpr float TIME_RES_INV = 63897.6f; // Speed of radio waves [m/s] * timestamp resolution [~15.65ps] of DW1000 static constexpr float DISTANCE_OF_RADIO = 0.0046917639786159f; static constexpr float DISTANCE_OF_RADIO_INV = 213.139451293f; // timestamp byte length - 40 bit -> 5 byte static constexpr uint8_t LENGTH_TIMESTAMP = 5; // timer/counter overflow (40 bits) -> 4overflow approx. every 17.2 seconds static constexpr int64_t TIME_OVERFLOW = 0x10000000000; //1099511627776LL static constexpr int64_t TIME_MAX = 0xffffffffff; // time factors (relative to [us]) for setting delayed transceive // TODO use non float static constexpr float SECONDS = 1e6; static constexpr float MILLISECONDS = 1e3; static constexpr float MICROSECONDS = 1; static constexpr float NANOSECONDS = 1e-3; // constructor DW1000Time(); DW1000Time(int64_t time); DW1000Time(byte data[]); DW1000Time(const DW1000Time& copy); DW1000Time(float timeUs); DW1000Time(int32_t value, float factorUs); ~DW1000Time(); // setter // dw1000 timestamp, increase of +1 approx approx. 15.65ps real time void setTimestamp(int64_t value); void setTimestamp(byte data[]); void setTimestamp(const DW1000Time& copy); // real time in us void setTime(float timeUs); void setTime(int32_t value, float factorUs); // getter int64_t getTimestamp() const; void getTimestamp(byte data[]) const; DEPRECATED_MSG("use getAsMicroSeconds()") float getAsFloat() const; // getter, convert the timestamp to usual units float getAsMicroSeconds() const; //void getAsBytes(byte data[]) const; // TODO check why it is here, is it old version of getTimestamp(byte) ? float getAsMeters() const; DW1000Time& wrap(); // self test bool isValidTimestamp(); // assign DW1000Time& operator=(const DW1000Time& assign); // add DW1000Time& operator+=(const DW1000Time& add); DW1000Time operator+(const DW1000Time& add) const; // subtract DW1000Time& operator-=(const DW1000Time& sub); DW1000Time operator-(const DW1000Time& sub) const; // multiply // multiply with float cause lost in accuracy, because float calculates only with 23bit matise DW1000Time& operator*=(float factor); DW1000Time operator*(float factor) const; // no accuracy lost DW1000Time& operator*=(const DW1000Time& factor); DW1000Time operator*(const DW1000Time& factor) const; // divide // divide with float cause lost in accuracy, because float calculates only with 23bit matise DW1000Time& operator/=(float factor); DW1000Time operator/(float factor) const; // no accuracy lost DW1000Time& operator/=(const DW1000Time& factor); DW1000Time operator/(const DW1000Time& factor) const; // compare boolean operator==(const DW1000Time& cmp) const; boolean operator!=(const DW1000Time& cmp) const; #ifdef DW1000TIME_H_PRINTABLE // print to serial for debug DEPRECATED_MSG("use Serial.print(object)") void print(); // for usage with e.g. Serial.print() size_t printTo(Print& p) const; #endif // DW1000Time_H_PRINTABLE private: // timestamp size from dw1000 is 40bit, maximum number 1099511627775 // signed because you can calculate with DW1000Time; negative values are possible errors int64_t _timestamp = 0; }; #endif // DW1000Time_H
apache-2.0
tchibirev/Prebid.js
modules/validationFpdModule/index.js
7184
/** * This module sets default values and validates ortb2 first part data * @module modules/firstPartyData */ import { config } from '../../src/config.js'; import * as utils from '../../src/utils.js'; import { ORTB_MAP } from './config.js'; import { submodule } from '../../src/hook.js'; import { getStorageManager } from '../../src/storageManager.js'; const STORAGE = getStorageManager(); let optout; /** * Check if data passed is empty * @param {*} value to test against * @returns {Boolean} is value empty */ function isEmptyData(data) { let check = true; if (typeof data === 'object' && !utils.isEmpty(data)) { check = false; } else if (typeof data !== 'object' && (utils.isNumber(data) || data)) { check = false; } return check; } /** * Check if required keys exist in data object * @param {Object} data object * @param {Array} array of required keys * @param {String} object path (for printing warning) * @param {Number} index of object value in the data array (for printing warning) * @returns {Boolean} is requirements fulfilled */ function getRequiredData(obj, required, parent, i) { let check = true; required.forEach(key => { if (!obj[key] || isEmptyData(obj[key])) { check = false; utils.logWarn(`Filtered ${parent}[] value at index ${i} in ortb2 data: missing required property ${key}`); } }); return check; } /** * Check if data type is valid * @param {*} value to test against * @param {Object} object containing type definition and if should be array bool * @returns {Boolean} is type fulfilled */ function typeValidation(data, mapping) { let check = false; switch (mapping.type) { case 'string': if (typeof data === 'string') check = true; break; case 'number': if (typeof data === 'number' && isFinite(data)) check = true; break; case 'object': if (typeof data === 'object') { if ((Array.isArray(data) && mapping.isArray) || (!Array.isArray(data) && !mapping.isArray)) check = true; } break; } return check; } /** * Validates ortb2 data arrays and filters out invalid data * @param {Array} ortb2 data array * @param {Object} object defining child type and if array * @param {String} config path of data array * @param {String} parent path for logging warnings * @returns {Array} validated/filtered data */ export function filterArrayData(arr, child, path, parent) { arr = arr.filter((index, i) => { let check = typeValidation(index, {type: child.type, isArray: child.isArray}); if (check && Array.isArray(index) === Boolean(child.isArray)) { return true; } utils.logWarn(`Filtered ${parent}[] value at index ${i} in ortb2 data: expected type ${child.type}`); }).filter((index, i) => { let requiredCheck = true; let mapping = utils.deepAccess(ORTB_MAP, path); if (mapping && mapping.required) requiredCheck = getRequiredData(index, mapping.required, parent, i); if (requiredCheck) return true; }).reduce((result, value, i) => { let typeBool = false; let mapping = utils.deepAccess(ORTB_MAP, path); switch (child.type) { case 'string': result.push(value); break; case 'object': if (mapping && mapping.children) { let validObject = validateFpd(value, path + '.children.', parent + '.'); if (Object.keys(validObject).length) { let requiredCheck = getRequiredData(validObject, mapping.required, parent, i); if (requiredCheck) { result.push(validObject); typeBool = true; } } } else { result.push(value); typeBool = true; } break; } if (!typeBool) utils.logWarn(`Filtered ${parent}[] value at index ${i} in ortb2 data: expected type ${child.type}`); return result; }, []); return arr; } /** * Validates ortb2 object and filters out invalid data * @param {Object} ortb2 object * @param {String} config path of data array * @param {String} parent path for logging warnings * @returns {Object} validated/filtered data */ export function validateFpd(fpd, path = '', parent = '') { if (!fpd) return {}; // Filter out imp property if exists let validObject = Object.assign({}, Object.keys(fpd).filter(key => { let mapping = utils.deepAccess(ORTB_MAP, path + key); if (!mapping || !mapping.invalid) return key; utils.logWarn(`Filtered ${parent}${key} property in ortb2 data: invalid property`); }).filter(key => { let mapping = utils.deepAccess(ORTB_MAP, path + key); // let typeBool = false; let typeBool = (mapping) ? typeValidation(fpd[key], {type: mapping.type, isArray: mapping.isArray}) : true; if (typeBool || !mapping) return key; utils.logWarn(`Filtered ${parent}${key} property in ortb2 data: expected type ${(mapping.isArray) ? 'array' : mapping.type}`); }).reduce((result, key) => { let mapping = utils.deepAccess(ORTB_MAP, path + key); let modified = {}; if (mapping) { if (mapping.optoutApplies && optout) { utils.logWarn(`Filtered ${parent}${key} data: pubcid optout found`); return result; } modified = (mapping.type === 'object' && !mapping.isArray) ? validateFpd(fpd[key], path + key + '.children.', parent + key + '.') : (mapping.isArray && mapping.childType) ? filterArrayData(fpd[key], { type: mapping.childType, isArray: mapping.childisArray }, path + key, parent + key) : fpd[key]; // Check if modified data has data and return (!isEmptyData(modified)) ? result[key] = modified : utils.logWarn(`Filtered ${parent}${key} property in ortb2 data: empty data found`); } else { result[key] = fpd[key]; } return result; }, {})); // Return validated data return validObject; } /** * Run validation on global and bidder config data for ortb2 */ function runValidations(data) { let conf = validateFpd(data); let bidderDuplicate = { ...config.getBidderConfig() }; Object.keys(bidderDuplicate).forEach(bidder => { let modConf = Object.keys(bidderDuplicate[bidder]).reduce((res, key) => { let valid = (key !== 'ortb2') ? bidderDuplicate[bidder][key] : validateFpd(bidderDuplicate[bidder][key]); if (valid) res[key] = valid; return res; }, {}); if (Object.keys(modConf).length) config.setBidderConfig({ bidders: [bidder], config: modConf }); }); return conf; } /** * Sets default values to ortb2 if exists and adds currency and ortb2 setConfig callbacks on init */ export function initSubmodule(fpdConf, data) { // Checks for existsnece of pubcid optout cookie/storage // if exists, filters user data out optout = (STORAGE.cookiesAreEnabled() && STORAGE.getCookie('_pubcid_optout')) || (STORAGE.hasLocalStorage() && STORAGE.getDataFromLocalStorage('_pubcid_optout')); return (!fpdConf.skipValidations) ? runValidations(data) : data; } /** @type {firstPartyDataSubmodule} */ export const validationSubmodule = { name: 'validation', queue: 1, init: initSubmodule } submodule('firstPartyData', validationSubmodule)
apache-2.0
googleapis/google-api-java-client-services
clients/google-api-services-binaryauthorization/v1beta1/1.31.0/com/google/api/services/binaryauthorization/v1beta1/model/ValidateAttestationOccurrenceRequest.java
4580
/* * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software distributed under the License * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express * or implied. See the License for the specific language governing permissions and limitations under * the License. */ /* * This code was generated by https://github.com/googleapis/google-api-java-client-services/ * Modify at your own risk. */ package com.google.api.services.binaryauthorization.v1beta1.model; /** * Request message for ValidationHelperV1.ValidateAttestationOccurrence. * * <p> This is the Java data model class that specifies how to parse/serialize into the JSON that is * transmitted over HTTP when working with the Binary Authorization API. For a detailed explanation * see: * <a href="https://developers.google.com/api-client-library/java/google-http-java-client/json">https://developers.google.com/api-client-library/java/google-http-java-client/json</a> * </p> * * @author Google, Inc. */ @SuppressWarnings("javadoc") public final class ValidateAttestationOccurrenceRequest extends com.google.api.client.json.GenericJson { /** * Required. An AttestationOccurrence to be checked that it can be verified by the Attestor. It * does not have to be an existing entity in Container Analysis. It must otherwise be a valid * AttestationOccurrence. * The value may be {@code null}. */ @com.google.api.client.util.Key private AttestationOccurrence attestation; /** * Required. The resource name of the Note to which the containing Occurrence is associated. * The value may be {@code null}. */ @com.google.api.client.util.Key private java.lang.String occurrenceNote; /** * Required. The URI of the artifact (e.g. container image) that is the subject of the containing * Occurrence. * The value may be {@code null}. */ @com.google.api.client.util.Key private java.lang.String occurrenceResourceUri; /** * Required. An AttestationOccurrence to be checked that it can be verified by the Attestor. It * does not have to be an existing entity in Container Analysis. It must otherwise be a valid * AttestationOccurrence. * @return value or {@code null} for none */ public AttestationOccurrence getAttestation() { return attestation; } /** * Required. An AttestationOccurrence to be checked that it can be verified by the Attestor. It * does not have to be an existing entity in Container Analysis. It must otherwise be a valid * AttestationOccurrence. * @param attestation attestation or {@code null} for none */ public ValidateAttestationOccurrenceRequest setAttestation(AttestationOccurrence attestation) { this.attestation = attestation; return this; } /** * Required. The resource name of the Note to which the containing Occurrence is associated. * @return value or {@code null} for none */ public java.lang.String getOccurrenceNote() { return occurrenceNote; } /** * Required. The resource name of the Note to which the containing Occurrence is associated. * @param occurrenceNote occurrenceNote or {@code null} for none */ public ValidateAttestationOccurrenceRequest setOccurrenceNote(java.lang.String occurrenceNote) { this.occurrenceNote = occurrenceNote; return this; } /** * Required. The URI of the artifact (e.g. container image) that is the subject of the containing * Occurrence. * @return value or {@code null} for none */ public java.lang.String getOccurrenceResourceUri() { return occurrenceResourceUri; } /** * Required. The URI of the artifact (e.g. container image) that is the subject of the containing * Occurrence. * @param occurrenceResourceUri occurrenceResourceUri or {@code null} for none */ public ValidateAttestationOccurrenceRequest setOccurrenceResourceUri(java.lang.String occurrenceResourceUri) { this.occurrenceResourceUri = occurrenceResourceUri; return this; } @Override public ValidateAttestationOccurrenceRequest set(String fieldName, Object value) { return (ValidateAttestationOccurrenceRequest) super.set(fieldName, value); } @Override public ValidateAttestationOccurrenceRequest clone() { return (ValidateAttestationOccurrenceRequest) super.clone(); } }
apache-2.0