code
stringlengths
3
1.01M
repo_name
stringlengths
5
116
path
stringlengths
3
311
language
stringclasses
30 values
license
stringclasses
15 values
size
int64
3
1.01M
/* * 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/ecl1.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.coeus.propdev.impl.custom; import org.kuali.coeus.common.framework.custom.CustomDataHelperBase; import org.kuali.coeus.common.framework.custom.attr.CustomAttributeDocValue; import org.kuali.coeus.common.framework.custom.attr.CustomAttributeDocument; import org.kuali.coeus.propdev.impl.core.ProposalDevelopmentDocument; import org.kuali.rice.kew.api.WorkflowDocument; import java.util.List; import java.util.Map; public class ProposalDevelopmentCustomDataHelper extends CustomDataHelperBase<CustomAttributeDocValue> { private static final long serialVersionUID = 4399783400354474904L; private ProposalDevelopmentDocument document; public ProposalDevelopmentCustomDataHelper(ProposalDevelopmentDocument document) { this.document = document; } @Override protected CustomAttributeDocValue getNewCustomData() { CustomAttributeDocValue customAttributeDocValue = new CustomAttributeDocValue(); customAttributeDocValue.setDocumentNumber(document.getDocumentNumber()); return customAttributeDocValue; } @Override public List<CustomAttributeDocValue> getCustomDataList() { return document.getCustomDataList(); } @Override public Map<String, CustomAttributeDocument> getCustomAttributeDocuments() { return document.getCustomAttributeDocuments(); } @Override public boolean documentNotRouted() { WorkflowDocument doc = document.getDocumentHeader().getWorkflowDocument(); return doc.isSaved() || doc.isInitiated(); } }
blackcathacker/kc.preclean
coeus-code/src/main/java/org/kuali/coeus/propdev/impl/custom/ProposalDevelopmentCustomDataHelper.java
Java
apache-2.0
2,192
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1" charset="UTF-8"> <title>DISABLED</title> <link href="../../../../images/logo-icon.svg" rel="icon" type="image/svg"> <script>var pathToRoot = "../../../../";</script> <script type="text/javascript" src="../../../../scripts/sourceset_dependencies.js" async="async"></script> <link href="../../../../styles/style.css" rel="Stylesheet"> <link href="../../../../styles/logo-styles.css" rel="Stylesheet"> <link href="../../../../styles/jetbrains-mono.css" rel="Stylesheet"> <link href="../../../../styles/main.css" rel="Stylesheet"> <script type="text/javascript" src="../../../../scripts/clipboard.js" async="async"></script> <script type="text/javascript" src="../../../../scripts/navigation-loader.js" async="async"></script> <script type="text/javascript" src="../../../../scripts/platform-content-handler.js" async="async"></script> <script type="text/javascript" src="../../../../scripts/main.js" async="async"></script> </head> <body> <div id="container"> <div id="leftColumn"> <div id="logo"></div> <div id="paneSearch"></div> <div id="sideMenu"></div> </div> <div id="main"> <div id="leftToggler"><span class="icon-toggler"></span></div> <script type="text/javascript" src="../../../../scripts/pages.js"></script> <script type="text/javascript" src="../../../../scripts/main.js"></script> <div class="main-content" id="content" pageIds="org.hexworks.zircon.api.component.data/ComponentState.DISABLED///PointingToDeclaration//-755115832"> <div class="navigation-wrapper" id="navigation-wrapper"> <div class="breadcrumbs"><a href="../../../index.html">zircon.core</a>/<a href="../../index.html">org.hexworks.zircon.api.component.data</a>/<a href="../index.html">ComponentState</a>/<a href="index.html">DISABLED</a></div> <div class="pull-right d-flex"> <div class="filter-section" id="filter-section"><button class="platform-tag platform-selector common-like" data-active="" data-filter=":zircon.core:dokkaHtml/commonMain">common</button></div> <div id="searchBar"></div> </div> </div> <div class="cover "> <h1 class="cover"><span>D</span><wbr></wbr><span>I</span><wbr></wbr><span>S</span><wbr></wbr><span>A</span><wbr></wbr><span>B</span><wbr></wbr><span>L</span><wbr></wbr><span>E</span><wbr></wbr><span>D</span></h1> <div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-depenent-content" data-active="" data-togglable=":zircon.core:dokkaHtml/commonMain"><div class="symbol monospace"><div class="block"><a href="index.html">DISABLED</a>()</div><span class="top-right-position"><span class="copy-icon"></span><div class="copy-popup-wrapper popup-to-left"><span class="copy-popup-icon"></span><span>Content copied to clipboard</span></div></span></div><p class="paragraph">This component is inactive, its features are disabled.</p></div></div> </div> <div class="tabbedcontent"> <div class="tabs-section" tabs-section="tabs-section"><button class="section-tab" data-active="" data-togglable="Functions">Functions</button><button class="section-tab" data-togglable="Properties">Properties</button></div> <div class="tabs-section-body"> <h2 class="">Functions</h2> <div class="table" data-togglable="Functions"><a data-name="%5Bkotlin%2FEnum%2Fclone%2F%23%2FPointingToDeclaration%2F%5D%2FFunctions%2F-755115832" anchor-label="clone" id="%5Bkotlin%2FEnum%2Fclone%2F%23%2FPointingToDeclaration%2F%5D%2FFunctions%2F-755115832" data-filterable-set=":zircon.core:dokkaHtml/commonMain"></a> <div class="table-row" data-filterable-current=":zircon.core:dokkaHtml/commonMain" data-filterable-set=":zircon.core:dokkaHtml/commonMain"> <div class="main-subrow keyValue "> <div class=""><span class="inline-flex"><a href="../../../org.hexworks.zircon.internal.resource/-tileset-source-type/-j-a-r/index.html#%5Bkotlin%2FEnum%2Fclone%2F%23%2FPointingToDeclaration%2F%5D%2FFunctions%2F-755115832">clone</a><span class="anchor-wrapper"><span class="anchor-icon" pointing-to="%5Bkotlin%2FEnum%2Fclone%2F%23%2FPointingToDeclaration%2F%5D%2FFunctions%2F-755115832"></span> <div class="copy-popup-wrapper "><span class="copy-popup-icon"></span><span>Link copied to clipboard</span></div> </span></span></div> <div> <div class="platform-tags "> <div class="platform-tag common-like">common</div> </div> <div class="title"><div class="divergent-group" data-filterable-current=":zircon.core:dokkaHtml/commonMain" data-filterable-set=":zircon.core:dokkaHtml/commonMain"><div class="with-platform-tags"><span class="pull-right"></span></div> <div> <div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-depenent-content" data-active="" data-togglable=":zircon.core:dokkaHtml/commonMain"><div class="symbol monospace">protected fun <a href="../../../org.hexworks.zircon.internal.resource/-tileset-source-type/-j-a-r/index.html#%5Bkotlin%2FEnum%2Fclone%2F%23%2FPointingToDeclaration%2F%5D%2FFunctions%2F-755115832">clone</a>(): <a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html">Any</a><span class="top-right-position"><span class="copy-icon"></span><div class="copy-popup-wrapper popup-to-left"><span class="copy-popup-icon"></span><span>Content copied to clipboard</span></div></span></div></div></div> </div> </div> </div> </div> </div> </div> <a data-name="%5Bkotlin%2FEnum%2FcompareTo%2F%23org.hexworks.zircon.api.component.data.ComponentState%2FPointingToDeclaration%2F%5D%2FFunctions%2F-755115832" anchor-label="compareTo" id="%5Bkotlin%2FEnum%2FcompareTo%2F%23org.hexworks.zircon.api.component.data.ComponentState%2FPointingToDeclaration%2F%5D%2FFunctions%2F-755115832" data-filterable-set=":zircon.core:dokkaHtml/commonMain"></a> <div class="table-row" data-filterable-current=":zircon.core:dokkaHtml/commonMain" data-filterable-set=":zircon.core:dokkaHtml/commonMain"> <div class="main-subrow keyValue "> <div class=""><span class="inline-flex"><a href="../-a-c-t-i-v-e/index.html#%5Bkotlin%2FEnum%2FcompareTo%2F%23org.hexworks.zircon.api.component.data.ComponentState%2FPointingToDeclaration%2F%5D%2FFunctions%2F-755115832">compareTo</a><span class="anchor-wrapper"><span class="anchor-icon" pointing-to="%5Bkotlin%2FEnum%2FcompareTo%2F%23org.hexworks.zircon.api.component.data.ComponentState%2FPointingToDeclaration%2F%5D%2FFunctions%2F-755115832"></span> <div class="copy-popup-wrapper "><span class="copy-popup-icon"></span><span>Link copied to clipboard</span></div> </span></span></div> <div> <div class="platform-tags "> <div class="platform-tag common-like">common</div> </div> <div class="title"><div class="divergent-group" data-filterable-current=":zircon.core:dokkaHtml/commonMain" data-filterable-set=":zircon.core:dokkaHtml/commonMain"><div class="with-platform-tags"><span class="pull-right"></span></div> <div> <div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-depenent-content" data-active="" data-togglable=":zircon.core:dokkaHtml/commonMain"><div class="symbol monospace">operator override fun <a href="../-a-c-t-i-v-e/index.html#%5Bkotlin%2FEnum%2FcompareTo%2F%23org.hexworks.zircon.api.component.data.ComponentState%2FPointingToDeclaration%2F%5D%2FFunctions%2F-755115832">compareTo</a>(other: <a href="../index.html">ComponentState</a>): <a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html">Int</a><span class="top-right-position"><span class="copy-icon"></span><div class="copy-popup-wrapper popup-to-left"><span class="copy-popup-icon"></span><span>Content copied to clipboard</span></div></span></div></div></div> </div> </div> </div> </div> </div> </div> <a data-name="%5Bkotlin%2FEnum%2Fequals%2F%23kotlin.Any%3F%2FPointingToDeclaration%2F%5D%2FFunctions%2F-755115832" anchor-label="equals" id="%5Bkotlin%2FEnum%2Fequals%2F%23kotlin.Any%3F%2FPointingToDeclaration%2F%5D%2FFunctions%2F-755115832" data-filterable-set=":zircon.core:dokkaHtml/commonMain"></a> <div class="table-row" data-filterable-current=":zircon.core:dokkaHtml/commonMain" data-filterable-set=":zircon.core:dokkaHtml/commonMain"> <div class="main-subrow keyValue "> <div class=""><span class="inline-flex"><a href="../../../org.hexworks.zircon.internal.resource/-tileset-source-type/-j-a-r/index.html#%5Bkotlin%2FEnum%2Fequals%2F%23kotlin.Any%3F%2FPointingToDeclaration%2F%5D%2FFunctions%2F-755115832">equals</a><span class="anchor-wrapper"><span class="anchor-icon" pointing-to="%5Bkotlin%2FEnum%2Fequals%2F%23kotlin.Any%3F%2FPointingToDeclaration%2F%5D%2FFunctions%2F-755115832"></span> <div class="copy-popup-wrapper "><span class="copy-popup-icon"></span><span>Link copied to clipboard</span></div> </span></span></div> <div> <div class="platform-tags "> <div class="platform-tag common-like">common</div> </div> <div class="title"><div class="divergent-group" data-filterable-current=":zircon.core:dokkaHtml/commonMain" data-filterable-set=":zircon.core:dokkaHtml/commonMain"><div class="with-platform-tags"><span class="pull-right"></span></div> <div> <div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-depenent-content" data-active="" data-togglable=":zircon.core:dokkaHtml/commonMain"><div class="symbol monospace">operator override fun <a href="../../../org.hexworks.zircon.internal.resource/-tileset-source-type/-j-a-r/index.html#%5Bkotlin%2FEnum%2Fequals%2F%23kotlin.Any%3F%2FPointingToDeclaration%2F%5D%2FFunctions%2F-755115832">equals</a>(other: <a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html">Any</a>?): <a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html">Boolean</a><span class="top-right-position"><span class="copy-icon"></span><div class="copy-popup-wrapper popup-to-left"><span class="copy-popup-icon"></span><span>Content copied to clipboard</span></div></span></div></div></div> </div> </div> </div> </div> </div> </div> <a data-name="%5Bkotlin%2FEnum%2FhashCode%2F%23%2FPointingToDeclaration%2F%5D%2FFunctions%2F-755115832" anchor-label="hashCode" id="%5Bkotlin%2FEnum%2FhashCode%2F%23%2FPointingToDeclaration%2F%5D%2FFunctions%2F-755115832" data-filterable-set=":zircon.core:dokkaHtml/commonMain"></a> <div class="table-row" data-filterable-current=":zircon.core:dokkaHtml/commonMain" data-filterable-set=":zircon.core:dokkaHtml/commonMain"> <div class="main-subrow keyValue "> <div class=""><span class="inline-flex"><a href="../../../org.hexworks.zircon.internal.resource/-tileset-source-type/-j-a-r/index.html#%5Bkotlin%2FEnum%2FhashCode%2F%23%2FPointingToDeclaration%2F%5D%2FFunctions%2F-755115832">hashCode</a><span class="anchor-wrapper"><span class="anchor-icon" pointing-to="%5Bkotlin%2FEnum%2FhashCode%2F%23%2FPointingToDeclaration%2F%5D%2FFunctions%2F-755115832"></span> <div class="copy-popup-wrapper "><span class="copy-popup-icon"></span><span>Link copied to clipboard</span></div> </span></span></div> <div> <div class="platform-tags "> <div class="platform-tag common-like">common</div> </div> <div class="title"><div class="divergent-group" data-filterable-current=":zircon.core:dokkaHtml/commonMain" data-filterable-set=":zircon.core:dokkaHtml/commonMain"><div class="with-platform-tags"><span class="pull-right"></span></div> <div> <div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-depenent-content" data-active="" data-togglable=":zircon.core:dokkaHtml/commonMain"><div class="symbol monospace">override fun <a href="../../../org.hexworks.zircon.internal.resource/-tileset-source-type/-j-a-r/index.html#%5Bkotlin%2FEnum%2FhashCode%2F%23%2FPointingToDeclaration%2F%5D%2FFunctions%2F-755115832">hashCode</a>(): <a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html">Int</a><span class="top-right-position"><span class="copy-icon"></span><div class="copy-popup-wrapper popup-to-left"><span class="copy-popup-icon"></span><span>Content copied to clipboard</span></div></span></div></div></div> </div> </div> </div> </div> </div> </div> <a data-name="%5Bkotlin%2FEnum%2FtoString%2F%23%2FPointingToDeclaration%2F%5D%2FFunctions%2F-755115832" anchor-label="toString" id="%5Bkotlin%2FEnum%2FtoString%2F%23%2FPointingToDeclaration%2F%5D%2FFunctions%2F-755115832" data-filterable-set=":zircon.core:dokkaHtml/commonMain"></a> <div class="table-row" data-filterable-current=":zircon.core:dokkaHtml/commonMain" data-filterable-set=":zircon.core:dokkaHtml/commonMain"> <div class="main-subrow keyValue "> <div class=""><span class="inline-flex"><a href="../../../org.hexworks.zircon.internal.resource/-tileset-source-type/-j-a-r/index.html#%5Bkotlin%2FEnum%2FtoString%2F%23%2FPointingToDeclaration%2F%5D%2FFunctions%2F-755115832">toString</a><span class="anchor-wrapper"><span class="anchor-icon" pointing-to="%5Bkotlin%2FEnum%2FtoString%2F%23%2FPointingToDeclaration%2F%5D%2FFunctions%2F-755115832"></span> <div class="copy-popup-wrapper "><span class="copy-popup-icon"></span><span>Link copied to clipboard</span></div> </span></span></div> <div> <div class="platform-tags "> <div class="platform-tag common-like">common</div> </div> <div class="title"><div class="divergent-group" data-filterable-current=":zircon.core:dokkaHtml/commonMain" data-filterable-set=":zircon.core:dokkaHtml/commonMain"><div class="with-platform-tags"><span class="pull-right"></span></div> <div> <div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-depenent-content" data-active="" data-togglable=":zircon.core:dokkaHtml/commonMain"><div class="symbol monospace">open override fun <a href="../../../org.hexworks.zircon.internal.resource/-tileset-source-type/-j-a-r/index.html#%5Bkotlin%2FEnum%2FtoString%2F%23%2FPointingToDeclaration%2F%5D%2FFunctions%2F-755115832">toString</a>(): <a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html">String</a><span class="top-right-position"><span class="copy-icon"></span><div class="copy-popup-wrapper popup-to-left"><span class="copy-popup-icon"></span><span>Content copied to clipboard</span></div></span></div></div></div> </div> </div> </div> </div> </div> </div> </div> <h2 class="">Properties</h2> <div class="table" data-togglable="Properties"><a data-name="%5Borg.hexworks.zircon.api.component.data%2FComponentState.DISABLED%2Fname%2F%23%2FPointingToDeclaration%2F%5D%2FProperties%2F-755115832" anchor-label="name" id="%5Borg.hexworks.zircon.api.component.data%2FComponentState.DISABLED%2Fname%2F%23%2FPointingToDeclaration%2F%5D%2FProperties%2F-755115832" data-filterable-set=":zircon.core:dokkaHtml/commonMain"></a> <div class="table-row" data-filterable-current=":zircon.core:dokkaHtml/commonMain" data-filterable-set=":zircon.core:dokkaHtml/commonMain"> <div class="main-subrow keyValue "> <div class=""><span class="inline-flex"><a href="name.html">name</a><span class="anchor-wrapper"><span class="anchor-icon" pointing-to="%5Borg.hexworks.zircon.api.component.data%2FComponentState.DISABLED%2Fname%2F%23%2FPointingToDeclaration%2F%5D%2FProperties%2F-755115832"></span> <div class="copy-popup-wrapper "><span class="copy-popup-icon"></span><span>Link copied to clipboard</span></div> </span></span></div> <div> <div class="platform-tags "> <div class="platform-tag common-like">common</div> </div> <div class="title"> <div class="platform-hinted " data-platform-hinted="data-platform-hinted" data-togglable="Properties"><div class="content sourceset-depenent-content" data-active="" data-togglable=":zircon.core:dokkaHtml/commonMain"><a data-name="%5Borg.hexworks.zircon.api.component.data%2FComponentState.DISABLED%2Fname%2F%23%2FPointingToDeclaration%2F%5D%2FProperties%2F-755115832" anchor-label="name" id="%5Borg.hexworks.zircon.api.component.data%2FComponentState.DISABLED%2Fname%2F%23%2FPointingToDeclaration%2F%5D%2FProperties%2F-755115832" data-filterable-set=":zircon.core:dokkaHtml/commonMain"></a><div class="symbol monospace">val <a href="name.html">name</a>: <a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html">String</a><span class="top-right-position"><span class="copy-icon"></span><div class="copy-popup-wrapper popup-to-left"><span class="copy-popup-icon"></span><span>Content copied to clipboard</span></div></span></div></div></div> </div> </div> </div> </div> <a data-name="%5Borg.hexworks.zircon.api.component.data%2FComponentState.DISABLED%2Fordinal%2F%23%2FPointingToDeclaration%2F%5D%2FProperties%2F-755115832" anchor-label="ordinal" id="%5Borg.hexworks.zircon.api.component.data%2FComponentState.DISABLED%2Fordinal%2F%23%2FPointingToDeclaration%2F%5D%2FProperties%2F-755115832" data-filterable-set=":zircon.core:dokkaHtml/commonMain"></a> <div class="table-row" data-filterable-current=":zircon.core:dokkaHtml/commonMain" data-filterable-set=":zircon.core:dokkaHtml/commonMain"> <div class="main-subrow keyValue "> <div class=""><span class="inline-flex"><a href="ordinal.html">ordinal</a><span class="anchor-wrapper"><span class="anchor-icon" pointing-to="%5Borg.hexworks.zircon.api.component.data%2FComponentState.DISABLED%2Fordinal%2F%23%2FPointingToDeclaration%2F%5D%2FProperties%2F-755115832"></span> <div class="copy-popup-wrapper "><span class="copy-popup-icon"></span><span>Link copied to clipboard</span></div> </span></span></div> <div> <div class="platform-tags "> <div class="platform-tag common-like">common</div> </div> <div class="title"> <div class="platform-hinted " data-platform-hinted="data-platform-hinted" data-togglable="Properties"><div class="content sourceset-depenent-content" data-active="" data-togglable=":zircon.core:dokkaHtml/commonMain"><a data-name="%5Borg.hexworks.zircon.api.component.data%2FComponentState.DISABLED%2Fordinal%2F%23%2FPointingToDeclaration%2F%5D%2FProperties%2F-755115832" anchor-label="ordinal" id="%5Borg.hexworks.zircon.api.component.data%2FComponentState.DISABLED%2Fordinal%2F%23%2FPointingToDeclaration%2F%5D%2FProperties%2F-755115832" data-filterable-set=":zircon.core:dokkaHtml/commonMain"></a><div class="symbol monospace">val <a href="ordinal.html">ordinal</a>: <a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html">Int</a><span class="top-right-position"><span class="copy-icon"></span><div class="copy-popup-wrapper popup-to-left"><span class="copy-popup-icon"></span><span>Content copied to clipboard</span></div></span></div></div></div> </div> </div> </div> </div> </div> </div> </div> </div> <div class="footer"><span class="go-to-top-icon"><a href="#content"></a></span><span>© 2020 Copyright</span><span class="pull-right"><span>Sponsored and developed by dokka</span><a href="https://github.com/Kotlin/dokka"><span class="padded-icon"></span></a></span></div> </div> </div> </body> </html>
Hexworks/zircon
docs/2021.1.0-RELEASE-KOTLIN/zircon.core/zircon.core/org.hexworks.zircon.api.component.data/-component-state/-d-i-s-a-b-l-e-d/index.html
HTML
apache-2.0
21,181
/* * Project Scelight * * Copyright (c) 2013 Andras Belicza <iczaaa@gmail.com> * * This software is the property of Andras Belicza. * Copying, modifying, distributing, refactoring without the author's permission * is prohibited and protected by Law. */ package sc2toolkit.mpq; /** * This class is the representation of an MPQ archive. * <p> * <p> * The representation might not be complete, I aimed to handle SC2Replay MPQ * archives. * </p> * * @author Andras Belicza */ public class MpqArchive { /** * Optional user data. */ public UserData userData; /** * The header. */ public Header header; /** * The hash tables. */ public HashTable[] hashTables; /** * The block tables. */ public BlockTable[] blockTables; /** * The upper bits of the archive offsets for each block in the block table. * Only present if the archive is > 4GB. */ public short[] extBlockTableHighOffsets; // Derived data /** * Size of the blocks. */ public int blockSize; /** * Block table indices of the files. */ public int[] blockTableIndices; /** * Number of files in the archive. */ public int filesCount; }
knonderful/sc2-toolkit
mpq-util/src/main/java/sc2toolkit/mpq/MpqArchive.java
Java
apache-2.0
1,262
/* * Copyright 2020 Coveo, 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.netflix.spinnaker.gate.controllers; import com.netflix.spinnaker.gate.services.RawResourceService; import io.swagger.annotations.ApiOperation; import java.util.List; import java.util.Map; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @RestController public class RawResourceController { private final RawResourceService rawResourceService; @Autowired public RawResourceController(RawResourceService rawResourceService) { this.rawResourceService = rawResourceService; } @ApiOperation( value = "Retrieve a list of raw resources for a given application", response = List.class) @RequestMapping(value = "/applications/{application}/rawResources", method = RequestMethod.GET) List<Map<String, Object>> getApplicationRawResources(@PathVariable String application) { return rawResourceService.getApplicationRawResources(application); } }
spinnaker/gate
gate-web/src/main/groovy/com/netflix/spinnaker/gate/controllers/RawResourceController.java
Java
apache-2.0
1,547
page_title: Remote API v1.11 page_description: API Documentation for Docker page_keywords: API, Docker, rcli, REST, documentation # Docker Remote API v1.11 ## 1. Brief introduction - The Remote API has replaced `rcli`. - The daemon listens on `unix:///var/run/docker.sock` but you can bind Docker to another host/port or a Unix socket. - The API tends to be REST, but for some complex commands, like `attach` or `pull`, the HTTP connection is hijacked to transport `STDOUT`, `STDIN` and `STDERR`. # 2. Endpoints ## 2.1 Containers ### List containers `GET /containers/json` List containers **Example request**: GET /containers/json?all=1&before=8dfafdbc3a40&size=1 HTTP/1.1 **Example response**: HTTP/1.1 200 OK Content-Type: application/json [ { "Id": "8dfafdbc3a40", "Image": "base:latest", "Command": "echo 1", "Created": 1367854155, "Status": "Exit 0", "Ports": [{"PrivatePort": 2222, "PublicPort": 3333, "Type": "tcp"}], "SizeRw": 12288, "SizeRootFs": 0 }, { "Id": "9cd87474be90", "Image": "base:latest", "Command": "echo 222222", "Created": 1367854155, "Status": "Exit 0", "Ports": [], "SizeRw": 12288, "SizeRootFs": 0 }, { "Id": "3176a2479c92", "Image": "base:latest", "Command": "echo 3333333333333333", "Created": 1367854154, "Status": "Exit 0", "Ports":[], "SizeRw":12288, "SizeRootFs":0 }, { "Id": "4cb07b47f9fb", "Image": "base:latest", "Command": "echo 444444444444444444444444444444444", "Created": 1367854152, "Status": "Exit 0", "Ports": [], "SizeRw": 12288, "SizeRootFs": 0 } ] Query Parameters:   - **all** – 1/True/true or 0/False/false, Show all containers. Only running containers are shown by default (i.e., this defaults to false) - **limit** – Show `limit` last created containers, include non-running ones. - **since** – Show only containers created since Id, include non-running ones. - **before** – Show only containers created before Id, include non-running ones. - **size** – 1/True/true or 0/False/false, Show the containers sizes Status Codes: - **200** – no error - **400** – bad parameter - **500** – server error ### Create a container `POST /containers/create` Create a container **Example request**: POST /containers/create HTTP/1.1 Content-Type: application/json { "Hostname":"", "User":"", "Memory":0, "MemorySwap":0, "AttachStdin":false, "AttachStdout":true, "AttachStderr":true, "PortSpecs":null, "Tty":false, "OpenStdin":false, "StdinOnce":false, "Env":null, "Cmd":[ "date" ], "Image":"base", "Volumes":{ "/tmp": {} }, "VolumesFrom":"", "WorkingDir":"", "DisableNetwork": false, "ExposedPorts":{ "22/tcp": {} } } **Example response**: HTTP/1.1 201 Created Content-Type: application/json { "Id":"e90e34656806" "Warnings":[] } Json Parameters: - **config** – the container's configuration Query Parameters: - **name** – Assign the specified name to the container. Mus match `/?[a-zA-Z0-9_-]+`. Status Codes: - **201** – no error - **404** – no such container - **406** – impossible to attach (container not running) - **500** – server error ### Inspect a container `GET /containers/(id)/json` Return low-level information on the container `id` **Example request**: GET /containers/4fa6e0f0c678/json HTTP/1.1 **Example response**: HTTP/1.1 200 OK Content-Type: application/json { "Id": "4fa6e0f0c6786287e131c3852c58a2e01cc697a68231826813597e4994f1d6e2", "Created": "2013-05-07T14:51:42.041847+02:00", "Path": "date", "Args": [], "Config": { "Hostname": "4fa6e0f0c678", "User": "", "Memory": 0, "MemorySwap": 0, "AttachStdin": false, "AttachStdout": true, "AttachStderr": true, "PortSpecs": null, "Tty": false, "OpenStdin": false, "StdinOnce": false, "Env": null, "Cmd": [ "date" ], "Dns": null, "Image": "base", "Volumes": {}, "VolumesFrom": "", "WorkingDir": "" }, "State": { "Running": false, "Pid": 0, "ExitCode": 0, "StartedAt": "2013-05-07T14:51:42.087658+02:01360", "Ghost": false }, "Image": "b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc", "NetworkSettings": { "IpAddress": "", "IpPrefixLen": 0, "Gateway": "", "Bridge": "", "PortMapping": null }, "SysInitPath": "/home/kitty/go/src/github.com/docker/docker/bin/docker", "ResolvConfPath": "/etc/resolv.conf", "Volumes": {}, "HostConfig": { "Binds": null, "ContainerIDFile": "", "LxcConf": [], "Privileged": false, "PortBindings": { "80/tcp": [ { "HostIp": "0.0.0.0", "HostPort": "49153" } ] }, "Links": null, "PublishAllPorts": false } } Status Codes: - **200** – no error - **404** – no such container - **500** – server error ### List processes running inside a container `GET /containers/(id)/top` List processes running inside the container `id` **Example request**: GET /containers/4fa6e0f0c678/top HTTP/1.1 **Example response**: HTTP/1.1 200 OK Content-Type: application/json { "Titles": [ "USER", "PID", "%CPU", "%MEM", "VSZ", "RSS", "TTY", "STAT", "START", "TIME", "COMMAND" ], "Processes": [ ["root","20147","0.0","0.1","18060","1864","pts/4","S","10:06","0:00","bash"], ["root","20271","0.0","0.0","4312","352","pts/4","S+","10:07","0:00","sleep","10"] ] } Query Parameters: - **ps_args** – ps arguments to use (e.g., aux) Status Codes: - **200** – no error - **404** – no such container - **500** – server error ### Get container logs `GET /containers/(id)/logs` Get stdout and stderr logs from the container ``id`` **Example request**: GET /containers/4fa6e0f0c678/logs?stderr=1&stdout=1&timestamps=1&follow=1 HTTP/1.1 **Example response**: HTTP/1.1 200 OK Content-Type: application/vnd.docker.raw-stream {{ STREAM }} Query Parameters:   - **follow** – 1/True/true or 0/False/false, return stream. Default false - **stdout** – 1/True/true or 0/False/false, if logs=true, return stdout log. Default false - **stderr** – 1/True/true or 0/False/false, if logs=true, return stderr log. Default false - **timestamps** – 1/True/true or 0/False/false, if logs=true, prin timestamps for every log line. Default false Status Codes: - **200** – no error - **404** – no such container - **500** – server error ### Inspect changes on a container's filesystem `GET /containers/(id)/changes` Inspect changes on container `id`'s filesystem **Example request**: GET /containers/4fa6e0f0c678/changes HTTP/1.1 **Example response**: HTTP/1.1 200 OK Content-Type: application/json [ { "Path": "/dev", "Kind": 0 }, { "Path": "/dev/kmsg", "Kind": 1 }, { "Path": "/test", "Kind": 1 } ] Status Codes: - **200** – no error - **404** – no such container - **500** – server error ### Export a container `GET /containers/(id)/export` Export the contents of container `id` **Example request**: GET /containers/4fa6e0f0c678/export HTTP/1.1 **Example response**: HTTP/1.1 200 OK Content-Type: application/octet-stream {{ TAR STREAM }} Status Codes: - **200** – no error - **404** – no such container - **500** – server error ### Start a container `POST /containers/(id)/start` Start the container `id` **Example request**: POST /containers/(id)/start HTTP/1.1 Content-Type: application/json { "Binds":["/tmp:/tmp"], "LxcConf":[{"Key":"lxc.utsname","Value":"docker"}], "PortBindings":{ "22/tcp": [{ "HostPort": "11022" }] }, "PublishAllPorts":false, "Privileged":false, "Dns": ["8.8.8.8"], "VolumesFrom": ["parent", "other:ro"] } **Example response**: HTTP/1.1 204 No Content Content-Type: text/plain Json Parameters:   - **hostConfig** – the container's host configuration (optional) Status Codes: - **204** – no error - **404** – no such container - **500** – server error ### Stop a container `POST /containers/(id)/stop` Stop the container `id` **Example request**: POST /containers/e90e34656806/stop?t=5 HTTP/1.1 **Example response**: HTTP/1.1 204 No Content Query Parameters: - **t** – number of seconds to wait before killing the container Status Codes: - **204** – no error - **404** – no such container - **500** – server error ### Restart a container `POST /containers/(id)/restart` Restart the container `id` **Example request**: POST /containers/e90e34656806/restart?t=5 HTTP/1.1 **Example response**: HTTP/1.1 204 No Content Query Parameters: - **t** – number of seconds to wait before killing the container Status Codes: - **204** – no error - **404** – no such container - **500** – server error ### Kill a container `POST /containers/(id)/kill` Kill the container `id` **Example request**: POST /containers/e90e34656806/kill HTTP/1.1 **Example response**: HTTP/1.1 204 No Content Query Parameters - **signal** - Signal to send to the container: integer or string like "SIGINT". When not set, SIGKILL is assumed and the call will wait for the container to exit. Status Codes: - **204** – no error - **404** – no such container - **500** – server error ### Attach to a container `POST /containers/(id)/attach` Attach to the container `id` **Example request**: POST /containers/16253994b7c4/attach?logs=1&stream=0&stdout=1 HTTP/1.1 **Example response**: HTTP/1.1 200 OK Content-Type: application/vnd.docker.raw-stream {{ STREAM }} Query Parameters: - **logs** – 1/True/true or 0/False/false, return logs. Defaul false - **stream** – 1/True/true or 0/False/false, return stream. Default false - **stdin** – 1/True/true or 0/False/false, if stream=true, attach to stdin. Default false - **stdout** – 1/True/true or 0/False/false, if logs=true, return stdout log, if stream=true, attach to stdout. Default false - **stderr** – 1/True/true or 0/False/false, if logs=true, return stderr log, if stream=true, attach to stderr. Default false Status Codes: - **200** – no error - **400** – bad parameter - **404** – no such container - **500** – server error **Stream details**: When using the TTY setting is enabled in [`POST /containers/create` ](/reference/api/docker_remote_api_v1.9/#create-a-container "POST /containers/create"), the stream is the raw data from the process PTY and client's stdin. When the TTY is disabled, then the stream is multiplexed to separate stdout and stderr. The format is a **Header** and a **Payload** (frame). **HEADER** The header will contain the information on which stream write the stream (stdout or stderr). It also contain the size of the associated frame encoded on the last 4 bytes (uint32). It is encoded on the first 8 bytes like this: header := [8]byte{STREAM_TYPE, 0, 0, 0, SIZE1, SIZE2, SIZE3, SIZE4} `STREAM_TYPE` can be: - 0: stdin (will be written on stdout) - 1: stdout - 2: stderr `SIZE1, SIZE2, SIZE3, SIZE4` are the 4 bytes of the uint32 size encoded as big endian. **PAYLOAD** The payload is the raw stream. **IMPLEMENTATION** The simplest way to implement the Attach protocol is the following: 1. Read 8 bytes 2. chose stdout or stderr depending on the first byte 3. Extract the frame size from the last 4 byets 4. Read the extracted size and output it on the correct output 5. Goto 1) ### Attach to a container (websocket) `GET /containers/(id)/attach/ws` Attach to the container `id` via websocket Implements websocket protocol handshake according to [RFC 6455](http://tools.ietf.org/html/rfc6455) **Example request** GET /containers/e90e34656806/attach/ws?logs=0&stream=1&stdin=1&stdout=1&stderr=1 HTTP/1.1 **Example response** {{ STREAM }} Query Parameters: - **logs** – 1/True/true or 0/False/false, return logs. Default false - **stream** – 1/True/true or 0/False/false, return stream. Default false - **stdin** – 1/True/true or 0/False/false, if stream=true, attach to stdin. Default false - **stdout** – 1/True/true or 0/False/false, if logs=true, return stdout log, if stream=true, attach to stdout. Default false - **stderr** – 1/True/true or 0/False/false, if logs=true, return stderr log, if stream=true, attach to stderr. Default false Status Codes: - **200** – no error - **400** – bad parameter - **404** – no such container - **500** – server error ### Wait a container `POST /containers/(id)/wait` Block until container `id` stops, then returns the exit code **Example request**: POST /containers/16253994b7c4/wait HTTP/1.1 **Example response**: HTTP/1.1 200 OK Content-Type: application/json {"StatusCode": 0} Status Codes: - **200** – no error - **404** – no such container - **500** – server error ### Remove a container `DELETE /containers/(id)` Remove the container `id` from the filesystem **Example request**: DELETE /containers/16253994b7c4?v=1 HTTP/1.1 **Example response**: HTTP/1.1 204 No Content Query Parameters: - **v** – 1/True/true or 0/False/false, Remove the volumes associated to the container. Default false - **force** – 1/True/true or 0/False/false, Removes the container even if it was running. Default false Status Codes: - **204** – no error - **400** – bad parameter - **404** – no such container - **500** – server error ### Copy files or folders from a container `POST /containers/(id)/copy` Copy files or folders of container `id` **Example request**: POST /containers/4fa6e0f0c678/copy HTTP/1.1 Content-Type: application/json { "Resource": "test.txt" } **Example response**: HTTP/1.1 200 OK Content-Type: application/octet-stream {{ TAR STREAM }} Status Codes: - **200** – no error - **404** – no such container - **500** – server error ## 2.2 Images ### List Images `GET /images/json` **Example request**: GET /images/json?all=0 HTTP/1.1 **Example response**: HTTP/1.1 200 OK Content-Type: application/json [ { "RepoTags": [ "ubuntu:12.04", "ubuntu:precise", "ubuntu:latest" ], "Id": "8dbd9e392a964056420e5d58ca5cc376ef18e2de93b5cc90e868a1bbc8318c1c", "Created": 1365714795, "Size": 131506275, "VirtualSize": 131506275 }, { "RepoTags": [ "ubuntu:12.10", "ubuntu:quantal" ], "ParentId": "27cf784147099545", "Id": "b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc", "Created": 1364102658, "Size": 24653, "VirtualSize": 180116135 } ] ### Create an image `POST /images/create` Create an image, either by pull it from the registry or by importing i **Example request**: POST /images/create?fromImage=base HTTP/1.1 **Example response**: HTTP/1.1 200 OK Content-Type: application/json {"status": "Pulling..."} {"status": "Pulling", "progress": "1 B/ 100 B", "progressDetail": {"current": 1, "total": 100}} {"error": "Invalid..."} ... When using this endpoint to pull an image from the registry, the `X-Registry-Auth` header can be used to include a base64-encoded AuthConfig object. Query Parameters: - **fromImage** – name of the image to pull - **fromSrc** – source to import, - means stdin - **repo** – repository - **tag** – tag - **registry** – the registry to pull from Request Headers: - **X-Registry-Auth** – base64-encoded AuthConfig object Status Codes: - **200** – no error - **500** – server error ### Inspect an image `GET /images/(name)/json` Return low-level information on the image `name` **Example request**: GET /images/base/json HTTP/1.1 **Example response**: HTTP/1.1 200 OK Content-Type: application/json { "id":"b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc", "parent":"27cf784147099545", "created":"2013-03-23T22:24:18.818426-07:00", "container":"3d67245a8d72ecf13f33dffac9f79dcdf70f75acb84d308770391510e0c23ad0", "container_config": { "Hostname":"", "User":"", "Memory":0, "MemorySwap":0, "AttachStdin":false, "AttachStdout":false, "AttachStderr":false, "PortSpecs":null, "Tty":true, "OpenStdin":true, "StdinOnce":false, "Env":null, "Cmd": ["/bin/bash"], "Dns":null, "Image":"base", "Volumes":null, "VolumesFrom":"", "WorkingDir":"" }, "Size": 6824592 } Status Codes: - **200** – no error - **404** – no such image - **500** – server error ### Get the history of an image `GET /images/(name)/history` Return the history of the image `name` **Example request**: GET /images/base/history HTTP/1.1 **Example response**: HTTP/1.1 200 OK Content-Type: application/json [ { "Id": "b750fe79269d", "Created": 1364102658, "CreatedBy": "/bin/bash" }, { "Id": "27cf78414709", "Created": 1364068391, "CreatedBy": "" } ] Status Codes: - **200** – no error - **404** – no such image - **500** – server error ### Push an image on the registry `POST /images/(name)/push` Push the image `name` on the registry **Example request**: POST /images/test/push HTTP/1.1 **Example response**: HTTP/1.1 200 OK Content-Type: application/json {"status": "Pushing..."} {"status": "Pushing", "progress": "1/? (n/a)", "progressDetail": {"current": 1}}} {"error": "Invalid..."} ... If you wish to push an image on to a private registry, that image must already have been tagged into a repository which references that registry host name and port. This repository name should then be used in the URL. This mirrors the flow of the CLI. **Example request**: POST /images/registry.acme.com:5000/test/push HTTP/1.1 Query Parameters: - **tag** – the tag to associate with the image on the registry, optional Request Headers: - **X-Registry-Auth** – include a base64-encoded AuthConfig object. Status Codes: - **200** – no error - **404** – no such image - **500** – server error ### Tag an image into a repository `POST /images/(name)/tag` Tag the image `name` into a repository **Example request**: POST /images/test/tag?repo=myrepo&force=0&tag=v42 HTTP/1.1 **Example response**: HTTP/1.1 201 OK Query Parameters: - **repo** – The repository to tag in - **force** – 1/True/true or 0/False/false, default false - **tag** - The new tag name Status Codes: - **201** – no error - **400** – bad parameter - **404** – no such image - **409** – conflict - **500** – server error ### Remove an image `DELETE /images/(name)` Remove the image `name` from the filesystem **Example request**: DELETE /images/test HTTP/1.1 **Example response**: HTTP/1.1 200 OK Content-type: application/json [ {"Untagged": "3e2f21a89f"}, {"Deleted": "3e2f21a89f"}, {"Deleted": "53b4f83ac9"} ] Query Parameters: - **force** – 1/True/true or 0/False/false, default false - **noprune** – 1/True/true or 0/False/false, default false Status Codes: - **200** – no error - **404** – no such image - **409** – conflict - **500** – server error ### Search images `GET /images/search` Search for an image on [Docker Hub](https://hub.docker.com). > **Note**: > The response keys have changed from API v1.6 to reflect the JSON > sent by the registry server to the docker daemon's request. **Example request**: GET /images/search?term=sshd HTTP/1.1 **Example response**: HTTP/1.1 200 OK Content-Type: application/json [ { "description": "", "is_official": false, "is_trusted": false, "name": "wma55/u1210sshd", "star_count": 0 }, { "description": "", "is_official": false, "is_trusted": false, "name": "jdswinbank/sshd", "star_count": 0 }, { "description": "", "is_official": false, "is_trusted": false, "name": "vgauthier/sshd", "star_count": 0 } ... ] Query Parameters: - **term** – term to search Status Codes: - **200** – no error - **500** – server error ## 2.3 Misc ### Build an image from Dockerfile via stdin `POST /build` Build an image from Dockerfile via stdin **Example request**: POST /build HTTP/1.1 {{ TAR STREAM }} **Example response**: HTTP/1.1 200 OK Content-Type: application/json {"stream": "Step 1..."} {"stream": "..."} {"error": "Error...", "errorDetail": {"code": 123, "message": "Error..."}} The stream must be a tar archive compressed with one of the following algorithms: identity (no compression), gzip, bzip2, xz. The archive must include a file called `Dockerfile` at its root. It may include any number of other files, which will be accessible in the build context (See the [*ADD build command*](/reference/builder/#dockerbuilder)). Query Parameters: - **t** – repository name (and optionally a tag) to be applied to the resulting image in case of success - **q** – suppress verbose build output - **nocache** – do not use the cache when building the image - **rm** - remove intermediate containers after a successful build Request Headers: - **Content-type** – should be set to `"application/tar"`. - **X-Registry-Config** – base64-encoded ConfigFile objec Status Codes: - **200** – no error - **500** – server error ### Check auth configuration `POST /auth` Get the default username and email **Example request**: POST /auth HTTP/1.1 Content-Type: application/json { "username":" hannibal", "password: "xxxx", "email": "hannibal@a-team.com", "serveraddress": "https://index.docker.io/v1/" } **Example response**: HTTP/1.1 200 OK Status Codes: - **200** – no error - **204** – no error - **500** – server error ### Display system-wide information `GET /info` Display system-wide information **Example request**: GET /info HTTP/1.1 **Example response**: HTTP/1.1 200 OK Content-Type: application/json { "Containers": 11, "Images": 16, "Driver": "btrfs", "ExecutionDriver": "native-0.1", "KernelVersion": "3.12.0-1-amd64" "Debug": false, "NFd": 11, "NGoroutines": 21, "NEventsListener": 0, "InitPath": "/usr/bin/docker", "IndexServerAddress": ["https://index.docker.io/v1/"], "MemoryLimit": true, "SwapLimit": false, "IPv4Forwarding": true } Status Codes: - **200** – no error - **500** – server error ### Show the docker version information `GET /version` Show the docker version information **Example request**: GET /version HTTP/1.1 **Example response**: HTTP/1.1 200 OK Content-Type: application/json { "Version":"0.2.2", "GitCommit":"5a2a5cc+CHANGES", "GoVersion":"go1.0.3" } Status Codes: - **200** – no error - **500** – server error ### Ping the docker server `GET /_ping` Ping the docker server **Example request**: GET /_ping HTTP/1.1 **Example response**: HTTP/1.1 200 OK Content-Type: text/plain OK Status Codes: - **200** - no error - **500** - server error ### Create a new image from a container's changes `POST /commit` Create a new image from a container's changes **Example request**: POST /commit?container=44c004db4b17&m=message&repo=myrepo HTTP/1.1 Content-Type: application/json { "Hostname":"", "User":"", "Memory":0, "MemorySwap":0, "AttachStdin":false, "AttachStdout":true, "AttachStderr":true, "PortSpecs":null, "Tty":false, "OpenStdin":false, "StdinOnce":false, "Env":null, "Cmd":[ "date" ], "Volumes":{ "/tmp": {} }, "WorkingDir":"", "DisableNetwork": false, "ExposedPorts":{ "22/tcp": {} } } **Example response**: HTTP/1.1 201 Created Content-Type: application/vnd.docker.raw-stream {"Id": "596069db4bf5"} Json Parameters: - **config** - the container's configuration Query Parameters: - **container** – source container - **repo** – repository - **tag** – tag - **m** – commit message - **author** – author (e.g., "John Hannibal Smith <[hannibal@a-team.com](mailto:hannibal%40a-team.com)>") Status Codes: - **201** – no error - **404** – no such container - **500** – server error ### Monitor Docker's events `GET /events` Get container events from docker, either in real time via streaming, or via polling (using since). Docker containers will report the following events: create, destroy, die, export, kill, pause, restart, start, stop, unpause and Docker images will report: untag, delete **Example request**: GET /events?since=1374067924 **Example response**: HTTP/1.1 200 OK Content-Type: application/json {"status": "create", "id": "dfdf82bd3881","from": "base:latest", "time":1374067924} {"status": "start", "id": "dfdf82bd3881","from": "base:latest", "time":1374067924} {"status": "stop", "id": "dfdf82bd3881","from": "base:latest", "time":1374067966} {"status": "destroy", "id": "dfdf82bd3881","from": "base:latest", "time":1374067970} Query Parameters: - **since** – timestamp used for polling - **until** – timestamp used for polling Status Codes: - **200** – no error - **500** – server error ### Get a tarball containing all images and tags in a repository `GET /images/(name)/get` Get a tarball containing all images and metadata for the repository specified by `name`. See the [image tarball format](#image-tarball-format) for more details. **Example request** GET /images/ubuntu/get **Example response**: HTTP/1.1 200 OK Content-Type: application/x-tar Binary data stream Status Codes: - **200** – no error - **500** – server error ### Load a tarball with a set of images and tags into docker `POST /images/load` Load a set of images and tags into the docker repository. See the [image tarball format](#image-tarball-format) for more details. **Example request** POST /images/load Tarball in body **Example response**: HTTP/1.1 200 OK Status Codes: - **200** – no error - **500** – server error ### Image tarball format An image tarball contains one directory per image layer (named using its long ID), each containing three files: 1. `VERSION`: currently `1.0` - the file format version 2. `json`: detailed layer information, similar to `docker inspect layer_id` 3. `layer.tar`: A tarfile containing the filesystem changes in this layer The `layer.tar` file will contain `aufs` style `.wh..wh.aufs` files and directories for storing attribute changes and deletions. If the tarball defines a repository, there will also be a `repositories` file at the root that contains a list of repository and tag names mapped to layer IDs. ``` {"hello-world": {"latest": "565a9d68a73f6706862bfe8409a7f659776d4d60a8d096eb4a3cbce6999cc2a1"} } ``` # 3. Going further ## 3.1 Inside `docker run` As an example, the `docker run` command line makes the following API calls: - Create the container - If the status code is 404, it means the image doesn't exist: - Try to pull it - Then retry to create the container - Start the container - If you are not in detached mode: - Attach to the container, using logs=1 (to have stdout and stderr from the container's start) and stream=1 - If in detached mode or only stdin is attached: - Display the container's id ## 3.2 Hijacking In this version of the API, /attach, uses hijacking to transport stdin, stdout and stderr on the same socket. This might change in the future. ## 3.3 CORS Requests To enable cross origin requests to the remote api add the flag "--api-enable-cors" when running docker in daemon mode. $ docker -d -H="192.168.1.9:2375" --api-enable-cors
euank/docker
docs/sources/reference/api/docker_remote_api_v1.11.md
Markdown
apache-2.0
33,818
/* * Copyright 2013 Cloudera 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.cloudera.crash.carriers; import com.cloudera.crash.Main; public abstract class FromCollection<S, T> extends Carrier<S, T> { protected FromCollection(String name, Main.Script script) { super(name, script); } @Override public final void process(S input) { work(input); } public abstract void work(S input); }
rdblue/crash
src/main/java/com/cloudera/crash/carriers/FromCollection.java
Java
apache-2.0
939
/** * Copyright (c) 2014 Lemur Consulting Ltd. * <p/> * 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 * <p/> * http://www.apache.org/licenses/LICENSE-2.0 * <p/> * 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 uk.co.flax.biosolr.ontology.resources; import java.util.Map; import javax.ws.rs.Consumes; import javax.ws.rs.POST; import javax.ws.rs.Path; import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; import uk.co.flax.biosolr.ontology.api.JenaRequest; import uk.co.flax.biosolr.ontology.api.SearchResponse; import uk.co.flax.biosolr.ontology.search.ResultsList; import uk.co.flax.biosolr.ontology.search.SearchEngineException; import uk.co.flax.biosolr.ontology.search.jena.JenaOntologySearch; /** * Endpoint for searching using Apache Jena, using SPARQL. * * @author Matt Pearce */ @Path("/jenaSearch") public class JenaSearchResource { private final JenaOntologySearch jenaSearch; public JenaSearchResource(JenaOntologySearch search) { this.jenaSearch = search; } @POST @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) public SearchResponse<Map<String, String>> handlePost(JenaRequest request) { SearchResponse<Map<String,String>> response; try { ResultsList<Map<String, String>> results = jenaSearch.searchOntology(request.getPrefix(), request.getQuery(), request.getRows()); response = new SearchResponse<Map<String, String>>(results.getResults(), 0, results.getPageSize(), results.getResults().size()); } catch (SearchEngineException e) { response = new SearchResponse<>(e.getMessage()); } return response; } }
flaxsearch/BioSolr
spot/spot-ontology/spot-ontology-webapp/src/main/java/uk/co/flax/biosolr/ontology/resources/JenaSearchResource.java
Java
apache-2.0
2,102
using System; using System.Collections.Generic; using System.Linq; using System.Runtime.Remoting.Messaging; using StackifyLib.Internal.Logs; using StackifyLib.Models; using StackifyLib.Utils; using Apache_log4net = log4net; using log4net.Appender; using log4net.spi; using log4netOffical = log4net; namespace StackifyLib.log4net.Sitecore { public class StackifyAppender : AppenderSkeleton { public string apiKey { get; set; } public string uri { get; set; } public string globalContextKeys { get; set; } public string threadContextKeys { get; set; } public string logicalThreadContextKeys { get; set; } public string callContextKeys { get; set; } public bool? logMethodNames { get; set; } //private List<string> _GlobalContextKeys = new List<string>(); //private List<string> _ThreadContextKeys = new List<string>(); //private List<string> _LogicalThreadContextKeys = new List<string>(); private List<string> _CallContextKeys = new List<string>(); private ILogClient _logClient = null; private bool _HasContextKeys = false; public Func<string, string, ILogClient> CreateLogClient = (apiKey, uri) => new LogClient("StackifyLib.net-log4net-sitecore", apiKey, uri); public override void OnClose() { try { StackifyAPILogger.Log("log4net appender closing"); _logClient.Close(); //This is to force the metrics queue to flush as well StackifyLib.Internal.Metrics.MetricClient.StopMetricsQueue("log4net OnClose"); } catch { } } public override void ActivateOptions() { StackifyAPILogger.Log("ActiveOptions on log4net appender"); try { //if (!String.IsNullOrEmpty(globalContextKeys)) //{ // _GlobalContextKeys = globalContextKeys.Split(',').Select(s => s.Trim()).ToList(); //} //if (!String.IsNullOrEmpty(threadContextKeys)) //{ // _ThreadContextKeys = threadContextKeys.Split(',').Select(s => s.Trim()).ToList(); //} //if (!String.IsNullOrEmpty(logicalThreadContextKeys)) //{ // _LogicalThreadContextKeys = logicalThreadContextKeys.Split(',').Select(s => s.Trim()).ToList(); //} if (!String.IsNullOrEmpty(callContextKeys)) { _CallContextKeys = callContextKeys.Split(',').Select(s => s.Trim()).ToList(); } // _HasContextKeys = _GlobalContextKeys.Any() || _ThreadContextKeys.Any() || _LogicalThreadContextKeys.Any() || _CallContextKeys.Any(); _HasContextKeys = _CallContextKeys.Any(); _logClient = CreateLogClient(apiKey, uri); } catch (Exception ex) { StackifyAPILogger.Log(ex.Message, true); } base.ActivateOptions(); } protected override void Append(LoggingEvent loggingEvent) { try { //make sure the buffer isn't overflowing //if it is skip since we can't do anything with the message if (Logger.PrefixEnabled() || _logClient.CanQueue()) { var logMsg = Translate(loggingEvent); if (logMsg != null) { _logClient.QueueMessage(logMsg); } } else { StackifyAPILogger.Log("Unable to send log because the queue is full"); } } catch (Exception ex) { StackifyAPILogger.Log(ex.ToString()); } } internal LogMsg Translate(LoggingEvent loggingEvent) { if (loggingEvent == null) return null; //don't log our own logging causing a loop if (loggingEvent.RenderedMessage.IndexOf("StackifyLib:", StringComparison.OrdinalIgnoreCase) > -1) return null; var msg = new LogMsg(); if (loggingEvent.Level != null) { msg.Level = loggingEvent.Level.Name; } try { msg.SrcMethod = loggingEvent.LoggerName; if (logMethodNames ?? false) { var frames = StackifyLib.Logger.GetCurrentStackTrace(loggingEvent.LoggerName, 1, true); if (frames.Any()) { var first = frames.First(); msg.SrcMethod = first.Method; msg.SrcLine = first.LineNum; } } } catch (Exception ex) { StackifyAPILogger.Log("Error evaluating source method " + ex.ToString()); } var diags = GetDiagnosticContextProperties(); if (diags != null && diags.ContainsKey("transid")) { msg.TransID = diags["transid"].ToString(); diags.Remove("transid"); } StackifyError error = null; object messageObject = null; string errorAdditionalMessage = null; if (loggingEvent.MessageObject != null && loggingEvent.MessageObject is StackifyError) { //Message Object was an exception error = (StackifyError)loggingEvent.MessageObject; messageObject = error.ToString(); errorAdditionalMessage = null; } else if (loggingEvent.MessageObject != null && loggingEvent.MessageObject is Exception) { //Message Object was an exception error = StackifyError.New((Exception)loggingEvent.MessageObject); messageObject = error.ToString(); errorAdditionalMessage = null; } //else if (loggingEvent.ExceptionObject != null) //{ // //Exception was passed in // if (loggingEvent.ExceptionObject is StackifyError) // { // error = loggingEvent.ExceptionObject as StackifyError; // } // else // { // error = StackifyError.New(loggingEvent.ExceptionObject); // } // errorAdditionalMessage = loggingEvent.RenderedMessage; // messageObject = loggingEvent.MessageObject; //} else { // we try to retrieve the thrown exception but wait to do this check until this last condition // block since we need to use reflection which is an expensive operation Exception thrownException = GetThrownException(loggingEvent); if (thrownException == null) { // the thrown exception does not exist, so we use the basic information provided in the message object messageObject = loggingEvent.MessageObject; } else { if (thrownException is StackifyError) { error = thrownException as StackifyError; } else { error = StackifyError.New(thrownException); } errorAdditionalMessage = loggingEvent.RenderedMessage; messageObject = loggingEvent.MessageObject; } } //messageObject is not an object we need to serialize. if (messageObject == null || messageObject is string || messageObject.GetType().FullName == "log4net.Util.SystemStringFormat") { //passing null to the serialize object since we can't serialize the logged object. We only need to get potential diags. msg.data = StackifyLib.Utils.HelperFunctions.SerializeDebugData(null, false, diags); msg.Msg = loggingEvent.RenderedMessage; } else if (messageObject is StackifyLib.Models.LogMessage) { var item = messageObject as StackifyLib.Models.LogMessage; msg.data = StackifyLib.Utils.HelperFunctions.SerializeDebugData(item.json, true, diags); msg.Msg = item.message; } else { //try to serialize the messageObject since we know its not a string msg.data = StackifyLib.Utils.HelperFunctions.SerializeDebugData(messageObject, false, diags); msg.Msg = loggingEvent.RenderedMessage; if (error != null) { msg.Msg += "\r\n" + error.ToString(); } } if (!string.IsNullOrWhiteSpace(errorAdditionalMessage) && error != null) { //if something besides just the exception was logged, add that message to our error object error.SetAdditionalMessage(errorAdditionalMessage); } else if (msg.Msg == null && error != null) { msg.Msg = error.ToString(); } if (error == null && (loggingEvent.Level == Level.ERROR || loggingEvent.Level == Level.FATAL)) { StringException stringEx = new StringException(loggingEvent.RenderedMessage); stringEx.TraceFrames = new List<TraceFrame>(); stringEx.TraceFrames = StackifyLib.Logger.GetCurrentStackTrace(loggingEvent.LoggerName); if (stringEx.TraceFrames.Any()) { var first = stringEx.TraceFrames.First(); msg.SrcMethod = first.Method; msg.SrcLine = first.LineNum; } //Make error out of log message error = StackifyError.New(stringEx); } if (error != null && !StackifyError.IgnoreError(error) && _logClient.ErrorShouldBeSent(error)) { msg.Ex = error; } else if(error != null && msg.Msg != null) { msg.Msg += " #errorgoverned"; } return msg; } private Exception GetThrownException(LoggingEvent loggingEvent) { // Since Sitecore's implementation does not expose the ExceptionObject, we need to use reflection to get access // to it, as per Matt Watson from Stackify. We know they store this Exception in a field with the name m_thrownException // so we retrieve the private field based on its name. Exception thrownException = null; Type loggingEventType = loggingEvent.GetType(); var thrownExceptionFieldInfo = loggingEventType.GetField("m_thrownException", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic); if (thrownExceptionFieldInfo != null) { thrownException = thrownExceptionFieldInfo.GetValue(loggingEvent) as Exception; } return thrownException; } private Dictionary<string, object> GetDiagnosticContextProperties() { if (!_HasContextKeys) { return null; } Dictionary<string, object> properties = new Dictionary<string, object>(); //foreach (string gdcKey in _GlobalContextKeys) //{ // object gdcValue = Apache_log4net.GlobalContext.Properties[gdcKey]; // if (gdcValue != null) // { // properties[gdcKey.ToLower()] = gdcValue; // } //} //foreach (string mdcKey in _ThreadContextKeys) //{ // object mdcValue = Apache_log4net.ThreadContext.Properties[mdcKey]; // if (mdcValue != null) // { // // Check if the property is a Log4net Context Stack, // // If it is, then we want to read it as a string as that is // // the expected behavior for a Log4Net Appender. // var tcs = mdcValue as Apache_log4net.Util.ThreadContextStack; // if (tcs != null) // { // properties[mdcKey.ToLower()] = tcs.ToString(); // } // else // { // // for anything else, we will let Json.Net take care of it. // properties[mdcKey.ToLower()] = mdcValue; // } // } //} //foreach (string mdcKey in _LogicalThreadContextKeys) //{ // object mdcValue = Apache_log4net.LogicalThreadContext.Properties[mdcKey]; // if (mdcValue != null) // { // // Check if the property is a Log4net Context Stack, // // If it is, then we want to read it as a string as that is // // the expected behavior for a Log4Net Appender. // var tcs = mdcValue as Apache_log4net.Util.ThreadContextStack; // if (tcs != null) // { // properties[mdcKey.ToLower()] = tcs.ToString(); // continue; // } // // Log4Net 1.2.14 (2.0.4) added LogicalThreadContextStack // // see https://issues.apache.org/jira/browse/LOG4NET-455 // // To maintain compatibility with version 2.0.0 in this library, we have to use reflection here. // // TODO: Require version 1.2.14, as we know there are issues in prior versions. // var mdcType = mdcValue.GetType(); // if (mdcType.FullName == "log4net.Util.LogicalThreadContextStack") // { // properties[mdcKey.ToLower()] = mdcValue.ToString(); // continue; // } // // for anything else, we will let Json.Net take care of it. // properties[mdcKey.ToLower()] = mdcValue; // } //} foreach (string key in _CallContextKeys) { object value = CallContext.LogicalGetData(key); if (value != null) { properties[key.ToLower()] = value; } } return properties; } } }
stackify/stackify-api-dotnet
Src/StackifyLib.log4net.Sitecore/StackifyAppender.cs
C#
apache-2.0
14,764
/* Copyright (c) 2017 TOSHIBA Digital Solutions Corporation 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 _PARTITIONCONTROLLER_H_ #define _PARTITIONCONTROLLER_H_ #include "gridstore.h" #include "GSException.h" #include <vector> namespace griddb { class PartitionController { GSPartitionController *mController; public: PartitionController(GSPartitionController *controller); ~PartitionController(); int32_t get_partition_count(); int64_t get_partition_container_count(int32_t partitionIndex); void get_partition_container_names(int32_t partitionIndex, int64_t start, const GSChar * const ** stringList, size_t *size, int64_t limit=-1); void get_partition_hosts(int32_t partitionIndex, const GSChar * const **stringList, size_t *size); int32_t get_partition_index_of_container(const GSChar *containerName); string get_partition_owner_host(int32_t partitionIndex); void get_partition_backup_hosts(int32_t partitionIndex, const GSChar * const ** stringList, size_t *size); void assign_partition_preferable_host(int32_t partitionIndex, const GSChar *host); }; } /* namespace griddb */ #endif /* _PARTITIONCONTROLLER_H_ */
griddb/griddb_client
src/PartitionController.h
C
apache-2.0
1,667
/** * Copyright (C) 2013 cherimojava (http://github.com/cherimojava/cherimodata) 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.github.cherimojava.data.mongo.io; import java.util.Map; import org.bson.BsonType; import org.bson.codecs.BsonTypeClassMap; import com.github.cherimojava.data.mongo.entity.Entity; import com.google.common.collect.Maps; /** * BsonTypeClassMap adjusted to our Entity needs * * @author philnate */ public class EntityTypeMap extends BsonTypeClassMap { private static final Map<BsonType, Class<?>> replacements; static { // right now all we need to replace is the DocumentType with our Entity class replacements = Maps.newHashMap(); replacements.put( BsonType.DOCUMENT, Entity.class ); } /** * replaces Document mapping with generic EntityType */ public EntityTypeMap() { super( replacements ); } /** * replaces the document mapping with the actual EntityType * * @param clazz */ public EntityTypeMap( Class<? extends Entity> clazz ) { super( replacement( clazz ) ); } private static Map<BsonType, Class<?>> replacement( Class<? extends Entity> clazz ) { Map<BsonType, Class<?>> repl = Maps.newHashMap( replacements ); repl.put( BsonType.DOCUMENT, clazz ); return repl; } }
cherimojava/cherimodata
mongo/src/main/java/com/github/cherimojava/data/mongo/io/EntityTypeMap.java
Java
apache-2.0
1,872
/* Copyright (C) 2014 Zi-Xiang Lin <bdl9437@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package nkfust.selab.android.explorer.layout.processer; import nkfust.selab.android.explorer.layout.model.TabFragment; import android.content.Context; import android.util.DisplayMetrics; import android.view.View; import android.view.ViewGroup; import android.view.ViewGroup.MarginLayoutParams; import android.view.WindowManager; /** * This class is set specific view size in the content page. * <p> * This usage: * <ul> * <li>First must set content page size use "setContentSize(int Height, int Width)" function, * and specific view size use "setDataViewSize(int Height, int Width)" function. * <li>Second used to "set(Context context, View aView, Boolean isFullScreen)" function * set specific view size. * </ul> * * @author Zi-Xiang Lin <bdl9437@gmail.com> */ public class SetScreenSize { private static int dataHeight, dataWidth, contentHeight, contentWidth; /** * This function is set specific view size in the content page. * @param context The context is a Activity parent. * @param aView The aView is specific view. * @param isFullScreen The isFullScreen is judge content page whether full screen. */ public static void set(Context context, View aView, Boolean isFullScreen){ DisplayMetrics metrics = new DisplayMetrics(); WindowManager windowManager = (WindowManager) context .getSystemService(Context.WINDOW_SERVICE); windowManager.getDefaultDisplay().getMetrics(metrics); ViewGroup.MarginLayoutParams params = (MarginLayoutParams) aView.getLayoutParams(); // Get the width of the screen int screenWidth = windowManager.getDefaultDisplay().getWidth(); int screenHeight = windowManager.getDefaultDisplay().getHeight(); float screenProportion = (float) screenWidth / (float) screenHeight; float videoProportion = (float) dataWidth / (float) dataHeight; float contentScreenProportion = (float) contentWidth / (float) contentHeight; if (isFullScreen) { TabFragment.getActionBarActivity().getSupportActionBar().hide(); if(TabFragment.getFrameLayout() == null) TabFragment.getActionBarActivity().getSupportFragmentManager() .beginTransaction().hide(TabFragment.getTabFragment()).commit(); if (videoProportion > screenProportion) { params.width = screenWidth; params.height = (int) ((float) screenWidth / videoProportion); } else { params.width = (int) (videoProportion * (float) screenHeight); params.height = screenHeight; } } else { TabFragment.getActionBarActivity().getSupportActionBar().show(); TabFragment.getActionBarActivity().getSupportFragmentManager() .beginTransaction().show(TabFragment.getTabFragment()).commit(); if (videoProportion > contentScreenProportion) { params.width = contentWidth; params.height = (int) ((float) contentWidth / videoProportion); } else { params.width = (int) (videoProportion * (float) contentHeight); params.height = contentHeight; } } params.setMargins(0, 0, 0, 0); aView.setLayoutParams(params); } /** * This function is set specific view original size. * @param Height The specific view original height. * @param Width The specific view original width. */ public static void setDataViewSize(int Height, int Width) { dataHeight = Height; dataWidth = Width; } /** * This function is set content page current size. * @param Height The content page current height. * @param Width The content page current width. */ public static void setContentSize(int Height, int Width) { contentHeight = Height; contentWidth = Width; } }
BDLin/android.explorer_layout
src/nkfust/selab/android/explorer/layout/processer/SetScreenSize.java
Java
apache-2.0
4,184
/** * Most of the code in the Qalingo project is copyrighted Hoteia and licensed * under the Apache License Version 2.0 (release version 0.8.0) * http://www.apache.org/licenses/LICENSE-2.0 * * Copyright (c) Hoteia, 2012-2014 * http://www.hoteia.com - http://twitter.com/hoteia - contact@hoteia.com * */ package org.hoteia.qalingo.core.domain; import java.util.HashSet; import java.util.Set; import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.OneToMany; import javax.persistence.Table; import org.hoteia.qalingo.core.domain.impl.DomainEntity; @Entity @Table(name="TECO_TAX_COUNTRY") public class TaxCountry extends AbstractEntity<TaxCountry> implements DomainEntity { /** * Generated UID */ private static final long serialVersionUID = -3914688014885715616L; @Id @GeneratedValue(strategy = GenerationType.AUTO) @Column(name="ID", nullable=false) private Long id; @Column(name="CODE_COUNTRY") private String codeCountry; @OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL) @JoinColumn(name="TAX_COUNTRY_ID") private Set<TaxState> taxCounties = new HashSet<TaxState>(); public TaxCountry() { } public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getCodeCountry() { return codeCountry; } public void setCodeCountry(String codeCountry) { this.codeCountry = codeCountry.replaceAll(" ", ""); } public Set<TaxState> getTaxCounties() { return taxCounties; } public void setTaxeCounties(Set<TaxState> taxCounties) { this.taxCounties = taxCounties; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((codeCountry == null) ? 0 : codeCountry.hashCode()); result = prime * result + ((id == null) ? 0 : id.hashCode()); return result; } @Override public boolean equals(Object sourceObj) { Object obj = deproxy(sourceObj); if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; TaxCountry other = (TaxCountry) obj; if (codeCountry == null) { if (other.codeCountry != null) return false; } else if (!codeCountry.equals(other.codeCountry)) return false; if (id == null) { if (other.id != null) return false; } else if (!id.equals(other.id)) return false; return true; } @Override public String toString() { return "TaxCountry [id=" + id + ", codeCountry=" + codeCountry + "]"; } }
qalingo/qalingo-engine
apis/api-core/api-core-common/src/main/java/org/hoteia/qalingo/core/domain/TaxCountry.java
Java
apache-2.0
2,963
# Ferdinandia adolfi-friderici Gilg & Mildbr. SPECIES #### Status SYNONYM #### According to GRIN Taxonomy for Plants #### Published in G. W. J. Mildbraed, Wiss. Erg. deut. Zentr. -Afr. Exped. , Bot. 290. 1911 #### Original name null ### Remarks null
mdoering/backbone
life/Plantae/Magnoliophyta/Magnoliopsida/Lamiales/Bignoniaceae/Fernandoa/Fernandoa adolfi-friderici/ Syn. Ferdinandia adolfi-friderici/README.md
Markdown
apache-2.0
254
/* * Copyright (C) 2016 Lavoisier.io * * This file is part of the Lavoisier.io project. * * 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.lavoisier.osgi.logging; import java.util.HashMap; import java.util.Map; import org.osgi.service.log.LogEntry; import org.osgi.service.log.LogListener; import org.osgi.service.log.LogService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Component; /** * The Slf4jOSGiLoggingAdaptor converts the {@link LogEntry} objects it receives into calls to the slf4j loggers. */ @Component public class Slf4jOSGiLoggingAdaptor implements LogListener { private Map<Long, Logger> loggers = new HashMap<Long, Logger>(); /** * This methods is called by the {@link org.osgi.service.log.LogReaderService}, and dispatch them to a set of * {@link Logger}s */ @Override public void logged(LogEntry log) { if ((log.getBundle() == null) || (log.getBundle().getSymbolicName() == null)) { // if there is no name, it's probably the framework emitting a log // This should not happen and we don't want to log something anonymous return; } // Retrieve a Log object, or create it if none exists. Logger logger = loggers.get(log.getBundle().getBundleId()); if (logger == null) { logger = LoggerFactory.getLogger(log.getBundle().getSymbolicName()); loggers.put(log.getBundle().getBundleId(), logger); } // If there is an exception available, use it, otherwise just log // the message if (log.getException() != null) { switch (log.getLevel()) { case LogService.LOG_DEBUG: logger.debug(log.getMessage(), log.getException()); break; case LogService.LOG_INFO: logger.info(log.getMessage(), log.getException()); break; case LogService.LOG_WARNING: logger.warn(log.getMessage(), log.getException()); break; case LogService.LOG_ERROR: logger.error(log.getMessage(), log.getException()); break; } } else { switch (log.getLevel()) { case LogService.LOG_DEBUG: logger.debug(log.getMessage()); break; case LogService.LOG_INFO: logger.info(log.getMessage()); break; case LogService.LOG_WARNING: logger.warn(log.getMessage()); break; case LogService.LOG_ERROR: logger.error(log.getMessage()); break; } } } }
lavoisier/lavoisier.io
lavoisier-osgi/src/main/java/io/lavoisier/osgi/logging/Slf4jOSGiLoggingAdaptor.java
Java
apache-2.0
3,267
/* * Copyright 2011 frdfsnlght <frdfsnlght@gmail.com>. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.frdfsnlght.transporter.api.event; import com.frdfsnlght.transporter.api.Reservation; import org.bukkit.event.Event; import org.bukkit.event.HandlerList; /** * Fired when an entity arrives from a teleport. * * @author frdfsnlght <frdfsnlght@gmail.com> */ public final class EntityArriveEvent extends Event { private static final HandlerList handlers = new HandlerList(); /** * Returns the list of event handlers for this event. * * @return the list of event handlers for this event */ public static HandlerList getHandlerList() { return handlers; } private Reservation reservation; /** * Creates the event. * * @param reservation the reservation used for teleportation */ public EntityArriveEvent(Reservation reservation) { this.reservation = reservation; } /** * Returns the reservation used for teleporation. * * @return the reservation used for teleporation */ public Reservation getReservation() { return reservation; } /** * Returns the list of event handlers for this event. * * @return the list of event handlers for this event */ @Override public HandlerList getHandlers() { return handlers; } }
AlmuraDev/Transporter
src/main/java/com/frdfsnlght/transporter/api/event/EntityArriveEvent.java
Java
apache-2.0
1,921
.uneditable-input { color: #666; } .modal-backdrop { background: none; }
vidyacraghav/scalapress
src/main/webapp/static/css/scalapress.css
CSS
apache-2.0
81
# Statice altaica Hort. ex G.Don SPECIES #### Status ACCEPTED #### According to International Plant Names Index #### Published in null #### Original name null ### Remarks null
mdoering/backbone
life/Plantae/Magnoliophyta/Magnoliopsida/Caryophyllales/Plumbaginaceae/Statice/Statice altaica/README.md
Markdown
apache-2.0
180
# Epipactis palustris f. gracilis FORM #### Status SYNONYM #### According to The Catalogue of Life, 3rd January 2011 #### Published in null #### Original name null ### Remarks null
mdoering/backbone
life/Plantae/Magnoliophyta/Liliopsida/Asparagales/Orchidaceae/Epipactis/Epipactis palustris/ Syn. Epipactis palustris gracilis/README.md
Markdown
apache-2.0
185
# Cucubalus strictus Roth SPECIES #### Status ACCEPTED #### According to International Plant Names Index #### Published in null #### Original name null ### Remarks null
mdoering/backbone
life/Plantae/Magnoliophyta/Magnoliopsida/Caryophyllales/Caryophyllaceae/Cucubalus/Cucubalus strictus/README.md
Markdown
apache-2.0
173
# Audouinella violacea (Kützing) Hamel SPECIES #### Status SYNONYM #### According to The Catalogue of Life, 3rd January 2011 #### Published in null #### Original name null ### Remarks null
mdoering/backbone
life/Plantae/Rhodophyta/Florideophyceae/Acrochaetiales/Acrochaetiaceae/Audouinella/Audouinella hermannii/ Syn. Audouinella violacea/README.md
Markdown
apache-2.0
194
# Isothecium subdiversiforme subsp. subdiversiforme SUBSPECIES #### Status ACCEPTED #### According to NUB Generator [autonym] #### Published in null #### Original name null ### Remarks null
mdoering/backbone
life/Plantae/Bryophyta/Bryopsida/Hypnales/Brachytheciaceae/Isothecium/Isothecium subdiversiforme/Isothecium subdiversiforme subdiversiforme/README.md
Markdown
apache-2.0
194
# Daphne tinctoria Wikstr. SPECIES #### Status ACCEPTED #### According to International Plant Names Index #### Published in null #### Original name null ### Remarks null
mdoering/backbone
life/Plantae/Magnoliophyta/Magnoliopsida/Malvales/Thymelaeaceae/Daphne/Daphne tinctoria/README.md
Markdown
apache-2.0
174
# Exothostemon G.Don GENUS #### Status ACCEPTED #### According to International Plant Names Index #### Published in null #### Original name null ### Remarks null
mdoering/backbone
life/Plantae/Magnoliophyta/Magnoliopsida/Gentianales/Apocynaceae/Exothostemon/README.md
Markdown
apache-2.0
166
# Cattleya irrorata (Rchb.f.) J.M.H.Shaw SPECIES #### Status ACCEPTED #### According to The Catalogue of Life, 3rd January 2011 #### Published in null #### Original name Laelia irrorata Rchb.f. ### Remarks null
mdoering/backbone
life/Plantae/Magnoliophyta/Liliopsida/Asparagales/Orchidaceae/Cattleya/Cattleya irrorata/README.md
Markdown
apache-2.0
215
# Leucothoe D. Don, 1834 GENUS #### Status ACCEPTED #### According to The Catalogue of Life, 3rd January 2011 #### Published in null #### Original name null ### Remarks null
mdoering/backbone
life/Plantae/Magnoliophyta/Magnoliopsida/Ericales/Ericaceae/Leucothoe/README.md
Markdown
apache-2.0
178
# Zilla myagrum Forssk. SPECIES #### Status ACCEPTED #### According to International Plant Names Index #### Published in null #### Original name null ### Remarks null
mdoering/backbone
life/Plantae/Magnoliophyta/Magnoliopsida/Brassicales/Brassicaceae/Zilla/Zilla myagrum/README.md
Markdown
apache-2.0
171
# Crumenaria polygaloides var. paraguariensis Hassl. VARIETY #### Status ACCEPTED #### According to International Plant Names Index #### Published in null #### Original name null ### Remarks null
mdoering/backbone
life/Plantae/Magnoliophyta/Magnoliopsida/Rosales/Rhamnaceae/Crumenaria/Crumenaria polygaloides/Crumenaria polygaloides paraguariensis/README.md
Markdown
apache-2.0
200
# Fucus vesiculosus var. subecostatus C. Agardh VARIETY #### Status SYNONYM #### According to The Catalogue of Life, 3rd January 2011 #### Published in null #### Original name null ### Remarks null
mdoering/backbone
life/Chromista/Ochrophyta/Phaeophyceae/Fucales/Fucaceae/Fucus/Fucus vesiculosus/ Syn. Fucus vesiculosus subecostatus/README.md
Markdown
apache-2.0
202
# Polyporus ornithorhynchi Kalchbr. SPECIES #### Status ACCEPTED #### According to Index Fungorum #### Published in Grevillea 10(no. 55): 96 (1882) #### Original name Polyporus ornithorhynchi Kalchbr. ### Remarks null
mdoering/backbone
life/Fungi/Basidiomycota/Agaricomycetes/Polyporales/Polyporaceae/Polyporus/Polyporus ornithorhynchi/README.md
Markdown
apache-2.0
222
# Dysoxylum alliaceum Seem. SPECIES #### Status ACCEPTED #### According to International Plant Names Index #### Published in null #### Original name null ### Remarks null
mdoering/backbone
life/Plantae/Magnoliophyta/Magnoliopsida/Sapindales/Meliaceae/Dysoxylum/Dysoxylum alliaceum/README.md
Markdown
apache-2.0
175
# Hibiscaceae J. Agardh FAMILY #### Status SYNONYM #### According to GRIN Taxonomy for Plants #### Published in null #### Original name null ### Remarks null
mdoering/backbone
life/Plantae/Magnoliophyta/Magnoliopsida/Malvales/Malvaceae/ Syn. Hibiscaceae/README.md
Markdown
apache-2.0
162
/** * SIX OVAL - https://nakamura5akihito.github.io/ * Copyright (C) 2010 Akihito Nakamura * * 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.opensec.six.oval.model.ios; import io.opensec.six.oval.model.ComponentType; import io.opensec.six.oval.model.ElementRef; import io.opensec.six.oval.model.Family; import io.opensec.six.oval.model.definitions.SystemObjectType; import java.util.Collection; import java.util.Collections; /** * The snmp object is used by a snmp test to define those objects to evaluated * based on a specified state. * * @author Akihito Nakamura, AIST * @see <a href="http://oval.mitre.org/language/">OVAL Language</a> */ public class SnmpObject extends SystemObjectType { /** * Constructor. */ public SnmpObject() { this( null, 0 ); } public SnmpObject( final String id, final int version ) { super( id, version ); _oval_family = Family.IOS; _oval_component = ComponentType.SNMP; } //********************************************************************* // DefinitionsElement //********************************************************************* @Override public Collection<ElementRef> ovalGetElementRef() { Collection<ElementRef> ref_list = Collections.emptyList(); return ref_list; } //************************************************************** // java.lang.Object //************************************************************** @Override public int hashCode() { return super.hashCode(); } @Override public boolean equals( final Object obj ) { if (!(obj instanceof SnmpObject)) { return false; } return super.equals( obj ); } @Override public String toString() { return "snmp_object[" + super.toString() + "]"; } } //
nakamura5akihito/six-oval
src/main/java/io/opensec/six/oval/model/ios/SnmpObject.java
Java
apache-2.0
2,538
# Trichoglottis zollingeriana (Kraenzl.) J.J.Sm. SPECIES #### Status ACCEPTED #### According to The Catalogue of Life, 3rd January 2011 #### Published in null #### Original name null ### Remarks null
mdoering/backbone
life/Plantae/Magnoliophyta/Liliopsida/Asparagales/Orchidaceae/Trichoglottis/Trichoglottis zollingeriana/README.md
Markdown
apache-2.0
204
/* * Copyright 2010 MIT Strategic Engineering Research Group * * 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 edu.mit.spacenet.gui.demand; import java.awt.Cursor; import java.awt.Dimension; import java.awt.GridBagConstraints; import java.awt.GridBagLayout; import java.awt.Insets; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.ItemEvent; import java.awt.event.ItemListener; import java.awt.event.KeyAdapter; import java.awt.event.KeyEvent; import java.io.BufferedWriter; import java.io.File; import java.io.FileWriter; import java.io.IOException; import java.util.Hashtable; import javax.swing.BorderFactory; import javax.swing.BoxLayout; import javax.swing.ImageIcon; import javax.swing.JButton; import javax.swing.JCheckBox; import javax.swing.JComboBox; import javax.swing.JFileChooser; import javax.swing.JLabel; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.JSlider; import javax.swing.JSplitPane; import javax.swing.JTabbedPane; import javax.swing.JTextField; import javax.swing.SwingWorker; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import edu.mit.spacenet.domain.resource.Demand; import edu.mit.spacenet.gui.ScenarioPanel; import edu.mit.spacenet.gui.SpaceNetFrame; import edu.mit.spacenet.gui.SpaceNetSettings; import edu.mit.spacenet.scenario.ItemDiscretization; import edu.mit.spacenet.scenario.Scenario; import edu.mit.spacenet.scenario.SupplyEdge; import edu.mit.spacenet.scenario.SupplyEdge.SupplyPoint; import edu.mit.spacenet.simulator.DemandSimulator; import edu.mit.spacenet.simulator.SimDemand; /** * Component for viewing and editing the demands associated with a scenario. * * @author Paul Grogan */ public class DemandsTab extends JSplitPane { private static final long serialVersionUID = 1065899429343403823L; private static String RAW_DEMANDS = "Raw Demands"; private static String AGGREGATED_DEMANDS = "Aggregated Demands"; private static String ID_OUTPUT = "Object IDs"; private static String NAME_OUTPUT = "Object Names"; private static String COMMA_DELIMITED = "Comma Delimited"; private static String SEMICOLON_DELIMITED = "Semicolon Delimited"; private static String TAB_DELIMITED = "Tab Delimited"; private JPanel controlPanel; private JComboBox discretizationCombo; private JSlider aggregationSlider; private JCheckBox scavengeSparesCheck, packingDemandsCheck, demandsSatisfiedCheck; private JTextField directoryPathText, fileNameText; private JCheckBox overwriteCheck; private JButton browseButton, exportButton; private JComboBox demandsCombo, referenceCombo, delimiterCombo; private JFileChooser directoryChooser; private ExportWorker exportWorker; private JTabbedPane tabbedPane; private ScenarioFeasibilityTab feasibilityTab; private SupplyNetworkTab networkTab; private ElementDemandsTab elementDemandsTab; private MissionDemandsTab missionDemandTab; private LocationDemandsTab locationDemandTab; private CommonalityTab commonalityTab; private RepairabilityTab repairabilityTab; private ScenarioPanel scenarioPanel; private DemandSimulator simulator; private SimWorker simWorker; /** * The constructor. * * @param scenarioPanel the scenario panel */ public DemandsTab(ScenarioPanel scenarioPanel) { this.scenarioPanel = scenarioPanel; controlPanel = new JPanel(); controlPanel.setBorder(BorderFactory.createEmptyBorder(5,5,5,5)); controlPanel.setLayout(new GridBagLayout()); GridBagConstraints c = new GridBagConstraints(); c.gridx = 0; c.gridy = 0; c.fill = GridBagConstraints.HORIZONTAL; c.anchor = GridBagConstraints.CENTER; c.weightx = 1; controlPanel.add(buildOptionsPanel(), c); c.gridy++; controlPanel.add(buildDisplayPanel(), c); c.gridy++; controlPanel.add(buildExportPanel(), c); c.gridy++; c.weighty = 1; controlPanel.add(new JPanel(), c); setLeftComponent(new JScrollPane(controlPanel)); tabbedPane = new JTabbedPane(); networkTab = new SupplyNetworkTab(this); tabbedPane.add(networkTab); feasibilityTab = new ScenarioFeasibilityTab(this); tabbedPane.add(feasibilityTab); elementDemandsTab = new ElementDemandsTab(this); tabbedPane.add(elementDemandsTab); missionDemandTab = new MissionDemandsTab(this); tabbedPane.add(missionDemandTab); locationDemandTab = new LocationDemandsTab(this); tabbedPane.add(locationDemandTab); commonalityTab = new CommonalityTab(this); tabbedPane.add(commonalityTab); repairabilityTab = new RepairabilityTab(this); tabbedPane.add(repairabilityTab); tabbedPane.addChangeListener(new ChangeListener() { public void stateChanged(ChangeEvent e) { updateTab(); } }); setRightComponent(tabbedPane); setResizeWeight(.1); setDividerLocation(250); setBorder(BorderFactory.createEmptyBorder()); } /** * Initializes the demands tab. */ public void initialize() { discretizationCombo.setEnabled(getScenario()!=null); aggregationSlider.setEnabled(getScenario()!=null); scavengeSparesCheck.setEnabled(getScenario()!=null); packingDemandsCheck.setEnabled(getScenario()!=null); browseButton.setEnabled(getScenario()!=null); fileNameText.setEnabled(getScenario()!=null); demandsCombo.setEnabled(getScenario()!=null); referenceCombo.setEnabled(getScenario()!=null); delimiterCombo.setEnabled(getScenario()!=null); if(getScenario()!=null) { discretizationCombo.setSelectedItem(getScenario().getItemDiscretization()); aggregationSlider.setValue((int)(getScenario().getItemAggregation()*4)); aggregationSlider.setEnabled(getScenario().getItemDiscretization()!=ItemDiscretization.NONE); scavengeSparesCheck.setSelected(getScenario().isScavengeSpares()); fileNameText.setText("demands.txt"); //TODO: this is a hack, simulator should be initialized, not re-created simulator = new DemandSimulator(getScenario()); simulator.setDemandsSatisfied(false); packingDemandsCheck.setSelected(simulator.isPackingDemandsAdded()); demandsSatisfiedCheck.setSelected(simulator.isDemandsSatisfied()); simWorker = new SimWorker(true); simWorker.execute(); } } /** * Builds the options panel, used for accessing scenario options. * * @return the options panel */ private JPanel buildOptionsPanel() { JPanel optionsPanel = new JPanel(); optionsPanel.setBorder(BorderFactory.createTitledBorder("Demand Options")); optionsPanel.setLayout(new GridBagLayout()); GridBagConstraints c = new GridBagConstraints(); c.insets = new Insets(2,2,2,2); c.anchor = GridBagConstraints.LINE_END; c.fill = GridBagConstraints.NONE; c.gridx = 0; c.gridy = 0; c.weighty = 0; c.weightx = 0; optionsPanel.add(new JLabel("Item Discretization by: "), c); c.gridy++; c.anchor = GridBagConstraints.FIRST_LINE_END; optionsPanel.add(new JLabel("Item Aggregation at: "), c); c.gridy = 0; c.gridx++; c.weightx = 1; c.anchor = GridBagConstraints.LINE_START; c.fill = GridBagConstraints.BOTH; discretizationCombo = new JComboBox(); discretizationCombo.setToolTipText("Discretize demands for items to integer values at the selected level"); for(ItemDiscretization t : ItemDiscretization.values()) { discretizationCombo.addItem(t); } discretizationCombo.addItemListener(new ItemListener() { public void itemStateChanged(ItemEvent e) { if(!discretizationCombo.getSelectedItem().equals(getScenario().getItemDiscretization())) { getScenario().setItemDiscretization((ItemDiscretization)discretizationCombo.getSelectedItem()); aggregationSlider.setEnabled(getScenario().getItemDiscretization()!=ItemDiscretization.NONE); updateView(); } } }); optionsPanel.add(discretizationCombo, c); c.gridy++; aggregationSlider = new JSlider(JSlider.VERTICAL, 0,4,1); aggregationSlider.setToolTipText("Aggregate discretized item demands ahead or behind demands."); Hashtable<Integer, JLabel> labelTable = new Hashtable<Integer, JLabel>(); labelTable.put(new Integer(0), new JLabel("First Demand", JLabel.LEFT)); labelTable.put(new Integer(2), new JLabel("Half Demand", JLabel.LEFT)); labelTable.put(new Integer(4), new JLabel("Unit Demand", JLabel.RIGHT)); aggregationSlider.setLabelTable(labelTable); aggregationSlider.setPaintLabels(true); aggregationSlider.setMajorTickSpacing(1); aggregationSlider.setSnapToTicks(true); aggregationSlider.setPaintTicks(true); aggregationSlider.addChangeListener(new ChangeListener() { public void stateChanged(ChangeEvent e) { if(!aggregationSlider.getValueIsAdjusting() && aggregationSlider.getValue()/4d!= getScenario().getItemAggregation()) { getScenario().setItemAggregation(aggregationSlider.getValue()/4d); updateView(); } } }); aggregationSlider.setPreferredSize(new Dimension(50,100)); optionsPanel.add(aggregationSlider, c); c.gridy++; c.gridx = 0; c.gridwidth = 2; c.anchor = GridBagConstraints.LINE_START; c.fill = GridBagConstraints.BOTH; scavengeSparesCheck = new JCheckBox("Scavenge Spares"); scavengeSparesCheck.setToolTipText("Scavenge spare parts from co-located decommissioned elements"); scavengeSparesCheck.addItemListener(new ItemListener() { public void itemStateChanged(ItemEvent e) { if(scavengeSparesCheck.isSelected()!=getScenario().isScavengeSpares()) { getScenario().setScavengeSpares(scavengeSparesCheck.isSelected()); updateView(); } } }); optionsPanel.add(scavengeSparesCheck, c); return optionsPanel; } /** * Builds the display panel, used for controlling the display options. * * @return the display panel */ private JPanel buildDisplayPanel() { JPanel displayPanel = new JPanel(); displayPanel.setLayout(new BoxLayout(displayPanel, BoxLayout.PAGE_AXIS)); displayPanel.setBorder(BorderFactory.createTitledBorder("Display Options")); packingDemandsCheck = new JCheckBox("Estimate Logistics Container Masses"); packingDemandsCheck.setToolTipText("Estimate mass (Generic COS 5) for containers using resource packing factors."); packingDemandsCheck.addItemListener(new ItemListener() { public void itemStateChanged(ItemEvent e) { if(packingDemandsCheck.isSelected()!=simulator.isPackingDemandsAdded()) { simulator.setPackingDemandsAdded(e.getStateChange()==ItemEvent.SELECTED); updateView(); } } }); displayPanel.add(packingDemandsCheck); demandsSatisfiedCheck = new JCheckBox("Consume Existing Resources"); demandsSatisfiedCheck.setToolTipText("Consume existing resources when demanded."); demandsSatisfiedCheck.addItemListener(new ItemListener() { public void itemStateChanged(ItemEvent e) { if(demandsSatisfiedCheck.isSelected()!=simulator.isDemandsSatisfied()) { simulator.setDemandsSatisfied(e.getStateChange()==ItemEvent.SELECTED); updateView(); } } }); displayPanel.add(demandsSatisfiedCheck); return displayPanel; } private JPanel buildExportPanel() { directoryChooser = new JFileChooser(); directoryChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); JPanel exportPanel = new JPanel(); exportPanel.setBorder(BorderFactory.createTitledBorder("Export Demands")); exportPanel.setLayout(new GridBagLayout()); GridBagConstraints c = new GridBagConstraints(); c.gridx = 0; c.gridy = 0; c.insets = new Insets(2,2,2,2); c.anchor = GridBagConstraints.LINE_END; c.fill = GridBagConstraints.NONE; exportPanel.add(new JLabel("Directory: "), c); c.gridy++; exportPanel.add(new JLabel("File Name: "), c); c.gridy+=2; exportPanel.add(new JLabel("Demands: "), c); c.gridy++; exportPanel.add(new JLabel("Output: "), c); c.gridy++; exportPanel.add(new JLabel("Delimiter: "), c); c.gridy = 0; c.gridx++; c.weightx = 1; c.anchor = GridBagConstraints.LINE_START; c.fill = GridBagConstraints.HORIZONTAL; directoryPathText = new JTextField(); directoryPathText.setEnabled(false); exportPanel.add(directoryPathText, c); c.anchor = GridBagConstraints.LINE_END; c.fill = GridBagConstraints.NONE; c.gridx++; c.weightx = 0; browseButton = new JButton(new ImageIcon(getClass().getClassLoader().getResource("icons/folder_explore.png"))); browseButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { if(directoryPathText.getText()=="") { directoryChooser.setCurrentDirectory( new File(SpaceNetSettings.getInstance().getDefaultDirectory())); } int returnVal = directoryChooser.showOpenDialog(getThis()); if(returnVal == JFileChooser.APPROVE_OPTION) { directoryPathText.setText(directoryChooser.getSelectedFile().getAbsolutePath()); } exportButton.setEnabled(directoryPathText.getText()!="" && fileNameText.getText()!=""); } }); exportPanel.add(browseButton, c); c.gridy++; c.gridx--; c.gridwidth = 2; c.weightx = 1; c.anchor = GridBagConstraints.LINE_START; c.fill = GridBagConstraints.HORIZONTAL; fileNameText = new JTextField(15); fileNameText.addKeyListener(new KeyAdapter() { public void keyTyped(KeyEvent e) { exportButton.setEnabled(directoryPathText.getText()!="" && fileNameText.getText()!=""); } }); exportPanel.add(fileNameText, c); c.gridy++; overwriteCheck = new JCheckBox("Overwrite existing files", false); exportPanel.add(overwriteCheck, c); c.gridy++; demandsCombo = new JComboBox(); demandsCombo.addItem(RAW_DEMANDS); demandsCombo.addItem(AGGREGATED_DEMANDS); exportPanel.add(demandsCombo, c); c.gridy++; referenceCombo = new JComboBox(); referenceCombo.addItem(ID_OUTPUT); referenceCombo.addItem(NAME_OUTPUT); exportPanel.add(referenceCombo, c); c.gridy++; delimiterCombo = new JComboBox(); delimiterCombo.addItem(TAB_DELIMITED); delimiterCombo.addItem(COMMA_DELIMITED); delimiterCombo.addItem(SEMICOLON_DELIMITED); exportPanel.add(delimiterCombo, c); c.gridy++; c.anchor = GridBagConstraints.LINE_END; c.fill = GridBagConstraints.NONE; exportButton = new JButton("Export", new ImageIcon(getClass().getClassLoader().getResource("icons/page_white_edit.png"))); exportButton.setEnabled(false); exportButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { exportDemands(); } }); exportPanel.add(exportButton, c); return exportPanel; } /** * Gets the scenario panel component. * * @return the scenario panel */ public ScenarioPanel getScenarioPanel() { return scenarioPanel; } /** * Gets this. * * @return this */ private DemandsTab getThis() { return this; } /** * Gets the scenario. * * @return the scenario */ public Scenario getScenario() { return scenarioPanel.getScenario(); } /** * Gets the demand simulator. * * @return the demand simulator */ public DemandSimulator getSimulator() { return simulator; } /** * A SwingWorker subclass that manages the time-intensive simulation in a * separate thread. */ private class SimWorker extends SwingWorker<Void, Void> { private boolean isInitialization; /** * Instantiates a new sim worker. * * @param isInitialization the is initialization */ public SimWorker(boolean isInitialization) { this.isInitialization = isInitialization; } /** * Instantiates a new sim worker. */ public SimWorker() { this(false); } /* (non-Javadoc) * @see org.jdesktop.swingworker.SwingWorker#doInBackground() */ public Void doInBackground() { try { SpaceNetFrame.getInstance().getStatusBar().setStatusMessage("Simulating Demands..."); scenarioPanel.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); simulator.simulate(); scenarioPanel.setCursor(Cursor.getDefaultCursor()); SpaceNetFrame.getInstance().getStatusBar().clearStatusMessage(); } catch(Exception ex) { ex.printStackTrace(); } return null; } /* (non-Javadoc) * @see org.jdesktop.swingworker.SwingWorker#done() */ public void done() { // update tab only after simulation has completed if(isInitialization) { feasibilityTab.initialize(); networkTab.initialize(); elementDemandsTab.initialize(); missionDemandTab.initialize(); locationDemandTab.initialize(); commonalityTab.initialize(); repairabilityTab.initialize(); } else { updateTab(); } } } /** * Export demands. */ private void exportDemands() { while(exportWorker != null && !exportWorker.isDone() && simWorker != null && !simWorker.isDone()) { // wait until previous simulation and export is complete } exportWorker = new ExportWorker(); exportWorker.execute(); } /** * Write file. */ private void writeFile() { String filePath = directoryPathText.getText() + System.getProperty("file.separator") + fileNameText.getText(); char delimiter = ','; if(delimiterCombo.getSelectedItem()==COMMA_DELIMITED) { delimiter = ','; } else if(delimiterCombo.getSelectedItem()==SEMICOLON_DELIMITED) { delimiter = ';'; } else if(delimiterCombo.getSelectedItem()==TAB_DELIMITED) { delimiter = '\t'; } try { File file = new File(filePath); if(file.exists() && !overwriteCheck.isSelected()) { int answer = JOptionPane.showOptionDialog(getThis(), "Overwrite existing file " + fileNameText.getText() + "?", "SpaceNet Warning", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE, null, null, null); if (answer == JOptionPane.NO_OPTION) return; else overwriteCheck.setSelected(true); } BufferedWriter out = new BufferedWriter(new FileWriter(filePath)); if(demandsCombo.getSelectedItem()==RAW_DEMANDS) { out.write("Time" + delimiter + "Location" + delimiter + "Element" + delimiter + "Resource" + delimiter + "Amount" + System.getProperty("line.separator")); for(SimDemand simDemand : simulator.getUnsatisfiedDemands()) { for(Demand demand : simDemand.getDemands()) { if(referenceCombo.getSelectedItem()==ID_OUTPUT) { out.write("" + simDemand.getTime()); out.write(delimiter); out.write("" + simDemand.getLocation().getTid()); out.write(delimiter); if(simDemand.getElement()!=null) { out.write("" + simDemand.getElement().getUid()); } out.write(delimiter); out.write("" + demand.getResource().getTid()); out.write(delimiter); out.write("" + demand.getAmount()); } else if(referenceCombo.getSelectedItem()==NAME_OUTPUT) { out.write("" + simDemand.getTime()); out.write(delimiter); out.write(simDemand.getLocation().getName()); out.write(delimiter); if(simDemand.getElement()!=null) { out.write("" + simDemand.getElement().getName()); } out.write(delimiter); out.write(demand.getResource().getName()); out.write(delimiter); out.write("" + demand.getAmount()); } out.write(System.getProperty("line.separator")); } } } else if(demandsCombo.getSelectedItem()==AGGREGATED_DEMANDS) { out.write("Time1" + delimiter + "Time2" + delimiter + "Node1" + delimiter + "Node2" + delimiter + "Resource" + delimiter + "Amount" + System.getProperty("line.separator")); for(SupplyEdge supplyEdge : simulator.getSupplyEdges()) { for(Demand demand : simulator.getAggregatedEdgeDemands().get(supplyEdge)) { if(referenceCombo.getSelectedItem()==ID_OUTPUT) { out.write("" + supplyEdge.getStartTime()); out.write(delimiter); out.write("" + supplyEdge.getEndTime()); out.write(delimiter); out.write("" + supplyEdge.getOrigin().getTid()); out.write(delimiter); out.write("" + supplyEdge.getDestination().getTid()); out.write(delimiter); out.write("" + demand.getResource().getTid()); out.write(delimiter); out.write("" + demand.getAmount()); } else if(referenceCombo.getSelectedItem()==NAME_OUTPUT) { out.write("" + supplyEdge.getStartTime()); out.write(delimiter); out.write("" + supplyEdge.getEndTime()); out.write(delimiter); out.write(supplyEdge.getOrigin().getName()); out.write(delimiter); out.write(supplyEdge.getDestination().getName()); out.write(delimiter); out.write(demand.getResource().getName()); out.write(delimiter); out.write("" + demand.getAmount()); } out.write(System.getProperty("line.separator")); } SupplyPoint supplyPoint = supplyEdge.getPoint(); for(Demand demand : simulator.getAggregatedNodeDemands().get(supplyPoint)) { if(referenceCombo.getSelectedItem()==ID_OUTPUT) { out.write("" + supplyPoint.getNode().getTid()); out.write(delimiter); out.write(delimiter); out.write("" + supplyPoint.getTime()); out.write(delimiter); out.write(delimiter); out.write("" + demand.getResource().getTid()); out.write(delimiter); out.write("" + demand.getAmount()); } else if(referenceCombo.getSelectedItem()==NAME_OUTPUT) { out.write(supplyPoint.getNode().getName()); out.write(delimiter); out.write(delimiter); out.write("" + supplyPoint.getTime()); out.write(delimiter); out.write(delimiter); out.write(demand.getResource().getName()); out.write(delimiter); out.write("" + demand.getAmount()); } out.write(System.getProperty("line.separator")); } } } out.close(); } catch(IOException ex) { JOptionPane.showMessageDialog(this, "An error of type \"" + ex.getClass().getSimpleName() + "\" occurred while exporting the demands", "SpaceNet Error", JOptionPane.ERROR_MESSAGE); } } /** * The Class ExportWorker. */ private class ExportWorker extends SwingWorker<Void, Void> { /* (non-Javadoc) * @see org.jdesktop.swingworker.SwingWorker#doInBackground() */ protected Void doInBackground() { try { SpaceNetFrame.getInstance().getStatusBar().setStatusMessage("Exporting Demands..."); setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); writeFile(); setCursor(Cursor.getDefaultCursor()); SpaceNetFrame.getInstance().getStatusBar().clearStatusMessage(); } catch(Exception ex) { ex.printStackTrace(); } return null; } } /** * Requests that the component and any nested components update themselves. */ public void updateView() { discretizationCombo.setSelectedItem(getScenario().getItemDiscretization()); aggregationSlider.setValue((int)(getScenario().getItemAggregation()*4)); aggregationSlider.setEnabled(getScenario().getItemDiscretization()!=ItemDiscretization.NONE); scavengeSparesCheck.setSelected(getScenario().isScavengeSpares()); while(simWorker != null && !simWorker.isDone()) { // lock UI while previous simulation is running } simWorker = new SimWorker(); simWorker.execute(); } /** * Updates the currently-visible tab. */ private void updateTab() { if(tabbedPane.getSelectedComponent().equals(feasibilityTab)) { feasibilityTab.updateView(); } else if(tabbedPane.getSelectedComponent().equals(networkTab)) { networkTab.updateView(); } else if(tabbedPane.getSelectedComponent().equals(elementDemandsTab)) { elementDemandsTab.updateView(); } else if(tabbedPane.getSelectedComponent().equals(missionDemandTab)) { missionDemandTab.updateView(); } else if(tabbedPane.getSelectedComponent().equals(locationDemandTab)) { locationDemandTab.updateView(); } else if(tabbedPane.getSelectedComponent().equals(repairabilityTab)) { repairabilityTab.updateView(); } else if(tabbedPane.getSelectedComponent().equals(commonalityTab)) { commonalityTab.updateView(); } } }
ptgrogan/spacenet
src/main/java/edu/mit/spacenet/gui/demand/DemandsTab.java
Java
apache-2.0
24,371
"use strict"; function deprecated(message, helpPage) { if (typeof console !== "undefined" && typeof console.warn === "function") { console.warn("[DEPRECATED] " + message + build(helpPage)); } } function build(helpPage) { if (!helpPage) { return ""; } return ". Go to " + helpPage + " for full documentation."; } module.exports = deprecated;
zomaish/brisket
lib/util/deprecated.js
JavaScript
apache-2.0
381
package com.google.firebase.udacity.friendlychat; import android.app.Activity; import android.content.Context; import android.view.View; import android.view.ViewGroup; import android.widget.ArrayAdapter; import android.widget.ImageView; import android.widget.TextView; import com.bumptech.glide.Glide; import java.util.List; public class MessageAdapter extends ArrayAdapter<FriendlyMessage> { public MessageAdapter(Context context, int resource, List<FriendlyMessage> objects) { super(context, resource, objects); } @Override public View getView(int position, View convertView, ViewGroup parent) { if (convertView == null) { convertView = ((Activity) getContext()).getLayoutInflater().inflate(R.layout.item_message, parent, false); } ImageView photoImageView = (ImageView) convertView.findViewById(R.id.photoImageView); TextView messageTextView = (TextView) convertView.findViewById(R.id.messageTextView); TextView authorTextView = (TextView) convertView.findViewById(R.id.nameTextView); FriendlyMessage message = getItem(position); boolean isPhoto = message.getPhotoUrl() != null; if (isPhoto) { messageTextView.setVisibility(View.GONE); //View.GONE does not occupy any space if invisible . photoImageView.setVisibility(View.VISIBLE); Glide.with(photoImageView.getContext()) .load(message.getPhotoUrl()) .into(photoImageView); } else { messageTextView.setVisibility(View.VISIBLE); photoImageView.setVisibility(View.GONE); messageTextView.setText(message.getText()); } authorTextView.setText(message.getName()); return convertView; } }
Ashwin2692/Group-Chat-Application
app/src/main/java/com/google/firebase/udacity/friendlychat/MessageAdapter.java
Java
apache-2.0
1,794
<h3 class="title"><span>Daftar Konsumen</span></h3> <div class="container"> <div class="row"> <?= form_open('admin/list_konsumen') ?> <div class="col-md-3 form-group"> <input type="text" name="cari" class="form-control"> </div> <div class="col-md-1 form-group"> <input type="submit" name="btn_cari" value="Cari" class="btn btn-primary form-control"> </div> <?= form_close() ?> </div> <table class="table table-bordered table-hover" style="width:100%;" id="table_1"> <tr> <th>No</th> <th>Nama Konsumen</th> <th>Alamat</th> <th>Email</th> <th>No Telp</th> <th>Anak ( usia )</th> <th>Action</th> </tr> <?php $i = 0; foreach ($konsumen as $row): ?> <tr> <td><?= ++$i ?></td> <td><?= $row->nama ?></td> <td> <?= $row->alamat ?> </td> <td> <?= $row->email ?> </td> <td> <?= $row->no_telp ?> </td> <td> <?php $anak = json_decode($row->anak); for ($j=0; $j <count($anak); $j++) { echo $anak[$j]->nama ." : " . $anak[$j]->usia. " tahun"; echo "<br>"; } ?> </td> <td> <a href="<?= base_url('admin/detail_konsumen/'.$row->id_konsumen) ?>" class="btn btn-success">View</a> </td> </tr> <?php endforeach; ?> </table> </div>
azhry/adjproject
application/views/page/admin/list_customer.php
PHP
apache-2.0
1,265
.gearDate, .gearDatetime, .gearTime { font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: 10px; background-color: rgba(0, 0, 0, 0.2); display: block; position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 9900; overflow: hidden; -webkit-animation-fill-mode: both; animation-fill-mode: both } .date_ctrl { vertical-align: middle; background-color: white; color: #363837; margin: 0; height: auto; width: 100%; position: absolute; left: 0; bottom: 0; z-index: 9901; overflow: hidden; -webkit-transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0) } .slideInUp { animation: slideInUp .3s ease-in; -webkit-animation: slideInUp .3s ease-in } @-webkit-keyframes slideInUp { from { -webkit-transform: translate3d(0, 100%, 0); transform: translate3d(0, 100%, 0) } to { -webkit-transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0) } } .date_roll, .datetime_roll, .time_roll { display: -webkit-box; width: 100%; height: auto; overflow: hidden; font-weight: bold; background-color: transparent; -webkit-mask: -webkit-gradient(linear, 0% 50%, 0% 100%, from(#debb47), to(rgba(36, 142, 36, 0))); -webkit-mask: -webkit-linear-gradient(top, #debb47 50%, rgba(36, 142, 36, 0)) } .date_roll>div, .datetime_roll>div, .time_roll>div { font-size: 2.3em; height: 6em; float: left; background-color: transparent; position: relative; overflow: hidden; -webkit-box-flex: 4 } .date_roll_mask { -webkit-mask: -webkit-gradient(linear, 0% 40%, 0% 0%, from(#debb47), to(rgba(36, 142, 36, 0))); -webkit-mask: -webkit-linear-gradient(bottom, #debb47 50%, rgba(36, 142, 36, 0)); padding: 0 0 3em 0 } .date_roll>div:nth-child(2) { -webkit-box-flex: 2 } .date_roll>div:nth-child(1), .datetime_roll>div:nth-child(1) { -webkit-box-flex: 4 } .datetime_roll>div:first-child { -webkit-box-flex: 6 } .datetime_roll>div:last-child { -webkit-box-flex: 6 } .date_grid { position: relative; top: 2em; width: 100%; height: 2em; margin: 0; box-sizing: border-box; z-index: 0; border-top: 1px solid #e6e6e6; border-bottom: 1px solid #e6e6e6 } .date_grid>div { color: #000; position: absolute; right: 0; top: 0; font-size: .8em; line-height: 2.5em } .date_roll>div:nth-child(3) .date_grid>div { left: 42% } .datetime_roll>div .date_grid>div { right: 0 } .datetime_roll>div:first-child .date_grid>div { left: auto; right: 0% } .datetime_roll>div:last-child .date_grid>div { left: 50% } .time_roll>div:nth-child(1) .date_grid>div { right: 0.5em; /*border: 1px solid red;*/ } .time_roll>div .date_grid{ /*border: 1px solid black;*/ } .time_roll>div .date_grid>div { right:1em; /*border: 1px solid blue;*/ } .date_btn { color: #000; font-size: 1.6em; line-height: 1em; text-align: center; padding: .8em 1em; cursor: pointer } .date_btn_box { display: -webkit-box; -webkit-box-pack: justify; -webkit-box-align: stretch } .gear { float: left; position: absolute; z-index: 9902; width: 5.5em; margin-top: -6em } .date_roll>div .gear { width: 100% } .date_roll>div:nth-child(1) .gear { text-indent: 20% } .date_roll>div:nth-child(2) .gear { text-indent: -20% } .date_roll>div:nth-child(3) .gear { text-indent: -55% } .datetime_roll>div .gear { width: 100%; text-indent: -25% } .datetime_roll>div:first-child .gear { text-indent: -10% } .datetime_roll>div:last-child .gear { text-indent: -50% } .time_roll>div .gear { width: 100%; /*text-indent: -70%;*/ text-align: center; } .time_roll>div:nth-child(1) .gear { width: 100%; text-indent: 10% } .tooth { height: 2em; line-height: 2em; text-align: center }
ppyang010/layout
codingsnippet/08ICalendar/css/lCalendar.css
CSS
apache-2.0
3,648
<!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 --> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Uses of Class com.google.zxing.qrcode.QRCodeReader (ZXing 3.3.2 API)</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 Class com.google.zxing.qrcode.QRCodeReader (ZXing 3.3.2 API)"; } } catch(err) { } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar.top"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.top.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../com/google/zxing/qrcode/QRCodeReader.html" title="class in com.google.zxing.qrcode">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../package-tree.html">Tree</a></li> <li><a href="../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../index-all.html">Index</a></li> <li><a href="../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../index.html?com/google/zxing/qrcode/class-use/QRCodeReader.html" target="_top">Frames</a></li> <li><a href="QRCodeReader.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip.navbar.top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <div class="header"> <h2 title="Uses of Class com.google.zxing.qrcode.QRCodeReader" class="title">Uses of Class<br>com.google.zxing.qrcode.QRCodeReader</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="../../../../../com/google/zxing/qrcode/QRCodeReader.html" title="class in com.google.zxing.qrcode">QRCodeReader</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Package</th> <th class="colLast" scope="col">Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><a href="#com.google.zxing.multi.qrcode">com.google.zxing.multi.qrcode</a></td> <td class="colLast">&nbsp;</td> </tr> </tbody> </table> </li> <li class="blockList"> <ul class="blockList"> <li class="blockList"><a name="com.google.zxing.multi.qrcode"> <!-- --> </a> <h3>Uses of <a href="../../../../../com/google/zxing/qrcode/QRCodeReader.html" title="class in com.google.zxing.qrcode">QRCodeReader</a> in <a href="../../../../../com/google/zxing/multi/qrcode/package-summary.html">com.google.zxing.multi.qrcode</a></h3> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing subclasses, and an explanation"> <caption><span>Subclasses of <a href="../../../../../com/google/zxing/qrcode/QRCodeReader.html" title="class in com.google.zxing.qrcode">QRCodeReader</a> in <a href="../../../../../com/google/zxing/multi/qrcode/package-summary.html">com.google.zxing.multi.qrcode</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="../../../../../com/google/zxing/multi/qrcode/QRCodeMultiReader.html" title="class in com.google.zxing.multi.qrcode">QRCodeMultiReader</a></span></code> <div class="block">This implementation can detect and decode multiple QR Codes in an image.</div> </td> </tr> </tbody> </table> </li> </ul> </li> </ul> </div> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar.bottom"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.bottom.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../com/google/zxing/qrcode/QRCodeReader.html" title="class in com.google.zxing.qrcode">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../package-tree.html">Tree</a></li> <li><a href="../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../index-all.html">Index</a></li> <li><a href="../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../index.html?com/google/zxing/qrcode/class-use/QRCodeReader.html" target="_top">Frames</a></li> <li><a href="QRCodeReader.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip.navbar.bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> <p class="legalCopy"><small>Copyright &#169; 2007&#x2013;2018. All rights reserved.</small></p> </body> </html>
l-dobrev/zxing
docs/apidocs/com/google/zxing/qrcode/class-use/QRCodeReader.html
HTML
apache-2.0
6,511
/* * Copyright 2016 Google LLC. 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.cloud.tools.gradle.appengine.sourcecontext; import com.google.cloud.tools.appengine.operations.cloudsdk.CloudSdkNotFoundException; import com.google.cloud.tools.gradle.appengine.core.AppEngineCoreExtensionProperties; import com.google.cloud.tools.gradle.appengine.core.CloudSdkOperations; import com.google.cloud.tools.gradle.appengine.core.ToolsExtension; import com.google.cloud.tools.gradle.appengine.util.ExtensionUtil; import java.io.File; import org.gradle.api.GradleException; import org.gradle.api.Plugin; import org.gradle.api.Project; import org.gradle.api.plugins.ExtensionAware; import org.gradle.api.tasks.bundling.AbstractArchiveTask; import org.gradle.api.tasks.bundling.Jar; import org.gradle.api.tasks.bundling.War; /** Plugin for adding source context into App Engine project. */ public class SourceContextPlugin implements Plugin<Project> { private Project project; private GenRepoInfoFileExtension extension; private CloudSdkOperations cloudSdkOperations; public static final String SOURCE_CONTEXT_EXTENSION = "sourceContext"; @Override public void apply(Project project) { this.project = project; createExtension(); createSourceContextTask(); } private void createExtension() { // obtain extensions defined by core plugin. ExtensionAware appengine = new ExtensionUtil(project).get("appengine"); final ToolsExtension tools = ((AppEngineCoreExtensionProperties) appengine).getTools(); // create source context extension and set defaults extension = appengine .getExtensions() .create(SOURCE_CONTEXT_EXTENSION, GenRepoInfoFileExtension.class, project); extension.setOutputDirectory(new File(project.getBuildDir(), "sourceContext")); extension.setSourceDirectory(new File(project.getProjectDir(), "src")); // wait to read the cloudSdkHome till after project evaluation project.afterEvaluate( project -> { try { cloudSdkOperations = new CloudSdkOperations(tools.getCloudSdkHome(), null, tools.getVerbosity()); } catch (CloudSdkNotFoundException ex) { // this should be caught in AppEngineCorePluginConfig before it can ever reach here. throw new GradleException("Could not find CloudSDK: ", ex); } }); } private void createSourceContextTask() { project .getTasks() .create( "_createSourceContext", GenRepoInfoFileTask.class, genRepoInfoFile -> { genRepoInfoFile.setDescription("_internal"); project.afterEvaluate( project -> { genRepoInfoFile.setConfiguration(extension); genRepoInfoFile.setGcloud(cloudSdkOperations.getGcloud()); }); }); configureArchiveTask(project.getTasks().withType(War.class).findByName("war")); configureArchiveTask(project.getTasks().withType(Jar.class).findByName("jar")); } // inject source-context into the META-INF directory of a jar or war private void configureArchiveTask(AbstractArchiveTask archiveTask) { if (archiveTask == null) { return; } archiveTask.dependsOn("_createSourceContext"); archiveTask.from(extension.getOutputDirectory(), copySpec -> copySpec.into("WEB-INF/classes")); } }
GoogleCloudPlatform/app-gradle-plugin
src/main/java/com/google/cloud/tools/gradle/appengine/sourcecontext/SourceContextPlugin.java
Java
apache-2.0
4,002
package com.nimbusds.jose.crypto; import java.security.Signature; import java.security.InvalidKeyException; import java.security.SignatureException; import java.security.interfaces.RSAPrivateKey; import net.jcip.annotations.ThreadSafe; import com.nimbusds.jose.JOSEException; import com.nimbusds.jose.JWSSigner; import com.nimbusds.jose.ReadOnlyJWSHeader; import com.nimbusds.jose.util.Base64URL; /** * RSA Signature-Scheme-with-Appendix (RSASSA) signer of * {@link com.nimbusds.jose.JWSObject JWS objects}. This class is thread-safe. * * <p>Supports the following JSON Web Algorithms (JWAs): * * <ul> * <li>{@link com.nimbusds.jose.JWSAlgorithm#RS256} * <li>{@link com.nimbusds.jose.JWSAlgorithm#RS384} * <li>{@link com.nimbusds.jose.JWSAlgorithm#RS512} * </ul> * * @author Vladimir Dzhuvinov * @version $version$ (2012-10-23) */ @ThreadSafe public class RSASSASigner extends RSASSAProvider implements JWSSigner { /** * The private RSA key. */ private final RSAPrivateKey privateKey; /** * Creates a new RSA Signature-Scheme-with-Appendix (RSASSA) signer. * * @param privateKey The private RSA key. Must not be {@code null}. */ public RSASSASigner(final RSAPrivateKey privateKey) { if (privateKey == null) throw new IllegalArgumentException("The private RSA key must not be null"); this.privateKey = privateKey; } /** * Gets the private RSA key. * * @return The private RSA key. */ public RSAPrivateKey getPrivateKey() { return privateKey; } @Override public Base64URL sign(final ReadOnlyJWSHeader header, final byte[] signableContent) throws JOSEException { Signature signer = getRSASignerAndVerifier(header.getAlgorithm()); try { signer.initSign(privateKey); signer.update(signableContent); return Base64URL.encode(signer.sign()); } catch (InvalidKeyException e) { throw new JOSEException("Invalid private RSA key: " + e.getMessage(), e); } catch (SignatureException e) { throw new JOSEException("RSA signature exception: " + e.getMessage(), e); } } }
gesellix/Nimbus-JOSE-JWT
src/main/java/com/nimbusds/jose/crypto/RSASSASigner.java
Java
apache-2.0
2,097
/* * Copyright (c) 2016-present, RxJava Contributors. * * 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.reactivex.rxjava3.internal.operators.flowable; import java.util.Objects; import java.util.concurrent.atomic.*; import org.reactivestreams.Subscription; import io.reactivex.rxjava3.core.*; import io.reactivex.rxjava3.disposables.*; import io.reactivex.rxjava3.exceptions.Exceptions; import io.reactivex.rxjava3.functions.Function; import io.reactivex.rxjava3.internal.disposables.DisposableHelper; import io.reactivex.rxjava3.internal.fuseable.FuseToFlowable; import io.reactivex.rxjava3.internal.subscriptions.SubscriptionHelper; import io.reactivex.rxjava3.internal.util.AtomicThrowable; import io.reactivex.rxjava3.plugins.RxJavaPlugins; /** * Maps a sequence of values into CompletableSources and awaits their termination. * @param <T> the value type */ public final class FlowableFlatMapCompletableCompletable<T> extends Completable implements FuseToFlowable<T> { final Flowable<T> source; final Function<? super T, ? extends CompletableSource> mapper; final int maxConcurrency; final boolean delayErrors; public FlowableFlatMapCompletableCompletable(Flowable<T> source, Function<? super T, ? extends CompletableSource> mapper, boolean delayErrors, int maxConcurrency) { this.source = source; this.mapper = mapper; this.delayErrors = delayErrors; this.maxConcurrency = maxConcurrency; } @Override protected void subscribeActual(CompletableObserver observer) { source.subscribe(new FlatMapCompletableMainSubscriber<>(observer, mapper, delayErrors, maxConcurrency)); } @Override public Flowable<T> fuseToFlowable() { return RxJavaPlugins.onAssembly(new FlowableFlatMapCompletable<>(source, mapper, delayErrors, maxConcurrency)); } static final class FlatMapCompletableMainSubscriber<T> extends AtomicInteger implements FlowableSubscriber<T>, Disposable { private static final long serialVersionUID = 8443155186132538303L; final CompletableObserver downstream; final AtomicThrowable errors; final Function<? super T, ? extends CompletableSource> mapper; final boolean delayErrors; final CompositeDisposable set; final int maxConcurrency; Subscription upstream; volatile boolean disposed; FlatMapCompletableMainSubscriber(CompletableObserver observer, Function<? super T, ? extends CompletableSource> mapper, boolean delayErrors, int maxConcurrency) { this.downstream = observer; this.mapper = mapper; this.delayErrors = delayErrors; this.errors = new AtomicThrowable(); this.set = new CompositeDisposable(); this.maxConcurrency = maxConcurrency; this.lazySet(1); } @Override public void onSubscribe(Subscription s) { if (SubscriptionHelper.validate(this.upstream, s)) { this.upstream = s; downstream.onSubscribe(this); int m = maxConcurrency; if (m == Integer.MAX_VALUE) { s.request(Long.MAX_VALUE); } else { s.request(m); } } } @Override public void onNext(T value) { CompletableSource cs; try { cs = Objects.requireNonNull(mapper.apply(value), "The mapper returned a null CompletableSource"); } catch (Throwable ex) { Exceptions.throwIfFatal(ex); upstream.cancel(); onError(ex); return; } getAndIncrement(); InnerObserver inner = new InnerObserver(); if (!disposed && set.add(inner)) { cs.subscribe(inner); } } @Override public void onError(Throwable e) { if (errors.tryAddThrowableOrReport(e)) { if (delayErrors) { if (decrementAndGet() == 0) { errors.tryTerminateConsumer(downstream); } else { if (maxConcurrency != Integer.MAX_VALUE) { upstream.request(1); } } } else { disposed = true; upstream.cancel(); set.dispose(); errors.tryTerminateConsumer(downstream); } } } @Override public void onComplete() { if (decrementAndGet() == 0) { errors.tryTerminateConsumer(downstream); } else { if (maxConcurrency != Integer.MAX_VALUE) { upstream.request(1); } } } @Override public void dispose() { disposed = true; upstream.cancel(); set.dispose(); errors.tryTerminateAndReport(); } @Override public boolean isDisposed() { return set.isDisposed(); } void innerComplete(InnerObserver inner) { set.delete(inner); onComplete(); } void innerError(InnerObserver inner, Throwable e) { set.delete(inner); onError(e); } final class InnerObserver extends AtomicReference<Disposable> implements CompletableObserver, Disposable { private static final long serialVersionUID = 8606673141535671828L; @Override public void onSubscribe(Disposable d) { DisposableHelper.setOnce(this, d); } @Override public void onComplete() { innerComplete(this); } @Override public void onError(Throwable e) { innerError(this, e); } @Override public void dispose() { DisposableHelper.dispose(this); } @Override public boolean isDisposed() { return DisposableHelper.isDisposed(get()); } } } }
ReactiveX/RxJava
src/main/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableFlatMapCompletableCompletable.java
Java
apache-2.0
6,893
// This file is a part of the OpenSurgSim project. // Copyright 2013-2016, SimQuest Solutions 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. #include <gtest/gtest.h> #include "SurgSim/Collision/CollisionPair.h" #include "SurgSim/DataStructures/Location.h" #include "SurgSim/Math/Vector.h" #include "SurgSim/Physics/CcdCollisionLoop.h" #include "SurgSim/Physics/PushResults.h" #include "SurgSim/Physics/RigidCollisionRepresentation.h" #include "SurgSim/Physics/SolveMlcp.h" namespace SurgSim { namespace Physics { TEST(CcdCollisionLoopTest, Setters) { auto ccd = std::make_shared<CcdCollisionLoop>(false); std::unique_ptr<SolveMlcp> solveMlcp(new SolveMlcp(false)); ccd->setSolveMlcp(std::move(solveMlcp)); std::unique_ptr<PushResults> pushResults(new PushResults(false)); ccd->setPushResults(std::move(pushResults)); } TEST(CcdCollisionLoopTest, FilterContacts) { double toi = -1.0; auto rep1 = std::make_shared<RigidCollisionRepresentation>("One"); rep1->setSelfCollisionDetectionType(Collision::COLLISION_DETECTION_TYPE_CONTINUOUS); auto pair = std::make_shared<Collision::CollisionPair>(rep1, rep1); auto computation = std::make_shared<CcdCollisionLoop>(false); DataStructures::Location location; std::vector<std::shared_ptr<Collision::CollisionPair>> pairs(1, pair); EXPECT_FALSE(computation->findEarliestContact(pairs, &toi)); // Check that we find the toi correctly pair->addCcdContact(0.0, 0.1, Math::Vector3d::Zero(), Math::Vector3d::Zero(), std::make_pair(location, location)); EXPECT_TRUE(computation->findEarliestContact(pairs, &toi)); EXPECT_DOUBLE_EQ(0.1, toi); computation->filterLaterContacts(&pairs, 0.0, toi); EXPECT_EQ(1u, pair->getContacts().size()); pair->addCcdContact(0.0, 0.2, Math::Vector3d::Zero(), Math::Vector3d::Zero(), std::make_pair(location, location)); pair->addCcdContact(0.0, 0.3, Math::Vector3d::Zero(), Math::Vector3d::Zero(), std::make_pair(location, location)); // Check that we filter everything after the toi toi = 0.0; EXPECT_EQ(3u, pair->getContacts().size()); EXPECT_TRUE(computation->findEarliestContact(pairs, &toi)); computation->filterLaterContacts(&pairs, 0.0, toi); EXPECT_DOUBLE_EQ(0.1, toi); EXPECT_EQ(1u, pair->getContacts().size()); } TEST(CcdCollisionLoopTest, FilterContactsWithEpsilon) { double toi = -1.0; auto rep1 = std::make_shared<RigidCollisionRepresentation>("One"); rep1->setSelfCollisionDetectionType(Collision::COLLISION_DETECTION_TYPE_CONTINUOUS); auto pair = std::make_shared<Collision::CollisionPair>(rep1, rep1); auto computation = std::make_shared<CcdCollisionLoop>(false); DataStructures::Location location; std::vector<std::shared_ptr<Collision::CollisionPair>> pairs(1, pair); // Check that we find the toi correctly pair->addCcdContact(0.0, 0.1, Math::Vector3d::Zero(), Math::Vector3d::Zero(), std::make_pair(location, location)); pair->addCcdContact(0.0, 0.2, Math::Vector3d::Zero(), Math::Vector3d::Zero(), std::make_pair(location, location)); pair->addCcdContact(0.0, 0.3, Math::Vector3d::Zero(), Math::Vector3d::Zero(), std::make_pair(location, location)); EXPECT_TRUE(computation->findEarliestContact(pairs, &toi)); computation->filterLaterContacts(&pairs, 0.11, toi); // toi should be 0.1 + 0.11 i.e. toi + epsilon EXPECT_DOUBLE_EQ(0.1, toi); EXPECT_EQ(2u, pair->getContacts().size()); } } }
simquest/opensurgsim
SurgSim/Physics/UnitTests/CcdCollisionLoopTest.cpp
C++
apache-2.0
3,885
package com.doplgangr.secrecy.jobs; import com.doplgangr.secrecy.utils.Util; import com.path.android.jobqueue.Job; import com.path.android.jobqueue.Params; import org.apache.commons.io.FileUtils; import java.io.BufferedOutputStream; import java.io.File; import java.io.OutputStream; public class ShredFileJob extends Job { public static final int PRIORITY = 1; private OutputStream fileOs = null; private final long size; private final File file; public ShredFileJob(OutputStream os, long size, File file) { super(new Params(PRIORITY)); this.fileOs = os; this.size = size; this.file = file; } @Override public void onAdded() { } @Override public void onRun() throws Throwable { Util.log("Shredding, filesize",size); OutputStream os = new BufferedOutputStream(fileOs); try { for (int i = 0; i < size; i++) os.write(0); } finally { os.close(); } FileUtils.deleteQuietly(file); } @Override protected void onCancel() { // Final try, in case it is problem associated with output stream. FileUtils.deleteQuietly(file); } @Override protected boolean shouldReRunOnThrowable(Throwable throwable) { Util.log(throwable.getMessage()); return true; } @Override protected int getRetryLimit() { return 10; } }
SecrecySupportTeam/secrecy
app/src/main/java/com/doplgangr/secrecy/jobs/ShredFileJob.java
Java
apache-2.0
1,450
using System.Collections.Generic; using Gitlab.Ci.Models; namespace Gitlab.Ci.Impl { public class CiRunnerClient : ICiRunnerClient { private readonly API _api; public CiRunnerClient(API api) { _api = api; } public IEnumerable<CiRunner> Accessible { get { return _api.Get().GetAll<CiRunner>(CiRunner.Url); } } public IEnumerable<CiRunner> Owned { get { return _api.Get().GetAll<CiRunner>(CiRunner.Url + "/owned"); } } public IEnumerable<CiRunner> All { get { return _api.Get().GetAll<CiRunner>(CiRunner.Url + "/"); } } public CiRunner this[int id] { get { return _api.Get().To<CiRunner>(CiRunner.Url + "/" + id); } } // public CiRunner Create(CiRunnerCreate project) // { // return _api.Post().With(project).To<CiRunner>(CiRunner.Url + "/"); // } public CiRunner Delete(int id) { return _api.Delete().To<CiRunner>(CiRunner.Url + "/" + id); } } }
michaKFromParis/gitlab-ci.net
gitlab-ci.net/gitlab-ci.net/Impl/CiRunnerClient.cs
C#
apache-2.0
1,283
/************************************************************************** Copyright [2009] [CrypTool Team] This file is part of CrypTool. 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. **************************************************************************/ // RSAStereotypedMSGDlg.cpp : Implementierungsdatei // #include "stdafx.h" #include "CrypToolApp.h" #include "RSAStereotypedMSGDlg.h" #include "NTLExpPars.h" #include "FileTools.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // CRSAStereotypedMSGDlg Dialogfeld CRSAStereotypedMSGDlg::CRSAStereotypedMSGDlg(CWnd* pParent /*=NULL*/) : CDialog(CRSAStereotypedMSGDlg::IDD, pParent) { //{{AFX_DATA_INIT(CRSAStereotypedMSGDlg) m_baseOfCipher = 0; m_cipher = _T(""); m_bitsOfN = 0; m_h = 4; m_N = _T(""); m_e = _T(""); m_choice = 0; //}}AFX_DATA_INIT // Beachten Sie, dass LoadIcon unter Win32 keinen nachfolgenden DestroyIcon-Aufruf benötigt m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME); } void CRSAStereotypedMSGDlg::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(CRSAStereotypedMSGDlg) DDX_Control(pDX, IDC_SPINLENGTH, m_spinLengthControl); DDX_Control(pDX, IDC_SPINPOS, m_spinPosControl); DDX_Radio(pDX, IDC_RADIONUMBER, m_baseOfCipher); DDX_Text(pDX, IDC_EDITCIPHER, m_cipher); DDX_Text(pDX, IDC_EDITBITSOFN, m_bitsOfN); DDX_Text(pDX, IDC_EDITH, m_h); DDX_Text(pDX, IDC_EDITN, m_N); DDX_Text(pDX, IDC_EDITE, m_e); DDX_Radio(pDX, IDC_RADIOCHOICE, m_choice); //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(CRSAStereotypedMSGDlg, CDialog) //{{AFX_MSG_MAP(CRSAStereotypedMSGDlg) ON_WM_PAINT() ON_WM_QUERYDRAGICON() ON_EN_CHANGE(IDC_EDITPLAIN, OnChangeEditplain) ON_EN_CHANGE(IDC_EDITLENGTH, OnChangeEditlength) ON_EN_CHANGE(IDC_EDITPOS, OnChangeEditpos) ON_EN_CHANGE(IDC_EDITN, OnChangeEditn) ON_EN_CHANGE(IDC_EDITE, OnChangeEdite) ON_BN_CLICKED(IDC_BUTTONENCRYPT, OnButtonencrypt) ON_BN_CLICKED(IDC_RADIONUMBER, OnRadionumber) ON_BN_CLICKED(IDC_RADIOHEX, OnRadiohex) ON_EN_KILLFOCUS(IDC_EDITCIPHER, OnKillfocusEditcipher) ON_EN_CHANGE(IDC_EDITH, OnChangeEdith) ON_EN_UPDATE(IDC_EDITCIPHER, OnUpdateEditcipher) ON_BN_CLICKED(IDC_BUTTONSTART, OnButtonstart) ON_WM_TIMER() ON_BN_CLICKED(IDC_BUTTONCANCELATTACK, OnButtoncancelattack) ON_BN_CLICKED(IDC_RANDOM, OnRandom) ON_WM_SETCURSOR() ON_WM_CLOSE() ON_BN_CLICKED(IDC_BUTTONLOG, OnButtonlog) ON_BN_CLICKED(IDC_RADIOCHOICE, OnRadiochoice) ON_BN_CLICKED(IDC_BUTTONDELETE, OnButtondelete) ON_EN_CHANGE(IDC_EDITPLAINFULL, OnChangeEditplainfull) ON_EN_KILLFOCUS(IDC_EDITE, OnKillfocusEdite) ON_BN_CLICKED(IDC_RADIOCHOICE2, OnRadiochoice) ON_EN_KILLFOCUS(IDC_EDITN, OnKillfocusEditn) //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CRSAStereotypedMSGDlg Nachrichten-Handler BOOL CRSAStereotypedMSGDlg::OnInitDialog() { CDialog::OnInitDialog(); // Symbol für dieses Dialogfeld festlegen. Wird automatisch erledigt // wenn das Hauptfenster der Anwendung kein Dialogfeld ist SetIcon(m_hIcon, TRUE); // Großes Symbol verwenden SetIcon(m_hIcon, FALSE); // Kleines Symbol verwenden //OnRadiochoice(); // ZU ERLEDIGEN: Hier zusätzliche Initialisierung einfügen return TRUE; // Geben Sie TRUE zurück, außer ein Steuerelement soll den Fokus erhalten } // Wollen Sie Ihrem Dialogfeld eine Schaltfläche "Minimieren" hinzufügen, benötigen Sie // den nachstehenden Code, um das Symbol zu zeichnen. Für MFC-Anwendungen, die das // Dokument/Ansicht-Modell verwenden, wird dies automatisch für Sie erledigt. void CRSAStereotypedMSGDlg::OnPaint() { if (IsIconic()) { CPaintDC dc(this); // Gerätekontext für Zeichnen SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0); // Symbol in Client-Rechteck zentrieren int cxIcon = GetSystemMetrics(SM_CXICON); int cyIcon = GetSystemMetrics(SM_CYICON); CRect rect; GetClientRect(&rect); int x = (rect.Width() - cxIcon + 1) / 2; int y = (rect.Height() - cyIcon + 1) / 2; // Symbol zeichnen dc.DrawIcon(x, y, m_hIcon); } else { CDialog::OnPaint(); } } // Die Systemaufrufe fragen den Cursorform ab, die angezeigt werden soll, während der Benutzer // das zum Symbol verkleinerte Fenster mit der Maus zieht. HCURSOR CRSAStereotypedMSGDlg::OnQueryDragIcon() { return (HCURSOR) m_hIcon; } // When the plaintext is edited, the range of the spinbuttons must be // adjusted and the preview must be updated. void CRSAStereotypedMSGDlg::OnChangeEditplain() { updatePreview(); checkParameters(); } // This function gets called, when the preview has to be updated. // This is the case, when either of the parameters N, e, plaintext, // unknown position or unknown length changes. void CRSAStereotypedMSGDlg::updatePreview() { // Get the source information,... bool b=m_choice==0; CString tmp; GetDlgItemText(IDC_EDITPLAIN, tmp); int pos=GetDlgItemInt(IDC_EDITPOS); int length=GetDlgItemInt(IDC_EDITLENGTH); CString preview; // ...cut it apart at the right position... CString left=tmp.Left(pos); CString right=tmp.Right(tmp.GetLength()-pos); // ... and make it fit. if(left.GetLength()>25){ CString tmp="..."; left=left.Right(22); left=tmp+left; } if(right.GetLength()>25) right=right.Left(22)+"..."; // Put everything together again. preview=left; if(length>10) length=10; for(int i=0; i<length;i++) preview+="*"; preview+=right; SetDlgItemText(IDC_EDITPREVIEW, preview); } void CRSAStereotypedMSGDlg::OnChangeEditlength() { CString tmp; bool b=m_choice==0; GetDlgItemText(IDC_EDITPLAIN, tmp); int pos, length; pos=GetDlgItemInt(IDC_EDITPOS); length=GetDlgItemInt(IDC_EDITLENGTH); if(!b){ CString fullPlainText; GetDlgItemText(IDC_EDITPLAINFULL, fullPlainText); int fullLenght = fullPlainText.GetLength(); int maxLength = fullLenght; if(maxLength<length){ length=maxLength; SetDlgItemInt(IDC_EDITLENGTH,length); } int maxPos=fullLenght-length; if(maxPos<pos){ pos=maxPos; SetDlgItemInt(IDC_EDITPOS,pos); } fullPlainText.Delete(pos, length); SetDlgItemText(IDC_EDITPLAIN, fullPlainText); } updatePreview(); } void CRSAStereotypedMSGDlg::OnChangeEditpos() { CString tmp; bool b=m_choice==0; GetDlgItemText(IDC_EDITPLAIN, tmp); int pos, length; pos=GetDlgItemInt(IDC_EDITPOS); length=GetDlgItemInt(IDC_EDITLENGTH); if(!b){ CString fullPlainText; GetDlgItemText(IDC_EDITPLAINFULL, fullPlainText); int fullLenght = fullPlainText.GetLength(); int maxPos=fullLenght; if(maxPos<pos){ pos=maxPos; SetDlgItemInt(IDC_EDITPOS,pos); } int maxLength = fullLenght-pos; if(maxLength<length){ length=maxLength; SetDlgItemInt(IDC_EDITLENGTH,length); } fullPlainText.Delete(pos, length); SetDlgItemText(IDC_EDITPLAIN, fullPlainText); } updatePreview(); } void CRSAStereotypedMSGDlg::OnChangeEditn() { CheckEncryptButton(); checkParameters(); } // Check whether an encryption ist possible void CRSAStereotypedMSGDlg::CheckEncryptButton() { UpdateData(); ((CButton*)GetDlgItem(IDC_BUTTONENCRYPT))->EnableWindow(false); NTLExpPars myPars; ZZ N=myPars.parseExp(m_N); ZZ e=myPars.parseExp(m_e); if(N>0) if(e>0) ((CButton*)GetDlgItem(IDC_BUTTONENCRYPT))->EnableWindow(true); } // Reads the String from an edit and converts it to NTL's ZZ (big integer). ZZ CRSAStereotypedMSGDlg::GetDlgItemZZ(int ID, int base) { CString tmp; GetDlgItemText(ID,tmp); return setToStringValue(tmp,base); } void CRSAStereotypedMSGDlg::OnChangeEdite() { CheckEncryptButton(); checkParameters(); } // Simple RSA encryption: m^e mod N, no padding. void CRSAStereotypedMSGDlg::OnButtonencrypt() { UpdateData(); ZZ cipher; ZZ plain=GetDlgItemZZ(IDC_EDITPLAINFULL,256); NTLExpPars myPars; ZZ N=myPars.parseExp(m_N); ZZ e=myPars.parseExp(m_e); // if the plaintext is to long, RSA encryption // does not work. int maxChars=NumBits(N)/8; if(plain>N){ CString form, myTitle; this->GetWindowText(myTitle); form.Format(IDS_RSA_SM_MAXCHAR, maxChars); MessageBox(form, myTitle); } else{ cipher=PowerMod(plain, e, N); UpdateData(); if(m_baseOfCipher==0) SetDlgItemZZ(IDC_EDITCIPHER, cipher, 10,0); else SetDlgItemZZ(IDC_EDITCIPHER, cipher, 16,2); checkParameters(); } } // function to set write the value of a ZZ into an edit box. void CRSAStereotypedMSGDlg::SetDlgItemZZ(int ID, ZZ value, int base, int group) { SetDlgItemText(ID, toString(value, base, group)); } void CRSAStereotypedMSGDlg::OnRadionumber() { updateCipher(); } void CRSAStereotypedMSGDlg::OnRadiohex() { updateCipher(); } // This is caled, when the base of the cipertext is changed // or user leaves the textbox. It makes sure, the input is // valid and formatted void CRSAStereotypedMSGDlg::updateCipher() { int group=0; // determines the grouping of the figures int newbase=0; int oldbase = m_baseOfCipher; UpdateData(); if(oldbase==0) oldbase=10; else oldbase=16; if(m_baseOfCipher==0) newbase=10; else{ newbase=16; group=2; } m_cipher=toString(setToStringValue(m_cipher,oldbase),newbase,group); UpdateData(false); } void CRSAStereotypedMSGDlg::OnKillfocusEditcipher() { updateCipher(); } void CRSAStereotypedMSGDlg::OnChangeEdith() { checkParameters(); } // This function checks, whether all parameters for the attack // are right and enables or disables the start button. void CRSAStereotypedMSGDlg::checkParameters() { UpdateData(); ((CButton*)GetDlgItem(IDC_BUTTONSTART))->EnableWindow(false); StereotypedAttack sa; NTLExpPars myPars; sa.setN(myPars.parseExp(m_N)); sa.setE(myPars.parseExp(m_e)); sa.setH(GetDlgItemZZ(IDC_EDITH, 10)); int cbase; if(m_baseOfCipher==0) cbase=10; else cbase=16; if(sa.getBound()>0){ SetDlgItemZZ(IDC_EDITPOSLENGTH, to_ZZ(floor(log(sa.getBound())/log((double)256))),10,0); SetDlgItemInt(IDC_EDITDIM, GetDlgItemInt(IDC_EDITE)*GetDlgItemInt(IDC_EDITH)); if(GetDlgItemZZ(IDC_EDITPLAIN,256)>0&& GetDlgItemZZ(IDC_EDITCIPHER,cbase)>0) ((CButton*)GetDlgItem(IDC_BUTTONSTART))->EnableWindow(true); }else SetDlgItemInt(IDC_EDITPOSLENGTH, 0); } void CRSAStereotypedMSGDlg::OnUpdateEditcipher() { checkParameters(); } void CRSAStereotypedMSGDlg::OnButtonstart() { SetDlgItemText(IDC_EDITSOLUTION, ""); int cbase=10; int pos, length; if(m_baseOfCipher==1) cbase=16; CString tmp; GetDlgItemText(IDC_EDITPLAIN, tmp); if (power(GetDlgItemZZ(IDC_EDITPLAIN,256),GetDlgItemInt(IDC_EDITE)) // test, whether full plaintext known ==GetDlgItemZZ(IDC_EDITCIPHER,cbase)){ CString tmp, myTitle; tmp.LoadString(IDS_RSA_SM_FULLPLAIN); this->GetWindowText(myTitle); MessageBox(tmp,myTitle); } else { pos=GetDlgItemInt(IDC_EDITPOS); length=GetDlgItemInt(IDC_EDITLENGTH); int maxLength = GetDlgItemInt(IDC_EDITPOSLENGTH); if(length>maxLength){ CString tmp, myTitle; tmp.LoadString(IDS_RSA_SM_UNKNOWNTOOBIG); this->GetWindowText(myTitle); MessageBox(tmp,myTitle); } sa.setRightText(setToStringValue(tmp.Right(tmp.GetLength()-pos),256)); sa.setLeftText(setToStringValue(tmp.Left(pos),256)); sa.setUnknownLength(length); sa.setN(GetDlgItemZZ(IDC_EDITN,10)); sa.setE(GetDlgItemZZ(IDC_EDITE,10)); sa.setH(GetDlgItemZZ(IDC_EDITH,10)); sa.setCiphertext(GetDlgItemZZ(IDC_EDITCIPHER,cbase)); enableDisable(false); GetDlgItem(IDC_BUTTONCANCELATTACK)->EnableWindow(true); GetDlgItem(IDC_BUTTONSTART)->EnableWindow(false); SetTimer(1, 1000, 0); pThread = AfxBeginThread (thrFunction, this); } } void CRSAStereotypedMSGDlg::OnTimer(UINT nIDEvent) { // update and format overall elapsed time int elapsedTime=sa.getOverallTime(); CString timeStr; timeStr.Format("%3dh%3dm%3ds",elapsedTime/3600, (elapsedTime/60)%60,(elapsedTime)%60); SetDlgItemText(IDC_EDITOVERALLTIME,timeStr); if(sa.status>SA_CANCELED){ // attack still running // update information CString t; int bLT=sa.getLatticeTime(); t.Format("%3dh%3dm%3ds",bLT/3600,(bLT/60)%60,(bLT)%60); SetDlgItemText(IDC_EDITLATTICETIME,t); int rLT=sa.getReductionTime(); t.Format("%3dh%3dm%3ds",rLT/3600,(rLT/60)%60,(rLT)%60); SetDlgItemText(IDC_EDITREDUCETIME,t); SetDlgItemInt(IDC_EDITREDUCTIONS,sa.reductions); } if(sa.status==SA_SUCCESSFUL){// finished successfully KillTimer(1); CString res=toString(sa.getSolution(),256,0); CString full; GetDlgItemText(IDC_EDITPLAIN, full); full.Insert(GetDlgItemInt(IDC_EDITPOS),res); SetDlgItemText(IDC_EDITSOLUTION, res); SetDlgItemText(IDC_EDITPLAINFULL, full); CString tmp, myTitle; tmp.LoadString(IDS_RSA_SM_SUCCESS); this->GetWindowText(myTitle); MessageBox(tmp,myTitle); } if(sa.status==SA_FAILED){// finished without success KillTimer(1); CString tmp, myTitle; tmp.LoadString(IDS_RSA_SM_NOSUCCESS); this->GetWindowText(myTitle); MessageBox(tmp,myTitle); } if(sa.status==SA_CANCELED||sa.status>SA_REDUCING){ KillTimer(1); GetDlgItem(IDC_BUTTONSTART)->EnableWindow(true); GetDlgItem(IDC_BUTTONCANCELATTACK)->EnableWindow(false); enableDisable(true); SetCursor(LoadCursor(NULL, IDC_ARROW)); } CDialog::OnTimer(nIDEvent); } ////////////////////////////////////////////// // Function of the thread, calls the attack function of the // StereotypedAttack object. ////////////////////////////////////////////// UINT CRSAStereotypedMSGDlg::thrFunction (LPVOID pParam){ CRSAStereotypedMSGDlg* pDlg=(CRSAStereotypedMSGDlg*) pParam; pDlg->sa.attack(); return 0; } void CRSAStereotypedMSGDlg::OnButtoncancelattack() { // make sure cancel is not pushed twice GetDlgItem(IDC_BUTTONCANCELATTACK)->EnableWindow(false); if(sa.status!=0) // is the attack running? sa.cancel(); // wait until thread is really finished WaitForSingleObject(pThread->m_hThread, INFINITE); } void CRSAStereotypedMSGDlg::OnOK() { if(sa.status>SA_CANCELED&&sa.status<=SA_REDUCING){ sa.cancel(); WaitForSingleObject(pThread->m_hThread, INFINITE); } CDialog::OnCancel(); } void CRSAStereotypedMSGDlg::OnRandom() { if (UpdateData()){ if(m_bitsOfN<=10){ CString tmp, myTitle; tmp.LoadString(IDS_RSA_SM_WRONGN); this->GetWindowText(myTitle); MessageBox(tmp,myTitle); } else{ BeginWaitCursor(); int bitsOfQ=m_bitsOfN/2; int bitsOfP=(m_bitsOfN+1)/2; SetSeed(to_ZZ(GetTime()*10000)); ZZ p = GenPrime_ZZ(bitsOfP); // generate N, p and q ZZ q = GenPrime_ZZ(bitsOfQ); ZZ N = p*q; SetDlgItemText(IDC_EDITN,toString(N,10,0)); EndWaitCursor(); } } OnChangeEditplainfull(); } void CRSAStereotypedMSGDlg::enableDisable(bool b) { GetDlgItem(IDC_EDITN)->EnableWindow(b); GetDlgItem(IDC_EDITE)->EnableWindow(b); GetDlgItem(IDC_EDITPLAIN)->EnableWindow(b); GetDlgItem(IDC_EDITPLAINFULL)->EnableWindow(b); GetDlgItem(IDC_EDITCIPHER)->EnableWindow(b); GetDlgItem(IDC_EDITPOS)->EnableWindow(b); GetDlgItem(IDC_EDITLENGTH)->EnableWindow(b); GetDlgItem(IDC_SPINPOS)->EnableWindow(b); GetDlgItem(IDC_SPINLENGTH)->EnableWindow(b); GetDlgItem(IDC_EDITH)->EnableWindow(b); GetDlgItem(IDC_RADIONUMBER)->EnableWindow(b); GetDlgItem(IDC_RADIOHEX)->EnableWindow(b); GetDlgItem(IDC_EDITBITSOFN)->EnableWindow(b); GetDlgItem(IDC_BUTTONENCRYPT)->EnableWindow(b); GetDlgItem(IDC_BUTTONDELETE)->EnableWindow(b); GetDlgItem(IDC_RANDOM)->EnableWindow(b); } BOOL CRSAStereotypedMSGDlg::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message) { if(sa.status!=SA_CANCELED&&sa.status<=SA_REDUCING) SetCursor(LoadCursor(NULL, IDC_WAIT)); else SetCursor(LoadCursor(NULL, IDC_ARROW)); return TRUE; } void CRSAStereotypedMSGDlg::OnClose() { OnOK(); } void CRSAStereotypedMSGDlg::OnButtonlog() { char *filename = new char[CRYPTOOL_PATH_LENGTH]; GetTmpName(filename, "cry", ".txt"); ofstream Outfile; Outfile.open(filename); Outfile << sa.Log; Outfile.close(); CAppDocument *NewDoc = theApp.OpenDocumentFileNoMRU(filename); delete filename; } void CRSAStereotypedMSGDlg::OnRadiochoice() { UpdateData(); bool b=m_choice==0; ((CEdit*)GetDlgItem(IDC_EDITCIPHER))->SetReadOnly(!b); ((CEdit*)GetDlgItem(IDC_EDITPLAIN))->SetReadOnly(!b); ((CEdit*)GetDlgItem(IDC_EDITPLAINFULL))->SetReadOnly(b); SetDlgItemText(IDC_EDITCIPHER,""); SetDlgItemText(IDC_EDITPLAIN,""); SetDlgItemText(IDC_EDITPLAINFULL,""); SetDlgItemText(IDC_EDITPLAINLENGTH, ""); SetDlgItemText(IDC_EDITPOS,""); SetDlgItemText(IDC_EDITLENGTH,""); GetDlgItem(IDC_BUTTONENCRYPT)->ShowWindow(!b); GetDlgItem(IDC_BUTTONDELETE)->ShowWindow(!b); GetDlgItem(IDC_STATIC_ENTER_KNOWN)->ShowWindow(b); GetDlgItem(IDC_STATIC_SHOW_KNOWN)->ShowWindow(!b); GetDlgItem(IDC_STATIC_ENTER_POS)->ShowWindow(b); GetDlgItem(IDC_STATIC_HIGHLIGHT_POS)->ShowWindow(!b); GetDlgItem(IDC_EDITPLAINLENGTH)->ShowWindow(!b); GetDlgItem(IDC_PTLENGTH)->ShowWindow(!b); GetDlgItem(IDC_STATIC_PLAINTEXT)->ShowWindow(!b); GetDlgItem(IDC_EDITPLAINFULL)->ShowWindow(!b); GetDlgItem(IDC_BUTTONENCRYPT)->ShowWindow(!b); UpdateSliders(); } void CRSAStereotypedMSGDlg::OnButtondelete() { int start, end; ((CEdit*)GetDlgItem(IDC_EDITPLAINFULL))->GetSel(start, end); if(start+end==0){ CString tmp, myTitle; tmp.LoadString(IDS_RSA_SM_PLEASEHIGHLIGHT); this->GetWindowText(myTitle); MessageBox(tmp,myTitle); } else{ if(end-start==0){ CString tmp, myTitle; tmp.LoadString(IDS_RSA_SM_ALLKNOWN); this->GetWindowText(myTitle); MessageBox(tmp,myTitle); } CString incomplete; GetDlgItemText(IDC_EDITPLAINFULL, incomplete); incomplete.Delete(start, end-start); SetDlgItemText(IDC_EDITPLAIN,incomplete); SetDlgItemInt(IDC_EDITPOS, start); SetDlgItemInt(IDC_EDITLENGTH, end-start); checkParameters(); updatePreview(); } } void CRSAStereotypedMSGDlg::UpdateSliders(){ CString tmp; bool b=m_choice==0; GetDlgItemText(IDC_EDITPLAIN, tmp); int pos, length; pos=GetDlgItemInt(IDC_EDITPOS); length=GetDlgItemInt(IDC_EDITLENGTH); if(!b){ CString fullPlainText; GetDlgItemText(IDC_EDITPLAINFULL, fullPlainText); int fullLenght = fullPlainText.GetLength(); int maxPos=fullLenght; int maxLength = fullLenght; if(maxPos<pos){ pos=maxPos; SetDlgItemInt(IDC_EDITPOS,pos); } if(maxLength<length){ length=maxLength; SetDlgItemInt(IDC_EDITLENGTH,length); } (( CSpinButtonCtrl* )GetDlgItem( IDC_SPINPOS ))->SetRange(0,maxPos); (( CSpinButtonCtrl* )GetDlgItem( IDC_SPINLENGTH ))->SetRange(0,maxLength); //fullPlainText.Delete(pos, length); //SetDlgItemText(IDC_EDITPLAIN, fullPlainText); }else{ int knownlenght=tmp.GetLength(); m_spinLengthControl.SetRange32(0,32000); m_spinPosControl.SetRange32(0,knownlenght); } } void CRSAStereotypedMSGDlg::OnChangeEditplainfull() { ZZ plain=GetDlgItemZZ(IDC_EDITPLAINFULL,256); NTLExpPars myPars; ZZ N=myPars.parseExp(m_N); CString tmp; GetDlgItemText(IDC_EDITPLAINFULL,tmp); CString chars; ZZ MaxChars ; if(N>0) MaxChars = to_ZZ(floor(log(N+255)/log(256.0))); else MaxChars = 0; chars.Format("%d(%s)",tmp.GetLength(),toString(MaxChars,10,0)); SetDlgItemText(IDC_EDITPLAINLENGTH,chars); SetDlgItemText(IDC_EDITCIPHER,""); UpdateSliders(); updatePreview(); } void CRSAStereotypedMSGDlg::OnKillfocusEdite() { UpdateData(); NTLExpPars myPars; ZZ e=myPars.parseExp(m_e); m_e=toString(e,10,0); UpdateData(false); } void CRSAStereotypedMSGDlg::OnKillfocusEditn() { UpdateData(); NTLExpPars myPars; ZZ N=myPars.parseExp(m_N); m_N=toString(N,10,0); UpdateData(false); }
flomar/CrypTool-VS2015
trunk/CrypTool/rsastereotypedmsgdlg.cpp
C++
apache-2.0
19,992
package com.ganxin.doingdaily.common.widgets.rowview.text; import com.ganxin.doingdaily.common.widgets.rowview.base.BaseRowDescriptor; /** * Description : TextRowDescriptor <br/> * author : WangGanxin <br/> * date : 2017/1/13 <br/> * email : mail@wangganxin.me <br/> */ public class TextRowDescriptor extends BaseRowDescriptor { public String content; public boolean hasAction; public TextRowDescriptor(int rowId) { super(rowId); } public TextRowDescriptor content(String content) { this.content = content; return this; } public TextRowDescriptor hasAction(boolean hasAction) { this.hasAction = hasAction; return this; } }
WangGanxin/DoingDaily
app/src/main/java/com/ganxin/doingdaily/common/widgets/rowview/text/TextRowDescriptor.java
Java
apache-2.0
707
// // Copyright (c) Microsoft and contributors. 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. // // Warning: This code was generated by a tool. // // Changes to this file may cause incorrect behavior and will be lost if the // code is regenerated. using System; using System.Collections.Generic; using System.Linq; using Hyak.Common; namespace Microsoft.Azure.Management.Sql.Models { /// <summary> /// Represents the properties of an Azure SQL blob auditing policy. /// </summary> public partial class BlobAuditingProperties { private IList<string> _auditActionsAndGroups; /// <summary> /// Optional. Specifies the audit actions and groups. /// </summary> public IList<string> AuditActionsAndGroups { get { return this._auditActionsAndGroups; } set { this._auditActionsAndGroups = value; } } private int _retentionDays; /// <summary> /// Optional. Specifies the number of days to keep in the audit logs. /// </summary> public int RetentionDays { get { return this._retentionDays; } set { this._retentionDays = value; } } private string _state; /// <summary> /// Optional. Specifies the state of the policy. The acceptable values /// are Disabled and Enabled. /// </summary> public string State { get { return this._state; } set { this._state = value; } } private string _storageAccountAccessKey; /// <summary> /// Optional. Specifies the identifier key of the auditing storage /// account. /// </summary> public string StorageAccountAccessKey { get { return this._storageAccountAccessKey; } set { this._storageAccountAccessKey = value; } } private string _storageEndpoint; /// <summary> /// Optional. Specifies the blob storage endpoint (e.g. /// https://MyAccount.blob.core.windows.net). /// </summary> public string StorageEndpoint { get { return this._storageEndpoint; } set { this._storageEndpoint = value; } } /// <summary> /// Initializes a new instance of the BlobAuditingProperties class. /// </summary> public BlobAuditingProperties() { this.AuditActionsAndGroups = new LazyList<string>(); } } }
pomortaz/azure-sdk-for-net
src/ResourceManagement/Sql/SqlManagement/Generated/Models/BlobAuditingProperties.cs
C#
apache-2.0
3,144
package com.docker.rpc; public abstract class RPCResponse extends RPCBase { protected RPCRequest request; public RPCResponse(String type) { super(type); } public RPCRequest getRequest() { return request; } public void setRequest(RPCRequest request) { this.request = request; } }
dobybros/scriptcore
SDockerCore/src/com/docker/rpc/RPCResponse.java
Java
apache-2.0
297
# Geminocarpus austrogeorgiae Skottsberg SPECIES #### Status ACCEPTED #### According to The Catalogue of Life, 3rd January 2011 #### Published in null #### Original name null ### Remarks null
mdoering/backbone
life/Chromista/Ochrophyta/Phaeophyceae/Ectocarpales/Acinetosporaceae/Geminocarpus/Geminocarpus austrogeorgiae/README.md
Markdown
apache-2.0
196
/* * Licensed to The Apereo Foundation under one or more contributor license * agreements. See the NOTICE file distributed with this work for additional * information regarding copyright ownership. * * The Apereo Foundation 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.tle.web.api.taxonomy; import com.tle.annotation.NonNullByDefault; import com.tle.beans.taxonomy.TaxonomyBean; import com.tle.common.security.PrivilegeTree.Node; import com.tle.common.taxonomy.Taxonomy; import com.tle.core.entity.service.AbstractEntityService; import com.tle.core.guice.Bind; import com.tle.core.taxonomy.TaxonomyService; import com.tle.web.api.baseentity.serializer.AbstractEquellaBaseEntitySerializer; import com.tle.web.api.taxonomy.TaxonomyEditorImpl.TaxonomyEditorFactory; import javax.inject.Inject; import javax.inject.Singleton; @NonNullByDefault @Bind @Singleton public class TaxonomyBeanSerializer extends AbstractEquellaBaseEntitySerializer<Taxonomy, TaxonomyBean, TaxonomyEditor> { @Inject private TaxonomyService taxonomyService; @Inject private TaxonomyEditorFactory editorFactory; @Override protected TaxonomyBean createBean() { return new TaxonomyBean(); } @Override protected Taxonomy createEntity() { return new Taxonomy(); } @Override protected TaxonomyEditor createExistingEditor( Taxonomy entity, String stagingUuid, String lockId, boolean importing) { return editorFactory.createExistingEditor(entity, stagingUuid, lockId, true, importing); } @Override protected TaxonomyEditor createNewEditor(Taxonomy entity, String stagingUuid, boolean importing) { return editorFactory.createNewEditor(entity, stagingUuid, importing); } @Override protected void copyCustomFields(Taxonomy taxonomy, TaxonomyBean bean, Object data) { bean.setReadonly(taxonomyService.isTaxonomyReadonly(taxonomy.getUuid())); } @Override protected AbstractEntityService<?, Taxonomy> getEntityService() { return taxonomyService; } @Override protected Node getNonVirtualNode() { return Node.TAXONOMY; } }
equella/Equella
Source/Plugins/Core/com.equella.core/src/com/tle/web/api/taxonomy/TaxonomyBeanSerializer.java
Java
apache-2.0
2,618
<!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_21) on Sat May 11 22:08:45 BST 2013 --> <meta http-equiv="Content-Type" content="text/html" charset="UTF-8"> <title>MapWithScope.Allocator (Apache Jena ARQ)</title> <meta name="date" content="2013-05-11"> <link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style"> </head> <body> <script type="text/javascript"><!-- if (location.href.indexOf('is-external=true') == -1) { parent.document.title="MapWithScope.Allocator (Apache Jena ARQ)"; } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar_top"> <!-- --> </a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="class-use/MapWithScope.Allocator.html">Use</a></li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../index-all.html">Index</a></li> <li><a href="../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../../org/apache/jena/riot/system/MapWithScope.html" title="class in org.apache.jena.riot.system"><span class="strong">Prev Class</span></a></li> <li><a href="../../../../../org/apache/jena/riot/system/MapWithScope.ScopePolicy.html" title="interface in org.apache.jena.riot.system"><span class="strong">Next Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../../index.html?org/apache/jena/riot/system/MapWithScope.Allocator.html" target="_top">Frames</a></li> <li><a href="MapWithScope.Allocator.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li><a href="#method_summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li><a href="#method_detail">Method</a></li> </ul> </div> <a name="skip-navbar_top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <!-- ======== START OF CLASS DATA ======== --> <div class="header"> <div class="subTitle">org.apache.jena.riot.system</div> <h2 title="Interface MapWithScope.Allocator" class="title">Interface MapWithScope.Allocator&lt;A,B&gt;</h2> </div> <div class="contentContainer"> <div class="description"> <ul class="blockList"> <li class="blockList"> <dl> <dt>Enclosing class:</dt> <dd><a href="../../../../../org/apache/jena/riot/system/MapWithScope.html" title="class in org.apache.jena.riot.system">MapWithScope</a>&lt;<a href="../../../../../org/apache/jena/riot/system/MapWithScope.html" title="type parameter in MapWithScope">A</a>,<a href="../../../../../org/apache/jena/riot/system/MapWithScope.html" title="type parameter in MapWithScope">B</a>,<a href="../../../../../org/apache/jena/riot/system/MapWithScope.html" title="type parameter in MapWithScope">S</a>&gt;</dd> </dl> <hr> <br> <pre>public static interface <span class="strong">MapWithScope.Allocator&lt;A,B&gt;</span></pre> <div class="block">Allocate a B, given some A. Only called once per instance of B if the ScopePolicy map is non-null.</div> </li> </ul> </div> <div class="summary"> <ul class="blockList"> <li class="blockList"> <!-- ========== METHOD SUMMARY =========== --> <ul class="blockList"> <li class="blockList"><a name="method_summary"> <!-- --> </a> <h3>Method Summary</h3> <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> <caption><span>Methods</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tr class="altColor"> <td class="colFirst"><code><a href="../../../../../org/apache/jena/riot/system/MapWithScope.Allocator.html" title="type parameter in MapWithScope.Allocator">B</a></code></td> <td class="colLast"><code><strong><a href="../../../../../org/apache/jena/riot/system/MapWithScope.Allocator.html#alloc(A)">alloc</a></strong>(<a href="../../../../../org/apache/jena/riot/system/MapWithScope.Allocator.html" title="type parameter in MapWithScope.Allocator">A</a>&nbsp;item)</code> <div class="block">Allocate - return the same B for a given A.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code><a href="../../../../../org/apache/jena/riot/system/MapWithScope.Allocator.html" title="type parameter in MapWithScope.Allocator">B</a></code></td> <td class="colLast"><code><strong><a href="../../../../../org/apache/jena/riot/system/MapWithScope.Allocator.html#create()">create</a></strong>()</code> <div class="block">Create a fresh, unique (to within policy) B</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><strong><a href="../../../../../org/apache/jena/riot/system/MapWithScope.Allocator.html#reset()">reset</a></strong>()</code>&nbsp;</td> </tr> </table> </li> </ul> </li> </ul> </div> <div class="details"> <ul class="blockList"> <li class="blockList"> <!-- ============ METHOD DETAIL ========== --> <ul class="blockList"> <li class="blockList"><a name="method_detail"> <!-- --> </a> <h3>Method Detail</h3> <a name="alloc(java.lang.Object)"> <!-- --> </a><a name="alloc(A)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>alloc</h4> <pre><a href="../../../../../org/apache/jena/riot/system/MapWithScope.Allocator.html" title="type parameter in MapWithScope.Allocator">B</a>&nbsp;alloc(<a href="../../../../../org/apache/jena/riot/system/MapWithScope.Allocator.html" title="type parameter in MapWithScope.Allocator">A</a>&nbsp;item)</pre> <div class="block">Allocate - return the same B for a given A. "same" means .equals, not ==</div> </li> </ul> <a name="create()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>create</h4> <pre><a href="../../../../../org/apache/jena/riot/system/MapWithScope.Allocator.html" title="type parameter in MapWithScope.Allocator">B</a>&nbsp;create()</pre> <div class="block">Create a fresh, unique (to within policy) B</div> </li> </ul> <a name="reset()"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>reset</h4> <pre>void&nbsp;reset()</pre> </li> </ul> </li> </ul> </li> </ul> </div> </div> <!-- ========= END OF CLASS DATA ========= --> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar_bottom"> <!-- --> </a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="class-use/MapWithScope.Allocator.html">Use</a></li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../index-all.html">Index</a></li> <li><a href="../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../../org/apache/jena/riot/system/MapWithScope.html" title="class in org.apache.jena.riot.system"><span class="strong">Prev Class</span></a></li> <li><a href="../../../../../org/apache/jena/riot/system/MapWithScope.ScopePolicy.html" title="interface in org.apache.jena.riot.system"><span class="strong">Next Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../../index.html?org/apache/jena/riot/system/MapWithScope.Allocator.html" target="_top">Frames</a></li> <li><a href="MapWithScope.Allocator.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li><a href="#method_summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li><a href="#method_detail">Method</a></li> </ul> </div> <a name="skip-navbar_bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> <p class="legalCopy"><small>Licenced under the Apache License, Version 2.0</small></p> </body> </html>
chinhnc/floodlight
lib/apache-jena-2.10.1/javadoc-arq/org/apache/jena/riot/system/MapWithScope.Allocator.html
HTML
apache-2.0
9,590
using System; using System.Globalization; using System.Windows.Forms; using Microsoft.VisualBasic.Devices; namespace SupremeFiction.UI.SupremeRulerModdingTool.WinForm.HotKey { public class GlobalHotKeyEventArgs : EventArgs { //public string Name { get { return HotKey.Name; } } //public Keys Key { get { return HotKey.Key; } set { HotKey.Key = value; } } //public Modifiers Modifier { get { return HotKey.Modifier; } set { HotKey.Modifier = value; } } //public string FullInfo() { return HotKey.FullInfo(); } //public object Tag { get { return HotKey.Tag; } set { HotKey.Tag = value; } } //public int Id { get { return HotKey.Id; } } //public bool Enabled { get { return HotKey.Enabled; } set { HotKey.Enabled = value; } } public GlobalHotKeyEventArgs(GlobalHotKey hotKey) { HotKey = hotKey; } public GlobalHotKey HotKey { get; private set; } } public class LocalHotKeyEventArgs : EventArgs { public LocalHotKeyEventArgs(LocalHotKey hotKey) { HotKey = hotKey; } public LocalHotKey HotKey { get; private set; } } public class PreChordHotKeyEventArgs : EventArgs { private readonly LocalHotKey HotKey; public PreChordHotKeyEventArgs(LocalHotKey hotkey) { HotKey = hotkey; } ///// <summary>The name of the chord that raised this event. ///// </summary> //public string Name { get { return HotKey.Name; } } /// <summary> /// The base key of the chord that raised this event. /// </summary> public Keys BaseKey { get { return HotKey.Key; } } /// <summary> /// The base modifier of the chord that raised this event. /// </summary> public Modifiers BaseModifier { get { return HotKey.Modifier; } } /// <summary> /// Gets or sets if the chord event should be handled. /// </summary> public bool HandleChord { get; set; } /// <summary> /// Displays information about /// </summary> public override string ToString() { return Info(); } /// <summary> /// Displays the Modifier and key in extended format. /// </summary> /// <returns>The key and modifier in string.</returns> public string Info() { string info = ""; foreach (Modifiers mod in new HotKeyShared.ParseModifier((int) BaseModifier)) { info += mod + " + "; } info += BaseKey.ToString(); return info; } } public class ChordHotKeyEventArgs : EventArgs { public ChordHotKeyEventArgs(ChordHotKey hotkey) { HotKey = hotkey; } /// <summary> /// The HotKey that raised this event. /// </summary> public ChordHotKey HotKey { get; private set; } } public class HotKeyIsSetEventArgs : EventArgs { public HotKeyIsSetEventArgs(Keys key, Modifiers modifier) { UserKey = key; UserModifier = modifier; } public Keys UserKey { get; private set; } public Modifiers UserModifier { get; private set; } public bool Cancel { get; set; } public string Shortcut { get { return HotKeyShared.CombineShortcut(UserModifier, UserKey); } } } public class HotKeyEventArgs : EventArgs { public HotKeyEventArgs(Keys key, Modifiers modifier, RaiseLocalEvent KeyPressevent) { Key = key; Modifier = modifier; KeyPressEvent = KeyPressevent; } public Keys Key { get; private set; } public Modifiers Modifier { get; private set; } public RaiseLocalEvent KeyPressEvent { get; private set; } } public class KeyboardHookEventArgs : EventArgs { public enum modifiers { /// <summary> /// Specifies that no modifier key is pressed. /// </summary> None, /// <summary> /// Specifies that only the Shift key is pressed. /// </summary> Shift, /// <summary> /// Specifies that only the Control key is pressed. /// </summary> Control, /// <summary> /// Specifies that only the Alt key is pressed. /// </summary> Alt, /// <summary> /// Specifies that the Shift and Control key are pressed. /// </summary> ShiftControl, /// <summary> /// Specifies that the Shift and Alt key are pressed. /// </summary> ShiftAlt, /// <summary> /// Specifies that the Control and Alt key are pressed. /// </summary> ControlAlt, /// <summary> /// Specifies that the Shift, Control and Alt key are pressed. /// </summary> ShiftControlAlt } private bool handled; private KeyboardHookStruct lParam; public KeyboardHookEventArgs(KeyboardHookStruct lparam) { LParam = lparam; } private KeyboardHookStruct LParam { get { return lParam; } set { lParam = value; uint nonVirtual = Win32.MapVirtualKey((uint) VirtualKeyCode, 2); Char = Convert.ToChar(nonVirtual); } } /// <summary> /// The ASCII code of the key pressed. /// </summary> public int VirtualKeyCode { get { return LParam.VirtualKeyCode; } } /// <summary> /// The Key pressed. /// </summary> public Keys Key { get { return (Keys) VirtualKeyCode; } } public char Char { get; private set; } public string KeyString { get { if (Char == '\0') { return Key == Keys.Return ? "[Enter]" : string.Format("[{0}]", Key); } if (Char == '\r') { Char = '\0'; return "[Enter]"; } if (Char == '\b') { Char = '\0'; return "[Backspace]"; } return Char.ToString(CultureInfo.InvariantCulture); } } /// <summary> /// Specifies if this key should be processed by other windows. /// </summary> public bool Handled { get { return handled; } set { //Because a key cannot be handled when it is already up, we'll ignore this. if (KeyboardEventName != KeyboardEventNames.KeyUp) handled = value; } } /// <summary> /// The event that raised this 'event' Whether KeyUp or KeyDown. /// </summary> public KeyboardEventNames KeyboardEventName { get; internal set; } /// <summary> /// Gets the modifier that is pressed when this event was raised. /// </summary> public modifiers Modifier { get { var KeyBoard = new Keyboard(); if (KeyBoard.AltKeyDown && KeyBoard.CtrlKeyDown && KeyBoard.ShiftKeyDown) return modifiers.ShiftControlAlt; if (KeyBoard.AltKeyDown && KeyBoard.CtrlKeyDown && !KeyBoard.ShiftKeyDown) return modifiers.ControlAlt; if (KeyBoard.AltKeyDown && !KeyBoard.CtrlKeyDown && KeyBoard.ShiftKeyDown) return modifiers.ShiftAlt; if (!KeyBoard.AltKeyDown && KeyBoard.CtrlKeyDown && KeyBoard.ShiftKeyDown) return modifiers.ShiftControl; if (!KeyBoard.AltKeyDown && !KeyBoard.CtrlKeyDown && KeyBoard.ShiftKeyDown) return modifiers.Shift; if (KeyBoard.AltKeyDown && !KeyBoard.CtrlKeyDown && !KeyBoard.ShiftKeyDown) return modifiers.Alt; if (!KeyBoard.AltKeyDown && KeyBoard.CtrlKeyDown && !KeyBoard.ShiftKeyDown) return modifiers.Control; return modifiers.None; } } public int Time { get { return lParam.Time; } } } }
Blind-Striker/supremefiction
SupremeRulerModdingTool/UI/SupremeRulerModdingTool.WinForm/HotKey/EventArgs.cs
C#
apache-2.0
8,863
@* * Copyright 2021 HM Revenue & Customs * * 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. *@ @(heading: String, content: String, id: String) <div class="protection-detail" id="@{id}Heading"> @heading <span class="font-small block" id="@{id}Content">@content</span> </div>
hmrc/pensions-lifetime-allowance-frontend
app/views/helpers/templates/existingProtections/protectionDetails.scala.html
HTML
apache-2.0
787
# Notebook testing This directory contains some resources used for testing notebooks.
kubeflow/testing
notebook_testing/README.md
Markdown
apache-2.0
86
body{ /* background-color: #f1f7fe;*/ font-family: Arial, Arial Unicode Regular, sans-serif; } button[disabled] { cursor: not-allowed; } input[disabled] { cursor: not-allowed; } #mainContainer { margin-top: 35px; margin-left: 0px; margin-right: 0px; } #logo-box { height: 55px; background-color: white; padding-top: 0px; padding-bottom: 0px; padding-left: 0px; border-right: solid 2px #ddd; } .menu-item { font-weight: bold; } /* poker stuff*/ .poker-table{ float: right; height: 80%; width: 100%; } /* class to manage the menuItems reserve to the traders (internal reports and logs)*/ .trade-menu-item { font-size: 11px; } .nav > li > a:active { background-color: aqua !important; } .bg-menu { background-color: aqua !important; } .row-counterparty { display:inline-block; width: 300px; left: 40%; position: absolute; top:20%; } #counterPartyDiv { width: 320px; margin-left: auto; margin-right: auto; } #counterparty { width: 250px; } #counterparty_detail { margin-left: auto; margin-right: auto; padding: 5px; width: 400px; text-align: center; } .info-icon{ font-size: 16px; color:cornflowerblue; top:35%; position: absolute; cursor: default; } .counterparty-detail-name { margin-left: 10px; text-align: right; width: 61px; font-weight: normal; height: 20px; margin-bottom: 4px; } .counterparty-detail-value{ width: 150px; vertical-align: top; } #counterpartyLabel { margin-left: auto; margin-right: auto; height: 20px; } .nav-tabs > li > a { cursor: default; height: 23px; padding-bottom: 0px; } .tablink-name{ display: inline-block; height: 17px; width: 60px; overflow-x: hidden; overflow-y: hidden; cursor: default; } .dropdown-custom { position: absolute; padding-left: 0px; min-width: 100px; background-color: #f9f9f9; box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2); list-style-type: none; z-index: 1000; background-color: #fff; -webkit-background-clip: padding-box; background-clip: padding-box; /* border: 1px solid #ccc;*/ /* border: 1px solid rgba(0, 0, 0, .15);*/ border-radius: 0px; -webkit-box-shadow: 0 6px 12px rgba(0, 0, 0, .175); box-shadow: 0 6px 12px rgba(0, 0, 0, .175); margin-top: -2px; max-height: 300px; /*min-height: 20px;*/ overflow-y: scroll; overflow-x: hidden; } .dropdown-custom { list-style-type: none; } .dropdown-custom > li > a { display: block; min-width: 140px; padding-left: 5px; text-align: left; clear: both; font-weight: normal; line-height: 1.42857143; color: #333; white-space: nowrap; cursor: default; } .dropdown-custom > li.active { color: #262626; text-decoration: none; background-color: #f5f5f5; } .dropdown-custom > li > a:hover, .dropdown-custom > li > a:focus { color: #262626; text-decoration: none; background-color: #f5f5f5; } .dropdown-custom > .active > a, .dropdown-custom > .active > a:hover, .dropdown-custom > .active > a:focus { color: #fff; text-decoration: none; background-color: #337ab7; outline: 0; } .dropdown-currency { max-width: 120px; } .dropdown-counterparty { width: 250px; } .dropdown-profile { right: 0.25%; width: 50px; overflow-y: auto; margin-top: 6px; } .dropdown-counterpartyDetail{ overflow-y: auto; overflow-x: auto; min-width: 250px; width: 250px; margin-top:0.1px; } .button-caret { margin-left: -27px; vertical-align: middle; height: 20px; } .panel { border-radius: 1px; } .panel-main { border-bottom: none; } .panel-heading { height: 25px; padding-top: 2px; padding-right: 0px; background-image: linear-gradient(to bottom, #fff 0%, #fff 100%) !important; } .panel-heading > .nav-tabs > li > a { padding-bottom: 3px; padding-top: 1px; padding-right: 0px; } .panel-body { padding-top: 5px; } #pricers > .panel-body{ padding-left: 0px; } .close-span { padding-left: 8px; font-size: 1rem; margin-top: 0.1rem; margin-right: 0.4rem; color: #cabccc; } .close-span:hover { color: #555555; } .plus-span { padding-right: 10px; padding-top: 0px; padding-bottom: 0px; color: cadetblue; } .plus-table { width: 30px; height: 15px; margin: 3px 0 3px 10px; -webkit-transform: skew(25deg); -moz-transform: skew(25deg); -o-transform: skew(25deg); background: #e3e3e3; } .row-type-product { padding-top: 10px; border-bottom: solid 2px #ddd; } .type-product-name { font-weight: bold; font-size: 16px; color: green; } .row-product { padding-top: 25px; padding-bottom: 15px; } .row-product [class*='col-'] { padding-right: 1px; padding-left: 1px; } .center-align-text { text-align: center; } .product { padding-left: 15px; padding-right: 15px; padding-bottom: 15px; padding-top: 15px; line-height: 1.5em; color: black; font-size: 13px; background-color: #fff; /*background-image: linear-gradient(#eee, #CFCFCF);*/ background-image: linear-gradient(#eee, #fff); border: solid 2px #333; border-radius: 2px; margin-top: 5px; cursor: default; } .product:hover { background-image: linear-gradient(#eee, green); } .request-product-form { width: 420px; margin-left: auto; margin-right: auto; padding: 15px; } .error-div-pricing{ } .align-div { display: inline-block; /*padding-top: 5px;*/ vertical-align : bottom; } .align-horirontal { display: inline-block; } .form-control-feedback { width: 20px; cursor: pointer; pointer-events: auto; right: 4px; } .align-caret{ top:-10%; } .wrapper-label-input{ height: 25px; margin-bottom: 6px; margin-top: 6px; } .control-label { text-align: right; width: 130px; font-weight: bold; margin-right: 6px; height: 20px; margin-bottom: 0px; } .price-output-label{ width: 120px; } .input-control { width: 120px; margin-right: 0px; height: 20px; margin-bottom: 0px; } .output-control { max-width: 200px; margin-right: 0px; height: 20px; margin-bottom: 0px; overflow-x: hidden; overflow-y: hidden; vertical-align: middle; } .margin-separator{ font-size: 15px; vertical-align: middle; } /*input.input-control { border-radius: 0px; border: solid 1px black; }*/ .request-product-action-withAnchor { float: right; max-height: } .request-product-action-anchor { width: 100px; /*margin-left:auto;*/ /*margin-right:auto;*/ float: right; } .request-product-action { position: absolute; bottom: 30px; width: 50%; left: 35% } .price-action{ margin-right: 5px; } .quote-action{ vertical-align: top; } .reserved { font-weight: normal; } .action-button { width: 90px; } .stream-button { width: 25px; margin-left: -4px; margin-right: 15px; height: 21px; vertical-align: middle; } .edit-price { height: 19px; vertical-align: -3px; } .toggle-button-off { background-color: #fff; } .toggle-button-on { background-color: #E1E4DF; } .refresh-action { margin-right: 5px; } .labelPrice { max-width: 70px; margin-right: 0px; height: 20px; margin-bottom: 0px; overflow-x: hidden; overflow-y: hidden; vertical-align: middle; } .label-price-compute{ font-size:12px; color:#aaa; width:120px; margin-right:0px; } .anchor-with-pointer { cursor: pointer; } .timer-span { font-size: 11px; color: #aaa; } .timer-div { margin-left: 20px; } .progress-bar { background-color: #cccccc; background-image: linear-gradient(to bottom, #cccccc 0%, #dddddd 100%); } .progress-bar-div { width: 120px; height: 22px; border: solid 1px black; position: relative; } .quote-element { margin-top: 15px; } .quote-action-accept { margin-left: auto; margin-right: auto; margin-top: 10px; width: 90px; } .time-quote-div { vertical-align: -7px; } .quote-booked { margin-left: auto; margin-right: auto; margin-top: 10px; width: 350px; } .button-date-picker { width: 60px; } select:disabled,input[type="text"]:disabled { background: #e5e5e5; color:#333; } .btn-primary[disabled] { /* background: #000;*/ background: #ccc; /* background-image: linear-gradient(180deg, #000, #4d4d4d);*/ background-image: linear-gradient(180deg, #aaa, #ccc); cursor: not-allowed; } .btn-primary[disabled]:hover { /*background: #000; background-image: linear-gradient(180deg, #000, #4d4d4d);*/ background: #ccc; background-image: linear-gradient(180deg, #aaa, #ccc); cursor: not-allowed; } .error-div { margin-top: 20px; width: 350px; border: solid 1px black; font-weight: bold; font-size: 12px; background-color: darkorange; padding-left: 10px; } .ngdialog.ngdialog-theme-plain .ngdialog-content { padding: 0px; border: solid 5px; } .popup-content { margin: 10px; } .resultQuoteTrade { /*background-color: aqua;*/ } .user-name-banner{ display:inline-block; margin-right: 45px; cursor: pointer; position: absolute; right: 0.25%; top:30%; } .user { display: inline-block; width: 30px; height: 30px; border-radius: 50%; background-repeat: no-repeat; background-position: center center; background-size: cover; background-color: cornflowerblue; /* border: solid 1px;*/ /*float: right;*/ right: 0.25%; top:20%; margin-right: 10px; position: absolute; } .user-icon { left: 0.7rem; margin-top: 5px; color: white; font-size: 14px } .user-name { margin-left: 30px; font-weight: bold; font-size: medium; } .icon-align{ margin-top: 3px; } .default-date-title{ display: inline-block; margin-top: 15px; font-size:12px; margin-left: -150px; } #mainContainer{ margin-left: 5px; margin-right: 5px; margin-top: 5px; } .type-product{ margin-left: 15px; } .type-product-title{ margin-bottom: 7px; } .div-product{ width: 120px; height: 60px; background: #fff; border-radius: 4px; -moz-border-radius: 4px; -webkit-border-radius: 4px; box-shadow: 0 0 4px rgba(0, 0, 0, 0.2) inset; font-size: 12px; line-height: 15px; margin-bottom: 5px; margin-left: 2px; padding-top:0px; cursor:pointer; } .div-product:hover { box-shadow: 0 0 4px rgba(51,122,183, 1) inset; } #select-product{ margin-top:5px; margin-bottom:10px; margin-left:25px; font-size:14; font-weight:bold } .icon-product{ /*background-color: #fafafb;*/ width: 40px; height: 45px; /*box-shadow: 0 0 4px rgba(0, 0, 0, 0.2) inset;*/ border-top-left-radius: 4px; display: inline-block; padding-top:10px; } .name-product{ width: 77px; height: 45px; display: inline-block; padding-right: 2px; padding-top: 3px; } .separator{ border-bottom: solid 1px #ddd; margin-left: 0px; margin-bottom: 10px; } .well-sm{ padding:0px; border-radius:0px; } .well{ padding: 0px; margin-bottom: 0px; } .uib-title { width: 100%; } .options-date{ display: inline-block; vertical-align: top; height: 166px; } .options-date >.btn-sm{ width: 40px; } .btn-options{ width: 65px; } .dropdown-date { position: absolute; padding-left: 0px; background-color: #f9f9f9; box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2); list-style-type: none; z-index: 1000; background-color: #fff; -webkit-background-clip: padding-box; background-clip: padding-box; border: 1px solid #ccc; border: 1px solid rgba(0, 0, 0, .15); border-radius: 0px; -webkit-box-shadow: 0 6px 12px rgba(0, 0, 0, .175); box-shadow: 0 6px 12px rgba(0, 0, 0, .175); margin-top: -1px; } th{ border-left: none; background-color: transparent; } table{ margin: 0px; border: none; } td{ border-left: none; } .th-validation{ vertical-align: top; } .table > thead > tr > th { vertical-align: top; } .btn-open-calendar{ margin-left: -4px; height: 21px; padding-left: 5px; padding-right: 5px; padding-top: 0px; padding-bottom: 0px; position: relative; margin-top: 0px; border-bottom-width: 0px; right: 26px; } .btn-default.active { background-color: #265a88; border-color: #dbdbdb; color: white; } .title-validation-array{ margin-bottom: 15px; font-size: 14px; font-weight: bold; } .popup{ height:300px; } .popup .panel-body{ height: 270px; margin-top: 15px; } .details-popup{ max-height: 210px; overflow: auto; } .payment-popup{ max-height: 400px; overflow: auto; } .payment-popup .panel-body{ background-color: initial; } .payment-label{ font-weight: normal; font-size: 12px; } .quote-popup{ max-height: 800px; overflow: auto; } .quote-popup .panel-body{ background-color: initial; } .quote-popup-label{ font-weight: normal; font-size: 12px; } .close-payment{ float:right; margin-top: 5px; margin-bottom: 5px; padding-right:10px; } .upArrow{ color: blue; font-weight: bold; font-size: 18px; } .downArrow{ color: red; font-weight: bold; font-size: 18px; } .close-popup{ position: absolute; bottom: 1rem; right: 1rem; } .span-icon:hover { color: #999; opacity: 100%; } .span-icon { color: #000; opacity: 70%; } .span-icon{ right: -0.05rem; top:-0.2rem; } .input-unit{ width: 60px; } .ngdialog.ngdialog-theme-plain .ngdialog-content{ border:none; } .i-calendar{ top: 0.3rem; position: absolute; right: -1px; } /** css for the animate refresh button **/ .glyphicon-refresh-animate { -animation: spin .7s infinite linear; -webkit-animation: spin2 .7s infinite linear; } @-webkit-keyframes spin2 { from { -webkit-transform: rotate(0deg);} to { -webkit-transform: rotate(360deg);} } @keyframes spin { from { transform: scale(1) rotate(0deg);} to { transform: scale(1) rotate(360deg);} } /** end css for the animate refresh button **/
WhippyCleric/WhipPoker
WhipPokerWebClient/styles/myStyles/webMX.css
CSS
apache-2.0
14,499
<template name="menus"> <section id="menus-section" class="mdl-components__page mdl-grid"> <div class="mdl-cell mdl-cell--12-col"> <div class="docs-text-styling component-title"> <p>Lists of clickable actions.</p> </div> <!-- Generating snippets --> {{#SnippetGroup true}} {{#SnippetDemo}} <style> .container-menu-lower-left { position: relative; width: 200px; } .background-menu-lower-left { background: white; height: 148px; width: 100%; } .bar-menu-lower-left { box-sizing: border-box; background: #3F51B5; color: white; width: 100%; padding: 16px; } </style> <div class="container-menu-lower-left mdl-shadow--2dp"> <div class="bar-menu-lower-left"> <!-- Left aligned menu below button --> <button id="demo-menu-lower-left" class="mdl-button mdl-js-button mdl-button--icon"> <i class="material-icons">more_vert</i> </button> <ul class="mdl-menu mdl-menu--bottom-left mdl-js-menu mdl-js-ripple-effect" for="demo-menu-lower-left"> <li class="mdl-menu__item">Some Action</li> <li class="mdl-menu__item">Another Action</li> <li disabled class="mdl-menu__item">Disabled Action</li> <li class="mdl-menu__item">Yet Another Action</li> </ul> </div> <div class="background-menu-lower-left"></div> </div> {{/SnippetDemo}} {{#SnippetDemo}} <style> .container-menu-lower-right { position: relative; width: 200px; } .background-menu-lower-right { background: white; height: 148px; width: 100%; } .bar-menu-lower-right { box-sizing: border-box; position: relative; background: #3F51B5; color: white; height: 64px; width: 100%; padding: 16px; } .wrapper-menu-lower-right { box-sizing: border-box; position: absolute; right: 16px; } </style> <div class="container-menu-lower-right mdl-shadow--2dp"> <div class="bar-menu-lower-right"> <div class="wrapper-menu-lower-right"> <!-- Right aligned menu below button --> <button id="demo-menu-lower-right" class="mdl-button mdl-js-button mdl-button--icon"> <i class="material-icons">more_vert</i> </button> <ul class="mdl-menu mdl-menu--bottom-right mdl-js-menu mdl-js-ripple-effect" for="demo-menu-lower-right"> <li class="mdl-menu__item">Some Action</li> <li class="mdl-menu__item">Another Action</li> <li disabled class="mdl-menu__item">Disabled Action</li> <li class="mdl-menu__item">Yet Another Action</li> </ul> </div> </div> <div class="background-menu-lower-right"></div> </div> {{/SnippetDemo}} {{else}} {{#SnippetCaption}}Lower left{{/SnippetCaption}} {{#SnippetCaption}}Lower right{{/SnippetCaption}} {{/SnippetGroup}} {{#SnippetGroup true}} {{#SnippetDemo}} <style> .container-menu-top-left { position: relative; width: 200px; } .background-menu-top-left { background: white; height: 148px; width: 100%; } .bar-menu-top-left { box-sizing: border-box; background: #3F51B5; color: white; width: 100%; padding: 16px; } </style> <div class="container-menu-top-left mdl-shadow--2dp"> <div class="background-menu-top-left"></div> <div class="bar-menu-top-left"> <!-- Left aligned menu on top of button --> <button id="demo-menu-top-left" class="mdl-button mdl-js-button mdl-button--icon"> <i class="material-icons">more_vert</i> </button> <ul class="mdl-menu mdl-menu--top-left mdl-js-menu mdl-js-ripple-effect" for="demo-menu-top-left"> <li class="mdl-menu__item">Some Action</li> <li class="mdl-menu__item">Another Action</li> <li disabled class="mdl-menu__item">Disabled Action</li> <li class="mdl-menu__item">Yet Another Action</li> </ul> </div> </div> {{/SnippetDemo}} {{#SnippetDemo}} <style> .container-menu-top-right { position: relative; width: 200px; } .background-menu-top-right { background: white; height: 148px; width: 100%; } .bar-menu-top-right { box-sizing: border-box; position: relative; background: #3F51B5; color: white; height: 64px; width: 100%; padding: 16px; } .wrapper-menu-top-right { box-sizing: border-box; position: absolute; right: 16px; } </style> <div class="container-menu-top-right mdl-shadow--2dp"> <div class="background-menu-top-right"></div> <div class="bar-menu-top-right"> <div class="wrapper-menu-top-right"> <!-- Right aligned menu on top of button --> <button id="demo-menu-top-right" class="mdl-button mdl-js-button mdl-button--icon"> <i class="material-icons">more_vert</i> </button> <ul class="mdl-menu mdl-menu--top-right mdl-js-menu mdl-js-ripple-effect" for="demo-menu-top-right"> <li class="mdl-menu__item">Some Action</li> <li class="mdl-menu__item">Another Action</li> <li disabled class="mdl-menu__item">Disabled Action</li> <li class="mdl-menu__item">Yet Another Action</li> </ul> </div> </div> </div> {{/SnippetDemo}} {{else}} {{#SnippetCaption}}Top left{{/SnippetCaption}} {{#SnippetCaption}}Top right{{/SnippetCaption}} {{/SnippetGroup}} </div> </section> </template>
Zodiase/meteor-mdl
integration-tests/dashboard/client/routes/menus.html
HTML
apache-2.0
5,201
/* * Copyright 1999-2006 University of Chicago * * 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.globus.gsi.gssapi.auth; import org.ietf.jgss.GSSContext; import org.ietf.jgss.GSSName; /** * Interface for authorization mechanisms. * The authorization is performed once the connection was authenticated. */ public abstract class Authorization { /** * Performes authorization checks. Throws * <code>AuthorizationException</code> if the authorization fails. * Otherwise, the function completes normally. * * @param context the securit context * @param host host address of the peer. * @exception AuthorizationException if the peer is * not authorized to access/use the resource. */ public abstract void authorize(GSSContext context, String host) throws AuthorizationException; protected void generateAuthorizationException(GSSName expected, GSSName target) throws AuthorizationException { String lineSep = System.getProperty("line.separator"); StringBuffer msg = new StringBuffer(); msg.append("Mutual authentication failed").append(lineSep) .append(" Expected target subject name=\"") .append(expected.toString()).append("\"") .append(lineSep) .append(" Target returned subject name=\"") .append(target.toString()) .append("\""); throw new AuthorizationException(msg.toString()); } }
dCache/jglobus-1.8
src/org/globus/gsi/gssapi/auth/Authorization.java
Java
apache-2.0
1,947
package com.can.coolweather.db; import java.util.ArrayList; import java.util.List; import com.can.coolweather.model.City; import com.can.coolweather.model.County; import com.can.coolweather.model.Province; import android.content.ContentValues; import android.content.Context; import android.database.Cursor; import android.database.sqlite.SQLiteDatabase;; /** * 操作数据库的封装类 * * @author can * */ public class CoolWeatherDB { // 数据库名 private static final String DB_NAME = "cool_weather.db"; // 数据库版本号 private static final int VERSION = 1; private SQLiteDatabase mSqLiteDatabase; private static CoolWeatherDB mCoolWeatherDB; // 将构造方法私有化 private CoolWeatherDB(Context context) { CollWeatherOpenHelper mCollWeatherOpenHelper = new CollWeatherOpenHelper(context, DB_NAME, null, VERSION); mSqLiteDatabase = mCollWeatherOpenHelper.getWritableDatabase(); } /** * 获取CoolWeatherDB类 * * @param context * 上下文 * @return CoolWeatherDB */ public synchronized static CoolWeatherDB getInstance(Context context) { if (mCoolWeatherDB == null) { mCoolWeatherDB = new CoolWeatherDB(context); } return mCoolWeatherDB; } /** * 将Province实例存储到数据库 * * @param province * 省份 */ public void saveProvince(Province province) { if (province != null) { ContentValues values = new ContentValues(); values.put("province_name", province.getProvinceName()); values.put("province_code", province.getProvinceCode()); mSqLiteDatabase.insert("Province", null, values); } } /** * 从数据库读取全国所有省份信息 * * @return 省份的集合 */ public List<Province> loadProvince() { List<Province> provinces = new ArrayList<Province>(); Cursor cursor = mSqLiteDatabase.query("Province", null, null, null, null, null, null); if (cursor.moveToFirst()) { do { Province province = new Province(); province.setId(cursor.getInt(cursor.getColumnIndex("id"))); province.setProvinceCode(cursor.getString(cursor.getColumnIndex("province_code"))); province.setProvinceName(cursor.getString(cursor.getColumnIndex("province_name"))); provinces.add(province); } while (cursor.moveToNext()); if (cursor != null) { cursor.close(); } } return provinces; } /** * 将City实例存储到数据库 * * @param city * 城市的实例 */ public void saveCity(City city) { if (city != null) { ContentValues values = new ContentValues(); values.put("city_name", city.getCityName()); values.put("city_code", city.getCityCode()); values.put("province_id", city.getProvinceId()); mSqLiteDatabase.insert("City", null, values); } } /** * 从数据库读取省级所有的城市信息 * * @param provinceId 省份的ID号 * @return 城市的集合 */ public List<City> loadCity(int provinceId) { List<City> citys = new ArrayList<City>(); Cursor cursor = mSqLiteDatabase.query("City", null, "province_id = ?", new String[] { String.valueOf(provinceId) }, null, null, null); if (cursor.moveToFirst()) { do { City city = new City(); city.setId(cursor.getInt(cursor.getColumnIndex("id"))); city.setCityCode(cursor.getString(cursor.getColumnIndex("city_code"))); city.setCityName(cursor.getString(cursor.getColumnIndex("city_name"))); city.setProvinceId(provinceId);; citys.add(city); } while (cursor.moveToNext()); if (cursor != null) { cursor.close(); } } return citys; } /** * 将County实例存储到数据库 * * @param county * 县的实例 */ public void saveCounty(County county) { if (county != null) { ContentValues values = new ContentValues(); values.put("county_name", county.getCountyName()); values.put("county_code", county.getCountyCode()); values.put("city_id", county.getCityId()); mSqLiteDatabase.insert("County", null, values); } } /** * 从数据库读取市级所有的县信息 * @param cityId 城市的ID号 * @return 县的集合 */ public List<County> loadCounty(int cityId){ List<County> countys = new ArrayList<County>(); Cursor cursor = mSqLiteDatabase.query("County", null, "city_id = ?", new String[]{String.valueOf(cityId)}, null, null, null); if(cursor.moveToFirst()){ do{ County county = new County(); county.setId(cursor.getInt(cursor.getColumnIndex("id"))); county.setCountyCode(cursor.getString(cursor.getColumnIndex("county_code"))); county.setCountyName(cursor.getString(cursor.getColumnIndex("county_name"))); county.setCityId(cityId); countys.add(county); }while(cursor.moveToNext()); if(cursor!=null){ cursor.close(); } } return countys; } }
can06/coolweather
src/com/can/coolweather/db/CoolWeatherDB.java
Java
apache-2.0
4,799
/* Generated by camel build tools - do NOT edit this file! */ package org.apache.camel.component.directvm; import java.net.URISyntaxException; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Set; import org.apache.camel.spi.EndpointUriFactory; /** * Generated by camel build tools - do NOT edit this file! */ public class DirectVmEndpointUriFactory extends org.apache.camel.support.component.EndpointUriFactorySupport implements EndpointUriFactory { private static final String BASE = ":name"; private static final Set<String> PROPERTY_NAMES; private static final Set<String> SECRET_PROPERTY_NAMES; static { Set<String> props = new HashSet<>(11); props.add("lazyStartProducer"); props.add("bridgeErrorHandler"); props.add("headerFilterStrategy"); props.add("synchronous"); props.add("name"); props.add("exchangePattern"); props.add("failIfNoConsumers"); props.add("block"); props.add("propagateProperties"); props.add("exceptionHandler"); props.add("timeout"); PROPERTY_NAMES = Collections.unmodifiableSet(props); SECRET_PROPERTY_NAMES = Collections.emptySet(); } @Override public boolean isEnabled(String scheme) { return "direct-vm".equals(scheme); } @Override public String buildUri(String scheme, Map<String, Object> properties, boolean encode) throws URISyntaxException { String syntax = scheme + BASE; String uri = syntax; Map<String, Object> copy = new HashMap<>(properties); uri = buildPathParameter(syntax, uri, "name", null, true, copy); uri = buildQueryParameters(uri, copy, encode); return uri; } @Override public Set<String> propertyNames() { return PROPERTY_NAMES; } @Override public Set<String> secretPropertyNames() { return SECRET_PROPERTY_NAMES; } @Override public boolean isLenientProperties() { return false; } }
nicolaferraro/camel
components/camel-directvm/src/generated/java/org/apache/camel/component/directvm/DirectVmEndpointUriFactory.java
Java
apache-2.0
2,093
#include "lunkwill.h" struct _fifo *Sighandler=NULL; struct module_info Modules[256]; /** * \brief Where it all begins */ int main(int argc, char** argv) { char *err=NULL; int pipe1[2]; int pipe2[2]; pid_t pid; int opt; int log_level=0; char *log_file=NULL; int conf; char *config_path=NULL; config_t config; config_setting_t *config_prop; memset(Modules, 0, 256*sizeof(struct module_info)); //Parse args while((opt=getopt(argc,argv,"c:f"))!=-1) { switch(opt) { case 'c': if(config_path==NULL) { config_path=malloc(strlen(optarg)+10); strcpy(config_path, optarg); } break; case 'f': switch((int)fork()) { case -1: err="Unable to fork worker"; nfree(config_path); goto _fail; break; case 0: log_level=99; break; default: nfree(config_path); return 0; break; } break; default: err=argv[0]; nfree(config_path); goto argv_fail; break; } } //Load configuration if(config_path!=NULL) { log_write("Initializing lunkwill", LOG_DBG); log_write("Using config: %s", LOG_DBG, config_path); if(load_config(&config, config_path)!=0) { err="Failed to load configuration"; nfree(config_path); goto _fail; } nfree(config_path); } else { log_write("Initializing lunkwill", LOG_DBG); if(load_config(&config,"lunkwill.cfg")!=0) { log_write("Creating default config", LOG_DBG); if(create_config(&config, "lunkwill.cfg")!=0) { err="Failed to create default configuration"; goto _fail; } } log_write("Using default config", LOG_DBG); } if((config_prop=config_lookup(&config, "LOG"))==NULL) { config_prop=config_root_setting(&config); } if(config_setting_lookup_int(config_prop, "LOGLEVEL", &conf)&&log_level==0) log_level=conf; if(!config_setting_lookup_string(config_prop, "LOGFILE", (const char**)&log_file)) return 1; init_logger(log_file,log_level); init_sighndlr(); fflush(stdout); if(pipe(pipe1) == 0 && pipe(pipe2)==0) { pid = fork(); if(pid == (pid_t)-1) { err="Unable to fork worker"; goto _fail; } else if(pid == (pid_t)0) { //Child process close(pipe2[0]); close(pipe1[1]); fclose(stdin); //Read config //Modules_init; if(login_init_module(0)!=0) return 1; int max_num_threads=0; if((config_prop=config_lookup(&config, "WORKER"))==NULL) { config_prop=config_root_setting(&config); } if(config_setting_lookup_int(config_prop, "MAX_NUM_THREADS", &conf)) max_num_threads=conf; if(max_num_threads<=0||max_num_threads>0xFFFF) max_num_threads=15; if((config_prop=config_lookup(&config, "MODULES"))==NULL) { config_prop=config_root_setting(&config); } int x,n=0; n=config_setting_length(config_prop); for(x=0; x<n; x++) { const char *varName; if((varName = config_setting_get_string_elem(config_prop, x))==NULL) continue; load_module(varName, x); } config_destroy(&config); start_worker(max_num_threads, pipe1[0], pipe2[1]); } else { //Parent process close(pipe1[0]); close(pipe2[1]); //Read config int conf, port=0; int listen_queue=0; int timeout=0; config_setting_t *config_prop; if((config_prop=config_lookup(&config, "SOCKET"))==NULL) { config_prop=config_root_setting(&config); } if(config_setting_lookup_int(config_prop, "PORT", &conf)) port=conf; if(port<=0||port>0xFFFF) port=3000; if(config_setting_lookup_int(config_prop, "PEND_CONNECTIONS", &conf)) listen_queue=conf; if(listen_queue<=0||listen_queue>0xFF) listen_queue=20; if(config_setting_lookup_int(config_prop, "RCV_TIMEOUT", &conf)) timeout=conf; if(timeout<=0||timeout>0xFF) timeout=1; config_destroy(&config); log_write("Server started. Enter 'quit' to shutdown the server (Port: %d)", LOG_WARN, port); start_server(port, listen_queue, timeout, pipe2[0], pipe1[1]); } } sighndlr_safe_exit(0); return 0; argv_fail: log_write("Usage: %s [-c CONFIG_FILE] [-f]", LOG_FATAL, err); nfree(config_path); return 1; _fail: log_write(err, LOG_ERR); return 2; }
aceofspades/lunkwill
01-init/lunkwill.c
C
apache-2.0
4,115
// Copyright 2007-2014 Chris Patterson, Dru Sellers, Travis Smith, et. al. // // 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. namespace MassTransit.Context { using System; using System.Collections.Concurrent; using Util; public class PayloadCache { readonly ConcurrentDictionary<Type, CachedPayload> _cache; public PayloadCache(int capacity = 2) { _cache = new ConcurrentDictionary<Type, CachedPayload>(2, capacity); } public bool HasPayloadType(Type contextType) { return _cache.ContainsKey(contextType); } public bool TryGetPayload<TPayload>(out TPayload context) where TPayload : class { CachedPayload payloadCache; if (_cache.TryGetValue(typeof(TPayload), out payloadCache)) { context = payloadCache.GetPayload<TPayload>(); return true; } context = default(TPayload); return false; } public TPayload GetOrAddPayload<TPayload>(PayloadFactory<TPayload> payloadFactory) where TPayload : class { CachedPayload cachedPayload; if (_cache.TryGetValue(typeof(TPayload), out cachedPayload)) return cachedPayload.GetPayload<TPayload>(); try { cachedPayload = _cache.GetOrAdd(typeof(TPayload), x => { TPayload payload = payloadFactory(); if (payload != default(TPayload)) return new CachedPayload<TPayload>(payload); throw new PayloadNotFoundException("The payload was not found: " + TypeMetadataCache<TPayload>.ShortName); }); return cachedPayload.GetPayload<TPayload>(); } catch (PayloadNotFoundException) { throw; } catch (Exception ex) { throw new PayloadFactoryException("The payload factory faulted: " + TypeMetadataCache<TPayload>.ShortName, ex); } } interface CachedPayload { T GetPayload<T>() where T : class; } class CachedPayload<TPayload> : CachedPayload where TPayload : class { readonly TPayload _payload; public CachedPayload(TPayload payload) { _payload = payload; } public T GetPayload<T>() where T : class { var payload = this as CachedPayload<T>; if (payload != null) return payload._payload; throw new PayloadException("Payload type mismatch: " + TypeMetadataCache<T>.ShortName); } } } }
D3-LucaPiombino/MassTransit
src/MassTransit/Context/PayloadCache.cs
C#
apache-2.0
3,532
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("FluentValidation.Extensions.Tests")] [assembly: AssemblyTrademark("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("6813b022-c07b-4b71-9b51-44b9845e5b39")]
cbrianball/FluentValidation.Extensions
test/FluentValidation.Extensions.Tests/Properties/AssemblyInfo.cs
C#
apache-2.0
845
/* * Copyright 2009-2013 by The Regents of the University of California * 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 from * * 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.hyracks.storage.am.lsm.common.api; import org.apache.hyracks.api.exceptions.HyracksDataException; import org.apache.hyracks.storage.am.common.api.IIndexAccessor; import org.apache.hyracks.storage.am.common.api.IModificationOperationCallback; import org.apache.hyracks.storage.am.common.api.ISearchOperationCallback; import org.apache.hyracks.storage.am.lsm.common.impls.LSMOperationType; /** * This interface exposes methods for tracking and setting the status of operations for the purpose * of coordinating flushes/merges in {@link ILSMIndex}. * Note that 'operation' below refers to {@link IIndexAccessor} methods. * * @author zheilbron */ public interface ILSMOperationTracker { /** * An {@link ILSMIndex} will call this method before an operation enters it, * i.e., before any latches are taken. * If tryOperation is true, and the operation would have to wait for a flush, * then this method does not block and returns false. * Otherwise, this method returns true, and the operation is considered 'active' in the index. */ public void beforeOperation(ILSMIndex index, LSMOperationType opType, ISearchOperationCallback searchCallback, IModificationOperationCallback modificationCallback) throws HyracksDataException; /** * An {@link ILSMIndex} will call this method after an operation has left the index, * i.e., after all relevant latches have been released. * After this method has been called, the operation is still considered 'active', * until the issuer of the operation declares it completed by calling completeOperation(). */ public void afterOperation(ILSMIndex index, LSMOperationType opType, ISearchOperationCallback searchCallback, IModificationOperationCallback modificationCallback) throws HyracksDataException; /** * This method must be called by whoever is requesting the index operation through an {@link IIndexAccessor}. * The use of this method indicates that the operation is no longer 'active' * for the purpose of coordinating flushes/merges. */ public void completeOperation(ILSMIndex index, LSMOperationType opType, ISearchOperationCallback searchCallback, IModificationOperationCallback modificationCallback) throws HyracksDataException; }
tectronics/hyracks
hyracks/hyracks-storage-am-lsm-common/src/main/java/org/apache/hyracks/storage/am/lsm/common/api/ILSMOperationTracker.java
Java
apache-2.0
2,971
using DigitalPlatform.Marc; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Windows.Forms; namespace dp2Circulation { /// <summary> /// 书目记录合并策略 /// </summary> public class MergeRegistry { // 数据库名顺序列表 public List<string> DbNames = new List<string>(); // 要求 ListViewItem 的 .Tag 为 ItemTag 类型 public void Sort(ref List<ListViewItem> items) { items.Sort((item1, item2) => { ItemTag info1 = (ItemTag)item1.Tag; ItemTag info2 = (ItemTag)item2.Tag; if (info1.RecPath == info2.RecPath) return 0; // 先按照数据库名字排序 if (this.DbNames.Count > 0) { int index1 = this.DbNames.IndexOf(Global.GetDbName(info1.RecPath)); if (index1 == -1) index1 = this.DbNames.Count + 1; int index2 = this.DbNames.IndexOf(Global.GetDbName(info2.RecPath)); if (index2 == -1) index2 = this.DbNames.Count + 1; if (index1 != index2) return index1 - index2; } // 再观察 606 690 丰富程度 int nRet = Compare6XX(info1.Xml, info2.Xml); if (nRet != 0) return nRet; // 再观察 MARC 记录长度 nRet = CompareMarcLength(info1.Xml, info2.Xml); if (nRet != 0) return nRet; return nRet; }); } // 比较 606 690 丰富程度。数值小于 0 表示 strXml1 比 strXml2 丰富 static int Compare6XX(string strXml1, string strXml2) { int nCount1 = Count6XX(strXml1); int nCount2 = Count6XX(strXml2); return nCount2 - nCount1; } static int CompareMarcLength(string strXml1, string strXml2) { return GetMarcLength(strXml2) - GetMarcLength(strXml1); } static int Count6XX(string strXml) { string strError = ""; string strMarc = ""; string strOutMarcSyntax = ""; // 将MARCXML格式的xml记录转换为marc机内格式字符串 // parameters: // bWarning ==true, 警告后继续转换,不严格对待错误; = false, 非常严格对待错误,遇到错误后不继续转换 // strMarcSyntax 指示marc语法,如果=="",则自动识别 // strOutMarcSyntax out参数,返回marc,如果strMarcSyntax == "",返回找到marc语法,否则返回与输入参数strMarcSyntax相同的值 int nRet = MarcUtil.Xml2Marc(strXml, true, // 2013/1/12 修改为true "", // strMarcSyntax out strOutMarcSyntax, out strMarc, out strError); if (nRet == -1) return 0; int nCount = 0; if (strOutMarcSyntax == "unimarc") { MarcRecord record = new MarcRecord(strMarc); nCount += record.select("field[@name='606']").count; nCount += record.select("field[@name='690']").count; return nCount; } if (strOutMarcSyntax == "usmarc") { MarcRecord record = new MarcRecord(strMarc); nCount += record.select("field[@name='600' or @name='610' or @name='630' or @name='650' or @name='651']").count; nCount += record.select("field[@name='093']").count; return nCount; } return 0; } static int GetMarcLength(string strXml) { string strError = ""; string strMarc = ""; string strOutMarcSyntax = ""; // 将MARCXML格式的xml记录转换为marc机内格式字符串 // parameters: // bWarning ==true, 警告后继续转换,不严格对待错误; = false, 非常严格对待错误,遇到错误后不继续转换 // strMarcSyntax 指示marc语法,如果=="",则自动识别 // strOutMarcSyntax out参数,返回marc,如果strMarcSyntax == "",返回找到marc语法,否则返回与输入参数strMarcSyntax相同的值 int nRet = MarcUtil.Xml2Marc(strXml, true, // 2013/1/12 修改为true "", // strMarcSyntax out strOutMarcSyntax, out strMarc, out strError); if (nRet == -1) return 0; MarcRecord record = new MarcRecord(strMarc); return record.Text.Length; } } }
renyh1013/dp2
dp2Circulation/IO/MergeRegistry.cs
C#
apache-2.0
4,929
package in.co.madhur.ganalyticsdashclock.API; import in.co.madhur.ganalyticsdashclock.Consts; import in.co.madhur.ganalyticsdashclock.Consts.APIPeriod; public class GPeriod extends GType { public GPeriod() { } public GPeriod(String Id, String Name) { super(Id, Name); } public GPeriod(APIPeriod Id, String Name) { super(Id.toString(), Name); } @Override public String toString() { return Name; } }
madhur/GAnalytics
src/in/co/madhur/ganalyticsdashclock/API/GPeriod.java
Java
apache-2.0
427
/** * Copyright (C) 2015 Caratarse Auth Team <lucio.benfante@gmail.com> * * This file is part of Caratarse Auth Model. * * 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.caratarse.auth.model.po.attribute; import java.util.Date; import javax.persistence.Entity; import javax.persistence.Temporal; import javax.persistence.Transient; import org.hibernate.annotations.Filter; import org.hibernate.annotations.Filters; /** * An attribute with value of type date. * * @author <a href="mailto:lucio.benfante@gmail.com">Lucio Benfante</a> */ @Filters({@Filter(name = "limitByNotDeleted")}) @Entity public class DateAttribute extends Attribute { private Date dateValue; @Temporal(javax.persistence.TemporalType.DATE) public Date getDateValue() { return dateValue; } public void setDateValue(Date dateValue) { this.dateValue = dateValue; } @Transient @Override public Object getValue() { return getDateValue(); } public void setValue(Object value) { setDateValue((Date) value); } }
caratarse/caratarse-auth
caratarse-auth-model/src/main/java/org/caratarse/auth/model/po/attribute/DateAttribute.java
Java
apache-2.0
1,588
--- layout: post title: 'Tickets Now Available For API Days - APIStrat Berlin' url: /2015/01/22/tickets-now-available-for-api-days--apistrat-berlin/ source: /2015/01/22/tickets-now-available-for-api-days--apistrat-berlin/ domain: apistrat.com image: --- <p><a href="/wp-content/uploads/2015/01/bw-ticket-system.png"><img class="alignright wp-image-474" src="/wp-content/uploads/2015/01/bw-ticket-system.png" alt="Tickets" width="150" height="150" /></a>The time has come to <a href="https://apidays-apistrat.eventbrite.com">open up ticket sales for API Days - APIStrat Berlin</a>, this April 24th and 25th. This is the first round of early-bird tickets available for the joint API industry conference put on by both <a href="http://apidaysberlin2015.apistrat.com/">API Days and APIStrat i</a>n Germany this spring.</p> <p>As we have done with past events, we will be rolling out tickets in waves, but if you want to get the best deal for tickets—now is the time. This version of the conference will only be two days, and seats will be much more limited than before, so make sure you get in on the action early, and <a href="https://apidays-apistrat.eventbrite.com">get registered now</a>.</p> <!--break--> <p>There are other sponsorship opportunities as well, so if you company wants to increase your participation in the conversation, <a href="/contact/">make sure and contact us now</a>. We are also closing the request for talks, so if you have a last minute proposal—<a href="http://apidaysberlin2015.apistrat.com/call-for-talks/">submit now</a>!!</p>
APIStrat/apistrat
_posts/2015-01-22-tickets-now-available-for-api-days--apistrat-berlin.html
HTML
apache-2.0
1,566
package com.fincatto.documentofiscal.cte300.webservices; import com.fincatto.documentofiscal.assinatura.AssinaturaDigital; import com.fincatto.documentofiscal.cte300.CTeConfig; import com.fincatto.documentofiscal.cte300.classes.CTAutorizador31; import com.fincatto.documentofiscal.cte300.classes.enviolote.CTeEnvioLote; import com.fincatto.documentofiscal.cte300.classes.enviolote.CTeEnvioLoteRetorno; import com.fincatto.documentofiscal.cte300.classes.enviolote.CTeEnvioLoteRetornoDados; import com.fincatto.documentofiscal.cte300.webservices.recepcao.CteRecepcaoStub; import com.fincatto.documentofiscal.cte300.webservices.recepcao.CteRecepcaoStub.CteCabecMsg; import com.fincatto.documentofiscal.cte300.webservices.recepcao.CteRecepcaoStub.CteCabecMsgE; import com.fincatto.documentofiscal.cte300.webservices.recepcao.CteRecepcaoStub.CteDadosMsg; import com.fincatto.documentofiscal.cte300.webservices.recepcao.CteRecepcaoStub.CteRecepcaoLoteResult; import com.fincatto.documentofiscal.parsers.DFParser; import com.fincatto.documentofiscal.persister.DFPersister; import com.fincatto.documentofiscal.validadores.xsd.XMLValidador; import org.apache.axiom.om.OMElement; import org.apache.axiom.om.impl.builder.StAXOMBuilder; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import javax.xml.stream.XMLInputFactory; import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamReader; import java.io.StringReader; import java.util.Iterator; class WSRecepcaoLote { private static final String CTE_ELEMENTO = "CTe"; private static final Logger LOGGER = LoggerFactory.getLogger(WSRecepcaoLote.class); private final CTeConfig config; WSRecepcaoLote(final CTeConfig config){ this.config = config; } public CTeEnvioLoteRetornoDados envioRecepcao(CTeEnvioLote cteRecepcaoLote) throws Exception { //assina o lote final String documentoAssinado = new AssinaturaDigital(this.config).assinarDocumento(cteRecepcaoLote.toString(), "infCte"); final CTeEnvioLote loteAssinado = new DFParser().cteRecepcaoParaObjeto(documentoAssinado); //comunica o lote final CTeEnvioLoteRetorno retorno = comunicaLote(documentoAssinado); return new CTeEnvioLoteRetornoDados(retorno, loteAssinado); } private CTeEnvioLoteRetorno comunicaLote(final String loteAssinadoXml) throws Exception { //valida o lote assinado, para verificar se o xsd foi satisfeito, antes de comunicar com a sefaz XMLValidador.validaLoteCTe(loteAssinadoXml); //envia o lote para a sefaz final OMElement omElement = this.cteToOMElement(loteAssinadoXml); final CteDadosMsg dados = new CteDadosMsg(); dados.setExtraElement(omElement); final CteCabecMsgE cabecalhoSOAP = this.getCabecalhoSOAP(); WSRecepcaoLote.LOGGER.info(omElement.toString()); final CTAutorizador31 autorizador = CTAutorizador31.valueOfTipoEmissao(this.config.getTipoEmissao(), this.config.getCUF()); final String endpoint = autorizador.getCteRecepcao(this.config.getAmbiente()); if (endpoint == null) { throw new IllegalArgumentException("Nao foi possivel encontrar URL para Recepcao, autorizador " + autorizador.name() + ", UF " + this.config.getCUF().name()); } WSRecepcaoLote.LOGGER.info(endpoint); final CteRecepcaoLoteResult autorizacaoLoteResult = new CteRecepcaoStub(endpoint).cteRecepcaoLote(dados, cabecalhoSOAP); final CTeEnvioLoteRetorno retorno = new DFPersister().read(CTeEnvioLoteRetorno.class, autorizacaoLoteResult.getExtraElement().toString()); WSRecepcaoLote.LOGGER.info(retorno.toString()); return retorno; } private CteCabecMsgE getCabecalhoSOAP() { final CteCabecMsg cabecalho = new CteCabecMsg(); cabecalho.setCUF(this.config.getCUF().getCodigoIbge()); cabecalho.setVersaoDados(CTeConfig.VERSAO); final CteCabecMsgE cabecalhoSOAP = new CteCabecMsgE(); cabecalhoSOAP.setCteCabecMsg(cabecalho); return cabecalhoSOAP; } private OMElement cteToOMElement(final String documento) throws XMLStreamException { final XMLInputFactory factory = XMLInputFactory.newInstance(); factory.setProperty(XMLInputFactory.IS_COALESCING, false); XMLStreamReader reader = factory.createXMLStreamReader(new StringReader(documento)); StAXOMBuilder builder = new StAXOMBuilder(reader); final OMElement ome = builder.getDocumentElement(); final Iterator<?> children = ome.getChildrenWithLocalName(WSRecepcaoLote.CTE_ELEMENTO); while (children.hasNext()) { final OMElement omElement = (OMElement) children.next(); if ((omElement != null) && (WSRecepcaoLote.CTE_ELEMENTO.equals(omElement.getLocalName()))) { omElement.addAttribute("xmlns", CTeConfig.NAMESPACE, null); } } return ome; } }
jefperito/nfe
src/main/java/com/fincatto/documentofiscal/cte300/webservices/WSRecepcaoLote.java
Java
apache-2.0
4,938
/** * Copyright (c) 2011-2013, kidzhou 周磊 (zhouleib1412@gmail.com) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.tuohang.framework.jfinal.ext.handler; import com.google.common.collect.Maps; import com.jfinal.handler.Handler; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.util.Map; import java.util.Map.Entry; public class AddHeaderHandler extends Handler { private final Map<String, Object> headers = Maps.newHashMap(); public AddHeaderHandler addHeader(String name, String header) { headers.put(name, header); return this; } @Override public void handle(String target, HttpServletRequest request, HttpServletResponse response, boolean[] isHandled) { for (Entry<String, Object> entry : headers.entrySet()) { Object header = entry.getValue(); String name = entry.getKey(); if (header instanceof String) { response.addHeader(name, (String) header); } else if (header instanceof Integer) { response.addIntHeader(name, (Integer) header); } else if (header instanceof Long) { response.addDateHeader(name, (Long) header); } else { new RuntimeException("Not support the name (" + name + ") with value that type is " + header.getClass()); } } nextHandler.handle(target, request, response, isHandled); } }
tuohang/jfinal-framework
src/main/java/com/tuohang/framework/jfinal/ext/handler/AddHeaderHandler.java
Java
apache-2.0
2,084
<!-- This file was autogenerated via cilium cmdref, do not edit manually--> ## cilium bpf sha list List BPF template objects. ### Synopsis List BPF template objects. ``` cilium bpf sha list [flags] ``` ### Options ``` -h, --help help for list -o, --output string json| jsonpath='{}' ``` ### Options inherited from parent commands ``` --config string config file (default is $HOME/.cilium.yaml) -D, --debug Enable debug messages -H, --host string URI to server-side API ``` ### SEE ALSO * [cilium bpf sha](../cilium_bpf_sha) - Manage compiled BPF template objects
cilium-team/cilium
Documentation/cmdref/cilium_bpf_sha_list.md
Markdown
apache-2.0
619
/* * Copyright 2017 - 2018 Aitu Software Limited. * * 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.aitusoftware.transport.messaging; import com.aitusoftware.transport.Fixtures; import com.aitusoftware.transport.buffer.PageCache; import com.aitusoftware.transport.messaging.proxy.PublisherFactory; import com.aitusoftware.transport.messaging.proxy.Subscriber; import com.aitusoftware.transport.messaging.proxy.SubscriberFactory; import com.aitusoftware.transport.reader.StreamingReader; import com.aitusoftware.transport.threads.Idlers; import org.agrona.collections.Int2ObjectHashMap; import org.junit.Before; import org.junit.Test; import java.nio.file.Path; import java.util.concurrent.TimeUnit; import static org.hamcrest.CoreMatchers.is; import static org.junit.Assert.assertThat; public final class TopicDispatcherRecordHandlerTest { private final Path tempDir = Fixtures.tempDirectory(); private final SubscriberFactory subscriberFactory = new SubscriberFactory(); private PublisherFactory factory; private PageCache pageCache; @Before public void setUp() throws Exception { pageCache = PageCache.create(tempDir, 4096); factory = new PublisherFactory(pageCache); } @Test public void shouldDispatchMessages() throws Exception { final TestTopicMessageCounter testTopicMessageCounter = new TestTopicMessageCounter(); final Subscriber testTopicSubscriber = subscriberFactory.getSubscriber(TestTopic.class, testTopicMessageCounter); final Subscriber otherTopicSubscriber = subscriberFactory.getSubscriber(OtherTopic.class, new OtherTopicMessageCounter()); final TestTopic proxy = factory.getPublisherProxy(TestTopic.class); final OtherTopic paramTester = factory.getPublisherProxy(OtherTopic.class); proxy.say("hola", 7); paramTester.testParams(true, (byte) 5, (short) 7, 11, 13.7f, 17L, 19.37d, "first", "second"); proxy.say("bonjour", 11); paramTester.testParams(false, (byte) -5, (short) -7, -11, Float.MAX_VALUE, Long.MIN_VALUE, Double.POSITIVE_INFINITY, "first", "second"); final Int2ObjectHashMap<Subscriber> subscriberMap = new Int2ObjectHashMap<>(); subscriberMap.put(testTopicSubscriber.getTopicId(), testTopicSubscriber); subscriberMap.put(otherTopicSubscriber.getTopicId(), otherTopicSubscriber); final TopicDispatcherRecordHandler topicDispatcher = new TopicDispatcherRecordHandler(subscriberMap); new StreamingReader(pageCache, topicDispatcher, false, Idlers.staticPause(1, TimeUnit.MILLISECONDS)).process(); assertThat(testTopicMessageCounter.getMessageCount(), is(2)); } }
aitusoftware/transport
src/test/java/com/aitusoftware/transport/messaging/TopicDispatcherRecordHandlerTest.java
Java
apache-2.0
3,292
/* * 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/ecl1.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.kra.committee.service; import org.kuali.kra.common.printing.CorrespondencePrintingService; public interface ScheduleCorrespondencePrint extends CorrespondencePrintingService { }
vivantech/kc_fixes
src/main/java/org/kuali/kra/committee/service/ScheduleCorrespondencePrint.java
Java
apache-2.0
823
Build/Test 3scale-operator-metadata ----------------------------------- Step 1) Build 3scale-operator-metadata builder image (once per release) $ docker build -t 3scale-operator-metadata-builder . Step 2) Build/Test 3scale-operator-metadata Usage: $ docker run --rm -v `pwd`:/ws 3scale-operator-metadata-builder bash -l -c "cd /ws; ./build.sh <rel_tag> 2>&1 | tee output.log" Examples: ========== Build Only ========== # by default, build "lasttestedrelease" which is v0.5.1 marked as 'Latest_Release' as of Apr-30-2021 # both the commands below build the "v0.5.1: branch $ docker run --rm -v `pwd`:/ws 3scale-operator-metadata-builder bash -l -c "cd /ws; ./build.sh 2>&1 | tee output.log" $ docker run --rm -v `pwd`:/ws 3scale-operator-metadata-builder bash -l -c "cd /ws; ./build.sh lasttestedrelease 2>&1 | tee output.log" # to build master branch $ docker run --rm -v `pwd`:/ws 3scale-operator-metadata-builder bash -l -c "cd /ws; ./build.sh master 2>&1 | tee output.log" # build specific branch/release $ docker run --rm -v `pwd`:/ws 3scale-operator-metadata-builder bash -l -c "cd /ws; ./build.sh v0.5.1 2>&1 | tee output.log"
ppc64le/build-scripts
3/3scale-operator-metadata/redhat_ubi8/README.md
Markdown
apache-2.0
1,355
<!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_79) on Mon Aug 17 17:11:17 IST 2015 --> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Uses of Class org.apache.solr.spelling.SpellingResult (Solr 5.3.0 API)</title> <meta name="date" content="2015-08-17"> <link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style"> </head> <body> <script type="text/javascript"><!-- if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Class org.apache.solr.spelling.SpellingResult (Solr 5.3.0 API)"; } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar_top"> <!-- --> </a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../org/apache/solr/spelling/SpellingResult.html" title="class in org.apache.solr.spelling">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="../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../index.html?org/apache/solr/spelling/class-use/SpellingResult.html" target="_top">Frames</a></li> <li><a href="SpellingResult.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip-navbar_top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <div class="header"> <h2 title="Uses of Class org.apache.solr.spelling.SpellingResult" class="title">Uses of Class<br>org.apache.solr.spelling.SpellingResult</h2> </div> <div class="classUseContainer"> <ul class="blockList"> <li class="blockList"> <table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing packages, and an explanation"> <caption><span>Packages that use <a href="../../../../../org/apache/solr/spelling/SpellingResult.html" title="class in org.apache.solr.spelling">SpellingResult</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Package</th> <th class="colLast" scope="col">Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><a href="#org.apache.solr.handler.component">org.apache.solr.handler.component</a></td> <td class="colLast"> <div class="block"><a href="../../../../../org/apache/solr/handler/component/SearchComponent.html" title="class in org.apache.solr.handler.component"><code>SearchComponent</code></a> implementations for use in <a href="../../../../../org/apache/solr/handler/component/SearchHandler.html" title="class in org.apache.solr.handler.component"><code>SearchHandler</code></a></div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="#org.apache.solr.spelling">org.apache.solr.spelling</a></td> <td class="colLast"> <div class="block">APIs and classes used by the <a href="../../../../../org/apache/solr/handler/component/SpellCheckComponent.html" title="class in org.apache.solr.handler.component"><code>SpellCheckComponent</code></a></div> </td> </tr> <tr class="altColor"> <td class="colFirst"><a href="#org.apache.solr.spelling.suggest">org.apache.solr.spelling.suggest</a></td> <td class="colLast"> <div class="block">APIs and classes used by the <a href="../../../../../org/apache/solr/handler/component/SpellCheckComponent.html" title="class in org.apache.solr.handler.component"><code>SpellCheckComponent</code></a></div> </td> </tr> </tbody> </table> </li> <li class="blockList"> <ul class="blockList"> <li class="blockList"><a name="org.apache.solr.handler.component"> <!-- --> </a> <h3>Uses of <a href="../../../../../org/apache/solr/spelling/SpellingResult.html" title="class in org.apache.solr.spelling">SpellingResult</a> in <a href="../../../../../org/apache/solr/handler/component/package-summary.html">org.apache.solr.handler.component</a></h3> <table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation"> <caption><span>Methods in <a href="../../../../../org/apache/solr/handler/component/package-summary.html">org.apache.solr.handler.component</a> with parameters of type <a href="../../../../../org/apache/solr/spelling/SpellingResult.html" title="class in org.apache.solr.spelling">SpellingResult</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code>protected void</code></td> <td class="colLast"><span class="strong">SpellCheckComponent.</span><code><strong><a href="../../../../../org/apache/solr/handler/component/SpellCheckComponent.html#addCollationsToResponse(org.apache.solr.common.params.SolrParams,%20org.apache.solr.spelling.SpellingResult,%20org.apache.solr.handler.component.ResponseBuilder,%20java.lang.String,%20org.apache.solr.common.util.NamedList,%20boolean)">addCollationsToResponse</a></strong>(<a href="../../../../../../solr-solrj/org/apache/solr/common/params/SolrParams.html?is-external=true" title="class or interface in org.apache.solr.common.params">SolrParams</a>&nbsp;params, <a href="../../../../../org/apache/solr/spelling/SpellingResult.html" title="class in org.apache.solr.spelling">SpellingResult</a>&nbsp;spellingResult, <a href="../../../../../org/apache/solr/handler/component/ResponseBuilder.html" title="class in org.apache.solr.handler.component">ResponseBuilder</a>&nbsp;rb, <a href="http://download.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;q, <a href="../../../../../../solr-solrj/org/apache/solr/common/util/NamedList.html?is-external=true" title="class or interface in org.apache.solr.common.util">NamedList</a>&nbsp;response, boolean&nbsp;suggestionsMayOverlap)</code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><code>protected <a href="../../../../../../solr-solrj/org/apache/solr/common/util/NamedList.html?is-external=true" title="class or interface in org.apache.solr.common.util">NamedList</a></code></td> <td class="colLast"><span class="strong">SpellCheckComponent.</span><code><strong><a href="../../../../../org/apache/solr/handler/component/SpellCheckComponent.html#toNamedList(boolean,%20org.apache.solr.spelling.SpellingResult,%20java.lang.String,%20boolean)">toNamedList</a></strong>(boolean&nbsp;shardRequest, <a href="../../../../../org/apache/solr/spelling/SpellingResult.html" title="class in org.apache.solr.spelling">SpellingResult</a>&nbsp;spellingResult, <a href="http://download.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;origQuery, boolean&nbsp;extendedResults)</code>&nbsp;</td> </tr> </tbody> </table> </li> <li class="blockList"><a name="org.apache.solr.spelling"> <!-- --> </a> <h3>Uses of <a href="../../../../../org/apache/solr/spelling/SpellingResult.html" title="class in org.apache.solr.spelling">SpellingResult</a> in <a href="../../../../../org/apache/solr/spelling/package-summary.html">org.apache.solr.spelling</a></h3> <table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation"> <caption><span>Methods in <a href="../../../../../org/apache/solr/spelling/package-summary.html">org.apache.solr.spelling</a> that return <a href="../../../../../org/apache/solr/spelling/SpellingResult.html" title="class in org.apache.solr.spelling">SpellingResult</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code><a href="../../../../../org/apache/solr/spelling/SpellingResult.html" title="class in org.apache.solr.spelling">SpellingResult</a></code></td> <td class="colLast"><span class="strong">WordBreakSolrSpellChecker.</span><code><strong><a href="../../../../../org/apache/solr/spelling/WordBreakSolrSpellChecker.html#getSuggestions(org.apache.solr.spelling.SpellingOptions)">getSuggestions</a></strong>(<a href="../../../../../org/apache/solr/spelling/SpellingOptions.html" title="class in org.apache.solr.spelling">SpellingOptions</a>&nbsp;options)</code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><code>abstract <a href="../../../../../org/apache/solr/spelling/SpellingResult.html" title="class in org.apache.solr.spelling">SpellingResult</a></code></td> <td class="colLast"><span class="strong">SolrSpellChecker.</span><code><strong><a href="../../../../../org/apache/solr/spelling/SolrSpellChecker.html#getSuggestions(org.apache.solr.spelling.SpellingOptions)">getSuggestions</a></strong>(<a href="../../../../../org/apache/solr/spelling/SpellingOptions.html" title="class in org.apache.solr.spelling">SpellingOptions</a>&nbsp;options)</code> <div class="block">Get suggestions for the given query.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code><a href="../../../../../org/apache/solr/spelling/SpellingResult.html" title="class in org.apache.solr.spelling">SpellingResult</a></code></td> <td class="colLast"><span class="strong">DirectSolrSpellChecker.</span><code><strong><a href="../../../../../org/apache/solr/spelling/DirectSolrSpellChecker.html#getSuggestions(org.apache.solr.spelling.SpellingOptions)">getSuggestions</a></strong>(<a href="../../../../../org/apache/solr/spelling/SpellingOptions.html" title="class in org.apache.solr.spelling">SpellingOptions</a>&nbsp;options)</code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><code><a href="../../../../../org/apache/solr/spelling/SpellingResult.html" title="class in org.apache.solr.spelling">SpellingResult</a></code></td> <td class="colLast"><span class="strong">ConjunctionSolrSpellChecker.</span><code><strong><a href="../../../../../org/apache/solr/spelling/ConjunctionSolrSpellChecker.html#getSuggestions(org.apache.solr.spelling.SpellingOptions)">getSuggestions</a></strong>(<a href="../../../../../org/apache/solr/spelling/SpellingOptions.html" title="class in org.apache.solr.spelling">SpellingOptions</a>&nbsp;options)</code>&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><code><a href="../../../../../org/apache/solr/spelling/SpellingResult.html" title="class in org.apache.solr.spelling">SpellingResult</a></code></td> <td class="colLast"><span class="strong">AbstractLuceneSpellChecker.</span><code><strong><a href="../../../../../org/apache/solr/spelling/AbstractLuceneSpellChecker.html#getSuggestions(org.apache.solr.spelling.SpellingOptions)">getSuggestions</a></strong>(<a href="../../../../../org/apache/solr/spelling/SpellingOptions.html" title="class in org.apache.solr.spelling">SpellingOptions</a>&nbsp;options)</code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><code><a href="../../../../../org/apache/solr/spelling/SpellingResult.html" title="class in org.apache.solr.spelling">SpellingResult</a></code></td> <td class="colLast"><span class="strong">SolrSpellChecker.</span><code><strong><a href="../../../../../org/apache/solr/spelling/SolrSpellChecker.html#mergeSuggestions(org.apache.solr.handler.component.SpellCheckMergeData,%20int,%20int,%20boolean)">mergeSuggestions</a></strong>(<a href="../../../../../org/apache/solr/handler/component/SpellCheckMergeData.html" title="class in org.apache.solr.handler.component">SpellCheckMergeData</a>&nbsp;mergeData, int&nbsp;numSug, int&nbsp;count, boolean&nbsp;extendedResults)</code> <div class="block">Integrate spelling suggestions from the various shards in a distributed environment.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code><a href="../../../../../org/apache/solr/spelling/SpellingResult.html" title="class in org.apache.solr.spelling">SpellingResult</a></code></td> <td class="colLast"><span class="strong">ConjunctionSolrSpellChecker.</span><code><strong><a href="../../../../../org/apache/solr/spelling/ConjunctionSolrSpellChecker.html#mergeSuggestions(org.apache.solr.handler.component.SpellCheckMergeData,%20int,%20int,%20boolean)">mergeSuggestions</a></strong>(<a href="../../../../../org/apache/solr/handler/component/SpellCheckMergeData.html" title="class in org.apache.solr.handler.component">SpellCheckMergeData</a>&nbsp;mergeData, int&nbsp;numSug, int&nbsp;count, boolean&nbsp;extendedResults)</code>&nbsp;</td> </tr> </tbody> </table> <table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation"> <caption><span>Methods in <a href="../../../../../org/apache/solr/spelling/package-summary.html">org.apache.solr.spelling</a> with parameters of type <a href="../../../../../org/apache/solr/spelling/SpellingResult.html" title="class in org.apache.solr.spelling">SpellingResult</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code><a href="http://download.oracle.com/javase/7/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a>&lt;<a href="../../../../../org/apache/solr/spelling/SpellCheckCollation.html" title="class in org.apache.solr.spelling">SpellCheckCollation</a>&gt;</code></td> <td class="colLast"><span class="strong">SpellCheckCollator.</span><code><strong><a href="../../../../../org/apache/solr/spelling/SpellCheckCollator.html#collate(org.apache.solr.spelling.SpellingResult,%20java.lang.String,%20org.apache.solr.handler.component.ResponseBuilder)">collate</a></strong>(<a href="../../../../../org/apache/solr/spelling/SpellingResult.html" title="class in org.apache.solr.spelling">SpellingResult</a>&nbsp;result, <a href="http://download.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;originalQuery, <a href="../../../../../org/apache/solr/handler/component/ResponseBuilder.html" title="class in org.apache.solr.handler.component">ResponseBuilder</a>&nbsp;ultimateResponse)</code>&nbsp;</td> </tr> </tbody> </table> </li> <li class="blockList"><a name="org.apache.solr.spelling.suggest"> <!-- --> </a> <h3>Uses of <a href="../../../../../org/apache/solr/spelling/SpellingResult.html" title="class in org.apache.solr.spelling">SpellingResult</a> in <a href="../../../../../org/apache/solr/spelling/suggest/package-summary.html">org.apache.solr.spelling.suggest</a></h3> <table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation"> <caption><span>Methods in <a href="../../../../../org/apache/solr/spelling/suggest/package-summary.html">org.apache.solr.spelling.suggest</a> that return <a href="../../../../../org/apache/solr/spelling/SpellingResult.html" title="class in org.apache.solr.spelling">SpellingResult</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code><a href="../../../../../org/apache/solr/spelling/SpellingResult.html" title="class in org.apache.solr.spelling">SpellingResult</a></code></td> <td class="colLast"><span class="strong">Suggester.</span><code><strong><a href="../../../../../org/apache/solr/spelling/suggest/Suggester.html#getSuggestions(org.apache.solr.spelling.SpellingOptions)">getSuggestions</a></strong>(<a href="../../../../../org/apache/solr/spelling/SpellingOptions.html" title="class in org.apache.solr.spelling">SpellingOptions</a>&nbsp;options)</code>&nbsp;</td> </tr> </tbody> </table> </li> </ul> </li> </ul> </div> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar_bottom"> <!-- --> </a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../org/apache/solr/spelling/SpellingResult.html" title="class in org.apache.solr.spelling">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="../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../index.html?org/apache/solr/spelling/class-use/SpellingResult.html" target="_top">Frames</a></li> <li><a href="SpellingResult.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip-navbar_bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> <p class="legalCopy"><small> <i>Copyright &copy; 2000-2015 Apache Software Foundation. All Rights Reserved.</i> <script src='../../../../../prettify.js' type='text/javascript'></script> <script type='text/javascript'> (function(){ var oldonload = window.onload; if (typeof oldonload != 'function') { window.onload = prettyPrint; } else { window.onload = function() { oldonload(); prettyPrint(); } } })(); </script> </small></p> </body> </html>
changwu/mqa
solr-5.3.0/docs/solr-core/org/apache/solr/spelling/class-use/SpellingResult.html
HTML
apache-2.0
19,095
using NVelocity; using NVelocity.App; using NVelocity.Runtime; using System; using System.Collections.Generic; using System.Data; using System.Linq; using System.Web; using Weixin_Server.MPServer.Helper; namespace Weixin_Server.Push.Action { public class RecordAction { /// <summary> /// 触发记录 /// </summary> /// <param name="context"></param> /// <returns></returns> public static string AddRec(HttpContext context) { WeiXinMsgInfo.OpenId = context.Request["openid"]; WeiXinMsgInfo.OriginalId = context.Request["originalid"]; WeiXinMsgInfo.ToUser = context.Request["to"]; WeiXinMsgInfo.Text = context.Request["text"]; return BindAction.IsBindFakeId(); } /// <summary> /// 遍历48小时内发送消息的用户 /// </summary> /// <returns></returns> public static string ListRec(HttpContext context) { string sHtml = "Id OpenId DateTime"; string sOriginalId = context.Request["OriginalId"]; DataTable dt = ListAction.ShowSendUser(sOriginalId); if (dt == null) { return "暂无数据"; } foreach (DataRow t in dt.Rows) { sHtml += string.Format("\n<br>{0} {1} {2}", t[0], t[1], t[2]); } return sHtml; } internal static string EditRec(HttpContext context) { if (context.Request.HttpMethod.ToLower() == "post") { EditAction.AddEdit(context); return "<script type=\"text/JavaScript\">alert(\"ADD Success;\");window.location.href='handler.ashx?do=edit&OriginalId=" + context.Request["OriginalId"] + "';</script>"; } else { DataTable dt = EditAction.ShowEdit(context); if (dt == null) { var J1 = new { tw = "", Text = "" }; var J2 = new { tw = "", Text = "" }; var datas = new { J1, J2 }; return CommonHelper.RenderHtml("edit.html",datas); } else { var j1 = new { tw = dt.Rows[0]["type"].ToString()=="1"?"selected=\"selected\"":"", Text = dt.Rows[0]["text"] }; var j2 = new { tw = dt.Rows[1]["type"].ToString() == "1" ? "selected=\"selected\"" : "", Text = dt.Rows[1]["text"] }; var data = new { j1, j2 }; return CommonHelper.RenderHtml("edit.html",data); } } } public static string SendRec(HttpContext context) { WeiXinMsgInfo.OpenId = context.Request["openid"]; WeiXinMsgInfo.OriginalId = context.Request["originalid"]; WeiXinMsgInfo.ToUser = context.Request["to"]; WeiXinMsgInfo.Text = context.Request["text"]; return SendAction.SendMessage(context); } } public class CommonHelper { /// <summary> /// 模版引擎 /// </summary> /// <param name="name">模版名</param> /// <param name="data">数据集合体</param> /// <returns></returns> public static string RenderHtml(string name, object data = null) { VelocityEngine vltEngine = new VelocityEngine(); vltEngine.SetProperty(RuntimeConstants.RESOURCE_LOADER, "file"); vltEngine.SetProperty(RuntimeConstants.FILE_RESOURCE_LOADER_PATH, System.Web.Hosting.HostingEnvironment.MapPath("~/push/tpl"));//模板文件所在的文件夹 vltEngine.Init(); VelocityContext vltContext = new VelocityContext(); vltContext.Put("Model", data); Template vltTemplate = vltEngine.GetTemplate(name); System.IO.StringWriter vltWriter = new System.IO.StringWriter(); vltTemplate.Merge(vltContext, vltWriter); return vltWriter.GetStringBuilder().ToString(); } } }
rmbzlib/weixinserver
Push/Action/RecordAction.cs
C#
apache-2.0
4,135
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>FST - Sebasti&amp;#xC3;&amp;#xA1;n Brugmans</title> <meta name="description" content="Keep track of the statistics from Sebasti&amp;#xC3;&amp;#xA1;n Brugmans. Average heat score, heat wins, heat wins percentage, epic heats road to the final"> <meta name="author" content=""> <link rel="apple-touch-icon" sizes="57x57" href="/favicon/apple-icon-57x57.png"> <link rel="apple-touch-icon" sizes="60x60" href="/favicon/apple-icon-60x60.png"> <link rel="apple-touch-icon" sizes="72x72" href="/favicon/apple-icon-72x72.png"> <link rel="apple-touch-icon" sizes="76x76" href="/favicon/apple-icon-76x76.png"> <link rel="apple-touch-icon" sizes="114x114" href="/favicon/apple-icon-114x114.png"> <link rel="apple-touch-icon" sizes="120x120" href="/favicon/apple-icon-120x120.png"> <link rel="apple-touch-icon" sizes="144x144" href="/favicon/apple-icon-144x144.png"> <link rel="apple-touch-icon" sizes="152x152" href="/favicon/apple-icon-152x152.png"> <link rel="apple-touch-icon" sizes="180x180" href="/favicon/apple-icon-180x180.png"> <link rel="icon" type="image/png" sizes="192x192" href="/favicon/android-icon-192x192.png"> <link rel="icon" type="image/png" sizes="32x32" href="/favicon/favicon-32x32.png"> <link rel="icon" type="image/png" sizes="96x96" href="/favicon/favicon-96x96.png"> <link rel="icon" type="image/png" sizes="16x16" href="/favicon/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"> <meta property="og:title" content="Fantasy Surfing tips"/> <meta property="og:image" content="https://fantasysurfingtips.com/img/just_waves.png"/> <meta property="og:description" content="See how great Sebasti&amp;#xC3;&amp;#xA1;n Brugmans is surfing this year"/> <!-- Bootstrap Core CSS - Uses Bootswatch Flatly Theme: https://bootswatch.com/flatly/ --> <link href="https://fantasysurfingtips.com/css/bootstrap.css" rel="stylesheet"> <!-- Custom CSS --> <link href="https://fantasysurfingtips.com/css/freelancer.css" rel="stylesheet"> <link href="https://cdn.datatables.net/plug-ins/1.10.7/integration/bootstrap/3/dataTables.bootstrap.css" rel="stylesheet" /> <!-- Custom Fonts --> <link href="https://fantasysurfingtips.com/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css"> <link href="https://fonts.googleapis.com/css?family=Montserrat:400,700" rel="stylesheet" type="text/css"> <link href="https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic" rel="stylesheet" type="text/css"> <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/morris.js/0.5.1/morris.css"> <script src="https://code.jquery.com/jquery-2.x-git.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-ujs/1.2.1/rails.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/raphael/2.1.0/raphael-min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/morris.js/0.5.1/morris.min.js"></script> <script src="https://www.w3schools.com/lib/w3data.js"></script> <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> <script> (adsbygoogle = window.adsbygoogle || []).push({ google_ad_client: "ca-pub-2675412311042802", enable_page_level_ads: true }); </script> </head> <body> <div id="fb-root"></div> <script>(function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/en_GB/sdk.js#xfbml=1&version=v2.6"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk'));</script> <!-- Navigation --> <div w3-include-html="https://fantasysurfingtips.com/layout/header.html"></div> <!-- Header --> <div w3-include-html="https://fantasysurfingtips.com/layout/sponsor.html"></div> <section > <div class="container"> <div class="row"> <div class="col-sm-3 "> <div class="col-sm-2 "> </div> <div class="col-sm-8 "> <!-- <img src="http://fantasysurfingtips.com/img/surfers/sbru.png" class="img-responsive" alt=""> --> <h3 style="text-align:center;">Sebasti&amp;#xC3;&amp;#xA1;n Brugmans</h3> <a href="https://twitter.com/share" class="" data-via="fansurfingtips"><i class="fa fa-twitter"></i> Share on Twitter</i></a> <br/> <a class="fb-xfbml-parse-ignore" target="_blank" href="https://www.facebook.com/sharer/sharer.php?u=http%3A%2F%2Ffantasysurfingtips.com%2Fsurfers%2Fsbru&amp;src=sdkpreparse"><i class="fa fa-facebook"></i> Share on Facebook</a> </div> <div class="col-sm-2 "> </div> </div> <div class="col-sm-3 portfolio-item"> </div> <div class="col-sm-3 portfolio-item"> <h6 style="text-align:center;">Avg Heat Score (FST DATA)</h6> <h1 style="text-align:center;">3.99</h1> </div> </div> <hr/> <h4 style="text-align:center;" >Heat Stats (FST data)</h4> <div class="row"> <div class="col-sm-4 portfolio-item"> <h6 style="text-align:center;">Heats</h6> <h2 style="text-align:center;">2</h2> </div> <div class="col-sm-4 portfolio-item"> <h6 style="text-align:center;">Heat wins</h6> <h2 style="text-align:center;">0</h2> </div> <div class="col-sm-4 portfolio-item"> <h6 style="text-align:center;">HEAT WINS PERCENTAGE</h6> <h2 style="text-align:center;">0.0%</h2> </div> </div> <hr/> <h4 style="text-align:center;">Avg Heat Score progression</h4> <div id="avg_chart" style="height: 250px;"></div> <hr/> <h4 style="text-align:center;">Heat stats progression</h4> <div id="heat_chart" style="height: 250px;"></div> <hr/> <style type="text/css"> .heats-all{ z-index: 3; margin-left: 5px; cursor: pointer; } </style> <div class="container"> <div id="disqus_thread"></div> <script> /** * RECOMMENDED CONFIGURATION VARIABLES: EDIT AND UNCOMMENT THE SECTION BELOW TO INSERT DYNAMIC VALUES FROM YOUR PLATFORM OR CMS. * LEARN WHY DEFINING THESE VARIABLES IS IMPORTANT: https://disqus.com/admin/universalcode/#configuration-variables*/ var disqus_config = function () { this.page.url = "http://fantasysurfingtips.com/surfers/sbru"; // Replace PAGE_URL with your page's canonical URL variable this.page.identifier = '2352'; // Replace PAGE_IDENTIFIER with your page's unique identifier variable }; (function() { // DON'T EDIT BELOW THIS LINE var d = document, s = d.createElement('script'); s.src = '//fantasysurfingtips.disqus.com/embed.js'; s.setAttribute('data-timestamp', +new Date()); (d.head || d.body).appendChild(s); })(); </script> <noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript> </div> </section> <script type="text/javascript"> $('.heats-all').click(function(){ $('.heats-all-stat').css('display', 'none') $('#'+$(this).attr('id')+'-stat').css('display', 'block') }); $('.heats-2016').click(function(){ $('.heats-2016-stat').css('display', 'none') $('#'+$(this).attr('id')+'-stat').css('display', 'block') }); $('document').ready(function(){ new Morris.Line({ // ID of the element in which to draw the chart. element: 'avg_chart', // Chart data records -- each entry in this array corresponds to a point on // the chart. data: [], // The name of the data record attribute that contains x-values. xkey: 'year', // A list of names of data record attributes that contain y-values. ykeys: ['avg', 'avg_all'], // Labels for the ykeys -- will be displayed when you hover over the // chart. labels: ['Avg score in year', 'Avg score FST DATA'] }); new Morris.Bar({ // ID of the element in which to draw the chart. element: 'heat_chart', // Chart data records -- each entry in this array corresponds to a point on // the chart. data: [], // The name of the data record attribute that contains x-values. xkey: 'year', // A list of names of data record attributes that contain y-values. ykeys: ['heats', 'wins', 'percs'], // Labels for the ykeys -- will be displayed when you hover over the // chart. labels: ['Heats surfed', 'Heats won', 'Winning percentage'] }); }); </script> <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> <!-- Footer --> <div w3-include-html="https://fantasysurfingtips.com/layout/footer.html"></div> <script type="text/javascript"> (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-74337819-1', 'auto'); // Replace with your property ID. ga('send', 'pageview'); </script> <script> w3IncludeHTML(); </script> <!-- jQuery --> <script src="https://fantasysurfingtips.com/js/jquery.js"></script> <script src="https://cdn.datatables.net/1.10.7/js/jquery.dataTables.min.js"></script> <!-- Bootstrap Core JavaScript --> <script src="https://fantasysurfingtips.com/js/bootstrap.min.js"></script> <!-- Plugin JavaScript --> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-easing/1.3/jquery.easing.min.js"></script> <script src="https://fantasysurfingtips.com/js/classie.js"></script> <script src="https://fantasysurfingtips.com/js/cbpAnimatedHeader.js"></script> <!-- Contact Form JavaScript --> <script src="https://fantasysurfingtips.com/js/jqBootstrapValidation.js"></script> <script src="https://fantasysurfingtips.com/js/contact_me.js"></script> <!-- Custom Theme JavaScript --> <script src="https://fantasysurfingtips.com/js/freelancer.js"></script> <script type="https://cdn.datatables.net/1.10.12/js/jquery.dataTables.min.js"></script> <script type="https://cdn.datatables.net/1.10.12/js/dataTables.bootstrap.min.js"></script> </body> </html>
chicofilho/fst
surfers/mqs/sbru.html
HTML
apache-2.0
11,266
package fi.vincit.multiusertest.rule.expectation; /** * Function call without return value * @since 1.0 */ public interface FunctionCall { void call() throws Throwable; }
Vincit/multi-user-test-runner
core/src/main/java/fi/vincit/multiusertest/rule/expectation/FunctionCall.java
Java
apache-2.0
179
const path = require('path') const json = require('@rollup/plugin-json') const alias = require('@rollup/plugin-alias') const replace = require('@rollup/plugin-replace') const PLATFORMS = { 'mp-weixin': { prefix: 'wx', title: '微信小程序' }, 'mp-qq': { prefix: 'wx', title: 'QQ小程序' }, 'mp-alipay': { prefix: 'my', title: '支付宝小程序' }, 'mp-baidu': { prefix: 'swan', title: '百度小程序' }, 'mp-toutiao': { prefix: 'tt', title: '头条小程序' }, 'mp-kuaishou': { prefix: 'ks', title: '快手小程序' }, 'mp-lark': { prefix: 'tt', title: '飞书小程序' }, 'mp-jd': { prefix: 'jd', title: '京东小程序' }, 'quickapp-webview': { prefix: 'qa', title: '快应用(Webview)版' }, 'app-plus': { prefix: 'wx', title: 'app-plus' } } const platform = PLATFORMS[process.env.UNI_PLATFORM] let input = 'src/core/runtime/index.js' const output = { file: `packages/uni-${process.env.UNI_PLATFORM}/dist/index.js`, format: 'es' } if (process.env.UNI_MP) { input = 'src/core/runtime/mp/index.js' output.file = `packages/uni-${process.env.UNI_PLATFORM}/dist/mp.js` } module.exports = { input, output, plugins: [ alias({ entries: [{ find: '@dcloudio', replacement: path.resolve(__dirname, '../packages') }, { find: 'uni-shared/query', replacement: path.resolve(__dirname, '../src/shared/query.js') }, { find: 'uni-shared', replacement: path.resolve(__dirname, '../src/shared/util.js') }, { find: 'uni-platform', replacement: path.resolve(__dirname, '../src/platforms/' + process.env.UNI_PLATFORM) }, { find: 'uni-wrapper', replacement: path.resolve(__dirname, '../src/core/runtime/wrapper') }, { find: 'uni-helpers', replacement: path.resolve(__dirname, '../src/core/helpers') }] }), json(), replace({ __GLOBAL__: platform.prefix, __PLATFORM_TITLE__: platform.title, __PLATFORM_PREFIX__: JSON.stringify(platform.prefix), __PLATFORM__: JSON.stringify(process.env.UNI_PLATFORM) }) ], external: ['vue', '@dcloudio/uni-i18n'] }
dcloudio/uni-app
build/rollup.config.mp.js
JavaScript
apache-2.0
2,359
/* * Copyright 2015 Sergej Meister * * 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.intellijob.exceptions; import com.intellijob.enums.Error; /** * Base application exception. */ public abstract class BaseException extends Exception { protected Error error; public BaseException(BaseException be) { super(be.getError().getMessage()); this.error = be.getError(); } public BaseException(Error error) { super(error.getMessage()); this.error = error; } public BaseException(Error error, Throwable cause) { super(error.getMessage(), cause); this.error = error; } /** * Returns error. * * @return error. */ public Error getError() { return error; } }
SergejMeister/intellijob
src/main/java/com/intellijob/exceptions/BaseException.java
Java
apache-2.0
1,298
chromeMyAdmin.controller("CreateRoutineDialogController", ["$scope", "Events", "mySQLClientService", "typeService", "sqlExpressionService", "targetObjectService", function($scope, Events, mySQLClientService, typeService, sqlExpressionService, targetObjectService) { "use strict"; var onShowDialog = function() { resetErrorMessage(); $scope.routineName = ""; $scope.routineType = "PROCEDURE"; $scope.parameters = []; $scope.routineBody = ""; $scope.deterministic = "false"; $scope.sqlSecurity = "DEFINER"; $scope.characteristic = "CONTAINS SQL"; $scope.comment = ""; $scope.returnTypeName = "INT"; $scope.returnTypeLength = null; $scope.returnTypeOption = ""; resetNewPrameterForm(); $("#createRoutineDialog").modal("show"); }; var resetNewPrameterForm = function() { $scope.newIo = "IN"; $scope.newParamName = ""; $scope.newTypeName = "INT"; $scope.newTypeLength = null; $scope.newTypeOption = ""; }; var assignEventHandlers = function() { $scope.$on(Events.SHOW_CREATE_ROUTINE_DIALOG, function(event, data) { onShowDialog(); }); }; var setupItems = function() { $scope.ios = ["IN", "OUT", "INOUT"]; $scope.types = typeService.getTypes(); $scope.typeOptions = ["", "UNSIGNED", "ZEROFILL", "UNSIGNED ZEROFILL"]; $scope.characteristics = ["CONTAINS SQL", "NO SQL", "READS SQL DATA", "MODIFIES SQL DATA"]; $scope.routineTypes = ["PROCEDURE", "FUNCTION"]; }; var resetErrorMessage = function() { $scope.errorMessage = ""; }; $scope.isErrorMessageVisible = function() { return $scope.errorMessage.length > 0; }; $scope.initialize = function() { resetErrorMessage(); assignEventHandlers(); setupItems(); }; $scope.aceLoaded = function(editor) { $scope.editor = editor; editor.setHighlightActiveLine(false); editor.setShowPrintMargin(false); editor.setShowInvisibles(true); editor.getSession().setUseWrapMode(true); }; $scope.createRoutine = function() { var sql = "CREATE DEFINER=CURRENT_USER "; sql += $scope.routineType + " `"; sql += $scope.routineName + "` ("; var params = []; angular.forEach($scope.parameters, function(param) { var p = []; if ($scope.isProcedure()) { p.push(param.io); } p.push("`" + param.paramName + "`"); var type = param.typeName; if (param.typeLength) { type += "(" + param.typeLength + ")"; } p.push(type); if (param.typeOption) { p.push(param.typeOption); } params.push(p.join(" ")); }); sql += params.join(", ") + ") "; if (!$scope.isProcedure()) { sql += "RETURNS "; var type = $scope.returnTypeName; if ($scope.returnTypeLength) { type += "(" + $scope.returnTypeLength + ")"; } sql += type + " "; sql += $scope.returnTypeOption + " "; } if ($scope.deterministic === "true") { sql += "DETERMINISTIC "; } sql += "SQL SECURITY " + $scope.sqlSecurity + " "; sql += $scope.characteristic + " "; if ($scope.comment) { sql += "COMMENT '" + sqlExpressionService.replaceValue($scope.comment) + "' "; } sql += $scope.routineBody; mySQLClientService.query(sql).then(function(result) { if (result.hasResultsetRows) { $scope.fatalErrorOccurred("Creating routine failed."); } else { $("#createRoutineDialog").modal("hide"); targetObjectService.refreshProceduresFunctions(); } }, function(reason) { var errorMessage = "[Error code:" + reason.errorCode; errorMessage += " SQL state:" + reason.sqlState; errorMessage += "] "; errorMessage += reason.errorMessage; $scope.errorMessage = errorMessage; }); }; $scope.isProcedure = function() { return $scope.routineType === "PROCEDURE"; }; $scope.addParameter = function() { var io = $scope.newIo; var paramName = $scope.newParamName; var typeName = $scope.newTypeName; var typeLength = $scope.newTypeLength; var typeOption = $scope.newTypeOption; $scope.parameters.push({ io: io, paramName: paramName, typeName: typeName, typeLength: typeLength ? Number(typeLength) : null, typeOption: typeOption }); resetNewPrameterForm(); }; $scope.deleteParameter = function(target) { var idx = -1; angular.forEach($scope.parameters, function(parameter, index) { if (parameter.paramName === target.paramName) { idx = index; } }); if (idx !== -1) { $scope.parameters.splice(idx, 1); } }; }]);
igrep/chrome_mysql_admin
app/scripts/window/controllers/create_routine_dialog_controller.js
JavaScript
apache-2.0
5,262
package typeinfo;//: typeinfo/Staff.java import java.util.*; public class Staff extends ArrayList<Position> { public void add(String title, Person person) { add(new Position(title, person)); } public void add(String... titles) { for(String title : titles) add(new Position(title)); } public Staff(String... titles) { add(titles); } public boolean positionAvailable(String title) { for(Position position : this) if(position.getTitle().equals(title) && position.getPerson() == Person.NULL) return true; return false; } public void fillPosition(String title, Person hire) { for(Position position : this) if(position.getTitle().equals(title) && position.getPerson() == Person.NULL) { position.setPerson(hire); return; } throw new RuntimeException( "Position " + title + " not available"); } public static void main(String[] args) { Staff staff = new Staff("President", "CTO", "Marketing Manager", "Product Manager", "Project Lead", "Software Engineer", "Software Engineer", "Software Engineer", "Software Engineer", "Test Engineer", "Technical Writer"); staff.fillPosition("President", new Person("Me", "Last", "The Top, Lonely At")); staff.fillPosition("Project Lead", new Person("Janet", "Planner", "The Burbs")); if(staff.positionAvailable("Software Engineer")) staff.fillPosition("Software Engineer", new Person("Bob", "Coder", "Bright Light City")); System.out.println(staff); } } /* Output: [Position: President Person: Me Last The Top, Lonely At, Position: CTO NullPerson, Position: Marketing Manager NullPerson, Position: Product Manager NullPerson, Position: Project Lead Person: Janet Planner The Burbs, Position: Software Engineer Person: Bob Coder Bright Light City, Position: Software Engineer NullPerson, Position: Software Engineer NullPerson, Position: Software Engineer NullPerson, Position: Test Engineer NullPerson, Position: Technical Writer NullPerson] *///:~
mayonghui2112/helloWorld
sourceCode/testMaven/thinkingInJava/src/main/java/typeinfo/Staff.java
Java
apache-2.0
2,075
<div> <div class="page-container"> <h1 class="cr-page-header">{{ 'SHARD.SHARDS' | translate }}</h1> <div class="cr-panel-block" ng-show="empty"> There are no shards. Shards are created and started when you create tables. </div> <div class="progress" ng-show="!empty && !shards"> <div class="indeterminate"></div> </div> <div id="shards-table--options" class="table-responsive" ng-show="!empty && shards"> <table class="table no-margin-bottom no-border-bottom"> <thead> <tr> <th class="header cr-table-cell shards-options-header" ng-show="shards"> <div class="shard-options"> <input id="id-option" type="checkbox" ng-model="idOption" ng-change="showShardIds()"> <label for="id-option">{{ 'SHARD.SHOW_SHARD_IDS' | translate }}</label> </div> </th> <th class="header cr-table-cell shards-options-header" ng-show="shards"> <div class="shard-legend"> <span class="shard-item cr-shard-primary cr-shard-state--green"> </span><span class="shard-item-label">{{ 'SHARD.STARTED_PRIMARY' | translate }}</span> <span class="shard-item cr-shard-state--green"> </span><span class="shard-item-label">{{ 'SHARD.STARTED_REPLICA' | translate }}</span> <span class="shard-item cr-shard-state--yellow"> </span><span class="shard-item-label">{{ 'SHARD.INITIALIZING' | translate }}</span> <span class="shard-item cr-shard-state--red"> </span><span class="shard-item-label">{{ 'SHARD.RELOCATING' | translate }}</span> <span class="shard-item cr-shard-primary cr-shard-state--grey"> </span><span class="shard-item-label">{{ 'SHARD.UNASSIGNED' | translate }}</span> </div> </th> </tr> </thead> </table> </div> <div id="shards-table" class="table-responsive" ng-show="!empty && shards"> <table class="table"> <thead> <tr> <th class="cr-table-cell th--no-border-bottom th--no-border-top"> </th> <th class="header cr-table-cell shards-table-schema_name th--no-border-top" ng-repeat="(schema_key, schema_value) in schemas track by schema_key" colspan="{{ schema_value }}"> {{ schema_key }} </th> </tr> <tr> <th class="cr-table-cell th--no-border-top"> </th> <th class="header cr-table-cell shards-table-table_name th--no-border-bottom" ng-repeat="(t_key, t_value) in tables track by t_key" ng-click="goToUrl('tables/' + t_key.split('.')[0] +'/'+ t_key.split('.')[1])" colspan="{{ t_value }}">{{ t_key.split('.')[1] }}</th> </tr> </thead> <tbody> <cr-custom-tooltip id="cr-custom-tooltip" class="cr-custom-tooltip" page-x="pageX" page-y="pageY" ng-if="displayTooltip"> <div class="progress" ng-show="tooltipLoading"> <div class="indeterminate"></div> </div> <div ng-show="tooltipError" class="node-content">No Information available.</div> <div ng-show="!isShard && !tooltipLoading && !tooltipError" class="node-content"> <div class="cr-custom-tooltip-section"> <div class="cr-custom-tooltip-label"> {{ 'SHARD.NODENAME' | translate }} </div> <div> {{ tooltipData.name }} </div> <div class="cr-custom-tooltip-label"> ID </div> <div> {{ tooltipData.id }} </div> <div class="cr-custom-tooltip-label"> Version </div> <div> {{ tooltipData.version }} </div> <div class="cr-custom-tooltip-label"> {{ 'SHARD.HOSTNAME' | translate }} </div> <div> {{ tooltipData.hostname }} </div> <div class="cr-custom-tooltip-label"> REST URL </div> <div> {{ tooltipData.rest_url }} </div> </div> </div> <div ng-show="isShard && !tooltipLoading && !tooltipError" class="shard-content"> <div class="cr-custom-tooltip-section"> <div class="cr-custom-tooltip-label"> {{ 'SHARD.ID' | translate }} </div> <div> {{ tooltipData.id }} </div> <div class="cr-custom-tooltip-label"> {{ 'SHARD.SIZE' | translate }} </div> <div> {{ tooltipData.size }} </div> <div class="cr-custom-tooltip-label"> {{ 'SHARD.MINIMUM_LUCENE_VERSION' | translate }} </div> <div> {{ tooltipData.min_lucene_version }} </i> </div> <div class="cr-custom-tooltip-label"> {{ 'SHARD.NUMBER_OF_RECORDS' | translate }} </div> <div> {{ tooltipData.num_docs }} </div> <div ng-if = "tooltipData.partition_ident" class="cr-custom-tooltip-label"> {{ 'SHARD.PARTITION_IDENTIFIER' | translate }} </div> <div ng-if = "tooltipData.partition_ident"> {{ tooltipData.partition_ident }} </div> </div> <div class="cr-custom-tooltip-section "> <div class="cr-custom-tooltip-label"> {{ 'SHARD.PRIMARY_SHARD' | translate }} </div> <div> {{ tooltipData.primary }} </div> <div class="cr-custom-tooltip-label"> {{ 'SHARD.RELOCATION_NODE' | translate }} </div> <div> {{ tooltipData.relocating_node || 'NULL'}} </div> <div class="cr-custom-tooltip-label"> {{ 'SHARD.ROUTING_STATE' | translate }} </div> <div> {{ tooltipData.routing_state }} </div> <div class="cr-custom-tooltip-label"> {{ 'SHARD.STATE' | translate }} </div> <div> {{ tooltipData.state}} </div> <div ng-repeat="(key, value) in tooltipData.values"> <div ng-if = "tooltipData.values" class="cr-custom-tooltip-label"> {{ key }} </div> <div ng-if = "tooltipData.values"> {{ value }} </div> </div> </div> </div> </cr-custom-tooltip> <tr ng-repeat="(node_key, node_value) in shards track by node_key" ng-show="node_value.node_info.name != 'UNASSIGNED'"> <td class="cr-table-cell shards-table-node" ng-click="goToUrl('nodes/' + node_key)" data-node="{{node_key}}"> {{ 'SHARD.NODENAME' | translate }}: {{ node_value.node_info.name }} </td> <td class="cr-table-cell" ng-repeat="(shard_by_table_key, shard_by_table_value) in node_value.shards_by_table track by shard_by_table_key"> <shard-wrapper length="shard_by_table_value.shards.length" class="shard-item-wrapper"> <div ng-repeat="(shard_key, shard_value) in shard_by_table_value.shards track by shard_key" class="shard-item" ng-class="shard_value.state_class" data-key="{{shard_value.key}}" data-table="{{shard_by_table_key}}" data-node="{{node_key}}" data-id="{{shard_value.id}}" > <span class="shard-number" ng-show="idOption">{{ shard_value.id }}</span> </div> </shard-wrapper> </td> </tr> <tr ng-show="shards.unassigned"> <td class="cr-table-cell shards-table-node" data-node="unassigned"> <div class="shards-table-header">Unassigned</div> </td> <td class="cr-table-cell" ng-repeat="(shard_by_table_key, shard_by_table_value) in shards.unassigned.shards_by_table track by shard_by_table_key"> <shard-wrapper length="shard_by_table_value.shards.length" class="shard-item-wrapper"> <div ng-repeat="(shard_key, shard_value) in shard_by_table_value.shards track by shard_key" class="shard-item" ng-class="shard_value.state_class" data-key="{{shard_value.key}}" data-table="{{shard_by_table_key}}" data-node="unassigned" data-id="{{shard_value.id}}"> <span class="shard-number" ng-show="idOption">{{ shard_value.id }}</span> <div class="shard-replicas" ng-if="shard_value.replicas">{{ shard_value.replicas + 1 }}</div> </div> </shard-wrapper> </td> </tr> </tbody> </table> </div> </div> </div>
crate/crate-admin
app/plugins/shards/shards.html
HTML
apache-2.0
8,550
require 'spec_helper' feature 'Imprintable Trains' do # TODO context 'As a logged in user' do include_context 'logged_in_as_user' context 'when there are users with the "receiving" role' do given!(:order) { create(:order) } given!(:train) { create(:imprintable_train, state: 'ordered', job: order.jobs.first ) } background :each do allow(User).to receive(:of_role) { [user] } end scenario 'I can assign inventoried by to train', js: true do expect(train.inventoried_by).to be_nil visit show_train_path('imprintable_train', train) sleep 2.5 # user is already selected success_transition :inventoried expect(train.reload.state).to eq("inventoried") expect(train.inventoried_by_id).to eq(user.id) end scenario 'I can assign staged by to a train when inventorying', js: true do expect(train.staged_by).to be_nil visit show_train_path('imprintable_train', train) sleep 2.5 fill_in "imprintable_train_location", with: "New Location" success_transition :staged expect(train.reload.staged_by_id).to eq(user.id) end end end end
AnnArborTees/softwear-production
spec/features/trains/imprintable_trains_spec.rb
Ruby
apache-2.0
1,215
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package io.hops.metadata.yarn.dal.rmstatestore; import io.hops.exception.StorageException; import io.hops.metadata.common.EntityDataAccess; import java.util.Collection; import java.util.List; import java.util.Map; public interface CompletedContainersStatusDataAccess<T> extends EntityDataAccess { public void update(Collection<T> entry) throws StorageException; public Map<String, List<byte[]>> getAll() throws StorageException; }
bcleenders/hops-metadata-dal
src/main/java/io/hops/metadata/yarn/dal/rmstatestore/CompletedContainersStatusDataAccess.java
Java
apache-2.0
626
package com.zr.action; import java.io.IOException; import java.io.PrintWriter; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import com.zr.service.ReplyProcessService; import com.zr.service.impl.ReplyProcessServiceImpl; import net.sf.json.JSONObject; /** * Servlet implementation class UpdateReplyProcess */ @WebServlet("/UpdateReplyProcess") public class UpdateReplyProcessAction extends HttpServlet { private static final long serialVersionUID = 1L; ReplyProcessService rpservice = new ReplyProcessServiceImpl(); /** * @see HttpServlet#HttpServlet() */ public UpdateReplyProcessAction() { super(); // TODO Auto-generated constructor stub } /** * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response) */ protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // TODO Auto-generated method stub doPost(request, response); } /** * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response) */ protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // TODO Auto-generated method stub request.setCharacterEncoding("utf-8"); response.setCharacterEncoding("utf-8"); String stuid = request.getParameter("sid"); int sid = Integer.parseInt(stuid); String ques = request.getParameter("ques"); String answer = request.getParameter("answer"); int i = rpservice.updateReplyProcess(sid, ques, answer); JSONObject json = new JSONObject(); json.put("exception", i); PrintWriter pw = response.getWriter(); pw.write(json.toString()); } }
q631406010228/graduation_project
src/main/java/com/zr/action/UpdateReplyProcessAction.java
Java
apache-2.0
1,923
package com.diffey.view.progressview; import android.animation.Animator; import android.animation.AnimatorListenerAdapter; import android.animation.ValueAnimator; import android.content.Context; import android.content.res.TypedArray; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Paint; import android.util.AttributeSet; import android.view.View; import android.view.animation.AccelerateInterpolator; /** * Created by diff on 2016/1/22. */ public class ProgressView extends View { private static final int DEF_MAX = 100; private static final int DEF_PROGRESS = 0; private static final int DEF_PROGRESS_COLOR = Color.BLUE; private static final int DEF_BACKGROUND_COLOR = Color.TRANSPARENT; private static final int DEF_TEXT_COLOR = Color.WHITE; private static final int DEF_TEXT_OVER_COLOR = Color.BLACK; private static final float DEF_TEXT_SIZE = 25; private static final int DEF_TEXT_GRAVITY = 0; private static final float DEF_TEXT_GRAVITY_PADDING = 10; private int max = DEF_MAX; private int progress = DEF_PROGRESS; private int progressColor = DEF_PROGRESS_COLOR; private int backgroundColor = DEF_BACKGROUND_COLOR; private String text; private int textColor = DEF_TEXT_COLOR; private int textOverColor = DEF_TEXT_OVER_COLOR; private float textSize = DEF_TEXT_SIZE; private int textGravity = DEF_TEXT_GRAVITY; private float textGravityPadding = DEF_TEXT_GRAVITY_PADDING; private boolean isAnimator = false; private Paint mPaint; public ProgressView(Context context) { super(context); inflateAttrs(context, null); } public ProgressView(Context context, AttributeSet attrs) { super(context, attrs); inflateAttrs(context, attrs); } private void inflateAttrs(Context context, AttributeSet attrs) { mPaint = new Paint(); if (attrs != null) { TypedArray typedArray = context.obtainStyledAttributes(attrs, R.styleable.ProgressView); max = typedArray.getInt(R.styleable.ProgressView_max, DEF_MAX); progress = typedArray.getInt(R.styleable.ProgressView_progress, DEF_PROGRESS); progressColor = typedArray.getColor(R.styleable.ProgressView_progressColor, DEF_PROGRESS_COLOR); backgroundColor = typedArray.getColor(R.styleable.ProgressView_backgroundColor, DEF_BACKGROUND_COLOR); text = typedArray.getString(R.styleable.ProgressView_text); textColor = typedArray.getColor(R.styleable.ProgressView_textColor, DEF_TEXT_COLOR); textOverColor = typedArray.getColor(R.styleable.ProgressView_textOverColor, DEF_TEXT_OVER_COLOR); textSize = typedArray.getDimension(R.styleable.ProgressView_textSize, DEF_TEXT_SIZE); textGravity = typedArray.getInt(R.styleable.ProgressView_textGravity, DEF_TEXT_GRAVITY); textGravityPadding = typedArray.getDimension(R.styleable.ProgressView_textGravityPadding, DEF_TEXT_GRAVITY_PADDING); typedArray.recycle(); } } public int getMax() { return max; } public void setMax(int max) { this.max = max; invalidate(); } public int getProgress() { return progress; } public void setProgress(int progress) { this.progress = progress; invalidate(); } public int getProgressColor() { return progressColor; } public void setProgressColor(int progressColor) { this.progressColor = progressColor; invalidate(); } public String getText() { return text; } public void setText(String text) { this.text = text; invalidate(); } public int getTextColor() { return textColor; } public void setTextColor(int textColor) { this.textColor = textColor; invalidate(); } public int getBackgroundColor() { return backgroundColor; } @Override public void setBackgroundColor(int backgroundColor) { this.backgroundColor = backgroundColor; invalidate(); } public float getTextSize() { return textSize; } public void setTextSize(float textSize) { this.textSize = textSize; invalidate(); } public float getTextGravityPadding() { return textGravityPadding; } public void setTextGravityPadding(float textGravityPadding) { this.textGravityPadding = textGravityPadding; invalidate(); } public int getTextOverColor() { return textOverColor; } public void setTextOverColor(int textOverColor) { this.textOverColor = textOverColor; invalidate(); } /** * 显示进度加载动画 * * @param duration 动画间隔 */ public void showAnimator(int duration) { ValueAnimator animator = ValueAnimator.ofInt(0, progress); animator.setDuration(duration); animator.setInterpolator(new AccelerateInterpolator(2f)); animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() { @Override public void onAnimationUpdate(ValueAnimator animation) { setProgress((int) animation.getAnimatedValue()); } }); animator.addListener(new AnimatorListenerAdapter() { @Override public void onAnimationStart(Animator animation) { super.onAnimationStart(animation); isAnimator = true; } @Override public void onAnimationEnd(Animator animation) { super.onAnimationEnd(animation); isAnimator = false; invalidate(); } }); animator.start(); } @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { super.onMeasure(widthMeasureSpec, heightMeasureSpec); } @Override protected void onDraw(Canvas canvas) { super.onDraw(canvas); //绘制背景 canvas.drawColor(backgroundColor); //绘制progress checkProgress(); int progressWidth = getWidth() * progress / max; int progressHeight = getHeight(); mPaint.setColor(progressColor); canvas.drawRect(0, 0, progressWidth, progressHeight, mPaint); //绘制文字 if (text != null && !isAnimator) { mPaint.setColor(textColor); mPaint.setTextSize(textSize); Paint.FontMetricsInt fontMetrics = mPaint.getFontMetricsInt(); float tX; if (progressWidth < mPaint.measureText(text)) { mPaint.setColor(textOverColor); tX = textGravityPadding + progressWidth; } else { if (textGravity == 0) { tX = textGravityPadding; } else { tX = progressWidth - (mPaint.measureText(text) + textGravityPadding); } } canvas.drawText(text, tX, (progressHeight - fontMetrics.top - fontMetrics.bottom) / 2, mPaint); } } /** * 检查Progress */ private void checkProgress() { if (progress >= max) { progress = max; } } }
Runpop/ProgressView
progressview/src/main/java/com/diffey/view/progressview/ProgressView.java
Java
apache-2.0
7,354
package com.sms.meal.backend; import com.parse.ParseException; import com.parse.ParseFile; import com.parse.ParseObject; import com.sms.meal.domainmeal.MyMeal; import java.util.ArrayList; import java.util.List; public class ParseMealParser implements MealParser<ParseObject> { public List<MyMeal> extractUnbookedMealsFromListOfObject(List<ParseObject> list) { List<MyMeal> mMealList = new ArrayList<MyMeal>(); for (int i = 0; i < list.size(); i++) { ParseObject object = list.get(i); boolean booked = object.getBoolean("booked"); if (!booked) { mMealList.add(parseMeal(object)); } } return mMealList; } @Override public MyMeal parseMeal(ParseObject object) { String description = object.getString("description"); String name = object.getString("name"); String id = object.getObjectId(); String location = object.getString("location"); String owner = object.getString("owner"); ParseFile image = object.getParseFile("image"); MyMeal meal = new MyMeal(id, name, description, location, owner); try { meal.setImage(image.getData()); } catch (ParseException e) { meal.setImage(new byte[0]); } return meal; } @Override public ParseObject parseObjectMeal(MyMeal meal) { ParseObject parseMeal = new ParseObject("Meal"); parseMeal.put("name", meal.getName()); parseMeal.put("description", meal.getDescription()); parseMeal.put("location", meal.getLocation()); parseMeal.put("owner", meal.getOwner()); parseMeal.put("image", meal.getImage()); return parseMeal; } }
kul3r4/sms
apiclient/src/main/java/com/sms/meal/backend/ParseMealParser.java
Java
apache-2.0
1,758
# Stenophragma halophilum (C.A. Mey.) B. Fedtsch. SPECIES #### Status SYNONYM #### According to The Catalogue of Life, 3rd January 2011 #### Published in null #### Original name null ### Remarks null
mdoering/backbone
life/Plantae/Magnoliophyta/Magnoliopsida/Brassicales/Brassicaceae/Eutrema/Eutrema halophilum/ Syn. Stenophragma halophilum/README.md
Markdown
apache-2.0
204
package de.mchllngr.quickopen.receiver; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.os.Build; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import de.mchllngr.quickopen.model.ApplicationModel; import de.mchllngr.quickopen.service.NotificationService; import timber.log.Timber; /** * {@link BroadcastReceiver} for (re)starting the {@link NotificationService}. * * This abstract approach is needed, because each action needs it's own {@link BroadcastReceiver}. */ abstract class NotificationStarterReceiver extends BroadcastReceiver { /** * Returns true when the received action is correct for this {@link BroadcastReceiver}. * * @param action received action * @return true is the action is correct for this {@link BroadcastReceiver} */ protected abstract boolean isCorrectAction(@Nullable String action); /** * Start the {@link NotificationService} if called with the correct actions. */ @Override public void onReceive(Context context, Intent intent) { if (context == null || intent == null) return; String action = intent.getAction(); if (isCorrectAction(action)) { Timber.d("Action '" + action + "' received"); ApplicationModel.removeNotLaunchableAppsFromList(context); startNotificationService(context); } else Timber.w("Unknown action '" + action + "' received"); } protected void startNotificationService(@NonNull Context context) { Intent serviceIntent = new Intent(context, NotificationService.class); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) context.startForegroundService(serviceIntent); else context.startService(serviceIntent); } }
mchllngr/QuickOpen
app/src/main/java/de/mchllngr/quickopen/receiver/NotificationStarterReceiver.java
Java
apache-2.0
1,864
package com.zhukic.sectionedrecyclerview; import org.junit.Before; import org.junit.Test; import static org.assertj.core.api.Java6Assertions.assertThat; import static org.mockito.Mockito.mock; public class SectionManageIsFirstItemInSectionTest { private SectionManager sectionManager; private SectionProvider sectionProvider; @Before public void beforeEachTest() { sectionProvider = mock(SectionProvider.class); sectionManager = new SectionManager(sectionProvider); } @Test public void test() { sectionManager.addSection(Section.create(0, 3, true)); sectionManager.addSection(Section.create(4, 1, true)); sectionManager.addSection(Section.create(6, 2, true)); sectionManager.addSection(Section.create(9, 4, true)); //Subheader 0 //Item 1 ( index = 0 ) //Item 2 ( index = 1 ) //Item 3 ( index = 2 ) //Subheader 4 //Item 5 ( index = 3 ) //Subheader 6 //Item 7 ( index = 4 ) //Item 8 ( index = 5 ) //Subheader 9 //Item 10 ( index = 6 ) //Item 11 ( index = 7 ) //Item 12 ( index = 8 ) //Item 13 ( index = 9 ) assertThat(sectionManager.isFirstItemInSection(0)).isFalse(); assertThat(sectionManager.isFirstItemInSection(1)).isTrue(); assertThat(sectionManager.isFirstItemInSection(2)).isFalse(); assertThat(sectionManager.isFirstItemInSection(3)).isFalse(); assertThat(sectionManager.isFirstItemInSection(4)).isFalse(); assertThat(sectionManager.isFirstItemInSection(5)).isTrue(); assertThat(sectionManager.isFirstItemInSection(6)).isFalse(); assertThat(sectionManager.isFirstItemInSection(7)).isTrue(); assertThat(sectionManager.isFirstItemInSection(8)).isFalse(); assertThat(sectionManager.isFirstItemInSection(9)).isFalse(); assertThat(sectionManager.isFirstItemInSection(10)).isTrue(); assertThat(sectionManager.isFirstItemInSection(11)).isFalse(); assertThat(sectionManager.isFirstItemInSection(12)).isFalse(); assertThat(sectionManager.isFirstItemInSection(13)).isFalse(); } }
zhukic/Sectioned-RecyclerView
sectioned-recyclerview/src/test/java/com/zhukic/sectionedrecyclerview/SectionManageIsFirstItemInSectionTest.java
Java
apache-2.0
2,191
/** * Appcelerator Titanium Mobile * Copyright (c) 2011 by Appcelerator, Inc. All Rights Reserved. * Licensed under the terms of the Apache Public License * Please see the LICENSE included with this distribution for details. */ /** This is generated, do not edit by hand. **/ #include <jni.h> #include "Proxy.h" namespace titanium { namespace media { class CameraProxy : public titanium::Proxy { public: explicit CameraProxy(jobject javaObject); static void bindProxy(v8::Handle<v8::Object> exports); static v8::Handle<v8::FunctionTemplate> getProxyTemplate(); static void dispose(); static v8::Persistent<v8::FunctionTemplate> proxyTemplate; static jclass javaClass; private: // Methods ----------------------------------------------------------- static v8::Handle<v8::Value> getPreview(const v8::Arguments&); // Dynamic property accessors ---------------------------------------- }; } // namespace media } // titanium
xissy/titanium-mobile-sdk
android/native/include/ti.modules.titanium.media.CameraProxy.h
C
apache-2.0
956
// Code generated by protoc-gen-validate // source: envoy/data/tap/v2alpha/capture.proto // DO NOT EDIT!!! package v2 import ( "bytes" "errors" "fmt" "net" "net/mail" "net/url" "regexp" "strings" "time" "unicode/utf8" "github.com/gogo/protobuf/types" ) // ensure the imports are used var ( _ = bytes.MinRead _ = errors.New("") _ = fmt.Print _ = utf8.UTFMax _ = (*regexp.Regexp)(nil) _ = (*strings.Reader)(nil) _ = net.IPv4len _ = time.Duration(0) _ = (*url.URL)(nil) _ = (*mail.Address)(nil) _ = types.DynamicAny{} ) // Validate checks the field values on Connection with the rules defined in the // proto definition for this message. If any rules are violated, an error is returned. func (m *Connection) Validate() error { if m == nil { return nil } // no validation rules for Id if v, ok := interface{}(m.GetLocalAddress()).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return ConnectionValidationError{ Field: "LocalAddress", Reason: "embedded message failed validation", Cause: err, } } } if v, ok := interface{}(m.GetRemoteAddress()).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return ConnectionValidationError{ Field: "RemoteAddress", Reason: "embedded message failed validation", Cause: err, } } } return nil } // ConnectionValidationError is the validation error returned by // Connection.Validate if the designated constraints aren't met. type ConnectionValidationError struct { Field string Reason string Cause error Key bool } // Error satisfies the builtin error interface func (e ConnectionValidationError) Error() string { cause := "" if e.Cause != nil { cause = fmt.Sprintf(" | caused by: %v", e.Cause) } key := "" if e.Key { key = "key for " } return fmt.Sprintf( "invalid %sConnection.%s: %s%s", key, e.Field, e.Reason, cause) } var _ error = ConnectionValidationError{} // Validate checks the field values on Event with the rules defined in the // proto definition for this message. If any rules are violated, an error is returned. func (m *Event) Validate() error { if m == nil { return nil } if v, ok := interface{}(m.GetTimestamp()).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return EventValidationError{ Field: "Timestamp", Reason: "embedded message failed validation", Cause: err, } } } switch m.EventSelector.(type) { case *Event_Read_: if v, ok := interface{}(m.GetRead()).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return EventValidationError{ Field: "Read", Reason: "embedded message failed validation", Cause: err, } } } case *Event_Write_: if v, ok := interface{}(m.GetWrite()).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return EventValidationError{ Field: "Write", Reason: "embedded message failed validation", Cause: err, } } } } return nil } // EventValidationError is the validation error returned by Event.Validate if // the designated constraints aren't met. type EventValidationError struct { Field string Reason string Cause error Key bool } // Error satisfies the builtin error interface func (e EventValidationError) Error() string { cause := "" if e.Cause != nil { cause = fmt.Sprintf(" | caused by: %v", e.Cause) } key := "" if e.Key { key = "key for " } return fmt.Sprintf( "invalid %sEvent.%s: %s%s", key, e.Field, e.Reason, cause) } var _ error = EventValidationError{} // Validate checks the field values on Trace with the rules defined in the // proto definition for this message. If any rules are violated, an error is returned. func (m *Trace) Validate() error { if m == nil { return nil } if v, ok := interface{}(m.GetConnection()).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return TraceValidationError{ Field: "Connection", Reason: "embedded message failed validation", Cause: err, } } } for idx, item := range m.GetEvents() { _, _ = idx, item if v, ok := interface{}(item).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return TraceValidationError{ Field: fmt.Sprintf("Events[%v]", idx), Reason: "embedded message failed validation", Cause: err, } } } } return nil } // TraceValidationError is the validation error returned by Trace.Validate if // the designated constraints aren't met. type TraceValidationError struct { Field string Reason string Cause error Key bool } // Error satisfies the builtin error interface func (e TraceValidationError) Error() string { cause := "" if e.Cause != nil { cause = fmt.Sprintf(" | caused by: %v", e.Cause) } key := "" if e.Key { key = "key for " } return fmt.Sprintf( "invalid %sTrace.%s: %s%s", key, e.Field, e.Reason, cause) } var _ error = TraceValidationError{} // Validate checks the field values on Event_Read with the rules defined in the // proto definition for this message. If any rules are violated, an error is returned. func (m *Event_Read) Validate() error { if m == nil { return nil } // no validation rules for Data return nil } // Event_ReadValidationError is the validation error returned by // Event_Read.Validate if the designated constraints aren't met. type Event_ReadValidationError struct { Field string Reason string Cause error Key bool } // Error satisfies the builtin error interface func (e Event_ReadValidationError) Error() string { cause := "" if e.Cause != nil { cause = fmt.Sprintf(" | caused by: %v", e.Cause) } key := "" if e.Key { key = "key for " } return fmt.Sprintf( "invalid %sEvent_Read.%s: %s%s", key, e.Field, e.Reason, cause) } var _ error = Event_ReadValidationError{} // Validate checks the field values on Event_Write with the rules defined in // the proto definition for this message. If any rules are violated, an error // is returned. func (m *Event_Write) Validate() error { if m == nil { return nil } // no validation rules for Data // no validation rules for EndStream return nil } // Event_WriteValidationError is the validation error returned by // Event_Write.Validate if the designated constraints aren't met. type Event_WriteValidationError struct { Field string Reason string Cause error Key bool } // Error satisfies the builtin error interface func (e Event_WriteValidationError) Error() string { cause := "" if e.Cause != nil { cause = fmt.Sprintf(" | caused by: %v", e.Cause) } key := "" if e.Key { key = "key for " } return fmt.Sprintf( "invalid %sEvent_Write.%s: %s%s", key, e.Field, e.Reason, cause) } var _ error = Event_WriteValidationError{}
frankbu/istio
vendor/github.com/envoyproxy/go-control-plane/envoy/data/tap/v2alpha/capture.pb.validate.go
GO
apache-2.0
6,894
package com.huawei.esdk.fusionmanager.local.impl.autogen.storage; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="req" type="{http://request.model.storageresource.soap.business.storage.north.galaxmanager.com/xsd}DeleteStorageResourceReq" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "req" }) @XmlRootElement(name = "deleteStorageResource") public class DeleteStorageResource { protected DeleteStorageResourceReq req; /** * Gets the value of the req property. * * @return * possible object is * {@link DeleteStorageResourceReq } * */ public DeleteStorageResourceReq getReq() { return req; } /** * Sets the value of the req property. * * @param value * allowed object is * {@link DeleteStorageResourceReq } * */ public void setReq(DeleteStorageResourceReq value) { this.req = value; } }
eSDK/esdk_cloud_fm_r3_native_java
source/FM/V1R3/esdk_fm_native_java/src/main/java/com/huawei/esdk/fusionmanager/local/impl/autogen/storage/DeleteStorageResource.java
Java
apache-2.0
1,573
/* FreeRDP: A Remote Desktop Protocol client. Video Redirection Virtual Channel Copyright 2010-2011 Vic Lee 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 __TSMF_TYPES_H #define __TSMF_TYPES_H typedef struct _TS_AM_MEDIA_TYPE { int MajorType; int SubType; int FormatType; uint32 Width; uint32 Height; uint32 BitRate; struct { uint32 Numerator; uint32 Denominator; } SamplesPerSecond; uint32 Channels; uint32 BitsPerSample; uint32 BlockAlign; const uint8 * ExtraData; uint32 ExtraDataSize; } TS_AM_MEDIA_TYPE; #endif
FreeRDP/FreeRDP-old
channels/drdynvc/tsmf/tsmf_types.h
C
apache-2.0
1,066
package env import java.time.{Clock, Instant, ZoneId} import com.twitter.finagle.http.{Request, Response} import com.twitter.util.Await import example.{Event, SecuritySystem} import io.fintrospect.testing.OverridableHttpService import scala.collection.mutable class TestEnvironment() { val clock = Clock.fixed(Instant.ofEpochMilli(0), ZoneId.systemDefault()) val userDirectory = new FakeUserDirectory() val entryLogger = new FakeEntryLogger() val userDirectoryHttp = new OverridableHttpService[Response](userDirectory) val entryLoggerHttp = new OverridableHttpService[Response](entryLogger) val events = mutable.MutableList[Event]() private val securitySystemSvc = new SecuritySystem( userDirectoryHttp.service, entryLoggerHttp.service, events += _, clock).service def responseTo(request: Request) = { val msg = Await.result(securitySystemSvc(request)) ResponseStatusAndContent(msg.status, msg.headerMap.getOrElse("Content-type", null), msg.contentString) } }
daviddenton/fintrospect-example-app
src/test/scala/env/TestEnvironment.scala
Scala
apache-2.0
1,012
# AUTOGENERATED FILE FROM balenalib/iot-gate-imx8-ubuntu:bionic-run # remove several traces of debian python RUN apt-get purge -y python.* # http://bugs.python.org/issue19846 # > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK. ENV LANG C.UTF-8 # install python dependencies RUN apt-get update && apt-get install -y --no-install-recommends \ ca-certificates \ netbase \ && rm -rf /var/lib/apt/lists/* # key 63C7CC90: public key "Simon McVittie <smcv@pseudorandom.co.uk>" imported # key 3372DCFA: public key "Donald Stufft (dstufft) <donald@stufft.io>" imported RUN gpg --keyserver keyring.debian.org --recv-keys 4DE8FF2A63C7CC90 \ && gpg --keyserver keyserver.ubuntu.com --recv-key 6E3CBCE93372DCFA \ && gpg --keyserver keyserver.ubuntu.com --recv-keys 0x52a43a1e4b77b059 ENV PYTHON_VERSION 3.6.12 # if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value '<VERSION>'" ENV PYTHON_PIP_VERSION 21.0.1 ENV SETUPTOOLS_VERSION 56.0.0 RUN set -x \ && buildDeps=' \ curl \ ' \ && apt-get update && apt-get install -y $buildDeps --no-install-recommends && rm -rf /var/lib/apt/lists/* \ && curl -SLO "http://resin-packages.s3.amazonaws.com/python/v$PYTHON_VERSION/Python-$PYTHON_VERSION.linux-aarch64-openssl1.1.tar.gz" \ && echo "f44f5617a7cd5593250bb8ad02044c37b433293343eacc84d78acae6490b7c53 Python-$PYTHON_VERSION.linux-aarch64-openssl1.1.tar.gz" | sha256sum -c - \ && tar -xzf "Python-$PYTHON_VERSION.linux-aarch64-openssl1.1.tar.gz" --strip-components=1 \ && rm -rf "Python-$PYTHON_VERSION.linux-aarch64-openssl1.1.tar.gz" \ && ldconfig \ && if [ ! -e /usr/local/bin/pip3 ]; then : \ && curl -SLO "https://raw.githubusercontent.com/pypa/get-pip/430ba37776ae2ad89f794c7a43b90dc23bac334c/get-pip.py" \ && echo "19dae841a150c86e2a09d475b5eb0602861f2a5b7761ec268049a662dbd2bd0c get-pip.py" | sha256sum -c - \ && python3 get-pip.py \ && rm get-pip.py \ ; fi \ && pip3 install --no-cache-dir --upgrade --force-reinstall pip=="$PYTHON_PIP_VERSION" setuptools=="$SETUPTOOLS_VERSION" \ && find /usr/local \ \( -type d -a -name test -o -name tests \) \ -o \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \ -exec rm -rf '{}' + \ && cd / \ && rm -rf /usr/src/python ~/.cache # make some useful symlinks that are expected to exist RUN cd /usr/local/bin \ && ln -sf pip3 pip \ && { [ -e easy_install ] || ln -s easy_install-* easy_install; } \ && ln -sf idle3 idle \ && ln -sf pydoc3 pydoc \ && ln -sf python3 python \ && ln -sf python3-config python-config # set PYTHONPATH to point to dist-packages ENV PYTHONPATH /usr/lib/python3/dist-packages:$PYTHONPATH CMD ["echo","'No CMD command was set in Dockerfile! Details about CMD command could be found in Dockerfile Guide section in our Docs. Here's the link: https://balena.io/docs"] RUN curl -SLO "https://raw.githubusercontent.com/balena-io-library/base-images/8accad6af708fca7271c5c65f18a86782e19f877/scripts/assets/tests/test-stack@python.sh" \ && echo "Running test-stack@python" \ && chmod +x test-stack@python.sh \ && bash test-stack@python.sh \ && rm -rf test-stack@python.sh RUN [ ! -d /.balena/messages ] && mkdir -p /.balena/messages; echo 'Here are a few details about this Docker image (For more information please visit https://www.balena.io/docs/reference/base-images/base-images/): \nArchitecture: ARM v8 \nOS: Ubuntu bionic \nVariant: run variant \nDefault variable(s): UDEV=off \nThe following software stack is preinstalled: \nPython v3.6.12, Pip v21.0.1, Setuptools v56.0.0 \nExtra features: \n- Easy way to install packages with `install_packages <package-name>` command \n- Run anywhere with cross-build feature (for ARM only) \n- Keep the container idling with `balena-idle` command \n- Show base image details with `balena-info` command' > /.balena/messages/image-info RUN echo '#!/bin/sh.real\nbalena-info\nrm -f /bin/sh\ncp /bin/sh.real /bin/sh\n/bin/sh "$@"' > /bin/sh-shim \ && chmod +x /bin/sh-shim \ && cp /bin/sh /bin/sh.real \ && mv /bin/sh-shim /bin/sh
nghiant2710/base-images
balena-base-images/python/iot-gate-imx8/ubuntu/bionic/3.6.12/run/Dockerfile
Dockerfile
apache-2.0
4,074
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. // This creates a bunch of yielding tasks that run concurrently // while holding onto C stacks mod rustrt { pub extern { pub fn rust_dbg_call(cb: *u8, data: libc::uintptr_t) -> libc::uintptr_t; } } extern fn cb(data: libc::uintptr_t) -> libc::uintptr_t { if data == 1u { data } else { task::yield(); count(data - 1u) + count(data - 1u) } } fn count(n: uint) -> uint { unsafe { rustrt::rust_dbg_call(cb, n) } } pub fn main() { for old_iter::repeat(100u) { do task::spawn { assert!(count(5u) == 16u); }; } }
1100110/rust
src/test/run-pass/extern-stress.rs
Rust
apache-2.0
1,107
package com.kbeanie.multipicker.utils; import android.support.v4.content.FileProvider; /** * Created by kbibek on 12/16/16. */ public class AMPFileProvider extends FileProvider { }
ogero/android-multipicker-library
multipicker/src/main/java/com/kbeanie/multipicker/utils/AMPFileProvider.java
Java
apache-2.0
186
/** * 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.hadoop.hdfs; import java.io.BufferedInputStream; import java.io.BufferedOutputStream; import java.io.DataInputStream; import java.io.DataOutputStream; import java.io.IOException; import java.nio.ByteBuffer; import java.util.EnumSet; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.fs.FSInputChecker; import org.apache.hadoop.fs.Path; import org.apache.hadoop.fs.ReadOption; import org.apache.hadoop.hdfs.net.Peer; import org.apache.hadoop.hdfs.protocol.Block; import org.apache.hadoop.hdfs.protocol.DatanodeID; import org.apache.hadoop.hdfs.protocol.ExtendedBlock; import org.apache.hadoop.hdfs.protocol.datatransfer.DataTransferProtoUtil; import org.apache.hadoop.hdfs.protocol.datatransfer.PacketHeader; import org.apache.hadoop.hdfs.protocol.datatransfer.Sender; import org.apache.hadoop.hdfs.protocol.proto.DataTransferProtos.BlockOpResponseProto; import org.apache.hadoop.hdfs.protocol.proto.DataTransferProtos.ReadOpChecksumInfoProto; import org.apache.hadoop.hdfs.protocol.proto.DataTransferProtos.Status; import org.apache.hadoop.hdfs.protocolPB.PBHelperClient; import org.apache.hadoop.hdfs.security.token.block.BlockTokenIdentifier; import org.apache.hadoop.hdfs.server.datanode.CachingStrategy; import org.apache.hadoop.hdfs.shortcircuit.ClientMmap; import org.apache.hadoop.io.IOUtils; import org.apache.hadoop.net.NetUtils; import org.apache.hadoop.security.token.Token; import org.apache.hadoop.util.DataChecksum; import org.apache.htrace.core.TraceScope; import org.apache.htrace.core.Tracer; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * @deprecated this is an old implementation that is being left around * in case any issues spring up with the new {@link RemoteBlockReader2} * implementation. * It will be removed in the next release. */ @InterfaceAudience.Private @Deprecated public class RemoteBlockReader extends FSInputChecker implements BlockReader { static final Logger LOG = LoggerFactory.getLogger(FSInputChecker.class); private final Peer peer; private final DatanodeID datanodeID; private final DataInputStream in; private DataChecksum checksum; /** offset in block of the last chunk received */ private long lastChunkOffset = -1; private long lastChunkLen = -1; private long lastSeqNo = -1; /** offset in block where reader wants to actually read */ private long startOffset; private final long blockId; /** offset in block of of first chunk - may be less than startOffset if startOffset is not chunk-aligned */ private final long firstChunkOffset; private final int bytesPerChecksum; private final int checksumSize; /** * The total number of bytes we need to transfer from the DN. * This is the amount that the user has requested plus some padding * at the beginning so that the read can begin on a chunk boundary. */ private final long bytesNeededToFinish; /** * True if we are reading from a local DataNode. */ private final boolean isLocal; private boolean eos = false; private boolean sentStatusCode = false; ByteBuffer checksumBytes = null; /** Amount of unread data in the current received packet */ int dataLeft = 0; private final PeerCache peerCache; private final Tracer tracer; /* FSInputChecker interface */ /* same interface as inputStream java.io.InputStream#read() * used by DFSInputStream#read() * This violates one rule when there is a checksum error: * "Read should not modify user buffer before successful read" * because it first reads the data to user buffer and then checks * the checksum. */ @Override public synchronized int read(byte[] buf, int off, int len) throws IOException { // This has to be set here, *before* the skip, since we can // hit EOS during the skip, in the case that our entire read // is smaller than the checksum chunk. boolean eosBefore = eos; //for the first read, skip the extra bytes at the front. if (lastChunkLen < 0 && startOffset > firstChunkOffset && len > 0) { // Skip these bytes. But don't call this.skip()! int toSkip = (int)(startOffset - firstChunkOffset); if ( super.readAndDiscard(toSkip) != toSkip ) { // should never happen throw new IOException("Could not skip required number of bytes"); } } int nRead = super.read(buf, off, len); // if eos was set in the previous read, send a status code to the DN if (eos && !eosBefore && nRead >= 0) { if (needChecksum()) { sendReadResult(peer, Status.CHECKSUM_OK); } else { sendReadResult(peer, Status.SUCCESS); } } return nRead; } @Override public synchronized long skip(long n) throws IOException { /* How can we make sure we don't throw a ChecksumException, at least * in majority of the cases?. This one throws. */ long nSkipped = 0; while (nSkipped < n) { int toSkip = (int)Math.min(n-nSkipped, Integer.MAX_VALUE); int ret = readAndDiscard(toSkip); if (ret <= 0) { return nSkipped; } nSkipped += ret; } return nSkipped; } @Override public int read() throws IOException { throw new IOException("read() is not expected to be invoked. " + "Use read(buf, off, len) instead."); } @Override public boolean seekToNewSource(long targetPos) throws IOException { /* Checksum errors are handled outside the BlockReader. * DFSInputStream does not always call 'seekToNewSource'. In the * case of pread(), it just tries a different replica without seeking. */ return false; } @Override public void seek(long pos) throws IOException { throw new IOException("Seek() is not supported in BlockInputChecker"); } @Override protected long getChunkPosition(long pos) { throw new RuntimeException("getChunkPosition() is not supported, " + "since seek is not required"); } /** * Makes sure that checksumBytes has enough capacity * and limit is set to the number of checksum bytes needed * to be read. */ private void adjustChecksumBytes(int dataLen) { int requiredSize = ((dataLen + bytesPerChecksum - 1)/bytesPerChecksum)*checksumSize; if (checksumBytes == null || requiredSize > checksumBytes.capacity()) { checksumBytes = ByteBuffer.wrap(new byte[requiredSize]); } else { checksumBytes.clear(); } checksumBytes.limit(requiredSize); } @Override protected synchronized int readChunk(long pos, byte[] buf, int offset, int len, byte[] checksumBuf) throws IOException { try (TraceScope ignored = tracer.newScope( "RemoteBlockReader#readChunk(" + blockId + ")")) { return readChunkImpl(pos, buf, offset, len, checksumBuf); } } private synchronized int readChunkImpl(long pos, byte[] buf, int offset, int len, byte[] checksumBuf) throws IOException { // Read one chunk. if (eos) { // Already hit EOF return -1; } // Read one DATA_CHUNK. long chunkOffset = lastChunkOffset; if ( lastChunkLen > 0 ) { chunkOffset += lastChunkLen; } // pos is relative to the start of the first chunk of the read. // chunkOffset is relative to the start of the block. // This makes sure that the read passed from FSInputChecker is the // for the same chunk we expect to be reading from the DN. if ( (pos + firstChunkOffset) != chunkOffset ) { throw new IOException("Mismatch in pos : " + pos + " + " + firstChunkOffset + " != " + chunkOffset); } // Read next packet if the previous packet has been read completely. if (dataLeft <= 0) { //Read packet headers. PacketHeader header = new PacketHeader(); header.readFields(in); LOG.debug("DFSClient readChunk got header {}", header); // Sanity check the lengths if (!header.sanityCheck(lastSeqNo)) { throw new IOException("BlockReader: error in packet header " + header); } lastSeqNo = header.getSeqno(); dataLeft = header.getDataLen(); adjustChecksumBytes(header.getDataLen()); if (header.getDataLen() > 0) { IOUtils.readFully(in, checksumBytes.array(), 0, checksumBytes.limit()); } } // Sanity checks assert len >= bytesPerChecksum; assert checksum != null; assert checksumSize == 0 || (checksumBuf.length % checksumSize == 0); int checksumsToRead, bytesToRead; if (checksumSize > 0) { // How many chunks left in our packet - this is a ceiling // since we may have a partial chunk at the end of the file int chunksLeft = (dataLeft - 1) / bytesPerChecksum + 1; // How many chunks we can fit in databuffer // - note this is a floor since we always read full chunks int chunksCanFit = Math.min(len / bytesPerChecksum, checksumBuf.length / checksumSize); // How many chunks should we read checksumsToRead = Math.min(chunksLeft, chunksCanFit); // How many bytes should we actually read bytesToRead = Math.min( checksumsToRead * bytesPerChecksum, // full chunks dataLeft); // in case we have a partial } else { // no checksum bytesToRead = Math.min(dataLeft, len); checksumsToRead = 0; } if ( bytesToRead > 0 ) { // Assert we have enough space assert bytesToRead <= len; assert checksumBytes.remaining() >= checksumSize * checksumsToRead; assert checksumBuf.length >= checksumSize * checksumsToRead; IOUtils.readFully(in, buf, offset, bytesToRead); checksumBytes.get(checksumBuf, 0, checksumSize * checksumsToRead); } dataLeft -= bytesToRead; assert dataLeft >= 0; lastChunkOffset = chunkOffset; lastChunkLen = bytesToRead; // If there's no data left in the current packet after satisfying // this read, and we have satisfied the client read, we expect // an empty packet header from the DN to signify this. // Note that pos + bytesToRead may in fact be greater since the // DN finishes off the entire last chunk. if (dataLeft == 0 && pos + bytesToRead >= bytesNeededToFinish) { // Read header PacketHeader hdr = new PacketHeader(); hdr.readFields(in); if (!hdr.isLastPacketInBlock() || hdr.getDataLen() != 0) { throw new IOException("Expected empty end-of-read packet! Header: " + hdr); } eos = true; } if ( bytesToRead == 0 ) { return -1; } return bytesToRead; } private RemoteBlockReader(String file, String bpid, long blockId, DataInputStream in, DataChecksum checksum, boolean verifyChecksum, long startOffset, long firstChunkOffset, long bytesToRead, Peer peer, DatanodeID datanodeID, PeerCache peerCache, Tracer tracer) { // Path is used only for printing block and file information in debug super(new Path("/" + Block.BLOCK_FILE_PREFIX + blockId + ":" + bpid + ":of:"+ file)/*too non path-like?*/, 1, verifyChecksum, checksum.getChecksumSize() > 0? checksum : null, checksum.getBytesPerChecksum(), checksum.getChecksumSize()); this.isLocal = DFSUtilClient.isLocalAddress(NetUtils. createSocketAddr(datanodeID.getXferAddr())); this.peer = peer; this.datanodeID = datanodeID; this.in = in; this.checksum = checksum; this.startOffset = Math.max( startOffset, 0 ); this.blockId = blockId; // The total number of bytes that we need to transfer from the DN is // the amount that the user wants (bytesToRead), plus the padding at // the beginning in order to chunk-align. Note that the DN may elect // to send more than this amount if the read starts/ends mid-chunk. this.bytesNeededToFinish = bytesToRead + (startOffset - firstChunkOffset); this.firstChunkOffset = firstChunkOffset; lastChunkOffset = firstChunkOffset; lastChunkLen = -1; bytesPerChecksum = this.checksum.getBytesPerChecksum(); checksumSize = this.checksum.getChecksumSize(); this.peerCache = peerCache; this.tracer = tracer; } /** * Create a new BlockReader specifically to satisfy a read. * This method also sends the OP_READ_BLOCK request. * * @param file File location * @param block The block object * @param blockToken The block token for security * @param startOffset The read offset, relative to block head * @param len The number of bytes to read * @param bufferSize The IO buffer size (not the client buffer size) * @param verifyChecksum Whether to verify checksum * @param clientName Client name * @return New BlockReader instance, or null on error. */ public static RemoteBlockReader newBlockReader(String file, ExtendedBlock block, Token<BlockTokenIdentifier> blockToken, long startOffset, long len, int bufferSize, boolean verifyChecksum, String clientName, Peer peer, DatanodeID datanodeID, PeerCache peerCache, CachingStrategy cachingStrategy, Tracer tracer) throws IOException { // in and out will be closed when sock is closed (by the caller) final DataOutputStream out = new DataOutputStream(new BufferedOutputStream(peer.getOutputStream())); new Sender(out).readBlock(block, blockToken, clientName, startOffset, len, verifyChecksum, cachingStrategy); // // Get bytes in block, set streams // DataInputStream in = new DataInputStream( new BufferedInputStream(peer.getInputStream(), bufferSize)); BlockOpResponseProto status = BlockOpResponseProto.parseFrom( PBHelperClient.vintPrefixed(in)); RemoteBlockReader2.checkSuccess(status, peer, block, file); ReadOpChecksumInfoProto checksumInfo = status.getReadOpChecksumInfo(); DataChecksum checksum = DataTransferProtoUtil.fromProto( checksumInfo.getChecksum()); //Warning when we get CHECKSUM_NULL? // Read the first chunk offset. long firstChunkOffset = checksumInfo.getChunkOffset(); if ( firstChunkOffset < 0 || firstChunkOffset > startOffset || firstChunkOffset <= (startOffset - checksum.getBytesPerChecksum())) { throw new IOException("BlockReader: error in first chunk offset (" + firstChunkOffset + ") startOffset is " + startOffset + " for file " + file); } return new RemoteBlockReader(file, block.getBlockPoolId(), block.getBlockId(), in, checksum, verifyChecksum, startOffset, firstChunkOffset, len, peer, datanodeID, peerCache, tracer); } @Override public synchronized void close() throws IOException { startOffset = -1; checksum = null; if (peerCache != null & sentStatusCode) { peerCache.put(datanodeID, peer); } else { peer.close(); } // in will be closed when its Socket is closed. } @Override public void readFully(byte[] buf, int readOffset, int amtToRead) throws IOException { IOUtils.readFully(this, buf, readOffset, amtToRead); } @Override public int readAll(byte[] buf, int offset, int len) throws IOException { return readFully(this, buf, offset, len); } /** * When the reader reaches end of the read, it sends a status response * (e.g. CHECKSUM_OK) to the DN. Failure to do so could lead to the DN * closing our connection (which we will re-open), but won't affect * data correctness. */ void sendReadResult(Peer peer, Status statusCode) { assert !sentStatusCode : "already sent status code to " + peer; try { RemoteBlockReader2.writeReadResult(peer.getOutputStream(), statusCode); sentStatusCode = true; } catch (IOException e) { // It's ok not to be able to send this. But something is probably wrong. LOG.info("Could not send read status (" + statusCode + ") to datanode " + peer.getRemoteAddressString() + ": " + e.getMessage()); } } @Override public int read(ByteBuffer buf) throws IOException { throw new UnsupportedOperationException("readDirect unsupported in RemoteBlockReader"); } @Override public int available() { // An optimistic estimate of how much data is available // to us without doing network I/O. return RemoteBlockReader2.TCP_WINDOW_SIZE; } @Override public boolean isLocal() { return isLocal; } @Override public boolean isShortCircuit() { return false; } @Override public ClientMmap getClientMmap(EnumSet<ReadOption> opts) { return null; } @Override public DataChecksum getDataChecksum() { return checksum; } }
aliyun-beta/aliyun-oss-hadoop-fs
hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/RemoteBlockReader.java
Java
apache-2.0
17,550