repo_name
stringlengths
4
116
path
stringlengths
3
942
size
stringlengths
1
7
content
stringlengths
3
1.05M
license
stringclasses
15 values
jprovaznik/tripleo-common
tripleo_common/exception.py
1750
# -*- coding: utf-8 -*- # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import logging from tripleo_common._i18n import _ LOG = logging.getLogger(__name__) class CloudConfigException(Exception): """Base tripleo-common exception To correctly use this class, inherit from it and define a 'message' property. That message will get printf'd with the keyword arguments provided to the constructor. """ msg_fmt = _("An unknown exception occurred.") def __init__(self, message=None, **kwargs): self.kwargs = kwargs if not message: try: message = self.msg_fmt % kwargs except Exception: # kwargs doesn't match a variable in the message # log the issue and the kwargs LOG.exception('Exception in string format operation') for name, value in kwargs.iteritems(): LOG.error("%s: %s" % (name, value)) # at least get the core message out if something happened message = self.msg_fmt super(CloudConfigException, self).__init__(message) class MissingEnvironment(CloudConfigException): message = "Required environment variables are not set."
apache-2.0
password123456/lotto
get_recent_lotto.py
1787
#!/usr/local/bin/python2.7 # -*- coding: utf-8 -*- __author__ = 'https://github.com/password123456/' import sys reload(sys) sys.setdefaultencoding('utf-8') import requests import urllib import urllib2 import json import datetime class bcolors: HEADER = '\033[95m' OKBLUE = '\033[94m' OKGREEN = '\033[92m' WARNING = '\033[93m' FAIL = '\033[91m' ENDC = '\033[0m' BOLD = '\033[1m' UNDERLINE = '\033[4m' def get_recent_lotto(): url = 'http://www.nlotto.co.kr/common.do?method=getLottoNumber' try: r = requests.get(url) data = json.loads(r.text) except Exception, e: print '%s[-] Exception::%s%s' % (bcolors.WARNING, e, bcolors.ENDC) sys.exit(0) else: r.close() drwNoDate = data['drwNoDate'] drwNo = data['drwNo'] firstWinamnt = data['firstWinamnt'] drwtNo1 = data['drwtNo1'] drwtNo2 = data['drwtNo2'] drwtNo3 = data['drwtNo3'] drwtNo4 = data['drwtNo4'] drwtNo5 = data['drwtNo5'] drwtNo6 = data['drwtNo6'] bnusNo = data['bnusNo'] # 당첨금 자리수 변환 firstWinamnt = format(firstWinamnt, ',') content = '** 최근 로또 조회 **\n' content = content + ' [+] 로또 : http://www.nlotto.co.kr\n [+] 추첨일자: %s\n [+] 회차: %d 회\n [+] 당첨번호: %d %d %d %d %d %d\n [+] 보너스: %d \n [*] 당첨금: %s 원\n' % (drwNoDate, drwNo, drwtNo1, drwtNo2, drwtNo3, drwtNo4, drwtNo5, drwtNo6, bnusNo, firstWinamnt ) #print content return content content = get_recent_lotto() def main(): get_recent_lotto() if __name__ == '__main__': try: main() except KeyboardInterrupt: sys.exit(0) except Exception, e: print '%s[-] Exception::%s%s' % (bcolors.WARNING, e, bcolors.ENDC)
apache-2.0
sakai-mirror/k2
agnostic/shared/src/main/java/org/sakaiproject/kernel/api/ClassLoaderService.java
1593
/* * Licensed to the Sakai Foundation (SF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The SF 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.sakaiproject.kernel.api; /** * A service to provide Classloaders to the kernel based on component * specifications. These classloaders should be fully populate with the the * class path elements in the component specification, and where appropriate * packages should be exported and dependencies injected into the shared * classloader. The resulting classloader should configured and ready for use. */ public interface ClassLoaderService { /** * Create a ComponentClassLoader based on the specification * * @param spec * the ComponentSpecification * @return the new Component Classloader * @throws ComponentSpecificationException */ ClassLoader getComponentClassLoader(ComponentSpecification spec) throws ComponentSpecificationException; }
apache-2.0
wildfly-swarm/wildfly-swarm-javadocs
2012.12.0/apidocs/org/wildfly/swarm/config/datasources/XADataSourceSupplier.html
8976
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (1.8.0_151) on Tue Dec 12 12:37:07 MST 2017 --> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>XADataSourceSupplier (BOM: * : All 2012.12.0 API)</title> <meta name="date" content="2017-12-12"> <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="XADataSourceSupplier (BOM: * : All 2012.12.0 API)"; } } catch(err) { } //--> var methods = {"i0":6}; var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],4:["t3","Abstract Methods"]}; var altColor = "altColor"; var rowColor = "rowColor"; var tableTab = "tableTab"; var activeTableTab = "activeTableTab"; </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 class="navBarCell1Rev">Class</li> <li><a href="class-use/XADataSourceSupplier.html">Use</a></li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../index-all.html">Index</a></li> <li><a href="../../../../../help-doc.html">Help</a></li> </ul> <div class="aboutLanguage">WildFly Swarm API, 2012.12.0</div> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../../org/wildfly/swarm/config/datasources/XADataSourceConsumer.html" title="interface in org.wildfly.swarm.config.datasources"><span class="typeNameLink">Prev&nbsp;Class</span></a></li> <li>Next&nbsp;Class</li> </ul> <ul class="navList"> <li><a href="../../../../../index.html?org/wildfly/swarm/config/datasources/XADataSourceSupplier.html" target="_top">Frames</a></li> <li><a href="XADataSourceSupplier.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> <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.wildfly.swarm.config.datasources</div> <h2 title="Interface XADataSourceSupplier" class="title">Interface XADataSourceSupplier&lt;T extends <a href="../../../../../org/wildfly/swarm/config/datasources/XADataSource.html" title="class in org.wildfly.swarm.config.datasources">XADataSource</a>&gt;</h2> </div> <div class="contentContainer"> <div class="description"> <ul class="blockList"> <li class="blockList"> <dl> <dt>Functional Interface:</dt> <dd>This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.</dd> </dl> <hr> <br> <pre><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/FunctionalInterface.html?is-external=true" title="class or interface in java.lang">@FunctionalInterface</a> public interface <span class="typeNameLabel">XADataSourceSupplier&lt;T extends <a href="../../../../../org/wildfly/swarm/config/datasources/XADataSource.html" title="class in org.wildfly.swarm.config.datasources">XADataSource</a>&gt;</span></pre> </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="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> <caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t3" class="tableTab"><span><a href="javascript:show(4);">Abstract Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tr id="i0" class="altColor"> <td class="colFirst"><code><a href="../../../../../org/wildfly/swarm/config/datasources/XADataSource.html" title="class in org.wildfly.swarm.config.datasources">XADataSource</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/wildfly/swarm/config/datasources/XADataSourceSupplier.html#get--">get</a></span>()</code> <div class="block">Constructed instance of XADataSource resource</div> </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="get--"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>get</h4> <pre><a href="../../../../../org/wildfly/swarm/config/datasources/XADataSource.html" title="class in org.wildfly.swarm.config.datasources">XADataSource</a>&nbsp;get()</pre> <div class="block">Constructed instance of XADataSource resource</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>The instance</dd> </dl> </li> </ul> </li> </ul> </li> </ul> </div> </div> <!-- ========= END OF CLASS DATA ========= --> <!-- ======= 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 class="navBarCell1Rev">Class</li> <li><a href="class-use/XADataSourceSupplier.html">Use</a></li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../index-all.html">Index</a></li> <li><a href="../../../../../help-doc.html">Help</a></li> </ul> <div class="aboutLanguage">WildFly Swarm API, 2012.12.0</div> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../../org/wildfly/swarm/config/datasources/XADataSourceConsumer.html" title="interface in org.wildfly.swarm.config.datasources"><span class="typeNameLink">Prev&nbsp;Class</span></a></li> <li>Next&nbsp;Class</li> </ul> <ul class="navList"> <li><a href="../../../../../index.html?org/wildfly/swarm/config/datasources/XADataSourceSupplier.html" target="_top">Frames</a></li> <li><a href="XADataSourceSupplier.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> <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>Copyright &#169; 2017 <a href="http://www.jboss.org">JBoss by Red Hat</a>. All rights reserved.</small></p> </body> </html>
apache-2.0
mdoering/backbone
life/Fungi/Ascomycota/Lecanoromycetes/Lecanorales/Lecanoraceae/Omphalodina/Omphalodina johnstonii/README.md
205
# Omphalodina johnstonii (C.W. Dodge) C.W. Dodge SPECIES #### Status ACCEPTED #### According to Index Fungorum #### Published in null #### Original name Lecanora johnstonii C.W. Dodge ### Remarks null
apache-2.0
codyer/CleanFramework
handler/src/main/java/com/cody/handler/framework/viewmodel/ListWithSearchViewModel.java
589
/* * Copyright (c) Created by Cody.yi on 2016/9/5. */ package com.cody.handler.framework.viewmodel; /** * Created by cody.yi on 2016/8/24. * <p> * 不包含头部的list view * * @param <ItemViewModel> ListView中的item ViewModel */ public class ListWithSearchViewModel<ItemViewModel extends XItemViewModel> extends ListViewModel<ItemViewModel> implements IWithSearchViewModel { private final SearchViewModel mSearchViewModel = SearchViewModel.createDefaultSearch(); @Override public SearchViewModel getSearchViewModel() { return mSearchViewModel; } }
apache-2.0
andy-goryachev/JsonPretty
src/goryachev/common/io/BitStreamCommon.java
828
// Copyright © 2013-2020 Andy Goryachev <[email protected]> package goryachev.common.io; public class BitStreamCommon { protected static final int BITS_PER_BYTE = 8; protected static final int MASK[] = { 0x00000000, 0x00000001, 0x00000003, 0x00000007, 0x0000000f, 0x0000001f, 0x0000003f, 0x0000007f, 0x000000ff, 0x000001ff, 0x000003ff, 0x000007ff, 0x00000fff, 0x00001fff, 0x00003fff, 0x00007fff, 0x0000ffff, 0x0001ffff, 0x0003ffff, 0x0007ffff, 0x000fffff, 0x001fffff, 0x003fffff, 0x007fffff, 0x00ffffff, 0x01ffffff, 0x03ffffff, 0x07ffffff, 0x0fffffff, 0x1fffffff, 0x3fffffff, 0x7fffffff, 0xffffffff }; public static int getMask(int bits) { return MASK[bits]; } }
apache-2.0
JorgePereiraUFRN/Myeclone
Myeclone/src/br/ufrn/Myeclone/model/Acao.java
123
package br.ufrn.Myeclone.model; import javax.persistence.Entity; @Entity public class Acao extends Tarefa{ }
apache-2.0
aciccarello/typedoc
lib/converter/types/alias.js
2391
var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var ts = require("typescript"); var index_1 = require("../../models/index"); var components_1 = require("../components"); var AliasConverter = (function (_super) { __extends(AliasConverter, _super); function AliasConverter() { _super.apply(this, arguments); this.priority = 100; } AliasConverter.prototype.supportsNode = function (context, node, type) { if (!type || !node || !node.typeName) return false; if (!type.symbol) return true; var checker = context.checker; var symbolName = checker.getFullyQualifiedName(type.symbol).split('.'); if (!symbolName.length) return false; if (symbolName[0].substr(0, 1) == '"') symbolName.shift(); var nodeName = ts.getTextOfNode(node.typeName).split('.'); if (!nodeName.length) return false; var common = Math.min(symbolName.length, nodeName.length); symbolName = symbolName.slice(-common); nodeName = nodeName.slice(-common); return nodeName.join('.') != symbolName.join('.'); }; AliasConverter.prototype.convertNode = function (context, node) { var name = ts.getTextOfNode(node.typeName); return new index_1.ReferenceType(name, index_1.ReferenceType.SYMBOL_ID_RESOLVE_BY_NAME); }; AliasConverter = __decorate([ components_1.Component({ name: 'type:alias' }) ], AliasConverter); return AliasConverter; })(components_1.ConverterTypeComponent); exports.AliasConverter = AliasConverter;
apache-2.0
jaikiran/ant-ivy
src/java/org/apache/ivy/plugins/conflict/AbstractConflictManager.java
1770
/* * 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.ivy.plugins.conflict; import java.util.Collection; import org.apache.ivy.core.module.descriptor.DependencyDescriptor; import org.apache.ivy.core.module.id.ModuleRevisionId; import org.apache.ivy.core.settings.IvySettings; import org.apache.ivy.plugins.IvySettingsAware; public abstract class AbstractConflictManager implements ConflictManager, IvySettingsAware { private String name; private IvySettings settings; public IvySettings getSettings() { return settings; } public void setSettings(IvySettings settings) { this.settings = settings; } public String getName() { return name; } public void setName(String name) { this.name = name; } @Override public String toString() { return name; } public void handleAllBlacklistedRevisions(DependencyDescriptor dd, Collection<ModuleRevisionId> foundBlacklisted) { } }
apache-2.0
tonbut/polestar
module/urn.io.polestar/src/io/polestar/data/login/AuthenticationDataAccessor.java
2279
/* Copyright 2015 1060 Research Ltd 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.polestar.data.login; import org.netkernel.layer0.nkf.*; import org.netkernel.mod.hds.*; import org.netkernel.module.standard.endpoint.StandardAccessorImpl; import io.polestar.data.db.PersistenceFactory; import io.polestar.data.util.MonitorUtils; public class AuthenticationDataAccessor extends StandardAccessorImpl { public AuthenticationDataAccessor() { this.declareThreadSafe(); this.declareInhibitCheckForBadExpirationOnMutableResource(); } public void onSource(INKFRequestContext aContext) throws Exception { IHDSDocument authData=PersistenceFactory.getPersistence(aContext).getAuthentication(aContext); INKFResponse resp=aContext.createResponseFrom(authData); MonitorUtils.attachGoldenThread(aContext, "gt:auth"); } public void onSink(INKFRequestContext aContext) throws Exception { IHDSMutator m=aContext.source("res:/md/authentication",IHDSDocument.class).getMutableClone(); IHDSReader primary=aContext.sourcePrimary(IHDSDocument.class).getReader(); String username=(String)primary.getFirstValue("/*/username"); String password=(String)primary.getFirstValue("/*/password"); IHDSMutator user=m.getFirstNodeOrNull("/authentication/user[username='"+username+"']"); if (user!=null) { INKFRequest req=aContext.createRequest("active:generatePasswordHash"); req.addArgumentByValue("password",password); req.setRepresentationClass(String.class); String hash=(String)aContext.issueRequest(req); user.setCursor("password").setValue(hash); IHDSDocument state=m.toDocument(false); PersistenceFactory.getPersistence(aContext).setAuthentication(state, aContext); MonitorUtils.cutGoldenThread(aContext, "gt:auth"); } } }
apache-2.0
numberer6/lightwave
vmdns/server/common/prototypes.h
3023
/* * File: prototypes.h * Author: huz * * Created on March 30, 2015, 3:47 PM */ #ifndef PROTOTYPES_H #define PROTOTYPES_H #ifdef __cplusplus extern "C" { #endif // Name Entry DWORD VmDnsCreateNameEntry( PCSTR pszZone, PCSTR pszName, PVMDNS_NAME_ENTRY* ppNameEntry ); DWORD VmDnsDeleteNameEntry( PVMDNS_NAME_ENTRY pNameEntry, BOOL bDirSync ); DWORD VmDnsNameEntryListRecord( PVMDNS_NAME_ENTRY pNameEntry, PVMDNS_RECORD_ARRAY* ppRecords ); DWORD VmDnsNameEntryCopyAllRecords( PVMDNS_NAME_ENTRY pNameEntry, PVMDNS_RECORD pRecordsBuffer, DWORD dwSize, DWORD* pdwCopied ); DWORD VmDnsNameEntryAddRecord( PVMDNS_NAME_ENTRY pNameEntry, PVMDNS_RECORD pRecord, BOOL bDirSync ); DWORD VmDnsNameEntryDeleteRecord( PVMDNS_NAME_ENTRY pNameEntry, PVMDNS_RECORD pRecord, BOOL bDirSync ); DWORD VmDnsNameEntryFindRecord( PVMDNS_NAME_ENTRY pNameEntry, PVMDNS_RECORD pRecord ); DWORD VmDnsNameEntryGetSoaRecord( PVMDNS_NAME_ENTRY pNameEntry, PVMDNS_RECORD* ppRecord ); DWORD VmDnsNameEntryUpdateSoaRecord( PVMDNS_NAME_ENTRY pNameEntry, PVMDNS_ZONE_INFO pZoneInfo, BOOL bDirSync ); DWORD VmDnsNameEntryGetRecordCount( PVMDNS_NAME_ENTRY pNameEntry ); //dnsparser.c DWORD VmDnsParseMessage( PVMDNS_MESSAGE_BUFFER pMessageBuffer, PVMDNS_MESSAGE *ppMessage ); DWORD VmDnsWriteHeaderToBuffer( PVMDNS_HEADER pHeader, PVMDNS_MESSAGE_BUFFER pMessageBuffer ); DWORD VmDnsForwarderResolveRequest( PVMDNS_FORWARDER_CONETXT pForwarder, BOOL bUseUDP, BOOL bRecusive, DWORD dwQuerySize, PBYTE pQueryBuffer, PDWORD pdwResponseSize, PBYTE* ppResopnse ); //dnsutils.c // DWORD VmDnsCreateBufferContext( PVMDNS_SOCK_BUF_CONTEXT *ppMessage ); PVMDNS_SOCK_BUF_CONTEXT VmDnsAcquireBufferContext( PVMDNS_SOCK_BUF_CONTEXT pMessage ); VOID VmDnsReleaseBufferContext( PVMDNS_SOCK_BUF_CONTEXT pMessage ); DWORD VmDnsGetAuthorityZone( PCSTR pszQueryName, PVMDNS_ZONE_INFO *ppZoneInfo ); DWORD VmDnsProcessRequest( PBYTE pDnsRequest, DWORD dwDnsRequestSize, PBYTE *ppDnsResponse, PDWORD pdwDnsResponseSize ); VOID VmDnsFreeQuestion( PVMDNS_QUESTION pQuestion ); VOID VmDnsFreeQuestions( PVMDNS_QUESTION *pQuestions, DWORD dwCount ); VOID VmDnsFreeRecordsArray( PVMDNS_RECORD *pRecords, DWORD dwCount ); DWORD VmDnsGetDnsMessage( PBYTE pDnsRequest, DWORD dwDnsRequestSize, PVMDNS_MESSAGE *ppDnsMessage ); VOID VmDnsFreeDnsMessage( PVMDNS_MESSAGE pVmDnsMessage ); #ifdef __cplusplus } #endif #endif /* PROTOTYPES_H */
apache-2.0
dsiufl/www.dsiufl.org-2016
_members/vempali_sai.md
611
--- layout: member # The next fields should be filled out appropriately. Place strings in double # quotes. name: "Sai Vishnu Teja Vempali" major: "Computer Science" minor: "" # Images should be placed in img/members and at least 500x300 px but not too # big since they'll take a long time to download image: "vempali_sai.jpg" # List the positions and semesters this person has held positions: - title: "Workshop Coordinator" semester: "2016 Fall Junior" --- Sai is a graduate student in Computer Science. Interests: <li>Statistical Data Analysis</li> <li>Machine Learning</li> <li>Programming</li>
apache-2.0
HadwinJ/PerfectDemo
PerfectSolution/Angular_ASPNETCore_Seed/Models/PagingResult.cs
386
using System.Collections.Generic; namespace Angular_ASPNETCore_Seed.Models { public struct PagingResult<T> { public IEnumerable<T> Records { get; set; } public int TotalRecords { get; set; } public PagingResult(IEnumerable<T> items, int totalRecords) { TotalRecords = totalRecords; Records = items; } } }
apache-2.0
KeepSafe/dexcount-gradle-plugin
src/main/java/com/getkeepsafe/dexcount/plugin/TaskApplicators.java
1649
/* * Copyright (C) 2015-2021 KeepSafe Software * * 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.getkeepsafe.dexcount.plugin; import com.android.repository.Revision; import com.android.repository.Revision.PreviewComparison; import java.util.Arrays; import java.util.List; import java.util.Optional; /** * Utility for obtaining an appropriate task applicator factory for a given * Android Gradle Plugin revision. */ public final class TaskApplicators { private TaskApplicators() { // no instances } public static Optional<TaskApplicator.Factory> getFactory(Revision revision) { List<TaskApplicator.Factory> factories = Arrays.asList( new SevenOhApplicator.Factory(), new FourTwoApplicator.Factory(), new FourOneApplicator.Factory(), new ThreeSixApplicator.Factory(), new ThreeFourApplicator.Factory(), new JavaOnlyApplicator.Factory() ); return factories.stream() .filter(it -> revision.compareTo(it.getMinimumRevision(), PreviewComparison.IGNORE) >= 0) .findFirst(); } }
apache-2.0
BlakeWilliams/crates.io
src/db.rs
6552
use std::cell::Cell; use std::error::Error; use std::mem; use std::sync::Arc; use pg; use pg::types::ToSql; use r2d2::{self, LoggingErrorHandler}; use r2d2_postgres::PostgresConnectionManager; use conduit::{Request, Response}; use conduit_middleware::Middleware; use app::{App, RequestApp}; use util::{CargoResult, LazyCell, internal}; pub type Pool = r2d2::Pool<PostgresConnectionManager>; type PooledConnnection<'a> = r2d2::PooledConnection<'a, PostgresConnectionManager>; pub fn pool(url: &str, config: r2d2::Config) -> Pool { let mgr = PostgresConnectionManager::new(url, pg::SslMode::None).unwrap(); r2d2::Pool::new(config, mgr, Box::new(LoggingErrorHandler)).unwrap() } pub struct TransactionMiddleware; pub struct Transaction { // fields are destructed top-to-bottom so ensure we destroy them in the // right order. tx: LazyCell<pg::Transaction<'static>>, slot: LazyCell<PooledConnnection<'static>>, commit: Cell<bool>, // Keep a handle to the app which keeps a handle to the database to ensure // that this `'static` is indeed at least a little more accurate (in that // it's alive for the period of time this `Transaction` is alive. app: Arc<App>, } impl Transaction { pub fn new(app: Arc<App>) -> Transaction { Transaction { app: app, slot: LazyCell::new(), tx: LazyCell::new(), commit: Cell::new(false), } } pub fn conn(&self) -> CargoResult<&pg::Connection> { // Here we want to tie the lifetime of a single connection the lifetime // of this request. Currently the lifetime of a connection is tied to // the lifetime of the pool from which it came from, which is the // mismatch. // // The unsafety here is frobbing lifetimes to ensure that they work out. // Additionally, any extension in a Request needs to live for the static // lifetime (yay!). // // To solve these problems, the private `Transaction` extension stores a // reference both to the pool (to keep it alive) as well as a connection // transmuted to the 'static lifetime. This allows us to allocate a // connection up front and then repeatedly hand it out. unsafe { if !self.slot.filled() { let conn = try!(self.app.database.get().map_err(|e| { internal(format!("failed to get a database connection: {}", e)) })); let conn: PooledConnnection = conn; self.slot.fill(mem::transmute::<_, PooledConnnection<'static>>(conn)); } } Ok(&**self.slot.borrow().unwrap()) } fn tx<'a>(&'a self) -> CargoResult<&'a (Connection + 'a)> { // Similar to above, the transaction for this request is actually tied // to the connection in the request itself, not 'static. We transmute it // to static as its paired with the inner connection to achieve the // desired effect. unsafe { if !self.tx.filled() { let conn = try!(self.conn()); let t = try!(conn.transaction()); let t = mem::transmute::<_, pg::Transaction<'static>>(t); self.tx.fill(t); } } let tx = self.tx.borrow(); let tx: &'a pg::Transaction<'static> = tx.unwrap(); Ok(tx) } pub fn rollback(&self) { self.commit.set(false); } pub fn commit(&self) { self.commit.set(true); } } impl Middleware for TransactionMiddleware { fn before(&self, req: &mut Request) -> Result<(), Box<Error+Send>> { if !req.extensions().contains::<Transaction>() { let app = req.app().clone(); req.mut_extensions().insert(Transaction::new(app)); } Ok(()) } fn after(&self, req: &mut Request, res: Result<Response, Box<Error+Send>>) -> Result<Response, Box<Error+Send>> { if res.is_ok() { let tx = req.extensions().find::<Transaction>() .expect("Transaction not present in request"); match tx.tx.borrow() { Some(transaction) if tx.commit.get() => { transaction.set_commit(); } _ => {} } } return res; } } pub trait RequestTransaction { /// Return the lazily initialized postgres connection for this request. /// /// The connection will live for the lifetime of the request. fn db_conn(&self) -> CargoResult<&pg::Connection>; /// Return the lazily initialized postgres transaction for this request. /// /// The transaction will live for the duration of the request, and it will /// only be set to commit() if a successful response code of 200 is seen. fn tx(&self) -> CargoResult<&Connection>; /// Flag the transaction to not be committed fn rollback(&self); /// Flag this transaction to be committed fn commit(&self); } impl<'a> RequestTransaction for Request + 'a { fn db_conn(&self) -> CargoResult<&pg::Connection> { self.extensions().find::<Transaction>() .expect("Transaction not present in request") .conn() } fn tx(&self) -> CargoResult<&Connection> { self.extensions().find::<Transaction>() .expect("Transaction not present in request") .tx() } fn rollback(&self) { self.extensions().find::<Transaction>() .expect("Transaction not present in request") .rollback() } fn commit(&self) { self.extensions().find::<Transaction>() .expect("Transaction not present in request") .commit() } } pub trait Connection { fn prepare(&self, query: &str) -> pg::Result<pg::Statement>; fn execute(&self, query: &str, params: &[&ToSql]) -> pg::Result<u64>; } impl Connection for pg::Connection { fn prepare(&self, query: &str) -> pg::Result<pg::Statement> { self.prepare(query) } fn execute(&self, query: &str, params: &[&ToSql]) -> pg::Result<u64> { self.execute(query, params) } } impl<'a> Connection for pg::Transaction<'a> { fn prepare(&self, query: &str) -> pg::Result<pg::Statement> { trace!("prepare: {}", query); self.prepare(query) } fn execute(&self, query: &str, params: &[&ToSql]) -> pg::Result<u64> { trace!("execute: {}", query); self.execute(query, params) } }
apache-2.0
iankronquist/puppetcpp
lib/include/puppet/runtime/types/array.hpp
7145
/** * @file * Declares the array type. */ #pragma once #include "tuple.hpp" #include "data.hpp" #include "../values/array.hpp" #include "../../cast.hpp" #include <boost/functional/hash.hpp> #include <boost/variant.hpp> #include <limits> #include <ostream> #include <functional> namespace puppet { namespace runtime { namespace types { /** * Represents the Puppet Array type. * @tparam Type The type of a runtime type. */ template <typename Type> struct basic_array { /** * Constructs an Array type. * @param type The element type of the array. Defaults to the Data type. * @param from The "from" type parameter. * @param to The "to" type parameter. */ explicit basic_array(Type type = data(), int64_t from = std::numeric_limits<int64_t>::min(), int64_t to = std::numeric_limits<int64_t>::max()) : _element_type(rvalue_cast(type)), _from(from), _to(to) { } /** * Gets the element type of the array. * @return Returns the element type of the array. */ Type const& element_type() const { return _element_type; } /** * Gets the "from" type parameter. * @return Returns the "from" type parameter. */ int64_t from() const { return _from; } /** * Gets the "to" type parameter. * @return Returns the "to" type parameter. */ int64_t to() const { return _to; } /** * Gets the name of the type. * @return Returns the name of the type (i.e. Array). */ static const char* name() { return "Array"; } /** * Determines if the given value is an instance of this type. * @tparam Value The type of the runtime value. * @param value The value to determine if it is an instance of this type. This value will never be a variable. * @return Returns true if the given value is an instance of this type or false if not. */ template <typename Value> bool is_instance(Value const& value) const { // Forward declaration of unsafe_is_instance for recursion bool unsafe_is_instance(void const*, void const*); // Check for array auto ptr = boost::get<values::basic_array<Value>>(&value); if (!ptr) { return false; } // Check for size is range int64_t size = static_cast<int64_t>(ptr->size()); if (!(_to < _from ? (size >= _to && size <= _from) : (size >= _from && size <= _to))) { return false; } // Check that each element is of the type for (auto const& element : *ptr) { if (!unsafe_is_instance(&element, &_element_type)) { return false; } } return true; } /** * Determines if the given type is a specialization (i.e. more specific) of this type. * @param other The other type to check for specialization. * @return Returns true if the other type is a specialization or false if not. */ bool is_specialization(Type const& other) const { // For the other type to be a specialization, it must be an Array or Tuple // For Tuple, the number of types must be 1 // The element types must match // And the range of other needs to be inside of this type's range int64_t from, to; auto array = boost::get<basic_array<Type>>(&other); if (!array) { // Check for Array[ElementType] if (array->element_type() != _element_type) { return false; } from = array->from(); to = array->to(); } else { // Check for a Tuple[ElementType] auto tuple = boost::get<basic_tuple<Type>>(&other); if (!tuple || tuple->types().size() != 1 || tuple->types().front() != _element_type) { return false; } from = tuple->from(); to = tuple->to(); } // Check for equality if (from == _from && to == _to) { return false; } return std::min(from, to) >= std::min(_from, _to) && std::max(from, to) <= std::max(_from, _to); } private: Type _element_type; int64_t _from; int64_t _to; }; /** * Stream insertion operator for array type. * @tparam Type The runtime "type" type. * @param os The output stream to write the type to. * @param type The type to write. * @return Returns the given output stream. */ template <typename Type> std::ostream& operator<<(std::ostream& os, basic_array<Type> const& type) { os << basic_array<Type>::name() << '[' << type.element_type(); bool from_default = type.from() == std::numeric_limits<int64_t>::min(); bool to_default = type.to() == std::numeric_limits<int64_t>::max(); if (from_default && to_default) { // Only output the type os << ']'; return os; } os << ", "; if (from_default) { os << "default"; } else { os << type.from(); } os << ", "; if (to_default) { os << "default"; } else { os << type.to(); } os << ']'; return os; } /** * Equality operator for array. * @tparam Type The "runtime type" type. * @param left The left type to compare. * @param right The right type to compare. * @return Returns true if the two types are equal or false if not. */ template <typename Type> bool operator==(basic_array<Type> const& left, basic_array<Type> const& right) { return left.from() == right.from() && left.to() == right.to() && left.element_type() == right.element_type(); } }}} // puppet::runtime::types namespace boost { /** * Hash specialization for Array type. * @tparam Type The "runtime type" type. */ template <typename Type> struct hash<puppet::runtime::types::basic_array<Type>> { /** * Hashes the Array type. * @param type The type to hash. * @return Returns the hash value for the type. */ size_t operator()(puppet::runtime::types::basic_array<Type> const& type) const { size_t seed = 0; hash_combine(seed, puppet::runtime::types::basic_array<Type>::name()); hash_combine(seed, type.element_type()); hash_combine(seed, type.from()); hash_combine(seed, type.to()); return seed; } }; }
apache-2.0
JAVA201708/Homework
201709/20170915/Team1/Malanlan/编程题/ex05/Test5.java
2394
public class Test5 { public static void main(String[] args) { Goods iphone = new Iphone(); iphone.setName("iphone"); iphone.setPrice(5000.0); Goods shoes =new Shoes(); shoes.setName("鞋"); shoes.setPrice(123.0); Item item =new Item(); item.setGoods(iphone); item.setAmount(2); Item item1 =new Item(); item1.setGoods(shoes); item1.setAmount(3); Order order = new Order(); order.order(item); Order order1 = new Order(); order1.order(item1); Customer customer = new Customer(); customer.order(order); Customer customer2 = new Customer(); customer2.order(order1); Payment aliay = new Aliay(); customer.pay(aliay); aliay.pay(order.getTotalMoney()); } } class Customer { public void order(Order order) { System.out.println("订单内容:"); } public void pay(Payment payment) { System.out.println("你选择的支付方式是:"); } } class Order { private String id; // private date createDate; Item[] items = new Item[2]; public void order(Item item) { } public double getTotalMoney() { Goods iphone = new Iphone(); Goods shoes =new Shoes(); return (double)(iphone.getPrice()*items[0].getAmount()+shoes.getPrice()*items[1].getAmount()); } } class Item { private Goods goods; private int amount; public void setGoods(Goods goods) { this.goods = goods; } public Goods getGoods() { return goods; } public void setAmount(int amount) { this.amount = amount; } public int getAmount() { return amount; } } class Goods { private double price; private String name; public void setPrice(double price) { this.price = price; } public double getPrice() { return price; } public void setName(String name) { this.name = name; } public String getName() { return name; } } class Iphone extends Goods { } class Shoes extends Goods { } interface Payment { void pay(double money); } class Aliay implements Payment { public void pay(double money) { System.out.println("阿里支付"+money); } } class ApplePay implements Payment { public void pay(double money) { System.out.println("苹果支付"+money); } } class WeixinPay implements Payment { public void pay(double money) { System.out.println("微信支付"+money); } }
apache-2.0
segfault/apache_cassandra
src/java/org/apache/cassandra/db/HintedHandOffManager.java
15835
/** * 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.cassandra.db; import java.io.DataInputStream; import java.io.IOException; import java.io.InputStream; import java.lang.management.ManagementFactory; import java.net.InetAddress; import java.net.UnknownHostException; import java.nio.ByteBuffer; import java.util.*; import java.util.concurrent.ExecutorService; import java.util.concurrent.TimeoutException; import javax.management.MBeanServer; import javax.management.ObjectName; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.apache.cassandra.concurrent.JMXEnabledThreadPoolExecutor; import org.apache.cassandra.config.DatabaseDescriptor; import org.apache.cassandra.db.compaction.CompactionManager; import org.apache.cassandra.db.filter.QueryFilter; import org.apache.cassandra.db.filter.QueryPath; import org.apache.cassandra.dht.IPartitioner; import org.apache.cassandra.dht.Range; import org.apache.cassandra.dht.Token; import org.apache.cassandra.gms.ApplicationState; import org.apache.cassandra.gms.FailureDetector; import org.apache.cassandra.gms.Gossiper; import org.apache.cassandra.net.MessagingService; import org.apache.cassandra.service.*; import org.apache.cassandra.thrift.*; import org.apache.cassandra.utils.ByteBufferUtil; import org.apache.cassandra.utils.FBUtilities; import org.apache.cassandra.utils.WrappedRunnable; import org.cliffc.high_scale_lib.NonBlockingHashSet; /** * For each endpoint for which we have hints, there is a row in the system hints CF. * The key for this row is ByteBuffer.wrap(string), i.e. "127.0.0.1". * (We have to use String keys for compatibility with OPP.) * SuperColumns in these rows are the mutations to replay, with uuid names: * * <dest ip>: { // key * <uuid>: { // supercolumn * mutation: <mutation> // subcolumn * version: <mutation serialization version> * table: <table of hinted mutation> * key: <key of hinted mutation> * } * } * * When FailureDetector signals that a node that was down is back up, we page through * the hinted mutations and send them over one at a time, waiting for * hinted_handoff_throttle_delay in between each. * * deliverHints is also exposed to JMX so it can be run manually if FD ever misses * its cue somehow. */ public class HintedHandOffManager implements HintedHandOffManagerMBean { public static final HintedHandOffManager instance = new HintedHandOffManager(); public static final String HINTS_CF = "HintsColumnFamily"; private static final Logger logger_ = LoggerFactory.getLogger(HintedHandOffManager.class); private static final int PAGE_SIZE = 1024; private static final String SEPARATOR = "-"; private static final int LARGE_NUMBER = 65536; // 64k nodes ought to be enough for anybody. private final NonBlockingHashSet<InetAddress> queuedDeliveries = new NonBlockingHashSet<InetAddress>(); private final ExecutorService executor_ = new JMXEnabledThreadPoolExecutor("HintedHandoff"); public HintedHandOffManager() { MBeanServer mbs = ManagementFactory.getPlatformMBeanServer(); try { mbs.registerMBean(this, new ObjectName("org.apache.cassandra.db:type=HintedHandoffManager")); } catch (Exception e) { throw new RuntimeException(e); } } public void registerMBean() { logger_.debug("Created HHOM instance, registered MBean."); } private static boolean sendMutation(InetAddress endpoint, RowMutation mutation) throws IOException { IWriteResponseHandler responseHandler = WriteResponseHandler.create(endpoint); MessagingService.instance().sendRR(mutation, endpoint, responseHandler); try { responseHandler.get(); } catch (TimeoutException e) { return false; } try { Thread.sleep(DatabaseDescriptor.getHintedHandoffThrottleDelay()); } catch (InterruptedException e) { throw new AssertionError(e); } return true; } private static void deleteHint(ByteBuffer tokenBytes, ByteBuffer hintId, long timestamp) throws IOException { RowMutation rm = new RowMutation(Table.SYSTEM_TABLE, tokenBytes); rm.delete(new QueryPath(HINTS_CF, hintId), timestamp); rm.apply(); } public void deleteHintsForEndpoint(final String ipOrHostname) { try { InetAddress endpoint = InetAddress.getByName(ipOrHostname); deleteHintsForEndpoint(endpoint); } catch (UnknownHostException e) { logger_.warn("Unable to find "+ipOrHostname+", not a hostname or ipaddr of a node?:"); e.printStackTrace(); throw new RuntimeException(e); } } public void deleteHintsForEndpoint(final InetAddress endpoint) { if (!StorageService.instance.getTokenMetadata().isMember(endpoint)) return; Token<?> token = StorageService.instance.getTokenMetadata().getToken(endpoint); ByteBuffer tokenBytes = StorageService.getPartitioner().getTokenFactory().toByteArray(token); final ColumnFamilyStore hintStore = Table.open(Table.SYSTEM_TABLE).getColumnFamilyStore(HINTS_CF); final RowMutation rm = new RowMutation(Table.SYSTEM_TABLE, tokenBytes); rm.delete(new QueryPath(HINTS_CF), System.currentTimeMillis()); // execute asynchronously to avoid blocking caller (which may be processing gossip) Runnable runnable = new Runnable() { public void run() { try { logger_.info("Deleting any stored hints for " + endpoint); rm.apply(); hintStore.forceFlush(); CompactionManager.instance.submitMaximal(hintStore, Integer.MAX_VALUE); } catch (Exception e) { logger_.warn("Could not delete hints for " + endpoint + ": " + e); } } }; StorageService.tasks.execute(runnable); } private static boolean pagingFinished(ColumnFamily hintColumnFamily, ByteBuffer startColumn) { // done if no hints found or the start column (same as last column processed in previous iteration) is the only one return hintColumnFamily == null || (hintColumnFamily.getSortedColumns().size() == 1 && hintColumnFamily.getColumn(startColumn) != null); } private int waitForSchemaAgreement(InetAddress endpoint) throws InterruptedException { Gossiper gossiper = Gossiper.instance; int waited = 0; // first, wait for schema to be gossiped. while (gossiper.getEndpointStateForEndpoint(endpoint).getApplicationState(ApplicationState.SCHEMA) == null) { Thread.sleep(1000); waited += 1000; if (waited > 2 * StorageService.RING_DELAY) throw new RuntimeException("Didin't receive gossiped schema from " + endpoint + " in " + 2 * StorageService.RING_DELAY + "ms"); } waited = 0; // then wait for the correct schema version. // usually we use DD.getDefsVersion, which checks the local schema uuid as stored in the system table. // here we check the one in gossip instead; this serves as a canary to warn us if we introduce a bug that // causes the two to diverge (see CASSANDRA-2946) while (!gossiper.getEndpointStateForEndpoint(endpoint).getApplicationState(ApplicationState.SCHEMA).value.equals( gossiper.getEndpointStateForEndpoint(FBUtilities.getBroadcastAddress()).getApplicationState(ApplicationState.SCHEMA).value)) { Thread.sleep(1000); waited += 1000; if (waited > 2 * StorageService.RING_DELAY) throw new RuntimeException("Could not reach schema agreement with " + endpoint + " in " + 2 * StorageService.RING_DELAY + "ms"); } logger_.debug("schema for {} matches local schema", endpoint); return waited; } private void deliverHintsToEndpoint(InetAddress endpoint) throws IOException, DigestMismatchException, InvalidRequestException, TimeoutException, InterruptedException { try { logger_.debug("Checking remote({}) schema before delivering hints", endpoint); int waited = waitForSchemaAgreement(endpoint); // sleep a random amount to stagger handoff delivery from different replicas. // (if we had to wait, then gossiper randomness took care of that for us already.) if (waited == 0) { int sleep = new Random().nextInt(60000); logger_.debug("Sleeping {}ms to stagger hint delivery", sleep); Thread.sleep(sleep); } if (!FailureDetector.instance.isAlive(endpoint)) { logger_.info("Endpoint {} died before hint delivery, aborting", endpoint); return; } } finally { queuedDeliveries.remove(endpoint); } // 1. Get the key of the endpoint we need to handoff // 2. For each column, deserialize the mutation and send it to the endpoint // 3. Delete the subcolumn if the write was successful // 4. Force a flush // 5. Do major compaction to clean up all deletes etc. // find the hints for the node using its token. Token<?> token = StorageService.instance.getTokenMetadata().getToken(endpoint); logger_.info("Started hinted handoff for token: {} with IP: {}", token, endpoint); ByteBuffer tokenBytes = StorageService.getPartitioner().getTokenFactory().toByteArray(token); DecoratedKey<?> epkey = StorageService.getPartitioner().decorateKey(tokenBytes); int rowsReplayed = 0; ColumnFamilyStore hintStore = Table.open(Table.SYSTEM_TABLE).getColumnFamilyStore(HINTS_CF); ByteBuffer startColumn = ByteBufferUtil.EMPTY_BYTE_BUFFER; delivery: while (true) { QueryFilter filter = QueryFilter.getSliceFilter(epkey, new QueryPath(HINTS_CF), startColumn, ByteBufferUtil.EMPTY_BYTE_BUFFER, false, PAGE_SIZE); ColumnFamily hintColumnFamily = ColumnFamilyStore.removeDeleted(hintStore.getColumnFamily(filter), Integer.MAX_VALUE); if (pagingFinished(hintColumnFamily, startColumn)) break; for (IColumn hint : hintColumnFamily.getSortedColumns()) { startColumn = hint.name(); IColumn versionColumn = hint.getSubColumn(ByteBufferUtil.bytes("version")); IColumn tableColumn = hint.getSubColumn(ByteBufferUtil.bytes("table")); IColumn keyColumn = hint.getSubColumn(ByteBufferUtil.bytes("key")); IColumn mutationColumn = hint.getSubColumn(ByteBufferUtil.bytes("mutation")); assert versionColumn != null; assert tableColumn != null; assert keyColumn != null; assert mutationColumn != null; DataInputStream in = new DataInputStream(ByteBufferUtil.inputStream(mutationColumn.value())); RowMutation rm = RowMutation.serializer().deserialize(in, ByteBufferUtil.toInt(versionColumn.value())); if (sendMutation(endpoint, rm)) { deleteHint(tokenBytes, hint.name(), versionColumn.timestamp()); rowsReplayed++; } else { logger_.info("Could not complete hinted handoff to " + endpoint); break delivery; } } } if (rowsReplayed > 0) { hintStore.forceFlush(); try { CompactionManager.instance.submitMaximal(hintStore, Integer.MAX_VALUE).get(); } catch (Exception e) { throw new RuntimeException(e); } } logger_.info(String.format("Finished hinted handoff of %s rows to endpoint %s", rowsReplayed, endpoint)); } /* * This method is used to deliver hints to a particular endpoint. * When we learn that some endpoint is back up we deliver the data * to him via an event driven mechanism. */ public void deliverHints(final InetAddress to) { if (!queuedDeliveries.add(to)) return; Runnable r = new WrappedRunnable() { public void runMayThrow() throws Exception { deliverHintsToEndpoint(to); } }; executor_.execute(r); } public void deliverHints(String to) throws UnknownHostException { deliverHints(InetAddress.getByName(to)); } public List<String> listEndpointsPendingHints() { List<Row> rows = getHintsSlice(1); // Extract the keys as strings to be reported. LinkedList<String> result = new LinkedList<String>(); for (Row r : rows) { if (r.cf != null) //ignore removed rows result.addFirst(new String(r.key.key.array())); } return result; } public Map<String, Integer> countPendingHints() { List<Row> rows = getHintsSlice(Integer.MAX_VALUE); Map<String, Integer> result = new HashMap<String, Integer>(); for (Row r : rows) { if (r.cf != null) //ignore removed rows result.put(new String(r.key.key.array()), r.cf.getColumnCount()); } return result; } private List<Row> getHintsSlice(int column_count) { // ColumnParent for HintsCF... ColumnParent parent = new ColumnParent(HINTS_CF); // Get count # of columns... SlicePredicate predicate = new SlicePredicate(); SliceRange sliceRange = new SliceRange(); sliceRange.setStart(new byte[0]).setFinish(new byte[0]); sliceRange.setCount(column_count); predicate.setSlice_range(sliceRange); // From keys "" to ""... IPartitioner<?> partitioner = StorageService.getPartitioner(); ByteBuffer empty = ByteBufferUtil.EMPTY_BYTE_BUFFER; Range range = new Range(partitioner.getToken(empty), partitioner.getToken(empty)); // Get a bunch of rows! List<Row> rows; try { rows = StorageProxy.getRangeSlice(new RangeSliceCommand("system", parent, predicate, range, LARGE_NUMBER), ConsistencyLevel.ONE); } catch (Exception e) { logger_.info("HintsCF getEPPendingHints timed out."); throw new RuntimeException(e); } return rows; } }
apache-2.0
Tochemey/NetFreeSwitch.Framework
NetFreeSwitch.Framework/FreeSwitch/Commands/DivertEventsCommand.cs
1199
/* 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. */ namespace NetFreeSwitch.Framework.FreeSwitch.Commands { /// <summary> /// DivertEvent /// </summary> public class DivertEventsCommand : BaseCommand { private readonly bool _flag; public DivertEventsCommand(bool flag) { _flag = flag; } public override string Command { get { return "divert_events"; } } public override string Argument { get { return _flag ? "on" : "off"; } } } }
apache-2.0
genius1611/Keystone
keystone/logic/types/user.py
9678
# Copyright (c) 2010-2011 OpenStack, LLC. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or # implied. # See the License for the specific language governing permissions and # limitations under the License. import json from lxml import etree from keystone.logic.types import fault class User(object): """Document me!""" def __init__(self, password=None, id=None, name=None, tenant_id=None, email=None, enabled=None, tenant_roles=None): self.id = id self.name = name self.tenant_id = tenant_id self.password = password self.email = email self.enabled = enabled and True or False self.tenant_roles = tenant_roles @staticmethod def from_xml(xml_str): try: dom = etree.Element("root") dom.append(etree.fromstring(xml_str)) root = dom.find("{http://docs.openstack.org/identity/api/v2.0}" \ "user") if root == None: raise fault.BadRequestFault("Expecting User") name = root.get("name") tenant_id = root.get("tenantId") email = root.get("email") password = root.get("password") enabled = root.get("enabled") if not name: raise fault.BadRequestFault("Expecting User") elif not password: raise fault.BadRequestFault("Expecting User password") elif not email: raise fault.BadRequestFault("Expecting User email") enabled = enabled is None or enabled.lower() in ["true", "yes"] return User(password, id, name, tenant_id, email, enabled) except etree.LxmlError as e: raise fault.BadRequestFault("Cannot parse User", str(e)) @staticmethod def from_json(json_str): try: obj = json.loads(json_str) if not "user" in obj: raise fault.BadRequestFault("Expecting User") user = obj["user"] id = user.get('id', None) name = user.get('name', None) if not "password" in user: raise fault.BadRequestFault("Expecting User Password") password = user["password"] if (id == None or len(id.strip()) == 0) and ( name == None or len(name.strip()) == 0): raise fault.BadRequestFault("Expecting User") elif password == None or len(password.strip()) == 0: raise fault.BadRequestFault("Expecting User password") if "tenantId" in user: tenant_id = user["tenantId"] else: tenant_id = None if "email" not in user: raise fault.BadRequestFault("Expecting User Email") email = user["email"] if "enabled" in user: set_enabled = user["enabled"] if not isinstance(set_enabled, bool): raise fault.BadRequestFault("Bad enabled attribute!") else: set_enabled = True return User(password, id, name, tenant_id, email, set_enabled) except (ValueError, TypeError) as e: raise fault.BadRequestFault("Cannot parse Tenant", str(e)) def to_dom(self): dom = etree.Element("user", xmlns="http://docs.openstack.org/identity/api/v2.0") if self.email: dom.set("email", unicode(self.email)) if self.tenant_id: dom.set("tenantId", unicode(self.tenant_id)) if self.id: dom.set("id", unicode(self.id)) if self.name: dom.set("name", unicode(self.name)) if self.enabled: dom.set("enabled", unicode(self.enabled).lower()) if self.password: dom.set("password", unicode(self.password)) if self.tenant_roles: dom_roles = etree.Element("tenantRoles") for role in self.tenant_roles: dom_role = etree.Element("tenantRole") dom_role.text = role dom_roles.append(dom_role) dom.append(dom_roles) return dom def to_xml(self): return etree.tostring(self.to_dom()) def to_dict(self): user = {} if self.id: user["id"] = unicode(self.id) if self.name: user["name"] = unicode(self.name) if self.tenant_id: user["tenantId"] = unicode(self.tenant_id) if self.password: user["password"] = unicode(self.password) user["email"] = unicode(self.email) user["enabled"] = self.enabled if self.tenant_roles: user["tenantRoles"] = list(self.tenant_roles) return {'user': user} def to_json(self): return json.dumps(self.to_dict()) class User_Update(object): """Document me!""" def __init__(self, password=None, id=None, name=None, tenant_id=None, email=None, enabled=None): self.id = id self.name = name self.tenant_id = tenant_id self.password = password self.email = email self.enabled = bool(enabled) if enabled is not None else None @staticmethod def from_xml(xml_str): try: dom = etree.Element("root") dom.append(etree.fromstring(xml_str)) root = dom.find("{http://docs.openstack.org/identity/api/v2.0}" \ "user") if root == None: raise fault.BadRequestFault("Expecting User") id = root.get("id") name = root.get("name") tenant_id = root.get("tenantId") email = root.get("email") password = root.get("password") enabled = root.get("enabled") if enabled == None or enabled == "true" or enabled == "yes": set_enabled = True elif enabled == "false" or enabled == "no": set_enabled = False else: raise fault.BadRequestFault("Bad enabled attribute!") # TODO: WTF is this?! if password == '': password = id return User(password=password, id=id, name=name, tenant_id=tenant_id, email=email, enabled=set_enabled) except etree.LxmlError as e: raise fault.BadRequestFault("Cannot parse User", str(e)) @staticmethod def from_json(json_str): try: obj = json.loads(json_str) if not "user" in obj: raise fault.BadRequestFault("Expecting User") user = obj["user"] id = user.get('id', None) name = user.get('name', None) password = user.get('password', None) tenant_id = user.get('tenantId', None) email = user.get('email', None) enabled = user.get('enabled', True) if not isinstance(enabled, bool): raise fault.BadRequestFault("Bad enabled attribute!") # TODO: WTF is this?! if password == '': password = id return User(password, id, name, tenant_id, email, enabled) except (ValueError, TypeError) as e: raise fault.BadRequestFault("Cannot parse Tenant", str(e)) def to_dom(self): dom = etree.Element("user", xmlns="http://docs.openstack.org/identity/api/v2.0") if self.email: dom.set("email", unicode(self.email)) if self.tenant_id: dom.set("tenantId", unicode(self.tenant_id)) if self.id: dom.set("id", unicode(self.id)) if self.name: dom.set("name", unicode(self.name)) if self.enabled is not None: dom.set("enabled", unicode(self.enabled).lower()) if self.password: dom.set("password", unicode(self.password)) return dom def to_xml(self): return etree.tostring(self.to_dom()) def to_dict(self): user = {} if self.id: user["id"] = unicode(self.id) if self.name: user["name"] = unicode(self.name) if self.tenant_id: user["tenantId"] = unicode(self.tenant_id) if self.password: user["password"] = unicode(self.password) if self.email: user["email"] = unicode(self.email) if self.enabled is not None: user["enabled"] = self.enabled return {'user': user} def to_json(self): return json.dumps(self.to_dict()) class Users(object): """A collection of users.""" def __init__(self, values, links): self.values = values self.links = links def to_xml(self): dom = etree.Element("users") dom.set(u"xmlns", "http://docs.openstack.org/identity/api/v2.0") for t in self.values: dom.append(t.to_dom()) for t in self.links: dom.append(t.to_dom()) return etree.tostring(dom) def to_json(self): values = [t.to_dict()["user"] for t in self.values] links = [t.to_dict()["links"] for t in self.links] return json.dumps({"users": values, "users_links": links})
apache-2.0
timotei/gradle-nuget-plugin
README.md
3133
# Gradle NuGet Plugin [![Build status](https://ci.appveyor.com/api/projects/status/ua9pbginenbf1b1u/branch/master?svg=true)](https://ci.appveyor.com/project/gluck/gradle-nuget-plugin/branch/master) [![Build Status](https://travis-ci.org/Ullink/gradle-nuget-plugin.svg?branch=master)](https://travis-ci.org/Ullink/gradle-nuget-plugin) This plugin allows to execute NuGet.exe from a gradle build. It also supports pack & push commands through built-in tasks, nugetPack, nugetPush & nugetRestore. ## nugetPack You can see this plugin being used for real on [il-repack](https://github.com/gluck/il-repack) project. (together with msbuild one) ## nugetSpec The task is to generate nuspec file by custom configuration - Sample usage: buildscript { repositories { mavenCentral() } dependencies { classpath "com.ullink.gradle:gradle-nuget-plugin:2.5" } } apply plugin:'nuget' nuget { // nuget.exe version to use, defaults to 3.3.0 // available versions can be found [here](https://dist.nuget.org/index.html) version = '3.3.0' } nugetSpec { // Array, Map and Closure could be used to generate nuspec XML, for details please check NuGetSpecTest nuspec = [ metadata: [ title: 'project title', authors: 'Francois Valdy', // id: default is project.name // version: default is project.version // description: default is project.description // ... ] files: [ { file (src: 'somefile1', target: 'tools') }, { file (src: 'somefile2', target: 'tools') } ] ] } ## nugetRestore Nuget restore is used to retrieve missing packages before starting the build - Sample usage: nugetRestore { solutionDirectory = path\to\project packagesDirectory = location\for\package\restore } Where - solutionDirectory - could either contain the .sln file or the repositories.config file - packagesDirectory - used only if a folder with repositories.config is used # See also [Gradle Msbuild plugin](https://github.com/Ullink/gradle-msbuild-plugin) - Allows to build VS projects & solutions. [Gradle NUnit plugin](https://github.com/Ullink/gradle-nunit-plugin) - Allows to execute NUnit tests from CI (used with this plugin to build the projects prior to UT execution) [Gradle OpenCover plugin](https://github.com/Ullink/gradle-opencover-plugin) - Allows to execute the UTs through OpenCover for coverage reports. You can see these 4 plugins in use on [ILRepack](https://github.com/gluck/il-repack) project ([build.gradle](https://github.com/gluck/il-repack/blob/master/build.gradle)). # License All these plugins are licensed under the [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.html) with no warranty (expressed or implied) for any purpose.
apache-2.0
apigee/registry
server/registry/internal/storage/get.go
5445
// Copyright 2022 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 storage import ( "context" "github.com/apigee/registry/server/registry/internal/storage/models" "github.com/apigee/registry/server/registry/names" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" "gorm.io/gorm" ) func (c *Client) GetProject(ctx context.Context, name names.Project) (*models.Project, error) { v := new(models.Project) if err := c.db.Take(v, "key = ?", name.String()).Error; err == gorm.ErrRecordNotFound { return nil, status.Errorf(codes.NotFound, "%q not found in database", name) } else if err != nil { return nil, status.Error(codes.Internal, err.Error()) } return v, nil } func (c *Client) GetApi(ctx context.Context, name names.Api) (*models.Api, error) { v := new(models.Api) if err := c.db.Take(v, "key = ?", name.String()).Error; err == gorm.ErrRecordNotFound { return nil, status.Errorf(codes.NotFound, "%q not found in database", name) } else if err != nil { return nil, status.Error(codes.Internal, err.Error()) } return v, nil } func (c *Client) GetVersion(ctx context.Context, name names.Version) (*models.Version, error) { v := new(models.Version) if err := c.db.Take(v, "key = ?", name.String()).Error; err == gorm.ErrRecordNotFound { return nil, status.Errorf(codes.NotFound, "%q not found in database", name) } else if err != nil { return nil, status.Error(codes.Internal, err.Error()) } return v, nil } func (c *Client) GetSpec(ctx context.Context, name names.Spec) (*models.Spec, error) { name = name.Normal() op := c.db. Where("project_id = ?", name.ProjectID). Where("api_id = ?", name.ApiID). Where("version_id = ?", name.VersionID). Where("spec_id = ?", name.SpecID). Order("revision_create_time desc") v := new(models.Spec) if err := op.First(v).Error; err == gorm.ErrRecordNotFound { return nil, status.Errorf(codes.NotFound, "%q not found in database", name) } else if err != nil { return nil, status.Error(codes.Internal, err.Error()) } return v, nil } func (c *Client) GetSpecRevision(ctx context.Context, name names.SpecRevision) (*models.Spec, error) { name, err := c.unwrapSpecRevisionTag(ctx, name) if err != nil { return nil, err } v := new(models.Spec) if err := c.db.Take(v, "key = ?", name.String()).Error; err == gorm.ErrRecordNotFound { return nil, status.Errorf(codes.NotFound, "%q not found in database", name) } else if err != nil { return nil, status.Error(codes.Internal, err.Error()) } return v, nil } func (c *Client) GetSpecRevisionContents(ctx context.Context, name names.SpecRevision) (*models.Blob, error) { name, err := c.unwrapSpecRevisionTag(ctx, name) if err != nil { return nil, err } v := new(models.Blob) if err := c.db.Take(v, "key = ?", name.String()).Error; err == gorm.ErrRecordNotFound { return nil, status.Errorf(codes.NotFound, "%q not found in database", name) } else if err != nil { return nil, status.Error(codes.Internal, err.Error()) } return v, nil } func (c *Client) GetDeployment(ctx context.Context, name names.Deployment) (*models.Deployment, error) { name = name.Normal() op := c.db. Where("project_id = ?", name.ProjectID). Where("api_id = ?", name.ApiID). Where("deployment_id = ?", name.DeploymentID). Order("revision_create_time desc") v := new(models.Deployment) if err := op.First(v).Error; err == gorm.ErrRecordNotFound { return nil, status.Errorf(codes.NotFound, "%q not found in database", name) } else if err != nil { return nil, status.Error(codes.Internal, err.Error()) } return v, nil } func (c *Client) GetDeploymentRevision(ctx context.Context, name names.DeploymentRevision) (*models.Deployment, error) { name, err := c.unwrapDeploymentRevisionTag(ctx, name) if err != nil { return nil, err } v := new(models.Deployment) if err := c.db.Take(v, "key = ?", name.String()).Error; err == gorm.ErrRecordNotFound { return nil, status.Errorf(codes.NotFound, "%q not found in database", name) } else if err != nil { return nil, status.Error(codes.Internal, err.Error()) } return v, nil } func (c *Client) GetArtifact(ctx context.Context, name names.Artifact) (*models.Artifact, error) { v := new(models.Artifact) if err := c.db.Take(v, "key = ?", name.String()).Error; err == gorm.ErrRecordNotFound { return nil, status.Errorf(codes.NotFound, "%q not found in database", name) } else if err != nil { return nil, status.Error(codes.Internal, err.Error()) } return v, nil } func (c *Client) GetArtifactContents(ctx context.Context, name names.Artifact) (*models.Blob, error) { v := new(models.Blob) if err := c.db.Take(v, "key = ?", name.String()).Error; err == gorm.ErrRecordNotFound { return nil, status.Errorf(codes.NotFound, "%q not found in database", name) } else if err != nil { return nil, status.Error(codes.Internal, err.Error()) } return v, nil }
apache-2.0
codyer/CleanFramework
app/src/main/java/com/cody/app/framework/hybrid/core/JsHandler.java
380
package com.cody.app.framework.hybrid.core; import com.cody.xf.common.NotProguard; /** * Created by cody.yi on 2017/4/13. * 所有Js处理类实现这个接口 * Js调用的方法必须按照一定的格式定义,否则不生效 * 格式: * public static void ***(WebView webView, JsonObject data, JsCallback callback){} */ @NotProguard public interface JsHandler { }
apache-2.0
anha1/mcp-adc
mcp-adc.js
2219
var SPI = require('spi'); var extend = require('util')._extend; var openSpi = function() { var device = '/dev/spidev0.0'; return new SPI.Spi(device, [], function(s) { s.open(); }); }; var Adc = function(options) { var self = this; var settings = extend( { voltage: 3.3, //3.3V by default spi: null }, options); self.voltage = settings.voltage; self.spi = settings.spi || openSpi(); /** * Read voltage (in a range 0-3.3V by default). * @param channel * @param callback */ self.readVoltage = function(channel, callback) { self.readSpi(channel, function(value) { var voltage = ((value * self.voltage) / self.maxValue); callback(voltage); }); }; /** * Read normalized value (in a range 0-1). * @param channel * @param callback */ self.readNormalizedValue = function(channel, callback) { self.readSpi(channel, function(value) { var normalizedValue = ((value) / self.maxValue); callback(normalizedValue); }); }; /** * Read raw ADC value (the range depends on ADC resolution). * @param channel * @param callback */ self.readRawValue = function(channel, callback) { self.readSpi(channel, callback); } }; module.exports.Mcp3208 = function(options) { var self = this; Adc.call(self, options); self.maxValue = 4095; self.readSpi = function(channel, callback) { var tx = new Buffer([4 | 2 | (channel >> 2), (channel & 3) << 6, 0]); var rx = new Buffer([0, 0, 0]); self.spi.transfer(tx, rx, function(dev, buffer) { var value = ((buffer[1] & 15) << 8) + buffer[2]; callback(value); }) }; }; module.exports.Mcp3008 = function(options) { var self = this; Adc.call(self, options); self.maxValue = 1023; self.readSpi = function(channel, callback) { var tx = new Buffer([1, (8 + channel) << 4, 0]); var rx = new Buffer([0, 0, 0]); self.spi.transfer(tx, rx, function(dev, buffer) { var value = ((buffer[1] & 3) << 8) + buffer[2]; callback(value); }) }; };
apache-2.0
estatio/estatio
estatioapp/app/src/main/java/org/estatio/module/turnover/dom/entry/TurnoverEntryRequest.java
2742
package org.estatio.module.turnover.dom.entry; import java.math.BigDecimal; import java.math.BigInteger; import java.util.List; import javax.inject.Inject; import org.joda.time.LocalDate; import org.apache.isis.applib.annotation.Action; import org.apache.isis.applib.annotation.ActionLayout; import org.apache.isis.applib.annotation.Contributed; import org.apache.isis.applib.annotation.DomainObject; import org.apache.isis.applib.annotation.Editing; import org.apache.isis.applib.annotation.Nature; import org.apache.isis.applib.annotation.Property; import org.apache.isis.applib.annotation.SemanticsOf; import org.apache.isis.applib.annotation.Where; import org.estatio.module.asset.dom.Unit; import org.estatio.module.lease.dom.Lease; import org.estatio.module.turnover.dom.Frequency; import org.estatio.module.turnover.dom.Turnover; import org.estatio.module.turnover.dom.TurnoverReportingConfig; import org.estatio.module.turnover.dom.TurnoverRepository; import org.estatio.module.turnover.dom.Type; import lombok.Getter; import lombok.Setter; @DomainObject(nature = Nature.VIEW_MODEL, objectType = "org.estatio.module.turnover.dom.entry.TurnoverEntryRequest") public class TurnoverEntryRequest { public TurnoverEntryRequest(){} public TurnoverEntryRequest( final TurnoverReportingConfig config, final LocalDate date, final Type type, final Frequency frequency ){ this.config = config; this.date = date; this.type = type; this.frequency = frequency; } @Getter @Setter @Property(hidden = Where.EVERYWHERE) private TurnoverReportingConfig config; public Lease getlease(){ return getConfig().getOccupancy().getLease(); } public Unit getUnit(){ return getConfig().getOccupancy().getUnit(); } @Getter @Setter private LocalDate date; @Getter @Setter private Type type; @Getter @Setter private Frequency frequency; @Getter @Setter @Property(editing = Editing.ENABLED) private BigDecimal netAmount; @Getter @Setter @Property(editing = Editing.ENABLED) private BigDecimal grossAmount; @Getter @Setter @Property(editing = Editing.ENABLED) private BigInteger purchaseCount; @Getter @Setter @Property(editing = Editing.ENABLED) private boolean nonComparable; @Action(semantics = SemanticsOf.SAFE) @ActionLayout(contributed = Contributed.AS_ASSOCIATION) public List<Turnover> getPreviousTurnoverEntries(){ return turnoverRepository.findApprovedByConfigAndTypeAndFrequencyBeforeDate(getConfig(), getType(), getFrequency(), getDate()); } @Inject TurnoverRepository turnoverRepository; }
apache-2.0
tompelka/pyTeXshell
README.md
37
pyTeXshell ========== (La)Tex shell
apache-2.0
gluons/Cooking-Community
changepassword.php
1922
<?php @session_start(); @require_once("db.php"); @header("Content-Type: application/json; charset=utf8"); if(!empty($_SESSION['username'])) { $username = $_SESSION['username']; $cn = connect(); $valid = true; $isPasswordCorrect = false; $message = ""; // Checking form data. if(!empty($_POST['changePasswordNewPassword'])) { $newPassword = $_POST['changePasswordNewPassword']; } else { $valid = false; $message .= "No new password received.<br>"; } if(!empty($_POST['changePasswordConfirmPassword'])) { $cpassword = $_POST['changePasswordConfirmPassword']; } else { $valid = false; $message .= "No confirm password received.<br>"; } if((!empty($newPassword) && !empty($cpassword)) && ($newPassword != $cpassword)) { $valid = false; $message .= "New password and confirm password is mismatch.<br>"; } if(!empty($_POST['changePasswordOldPassword'])) { $oldPassword = $_POST['changePasswordOldPassword']; $rs = @mysql_query("SELECT COUNT(*) FROM `user` WHERE `username`='" . $username . "' AND `password`='" . md5($oldPassword) . "';", $cn); $n = (int) @mysql_result($rs, 0, 0); if($n == 1) { $isPasswordCorrect = true; } } else { $valid = false; $message .= "No old password received.<br>"; } if($valid) { if($isPasswordCorrect) { // Changing password. $encNewPassword = md5($newPassword); $encOldPassword = md5($oldPassword); $query = <<<QUERY UPDATE `user` SET `password`='$encNewPassword' WHERE `username`='$username' AND `password`='$encOldPassword'; QUERY; if(@mysql_query($query, $cn)) { $result = array( "result" => "success" ); } else { $result = array( "result" => "fail" ); } } else { $result = array( "result" => "incorrect_pass" ); } } else { $result = array( "result" => $message ); } disconnect($cn); } else { $result = array( "result" => "fail" ); } echo(json_encode($result)); ?>
apache-2.0
agdsn/pycroft
pycroft/model/traffic.py
8996
# Copyright (c) 2015 The Pycroft Authors. See the AUTHORS file. # This file is part of the Pycroft project and licensed under the terms of # the Apache License, Version 2.0. See the LICENSE file for details. from sqlalchemy import Column, ForeignKey, CheckConstraint, \ PrimaryKeyConstraint, func, or_, and_, true, literal_column, \ select, cast, TEXT from sqlalchemy.orm import relationship, backref, Query from sqlalchemy.types import BigInteger, Enum, Integer from pycroft.model.base import ModelBase from pycroft.model.ddl import DDLManager, Function, Trigger, View from pycroft.model.types import DateTimeTz from pycroft.model.user import User from pycroft.model.host import IP, Host, Interface ddl = DDLManager() class TrafficEvent: timestamp = Column(DateTimeTz, server_default=func.current_timestamp(), nullable=False) amount = Column(BigInteger, CheckConstraint('amount >= 0'), nullable=False) class TrafficVolume(TrafficEvent, ModelBase): __table_args__ = ( PrimaryKeyConstraint('ip_id', 'type', 'timestamp'), ) type = Column(Enum("Ingress", "Egress", name="traffic_direction"), nullable=False) ip_id = Column(Integer, ForeignKey(IP.id, ondelete="CASCADE"), nullable=False, index=True) ip = relationship(IP, backref=backref("traffic_volumes", cascade="all, delete-orphan", cascade_backrefs=False)) user_id = Column(Integer, ForeignKey(User.id, ondelete='CASCADE'), nullable=True, index=True) user = relationship(User, backref=backref("traffic_volumes", cascade="all, delete-orphan", cascade_backrefs=False), uselist=False) packets = Column(Integer, CheckConstraint('packets >= 0'), nullable=False) TrafficVolume.__table__.add_is_dependent_on(IP.__table__) pmacct_traffic_egress = View( name='pmacct_traffic_egress', query=( Query([]) .add_columns(TrafficVolume.packets.label('packets'), TrafficVolume.amount.label('bytes'), TrafficVolume.timestamp.label('stamp_inserted'), TrafficVolume.timestamp.label('stamp_updated'), IP.address.label('ip_src')) .select_from(TrafficVolume) .filter_by(type='Egress') .join(IP) .statement # turns our `Selectable` into something compilable ), ) ddl.add_view(TrafficVolume.__table__, pmacct_traffic_egress) pmacct_expression_replacements = dict( tv_tname=TrafficVolume.__tablename__, tv_type=TrafficVolume.type.key, tv_ip_id=TrafficVolume.ip_id.key, tv_timestamp=TrafficVolume.timestamp.key, tv_amount=TrafficVolume.amount.key, tv_packets=TrafficVolume.packets.key, tv_user_id=TrafficVolume.user_id.key, ip_tname=IP.__tablename__, ip_id=str(IP.id.expression), ip_interface_id=str(IP.interface_id.expression), ip_address=str(IP.address.expression), host_tname=Host.__tablename__, host_id=str(Host.id.expression), host_owner_id=str(Host.owner_id.expression), interface_tname=Interface.__tablename__, interface_id=str(Interface.id.expression), interface_host_id=str(Interface.host_id.expression), ) pmacct_egress_upsert = Function( name="pmacct_traffic_egress_insert", arguments=[], language="plpgsql", rtype="trigger", definition="""BEGIN INSERT INTO traffic_volume ({tv_type}, {tv_ip_id}, "{tv_timestamp}", {tv_amount}, {tv_packets}, {tv_user_id}) SELECT 'Egress', {ip_id}, date_trunc('day', NEW.stamp_inserted), NEW.bytes, NEW.packets, {host_owner_id} FROM {ip_tname} JOIN {interface_tname} ON {ip_interface_id} = {interface_id} JOIN {host_tname} ON {interface_host_id} = {host_id} WHERE NEW.ip_src = {ip_address} ON CONFLICT ({tv_ip_id}, {tv_type}, "{tv_timestamp}") DO UPDATE SET ({tv_amount}, {tv_packets}) = ({tv_tname}.{tv_amount} + NEW.bytes, {tv_tname}.{tv_packets} + NEW.packets); RETURN NULL; END;""".format(**pmacct_expression_replacements), ) pmacct_egress_upsert_trigger = Trigger( name='pmacct_traffic_egress_insert_trigger', table=pmacct_traffic_egress.table, events=["INSERT"], function_call="pmacct_traffic_egress_insert()", when="INSTEAD OF" ) ddl.add_function(TrafficVolume.__table__, pmacct_egress_upsert) ddl.add_trigger(TrafficVolume.__table__, pmacct_egress_upsert_trigger) pmacct_traffic_ingress = View( name='pmacct_traffic_ingress', query=( Query([]) .add_columns(TrafficVolume.packets.label('packets'), TrafficVolume.amount.label('bytes'), TrafficVolume.timestamp.label('stamp_inserted'), TrafficVolume.timestamp.label('stamp_updated'), IP.address.label('ip_dst')) .select_from(TrafficVolume) .filter_by(type='Ingress') .join(IP) .statement # turns our `Selectable` into something compilable ), ) ddl.add_view(TrafficVolume.__table__, pmacct_traffic_ingress) pmacct_ingress_upsert = Function( name="pmacct_traffic_ingress_insert", arguments=[], language="plpgsql", rtype="trigger", definition="""BEGIN INSERT INTO traffic_volume ({tv_type}, {tv_ip_id}, "{tv_timestamp}", {tv_amount}, {tv_packets}, {tv_user_id}) SELECT 'Ingress', {ip_id}, date_trunc('day', NEW.stamp_inserted), NEW.bytes, NEW.packets, {host_owner_id} FROM {ip_tname} JOIN {interface_tname} ON {ip_interface_id} = {interface_id} JOIN {host_tname} ON {interface_host_id} = {host_id} WHERE NEW.ip_dst = {ip_address} ON CONFLICT ({tv_ip_id}, {tv_type}, "{tv_timestamp}") DO UPDATE SET ({tv_amount}, {tv_packets}) = ({tv_tname}.{tv_amount} + NEW.bytes, {tv_tname}.{tv_packets} + NEW.packets); RETURN NULL; END;""".format(**pmacct_expression_replacements), ) pmacct_ingress_upsert_trigger = Trigger( name='pmacct_traffic_ingress_insert_trigger', table=pmacct_traffic_ingress.table, events=["INSERT"], function_call="pmacct_traffic_ingress_insert()", when="INSTEAD OF" ) ddl.add_function(TrafficVolume.__table__, pmacct_ingress_upsert) ddl.add_trigger(TrafficVolume.__table__, pmacct_ingress_upsert_trigger) def traffic_history_query(): events = (select(func.sum(TrafficVolume.amount).label('amount'), literal_column('day'), cast(TrafficVolume.type, TEXT).label('type') ) .select_from( func.generate_series( func.date_trunc('day', literal_column('arg_start')), func.date_trunc('day', literal_column('arg_end')), '1 day' ).alias('day') .outerjoin(TrafficVolume.__table__, and_( func.date_trunc('day', TrafficVolume.timestamp) == literal_column('day'), TrafficVolume.user_id == literal_column('arg_user_id')) ) ) .group_by(literal_column('day'), literal_column('type')) ).cte() events_ingress = select(events).where(or_(events.c.type == 'Ingress', events.c.type == None)).cte() events_egress = select(events).where(or_(events.c.type == 'Egress', events.c.type == None)).cte() hist = (select(func.coalesce(events_ingress.c.day, events_egress.c.day).label('timestamp'), events_ingress.c.amount.label('ingress'), events_egress.c.amount.label('egress')) .select_from(events_ingress.join(events_egress, events_ingress.c.day == events_egress.c.day, full=true)) .order_by(literal_column('timestamp')) ) return hist traffic_history_function = Function( 'traffic_history', ['arg_user_id int', 'arg_start timestamptz', 'arg_end timestamptz'], 'TABLE ("timestamp" timestamptz, ingress numeric, egress numeric)', definition=traffic_history_query(), volatility='stable', ) ddl.add_function( TrafficVolume.__table__, traffic_history_function ) class TrafficHistoryEntry: def __init__(self, timestamp, ingress, egress): self.timestamp = timestamp self.ingress = ingress or 0 self.egress = egress or 0 def __repr__(self): return str(self.__dict__) ddl.register()
apache-2.0
charlescearl/VirtualMesos
third_party/zookeeper-3.3.1/src/c/Makefile
102925
# Makefile.in generated by automake 1.11 from Makefile.am. # Makefile. Generated from Makefile.in by configure. # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. # Copyright (C) 2004 Oren Ben-Kiki # This file is distributed under the same terms as the Automake macro files. # Generate automatic documentation using Doxygen. Goals and variables values # are controlled by the various DX_COND_??? conditionals set by autoconf. # # The provided goals are: # doxygen-doc: Generate all doxygen documentation. # doxygen-run: Run doxygen, which will generate some of the documentation # (HTML, CHM, CHI, MAN, RTF, XML) but will not do the post # processing required for the rest of it (PS, PDF, and some MAN). # doxygen-man: Rename some doxygen generated man pages. # doxygen-ps: Generate doxygen PostScript documentation. # doxygen-pdf: Generate doxygen PDF documentation. # # Note that by default these are not integrated into the automake goals. If # doxygen is used to generate man pages, you can achieve this integration by # setting man3_MANS to the list of man pages generated and then adding the # dependency: # # $(man3_MANS): doxygen-doc # # This will cause make to run doxygen and generate all the documentation. # # The following variable is intended for use in Makefile.am: # # DX_CLEANFILES = everything to clean. # # This is usually added to MOSTLYCLEANFILES. pkgdatadir = $(datadir)/c-client-src pkgincludedir = $(includedir)/c-client-src pkglibdir = $(libdir)/c-client-src pkglibexecdir = $(libexecdir)/c-client-src am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = x86_64-unknown-linux-gnu host_triplet = x86_64-unknown-linux-gnu DIST_COMMON = README $(am__configure_deps) $(pkginclude_HEADERS) \ $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/config.h.in $(top_srcdir)/aminclude.am \ $(top_srcdir)/configure ChangeLog INSTALL compile config.guess \ config.sub depcomp install-sh ltmain.sh missing am__append_1 = libzkmt.la am__append_2 = libzookeeper_mt.la bin_PROGRAMS = cli_st$(EXEEXT) $(am__EXEEXT_1) am__append_3 = cli_mt load_gen check_PROGRAMS = zktest-st$(EXEEXT) $(am__EXEEXT_2) am__append_4 = zktest-mt subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" \ "$(DESTDIR)$(pkgincludedir)" LTLIBRARIES = $(lib_LTLIBRARIES) $(noinst_LTLIBRARIES) libhashtable_la_LIBADD = am__objects_1 = hashtable_itr.lo hashtable.lo am_libhashtable_la_OBJECTS = $(am__objects_1) libhashtable_la_OBJECTS = $(am_libhashtable_la_OBJECTS) libzkmt_la_DEPENDENCIES = am__libzkmt_la_SOURCES_DIST = src/zookeeper.c include/zookeeper.h \ include/zookeeper_version.h include/zookeeper_log.h \ src/recordio.c include/recordio.h include/proto.h \ src/zk_adaptor.h generated/zookeeper.jute.c \ src/zookeeper_log.h src/zk_log.c src/zk_hashtable.h \ src/zk_hashtable.c src/mt_adaptor.c am__objects_2 = libzkmt_la-zookeeper.lo libzkmt_la-recordio.lo \ libzkmt_la-zookeeper.jute.lo libzkmt_la-zk_log.lo \ libzkmt_la-zk_hashtable.lo am_libzkmt_la_OBJECTS = $(am__objects_2) \ libzkmt_la-mt_adaptor.lo libzkmt_la_OBJECTS = $(am_libzkmt_la_OBJECTS) libzkmt_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(libzkmt_la_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ am_libzkmt_la_rpath = libzkst_la_DEPENDENCIES = am__objects_3 = zookeeper.lo recordio.lo zookeeper.jute.lo zk_log.lo \ zk_hashtable.lo am_libzkst_la_OBJECTS = $(am__objects_3) st_adaptor.lo libzkst_la_OBJECTS = $(am_libzkst_la_OBJECTS) am_libzookeeper_mt_la_OBJECTS = libzookeeper_mt_la_OBJECTS = $(am_libzookeeper_mt_la_OBJECTS) libzookeeper_mt_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libzookeeper_mt_la_LDFLAGS) $(LDFLAGS) -o $@ am_libzookeeper_mt_la_rpath = -rpath $(libdir) am_libzookeeper_st_la_OBJECTS = libzookeeper_st_la_OBJECTS = $(am_libzookeeper_st_la_OBJECTS) libzookeeper_st_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libzookeeper_st_la_LDFLAGS) $(LDFLAGS) -o $@ am__EXEEXT_1 = cli_mt$(EXEEXT) load_gen$(EXEEXT) am__EXEEXT_2 = zktest-mt$(EXEEXT) PROGRAMS = $(bin_PROGRAMS) am__cli_mt_SOURCES_DIST = src/cli.c am_cli_mt_OBJECTS = cli_mt-cli.$(OBJEXT) cli_mt_OBJECTS = $(am_cli_mt_OBJECTS) cli_mt_DEPENDENCIES = libzookeeper_mt.la cli_mt_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(cli_mt_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ am_cli_st_OBJECTS = cli.$(OBJEXT) cli_st_OBJECTS = $(am_cli_st_OBJECTS) cli_st_DEPENDENCIES = libzookeeper_st.la am__load_gen_SOURCES_DIST = src/load_gen.c am_load_gen_OBJECTS = load_gen-load_gen.$(OBJEXT) load_gen_OBJECTS = $(am_load_gen_OBJECTS) load_gen_DEPENDENCIES = libzookeeper_mt.la load_gen_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(load_gen_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ am__objects_4 = zktest_mt-TestDriver.$(OBJEXT) \ zktest_mt-LibCMocks.$(OBJEXT) zktest_mt-LibCSymTable.$(OBJEXT) \ zktest_mt-MocksBase.$(OBJEXT) zktest_mt-ZKMocks.$(OBJEXT) \ zktest_mt-Util.$(OBJEXT) zktest_mt-ThreadingUtil.$(OBJEXT) \ zktest_mt-TestClientRetry.$(OBJEXT) \ zktest_mt-TestOperations.$(OBJEXT) \ zktest_mt-TestZookeeperInit.$(OBJEXT) \ zktest_mt-TestZookeeperClose.$(OBJEXT) \ zktest_mt-TestClient.$(OBJEXT) \ zktest_mt-TestWatchers.$(OBJEXT) nodist_zktest_mt_OBJECTS = $(am__objects_4) \ zktest_mt-PthreadMocks.$(OBJEXT) zktest_mt_OBJECTS = $(nodist_zktest_mt_OBJECTS) am__DEPENDENCIES_1 = zktest_mt_DEPENDENCIES = libzkmt.la libhashtable.la \ $(am__DEPENDENCIES_1) zktest_mt_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(zktest_mt_CXXFLAGS) \ $(CXXFLAGS) $(zktest_mt_LDFLAGS) $(LDFLAGS) -o $@ am__objects_5 = zktest_st-TestDriver.$(OBJEXT) \ zktest_st-LibCMocks.$(OBJEXT) zktest_st-LibCSymTable.$(OBJEXT) \ zktest_st-MocksBase.$(OBJEXT) zktest_st-ZKMocks.$(OBJEXT) \ zktest_st-Util.$(OBJEXT) zktest_st-ThreadingUtil.$(OBJEXT) \ zktest_st-TestClientRetry.$(OBJEXT) \ zktest_st-TestOperations.$(OBJEXT) \ zktest_st-TestZookeeperInit.$(OBJEXT) \ zktest_st-TestZookeeperClose.$(OBJEXT) \ zktest_st-TestClient.$(OBJEXT) \ zktest_st-TestWatchers.$(OBJEXT) nodist_zktest_st_OBJECTS = $(am__objects_5) zktest_st_OBJECTS = $(nodist_zktest_st_OBJECTS) zktest_st_DEPENDENCIES = libzkst.la libhashtable.la \ $(am__DEPENDENCIES_1) zktest_st_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(zktest_st_CXXFLAGS) \ $(CXXFLAGS) $(zktest_st_LDFLAGS) $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I. depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libhashtable_la_SOURCES) $(libzkmt_la_SOURCES) \ $(libzkst_la_SOURCES) $(libzookeeper_mt_la_SOURCES) \ $(libzookeeper_st_la_SOURCES) $(cli_mt_SOURCES) \ $(cli_st_SOURCES) $(load_gen_SOURCES) \ $(nodist_zktest_mt_SOURCES) $(nodist_zktest_st_SOURCES) DIST_SOURCES = $(libhashtable_la_SOURCES) \ $(am__libzkmt_la_SOURCES_DIST) $(libzkst_la_SOURCES) \ $(libzookeeper_mt_la_SOURCES) $(libzookeeper_st_la_SOURCES) \ $(am__cli_mt_SOURCES_DIST) $(cli_st_SOURCES) \ $(am__load_gen_SOURCES_DIST) HEADERS = $(pkginclude_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ { test ! -d "$(distdir)" \ || { find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -fr "$(distdir)"; }; } DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print distcleancheck_listfiles = find . -type f -print ACLOCAL = ${SHELL} /media/LinuxShare2/mesos/third_party/zookeeper-3.3.1/src/c/missing --run aclocal-1.11 AMTAR = ${SHELL} /media/LinuxShare2/mesos/third_party/zookeeper-3.3.1/src/c/missing --run tar AR = ar AUTOCONF = ${SHELL} /media/LinuxShare2/mesos/third_party/zookeeper-3.3.1/src/c/missing --run autoconf AUTOHEADER = ${SHELL} /media/LinuxShare2/mesos/third_party/zookeeper-3.3.1/src/c/missing --run autoheader AUTOMAKE = ${SHELL} /media/LinuxShare2/mesos/third_party/zookeeper-3.3.1/src/c/missing --run automake-1.11 AWK = gawk CC = gcc CCDEPMODE = depmode=gcc3 CFLAGS = -g -O2 -D_GNU_SOURCE CPP = gcc -E CPPFLAGS = CPPUNIT_CFLAGS = -DZKSERVER_CMD="\"./tests/zkServer.sh\"" CPPUNIT_CONFIG = no CPPUNIT_LIBS = CXX = g++ CXXCPP = g++ -E CXXDEPMODE = depmode=gcc3 CXXFLAGS = -Wall -g $(USEIPV6) CYGPATH_W = echo DEFS = -DHAVE_CONFIG_H DEPDIR = .deps DOXYGEN_PAPER_SIZE = DSYMUTIL = DUMPBIN = DX_CONFIG = c-doc.Doxyfile DX_DOCDIR = docs DX_DOT = DX_DOXYGEN = DX_DVIPS = DX_EGREP = DX_ENV = SRCDIR='.' PROJECT='zookeeper' DOCDIR='docs' VERSION='3.3.1' PERL_PATH='/usr/bin/perl' HAVE_DOT='YES' DOT_PATH='.' GENERATE_MAN='NO' GENERATE_RTF='NO' GENERATE_XML='NO' GENERATE_HTMLHELP='NO' GENERATE_CHI='NO' GENERATE_HTML='YES' GENERATE_LATEX='NO' DX_FLAG_chi = 0 DX_FLAG_chm = 0 DX_FLAG_doc = 1 DX_FLAG_dot = 1 DX_FLAG_html = 1 DX_FLAG_man = 0 DX_FLAG_pdf = 0 DX_FLAG_ps = 0 DX_FLAG_rtf = 0 DX_FLAG_xml = 0 DX_HHC = DX_LATEX = DX_MAKEINDEX = DX_PDFLATEX = DX_PERL = /usr/bin/perl DX_PROJECT = zookeeper ECHO_C = ECHO_N = -n ECHO_T = EGREP = /bin/grep -E EXEEXT = FGREP = /bin/grep -F GREP = /bin/grep INSTALL = /usr/bin/install -c INSTALL_DATA = ${INSTALL} -m 644 INSTALL_PROGRAM = ${INSTALL} INSTALL_SCRIPT = ${INSTALL} INSTALL_STRIP_PROGRAM = $(install_sh) -c -s LD = /usr/bin/ld -m elf_x86_64 LDFLAGS = LIBOBJS = LIBS = LIBTOOL = $(SHELL) $(top_builddir)/libtool LIPO = LN_S = ln -s LTLIBOBJS = MAKEINFO = ${SHELL} /media/LinuxShare2/mesos/third_party/zookeeper-3.3.1/src/c/missing --run makeinfo MKDIR_P = /bin/mkdir -p NM = /usr/bin/nm -B NMEDIT = OBJDUMP = objdump OBJEXT = o OTOOL = OTOOL64 = PACKAGE = c-client-src PACKAGE_BUGREPORT = [email protected] PACKAGE_NAME = zookeeper C client PACKAGE_STRING = zookeeper C client 3.3.1 PACKAGE_TARNAME = c-client-src PACKAGE_URL = PACKAGE_VERSION = 3.3.1 PATH_SEPARATOR = : RANLIB = ranlib SED = /bin/sed SET_MAKE = SHELL = /bin/bash STRIP = strip USEIPV6 = -DZOO_IPV6_ENABLED VERSION = 3.3.1 abs_builddir = /media/LinuxShare2/mesos/third_party/zookeeper-3.3.1/src/c abs_srcdir = /media/LinuxShare2/mesos/third_party/zookeeper-3.3.1/src/c abs_top_builddir = /media/LinuxShare2/mesos/third_party/zookeeper-3.3.1/src/c abs_top_srcdir = /media/LinuxShare2/mesos/third_party/zookeeper-3.3.1/src/c ac_ct_CC = gcc ac_ct_CXX = g++ ac_ct_DUMPBIN = am__include = include am__leading_dot = . am__quote = am__tar = ${AMTAR} chof - "$$tardir" am__untar = ${AMTAR} xf - bindir = ${exec_prefix}/bin build = x86_64-unknown-linux-gnu build_alias = build_cpu = x86_64 build_os = linux-gnu build_vendor = unknown builddir = . datadir = ${datarootdir} datarootdir = ${prefix}/share docdir = ${datarootdir}/doc/${PACKAGE_TARNAME} dvidir = ${docdir} exec_prefix = ${prefix} host = x86_64-unknown-linux-gnu host_alias = host_cpu = x86_64 host_os = linux-gnu host_vendor = unknown htmldir = ${docdir} includedir = ${prefix}/include infodir = ${datarootdir}/info install_sh = ${SHELL} /media/LinuxShare2/mesos/third_party/zookeeper-3.3.1/src/c/install-sh libdir = ${exec_prefix}/lib libexecdir = ${exec_prefix}/libexec localedir = ${datarootdir}/locale localstatedir = ${prefix}/var lt_ECHO = echo mandir = ${datarootdir}/man mkdir_p = /bin/mkdir -p oldincludedir = /usr/include pdfdir = ${docdir} prefix = /usr/local program_transform_name = s,x,x, psdir = ${docdir} sbindir = ${exec_prefix}/sbin sharedstatedir = ${prefix}/com srcdir = . sysconfdir = ${prefix}/etc target_alias = top_build_prefix = top_builddir = . top_srcdir = . DX_CLEAN_HTML = docs/html #DX_CLEAN_CHM = docs/chm ##DX_CLEAN_CHI = docs/c-client-src.chi #DX_CLEAN_MAN = docs/man #DX_CLEAN_RTF = docs/rtf #DX_CLEAN_XML = docs/xml #DX_CLEAN_PS = docs/c-client-src.ps #DX_PS_GOAL = doxygen-ps #DX_CLEAN_PDF = docs/c-client-src.pdf #DX_PDF_GOAL = doxygen-pdf #DX_CLEAN_LATEX = docs/latex DX_CLEANFILES = \ docs/c-client-src.tag \ -r \ $(DX_CLEAN_HTML) \ $(DX_CLEAN_CHM) \ $(DX_CLEAN_CHI) \ $(DX_CLEAN_MAN) \ $(DX_CLEAN_RTF) \ $(DX_CLEAN_XML) \ $(DX_CLEAN_PS) \ $(DX_CLEAN_PDF) \ $(DX_CLEAN_LATEX) # need this for Doxygen integration AM_CPPFLAGS = -I${srcdir}/include -I${srcdir}/tests -I${srcdir}/generated AM_CFLAGS = -Wall -Werror LIB_LDFLAGS = -no-undefined -version-info 2 pkginclude_HEADERS = include/zookeeper.h include/zookeeper_version.h include/zookeeper_log.h include/recordio.h generated/zookeeper.jute.h ######################################################################### # build and run unit tests EXTRA_DIST = LICENSE $(wildcard ${srcdir}/tests/*.cc) $(wildcard \ ${srcdir}/tests/*.h) ${srcdir}/tests/wrappers.opt \ ${srcdir}/tests/wrappers-mt.opt HASHTABLE_SRC = src/hashtable/hashtable_itr.h src/hashtable/hashtable_itr.c \ src/hashtable/hashtable_private.h src/hashtable/hashtable.h src/hashtable/hashtable.c noinst_LTLIBRARIES = libhashtable.la libzkst.la $(am__append_1) libhashtable_la_SOURCES = $(HASHTABLE_SRC) COMMON_SRC = src/zookeeper.c include/zookeeper.h include/zookeeper_version.h include/zookeeper_log.h\ src/recordio.c include/recordio.h include/proto.h \ src/zk_adaptor.h generated/zookeeper.jute.c \ src/zookeeper_log.h src/zk_log.c src/zk_hashtable.h src/zk_hashtable.c # These are the symbols (classes, mostly) we want to export from our library. EXPORT_SYMBOLS = '(zoo_|zookeeper_|zhandle|Z|format_log_message|log_message|logLevel|deallocate_|zerror|is_unrecoverable)' libzkst_la_SOURCES = $(COMMON_SRC) src/st_adaptor.c libzkst_la_LIBADD = -lm lib_LTLIBRARIES = libzookeeper_st.la $(am__append_2) libzookeeper_st_la_SOURCES = libzookeeper_st_la_LIBADD = libzkst.la libhashtable.la libzookeeper_st_la_DEPENDENCIES = libzkst.la libhashtable.la libzookeeper_st_la_LDFLAGS = $(LIB_LDFLAGS) -export-symbols-regex $(EXPORT_SYMBOLS) libzkmt_la_SOURCES = $(COMMON_SRC) src/mt_adaptor.c libzkmt_la_CFLAGS = -DTHREADED libzkmt_la_LIBADD = -lm libzookeeper_mt_la_SOURCES = libzookeeper_mt_la_LIBADD = libzkmt.la libhashtable.la -lpthread libzookeeper_mt_la_DEPENDENCIES = libzkmt.la libhashtable.la libzookeeper_mt_la_LDFLAGS = $(LIB_LDFLAGS) -export-symbols-regex $(EXPORT_SYMBOLS) cli_st_SOURCES = src/cli.c cli_st_LDADD = libzookeeper_st.la cli_mt_SOURCES = src/cli.c cli_mt_LDADD = libzookeeper_mt.la cli_mt_CFLAGS = -DTHREADED load_gen_SOURCES = src/load_gen.c load_gen_LDADD = libzookeeper_mt.la load_gen_CFLAGS = -DTHREADED TEST_SOURCES = tests/TestDriver.cc tests/LibCMocks.cc tests/LibCSymTable.cc \ tests/MocksBase.cc tests/ZKMocks.cc tests/Util.cc tests/ThreadingUtil.cc \ tests/TestClientRetry.cc \ tests/TestOperations.cc tests/TestZookeeperInit.cc \ tests/TestZookeeperClose.cc tests/TestClient.cc \ tests/TestWatchers.cc SYMBOL_WRAPPERS = $(shell cat ${srcdir}/tests/wrappers.opt) nodist_zktest_st_SOURCES = $(TEST_SOURCES) zktest_st_LDADD = libzkst.la libhashtable.la $(CPPUNIT_LIBS) zktest_st_CXXFLAGS = -DUSE_STATIC_LIB $(CPPUNIT_CFLAGS) $(USEIPV6) zktest_st_LDFLAGS = -static-libtool-libs $(SYMBOL_WRAPPERS) nodist_zktest_mt_SOURCES = $(TEST_SOURCES) tests/PthreadMocks.cc zktest_mt_LDADD = libzkmt.la libhashtable.la -lpthread $(CPPUNIT_LIBS) zktest_mt_CXXFLAGS = -DUSE_STATIC_LIB -DTHREADED $(CPPUNIT_CFLAGS) $(USEIPV6) SYMBOL_WRAPPERS_MT = $(SYMBOL_WRAPPERS) $(shell cat ${srcdir}/tests/wrappers-mt.opt) zktest_mt_LDFLAGS = -static-libtool-libs $(SYMBOL_WRAPPERS_MT) all: config.h $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .cc .lo .o .obj am--refresh: @: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/aminclude.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): config.h: stamp-h1 @if test ! -f $@; then \ rm -f stamp-h1; \ $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \ else :; fi stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config.h $(srcdir)/config.h.in: $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f config.h stamp-h1 install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)" @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libhashtable.la: $(libhashtable_la_OBJECTS) $(libhashtable_la_DEPENDENCIES) $(LINK) $(libhashtable_la_OBJECTS) $(libhashtable_la_LIBADD) $(LIBS) libzkmt.la: $(libzkmt_la_OBJECTS) $(libzkmt_la_DEPENDENCIES) $(libzkmt_la_LINK) $(am_libzkmt_la_rpath) $(libzkmt_la_OBJECTS) $(libzkmt_la_LIBADD) $(LIBS) libzkst.la: $(libzkst_la_OBJECTS) $(libzkst_la_DEPENDENCIES) $(LINK) $(libzkst_la_OBJECTS) $(libzkst_la_LIBADD) $(LIBS) libzookeeper_mt.la: $(libzookeeper_mt_la_OBJECTS) $(libzookeeper_mt_la_DEPENDENCIES) $(libzookeeper_mt_la_LINK) $(am_libzookeeper_mt_la_rpath) $(libzookeeper_mt_la_OBJECTS) $(libzookeeper_mt_la_LIBADD) $(LIBS) libzookeeper_st.la: $(libzookeeper_st_la_OBJECTS) $(libzookeeper_st_la_DEPENDENCIES) $(libzookeeper_st_la_LINK) -rpath $(libdir) $(libzookeeper_st_la_OBJECTS) $(libzookeeper_st_la_LIBADD) $(LIBS) install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p || test -f $$p1; \ then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list clean-checkPROGRAMS: @list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list cli_mt$(EXEEXT): $(cli_mt_OBJECTS) $(cli_mt_DEPENDENCIES) @rm -f cli_mt$(EXEEXT) $(cli_mt_LINK) $(cli_mt_OBJECTS) $(cli_mt_LDADD) $(LIBS) cli_st$(EXEEXT): $(cli_st_OBJECTS) $(cli_st_DEPENDENCIES) @rm -f cli_st$(EXEEXT) $(LINK) $(cli_st_OBJECTS) $(cli_st_LDADD) $(LIBS) load_gen$(EXEEXT): $(load_gen_OBJECTS) $(load_gen_DEPENDENCIES) @rm -f load_gen$(EXEEXT) $(load_gen_LINK) $(load_gen_OBJECTS) $(load_gen_LDADD) $(LIBS) zktest-mt$(EXEEXT): $(zktest_mt_OBJECTS) $(zktest_mt_DEPENDENCIES) @rm -f zktest-mt$(EXEEXT) $(zktest_mt_LINK) $(zktest_mt_OBJECTS) $(zktest_mt_LDADD) $(LIBS) zktest-st$(EXEEXT): $(zktest_st_OBJECTS) $(zktest_st_DEPENDENCIES) @rm -f zktest-st$(EXEEXT) $(zktest_st_LINK) $(zktest_st_OBJECTS) $(zktest_st_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c include ./$(DEPDIR)/cli.Po include ./$(DEPDIR)/cli_mt-cli.Po include ./$(DEPDIR)/hashtable.Plo include ./$(DEPDIR)/hashtable_itr.Plo include ./$(DEPDIR)/libzkmt_la-mt_adaptor.Plo include ./$(DEPDIR)/libzkmt_la-recordio.Plo include ./$(DEPDIR)/libzkmt_la-zk_hashtable.Plo include ./$(DEPDIR)/libzkmt_la-zk_log.Plo include ./$(DEPDIR)/libzkmt_la-zookeeper.Plo include ./$(DEPDIR)/libzkmt_la-zookeeper.jute.Plo include ./$(DEPDIR)/load_gen-load_gen.Po include ./$(DEPDIR)/recordio.Plo include ./$(DEPDIR)/st_adaptor.Plo include ./$(DEPDIR)/zk_hashtable.Plo include ./$(DEPDIR)/zk_log.Plo include ./$(DEPDIR)/zktest_mt-LibCMocks.Po include ./$(DEPDIR)/zktest_mt-LibCSymTable.Po include ./$(DEPDIR)/zktest_mt-MocksBase.Po include ./$(DEPDIR)/zktest_mt-PthreadMocks.Po include ./$(DEPDIR)/zktest_mt-TestClient.Po include ./$(DEPDIR)/zktest_mt-TestClientRetry.Po include ./$(DEPDIR)/zktest_mt-TestDriver.Po include ./$(DEPDIR)/zktest_mt-TestOperations.Po include ./$(DEPDIR)/zktest_mt-TestWatchers.Po include ./$(DEPDIR)/zktest_mt-TestZookeeperClose.Po include ./$(DEPDIR)/zktest_mt-TestZookeeperInit.Po include ./$(DEPDIR)/zktest_mt-ThreadingUtil.Po include ./$(DEPDIR)/zktest_mt-Util.Po include ./$(DEPDIR)/zktest_mt-ZKMocks.Po include ./$(DEPDIR)/zktest_st-LibCMocks.Po include ./$(DEPDIR)/zktest_st-LibCSymTable.Po include ./$(DEPDIR)/zktest_st-MocksBase.Po include ./$(DEPDIR)/zktest_st-TestClient.Po include ./$(DEPDIR)/zktest_st-TestClientRetry.Po include ./$(DEPDIR)/zktest_st-TestDriver.Po include ./$(DEPDIR)/zktest_st-TestOperations.Po include ./$(DEPDIR)/zktest_st-TestWatchers.Po include ./$(DEPDIR)/zktest_st-TestZookeeperClose.Po include ./$(DEPDIR)/zktest_st-TestZookeeperInit.Po include ./$(DEPDIR)/zktest_st-ThreadingUtil.Po include ./$(DEPDIR)/zktest_st-Util.Po include ./$(DEPDIR)/zktest_st-ZKMocks.Po include ./$(DEPDIR)/zookeeper.Plo include ./$(DEPDIR)/zookeeper.jute.Plo .c.o: $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po # source='$<' object='$@' libtool=no \ # DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ # $(COMPILE) -c $< .c.obj: $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po # source='$<' object='$@' libtool=no \ # DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ # $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo # source='$<' object='$@' libtool=yes \ # DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ # $(LTCOMPILE) -c -o $@ $< hashtable_itr.lo: src/hashtable/hashtable_itr.c $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT hashtable_itr.lo -MD -MP -MF $(DEPDIR)/hashtable_itr.Tpo -c -o hashtable_itr.lo `test -f 'src/hashtable/hashtable_itr.c' || echo '$(srcdir)/'`src/hashtable/hashtable_itr.c $(am__mv) $(DEPDIR)/hashtable_itr.Tpo $(DEPDIR)/hashtable_itr.Plo # source='src/hashtable/hashtable_itr.c' object='hashtable_itr.lo' libtool=yes \ # DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ # $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o hashtable_itr.lo `test -f 'src/hashtable/hashtable_itr.c' || echo '$(srcdir)/'`src/hashtable/hashtable_itr.c hashtable.lo: src/hashtable/hashtable.c $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT hashtable.lo -MD -MP -MF $(DEPDIR)/hashtable.Tpo -c -o hashtable.lo `test -f 'src/hashtable/hashtable.c' || echo '$(srcdir)/'`src/hashtable/hashtable.c $(am__mv) $(DEPDIR)/hashtable.Tpo $(DEPDIR)/hashtable.Plo # source='src/hashtable/hashtable.c' object='hashtable.lo' libtool=yes \ # DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ # $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o hashtable.lo `test -f 'src/hashtable/hashtable.c' || echo '$(srcdir)/'`src/hashtable/hashtable.c libzkmt_la-zookeeper.lo: src/zookeeper.c $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libzkmt_la_CFLAGS) $(CFLAGS) -MT libzkmt_la-zookeeper.lo -MD -MP -MF $(DEPDIR)/libzkmt_la-zookeeper.Tpo -c -o libzkmt_la-zookeeper.lo `test -f 'src/zookeeper.c' || echo '$(srcdir)/'`src/zookeeper.c $(am__mv) $(DEPDIR)/libzkmt_la-zookeeper.Tpo $(DEPDIR)/libzkmt_la-zookeeper.Plo # source='src/zookeeper.c' object='libzkmt_la-zookeeper.lo' libtool=yes \ # DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ # $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libzkmt_la_CFLAGS) $(CFLAGS) -c -o libzkmt_la-zookeeper.lo `test -f 'src/zookeeper.c' || echo '$(srcdir)/'`src/zookeeper.c libzkmt_la-recordio.lo: src/recordio.c $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libzkmt_la_CFLAGS) $(CFLAGS) -MT libzkmt_la-recordio.lo -MD -MP -MF $(DEPDIR)/libzkmt_la-recordio.Tpo -c -o libzkmt_la-recordio.lo `test -f 'src/recordio.c' || echo '$(srcdir)/'`src/recordio.c $(am__mv) $(DEPDIR)/libzkmt_la-recordio.Tpo $(DEPDIR)/libzkmt_la-recordio.Plo # source='src/recordio.c' object='libzkmt_la-recordio.lo' libtool=yes \ # DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ # $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libzkmt_la_CFLAGS) $(CFLAGS) -c -o libzkmt_la-recordio.lo `test -f 'src/recordio.c' || echo '$(srcdir)/'`src/recordio.c libzkmt_la-zookeeper.jute.lo: generated/zookeeper.jute.c $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libzkmt_la_CFLAGS) $(CFLAGS) -MT libzkmt_la-zookeeper.jute.lo -MD -MP -MF $(DEPDIR)/libzkmt_la-zookeeper.jute.Tpo -c -o libzkmt_la-zookeeper.jute.lo `test -f 'generated/zookeeper.jute.c' || echo '$(srcdir)/'`generated/zookeeper.jute.c $(am__mv) $(DEPDIR)/libzkmt_la-zookeeper.jute.Tpo $(DEPDIR)/libzkmt_la-zookeeper.jute.Plo # source='generated/zookeeper.jute.c' object='libzkmt_la-zookeeper.jute.lo' libtool=yes \ # DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ # $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libzkmt_la_CFLAGS) $(CFLAGS) -c -o libzkmt_la-zookeeper.jute.lo `test -f 'generated/zookeeper.jute.c' || echo '$(srcdir)/'`generated/zookeeper.jute.c libzkmt_la-zk_log.lo: src/zk_log.c $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libzkmt_la_CFLAGS) $(CFLAGS) -MT libzkmt_la-zk_log.lo -MD -MP -MF $(DEPDIR)/libzkmt_la-zk_log.Tpo -c -o libzkmt_la-zk_log.lo `test -f 'src/zk_log.c' || echo '$(srcdir)/'`src/zk_log.c $(am__mv) $(DEPDIR)/libzkmt_la-zk_log.Tpo $(DEPDIR)/libzkmt_la-zk_log.Plo # source='src/zk_log.c' object='libzkmt_la-zk_log.lo' libtool=yes \ # DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ # $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libzkmt_la_CFLAGS) $(CFLAGS) -c -o libzkmt_la-zk_log.lo `test -f 'src/zk_log.c' || echo '$(srcdir)/'`src/zk_log.c libzkmt_la-zk_hashtable.lo: src/zk_hashtable.c $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libzkmt_la_CFLAGS) $(CFLAGS) -MT libzkmt_la-zk_hashtable.lo -MD -MP -MF $(DEPDIR)/libzkmt_la-zk_hashtable.Tpo -c -o libzkmt_la-zk_hashtable.lo `test -f 'src/zk_hashtable.c' || echo '$(srcdir)/'`src/zk_hashtable.c $(am__mv) $(DEPDIR)/libzkmt_la-zk_hashtable.Tpo $(DEPDIR)/libzkmt_la-zk_hashtable.Plo # source='src/zk_hashtable.c' object='libzkmt_la-zk_hashtable.lo' libtool=yes \ # DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ # $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libzkmt_la_CFLAGS) $(CFLAGS) -c -o libzkmt_la-zk_hashtable.lo `test -f 'src/zk_hashtable.c' || echo '$(srcdir)/'`src/zk_hashtable.c libzkmt_la-mt_adaptor.lo: src/mt_adaptor.c $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libzkmt_la_CFLAGS) $(CFLAGS) -MT libzkmt_la-mt_adaptor.lo -MD -MP -MF $(DEPDIR)/libzkmt_la-mt_adaptor.Tpo -c -o libzkmt_la-mt_adaptor.lo `test -f 'src/mt_adaptor.c' || echo '$(srcdir)/'`src/mt_adaptor.c $(am__mv) $(DEPDIR)/libzkmt_la-mt_adaptor.Tpo $(DEPDIR)/libzkmt_la-mt_adaptor.Plo # source='src/mt_adaptor.c' object='libzkmt_la-mt_adaptor.lo' libtool=yes \ # DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ # $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libzkmt_la_CFLAGS) $(CFLAGS) -c -o libzkmt_la-mt_adaptor.lo `test -f 'src/mt_adaptor.c' || echo '$(srcdir)/'`src/mt_adaptor.c zookeeper.lo: src/zookeeper.c $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT zookeeper.lo -MD -MP -MF $(DEPDIR)/zookeeper.Tpo -c -o zookeeper.lo `test -f 'src/zookeeper.c' || echo '$(srcdir)/'`src/zookeeper.c $(am__mv) $(DEPDIR)/zookeeper.Tpo $(DEPDIR)/zookeeper.Plo # source='src/zookeeper.c' object='zookeeper.lo' libtool=yes \ # DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ # $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o zookeeper.lo `test -f 'src/zookeeper.c' || echo '$(srcdir)/'`src/zookeeper.c recordio.lo: src/recordio.c $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT recordio.lo -MD -MP -MF $(DEPDIR)/recordio.Tpo -c -o recordio.lo `test -f 'src/recordio.c' || echo '$(srcdir)/'`src/recordio.c $(am__mv) $(DEPDIR)/recordio.Tpo $(DEPDIR)/recordio.Plo # source='src/recordio.c' object='recordio.lo' libtool=yes \ # DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ # $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o recordio.lo `test -f 'src/recordio.c' || echo '$(srcdir)/'`src/recordio.c zookeeper.jute.lo: generated/zookeeper.jute.c $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT zookeeper.jute.lo -MD -MP -MF $(DEPDIR)/zookeeper.jute.Tpo -c -o zookeeper.jute.lo `test -f 'generated/zookeeper.jute.c' || echo '$(srcdir)/'`generated/zookeeper.jute.c $(am__mv) $(DEPDIR)/zookeeper.jute.Tpo $(DEPDIR)/zookeeper.jute.Plo # source='generated/zookeeper.jute.c' object='zookeeper.jute.lo' libtool=yes \ # DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ # $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o zookeeper.jute.lo `test -f 'generated/zookeeper.jute.c' || echo '$(srcdir)/'`generated/zookeeper.jute.c zk_log.lo: src/zk_log.c $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT zk_log.lo -MD -MP -MF $(DEPDIR)/zk_log.Tpo -c -o zk_log.lo `test -f 'src/zk_log.c' || echo '$(srcdir)/'`src/zk_log.c $(am__mv) $(DEPDIR)/zk_log.Tpo $(DEPDIR)/zk_log.Plo # source='src/zk_log.c' object='zk_log.lo' libtool=yes \ # DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ # $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o zk_log.lo `test -f 'src/zk_log.c' || echo '$(srcdir)/'`src/zk_log.c zk_hashtable.lo: src/zk_hashtable.c $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT zk_hashtable.lo -MD -MP -MF $(DEPDIR)/zk_hashtable.Tpo -c -o zk_hashtable.lo `test -f 'src/zk_hashtable.c' || echo '$(srcdir)/'`src/zk_hashtable.c $(am__mv) $(DEPDIR)/zk_hashtable.Tpo $(DEPDIR)/zk_hashtable.Plo # source='src/zk_hashtable.c' object='zk_hashtable.lo' libtool=yes \ # DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ # $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o zk_hashtable.lo `test -f 'src/zk_hashtable.c' || echo '$(srcdir)/'`src/zk_hashtable.c st_adaptor.lo: src/st_adaptor.c $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT st_adaptor.lo -MD -MP -MF $(DEPDIR)/st_adaptor.Tpo -c -o st_adaptor.lo `test -f 'src/st_adaptor.c' || echo '$(srcdir)/'`src/st_adaptor.c $(am__mv) $(DEPDIR)/st_adaptor.Tpo $(DEPDIR)/st_adaptor.Plo # source='src/st_adaptor.c' object='st_adaptor.lo' libtool=yes \ # DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ # $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o st_adaptor.lo `test -f 'src/st_adaptor.c' || echo '$(srcdir)/'`src/st_adaptor.c cli_mt-cli.o: src/cli.c $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cli_mt_CFLAGS) $(CFLAGS) -MT cli_mt-cli.o -MD -MP -MF $(DEPDIR)/cli_mt-cli.Tpo -c -o cli_mt-cli.o `test -f 'src/cli.c' || echo '$(srcdir)/'`src/cli.c $(am__mv) $(DEPDIR)/cli_mt-cli.Tpo $(DEPDIR)/cli_mt-cli.Po # source='src/cli.c' object='cli_mt-cli.o' libtool=no \ # DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ # $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cli_mt_CFLAGS) $(CFLAGS) -c -o cli_mt-cli.o `test -f 'src/cli.c' || echo '$(srcdir)/'`src/cli.c cli_mt-cli.obj: src/cli.c $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cli_mt_CFLAGS) $(CFLAGS) -MT cli_mt-cli.obj -MD -MP -MF $(DEPDIR)/cli_mt-cli.Tpo -c -o cli_mt-cli.obj `if test -f 'src/cli.c'; then $(CYGPATH_W) 'src/cli.c'; else $(CYGPATH_W) '$(srcdir)/src/cli.c'; fi` $(am__mv) $(DEPDIR)/cli_mt-cli.Tpo $(DEPDIR)/cli_mt-cli.Po # source='src/cli.c' object='cli_mt-cli.obj' libtool=no \ # DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ # $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cli_mt_CFLAGS) $(CFLAGS) -c -o cli_mt-cli.obj `if test -f 'src/cli.c'; then $(CYGPATH_W) 'src/cli.c'; else $(CYGPATH_W) '$(srcdir)/src/cli.c'; fi` cli.o: src/cli.c $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cli.o -MD -MP -MF $(DEPDIR)/cli.Tpo -c -o cli.o `test -f 'src/cli.c' || echo '$(srcdir)/'`src/cli.c $(am__mv) $(DEPDIR)/cli.Tpo $(DEPDIR)/cli.Po # source='src/cli.c' object='cli.o' libtool=no \ # DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ # $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cli.o `test -f 'src/cli.c' || echo '$(srcdir)/'`src/cli.c cli.obj: src/cli.c $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cli.obj -MD -MP -MF $(DEPDIR)/cli.Tpo -c -o cli.obj `if test -f 'src/cli.c'; then $(CYGPATH_W) 'src/cli.c'; else $(CYGPATH_W) '$(srcdir)/src/cli.c'; fi` $(am__mv) $(DEPDIR)/cli.Tpo $(DEPDIR)/cli.Po # source='src/cli.c' object='cli.obj' libtool=no \ # DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ # $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cli.obj `if test -f 'src/cli.c'; then $(CYGPATH_W) 'src/cli.c'; else $(CYGPATH_W) '$(srcdir)/src/cli.c'; fi` load_gen-load_gen.o: src/load_gen.c $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(load_gen_CFLAGS) $(CFLAGS) -MT load_gen-load_gen.o -MD -MP -MF $(DEPDIR)/load_gen-load_gen.Tpo -c -o load_gen-load_gen.o `test -f 'src/load_gen.c' || echo '$(srcdir)/'`src/load_gen.c $(am__mv) $(DEPDIR)/load_gen-load_gen.Tpo $(DEPDIR)/load_gen-load_gen.Po # source='src/load_gen.c' object='load_gen-load_gen.o' libtool=no \ # DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ # $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(load_gen_CFLAGS) $(CFLAGS) -c -o load_gen-load_gen.o `test -f 'src/load_gen.c' || echo '$(srcdir)/'`src/load_gen.c load_gen-load_gen.obj: src/load_gen.c $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(load_gen_CFLAGS) $(CFLAGS) -MT load_gen-load_gen.obj -MD -MP -MF $(DEPDIR)/load_gen-load_gen.Tpo -c -o load_gen-load_gen.obj `if test -f 'src/load_gen.c'; then $(CYGPATH_W) 'src/load_gen.c'; else $(CYGPATH_W) '$(srcdir)/src/load_gen.c'; fi` $(am__mv) $(DEPDIR)/load_gen-load_gen.Tpo $(DEPDIR)/load_gen-load_gen.Po # source='src/load_gen.c' object='load_gen-load_gen.obj' libtool=no \ # DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ # $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(load_gen_CFLAGS) $(CFLAGS) -c -o load_gen-load_gen.obj `if test -f 'src/load_gen.c'; then $(CYGPATH_W) 'src/load_gen.c'; else $(CYGPATH_W) '$(srcdir)/src/load_gen.c'; fi` .cc.o: $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po # source='$<' object='$@' libtool=no \ # DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ # $(CXXCOMPILE) -c -o $@ $< .cc.obj: $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po # source='$<' object='$@' libtool=no \ # DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ # $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cc.lo: $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo # source='$<' object='$@' libtool=yes \ # DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ # $(LTCXXCOMPILE) -c -o $@ $< zktest_mt-TestDriver.o: tests/TestDriver.cc $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zktest_mt_CXXFLAGS) $(CXXFLAGS) -MT zktest_mt-TestDriver.o -MD -MP -MF $(DEPDIR)/zktest_mt-TestDriver.Tpo -c -o zktest_mt-TestDriver.o `test -f 'tests/TestDriver.cc' || echo '$(srcdir)/'`tests/TestDriver.cc $(am__mv) $(DEPDIR)/zktest_mt-TestDriver.Tpo $(DEPDIR)/zktest_mt-TestDriver.Po # source='tests/TestDriver.cc' object='zktest_mt-TestDriver.o' libtool=no \ # DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ # $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zktest_mt_CXXFLAGS) $(CXXFLAGS) -c -o zktest_mt-TestDriver.o `test -f 'tests/TestDriver.cc' || echo '$(srcdir)/'`tests/TestDriver.cc zktest_mt-TestDriver.obj: tests/TestDriver.cc $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zktest_mt_CXXFLAGS) $(CXXFLAGS) -MT zktest_mt-TestDriver.obj -MD -MP -MF $(DEPDIR)/zktest_mt-TestDriver.Tpo -c -o zktest_mt-TestDriver.obj `if test -f 'tests/TestDriver.cc'; then $(CYGPATH_W) 'tests/TestDriver.cc'; else $(CYGPATH_W) '$(srcdir)/tests/TestDriver.cc'; fi` $(am__mv) $(DEPDIR)/zktest_mt-TestDriver.Tpo $(DEPDIR)/zktest_mt-TestDriver.Po # source='tests/TestDriver.cc' object='zktest_mt-TestDriver.obj' libtool=no \ # DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ # $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zktest_mt_CXXFLAGS) $(CXXFLAGS) -c -o zktest_mt-TestDriver.obj `if test -f 'tests/TestDriver.cc'; then $(CYGPATH_W) 'tests/TestDriver.cc'; else $(CYGPATH_W) '$(srcdir)/tests/TestDriver.cc'; fi` zktest_mt-LibCMocks.o: tests/LibCMocks.cc $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zktest_mt_CXXFLAGS) $(CXXFLAGS) -MT zktest_mt-LibCMocks.o -MD -MP -MF $(DEPDIR)/zktest_mt-LibCMocks.Tpo -c -o zktest_mt-LibCMocks.o `test -f 'tests/LibCMocks.cc' || echo '$(srcdir)/'`tests/LibCMocks.cc $(am__mv) $(DEPDIR)/zktest_mt-LibCMocks.Tpo $(DEPDIR)/zktest_mt-LibCMocks.Po # source='tests/LibCMocks.cc' object='zktest_mt-LibCMocks.o' libtool=no \ # DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ # $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zktest_mt_CXXFLAGS) $(CXXFLAGS) -c -o zktest_mt-LibCMocks.o `test -f 'tests/LibCMocks.cc' || echo '$(srcdir)/'`tests/LibCMocks.cc zktest_mt-LibCMocks.obj: tests/LibCMocks.cc $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zktest_mt_CXXFLAGS) $(CXXFLAGS) -MT zktest_mt-LibCMocks.obj -MD -MP -MF $(DEPDIR)/zktest_mt-LibCMocks.Tpo -c -o zktest_mt-LibCMocks.obj `if test -f 'tests/LibCMocks.cc'; then $(CYGPATH_W) 'tests/LibCMocks.cc'; else $(CYGPATH_W) '$(srcdir)/tests/LibCMocks.cc'; fi` $(am__mv) $(DEPDIR)/zktest_mt-LibCMocks.Tpo $(DEPDIR)/zktest_mt-LibCMocks.Po # source='tests/LibCMocks.cc' object='zktest_mt-LibCMocks.obj' libtool=no \ # DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ # $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zktest_mt_CXXFLAGS) $(CXXFLAGS) -c -o zktest_mt-LibCMocks.obj `if test -f 'tests/LibCMocks.cc'; then $(CYGPATH_W) 'tests/LibCMocks.cc'; else $(CYGPATH_W) '$(srcdir)/tests/LibCMocks.cc'; fi` zktest_mt-LibCSymTable.o: tests/LibCSymTable.cc $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zktest_mt_CXXFLAGS) $(CXXFLAGS) -MT zktest_mt-LibCSymTable.o -MD -MP -MF $(DEPDIR)/zktest_mt-LibCSymTable.Tpo -c -o zktest_mt-LibCSymTable.o `test -f 'tests/LibCSymTable.cc' || echo '$(srcdir)/'`tests/LibCSymTable.cc $(am__mv) $(DEPDIR)/zktest_mt-LibCSymTable.Tpo $(DEPDIR)/zktest_mt-LibCSymTable.Po # source='tests/LibCSymTable.cc' object='zktest_mt-LibCSymTable.o' libtool=no \ # DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ # $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zktest_mt_CXXFLAGS) $(CXXFLAGS) -c -o zktest_mt-LibCSymTable.o `test -f 'tests/LibCSymTable.cc' || echo '$(srcdir)/'`tests/LibCSymTable.cc zktest_mt-LibCSymTable.obj: tests/LibCSymTable.cc $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zktest_mt_CXXFLAGS) $(CXXFLAGS) -MT zktest_mt-LibCSymTable.obj -MD -MP -MF $(DEPDIR)/zktest_mt-LibCSymTable.Tpo -c -o zktest_mt-LibCSymTable.obj `if test -f 'tests/LibCSymTable.cc'; then $(CYGPATH_W) 'tests/LibCSymTable.cc'; else $(CYGPATH_W) '$(srcdir)/tests/LibCSymTable.cc'; fi` $(am__mv) $(DEPDIR)/zktest_mt-LibCSymTable.Tpo $(DEPDIR)/zktest_mt-LibCSymTable.Po # source='tests/LibCSymTable.cc' object='zktest_mt-LibCSymTable.obj' libtool=no \ # DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ # $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zktest_mt_CXXFLAGS) $(CXXFLAGS) -c -o zktest_mt-LibCSymTable.obj `if test -f 'tests/LibCSymTable.cc'; then $(CYGPATH_W) 'tests/LibCSymTable.cc'; else $(CYGPATH_W) '$(srcdir)/tests/LibCSymTable.cc'; fi` zktest_mt-MocksBase.o: tests/MocksBase.cc $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zktest_mt_CXXFLAGS) $(CXXFLAGS) -MT zktest_mt-MocksBase.o -MD -MP -MF $(DEPDIR)/zktest_mt-MocksBase.Tpo -c -o zktest_mt-MocksBase.o `test -f 'tests/MocksBase.cc' || echo '$(srcdir)/'`tests/MocksBase.cc $(am__mv) $(DEPDIR)/zktest_mt-MocksBase.Tpo $(DEPDIR)/zktest_mt-MocksBase.Po # source='tests/MocksBase.cc' object='zktest_mt-MocksBase.o' libtool=no \ # DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ # $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zktest_mt_CXXFLAGS) $(CXXFLAGS) -c -o zktest_mt-MocksBase.o `test -f 'tests/MocksBase.cc' || echo '$(srcdir)/'`tests/MocksBase.cc zktest_mt-MocksBase.obj: tests/MocksBase.cc $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zktest_mt_CXXFLAGS) $(CXXFLAGS) -MT zktest_mt-MocksBase.obj -MD -MP -MF $(DEPDIR)/zktest_mt-MocksBase.Tpo -c -o zktest_mt-MocksBase.obj `if test -f 'tests/MocksBase.cc'; then $(CYGPATH_W) 'tests/MocksBase.cc'; else $(CYGPATH_W) '$(srcdir)/tests/MocksBase.cc'; fi` $(am__mv) $(DEPDIR)/zktest_mt-MocksBase.Tpo $(DEPDIR)/zktest_mt-MocksBase.Po # source='tests/MocksBase.cc' object='zktest_mt-MocksBase.obj' libtool=no \ # DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ # $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zktest_mt_CXXFLAGS) $(CXXFLAGS) -c -o zktest_mt-MocksBase.obj `if test -f 'tests/MocksBase.cc'; then $(CYGPATH_W) 'tests/MocksBase.cc'; else $(CYGPATH_W) '$(srcdir)/tests/MocksBase.cc'; fi` zktest_mt-ZKMocks.o: tests/ZKMocks.cc $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zktest_mt_CXXFLAGS) $(CXXFLAGS) -MT zktest_mt-ZKMocks.o -MD -MP -MF $(DEPDIR)/zktest_mt-ZKMocks.Tpo -c -o zktest_mt-ZKMocks.o `test -f 'tests/ZKMocks.cc' || echo '$(srcdir)/'`tests/ZKMocks.cc $(am__mv) $(DEPDIR)/zktest_mt-ZKMocks.Tpo $(DEPDIR)/zktest_mt-ZKMocks.Po # source='tests/ZKMocks.cc' object='zktest_mt-ZKMocks.o' libtool=no \ # DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ # $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zktest_mt_CXXFLAGS) $(CXXFLAGS) -c -o zktest_mt-ZKMocks.o `test -f 'tests/ZKMocks.cc' || echo '$(srcdir)/'`tests/ZKMocks.cc zktest_mt-ZKMocks.obj: tests/ZKMocks.cc $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zktest_mt_CXXFLAGS) $(CXXFLAGS) -MT zktest_mt-ZKMocks.obj -MD -MP -MF $(DEPDIR)/zktest_mt-ZKMocks.Tpo -c -o zktest_mt-ZKMocks.obj `if test -f 'tests/ZKMocks.cc'; then $(CYGPATH_W) 'tests/ZKMocks.cc'; else $(CYGPATH_W) '$(srcdir)/tests/ZKMocks.cc'; fi` $(am__mv) $(DEPDIR)/zktest_mt-ZKMocks.Tpo $(DEPDIR)/zktest_mt-ZKMocks.Po # source='tests/ZKMocks.cc' object='zktest_mt-ZKMocks.obj' libtool=no \ # DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ # $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zktest_mt_CXXFLAGS) $(CXXFLAGS) -c -o zktest_mt-ZKMocks.obj `if test -f 'tests/ZKMocks.cc'; then $(CYGPATH_W) 'tests/ZKMocks.cc'; else $(CYGPATH_W) '$(srcdir)/tests/ZKMocks.cc'; fi` zktest_mt-Util.o: tests/Util.cc $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zktest_mt_CXXFLAGS) $(CXXFLAGS) -MT zktest_mt-Util.o -MD -MP -MF $(DEPDIR)/zktest_mt-Util.Tpo -c -o zktest_mt-Util.o `test -f 'tests/Util.cc' || echo '$(srcdir)/'`tests/Util.cc $(am__mv) $(DEPDIR)/zktest_mt-Util.Tpo $(DEPDIR)/zktest_mt-Util.Po # source='tests/Util.cc' object='zktest_mt-Util.o' libtool=no \ # DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ # $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zktest_mt_CXXFLAGS) $(CXXFLAGS) -c -o zktest_mt-Util.o `test -f 'tests/Util.cc' || echo '$(srcdir)/'`tests/Util.cc zktest_mt-Util.obj: tests/Util.cc $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zktest_mt_CXXFLAGS) $(CXXFLAGS) -MT zktest_mt-Util.obj -MD -MP -MF $(DEPDIR)/zktest_mt-Util.Tpo -c -o zktest_mt-Util.obj `if test -f 'tests/Util.cc'; then $(CYGPATH_W) 'tests/Util.cc'; else $(CYGPATH_W) '$(srcdir)/tests/Util.cc'; fi` $(am__mv) $(DEPDIR)/zktest_mt-Util.Tpo $(DEPDIR)/zktest_mt-Util.Po # source='tests/Util.cc' object='zktest_mt-Util.obj' libtool=no \ # DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ # $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zktest_mt_CXXFLAGS) $(CXXFLAGS) -c -o zktest_mt-Util.obj `if test -f 'tests/Util.cc'; then $(CYGPATH_W) 'tests/Util.cc'; else $(CYGPATH_W) '$(srcdir)/tests/Util.cc'; fi` zktest_mt-ThreadingUtil.o: tests/ThreadingUtil.cc $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zktest_mt_CXXFLAGS) $(CXXFLAGS) -MT zktest_mt-ThreadingUtil.o -MD -MP -MF $(DEPDIR)/zktest_mt-ThreadingUtil.Tpo -c -o zktest_mt-ThreadingUtil.o `test -f 'tests/ThreadingUtil.cc' || echo '$(srcdir)/'`tests/ThreadingUtil.cc $(am__mv) $(DEPDIR)/zktest_mt-ThreadingUtil.Tpo $(DEPDIR)/zktest_mt-ThreadingUtil.Po # source='tests/ThreadingUtil.cc' object='zktest_mt-ThreadingUtil.o' libtool=no \ # DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ # $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zktest_mt_CXXFLAGS) $(CXXFLAGS) -c -o zktest_mt-ThreadingUtil.o `test -f 'tests/ThreadingUtil.cc' || echo '$(srcdir)/'`tests/ThreadingUtil.cc zktest_mt-ThreadingUtil.obj: tests/ThreadingUtil.cc $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zktest_mt_CXXFLAGS) $(CXXFLAGS) -MT zktest_mt-ThreadingUtil.obj -MD -MP -MF $(DEPDIR)/zktest_mt-ThreadingUtil.Tpo -c -o zktest_mt-ThreadingUtil.obj `if test -f 'tests/ThreadingUtil.cc'; then $(CYGPATH_W) 'tests/ThreadingUtil.cc'; else $(CYGPATH_W) '$(srcdir)/tests/ThreadingUtil.cc'; fi` $(am__mv) $(DEPDIR)/zktest_mt-ThreadingUtil.Tpo $(DEPDIR)/zktest_mt-ThreadingUtil.Po # source='tests/ThreadingUtil.cc' object='zktest_mt-ThreadingUtil.obj' libtool=no \ # DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ # $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zktest_mt_CXXFLAGS) $(CXXFLAGS) -c -o zktest_mt-ThreadingUtil.obj `if test -f 'tests/ThreadingUtil.cc'; then $(CYGPATH_W) 'tests/ThreadingUtil.cc'; else $(CYGPATH_W) '$(srcdir)/tests/ThreadingUtil.cc'; fi` zktest_mt-TestClientRetry.o: tests/TestClientRetry.cc $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zktest_mt_CXXFLAGS) $(CXXFLAGS) -MT zktest_mt-TestClientRetry.o -MD -MP -MF $(DEPDIR)/zktest_mt-TestClientRetry.Tpo -c -o zktest_mt-TestClientRetry.o `test -f 'tests/TestClientRetry.cc' || echo '$(srcdir)/'`tests/TestClientRetry.cc $(am__mv) $(DEPDIR)/zktest_mt-TestClientRetry.Tpo $(DEPDIR)/zktest_mt-TestClientRetry.Po # source='tests/TestClientRetry.cc' object='zktest_mt-TestClientRetry.o' libtool=no \ # DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ # $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zktest_mt_CXXFLAGS) $(CXXFLAGS) -c -o zktest_mt-TestClientRetry.o `test -f 'tests/TestClientRetry.cc' || echo '$(srcdir)/'`tests/TestClientRetry.cc zktest_mt-TestClientRetry.obj: tests/TestClientRetry.cc $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zktest_mt_CXXFLAGS) $(CXXFLAGS) -MT zktest_mt-TestClientRetry.obj -MD -MP -MF $(DEPDIR)/zktest_mt-TestClientRetry.Tpo -c -o zktest_mt-TestClientRetry.obj `if test -f 'tests/TestClientRetry.cc'; then $(CYGPATH_W) 'tests/TestClientRetry.cc'; else $(CYGPATH_W) '$(srcdir)/tests/TestClientRetry.cc'; fi` $(am__mv) $(DEPDIR)/zktest_mt-TestClientRetry.Tpo $(DEPDIR)/zktest_mt-TestClientRetry.Po # source='tests/TestClientRetry.cc' object='zktest_mt-TestClientRetry.obj' libtool=no \ # DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ # $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zktest_mt_CXXFLAGS) $(CXXFLAGS) -c -o zktest_mt-TestClientRetry.obj `if test -f 'tests/TestClientRetry.cc'; then $(CYGPATH_W) 'tests/TestClientRetry.cc'; else $(CYGPATH_W) '$(srcdir)/tests/TestClientRetry.cc'; fi` zktest_mt-TestOperations.o: tests/TestOperations.cc $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zktest_mt_CXXFLAGS) $(CXXFLAGS) -MT zktest_mt-TestOperations.o -MD -MP -MF $(DEPDIR)/zktest_mt-TestOperations.Tpo -c -o zktest_mt-TestOperations.o `test -f 'tests/TestOperations.cc' || echo '$(srcdir)/'`tests/TestOperations.cc $(am__mv) $(DEPDIR)/zktest_mt-TestOperations.Tpo $(DEPDIR)/zktest_mt-TestOperations.Po # source='tests/TestOperations.cc' object='zktest_mt-TestOperations.o' libtool=no \ # DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ # $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zktest_mt_CXXFLAGS) $(CXXFLAGS) -c -o zktest_mt-TestOperations.o `test -f 'tests/TestOperations.cc' || echo '$(srcdir)/'`tests/TestOperations.cc zktest_mt-TestOperations.obj: tests/TestOperations.cc $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zktest_mt_CXXFLAGS) $(CXXFLAGS) -MT zktest_mt-TestOperations.obj -MD -MP -MF $(DEPDIR)/zktest_mt-TestOperations.Tpo -c -o zktest_mt-TestOperations.obj `if test -f 'tests/TestOperations.cc'; then $(CYGPATH_W) 'tests/TestOperations.cc'; else $(CYGPATH_W) '$(srcdir)/tests/TestOperations.cc'; fi` $(am__mv) $(DEPDIR)/zktest_mt-TestOperations.Tpo $(DEPDIR)/zktest_mt-TestOperations.Po # source='tests/TestOperations.cc' object='zktest_mt-TestOperations.obj' libtool=no \ # DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ # $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zktest_mt_CXXFLAGS) $(CXXFLAGS) -c -o zktest_mt-TestOperations.obj `if test -f 'tests/TestOperations.cc'; then $(CYGPATH_W) 'tests/TestOperations.cc'; else $(CYGPATH_W) '$(srcdir)/tests/TestOperations.cc'; fi` zktest_mt-TestZookeeperInit.o: tests/TestZookeeperInit.cc $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zktest_mt_CXXFLAGS) $(CXXFLAGS) -MT zktest_mt-TestZookeeperInit.o -MD -MP -MF $(DEPDIR)/zktest_mt-TestZookeeperInit.Tpo -c -o zktest_mt-TestZookeeperInit.o `test -f 'tests/TestZookeeperInit.cc' || echo '$(srcdir)/'`tests/TestZookeeperInit.cc $(am__mv) $(DEPDIR)/zktest_mt-TestZookeeperInit.Tpo $(DEPDIR)/zktest_mt-TestZookeeperInit.Po # source='tests/TestZookeeperInit.cc' object='zktest_mt-TestZookeeperInit.o' libtool=no \ # DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ # $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zktest_mt_CXXFLAGS) $(CXXFLAGS) -c -o zktest_mt-TestZookeeperInit.o `test -f 'tests/TestZookeeperInit.cc' || echo '$(srcdir)/'`tests/TestZookeeperInit.cc zktest_mt-TestZookeeperInit.obj: tests/TestZookeeperInit.cc $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zktest_mt_CXXFLAGS) $(CXXFLAGS) -MT zktest_mt-TestZookeeperInit.obj -MD -MP -MF $(DEPDIR)/zktest_mt-TestZookeeperInit.Tpo -c -o zktest_mt-TestZookeeperInit.obj `if test -f 'tests/TestZookeeperInit.cc'; then $(CYGPATH_W) 'tests/TestZookeeperInit.cc'; else $(CYGPATH_W) '$(srcdir)/tests/TestZookeeperInit.cc'; fi` $(am__mv) $(DEPDIR)/zktest_mt-TestZookeeperInit.Tpo $(DEPDIR)/zktest_mt-TestZookeeperInit.Po # source='tests/TestZookeeperInit.cc' object='zktest_mt-TestZookeeperInit.obj' libtool=no \ # DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ # $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zktest_mt_CXXFLAGS) $(CXXFLAGS) -c -o zktest_mt-TestZookeeperInit.obj `if test -f 'tests/TestZookeeperInit.cc'; then $(CYGPATH_W) 'tests/TestZookeeperInit.cc'; else $(CYGPATH_W) '$(srcdir)/tests/TestZookeeperInit.cc'; fi` zktest_mt-TestZookeeperClose.o: tests/TestZookeeperClose.cc $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zktest_mt_CXXFLAGS) $(CXXFLAGS) -MT zktest_mt-TestZookeeperClose.o -MD -MP -MF $(DEPDIR)/zktest_mt-TestZookeeperClose.Tpo -c -o zktest_mt-TestZookeeperClose.o `test -f 'tests/TestZookeeperClose.cc' || echo '$(srcdir)/'`tests/TestZookeeperClose.cc $(am__mv) $(DEPDIR)/zktest_mt-TestZookeeperClose.Tpo $(DEPDIR)/zktest_mt-TestZookeeperClose.Po # source='tests/TestZookeeperClose.cc' object='zktest_mt-TestZookeeperClose.o' libtool=no \ # DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ # $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zktest_mt_CXXFLAGS) $(CXXFLAGS) -c -o zktest_mt-TestZookeeperClose.o `test -f 'tests/TestZookeeperClose.cc' || echo '$(srcdir)/'`tests/TestZookeeperClose.cc zktest_mt-TestZookeeperClose.obj: tests/TestZookeeperClose.cc $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zktest_mt_CXXFLAGS) $(CXXFLAGS) -MT zktest_mt-TestZookeeperClose.obj -MD -MP -MF $(DEPDIR)/zktest_mt-TestZookeeperClose.Tpo -c -o zktest_mt-TestZookeeperClose.obj `if test -f 'tests/TestZookeeperClose.cc'; then $(CYGPATH_W) 'tests/TestZookeeperClose.cc'; else $(CYGPATH_W) '$(srcdir)/tests/TestZookeeperClose.cc'; fi` $(am__mv) $(DEPDIR)/zktest_mt-TestZookeeperClose.Tpo $(DEPDIR)/zktest_mt-TestZookeeperClose.Po # source='tests/TestZookeeperClose.cc' object='zktest_mt-TestZookeeperClose.obj' libtool=no \ # DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ # $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zktest_mt_CXXFLAGS) $(CXXFLAGS) -c -o zktest_mt-TestZookeeperClose.obj `if test -f 'tests/TestZookeeperClose.cc'; then $(CYGPATH_W) 'tests/TestZookeeperClose.cc'; else $(CYGPATH_W) '$(srcdir)/tests/TestZookeeperClose.cc'; fi` zktest_mt-TestClient.o: tests/TestClient.cc $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zktest_mt_CXXFLAGS) $(CXXFLAGS) -MT zktest_mt-TestClient.o -MD -MP -MF $(DEPDIR)/zktest_mt-TestClient.Tpo -c -o zktest_mt-TestClient.o `test -f 'tests/TestClient.cc' || echo '$(srcdir)/'`tests/TestClient.cc $(am__mv) $(DEPDIR)/zktest_mt-TestClient.Tpo $(DEPDIR)/zktest_mt-TestClient.Po # source='tests/TestClient.cc' object='zktest_mt-TestClient.o' libtool=no \ # DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ # $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zktest_mt_CXXFLAGS) $(CXXFLAGS) -c -o zktest_mt-TestClient.o `test -f 'tests/TestClient.cc' || echo '$(srcdir)/'`tests/TestClient.cc zktest_mt-TestClient.obj: tests/TestClient.cc $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zktest_mt_CXXFLAGS) $(CXXFLAGS) -MT zktest_mt-TestClient.obj -MD -MP -MF $(DEPDIR)/zktest_mt-TestClient.Tpo -c -o zktest_mt-TestClient.obj `if test -f 'tests/TestClient.cc'; then $(CYGPATH_W) 'tests/TestClient.cc'; else $(CYGPATH_W) '$(srcdir)/tests/TestClient.cc'; fi` $(am__mv) $(DEPDIR)/zktest_mt-TestClient.Tpo $(DEPDIR)/zktest_mt-TestClient.Po # source='tests/TestClient.cc' object='zktest_mt-TestClient.obj' libtool=no \ # DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ # $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zktest_mt_CXXFLAGS) $(CXXFLAGS) -c -o zktest_mt-TestClient.obj `if test -f 'tests/TestClient.cc'; then $(CYGPATH_W) 'tests/TestClient.cc'; else $(CYGPATH_W) '$(srcdir)/tests/TestClient.cc'; fi` zktest_mt-TestWatchers.o: tests/TestWatchers.cc $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zktest_mt_CXXFLAGS) $(CXXFLAGS) -MT zktest_mt-TestWatchers.o -MD -MP -MF $(DEPDIR)/zktest_mt-TestWatchers.Tpo -c -o zktest_mt-TestWatchers.o `test -f 'tests/TestWatchers.cc' || echo '$(srcdir)/'`tests/TestWatchers.cc $(am__mv) $(DEPDIR)/zktest_mt-TestWatchers.Tpo $(DEPDIR)/zktest_mt-TestWatchers.Po # source='tests/TestWatchers.cc' object='zktest_mt-TestWatchers.o' libtool=no \ # DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ # $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zktest_mt_CXXFLAGS) $(CXXFLAGS) -c -o zktest_mt-TestWatchers.o `test -f 'tests/TestWatchers.cc' || echo '$(srcdir)/'`tests/TestWatchers.cc zktest_mt-TestWatchers.obj: tests/TestWatchers.cc $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zktest_mt_CXXFLAGS) $(CXXFLAGS) -MT zktest_mt-TestWatchers.obj -MD -MP -MF $(DEPDIR)/zktest_mt-TestWatchers.Tpo -c -o zktest_mt-TestWatchers.obj `if test -f 'tests/TestWatchers.cc'; then $(CYGPATH_W) 'tests/TestWatchers.cc'; else $(CYGPATH_W) '$(srcdir)/tests/TestWatchers.cc'; fi` $(am__mv) $(DEPDIR)/zktest_mt-TestWatchers.Tpo $(DEPDIR)/zktest_mt-TestWatchers.Po # source='tests/TestWatchers.cc' object='zktest_mt-TestWatchers.obj' libtool=no \ # DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ # $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zktest_mt_CXXFLAGS) $(CXXFLAGS) -c -o zktest_mt-TestWatchers.obj `if test -f 'tests/TestWatchers.cc'; then $(CYGPATH_W) 'tests/TestWatchers.cc'; else $(CYGPATH_W) '$(srcdir)/tests/TestWatchers.cc'; fi` zktest_mt-PthreadMocks.o: tests/PthreadMocks.cc $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zktest_mt_CXXFLAGS) $(CXXFLAGS) -MT zktest_mt-PthreadMocks.o -MD -MP -MF $(DEPDIR)/zktest_mt-PthreadMocks.Tpo -c -o zktest_mt-PthreadMocks.o `test -f 'tests/PthreadMocks.cc' || echo '$(srcdir)/'`tests/PthreadMocks.cc $(am__mv) $(DEPDIR)/zktest_mt-PthreadMocks.Tpo $(DEPDIR)/zktest_mt-PthreadMocks.Po # source='tests/PthreadMocks.cc' object='zktest_mt-PthreadMocks.o' libtool=no \ # DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ # $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zktest_mt_CXXFLAGS) $(CXXFLAGS) -c -o zktest_mt-PthreadMocks.o `test -f 'tests/PthreadMocks.cc' || echo '$(srcdir)/'`tests/PthreadMocks.cc zktest_mt-PthreadMocks.obj: tests/PthreadMocks.cc $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zktest_mt_CXXFLAGS) $(CXXFLAGS) -MT zktest_mt-PthreadMocks.obj -MD -MP -MF $(DEPDIR)/zktest_mt-PthreadMocks.Tpo -c -o zktest_mt-PthreadMocks.obj `if test -f 'tests/PthreadMocks.cc'; then $(CYGPATH_W) 'tests/PthreadMocks.cc'; else $(CYGPATH_W) '$(srcdir)/tests/PthreadMocks.cc'; fi` $(am__mv) $(DEPDIR)/zktest_mt-PthreadMocks.Tpo $(DEPDIR)/zktest_mt-PthreadMocks.Po # source='tests/PthreadMocks.cc' object='zktest_mt-PthreadMocks.obj' libtool=no \ # DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ # $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zktest_mt_CXXFLAGS) $(CXXFLAGS) -c -o zktest_mt-PthreadMocks.obj `if test -f 'tests/PthreadMocks.cc'; then $(CYGPATH_W) 'tests/PthreadMocks.cc'; else $(CYGPATH_W) '$(srcdir)/tests/PthreadMocks.cc'; fi` zktest_st-TestDriver.o: tests/TestDriver.cc $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zktest_st_CXXFLAGS) $(CXXFLAGS) -MT zktest_st-TestDriver.o -MD -MP -MF $(DEPDIR)/zktest_st-TestDriver.Tpo -c -o zktest_st-TestDriver.o `test -f 'tests/TestDriver.cc' || echo '$(srcdir)/'`tests/TestDriver.cc $(am__mv) $(DEPDIR)/zktest_st-TestDriver.Tpo $(DEPDIR)/zktest_st-TestDriver.Po # source='tests/TestDriver.cc' object='zktest_st-TestDriver.o' libtool=no \ # DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ # $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zktest_st_CXXFLAGS) $(CXXFLAGS) -c -o zktest_st-TestDriver.o `test -f 'tests/TestDriver.cc' || echo '$(srcdir)/'`tests/TestDriver.cc zktest_st-TestDriver.obj: tests/TestDriver.cc $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zktest_st_CXXFLAGS) $(CXXFLAGS) -MT zktest_st-TestDriver.obj -MD -MP -MF $(DEPDIR)/zktest_st-TestDriver.Tpo -c -o zktest_st-TestDriver.obj `if test -f 'tests/TestDriver.cc'; then $(CYGPATH_W) 'tests/TestDriver.cc'; else $(CYGPATH_W) '$(srcdir)/tests/TestDriver.cc'; fi` $(am__mv) $(DEPDIR)/zktest_st-TestDriver.Tpo $(DEPDIR)/zktest_st-TestDriver.Po # source='tests/TestDriver.cc' object='zktest_st-TestDriver.obj' libtool=no \ # DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ # $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zktest_st_CXXFLAGS) $(CXXFLAGS) -c -o zktest_st-TestDriver.obj `if test -f 'tests/TestDriver.cc'; then $(CYGPATH_W) 'tests/TestDriver.cc'; else $(CYGPATH_W) '$(srcdir)/tests/TestDriver.cc'; fi` zktest_st-LibCMocks.o: tests/LibCMocks.cc $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zktest_st_CXXFLAGS) $(CXXFLAGS) -MT zktest_st-LibCMocks.o -MD -MP -MF $(DEPDIR)/zktest_st-LibCMocks.Tpo -c -o zktest_st-LibCMocks.o `test -f 'tests/LibCMocks.cc' || echo '$(srcdir)/'`tests/LibCMocks.cc $(am__mv) $(DEPDIR)/zktest_st-LibCMocks.Tpo $(DEPDIR)/zktest_st-LibCMocks.Po # source='tests/LibCMocks.cc' object='zktest_st-LibCMocks.o' libtool=no \ # DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ # $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zktest_st_CXXFLAGS) $(CXXFLAGS) -c -o zktest_st-LibCMocks.o `test -f 'tests/LibCMocks.cc' || echo '$(srcdir)/'`tests/LibCMocks.cc zktest_st-LibCMocks.obj: tests/LibCMocks.cc $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zktest_st_CXXFLAGS) $(CXXFLAGS) -MT zktest_st-LibCMocks.obj -MD -MP -MF $(DEPDIR)/zktest_st-LibCMocks.Tpo -c -o zktest_st-LibCMocks.obj `if test -f 'tests/LibCMocks.cc'; then $(CYGPATH_W) 'tests/LibCMocks.cc'; else $(CYGPATH_W) '$(srcdir)/tests/LibCMocks.cc'; fi` $(am__mv) $(DEPDIR)/zktest_st-LibCMocks.Tpo $(DEPDIR)/zktest_st-LibCMocks.Po # source='tests/LibCMocks.cc' object='zktest_st-LibCMocks.obj' libtool=no \ # DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ # $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zktest_st_CXXFLAGS) $(CXXFLAGS) -c -o zktest_st-LibCMocks.obj `if test -f 'tests/LibCMocks.cc'; then $(CYGPATH_W) 'tests/LibCMocks.cc'; else $(CYGPATH_W) '$(srcdir)/tests/LibCMocks.cc'; fi` zktest_st-LibCSymTable.o: tests/LibCSymTable.cc $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zktest_st_CXXFLAGS) $(CXXFLAGS) -MT zktest_st-LibCSymTable.o -MD -MP -MF $(DEPDIR)/zktest_st-LibCSymTable.Tpo -c -o zktest_st-LibCSymTable.o `test -f 'tests/LibCSymTable.cc' || echo '$(srcdir)/'`tests/LibCSymTable.cc $(am__mv) $(DEPDIR)/zktest_st-LibCSymTable.Tpo $(DEPDIR)/zktest_st-LibCSymTable.Po # source='tests/LibCSymTable.cc' object='zktest_st-LibCSymTable.o' libtool=no \ # DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ # $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zktest_st_CXXFLAGS) $(CXXFLAGS) -c -o zktest_st-LibCSymTable.o `test -f 'tests/LibCSymTable.cc' || echo '$(srcdir)/'`tests/LibCSymTable.cc zktest_st-LibCSymTable.obj: tests/LibCSymTable.cc $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zktest_st_CXXFLAGS) $(CXXFLAGS) -MT zktest_st-LibCSymTable.obj -MD -MP -MF $(DEPDIR)/zktest_st-LibCSymTable.Tpo -c -o zktest_st-LibCSymTable.obj `if test -f 'tests/LibCSymTable.cc'; then $(CYGPATH_W) 'tests/LibCSymTable.cc'; else $(CYGPATH_W) '$(srcdir)/tests/LibCSymTable.cc'; fi` $(am__mv) $(DEPDIR)/zktest_st-LibCSymTable.Tpo $(DEPDIR)/zktest_st-LibCSymTable.Po # source='tests/LibCSymTable.cc' object='zktest_st-LibCSymTable.obj' libtool=no \ # DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ # $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zktest_st_CXXFLAGS) $(CXXFLAGS) -c -o zktest_st-LibCSymTable.obj `if test -f 'tests/LibCSymTable.cc'; then $(CYGPATH_W) 'tests/LibCSymTable.cc'; else $(CYGPATH_W) '$(srcdir)/tests/LibCSymTable.cc'; fi` zktest_st-MocksBase.o: tests/MocksBase.cc $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zktest_st_CXXFLAGS) $(CXXFLAGS) -MT zktest_st-MocksBase.o -MD -MP -MF $(DEPDIR)/zktest_st-MocksBase.Tpo -c -o zktest_st-MocksBase.o `test -f 'tests/MocksBase.cc' || echo '$(srcdir)/'`tests/MocksBase.cc $(am__mv) $(DEPDIR)/zktest_st-MocksBase.Tpo $(DEPDIR)/zktest_st-MocksBase.Po # source='tests/MocksBase.cc' object='zktest_st-MocksBase.o' libtool=no \ # DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ # $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zktest_st_CXXFLAGS) $(CXXFLAGS) -c -o zktest_st-MocksBase.o `test -f 'tests/MocksBase.cc' || echo '$(srcdir)/'`tests/MocksBase.cc zktest_st-MocksBase.obj: tests/MocksBase.cc $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zktest_st_CXXFLAGS) $(CXXFLAGS) -MT zktest_st-MocksBase.obj -MD -MP -MF $(DEPDIR)/zktest_st-MocksBase.Tpo -c -o zktest_st-MocksBase.obj `if test -f 'tests/MocksBase.cc'; then $(CYGPATH_W) 'tests/MocksBase.cc'; else $(CYGPATH_W) '$(srcdir)/tests/MocksBase.cc'; fi` $(am__mv) $(DEPDIR)/zktest_st-MocksBase.Tpo $(DEPDIR)/zktest_st-MocksBase.Po # source='tests/MocksBase.cc' object='zktest_st-MocksBase.obj' libtool=no \ # DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ # $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zktest_st_CXXFLAGS) $(CXXFLAGS) -c -o zktest_st-MocksBase.obj `if test -f 'tests/MocksBase.cc'; then $(CYGPATH_W) 'tests/MocksBase.cc'; else $(CYGPATH_W) '$(srcdir)/tests/MocksBase.cc'; fi` zktest_st-ZKMocks.o: tests/ZKMocks.cc $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zktest_st_CXXFLAGS) $(CXXFLAGS) -MT zktest_st-ZKMocks.o -MD -MP -MF $(DEPDIR)/zktest_st-ZKMocks.Tpo -c -o zktest_st-ZKMocks.o `test -f 'tests/ZKMocks.cc' || echo '$(srcdir)/'`tests/ZKMocks.cc $(am__mv) $(DEPDIR)/zktest_st-ZKMocks.Tpo $(DEPDIR)/zktest_st-ZKMocks.Po # source='tests/ZKMocks.cc' object='zktest_st-ZKMocks.o' libtool=no \ # DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ # $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zktest_st_CXXFLAGS) $(CXXFLAGS) -c -o zktest_st-ZKMocks.o `test -f 'tests/ZKMocks.cc' || echo '$(srcdir)/'`tests/ZKMocks.cc zktest_st-ZKMocks.obj: tests/ZKMocks.cc $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zktest_st_CXXFLAGS) $(CXXFLAGS) -MT zktest_st-ZKMocks.obj -MD -MP -MF $(DEPDIR)/zktest_st-ZKMocks.Tpo -c -o zktest_st-ZKMocks.obj `if test -f 'tests/ZKMocks.cc'; then $(CYGPATH_W) 'tests/ZKMocks.cc'; else $(CYGPATH_W) '$(srcdir)/tests/ZKMocks.cc'; fi` $(am__mv) $(DEPDIR)/zktest_st-ZKMocks.Tpo $(DEPDIR)/zktest_st-ZKMocks.Po # source='tests/ZKMocks.cc' object='zktest_st-ZKMocks.obj' libtool=no \ # DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ # $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zktest_st_CXXFLAGS) $(CXXFLAGS) -c -o zktest_st-ZKMocks.obj `if test -f 'tests/ZKMocks.cc'; then $(CYGPATH_W) 'tests/ZKMocks.cc'; else $(CYGPATH_W) '$(srcdir)/tests/ZKMocks.cc'; fi` zktest_st-Util.o: tests/Util.cc $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zktest_st_CXXFLAGS) $(CXXFLAGS) -MT zktest_st-Util.o -MD -MP -MF $(DEPDIR)/zktest_st-Util.Tpo -c -o zktest_st-Util.o `test -f 'tests/Util.cc' || echo '$(srcdir)/'`tests/Util.cc $(am__mv) $(DEPDIR)/zktest_st-Util.Tpo $(DEPDIR)/zktest_st-Util.Po # source='tests/Util.cc' object='zktest_st-Util.o' libtool=no \ # DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ # $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zktest_st_CXXFLAGS) $(CXXFLAGS) -c -o zktest_st-Util.o `test -f 'tests/Util.cc' || echo '$(srcdir)/'`tests/Util.cc zktest_st-Util.obj: tests/Util.cc $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zktest_st_CXXFLAGS) $(CXXFLAGS) -MT zktest_st-Util.obj -MD -MP -MF $(DEPDIR)/zktest_st-Util.Tpo -c -o zktest_st-Util.obj `if test -f 'tests/Util.cc'; then $(CYGPATH_W) 'tests/Util.cc'; else $(CYGPATH_W) '$(srcdir)/tests/Util.cc'; fi` $(am__mv) $(DEPDIR)/zktest_st-Util.Tpo $(DEPDIR)/zktest_st-Util.Po # source='tests/Util.cc' object='zktest_st-Util.obj' libtool=no \ # DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ # $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zktest_st_CXXFLAGS) $(CXXFLAGS) -c -o zktest_st-Util.obj `if test -f 'tests/Util.cc'; then $(CYGPATH_W) 'tests/Util.cc'; else $(CYGPATH_W) '$(srcdir)/tests/Util.cc'; fi` zktest_st-ThreadingUtil.o: tests/ThreadingUtil.cc $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zktest_st_CXXFLAGS) $(CXXFLAGS) -MT zktest_st-ThreadingUtil.o -MD -MP -MF $(DEPDIR)/zktest_st-ThreadingUtil.Tpo -c -o zktest_st-ThreadingUtil.o `test -f 'tests/ThreadingUtil.cc' || echo '$(srcdir)/'`tests/ThreadingUtil.cc $(am__mv) $(DEPDIR)/zktest_st-ThreadingUtil.Tpo $(DEPDIR)/zktest_st-ThreadingUtil.Po # source='tests/ThreadingUtil.cc' object='zktest_st-ThreadingUtil.o' libtool=no \ # DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ # $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zktest_st_CXXFLAGS) $(CXXFLAGS) -c -o zktest_st-ThreadingUtil.o `test -f 'tests/ThreadingUtil.cc' || echo '$(srcdir)/'`tests/ThreadingUtil.cc zktest_st-ThreadingUtil.obj: tests/ThreadingUtil.cc $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zktest_st_CXXFLAGS) $(CXXFLAGS) -MT zktest_st-ThreadingUtil.obj -MD -MP -MF $(DEPDIR)/zktest_st-ThreadingUtil.Tpo -c -o zktest_st-ThreadingUtil.obj `if test -f 'tests/ThreadingUtil.cc'; then $(CYGPATH_W) 'tests/ThreadingUtil.cc'; else $(CYGPATH_W) '$(srcdir)/tests/ThreadingUtil.cc'; fi` $(am__mv) $(DEPDIR)/zktest_st-ThreadingUtil.Tpo $(DEPDIR)/zktest_st-ThreadingUtil.Po # source='tests/ThreadingUtil.cc' object='zktest_st-ThreadingUtil.obj' libtool=no \ # DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ # $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zktest_st_CXXFLAGS) $(CXXFLAGS) -c -o zktest_st-ThreadingUtil.obj `if test -f 'tests/ThreadingUtil.cc'; then $(CYGPATH_W) 'tests/ThreadingUtil.cc'; else $(CYGPATH_W) '$(srcdir)/tests/ThreadingUtil.cc'; fi` zktest_st-TestClientRetry.o: tests/TestClientRetry.cc $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zktest_st_CXXFLAGS) $(CXXFLAGS) -MT zktest_st-TestClientRetry.o -MD -MP -MF $(DEPDIR)/zktest_st-TestClientRetry.Tpo -c -o zktest_st-TestClientRetry.o `test -f 'tests/TestClientRetry.cc' || echo '$(srcdir)/'`tests/TestClientRetry.cc $(am__mv) $(DEPDIR)/zktest_st-TestClientRetry.Tpo $(DEPDIR)/zktest_st-TestClientRetry.Po # source='tests/TestClientRetry.cc' object='zktest_st-TestClientRetry.o' libtool=no \ # DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ # $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zktest_st_CXXFLAGS) $(CXXFLAGS) -c -o zktest_st-TestClientRetry.o `test -f 'tests/TestClientRetry.cc' || echo '$(srcdir)/'`tests/TestClientRetry.cc zktest_st-TestClientRetry.obj: tests/TestClientRetry.cc $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zktest_st_CXXFLAGS) $(CXXFLAGS) -MT zktest_st-TestClientRetry.obj -MD -MP -MF $(DEPDIR)/zktest_st-TestClientRetry.Tpo -c -o zktest_st-TestClientRetry.obj `if test -f 'tests/TestClientRetry.cc'; then $(CYGPATH_W) 'tests/TestClientRetry.cc'; else $(CYGPATH_W) '$(srcdir)/tests/TestClientRetry.cc'; fi` $(am__mv) $(DEPDIR)/zktest_st-TestClientRetry.Tpo $(DEPDIR)/zktest_st-TestClientRetry.Po # source='tests/TestClientRetry.cc' object='zktest_st-TestClientRetry.obj' libtool=no \ # DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ # $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zktest_st_CXXFLAGS) $(CXXFLAGS) -c -o zktest_st-TestClientRetry.obj `if test -f 'tests/TestClientRetry.cc'; then $(CYGPATH_W) 'tests/TestClientRetry.cc'; else $(CYGPATH_W) '$(srcdir)/tests/TestClientRetry.cc'; fi` zktest_st-TestOperations.o: tests/TestOperations.cc $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zktest_st_CXXFLAGS) $(CXXFLAGS) -MT zktest_st-TestOperations.o -MD -MP -MF $(DEPDIR)/zktest_st-TestOperations.Tpo -c -o zktest_st-TestOperations.o `test -f 'tests/TestOperations.cc' || echo '$(srcdir)/'`tests/TestOperations.cc $(am__mv) $(DEPDIR)/zktest_st-TestOperations.Tpo $(DEPDIR)/zktest_st-TestOperations.Po # source='tests/TestOperations.cc' object='zktest_st-TestOperations.o' libtool=no \ # DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ # $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zktest_st_CXXFLAGS) $(CXXFLAGS) -c -o zktest_st-TestOperations.o `test -f 'tests/TestOperations.cc' || echo '$(srcdir)/'`tests/TestOperations.cc zktest_st-TestOperations.obj: tests/TestOperations.cc $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zktest_st_CXXFLAGS) $(CXXFLAGS) -MT zktest_st-TestOperations.obj -MD -MP -MF $(DEPDIR)/zktest_st-TestOperations.Tpo -c -o zktest_st-TestOperations.obj `if test -f 'tests/TestOperations.cc'; then $(CYGPATH_W) 'tests/TestOperations.cc'; else $(CYGPATH_W) '$(srcdir)/tests/TestOperations.cc'; fi` $(am__mv) $(DEPDIR)/zktest_st-TestOperations.Tpo $(DEPDIR)/zktest_st-TestOperations.Po # source='tests/TestOperations.cc' object='zktest_st-TestOperations.obj' libtool=no \ # DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ # $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zktest_st_CXXFLAGS) $(CXXFLAGS) -c -o zktest_st-TestOperations.obj `if test -f 'tests/TestOperations.cc'; then $(CYGPATH_W) 'tests/TestOperations.cc'; else $(CYGPATH_W) '$(srcdir)/tests/TestOperations.cc'; fi` zktest_st-TestZookeeperInit.o: tests/TestZookeeperInit.cc $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zktest_st_CXXFLAGS) $(CXXFLAGS) -MT zktest_st-TestZookeeperInit.o -MD -MP -MF $(DEPDIR)/zktest_st-TestZookeeperInit.Tpo -c -o zktest_st-TestZookeeperInit.o `test -f 'tests/TestZookeeperInit.cc' || echo '$(srcdir)/'`tests/TestZookeeperInit.cc $(am__mv) $(DEPDIR)/zktest_st-TestZookeeperInit.Tpo $(DEPDIR)/zktest_st-TestZookeeperInit.Po # source='tests/TestZookeeperInit.cc' object='zktest_st-TestZookeeperInit.o' libtool=no \ # DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ # $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zktest_st_CXXFLAGS) $(CXXFLAGS) -c -o zktest_st-TestZookeeperInit.o `test -f 'tests/TestZookeeperInit.cc' || echo '$(srcdir)/'`tests/TestZookeeperInit.cc zktest_st-TestZookeeperInit.obj: tests/TestZookeeperInit.cc $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zktest_st_CXXFLAGS) $(CXXFLAGS) -MT zktest_st-TestZookeeperInit.obj -MD -MP -MF $(DEPDIR)/zktest_st-TestZookeeperInit.Tpo -c -o zktest_st-TestZookeeperInit.obj `if test -f 'tests/TestZookeeperInit.cc'; then $(CYGPATH_W) 'tests/TestZookeeperInit.cc'; else $(CYGPATH_W) '$(srcdir)/tests/TestZookeeperInit.cc'; fi` $(am__mv) $(DEPDIR)/zktest_st-TestZookeeperInit.Tpo $(DEPDIR)/zktest_st-TestZookeeperInit.Po # source='tests/TestZookeeperInit.cc' object='zktest_st-TestZookeeperInit.obj' libtool=no \ # DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ # $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zktest_st_CXXFLAGS) $(CXXFLAGS) -c -o zktest_st-TestZookeeperInit.obj `if test -f 'tests/TestZookeeperInit.cc'; then $(CYGPATH_W) 'tests/TestZookeeperInit.cc'; else $(CYGPATH_W) '$(srcdir)/tests/TestZookeeperInit.cc'; fi` zktest_st-TestZookeeperClose.o: tests/TestZookeeperClose.cc $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zktest_st_CXXFLAGS) $(CXXFLAGS) -MT zktest_st-TestZookeeperClose.o -MD -MP -MF $(DEPDIR)/zktest_st-TestZookeeperClose.Tpo -c -o zktest_st-TestZookeeperClose.o `test -f 'tests/TestZookeeperClose.cc' || echo '$(srcdir)/'`tests/TestZookeeperClose.cc $(am__mv) $(DEPDIR)/zktest_st-TestZookeeperClose.Tpo $(DEPDIR)/zktest_st-TestZookeeperClose.Po # source='tests/TestZookeeperClose.cc' object='zktest_st-TestZookeeperClose.o' libtool=no \ # DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ # $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zktest_st_CXXFLAGS) $(CXXFLAGS) -c -o zktest_st-TestZookeeperClose.o `test -f 'tests/TestZookeeperClose.cc' || echo '$(srcdir)/'`tests/TestZookeeperClose.cc zktest_st-TestZookeeperClose.obj: tests/TestZookeeperClose.cc $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zktest_st_CXXFLAGS) $(CXXFLAGS) -MT zktest_st-TestZookeeperClose.obj -MD -MP -MF $(DEPDIR)/zktest_st-TestZookeeperClose.Tpo -c -o zktest_st-TestZookeeperClose.obj `if test -f 'tests/TestZookeeperClose.cc'; then $(CYGPATH_W) 'tests/TestZookeeperClose.cc'; else $(CYGPATH_W) '$(srcdir)/tests/TestZookeeperClose.cc'; fi` $(am__mv) $(DEPDIR)/zktest_st-TestZookeeperClose.Tpo $(DEPDIR)/zktest_st-TestZookeeperClose.Po # source='tests/TestZookeeperClose.cc' object='zktest_st-TestZookeeperClose.obj' libtool=no \ # DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ # $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zktest_st_CXXFLAGS) $(CXXFLAGS) -c -o zktest_st-TestZookeeperClose.obj `if test -f 'tests/TestZookeeperClose.cc'; then $(CYGPATH_W) 'tests/TestZookeeperClose.cc'; else $(CYGPATH_W) '$(srcdir)/tests/TestZookeeperClose.cc'; fi` zktest_st-TestClient.o: tests/TestClient.cc $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zktest_st_CXXFLAGS) $(CXXFLAGS) -MT zktest_st-TestClient.o -MD -MP -MF $(DEPDIR)/zktest_st-TestClient.Tpo -c -o zktest_st-TestClient.o `test -f 'tests/TestClient.cc' || echo '$(srcdir)/'`tests/TestClient.cc $(am__mv) $(DEPDIR)/zktest_st-TestClient.Tpo $(DEPDIR)/zktest_st-TestClient.Po # source='tests/TestClient.cc' object='zktest_st-TestClient.o' libtool=no \ # DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ # $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zktest_st_CXXFLAGS) $(CXXFLAGS) -c -o zktest_st-TestClient.o `test -f 'tests/TestClient.cc' || echo '$(srcdir)/'`tests/TestClient.cc zktest_st-TestClient.obj: tests/TestClient.cc $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zktest_st_CXXFLAGS) $(CXXFLAGS) -MT zktest_st-TestClient.obj -MD -MP -MF $(DEPDIR)/zktest_st-TestClient.Tpo -c -o zktest_st-TestClient.obj `if test -f 'tests/TestClient.cc'; then $(CYGPATH_W) 'tests/TestClient.cc'; else $(CYGPATH_W) '$(srcdir)/tests/TestClient.cc'; fi` $(am__mv) $(DEPDIR)/zktest_st-TestClient.Tpo $(DEPDIR)/zktest_st-TestClient.Po # source='tests/TestClient.cc' object='zktest_st-TestClient.obj' libtool=no \ # DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ # $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zktest_st_CXXFLAGS) $(CXXFLAGS) -c -o zktest_st-TestClient.obj `if test -f 'tests/TestClient.cc'; then $(CYGPATH_W) 'tests/TestClient.cc'; else $(CYGPATH_W) '$(srcdir)/tests/TestClient.cc'; fi` zktest_st-TestWatchers.o: tests/TestWatchers.cc $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zktest_st_CXXFLAGS) $(CXXFLAGS) -MT zktest_st-TestWatchers.o -MD -MP -MF $(DEPDIR)/zktest_st-TestWatchers.Tpo -c -o zktest_st-TestWatchers.o `test -f 'tests/TestWatchers.cc' || echo '$(srcdir)/'`tests/TestWatchers.cc $(am__mv) $(DEPDIR)/zktest_st-TestWatchers.Tpo $(DEPDIR)/zktest_st-TestWatchers.Po # source='tests/TestWatchers.cc' object='zktest_st-TestWatchers.o' libtool=no \ # DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ # $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zktest_st_CXXFLAGS) $(CXXFLAGS) -c -o zktest_st-TestWatchers.o `test -f 'tests/TestWatchers.cc' || echo '$(srcdir)/'`tests/TestWatchers.cc zktest_st-TestWatchers.obj: tests/TestWatchers.cc $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zktest_st_CXXFLAGS) $(CXXFLAGS) -MT zktest_st-TestWatchers.obj -MD -MP -MF $(DEPDIR)/zktest_st-TestWatchers.Tpo -c -o zktest_st-TestWatchers.obj `if test -f 'tests/TestWatchers.cc'; then $(CYGPATH_W) 'tests/TestWatchers.cc'; else $(CYGPATH_W) '$(srcdir)/tests/TestWatchers.cc'; fi` $(am__mv) $(DEPDIR)/zktest_st-TestWatchers.Tpo $(DEPDIR)/zktest_st-TestWatchers.Po # source='tests/TestWatchers.cc' object='zktest_st-TestWatchers.obj' libtool=no \ # DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ # $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zktest_st_CXXFLAGS) $(CXXFLAGS) -c -o zktest_st-TestWatchers.obj `if test -f 'tests/TestWatchers.cc'; then $(CYGPATH_W) 'tests/TestWatchers.cc'; else $(CYGPATH_W) '$(srcdir)/tests/TestWatchers.cc'; fi` mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool config.lt install-pkgincludeHEADERS: $(pkginclude_HEADERS) @$(NORMAL_INSTALL) test -z "$(pkgincludedir)" || $(MKDIR_P) "$(DESTDIR)$(pkgincludedir)" @list='$(pkginclude_HEADERS)'; test -n "$(pkgincludedir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(pkgincludedir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(pkgincludedir)" || exit $$?; \ done uninstall-pkgincludeHEADERS: @$(NORMAL_UNINSTALL) @list='$(pkginclude_HEADERS)'; test -n "$(pkgincludedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ test -n "$$files" || exit 0; \ echo " ( cd '$(DESTDIR)$(pkgincludedir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(pkgincludedir)" && rm -f $$files ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 $(am__remove_distdir) dist-lzma: distdir tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma $(am__remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz $(am__remove_distdir) dist-tarZ: distdir tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__remove_distdir) dist-shar: distdir shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__remove_distdir) dist dist-all: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lzma*) \ unlzma -c $(distdir).tar.lzma | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir); chmod a+w $(distdir) mkdir $(distdir)/_build mkdir $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 $(am__remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @$(am__cd) '$(distuninstallcheck_dir)' \ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) check: check-am all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(HEADERS) config.h install-binPROGRAMS: install-libLTLIBRARIES installdirs: for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(pkgincludedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-binPROGRAMS clean-checkPROGRAMS clean-generic \ clean-libLTLIBRARIES clean-libtool clean-local \ clean-noinstLTLIBRARIES mostlyclean-am distclean: distclean-am -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-hdr distclean-libtool distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-pkgincludeHEADERS install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-libLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-libLTLIBRARIES \ uninstall-pkgincludeHEADERS .MAKE: all check-am install-am install-strip .PHONY: CTAGS GTAGS all all-am am--refresh check check-am clean \ clean-binPROGRAMS clean-checkPROGRAMS clean-generic \ clean-libLTLIBRARIES clean-libtool clean-local \ clean-noinstLTLIBRARIES ctags dist dist-all dist-bzip2 \ dist-gzip dist-lzma dist-shar dist-tarZ dist-xz dist-zip \ distcheck distclean distclean-compile distclean-generic \ distclean-hdr distclean-libtool distclean-tags distcleancheck \ distdir distuninstallcheck dvi dvi-am html html-am info \ info-am install install-am install-binPROGRAMS install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-libLTLIBRARIES install-man install-pdf \ install-pdf-am install-pkgincludeHEADERS install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \ uninstall-am uninstall-binPROGRAMS uninstall-libLTLIBRARIES \ uninstall-pkgincludeHEADERS #doxygen-ps: docs/c-client-src.ps #docs/c-client-src.ps: docs/c-client-src.tag # cd docs/latex; \ # rm -f *.aux *.toc *.idx *.ind *.ilg *.log *.out; \ # $(DX_LATEX) refman.tex; \ # $(MAKEINDEX_PATH) refman.idx; \ # $(DX_LATEX) refman.tex; \ # countdown=5; \ # while $(DX_EGREP) 'Rerun (LaTeX|to get cross-references right)' \ # refman.log > /dev/null 2>&1 \ # && test $$countdown -gt 0; do \ # $(DX_LATEX) refman.tex; \ # countdown=`expr $$countdown - 1`; \ # done; \ # $(DX_DVIPS) -o ../c-client-src.ps refman.dvi #doxygen-pdf: docs/c-client-src.pdf #docs/c-client-src.pdf: docs/c-client-src.tag # cd docs/latex; \ # rm -f *.aux *.toc *.idx *.ind *.ilg *.log *.out; \ # $(DX_PDFLATEX) refman.tex; \ # $(DX_MAKEINDEX) refman.idx; \ # $(DX_PDFLATEX) refman.tex; \ # countdown=5; \ # while $(DX_EGREP) 'Rerun (LaTeX|to get cross-references right)' \ # refman.log > /dev/null 2>&1 \ # && test $$countdown -gt 0; do \ # $(DX_PDFLATEX) refman.tex; \ # countdown=`expr $$countdown - 1`; \ # done; \ # mv refman.pdf ../c-client-src.pdf .PHONY: doxygen-run doxygen-doc $(DX_PS_GOAL) $(DX_PDF_GOAL) .INTERMEDIATE: doxygen-run $(DX_PS_GOAL) $(DX_PDF_GOAL) doxygen-run: docs/c-client-src.tag doxygen-doc: doxygen-run $(DX_PS_GOAL) $(DX_PDF_GOAL) docs/c-client-src.tag: $(DX_CONFIG) $(pkginclude_HEADERS) rm -rf docs $(DX_ENV) $(DX_DOXYGEN) $(srcdir)/$(DX_CONFIG) run-check: check ./zktest-st $(TEST_OPTIONS) ./zktest-mt $(TEST_OPTIONS) clean-local: clean-check $(RM) $(DX_CLEANFILES) clean-check: $(RM) $(nodist_zktest_st_OBJECTS) $(nodist_zktest_mt_OBJECTS) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT:
apache-2.0
warptrosse/sctp_server
README.md
24
SCTP Server ===========
apache-2.0
maestrodev/maestro-maven-plugin
src/maven_worker.rb
8897
# Copyright (c) 2013 MaestroDev. All rights reserved. require 'maestro_plugin' require 'maestro_shell' require 'open-uri' require 'xmlsimple' module MaestroDev module Plugin class MavenWorker < Maestro::MaestroWorker def execute validate_execute_parameters Maestro.log.info "Inputs: goals = #{@goals}" Maestro.log.debug "Using Maven version #{@mvn_version}" if !@mvn_version.empty? shell = Maestro::Util::Shell.new command = create_command shell.create_script(command) write_output("\nRunning command:\n----------\n#{command.chomp}\n----------\n") exit_code = shell.run_script_with_delegate(self, :on_output) if !exit_code.success? # Error executing maven # Lets see if we can make the error a little more specific. # Maven thoughtfully prefixes all lines with [ERROR] that might be useful to us... # so lets iunclude them in the error error_lines = shell.output.split(/\r\n|\n/).select { |line| line.start_with?('[ERROR]') } raise PluginError, "Maven failed executing goal list '#{@goals.empty? ? '[default]' : @goals}'\n" + error_lines.join("\n") end end def wget_latest_snapshot validate_snapshot_parameters Maestro.log.info "Inputs: path = #{@path}," \ " url = #{@base_url}," \ " packaging = #{@packaging}" maven_metadata_xml = get_maven_metadata_xml artifactId = maven_metadata_xml["artifactId"][0] unless maven_metadata_xml["versioning"].nil? or maven_metadata_xml["versioning"][0]["snapshot"][0]["timestamp"].nil? buildNumber = maven_metadata_xml["versioning"][0]["snapshot"][0]["buildNumber"][0] timestamp = maven_metadata_xml["versioning"][0]["snapshot"][0]["timestamp"][0] version = maven_metadata_xml["version"][0].gsub(/\-SNAPSHOT/,'') file = "#{artifactId}-#{version}-#{timestamp}-#{buildNumber}.#{@packaging}" else version = maven_metadata_xml["version"][0] file = "#{artifactId}-#{version}.#{@packaging}" end url = @base_url + "/#{file}" Maestro.log.debug "Removing Existing File At #{@path}/#{artifactId}.#{@packaging}" begin FileUtils.rm "#{@path}/#{artifactId}.#{@packaging}" rescue Exception end write_output("\nDownloading File From #{url}", :buffer => true) wget = Maestro::Util::Shell.new command = "LANG=C #{@wget_executable} --progress=dot #{url} -O #{@path}/#{artifactId}.#{@packaging} --user=#{@username} --password=#{@password}" wget.create_script(command) write_output("\nRunning command:\n----------\n#{command.chomp}\n----------\n") exit_code = wget.run_script_with_delegate(self, :on_output) write_output("\nDownloaded File #{url} To #{@path}/#{artifactId}.#{@packaging}", :buffer => true) if File.exists? "#{@path}/#{artifactId}.#{@packaging}" raise PluginError, "Failed to download #{url} to #{@path}/#{artifactId}.#{@packaging}" unless exit_code.success? end def on_output(text) write_output(text, :buffer => true) end ########### # PRIVATE # ########### private # because we want to be able to string stuff together with && # can't really test the executable. def valid_executable?(executable) Maestro::Util::Shell.run_command("#{executable} --version")[0].success? end def get_version result = Maestro::Util::Shell.run_command("#{@mvn_executable} -version") result[1].split("\n")[0].split(' (')[0].split(' ')[2] if result[0].success? end def validate_execute_parameters errors = [] @mvn_executable = get_field('maven_executable', 'mvn') @mvn_version = get_field('maven_version', '') @path = get_field('path') || get_field('scm_path') @goals = get_field('goals', '') @settingsfile = get_field('settingsfile', '') @profiles = get_field('profiles', '') @properties = get_field('properties', '') @environment = get_field('environment', '') @env = @environment.empty? ? "" : "#{Maestro::Util::Shell::ENV_EXPORT_COMMAND} #{@environment.gsub(/(&&|[;&])\s*$/, '')} && " if valid_executable?(@mvn_executable) if !@mvn_version.empty? version = get_version errors << "maven is the wrong version: #{version}. Expected: #{@mvn_version}" if version != @mvn_version end else errors << 'maven not installed' end errors << 'missing field path' if @path.nil? errors << "not found path '#{@path}'" if [email protected]? && !File.exist?(@path) if [email protected]? if !File.exists?(@settingsfile) errors << "specified settings file (#{@settingsfile}) not found" end end process_goals_field process_profiles_field process_properties_field if !errors.empty? raise ConfigError, "Configuration errors: #{errors.join(', ')}" end end def validate_snapshot_parameters errors = [] @base_url = get_field('url', '') @path = get_field('path', '') @username = get_field('username', '') @password = get_field('password', '') @packaging = get_field('packaging', '') @wget_executable = get_field('wget_executable', 'wget') errors << 'missing field url' if @base_url.empty? errors << 'missing field path' if @path.empty? errors << "path not found '#{@path}'" if [email protected]? && !File.exist?(@path) errors << 'missing field username' if @username.empty? errors << 'missing field password' if @password.empty? errors << 'missing field packaging' if @packaging.empty? errors << 'wget not installed' unless valid_executable?(@wget_executable) if !errors.empty? raise ConfigError, "Configuration errors: #{errors.join(', ')}" end end def process_goals_field begin if is_json(@goals) @goals = JSON.parse(@goals) if @goals.is_a? String end rescue Exception end if @goals.is_a? Array @goals = @goals.join(' ') end end def process_profiles_field begin if is_json(@profiles) @profiles = JSON.parse(@profiles) if @profiles.is_a? String end rescue Exception end if @profiles.is_a? Array @profiles.delete_if{ |profile| profile.empty? } @profiles = @profiles.join(',') end Maestro.log.debug "Enabling Maven profiles: #{@profiles}" @profiles = " -P#{@profiles}" unless @profiles.empty? end def process_properties_field begin if is_json(@properties) @properties = JSON.parse(@properties) if @properties.is_a? String end rescue Exception end if @properties.is_a? Array @properties.delete_if{ |property| property.empty? } @properties = @properties.map{|x| "-D#{x}"}.join(' ') end Maestro.log.debug "Using Maven properties: #{@properties}" end def create_command settings = "--settings #{@settingsfile} " if [email protected]? shell_command = "#{@env}cd #{@path} && #{@mvn_executable} -B #{settings}#{@goals}#{@profiles} #{@properties}" set_field('command', shell_command) Maestro.log.debug("Running #{shell_command}") shell_command end def get_maven_metadata_xml write_output "\nRequesting maven-metadata.xml With Username #{@username} And Password" begin response = open(@base_url + "/maven-metadata.xml", :http_basic_authentication => [@username, @password]) raise PluginError, 'Failed To Retrieve maven-metadata.xml (no response from server)' unless response case response.status[0] when "200" maven_metadata_xml = XmlSimple.xml_in(response.read) Maestro.log.debug "\nResponse Received #{response.status[0]}\n#{maven_metadata_xml}" else raise PluginError, "Failed To Retrieve maven-metadata.xml #{response}" end raise PluginError, "Missing Version Or ArtifactID " if maven_metadata_xml["artifactId"].nil? or maven_metadata_xml["version"].nil? rescue Timeout::Error raise PluginError, 'Failed To Retrieve maven-metadata.xml (timeout)' rescue raise PluginError, 'Failed To Retrieve maven-metadata.xml (unable to connect to server)' end maven_metadata_xml end end end end
apache-2.0
hemingwang0902/doc.javake.cn
mybatis-generator-doc-zh/cobertura/org.mybatis.generator.codegen.ibatis2.dao.elements.SelectByExampleWithoutBLOBsMethodGenerator.html
29243
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <title>Coverage Report</title> <link title="Style" type="text/css" rel="stylesheet" href="css/main.css"/> <script type="text/javascript" src="js/popup.js"></script> </head> <body> <h5>Coverage Report - org.mybatis.generator.codegen.ibatis2.dao.elements.SelectByExampleWithoutBLOBsMethodGenerator</h5> <div class="separator">&nbsp;</div> <table class="report"> <thead><tr> <td class="heading">Classes in this File</td> <td class="heading"><a class="dfn" href="help.html" onclick="popupwindow('help.html'); return false;">Line Coverage</a></td> <td class="heading"><a class="dfn" href="help.html" onclick="popupwindow('help.html'); return false;">Branch Coverage</a></td> <td class="heading"><a class="dfn" href="help.html" onclick="popupwindow('help.html'); return false;">Complexity</a></td></tr></thead> <tr><td><a href="org.mybatis.generator.codegen.ibatis2.dao.elements.SelectByExampleWithoutBLOBsMethodGenerator.html">SelectByExampleWithoutBLOBsMethodGenerator</a></td><td><table cellpadding="0px" cellspacing="0px" class="percentgraph"><tr class="percentgraph"><td align="right" class="percentgraph" width="40">0%</td><td class="percentgraph"><div class="percentgraph"><div class="greenbar" style="width:0px"><span class="text">0/47</span></div></div></td></tr></table></td><td><table cellpadding="0px" cellspacing="0px" class="percentgraph"><tr class="percentgraph"><td align="right" class="percentgraph" width="40">0%</td><td class="percentgraph"><div class="percentgraph"><div class="greenbar" style="width:0px"><span class="text">0/16</span></div></div></td></tr></table></td><td class="value"><span class="hidden">3.25;</span>3.25</td></tr> </table> <div class="separator">&nbsp;</div> <table cellspacing="0" cellpadding="0" class="src"> <tr> <td class="numLine">&nbsp;1</td> <td class="nbHits">&nbsp;</td> <td class="src"><pre class="src">&nbsp;<span class="comment">/*</span></pre></td></tr> <tr> <td class="numLine">&nbsp;2</td> <td class="nbHits">&nbsp;</td> <td class="src"><pre class="src">&nbsp;<span class="comment"> * Copyright 2008 The Apache Software Foundation</span></pre></td></tr> <tr> <td class="numLine">&nbsp;3</td> <td class="nbHits">&nbsp;</td> <td class="src"><pre class="src">&nbsp;<span class="comment"> *</span></pre></td></tr> <tr> <td class="numLine">&nbsp;4</td> <td class="nbHits">&nbsp;</td> <td class="src"><pre class="src">&nbsp;<span class="comment"> * Licensed under the Apache License, Version 2.0 (the "License");</span></pre></td></tr> <tr> <td class="numLine">&nbsp;5</td> <td class="nbHits">&nbsp;</td> <td class="src"><pre class="src">&nbsp;<span class="comment"> * you may not use this file except in compliance with the License.</span></pre></td></tr> <tr> <td class="numLine">&nbsp;6</td> <td class="nbHits">&nbsp;</td> <td class="src"><pre class="src">&nbsp;<span class="comment"> * You may obtain a copy of the License at</span></pre></td></tr> <tr> <td class="numLine">&nbsp;7</td> <td class="nbHits">&nbsp;</td> <td class="src"><pre class="src">&nbsp;<span class="comment"> *</span></pre></td></tr> <tr> <td class="numLine">&nbsp;8</td> <td class="nbHits">&nbsp;</td> <td class="src"><pre class="src">&nbsp;<span class="comment"> * http://www.apache.org/licenses/LICENSE-2.0</span></pre></td></tr> <tr> <td class="numLine">&nbsp;9</td> <td class="nbHits">&nbsp;</td> <td class="src"><pre class="src">&nbsp;<span class="comment"> *</span></pre></td></tr> <tr> <td class="numLine">&nbsp;10</td> <td class="nbHits">&nbsp;</td> <td class="src"><pre class="src">&nbsp;<span class="comment"> * Unless required by applicable law or agreed to in writing, software</span></pre></td></tr> <tr> <td class="numLine">&nbsp;11</td> <td class="nbHits">&nbsp;</td> <td class="src"><pre class="src">&nbsp;<span class="comment"> * distributed under the License is distributed on an "AS IS" BASIS,</span></pre></td></tr> <tr> <td class="numLine">&nbsp;12</td> <td class="nbHits">&nbsp;</td> <td class="src"><pre class="src">&nbsp;<span class="comment"> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span></pre></td></tr> <tr> <td class="numLine">&nbsp;13</td> <td class="nbHits">&nbsp;</td> <td class="src"><pre class="src">&nbsp;<span class="comment"> * See the License for the specific language governing permissions and</span></pre></td></tr> <tr> <td class="numLine">&nbsp;14</td> <td class="nbHits">&nbsp;</td> <td class="src"><pre class="src">&nbsp;<span class="comment"> * limitations under the License.</span></pre></td></tr> <tr> <td class="numLine">&nbsp;15</td> <td class="nbHits">&nbsp;</td> <td class="src"><pre class="src">&nbsp;<span class="comment"> */</span></pre></td></tr> <tr> <td class="numLine">&nbsp;16</td> <td class="nbHits">&nbsp;</td> <td class="src"><pre class="src">&nbsp;<span class="keyword">package</span> org.mybatis.generator.codegen.ibatis2.dao.elements;</pre></td></tr> <tr> <td class="numLine">&nbsp;17</td> <td class="nbHits">&nbsp;</td> <td class="src"><pre class="src">&nbsp;</pre></td></tr> <tr> <td class="numLine">&nbsp;18</td> <td class="nbHits">&nbsp;</td> <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> <span class="keyword">static</span> org.mybatis.generator.internal.util.messages.Messages.getString;</pre></td></tr> <tr> <td class="numLine">&nbsp;19</td> <td class="nbHits">&nbsp;</td> <td class="src"><pre class="src">&nbsp;</pre></td></tr> <tr> <td class="numLine">&nbsp;20</td> <td class="nbHits">&nbsp;</td> <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> java.util.Set;</pre></td></tr> <tr> <td class="numLine">&nbsp;21</td> <td class="nbHits">&nbsp;</td> <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> java.util.TreeSet;</pre></td></tr> <tr> <td class="numLine">&nbsp;22</td> <td class="nbHits">&nbsp;</td> <td class="src"><pre class="src">&nbsp;</pre></td></tr> <tr> <td class="numLine">&nbsp;23</td> <td class="nbHits">&nbsp;</td> <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> org.mybatis.generator.api.dom.java.FullyQualifiedJavaType;</pre></td></tr> <tr> <td class="numLine">&nbsp;24</td> <td class="nbHits">&nbsp;</td> <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> org.mybatis.generator.api.dom.java.Interface;</pre></td></tr> <tr> <td class="numLine">&nbsp;25</td> <td class="nbHits">&nbsp;</td> <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> org.mybatis.generator.api.dom.java.JavaVisibility;</pre></td></tr> <tr> <td class="numLine">&nbsp;26</td> <td class="nbHits">&nbsp;</td> <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> org.mybatis.generator.api.dom.java.Method;</pre></td></tr> <tr> <td class="numLine">&nbsp;27</td> <td class="nbHits">&nbsp;</td> <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> org.mybatis.generator.api.dom.java.Parameter;</pre></td></tr> <tr> <td class="numLine">&nbsp;28</td> <td class="nbHits">&nbsp;</td> <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> org.mybatis.generator.api.dom.java.TopLevelClass;</pre></td></tr> <tr> <td class="numLine">&nbsp;29</td> <td class="nbHits">&nbsp;</td> <td class="src"><pre class="src">&nbsp;</pre></td></tr> <tr> <td class="numLine">&nbsp;30</td> <td class="nbHits">&nbsp;</td> <td class="src"><pre class="src">&nbsp;<span class="comment">/**</span></pre></td></tr> <tr> <td class="numLine">&nbsp;31</td> <td class="nbHits">&nbsp;</td> <td class="src"><pre class="src">&nbsp;<span class="comment"> * </span></pre></td></tr> <tr> <td class="numLine">&nbsp;32</td> <td class="nbHits">&nbsp;</td> <td class="src"><pre class="src">&nbsp;<span class="comment"> * @author Jeff Butler</span></pre></td></tr> <tr> <td class="numLine">&nbsp;33</td> <td class="nbHits">&nbsp;</td> <td class="src"><pre class="src">&nbsp;<span class="comment"> * </span></pre></td></tr> <tr> <td class="numLine">&nbsp;34</td> <td class="nbHits">&nbsp;</td> <td class="src"><pre class="src">&nbsp;<span class="comment"> */</span></pre></td></tr> <tr> <td class="numLine">&nbsp;35</td> <td class="nbHits">&nbsp;</td> <td class="src"><pre class="src">&nbsp;<span class="keyword">public</span> <span class="keyword">class</span> SelectByExampleWithoutBLOBsMethodGenerator <span class="keyword">extends</span></pre></td></tr> <tr> <td class="numLine">&nbsp;36</td> <td class="nbHits">&nbsp;</td> <td class="src"><pre class="src">&nbsp; AbstractDAOElementGenerator {</pre></td></tr> <tr> <td class="numLine">&nbsp;37</td> <td class="nbHits">&nbsp;</td> <td class="src"><pre class="src">&nbsp;</pre></td></tr> <tr> <td class="numLine">&nbsp;38</td> <td class="nbHits">&nbsp;</td> <td class="src"><pre class="src">&nbsp; <span class="keyword">private</span> <span class="keyword">boolean</span> generateForJava5;</pre></td></tr> <tr> <td class="numLine">&nbsp;39</td> <td class="nbHits">&nbsp;</td> <td class="src"><pre class="src">&nbsp;</pre></td></tr> <tr> <td class="numLine">&nbsp;40</td> <td class="nbHits">&nbsp;</td> <td class="src"><pre class="src">&nbsp; <span class="keyword">public</span> SelectByExampleWithoutBLOBsMethodGenerator(<span class="keyword">boolean</span> generateForJava5) {</pre></td></tr> <tr> <td class="numLineCover">&nbsp;41</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; <span class="keyword">super</span>();</span></pre></td></tr> <tr> <td class="numLineCover">&nbsp;42</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; <span class="keyword">this</span>.generateForJava5 = generateForJava5;</span></pre></td></tr> <tr> <td class="numLineCover">&nbsp;43</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; }</span></pre></td></tr> <tr> <td class="numLine">&nbsp;44</td> <td class="nbHits">&nbsp;</td> <td class="src"><pre class="src">&nbsp;</pre></td></tr> <tr> <td class="numLine">&nbsp;45</td> <td class="nbHits">&nbsp;</td> <td class="src"><pre class="src">&nbsp; @Override</pre></td></tr> <tr> <td class="numLine">&nbsp;46</td> <td class="nbHits">&nbsp;</td> <td class="src"><pre class="src">&nbsp; <span class="keyword">public</span> <span class="keyword">void</span> addImplementationElements(TopLevelClass topLevelClass) {</pre></td></tr> <tr> <td class="numLineCover">&nbsp;47</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; Set&lt;FullyQualifiedJavaType&gt; importedTypes = <span class="keyword">new</span> TreeSet&lt;FullyQualifiedJavaType&gt;();</span></pre></td></tr> <tr> <td class="numLineCover">&nbsp;48</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; Method method = getMethodShell(importedTypes);</span></pre></td></tr> <tr> <td class="numLine">&nbsp;49</td> <td class="nbHits">&nbsp;</td> <td class="src"><pre class="src">&nbsp;</pre></td></tr> <tr> <td class="numLineCover">&nbsp;50</td> <td class="nbHitsUncovered"><a title="Line 50: Conditional coverage 0% (0/2).">&nbsp;0</a></td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;<a title="Line 50: Conditional coverage 0% (0/2)."> <span class="keyword">if</span> (generateForJava5) {</a></span></pre></td></tr> <tr> <td class="numLineCover">&nbsp;51</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; method.addSuppressTypeWarningsAnnotation();</span></pre></td></tr> <tr> <td class="numLine">&nbsp;52</td> <td class="nbHits">&nbsp;</td> <td class="src"><pre class="src">&nbsp; }</pre></td></tr> <tr> <td class="numLine">&nbsp;53</td> <td class="nbHits">&nbsp;</td> <td class="src"><pre class="src">&nbsp;</pre></td></tr> <tr> <td class="numLineCover">&nbsp;54</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; StringBuilder sb = <span class="keyword">new</span> StringBuilder();</span></pre></td></tr> <tr> <td class="numLineCover">&nbsp;55</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; sb.append(method.getReturnType().getShortName());</span></pre></td></tr> <tr> <td class="numLineCover">&nbsp;56</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; sb.append(<span class="string">" list = "</span>); <span class="comment">//$NON-NLS-1$</span></span></pre></td></tr> <tr> <td class="numLineCover">&nbsp;57</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; sb.append(daoTemplate.getQueryForListMethod(introspectedTable</span></pre></td></tr> <tr> <td class="numLine">&nbsp;58</td> <td class="nbHits">&nbsp;</td> <td class="src"><pre class="src">&nbsp; .getIbatis2SqlMapNamespace(), introspectedTable</pre></td></tr> <tr> <td class="numLine">&nbsp;59</td> <td class="nbHits">&nbsp;</td> <td class="src"><pre class="src">&nbsp; .getSelectByExampleStatementId(), <span class="string">"example"</span>)); <span class="comment">//$NON-NLS-1$</span></pre></td></tr> <tr> <td class="numLineCover">&nbsp;60</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; method.addBodyLine(sb.toString());</span></pre></td></tr> <tr> <td class="numLineCover">&nbsp;61</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; method.addBodyLine(<span class="string">"return list;"</span>); <span class="comment">//$NON-NLS-1$</span></span></pre></td></tr> <tr> <td class="numLine">&nbsp;62</td> <td class="nbHits">&nbsp;</td> <td class="src"><pre class="src">&nbsp;</pre></td></tr> <tr> <td class="numLineCover">&nbsp;63</td> <td class="nbHitsUncovered"><a title="Line 63: Conditional coverage 0% (0/2).">&nbsp;0</a></td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;<a title="Line 63: Conditional coverage 0% (0/2)."> <span class="keyword">if</span> (context.getPlugins()</a></span></pre></td></tr> <tr> <td class="numLine">&nbsp;64</td> <td class="nbHits">&nbsp;</td> <td class="src"><pre class="src">&nbsp; .clientSelectByExampleWithoutBLOBsMethodGenerated(method,</pre></td></tr> <tr> <td class="numLine">&nbsp;65</td> <td class="nbHits">&nbsp;</td> <td class="src"><pre class="src">&nbsp; topLevelClass, introspectedTable)) {</pre></td></tr> <tr> <td class="numLineCover">&nbsp;66</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; topLevelClass.addImportedTypes(importedTypes);</span></pre></td></tr> <tr> <td class="numLineCover">&nbsp;67</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; topLevelClass.addMethod(method);</span></pre></td></tr> <tr> <td class="numLine">&nbsp;68</td> <td class="nbHits">&nbsp;</td> <td class="src"><pre class="src">&nbsp; }</pre></td></tr> <tr> <td class="numLineCover">&nbsp;69</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; }</span></pre></td></tr> <tr> <td class="numLine">&nbsp;70</td> <td class="nbHits">&nbsp;</td> <td class="src"><pre class="src">&nbsp;</pre></td></tr> <tr> <td class="numLine">&nbsp;71</td> <td class="nbHits">&nbsp;</td> <td class="src"><pre class="src">&nbsp; @Override</pre></td></tr> <tr> <td class="numLine">&nbsp;72</td> <td class="nbHits">&nbsp;</td> <td class="src"><pre class="src">&nbsp; <span class="keyword">public</span> <span class="keyword">void</span> addInterfaceElements(Interface interfaze) {</pre></td></tr> <tr> <td class="numLineCover">&nbsp;73</td> <td class="nbHitsUncovered"><a title="Line 73: Conditional coverage 0% (0/2).">&nbsp;0</a></td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;<a title="Line 73: Conditional coverage 0% (0/2)."> <span class="keyword">if</span> (getExampleMethodVisibility() == JavaVisibility.PUBLIC) {</a></span></pre></td></tr> <tr> <td class="numLineCover">&nbsp;74</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; Set&lt;FullyQualifiedJavaType&gt; importedTypes = <span class="keyword">new</span> TreeSet&lt;FullyQualifiedJavaType&gt;();</span></pre></td></tr> <tr> <td class="numLineCover">&nbsp;75</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; Method method = getMethodShell(importedTypes);</span></pre></td></tr> <tr> <td class="numLine">&nbsp;76</td> <td class="nbHits">&nbsp;</td> <td class="src"><pre class="src">&nbsp;</pre></td></tr> <tr> <td class="numLineCover">&nbsp;77</td> <td class="nbHitsUncovered"><a title="Line 77: Conditional coverage 0% (0/2).">&nbsp;0</a></td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;<a title="Line 77: Conditional coverage 0% (0/2)."> <span class="keyword">if</span> (context.getPlugins()</a></span></pre></td></tr> <tr> <td class="numLine">&nbsp;78</td> <td class="nbHits">&nbsp;</td> <td class="src"><pre class="src">&nbsp; .clientSelectByExampleWithoutBLOBsMethodGenerated(method,</pre></td></tr> <tr> <td class="numLine">&nbsp;79</td> <td class="nbHits">&nbsp;</td> <td class="src"><pre class="src">&nbsp; interfaze, introspectedTable)) {</pre></td></tr> <tr> <td class="numLineCover">&nbsp;80</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; interfaze.addImportedTypes(importedTypes);</span></pre></td></tr> <tr> <td class="numLineCover">&nbsp;81</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; interfaze.addMethod(method);</span></pre></td></tr> <tr> <td class="numLine">&nbsp;82</td> <td class="nbHits">&nbsp;</td> <td class="src"><pre class="src">&nbsp; }</pre></td></tr> <tr> <td class="numLine">&nbsp;83</td> <td class="nbHits">&nbsp;</td> <td class="src"><pre class="src">&nbsp; }</pre></td></tr> <tr> <td class="numLineCover">&nbsp;84</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; }</span></pre></td></tr> <tr> <td class="numLine">&nbsp;85</td> <td class="nbHits">&nbsp;</td> <td class="src"><pre class="src">&nbsp;</pre></td></tr> <tr> <td class="numLine">&nbsp;86</td> <td class="nbHits">&nbsp;</td> <td class="src"><pre class="src">&nbsp; <span class="keyword">private</span> Method getMethodShell(Set&lt;FullyQualifiedJavaType&gt; importedTypes) {</pre></td></tr> <tr> <td class="numLineCover">&nbsp;87</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; FullyQualifiedJavaType type = <span class="keyword">new</span> FullyQualifiedJavaType(</span></pre></td></tr> <tr> <td class="numLine">&nbsp;88</td> <td class="nbHits">&nbsp;</td> <td class="src"><pre class="src">&nbsp; introspectedTable.getExampleType());</pre></td></tr> <tr> <td class="numLineCover">&nbsp;89</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; importedTypes.add(type);</span></pre></td></tr> <tr> <td class="numLineCover">&nbsp;90</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; importedTypes.add(FullyQualifiedJavaType.getNewListInstance());</span></pre></td></tr> <tr> <td class="numLine">&nbsp;91</td> <td class="nbHits">&nbsp;</td> <td class="src"><pre class="src">&nbsp;</pre></td></tr> <tr> <td class="numLineCover">&nbsp;92</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; Method method = <span class="keyword">new</span> Method();</span></pre></td></tr> <tr> <td class="numLineCover">&nbsp;93</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; method.setVisibility(getExampleMethodVisibility());</span></pre></td></tr> <tr> <td class="numLine">&nbsp;94</td> <td class="nbHits">&nbsp;</td> <td class="src"><pre class="src">&nbsp;</pre></td></tr> <tr> <td class="numLineCover">&nbsp;95</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; FullyQualifiedJavaType returnType = FullyQualifiedJavaType</span></pre></td></tr> <tr> <td class="numLine">&nbsp;96</td> <td class="nbHits">&nbsp;</td> <td class="src"><pre class="src">&nbsp; .getNewListInstance();</pre></td></tr> <tr> <td class="numLine">&nbsp;97</td> <td class="nbHits">&nbsp;</td> <td class="src"><pre class="src">&nbsp; ;</pre></td></tr> <tr> <td class="numLineCover">&nbsp;98</td> <td class="nbHitsUncovered"><a title="Line 98: Conditional coverage 0% (0/2).">&nbsp;0</a></td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;<a title="Line 98: Conditional coverage 0% (0/2)."> <span class="keyword">if</span> (generateForJava5) {</a></span></pre></td></tr> <tr> <td class="numLine">&nbsp;99</td> <td class="nbHits">&nbsp;</td> <td class="src"><pre class="src">&nbsp; FullyQualifiedJavaType fqjt;</pre></td></tr> <tr> <td class="numLineCover">&nbsp;100</td> <td class="nbHitsUncovered"><a title="Line 100: Conditional coverage 0% (0/2).">&nbsp;0</a></td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;<a title="Line 100: Conditional coverage 0% (0/2)."> <span class="keyword">if</span> (introspectedTable.getRules().generateBaseRecordClass()) {</a></span></pre></td></tr> <tr> <td class="numLineCover">&nbsp;101</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; fqjt = <span class="keyword">new</span> FullyQualifiedJavaType(introspectedTable</span></pre></td></tr> <tr> <td class="numLine">&nbsp;102</td> <td class="nbHits">&nbsp;</td> <td class="src"><pre class="src">&nbsp; .getBaseRecordType());</pre></td></tr> <tr> <td class="numLineCover">&nbsp;103</td> <td class="nbHitsUncovered"><a title="Line 103: Conditional coverage 0% (0/2).">&nbsp;0</a></td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;<a title="Line 103: Conditional coverage 0% (0/2)."> } <span class="keyword">else</span> <span class="keyword">if</span> (introspectedTable.getRules().generatePrimaryKeyClass()) {</a></span></pre></td></tr> <tr> <td class="numLineCover">&nbsp;104</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; fqjt = <span class="keyword">new</span> FullyQualifiedJavaType(introspectedTable</span></pre></td></tr> <tr> <td class="numLine">&nbsp;105</td> <td class="nbHits">&nbsp;</td> <td class="src"><pre class="src">&nbsp; .getPrimaryKeyType());</pre></td></tr> <tr> <td class="numLine">&nbsp;106</td> <td class="nbHits">&nbsp;</td> <td class="src"><pre class="src">&nbsp; } <span class="keyword">else</span> {</pre></td></tr> <tr> <td class="numLineCover">&nbsp;107</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; <span class="keyword">throw</span> <span class="keyword">new</span> RuntimeException(getString(<span class="string">"RuntimeError.12"</span>)); <span class="comment">//$NON-NLS-1$</span></span></pre></td></tr> <tr> <td class="numLine">&nbsp;108</td> <td class="nbHits">&nbsp;</td> <td class="src"><pre class="src">&nbsp; }</pre></td></tr> <tr> <td class="numLine">&nbsp;109</td> <td class="nbHits">&nbsp;</td> <td class="src"><pre class="src">&nbsp;</pre></td></tr> <tr> <td class="numLineCover">&nbsp;110</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; importedTypes.add(fqjt);</span></pre></td></tr> <tr> <td class="numLineCover">&nbsp;111</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; returnType.addTypeArgument(fqjt);</span></pre></td></tr> <tr> <td class="numLine">&nbsp;112</td> <td class="nbHits">&nbsp;</td> <td class="src"><pre class="src">&nbsp; }</pre></td></tr> <tr> <td class="numLine">&nbsp;113</td> <td class="nbHits">&nbsp;</td> <td class="src"><pre class="src">&nbsp;</pre></td></tr> <tr> <td class="numLineCover">&nbsp;114</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; method.setReturnType(returnType);</span></pre></td></tr> <tr> <td class="numLine">&nbsp;115</td> <td class="nbHits">&nbsp;</td> <td class="src"><pre class="src">&nbsp;</pre></td></tr> <tr> <td class="numLineCover">&nbsp;116</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; method.setName(getDAOMethodNameCalculator()</span></pre></td></tr> <tr> <td class="numLine">&nbsp;117</td> <td class="nbHits">&nbsp;</td> <td class="src"><pre class="src">&nbsp; .getSelectByExampleWithoutBLOBsMethodName(introspectedTable));</pre></td></tr> <tr> <td class="numLineCover">&nbsp;118</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; method.addParameter(<span class="keyword">new</span> Parameter(type, <span class="string">"example"</span>)); <span class="comment">//$NON-NLS-1$</span></span></pre></td></tr> <tr> <td class="numLine">&nbsp;119</td> <td class="nbHits">&nbsp;</td> <td class="src"><pre class="src">&nbsp;</pre></td></tr> <tr> <td class="numLineCover">&nbsp;120</td> <td class="nbHitsUncovered"><a title="Line 120: Conditional coverage 0% (0/2).">&nbsp;0</a></td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;<a title="Line 120: Conditional coverage 0% (0/2)."> <span class="keyword">for</span> (FullyQualifiedJavaType fqjt : daoTemplate.getCheckedExceptions()) {</a></span></pre></td></tr> <tr> <td class="numLineCover">&nbsp;121</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; method.addException(fqjt);</span></pre></td></tr> <tr> <td class="numLineCover">&nbsp;122</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; importedTypes.add(fqjt);</span></pre></td></tr> <tr> <td class="numLineCover">&nbsp;123</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; }</span></pre></td></tr> <tr> <td class="numLine">&nbsp;124</td> <td class="nbHits">&nbsp;</td> <td class="src"><pre class="src">&nbsp;</pre></td></tr> <tr> <td class="numLineCover">&nbsp;125</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; context.getCommentGenerator().addGeneralMethodComment(method,</span></pre></td></tr> <tr> <td class="numLine">&nbsp;126</td> <td class="nbHits">&nbsp;</td> <td class="src"><pre class="src">&nbsp; introspectedTable);</pre></td></tr> <tr> <td class="numLine">&nbsp;127</td> <td class="nbHits">&nbsp;</td> <td class="src"><pre class="src">&nbsp;</pre></td></tr> <tr> <td class="numLineCover">&nbsp;128</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; <span class="keyword">return</span> method;</span></pre></td></tr> <tr> <td class="numLine">&nbsp;129</td> <td class="nbHits">&nbsp;</td> <td class="src"><pre class="src">&nbsp; }</pre></td></tr> <tr> <td class="numLine">&nbsp;130</td> <td class="nbHits">&nbsp;</td> <td class="src"><pre class="src">&nbsp;}</pre></td></tr> </table> <div class="footer">Report generated by <a href="http://cobertura.sourceforge.net/" target="_top">Cobertura</a> 2.0.3 on 14-12-20 上午9:21.</div> </body> </html>
apache-2.0
LeoBrilliant/OpenTS
TradingRecord.h
2463
/* * TradingRecord.h * * Created on: 2016Äê5ÔÂ2ÈÕ * Author: LeoBrilliant */ #ifndef TRADINGRECORD_H_ #define TRADINGRECORD_H_ #include "RightTimePoint.h" #include "Constants.h" #include "Types.h" #include <string> using namespace std; using namespace constants; class TradingRecord { public: TradingRecord(); TradingRecord(IntIDType recID, IntIDType clientID, RecordType recType, StringType instID, DirectionType direction, OffsetType offset, PriceType price, VolumeType volume, IntIDType orderID, IntIDType localOrderID ); ~TradingRecord(); private: IntIDType RecID; IntIDType ClientID; RecordType RecType; // RightTimePoint ConfirmedTime; // RightTimePoint UpdateTime; //ºÏÔ¼ºÅ StringType InstrumentID; //·½Ïò DirectionType Direction; //¿ªÆ½±êÖ¾ OffsetType OffsetFlag; //¼Û¸ñ PriceType Price; //ÊÖÊý VolumeType Volume; //±¨µ¥±àºÅ IntIDType OrderID; //±¾µØ±¨µ¥±àºÅ IntIDType LocalOrderID; //½»Ò×ÈÕ //³É½»Ê±¼ä //RightTimePoint OrderTimePoint; RightTimePoint InsertTime; static IntIDType RecordCounter; public: static IntIDType GetRecordCounter(); static IntIDType IncRecordCounter(); IntIDType GetClientID() const; VoidType SetClientID(IntIDType clientID); // const RightTimePoint& GetConfirmedTime() const; // VoidType SetConfirmedTime(RightTimePoint& confirmedTime); // VoidType SetConfirmedTime(); const RightTimePoint& GetInsertTime() const; VoidType SetInsertTime(RightTimePoint& insertTime); VoidType SetInsertTime(); IntIDType GetRecordID() const; VoidType SetRecordID(int recID = RecordCounter); //VoidType SetInstructionID(); // const RightTimePoint& GetUpdateTime() const; // VoidType SetUpdateTime(RightTimePoint& updateTime); // VoidType SetUpdateTime(); RecordType GetRecType() const; // VoidType SetRecType(RecordType instType); DirectionType GetDirection() const; VoidType SetDirection(DirectionType direction); IntIDType GetLocalOrderID() const; VoidType SetLocalOrderID(IntIDType localOrderID); OffsetType GetOffsetFlag() const; VoidType SetOffsetFlag(OffsetType offsetFlag); IntIDType GetOrderID() const; VoidType SetOrderID(IntIDType orderID); PriceType GetTradingPrice() const; VoidType SetTradingPrice(PriceType tradingPrice); VolumeType GetVolume() const; VoidType SetVolume(VolumeType volume); }; #endif /* TRADINGRECORD_H_ */
apache-2.0
adrienManikon/docmanager
src/SW/DocManagerBundle/Resources/public/js/upload.js
4586
var nbinput = 1; var $collectionHolder; $(function() { var $alreadyUsed = $("#alreadyExistVar").html(); if ($alreadyUsed) { showDialog("#some-exists-dialog"); } // Get the ul that holds the collection of tags $collectionHolder = $('#inputBlock'); // count the current form inputs we have (e.g. 2), use that as the new // index when inserting a new item (e.g. 2) $collectionHolder.data('index', $collectionHolder.find('.fileInput').length); $('#newInputButton').on('click', function(e) { if (nbinput < 5) { // prevent the link from creating a "#" on the URL e.preventDefault(); // add a new tag form (see next code block) addTagForm($collectionHolder); } else { showDialog("#limitFileDialog"); } }); }); $("#confirmOverride").click(function(){ $("#upload-block form").submit(); }); function changeInputFile(element) { var lineInput = $(element).parent().parent().parent(); var filename = $(element).val(); var n = filename.lastIndexOf('.'); var format = filename.substring(n + 1); $('.input-format', lineInput).val(format); $(element).parent().addClass("bg-green"); $(element).parent().removeClass("bg-gray"); } function addTagForm($collectionHolder) { // Get the data-prototype explained earlier var prototype = $collectionHolder.data('prototype'); // get the new index var index = $collectionHolder.data('index'); // Replace '__name__' in the prototype's HTML to // instead be a number based on how many items we have var newForm = prototype.replace(/__name__/g, index); // increase the index with one for the next item $collectionHolder.data('index', index + 1); var $newFormLi = $('<div></div>').append(newForm); var newBlock =$('<div id="lineInput_' + (index+1) + '" class="row cells12 fileInput"></div>'); $('input', $newFormLi).each(function(index, element){ var name = element.name; var $block = $('<div class="input-control text full-size"></div>').append(element); if (contains(name, 'category') || contains(name, 'creator') || contains(name, 'nameAlreadyUsed')) return; if (contains(name, 'initials') || contains(name, 'date')) { $block = $('<div class="cell colspan2"></div>').append($block); if(contains(name, 'initials')) { $('input', $block).val("AM"); } if(contains(name, 'date')) { $('input', $block).val($('#sw_docmanagerbundle_uploadsession_documents_0_date').val()); } } else if (contains(name, 'name')) { $block = $('<div class="cell colspan4"></div>').append($block); } else if (contains(name, 'format') || contains(name, 'code')) { $block = $('<div class="cell colspan1"></div>').append($block); if(contains(name, 'code')) { $('input', $block).val($('#sw_docmanagerbundle_uploadsession_documents_0_code').val()); $('input', $block).attr("readonly","readonly"); } if(contains(name, 'format')) { $('input', $block).attr("class",'input-format'); } } else if (contains(name, 'file')) { $('input', $block).attr("onchange",'changeInputFile(this)'); $block = $('<div class="input-control full-size input-file-custom button full-size bg-gray fg-white">Datei</div>').append(element); $block = $('<div class="cell colspan1"></div>').append($block); } else { return true; } newBlock.append($block); }); var $blockRemove = '<div class="cell colspan1 v-align-middle padding10">'; $blockRemove += '<button onclick="removeLine(lineInput_' + (index+1) + ')" class="removeInputButton button mini-button cycle-button">-</button>'; $blockRemove += '</div>'; newBlock.append($blockRemove); newBlock.hide(); newBlock.appendTo($("#inputBlock")).show("slow"); $("#sw_docmanagerbundle_uploadsession_weiter").prop( 'disabled', ($("#inputBlock").children().length < 1)); } function contains(text, chartext) { return text.indexOf(chartext) > -1; } function removeLine(id) { $(id).remove(); $("#sw_docmanagerbundle_uploadsession_weiter").prop( 'disabled', ($("#inputBlock").children().length < 1)); }
apache-2.0
Tei1988/google-api-ads-ruby
dfp_api/lib/dfp_api/v201511/custom_field_service.rb
2562
# Encoding: utf-8 # # This is auto-generated code, changes will be overwritten. # # Copyright:: Copyright 2015, Google Inc. All Rights Reserved. # License:: Licensed under the Apache License, Version 2.0. # # Code generated by AdsCommon library 0.11.2 on 2016-02-19 16:36:57. require 'ads_common/savon_service' require 'dfp_api/v201511/custom_field_service_registry' module DfpApi; module V201511; module CustomFieldService class CustomFieldService < AdsCommon::SavonService def initialize(config, endpoint) namespace = 'https://www.google.com/apis/ads/publisher/v201511' super(config, endpoint, namespace, :v201511) end def create_custom_field_options(*args, &block) return execute_action('create_custom_field_options', args, &block) end def create_custom_field_options_to_xml(*args) return get_soap_xml('create_custom_field_options', args) end def create_custom_fields(*args, &block) return execute_action('create_custom_fields', args, &block) end def create_custom_fields_to_xml(*args) return get_soap_xml('create_custom_fields', args) end def get_custom_field_option(*args, &block) return execute_action('get_custom_field_option', args, &block) end def get_custom_field_option_to_xml(*args) return get_soap_xml('get_custom_field_option', args) end def get_custom_fields_by_statement(*args, &block) return execute_action('get_custom_fields_by_statement', args, &block) end def get_custom_fields_by_statement_to_xml(*args) return get_soap_xml('get_custom_fields_by_statement', args) end def perform_custom_field_action(*args, &block) return execute_action('perform_custom_field_action', args, &block) end def perform_custom_field_action_to_xml(*args) return get_soap_xml('perform_custom_field_action', args) end def update_custom_field_options(*args, &block) return execute_action('update_custom_field_options', args, &block) end def update_custom_field_options_to_xml(*args) return get_soap_xml('update_custom_field_options', args) end def update_custom_fields(*args, &block) return execute_action('update_custom_fields', args, &block) end def update_custom_fields_to_xml(*args) return get_soap_xml('update_custom_fields', args) end private def get_service_registry() return CustomFieldServiceRegistry end def get_module() return DfpApi::V201511::CustomFieldService end end end; end; end
apache-2.0
AlexeiVainshtein/jenkins-artifactory-plugin
src/main/java/org/jfrog/hudson/pipeline/scripted/steps/conan/InitConanClientStep.java
4174
package org.jfrog.hudson.pipeline.scripted.steps.conan; import com.google.inject.Inject; import hudson.EnvVars; import hudson.Extension; import hudson.FilePath; import hudson.Launcher; import hudson.model.Run; import hudson.model.TaskListener; import hudson.util.ArgumentListBuilder; import org.apache.commons.lang.StringUtils; import org.jenkinsci.plugins.workflow.steps.AbstractStepDescriptorImpl; import org.jenkinsci.plugins.workflow.steps.AbstractStepImpl; import org.jenkinsci.plugins.workflow.steps.AbstractSynchronousStepExecution; import org.jenkinsci.plugins.workflow.steps.StepContextParameter; import org.jfrog.hudson.pipeline.common.Utils; import org.jfrog.hudson.pipeline.common.types.ConanClient; import org.jfrog.hudson.util.ExtractorUtils; import org.kohsuke.stapler.DataBoundConstructor; import java.io.File; import java.util.Calendar; public class InitConanClientStep extends AbstractStepImpl { private ConanClient client; @DataBoundConstructor public InitConanClientStep(ConanClient client) { this.client = client; } public ConanClient getClient() { return client; } public static class Execution extends AbstractSynchronousStepExecution<Boolean> { private static final long serialVersionUID = 1L; @StepContextParameter private transient Run build; @StepContextParameter private transient TaskListener listener; @StepContextParameter private transient Launcher launcher; @Inject(optional = true) private transient InitConanClientStep step; @StepContextParameter private transient FilePath ws; @StepContextParameter private transient EnvVars env; @Override protected Boolean run() throws Exception { ConanClient conanClient = getConanClient(); EnvVars extendedEnv = new EnvVars(env); extendedEnv.put(Utils.CONAN_USER_HOME, conanClient.getUserPath()); ArgumentListBuilder args = new ArgumentListBuilder(); String logFilePath = conanClient.getLogFilePath(); args.addTokenized("conan config set"); // We need to add quotation marks before we save the log file path args.add("log.trace_file=\"" + StringUtils.trim(logFilePath) + "\""); Utils.exeConan(args, ws, launcher, listener, build, extendedEnv); return true; } private ConanClient getConanClient() throws Exception { ConanClient conanClient = step.getClient(); conanClient.setUnixAgent(launcher.isUnix()); FilePath conanHomeDirectory; if (StringUtils.isEmpty(conanClient.getUserPath())) { conanHomeDirectory = env.containsKey(Utils.CONAN_USER_HOME) ? new FilePath(new File(env.get(Utils.CONAN_USER_HOME))) : createConanTempHome(); } else { conanHomeDirectory = new FilePath(launcher.getChannel(), conanClient.getUserPath()); if (!conanHomeDirectory.exists()) { conanHomeDirectory.mkdirs(); } } conanClient.setUserPath(conanHomeDirectory.getRemote()); conanHomeDirectory.child(ConanClient.CONAN_LOG_FILE).touch(Calendar.getInstance().getTimeInMillis()); return conanClient; } private FilePath createConanTempHome() throws Exception { // Create the @tmp directory FilePath tempDir = ExtractorUtils.createAndGetTempDir(ws); // Create the conan directory return tempDir.createTempDir("conan", ""); } } @Extension public static final class DescriptorImpl extends AbstractStepDescriptorImpl { public DescriptorImpl() { super(InitConanClientStep.Execution.class); } @Override public String getFunctionName() { return "initConanClient"; } @Override public String getDisplayName() { return "Create Conan Client"; } @Override public boolean isAdvanced() { return true; } } }
apache-2.0
srapisarda/ontop
obdalib-core/src/main/java/it/unibz/inf/ontop/ontology/impl/DataSomeValuesFromImpl.java
2538
package it.unibz.inf.ontop.ontology.impl; /* * #%L * ontop-obdalib-core * %% * Copyright (C) 2009 - 2014 Free University of Bozen-Bolzano * %% * 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. * #L% */ import it.unibz.inf.ontop.ontology.DataPropertyExpression; import it.unibz.inf.ontop.ontology.DataSomeValuesFrom; import it.unibz.inf.ontop.ontology.Datatype; /** * DataSomeValuesFrom in OWL 2 QL Specification * <p> * DataSomeValuesFrom := 'DataSomeValuesFrom' '(' DataPropertyExpression DataRange ')' * <p> * Implements (partially) rule [D5] in methods isTop and isBottom<br> * - the class expression is equivalent to top if the property is top (the data range cannot be empty)<br> * - the class expression is equivalent to bot if the property is bot * * @author Roman Kontchakov * */ public class DataSomeValuesFromImpl implements DataSomeValuesFrom { private static final long serialVersionUID = 593821958539751283L; private final DataPropertyExpression property; private final Datatype filler; private final String string; DataSomeValuesFromImpl(DataPropertyExpression property, Datatype filler) { this.property = property; this.filler = filler; this.string = new StringBuilder().append("E ").append(property.toString()).append(".") .append(filler.toString()).toString(); } @Override public DataPropertyExpression getProperty() { return property; } @Override public Datatype getDatatype() { return filler; } @Override public boolean equals(Object obj) { if (obj == this) return true; if (obj instanceof DataSomeValuesFromImpl) { DataSomeValuesFromImpl other = (DataSomeValuesFromImpl) obj; return property.equals(other.property) && filler.equals(other.filler); } return false; } @Override public int hashCode() { return string.hashCode(); } @Override public String toString() { return string; } @Override public boolean isBottom() { return property.isBottom(); } @Override public boolean isTop() { return property.isTop(); } }
apache-2.0
bashimao/ltudl
blaze/src/main/scala/edu/latrobe/blaze/optimizerexitcodes/NoMoreData.scala
1375
/* * La Trobe University - Distributed Deep Learning System * Copyright 2016 Matthias Langer ([email protected]) * * 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.latrobe.blaze.optimizerexitcodes import edu.latrobe._ import edu.latrobe.blaze._ /** * No more data available in data stream. Does not happen with infinite streams. */ final class NoMoreData extends IndependentOptimizerExitCode { override def toString : String = "NoMoreData" override def canEqual(that: Any) : Boolean = that.isInstanceOf[NoMoreData] override def description : String = { "The batch pool that feeds the optimization process has been depleted!" } override def indicatesConvergence : Boolean = false override def indicatesFailure : Boolean = false } object NoMoreData { final def apply() : NoMoreData = new NoMoreData }
apache-2.0
AnthonySteele/MvcRouteTester
src/MvcRouteTester.AttributeRouting.Test/NunitAssertEngine.cs
762
using MvcRouteTester.Assertions; using NUnit.Framework; namespace MvcRouteTester.AttributeRouting.Test { public class NunitAssertEngine : IAssertEngine { [System.Diagnostics.DebuggerNonUserCode] public void Fail(string message) { Assert.Fail(message); } /// <summary> /// This could be a wrapper over "Fail" and reduce the size of the IAssertEngine interface /// But then we would lose out on the error details that StringAssert.AreEqual provides /// </summary> [System.Diagnostics.DebuggerNonUserCode] public void StringsEqualIgnoringCase(string s1, string s2, string message) { if (string.IsNullOrEmpty(s1) && string.IsNullOrEmpty(s2)) { return; } StringAssert.AreEqualIgnoringCase(s1, s2, message); } } }
apache-2.0
deepjava/runtime-library
src/org/deepjava/runtime/mpc555/Impc555.java
17248
package org.deepjava.runtime.mpc555; import org.deepjava.runtime.ppc32.Ippc32; // Auto generated file (2021-02-17 13:57:50) public interface Impc555 extends Ippc32 { // System constants of CPU mpc555 public static final int SRR1init = 0x3802; public static final int stackSize = 0x2000; public static final int sysTabBaseAddr = 0x4000; public static final int excpCodeSize = 0x4000; public static final int excpCodeBase = 0x0; public static final int CMFB_Size = 0x30000; public static final int CMFB_BaseAddr = 0x40000; public static final int CMFA_Size = 0x40000; public static final int CMFA_BaseAddr = 0x0; public static final int SRAMB_Size = 0x4000; public static final int SRAMB_BaseAddr = 0x3fc000; public static final int SRAMA_Size = 0x2800; public static final int SRAMA_BaseAddr = 0x3f9800; public static final int IMB = 0x0; // Specific registers of CPU mpc555 public static final int SPR80 = 0x50; public static final int EIE = 0x50; public static final int SPR81 = 0x51; public static final int EID = 0x51; public static final int SPR82 = 0x52; public static final int NRI = 0x52; public static final int SPR144 = 0x90; public static final int CMPA = 0x90; public static final int SPR145 = 0x91; public static final int CMPB = 0x91; public static final int SPR146 = 0x92; public static final int CMPC = 0x92; public static final int SPR147 = 0x93; public static final int CMPD = 0x93; public static final int SPR148 = 0x94; public static final int ECR = 0x94; public static final int SPR149 = 0x95; public static final int DER = 0x95; public static final int SPR150 = 0x96; public static final int COUNTA = 0x96; public static final int SPR151 = 0x97; public static final int COUNTB = 0x97; public static final int SPR152 = 0x98; public static final int CMPE = 0x98; public static final int SPR153 = 0x99; public static final int CMPF = 0x99; public static final int SPR154 = 0x9a; public static final int CMPG = 0x9a; public static final int SPR155 = 0x9b; public static final int CMPH = 0x9b; public static final int SPR156 = 0x9c; public static final int LCTRL1 = 0x9c; public static final int SPR157 = 0x9d; public static final int LCTRL2 = 0x9d; public static final int SPR158 = 0x9e; public static final int ICTRL = 0x9e; public static final int SPR159 = 0x9f; public static final int BAR = 0x9f; public static final int PVR = 0x11f; public static final int SPR528 = 0x210; public static final int MI_GRA = 0x210; public static final int SPR536 = 0x218; public static final int L2U_GRA = 0x218; public static final int SPR560 = 0x230; public static final int BBCMCR = 0x230; public static final int SPR568 = 0x238; public static final int L2U_MCR = 0x238; public static final int SPR638 = 0x27e; public static final int IMMR = 0x27e; public static final int SPR784 = 0x310; public static final int MI_RBA0 = 0x310; public static final int SPR785 = 0x311; public static final int MI_RBA1 = 0x311; public static final int SPR786 = 0x312; public static final int MI_RBA2 = 0x312; public static final int SPR787 = 0x313; public static final int MI_RBA3 = 0x313; public static final int SPR792 = 0x318; public static final int L2U_RBA0 = 0x318; public static final int SPR793 = 0x319; public static final int L2U_RBA1 = 0x319; public static final int SPR794 = 0x31a; public static final int L2U_RBA2 = 0x31a; public static final int SPR795 = 0x31b; public static final int L2U_RBA3 = 0x31b; public static final int SPR816 = 0x330; public static final int MI_RA0 = 0x330; public static final int SPR817 = 0x331; public static final int MI_RA1 = 0x331; public static final int SPR818 = 0x332; public static final int MI_RA2 = 0x332; public static final int SPR819 = 0x333; public static final int MI_RA3 = 0x333; public static final int SPR824 = 0x338; public static final int L2U_RA0 = 0x338; public static final int SPR825 = 0x339; public static final int L2U_RA1 = 0x339; public static final int SPR826 = 0x33a; public static final int L2U_RA2 = 0x33a; public static final int SPR827 = 0x33b; public static final int L2U_RA3 = 0x33b; public static final int SPR1022 = 0x3fe; public static final int FPECR = 0x3fe; public static final int SIUMCR = 0x2fc000; public static final int SYPCR = 0x2fc004; public static final int SWSR = 0x2fc00e; public static final int SIPEND = 0x2fc010; public static final int SIMASK = 0x2fc014; public static final int SIEL = 0x2fc018; public static final int SIVEC = 0x2fc01c; public static final int TESR = 0x2fc020; public static final int SGPIODT1 = 0x2fc024; public static final int SGPIODT2 = 0x2fc028; public static final int SGPIOCR = 0x2fc02c; public static final int EMCR = 0x2fc030; public static final int PDMCR = 0x2fc03c; public static final int BR0 = 0x2fc100; public static final int OR0 = 0x2fc104; public static final int BR1 = 0x2fc108; public static final int OR1 = 0x2fc10c; public static final int BR2 = 0x2fc110; public static final int OR2 = 0x2fc114; public static final int BR3 = 0x2fc118; public static final int OR3 = 0x2fc11c; public static final int DMBR = 0x2fc140; public static final int DMOR = 0x2fc144; public static final int MSTAT = 0x2fc178; public static final int TBSCR = 0x2fc200; public static final int TBREF0 = 0x2fc204; public static final int TBREF1 = 0x2fc208; public static final int RTCSC = 0x2fc220; public static final int RTC = 0x2fc224; public static final int RTSEC = 0x2fc228; public static final int RTCAL = 0x2fc22c; public static final int PISCR = 0x2fc240; public static final int PITC = 0x2fc244; public static final int PITR = 0x2fc248; public static final int SCCR = 0x2fc280; public static final int PLPRCR = 0x2fc284; public static final int RSR = 0x2fc288; public static final int COLIR = 0x2fc28c; public static final int VSRMCR = 0x2fc290; public static final int TBSCRK = 0x2fc300; public static final int TBREF0K = 0x2fc304; public static final int TBREF1K = 0x2fc308; public static final int TBK = 0x2fc30c; public static final int RTCSCK = 0x2fc320; public static final int RTCK = 0x2fc324; public static final int RTSECK = 0x2fc328; public static final int RTCALK = 0x2fc32c; public static final int PISCRIK = 0x2fc340; public static final int PITCK = 0x2fc344; public static final int SCCRK = 0x2fc380; public static final int PLPRCRK = 0x2fc384; public static final int RSRK = 0x2fc388; public static final int CMFMCR_A = 0x2fc800; public static final int CMFTST_A = 0x2fc804; public static final int CMFCTL_A = 0x2fc808; public static final int CMFMCR_B = 0x2fc840; public static final int CMFTST_B = 0x2fc844; public static final int CMFCTL_B = 0x2fc848; public static final int DPTMCR = 0x300000; public static final int RAMBAR = 0x300004; public static final int MISRH = 0x300006; public static final int MISRL = 0x300008; public static final int MISCNT = 0x30000a; public static final int TPUMCR_A = 0x304000; public static final int DSCR_A = 0x304004; public static final int DSSR_A = 0x304006; public static final int TICR_A = 0x304008; public static final int CIER_A = 0x30400a; public static final int CFSR0_A = 0x30400c; public static final int CFSR1_A = 0x30400e; public static final int CFSR2_A = 0x304010; public static final int CFSR3_A = 0x304012; public static final int HSQR0_A = 0x304014; public static final int HSQR1_A = 0x304016; public static final int HSRR0_A = 0x304018; public static final int HSRR1_A = 0x30401a; public static final int CPR0_A = 0x30401c; public static final int CPR1_A = 0x30401e; public static final int CISR_A = 0x304020; public static final int TPUMCR2_A = 0x304028; public static final int TPUMCR3_A = 0x30402a; public static final int TPURAM0_A = 0x304100; public static final int TPURAM1_A = 0x304110; public static final int TPURAM2_A = 0x304120; public static final int TPURAM3_A = 0x304130; public static final int TPURAM4_A = 0x304140; public static final int TPURAM5_A = 0x304150; public static final int TPURAM6_A = 0x304160; public static final int TPURAM7_A = 0x304170; public static final int TPURAM8_A = 0x304180; public static final int TPURAM9_A = 0x304190; public static final int TPURAM10_A = 0x3041a0; public static final int TPURAM11_A = 0x3041b0; public static final int TPURAM12_A = 0x3041c0; public static final int TPURAM13_A = 0x3041d0; public static final int TPURAM14_A = 0x3041e0; public static final int TPURAM15_A = 0x3041f0; public static final int TPUMCR_B = 0x304400; public static final int DSCR_B = 0x304404; public static final int DSSR_B = 0x304406; public static final int TICR_B = 0x304408; public static final int CIER_B = 0x30440a; public static final int CFSR0_B = 0x30440c; public static final int CFSR1_B = 0x30440e; public static final int CFSR2_B = 0x304410; public static final int CFSR3_B = 0x304412; public static final int HSQR0_B = 0x304414; public static final int HSQR1_B = 0x304416; public static final int HSRR0_B = 0x304418; public static final int HSRR1_B = 0x30441a; public static final int CPR0_B = 0x30441c; public static final int CPR1_B = 0x30441e; public static final int CISR_B = 0x304420; public static final int TPUMCR2_B = 0x304428; public static final int TPUMCR3_B = 0x30442a; public static final int TPURAM0_B = 0x304500; public static final int TPURAM1_B = 0x304510; public static final int TPURAM2_B = 0x304520; public static final int TPURAM3_B = 0x304530; public static final int TPURAM4_B = 0x304540; public static final int TPURAM5_B = 0x304550; public static final int TPURAM6_B = 0x304560; public static final int TPURAM7_B = 0x304570; public static final int TPURAM8_B = 0x304580; public static final int TPURAM9_B = 0x304590; public static final int TPURAM10_B = 0x3045a0; public static final int TPURAM11_B = 0x3045b0; public static final int TPURAM12_B = 0x3045c0; public static final int TPURAM13_B = 0x3045d0; public static final int TPURAM14_B = 0x3045e0; public static final int TPURAM15_B = 0x3045f0; public static final int QADC64MCR_A = 0x304800; public static final int QADC64INT_A = 0x304804; public static final int PORTQA_A = 0x304806; public static final int PORTQB_A = 0x304807; public static final int DDRQA_A = 0x304808; public static final int QACR0_A = 0x30480a; public static final int QACR1_A = 0x30480c; public static final int QACR2_A = 0x30480e; public static final int QASR0_A = 0x304810; public static final int QASR1_A = 0x304812; public static final int CCW_A = 0x304a00; public static final int RJURR_A = 0x304a80; public static final int LJSRR_A = 0x304b00; public static final int LJURR_A = 0x304b80; public static final int QADC64MCR_B = 0x304c00; public static final int QADC64INT_B = 0x304c04; public static final int PORTQA_B = 0x304c06; public static final int PORTQB_B = 0x304c07; public static final int DDRQA_B = 0x304c08; public static final int QACR0_B = 0x304c0a; public static final int QACR1_B = 0x304c0c; public static final int QACR2_B = 0x304c0e; public static final int QASR0_B = 0x304c10; public static final int QASR1_B = 0x304c12; public static final int CCW_B = 0x304e00; public static final int RJURR_B = 0x304e80; public static final int LJSRR_B = 0x304f00; public static final int LJURR_B = 0x304f80; public static final int QSMCMMCR = 0x305000; public static final int QDSCI_IL = 0x305004; public static final int QSPI_IL = 0x305007; public static final int SCC1R0 = 0x305008; public static final int SCC1R1 = 0x30500a; public static final int SC1SR = 0x30500c; public static final int SC1DR = 0x30500e; public static final int PORTQS = 0x305014; public static final int PQSPAR = 0x305016; public static final int DDRQS = 0x305017; public static final int SPCR0 = 0x305018; public static final int SPCR1 = 0x30501a; public static final int SPCR2 = 0x30501c; public static final int SPCR3 = 0x30501e; public static final int SPSR = 0x30501f; public static final int SCC2R0 = 0x305020; public static final int SCC2R1 = 0x305022; public static final int SC2SR = 0x305024; public static final int SC2DR = 0x305026; public static final int QSCI1CR = 0x305028; public static final int QSCI1SR = 0x30502a; public static final int SCTQ = 0x30502c; public static final int SCRQ = 0x30504c; public static final int RECRAM = 0x305140; public static final int TRANRAM = 0x305180; public static final int COMDRAM = 0x3051c0; public static final int MPWMSM0PERR = 0x306000; public static final int MPWMSM0PULR = 0x306002; public static final int MPWMSM0CNTR = 0x306004; public static final int MPWMSM0SCR = 0x306006; public static final int MPWMSM1PERR = 0x306008; public static final int MPWMSM1PULR = 0x30600a; public static final int MPWMSM1CNTR = 0x30600c; public static final int MPWMSM1SCR = 0x30600e; public static final int MPWMSM2PERR = 0x306010; public static final int MPWMSM2PULR = 0x306012; public static final int MPWMSM2CNTR = 0x306014; public static final int MPWMSM2SCR = 0x306016; public static final int MPWMSM3PERR = 0x306018; public static final int MPWMSM3PULR = 0x30601a; public static final int MPWMSM3CNTR = 0x30601c; public static final int MPWMSM3SCR = 0x30601e; public static final int MMCSM6CNT = 0x306030; public static final int MMCSM6ML = 0x306032; public static final int MMCSM6SCRD = 0x306034; public static final int MMCSM6SCR = 0x306036; public static final int MDASM11AR = 0x306058; public static final int MDASM11BR = 0x30605a; public static final int MDASM11SCRD = 0x30605c; public static final int MDASM11SCR = 0x30605e; public static final int MDASM12AR = 0x306060; public static final int MDASM12BR = 0x306062; public static final int MDASM12SCRD = 0x306064; public static final int MDASM12SCR = 0x306066; public static final int MDASM13AR = 0x306068; public static final int MDASM13BR = 0x30606a; public static final int MDASM13SCRD = 0x30606c; public static final int MDASM13SCR = 0x30606e; public static final int MDASM14AR = 0x306070; public static final int MDASM14BR = 0x306072; public static final int MDASM14SCRD = 0x306074; public static final int MDASM14SCR = 0x306076; public static final int MDASM15AR = 0x306078; public static final int MDASM15BR = 0x30607a; public static final int MDASM15SCRD = 0x30607c; public static final int MDASM15SCR = 0x30607e; public static final int MPWMSM16PERR = 0x306080; public static final int MPWMSM16PULR = 0x306082; public static final int MPWMSM16CNTR = 0x306084; public static final int MPWMSM16SCR = 0x306086; public static final int MPWMSM17PERR = 0x306088; public static final int MPWMSM17PULR = 0x30608a; public static final int MPWMSM17CNTR = 0x30608c; public static final int MPWMSM17SCR = 0x30608e; public static final int MPWMSM18PERR = 0x306090; public static final int MPWMSM18PULR = 0x306092; public static final int MPWMSM18CNTR = 0x306094; public static final int MPWMSM18SCR = 0x306096; public static final int MPWMSM19PERR = 0x306098; public static final int MPWMSM19PULR = 0x30609a; public static final int MPWMSM19CNTR = 0x30609c; public static final int MPWMSM19SCR = 0x30609e; public static final int MMCSM22CNT = 0x3060b0; public static final int MMCSM22ML = 0x3060b2; public static final int MMCSM22SCRD = 0x3060b4; public static final int MMCSM22SCR = 0x3060b6; public static final int MDASM27AR = 0x3060d8; public static final int MDASM27BR = 0x3060da; public static final int MDASM27SCRD = 0x3060dc; public static final int MDASM27SCR = 0x3060de; public static final int MDASM28AR = 0x3060e0; public static final int MDASM28BR = 0x3060e2; public static final int MDASM28SCRD = 0x3060e4; public static final int MDASM28SCR = 0x3060e6; public static final int MDASM29AR = 0x3060e8; public static final int MDASM29BR = 0x3060ea; public static final int MDASM29SCRD = 0x3060ec; public static final int MDASM29SCR = 0x3060ee; public static final int MDASM30AR = 0x3060f0; public static final int MDASM30BR = 0x3060f2; public static final int MDASM30SCRD = 0x3060f4; public static final int MDASM30SCR = 0x3060f6; public static final int MDASM31AR = 0x3060f8; public static final int MDASM31BR = 0x3060fa; public static final int MDASM31SCRD = 0x3060fc; public static final int MDASM31SCR = 0x3060fe; public static final int MPIOSMDR = 0x306100; public static final int MPIOSMDDR = 0x306102; public static final int MIOS1TPCR = 0x306800; public static final int MIOS1VNR = 0x306804; public static final int MIOS1MCR = 0x306806; public static final int MCPSMSCR = 0x306816; public static final int MIOS1SR0 = 0x306c00; public static final int MIOS1ER0 = 0x306c04; public static final int MIOS1RPR0 = 0x306c06; public static final int MIOS1LVL0 = 0x306c30; public static final int MIOS1SR1 = 0x306c40; public static final int MIOS1ER1 = 0x306c44; public static final int MIOS1RPR1 = 0x306c46; public static final int MIOS1LVL1 = 0x306c70; public static final int UMCR = 0x307f80; public static final int UTSTCREG = 0x307f90; public static final int UIPEND = 0x307fa0; public static final int SRAMMCR_A = 0x380000; public static final int SRAMMCR_B = 0x380008; }
apache-2.0
ericfe-ms/roslyn
src/Compilers/CSharp/Portable/CSharpParseOptions.cs
8998
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Collections.Generic; using System.Collections.Immutable; using System.Diagnostics; using Roslyn.Utilities; namespace Microsoft.CodeAnalysis.CSharp { /// <summary> /// This class stores several source parsing related options and offers access to their values. /// </summary> public sealed class CSharpParseOptions : ParseOptions, IEquatable<CSharpParseOptions> { /// <summary> /// The default parse options. /// </summary> public static CSharpParseOptions Default { get; } = new CSharpParseOptions(); private ImmutableDictionary<string, string> _features; /// <summary> /// Gets the language version. /// </summary> public LanguageVersion LanguageVersion { get; private set; } internal ImmutableArray<string> PreprocessorSymbols { get; private set; } /// <summary> /// Gets the names of defined preprocessor symbols. /// </summary> public override IEnumerable<string> PreprocessorSymbolNames { get { return PreprocessorSymbols; } } public CSharpParseOptions( LanguageVersion languageVersion = LanguageVersion.CSharp6, DocumentationMode documentationMode = DocumentationMode.Parse, SourceCodeKind kind = SourceCodeKind.Regular, IEnumerable<string> preprocessorSymbols = null) : this(languageVersion, documentationMode, kind, preprocessorSymbols.ToImmutableArrayOrEmpty()) { if (!languageVersion.IsValid()) { throw new ArgumentOutOfRangeException(nameof(languageVersion)); } if (!kind.IsValid()) { throw new ArgumentOutOfRangeException(nameof(kind)); } if (preprocessorSymbols != null) { foreach (var preprocessorSymbol in preprocessorSymbols) { if (!SyntaxFacts.IsValidIdentifier(preprocessorSymbol)) { throw new ArgumentException("preprocessorSymbols"); } } } } internal CSharpParseOptions( LanguageVersion languageVersion, DocumentationMode documentationMode, SourceCodeKind kind, IEnumerable<string> preprocessorSymbols, ImmutableDictionary<string, string> features) : this(languageVersion, documentationMode, kind, preprocessorSymbols) { if (features == null) { throw new ArgumentNullException(nameof(features)); } _features = features; } private CSharpParseOptions(CSharpParseOptions other) : this( languageVersion: other.LanguageVersion, documentationMode: other.DocumentationMode, kind: other.Kind, preprocessorSymbols: other.PreprocessorSymbols, features: other.Features.ToImmutableDictionary()) { } // No validation internal CSharpParseOptions( LanguageVersion languageVersion, DocumentationMode documentationMode, SourceCodeKind kind, ImmutableArray<string> preprocessorSymbols) : base(kind, documentationMode) { Debug.Assert(!preprocessorSymbols.IsDefault); this.LanguageVersion = languageVersion; this.PreprocessorSymbols = preprocessorSymbols; _features = ImmutableDictionary<string, string>.Empty; } public new CSharpParseOptions WithKind(SourceCodeKind kind) { if (kind == this.Kind) { return this; } if (!kind.IsValid()) { throw new ArgumentOutOfRangeException(nameof(kind)); } return new CSharpParseOptions(this) { Kind = kind }; } public CSharpParseOptions WithLanguageVersion(LanguageVersion version) { if (version == this.LanguageVersion) { return this; } if (!version.IsValid()) { throw new ArgumentOutOfRangeException(nameof(version)); } return new CSharpParseOptions(this) { LanguageVersion = version }; } public CSharpParseOptions WithPreprocessorSymbols(IEnumerable<string> preprocessorSymbols) { return WithPreprocessorSymbols(preprocessorSymbols.AsImmutableOrNull()); } public CSharpParseOptions WithPreprocessorSymbols(params string[] preprocessorSymbols) { return WithPreprocessorSymbols(ImmutableArray.Create(preprocessorSymbols)); } public CSharpParseOptions WithPreprocessorSymbols(ImmutableArray<string> symbols) { if (symbols.IsDefault) { symbols = ImmutableArray<string>.Empty; } if (symbols.Equals(this.PreprocessorSymbols)) { return this; } return new CSharpParseOptions(this) { PreprocessorSymbols = symbols }; } public new CSharpParseOptions WithDocumentationMode(DocumentationMode documentationMode) { if (documentationMode == this.DocumentationMode) { return this; } if (!documentationMode.IsValid()) { throw new ArgumentOutOfRangeException(nameof(documentationMode)); } return new CSharpParseOptions(this) { DocumentationMode = documentationMode }; } public override ParseOptions CommonWithKind(SourceCodeKind kind) { return WithKind(kind); } protected override ParseOptions CommonWithDocumentationMode(DocumentationMode documentationMode) { return WithDocumentationMode(documentationMode); } protected override ParseOptions CommonWithFeatures(IEnumerable<KeyValuePair<string, string>> features) { return WithFeatures(features); } /// <summary> /// Enable some experimental language features for testing. /// </summary> public new CSharpParseOptions WithFeatures(IEnumerable<KeyValuePair<string, string>> features) { if (features == null) { throw new ArgumentNullException(nameof(features)); } return new CSharpParseOptions(this) { _features = features.ToImmutableDictionary(StringComparer.OrdinalIgnoreCase) }; } public override IReadOnlyDictionary<string, string> Features { get { return _features; } } internal bool IsFeatureEnabled(MessageID feature) { switch (feature) { case MessageID.IDS_FeatureBinaryLiteral: case MessageID.IDS_FeatureDigitSeparator: case MessageID.IDS_FeatureLocalFunctions: case MessageID.IDS_FeatureRefLocalsReturns: case MessageID.IDS_FeaturePatternMatching: case MessageID.IDS_FeatureTuples: case MessageID.IDS_FeatureReplace: // in "demo" mode enable proposed new C# 7 language features. if (PreprocessorSymbols.Contains("__DEMO__")) { return true; } break; default: break; } string featureFlag = feature.RequiredFeature(); if (featureFlag != null) { return Features.ContainsKey(featureFlag); } LanguageVersion availableVersion = LanguageVersion; LanguageVersion requiredVersion = feature.RequiredVersion(); return availableVersion >= requiredVersion; } public override bool Equals(object obj) { return this.Equals(obj as CSharpParseOptions); } public bool Equals(CSharpParseOptions other) { if (object.ReferenceEquals(this, other)) { return true; } if (!base.EqualsHelper(other)) { return false; } return this.LanguageVersion == other.LanguageVersion; } public override int GetHashCode() { return Hash.Combine(base.GetHashCodeHelper(), Hash.Combine((int)this.LanguageVersion, 0)); } } }
apache-2.0
Yiiinsh/x-pipe
redis/redis-integration-test/src/test/java/com/ctrip/xpipe/redis/integratedtest/keeper/AllKeeperTest.java
833
package com.ctrip.xpipe.redis.integratedtest.keeper; import org.junit.runner.RunWith; import org.junit.runners.Suite; import org.junit.runners.Suite.SuiteClasses; /** * @author wenchao.meng * * May 17, 2016 2:09:41 PM */ @RunWith(Suite.class) @SuiteClasses({ KeeperPsync2.class, KeeperPsync2Continue.class, KeeperSingleDc.class, KeeperMultiDc.class, KeeperMultiDcChangePrimary.class, KeeperSingleDcRestart.class, KeeperSingleDcSlaveof.class, KeeperSingleDcWipeOutData.class, KeeperSingleDcEof.class, KeeperMultiDc.class, KeeperSingleDcWaitForOffset.class, KeeperSingleDcVersionTest.class, XRedisXpipeCommandTest.class, XRedisPartialTest.class }) public class AllKeeperTest { /* * before run test, you should * 1. start redis 2.8.19 at localhost, for testCase: KeeperSingleDcVersionTest */ }
apache-2.0
maruel/fortuna
generator_test.go
7636
// Copyright 2013 Marc-Antoine Ruel. All rights reserved. // Use of this source code is governed under the Apache License, Version 2.0 // that can be found in the LICENSE file. package fortuna import ( "bytes" "compress/flate" "crypto/aes" "crypto/cipher" "crypto/md5" "crypto/sha256" "encoding/hex" "encoding/json" "hash" "io" "io/ioutil" "path/filepath" "runtime" "sync" "testing" ) type generatorLenTest struct { h hash.Hash request int expected int } var generatorLenTestData = []generatorLenTest{ // 64 bits of security (128/2). {md5.New(), 1024, 1024}, // Maximum data is 512kb. {md5.New(), 4 * 1024 * 1024, 512 * 1024}, // 128 bits of security (256/2). {sha256.New(), 1024, 1024}, // Maximum data is 1Mb. {sha256.New(), 8 * 1024 * 1024, 1024 * 1024}, } func init() { // Enable parallel execution if not already enabled. // These tests are highly CPU intensive and the scale linearly with NumCPU. if runtime.GOMAXPROCS(0) == 1 { runtime.GOMAXPROCS(runtime.NumCPU()) } } func TestnewGeneratorDefault(t *testing.T) { t.Parallel() g := newGenerator(sha256.New(), nil) if g.h.Size() != 32 { t.Fatal("Unexpected default") } g = newGenerator(sha256.New(), []byte{}) if g.h.Size() != 32 { t.Fatal("Unexpected default") } } // Compress data and returns the resulting size. func compress(t *testing.T, d []byte) int { buf := &bytes.Buffer{} // It's a bit slow, flate.BestSpeed could be used but that would go against // the check here. f, err := flate.NewWriter(buf, flate.BestCompression) if err != nil { t.Fatal(err) } if i, err := f.Write(d); err != nil { t.Fatal(err) } else if i != len(d) { t.Fatal("Unexpected len") } _ = f.Flush() return buf.Len() } // Reads data and ensures this is the expected size. func read(t *testing.T, r io.Reader, out []byte, expected int) { l, err := r.Read(out) if err != nil { t.Fatal(err) } if l != expected { t.Fatalf("Requested %d, expected %d, got %d", len(out), expected, l) } } func testGeneratorLen(t *testing.T, i int, s generatorLenTest) { g := NewGenerator(s.h, []byte{0}) d := make([]byte, s.request) read(t, g, d, s.expected) // Verify that the data is not compressible. // Note that it's not using d[:l] but the whole buffer. The reason is that // otherwise flate will go on the quick path skip compression, so the result // is not useful. compressed := compress(t, d) ratio := float64(compressed) / float64(s.expected) // Data will be larger because of the flate header. if ratio < 1. { t.Fatalf("%d H:%d; data is too compressible: %.1f %d -> %d\n%v", i, s.h.Size(), ratio*100., s.expected, compressed, d) } // Make sure the 0-filled block at the end is compressed. if compressed > (s.expected+8192) || ratio > 1.1 { t.Fatalf("%d H:%d; data is not enough compressed: %.1f %d -> %d", i, s.h.Size(), ratio*100., s.expected, compressed) } } func TestGeneratorCutShort(t *testing.T) { t.Parallel() // This test is CPU intensive so parallelize as much as possible. var wg sync.WaitGroup for index, line := range generatorLenTestData { wg.Add(1) go func(i int, s generatorLenTest) { defer wg.Done() testGeneratorLen(t, i, s) }(index, line) } wg.Wait() } type blockRead struct { Len int Expected []byte } type generatorTestData struct { Input []byte Expected []blockRead } func loadGeneratorTestData(t *testing.T, name string) []generatorTestData { content, err := ioutil.ReadFile(filepath.Join("testdata", name)) if err != nil { t.Fatal(err) } var data []generatorTestData if err = json.Unmarshal(content, &data); err != nil { t.Fatal(err) } return data } // Ensures Generator is completely deterministic and has the exact same output // than the python implementation. func TestGeneratorDeterminism(t *testing.T) { t.Parallel() for i, v := range loadGeneratorTestData(t, "generator.json") { { g1 := NewGenerator(nil, v.Input) for j, e := range v.Expected { d := make([]byte, e.Len) read(t, g1, d, e.Len) if 0 != bytes.Compare(e.Expected, d) { t.Fatalf("Index %d,%d: Generator.Read(%d) -> %v != %v", i, j, e.Len, d, e.Expected) } } } // Late reseeding results in the same output and that the output data is // properly overwritten. { g2 := NewGenerator(nil, nil) _, _ = g2.Write(v.Input) for j, e := range v.Expected { d := make([]byte, e.Len) read(t, g2, d, e.Len) if 0 != bytes.Compare(e.Expected, d) { t.Fatalf("Index %d,%d: Generator.Read(%d) -> %v != %v", i, j, e.Len, d, e.Expected) } } } } } // Benches large chunks throughput. Calculates the cost per byte. func BenchmarkGeneratorLarge(b *testing.B) { g := NewGenerator(nil, []byte{0}) data := make([]byte, b.N) count := 0 b.ResetTimer() for count != b.N { // For large values of b.N, the Read call will only return up to // maxBytesPerRequest bytes so a loop is needed. In theory it will increase // overhead, in practice maxBytesPerRequest is large enough that overhead // is minimal. remaining := b.N - count n, err := g.Read(data[:remaining]) if err != nil { b.Fatal(err) } if n == 0 { b.Fatalf("Failed to read") } count += n } } // Reads 1 byte at a time to bench overhead. Calculates the cost per byte. func BenchmarkGenerator1Byte(b *testing.B) { g := NewGenerator(nil, []byte{0}) data := make([]byte, 1) b.ResetTimer() for i := 0; i < b.N; i++ { n, err := g.Read(data) if err != nil { b.Fatal(err) } if n != 1 { b.Fatalf("Failed to read") } } } // Reads 16 bytes at a time to bench overhead. Calculates the cost per byte. func BenchmarkGenerator16Bytes(b *testing.B) { g := NewGenerator(nil, []byte{0}) data := make([]byte, 16) count := 0 b.ResetTimer() for count != b.N { chunk := 16 if b.N-count < 16 { chunk = b.N - count } n, err := g.Read(data[:chunk]) if err != nil { b.Fatal(err) } if n != chunk { b.Fatalf("Failed to read") } count += chunk } } func decodeString(str string) []byte { d, err := hex.DecodeString(str) if err != nil { panic("Invalid hex string") } return d } var key = decodeString("000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f") // Benches large chunks throughput. Calculates the cost per byte. func BenchmarkAESCTRLarge(b *testing.B) { c, err := aes.NewCipher(key) if err != nil { b.Fatal(err) } e := cipher.NewCTR(c, make([]byte, aes.BlockSize)) data := make([]byte, b.N) b.ResetTimer() // Interestingly, Generator is faster than AES in CTR, because there is no // need to XOR the data. e.XORKeyStream(data, data) } // Reads 1 byte at a time to bench overhead. Calculates the cost per byte. func BenchmarkAESCTR1Byte(b *testing.B) { c, err := aes.NewCipher(key) if err != nil { b.Fatal(err) } e := cipher.NewCTR(c, make([]byte, aes.BlockSize)) data := make([]byte, 1) b.ResetTimer() for i := 0; i < b.N; i++ { e.XORKeyStream(data, data) } } // Reads 16 bytes at a time to bench overhead. Calculates the cost per byte. func BenchmarkAESCTR16Bytes(b *testing.B) { c, err := aes.NewCipher(key) if err != nil { b.Fatal(err) } e := cipher.NewCTR(c, make([]byte, aes.BlockSize)) data := make([]byte, 16) count := 0 b.ResetTimer() for count != b.N { chunk := 16 if b.N-count < 16 { chunk = b.N - count } e.XORKeyStream(data[:chunk], data[:chunk]) count += chunk } } // Reseeds the generator. Calculates the cost per reseed. func BenchmarkGeneratorReseed(b *testing.B) { g := NewGenerator(nil, []byte{0}) data := make([]byte, 16) b.ResetTimer() for i := 0; i < b.N; i++ { _, _ = g.Write(data) } }
apache-2.0
penneryu/penneryu-ios
ios/Classes/UI/Main/NetWork/NetWorkViewController.h
272
// // NetWorkViewController.h // ios // // Created by sh587 on 15/10/28. // Copyright © 2015年 penneryu. All rights reserved. // #import <UIKit/UIKit.h> @interface NetWorkViewController : UIViewController @property (nonatomic, strong) UILabel *resultLabel; @end
apache-2.0
ryanobjc/hadoop-cloudera
docs/api/org/apache/hadoop/fs/class-use/FSOutputSummer.html
5974
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!--NewPage--> <HTML> <HEAD> <!-- Generated by javadoc (build 1.6.0_16) on Mon Jun 28 12:44:33 PDT 2010 --> <TITLE> Uses of Class org.apache.hadoop.fs.FSOutputSummer (Hadoop 0.20.2+320 API) </TITLE> <META NAME="date" CONTENT="2010-06-28"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Class org.apache.hadoop.fs.FSOutputSummer (Hadoop 0.20.2+320 API)"; } } </SCRIPT> <NOSCRIPT> </NOSCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <HR> <!-- ========= START OF TOP NAVBAR ======= --> <A NAME="navbar_top"><!-- --></A> <A HREF="#skip-navbar_top" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_top_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../org/apache/hadoop/fs/FSOutputSummer.html" title="class in org.apache.hadoop.fs"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;PREV&nbsp; &nbsp;NEXT</FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../index.html?org/apache/hadoop/fs//class-useFSOutputSummer.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="FSOutputSummer.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_top"></A> <!-- ========= END OF TOP NAVBAR ========= --> <HR> <CENTER> <H2> <B>Uses of Class<br>org.apache.hadoop.fs.FSOutputSummer</B></H2> </CENTER> No usage of org.apache.hadoop.fs.FSOutputSummer <P> <HR> <!-- ======= START OF BOTTOM NAVBAR ====== --> <A NAME="navbar_bottom"><!-- --></A> <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_bottom_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../org/apache/hadoop/fs/FSOutputSummer.html" title="class in org.apache.hadoop.fs"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;PREV&nbsp; &nbsp;NEXT</FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../index.html?org/apache/hadoop/fs//class-useFSOutputSummer.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="FSOutputSummer.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_bottom"></A> <!-- ======== END OF BOTTOM NAVBAR ======= --> <HR> Copyright &copy; 2009 The Apache Software Foundation </BODY> </HTML>
apache-2.0
tzerb/Learning
WebApplication3/src/WebApplication3/jspm_packages/npm/[email protected]/es6/prod/src/core/linker/debug_context.js
4102
/* */ "format esm"; var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var __metadata = (this && this.__metadata) || function (k, v) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); }; import { isPresent, isBlank, CONST } from 'angular2/src/facade/lang'; import { ListWrapper, StringMapWrapper } from 'angular2/src/facade/collection'; import { ViewType } from './view_type'; export let StaticNodeDebugInfo = class StaticNodeDebugInfo { constructor(providerTokens, componentToken, refTokens) { this.providerTokens = providerTokens; this.componentToken = componentToken; this.refTokens = refTokens; } }; StaticNodeDebugInfo = __decorate([ CONST(), __metadata('design:paramtypes', [Array, Object, Object]) ], StaticNodeDebugInfo); export class DebugContext { constructor(_view, _nodeIndex, _tplRow, _tplCol) { this._view = _view; this._nodeIndex = _nodeIndex; this._tplRow = _tplRow; this._tplCol = _tplCol; } get _staticNodeInfo() { return isPresent(this._nodeIndex) ? this._view.staticNodeDebugInfos[this._nodeIndex] : null; } get context() { return this._view.context; } get component() { var staticNodeInfo = this._staticNodeInfo; if (isPresent(staticNodeInfo) && isPresent(staticNodeInfo.componentToken)) { return this.injector.get(staticNodeInfo.componentToken); } return null; } get componentRenderElement() { var componentView = this._view; while (isPresent(componentView.declarationAppElement) && componentView.type !== ViewType.COMPONENT) { componentView = componentView.declarationAppElement.parentView; } return isPresent(componentView.declarationAppElement) ? componentView.declarationAppElement.nativeElement : null; } get injector() { return this._view.injector(this._nodeIndex); } get renderNode() { if (isPresent(this._nodeIndex) && isPresent(this._view.allNodes)) { return this._view.allNodes[this._nodeIndex]; } else { return null; } } get providerTokens() { var staticNodeInfo = this._staticNodeInfo; return isPresent(staticNodeInfo) ? staticNodeInfo.providerTokens : null; } get source() { return `${this._view.componentType.templateUrl}:${this._tplRow}:${this._tplCol}`; } get locals() { var varValues = {}; // TODO(tbosch): right now, the semantics of debugNode.locals are // that it contains the variables of all elements, not just // the given one. We preserve this for now to not have a breaking // change, but should change this later! ListWrapper.forEachWithIndex(this._view.staticNodeDebugInfos, (staticNodeInfo, nodeIndex) => { var refs = staticNodeInfo.refTokens; StringMapWrapper.forEach(refs, (refToken, refName) => { var varValue; if (isBlank(refToken)) { varValue = isPresent(this._view.allNodes) ? this._view.allNodes[nodeIndex] : null; } else { varValue = this._view.injectorGet(refToken, nodeIndex, null); } varValues[refName] = varValue; }); }); StringMapWrapper.forEach(this._view.locals, (localValue, localName) => { varValues[localName] = localValue; }); return varValues; } }
apache-2.0
erichoglander/qf
core/form_item/radios_form_item.php
193
<?php class Radios_FormItem_Core extends FormItem { protected function options() { return $this->options; } protected function inputType() { return "radio"; } };
apache-2.0
sacloud/libsacloud
v2/helper/service/sim/update_test.go
2609
// Copyright 2016-2022 The Libsacloud Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package sim import ( "context" "testing" "github.com/sacloud/libsacloud/v2/helper/cleanup" "github.com/sacloud/libsacloud/v2/sacloud" "github.com/sacloud/libsacloud/v2/sacloud/pointer" "github.com/sacloud/libsacloud/v2/sacloud/testutil" "github.com/sacloud/libsacloud/v2/sacloud/types" "github.com/stretchr/testify/require" ) func TestSIMService_convertUpdateRequest(t *testing.T) { ctx := context.Background() caller := testutil.SingletonAPICaller() name := testutil.ResourceName("sim-service") // setup simOp := sacloud.NewSIMOp(caller) sim, err := New(caller).CreateWithContext(ctx, &CreateRequest{ Name: name, Description: "desc", Tags: types.Tags{"tag1", "tag2"}, ICCID: "aaaaaaaa", PassCode: "bbbbbbbb", Activate: true, IMEI: "cccccccc", Carriers: []*sacloud.SIMNetworkOperatorConfig{ { Allow: true, Name: types.SIMOperators.Docomo.String(), }, }, }) if err != nil { t.Fatal(err) } defer func() { cleanup.DeleteSIM(ctx, simOp, sim.ID) // nolint }() // test cases := []struct { in *UpdateRequest expect *ApplyRequest }{ { in: &UpdateRequest{ ID: sim.ID, Name: pointer.NewString(name + "-upd"), Activate: pointer.NewBool(false), IMEI: pointer.NewString(""), Carriers: &[]*sacloud.SIMNetworkOperatorConfig{ {Allow: true, Name: types.SIMOperators.SoftBank.String()}, }, }, expect: &ApplyRequest{ ID: sim.ID, Name: name + "-upd", Description: sim.Description, Tags: sim.Tags, IconID: sim.IconID, ICCID: sim.ICCID, PassCode: "", Activate: false, IMEI: "", Carriers: []*sacloud.SIMNetworkOperatorConfig{ { Allow: true, Name: types.SIMOperators.SoftBank.String(), }, }, }, }, } for _, tc := range cases { req, err := tc.in.ApplyRequest(ctx, caller) require.NoError(t, err) require.EqualValues(t, tc.expect, req) } }
apache-2.0
hatchard/Assignment1-CMPUT301
app/src/main/java/com/mycompany/assignment1/SortStats.java
4882
/* Copyright 2015 Jenna Hatchard 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.mycompany.assignment1; import java.util.ArrayList; import java.util.Collections; import java.util.List; /** * Created by Me on 2015-10-03. */ public class SortStats { //initializes all of them to zero Long max10 = Long.valueOf(0); Long min10 = Long.valueOf(0); Long avg10= Long.valueOf(0); Long med10 = Long.valueOf(0); Long max100= Long.valueOf(0); Long min100= Long.valueOf(0); Long avg100= Long.valueOf(0); Long med100 = Long.valueOf(0); Long maxAll= Long.valueOf(0); Long minAll= Long.valueOf(0); Long avgAll= Long.valueOf(0); Long medAll= Long.valueOf(0); ArrayList<Long> results = new ArrayList<>(); //sort the stats so that they can be displayed later public ArrayList sortIt(ArrayList stats) { ArrayList statsCopy = (ArrayList)stats.clone(); //need to do this otherwise it can mess up later stats //just for all if(statsCopy.size() < 10) { sortAll(statsCopy); } //have to do for 10 and all else if(statsCopy.size() <= 100){ sort10(statsCopy); sortAll(statsCopy); } //for everything! else if(statsCopy.size() >= 100) { sort10(statsCopy); sort100(statsCopy); sortAll(statsCopy); } else {} //add the new sorted results in results.add(min10); results.add(max10); results.add(avg10); results.add(med10); results.add(min100); results.add(max100); results.add(avg100); results.add(med100); results.add(minAll); results.add(maxAll); results.add(avgAll); results.add(medAll); return results; } public void sortAll(ArrayList all) { Long zeros = Long.valueOf(0); Collections.sort(all); ArrayList subAll = new ArrayList(); // get rid of the zero place holders //checks that there are not zeros messing with the stats int zeroFrequency = Collections.frequency(all, zeros); if(zeroFrequency != 0) { for(Object i:all){ if(i.equals(zeros)){} else { subAll.add(i); } } //if the entire list was empty if(subAll.isEmpty()) { maxAll = zeros; minAll = zeros; medAll = zeros; avgAll = zeros; } else { int midIndex = (subAll.size() / 2); maxAll = (Long) Collections.max(subAll); minAll = (Long) Collections.min(subAll); medAll = (Long) all.get(midIndex); //get middle number avgAll = calculateAverage(subAll); } } else { int midIndex = (all.size() / 2); maxAll = (Long) Collections.max(all); minAll = (Long) Collections.min(all); medAll = (Long) all.get(midIndex); //get middle number avgAll = calculateAverage(all); } } public void sort100(ArrayList last100) { int end = last100.size(); int start = end - 100; List miniList = last100.subList(start, end); Collections.sort(miniList); max100 = (Long)Collections.max(miniList); min100 = (Long)Collections.min(miniList); med100 = (Long)miniList.get(49); //get middle number avg100 = calculateAverage(miniList); } public void sort10(ArrayList last10) { int end = last10.size(); int start = end - 10; List miniList = last10.subList(start, end); Collections.sort(miniList); max10 = (Long)Collections.max(miniList); min10 = (Long)Collections.min(miniList); med10 = (Long)miniList.get(4); //get middle number avg10 = calculateAverage(miniList); } //http://stackoverflow.com/questions/10791568/calculating-average-of-an-array-list Jesherun 10-03-2015 public Long calculateAverage(List <Long>list) { Long sum = new Long(0); if(!list.isEmpty()) { for (Long i: list) { sum += i; } return sum / list.size(); } return sum; } }
apache-2.0
hyarthi/project-red
src/java/org.openntf.red.main/src/org/openntf/red/security/authorization/package-info.java
100
/** * */ /** * @author Vladimir Kornienko * */ package org.openntf.red.security.authorization;
apache-2.0
fabric8io/kubernetes-client
kubernetes-model-generator/kubernetes-model-core/src/generated/java/io/fabric8/kubernetes/api/model/ServiceAccountTokenProjection.java
2936
package io.fabric8.kubernetes.api.model; import java.util.HashMap; import java.util.Map; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import io.sundr.builder.annotations.Buildable; import lombok.EqualsAndHashCode; import lombok.Setter; import lombok.ToString; import lombok.experimental.Accessors; @JsonDeserialize(using = com.fasterxml.jackson.databind.JsonDeserializer.None.class) @JsonInclude(JsonInclude.Include.NON_NULL) @JsonPropertyOrder({ "apiVersion", "kind", "metadata", "audience", "expirationSeconds", "path" }) @ToString @EqualsAndHashCode @Setter @Accessors(prefix = { "_", "" }) @Buildable(editableEnabled = false, validationEnabled = false, generateBuilderPackage = true, lazyCollectionInitEnabled = false, builderPackage = "io.fabric8.kubernetes.api.builder") public class ServiceAccountTokenProjection implements KubernetesResource { @JsonProperty("audience") private String audience; @JsonProperty("expirationSeconds") private Long expirationSeconds; @JsonProperty("path") private String path; @JsonIgnore private Map<String, Object> additionalProperties = new HashMap<String, Object>(); /** * No args constructor for use in serialization * */ public ServiceAccountTokenProjection() { } /** * * @param path * @param audience * @param expirationSeconds */ public ServiceAccountTokenProjection(String audience, Long expirationSeconds, String path) { super(); this.audience = audience; this.expirationSeconds = expirationSeconds; this.path = path; } @JsonProperty("audience") public String getAudience() { return audience; } @JsonProperty("audience") public void setAudience(String audience) { this.audience = audience; } @JsonProperty("expirationSeconds") public Long getExpirationSeconds() { return expirationSeconds; } @JsonProperty("expirationSeconds") public void setExpirationSeconds(Long expirationSeconds) { this.expirationSeconds = expirationSeconds; } @JsonProperty("path") public String getPath() { return path; } @JsonProperty("path") public void setPath(String path) { this.path = path; } @JsonAnyGetter public Map<String, Object> getAdditionalProperties() { return this.additionalProperties; } @JsonAnySetter public void setAdditionalProperty(String name, Object value) { this.additionalProperties.put(name, value); } }
apache-2.0
tzerb/Learning
WebApplication3/src/WebApplication3/jspm_packages/npm/dist/js/cjs/src/mock/view_resolver_mock.js
6175
"use strict"; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var __metadata = (this && this.__metadata) || function (k, v) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); }; var di_1 = require('angular2/src/core/di'); var di_2 = require('angular2/src/core/di'); var collection_1 = require('angular2/src/facade/collection'); var lang_1 = require('angular2/src/facade/lang'); var exceptions_1 = require('angular2/src/facade/exceptions'); var metadata_1 = require('../core/metadata'); var view_resolver_1 = require('angular2/src/compiler/view_resolver'); var MockViewResolver = (function (_super) { __extends(MockViewResolver, _super); function MockViewResolver() { _super.call(this); /** @internal */ this._views = new collection_1.Map(); /** @internal */ this._inlineTemplates = new collection_1.Map(); /** @internal */ this._viewCache = new collection_1.Map(); /** @internal */ this._directiveOverrides = new collection_1.Map(); } /** * Overrides the {@link ViewMetadata} for a component. * * @param {Type} component * @param {ViewDefinition} view */ MockViewResolver.prototype.setView = function (component, view) { this._checkOverrideable(component); this._views.set(component, view); }; /** * Overrides the inline template for a component - other configuration remains unchanged. * * @param {Type} component * @param {string} template */ MockViewResolver.prototype.setInlineTemplate = function (component, template) { this._checkOverrideable(component); this._inlineTemplates.set(component, template); }; /** * Overrides a directive from the component {@link ViewMetadata}. * * @param {Type} component * @param {Type} from * @param {Type} to */ MockViewResolver.prototype.overrideViewDirective = function (component, from, to) { this._checkOverrideable(component); var overrides = this._directiveOverrides.get(component); if (lang_1.isBlank(overrides)) { overrides = new collection_1.Map(); this._directiveOverrides.set(component, overrides); } overrides.set(from, to); }; /** * Returns the {@link ViewMetadata} for a component: * - Set the {@link ViewMetadata} to the overridden view when it exists or fallback to the default * `ViewResolver`, * see `setView`. * - Override the directives, see `overrideViewDirective`. * - Override the @View definition, see `setInlineTemplate`. * * @param component * @returns {ViewDefinition} */ MockViewResolver.prototype.resolve = function (component) { var view = this._viewCache.get(component); if (lang_1.isPresent(view)) return view; view = this._views.get(component); if (lang_1.isBlank(view)) { view = _super.prototype.resolve.call(this, component); } var directives = []; var overrides = this._directiveOverrides.get(component); if (lang_1.isPresent(overrides) && lang_1.isPresent(view.directives)) { flattenArray(view.directives, directives); overrides.forEach(function (to, from) { var srcIndex = directives.indexOf(from); if (srcIndex == -1) { throw new exceptions_1.BaseException("Overriden directive " + lang_1.stringify(from) + " not found in the template of " + lang_1.stringify(component)); } directives[srcIndex] = to; }); view = new metadata_1.ViewMetadata({ template: view.template, templateUrl: view.templateUrl, directives: directives }); } var inlineTemplate = this._inlineTemplates.get(component); if (lang_1.isPresent(inlineTemplate)) { view = new metadata_1.ViewMetadata({ template: inlineTemplate, templateUrl: null, directives: view.directives }); } this._viewCache.set(component, view); return view; }; /** * @internal * * Once a component has been compiled, the AppProtoView is stored in the compiler cache. * * Then it should not be possible to override the component configuration after the component * has been compiled. * * @param {Type} component */ MockViewResolver.prototype._checkOverrideable = function (component) { var cached = this._viewCache.get(component); if (lang_1.isPresent(cached)) { throw new exceptions_1.BaseException("The component " + lang_1.stringify(component) + " has already been compiled, its configuration can not be changed"); } }; MockViewResolver = __decorate([ di_2.Injectable(), __metadata('design:paramtypes', []) ], MockViewResolver); return MockViewResolver; }(view_resolver_1.ViewResolver)); exports.MockViewResolver = MockViewResolver; function flattenArray(tree, out) { for (var i = 0; i < tree.length; i++) { var item = di_1.resolveForwardRef(tree[i]); if (lang_1.isArray(item)) { flattenArray(item, out); } else { out.push(item); } } } //# sourceMappingURL=view_resolver_mock.js.map
apache-2.0
nicolasnoble/grpc
tools/run_tests/run_xds_tests.py
148710
#!/usr/bin/env python # Copyright 2020 gRPC authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. """Run xDS integration tests on GCP using Traffic Director.""" import argparse import datetime import json import logging import os import random import shlex import socket import subprocess import sys import tempfile import time import uuid from google.protobuf import json_format import googleapiclient.discovery import grpc from oauth2client.client import GoogleCredentials import python_utils.jobset as jobset import python_utils.report_utils as report_utils from src.proto.grpc.health.v1 import health_pb2 from src.proto.grpc.health.v1 import health_pb2_grpc from src.proto.grpc.testing import empty_pb2 from src.proto.grpc.testing import messages_pb2 from src.proto.grpc.testing import test_pb2_grpc # Envoy protos provided by PyPI package xds-protos # Needs to import the generated Python file to load descriptors try: from envoy.extensions.filters.common.fault.v3 import fault_pb2 from envoy.extensions.filters.http.fault.v3 import fault_pb2 from envoy.extensions.filters.http.router.v3 import router_pb2 from envoy.extensions.filters.network.http_connection_manager.v3 import \ http_connection_manager_pb2 from envoy.service.status.v3 import csds_pb2 from envoy.service.status.v3 import csds_pb2_grpc except ImportError: # These protos are required by CSDS test. We should not fail the entire # script for one test case. pass logger = logging.getLogger() console_handler = logging.StreamHandler() formatter = logging.Formatter(fmt='%(asctime)s: %(levelname)-8s %(message)s') console_handler.setFormatter(formatter) logger.handlers = [] logger.addHandler(console_handler) logger.setLevel(logging.WARNING) # Suppress excessive logs for gRPC Python original_grpc_trace = os.environ.pop('GRPC_TRACE', None) original_grpc_verbosity = os.environ.pop('GRPC_VERBOSITY', None) # Suppress not-essential logs for GCP clients logging.getLogger('google_auth_httplib2').setLevel(logging.WARNING) logging.getLogger('googleapiclient.discovery').setLevel(logging.WARNING) _TEST_CASES = [ 'backends_restart', 'change_backend_service', 'gentle_failover', 'load_report_based_failover', 'ping_pong', 'remove_instance_group', 'round_robin', 'secondary_locality_gets_no_requests_on_partial_primary_failure', 'secondary_locality_gets_requests_on_primary_failure', 'traffic_splitting', 'path_matching', 'header_matching', 'api_listener', 'forwarding_rule_port_match', 'forwarding_rule_default_port', 'metadata_filter', ] # Valid test cases, but not in all. So the tests can only run manually, and # aren't enabled automatically for all languages. # # TODO: Move them into _TEST_CASES when support is ready in all languages. _ADDITIONAL_TEST_CASES = [ 'circuit_breaking', 'timeout', 'fault_injection', 'csds', ] # Test cases that require the V3 API. Skipped in older runs. _V3_TEST_CASES = frozenset(['timeout', 'fault_injection', 'csds']) # Test cases that require the alpha API. Skipped for stable API runs. _ALPHA_TEST_CASES = frozenset(['timeout']) def parse_test_cases(arg): if arg == '': return [] arg_split = arg.split(',') test_cases = set() all_test_cases = _TEST_CASES + _ADDITIONAL_TEST_CASES for arg in arg_split: if arg == "all": test_cases = test_cases.union(_TEST_CASES) else: test_cases = test_cases.union([arg]) if not all([test_case in all_test_cases for test_case in test_cases]): raise Exception('Failed to parse test cases %s' % arg) # Perserve order. return [x for x in all_test_cases if x in test_cases] def parse_port_range(port_arg): try: port = int(port_arg) return list(range(port, port + 1)) except: port_min, port_max = port_arg.split(':') return list(range(int(port_min), int(port_max) + 1)) argp = argparse.ArgumentParser(description='Run xDS interop tests on GCP') # TODO(zdapeng): remove default value of project_id and project_num argp.add_argument('--project_id', default='grpc-testing', help='GCP project id') argp.add_argument('--project_num', default='830293263384', help='GCP project number') argp.add_argument( '--gcp_suffix', default='', help='Optional suffix for all generated GCP resource names. Useful to ' 'ensure distinct names across test runs.') argp.add_argument( '--test_case', default='ping_pong', type=parse_test_cases, help='Comma-separated list of test cases to run. Available tests: %s, ' '(or \'all\' to run every test). ' 'Alternative tests not included in \'all\': %s' % (','.join(_TEST_CASES), ','.join(_ADDITIONAL_TEST_CASES))) argp.add_argument( '--bootstrap_file', default='', help='File to reference via GRPC_XDS_BOOTSTRAP. Disables built-in ' 'bootstrap generation') argp.add_argument( '--xds_v3_support', default=False, action='store_true', help='Support xDS v3 via GRPC_XDS_EXPERIMENTAL_V3_SUPPORT. ' 'If a pre-created bootstrap file is provided via the --bootstrap_file ' 'parameter, it should include xds_v3 in its server_features field.') argp.add_argument( '--client_cmd', default=None, help='Command to launch xDS test client. {server_uri}, {stats_port} and ' '{qps} references will be replaced using str.format(). GRPC_XDS_BOOTSTRAP ' 'will be set for the command') argp.add_argument( '--client_hosts', default=None, help='Comma-separated list of hosts running client processes. If set, ' '--client_cmd is ignored and client processes are assumed to be running on ' 'the specified hosts.') argp.add_argument('--zone', default='us-central1-a') argp.add_argument('--secondary_zone', default='us-west1-b', help='Zone to use for secondary TD locality tests') argp.add_argument('--qps', default=100, type=int, help='Client QPS') argp.add_argument( '--wait_for_backend_sec', default=1200, type=int, help='Time limit for waiting for created backend services to report ' 'healthy when launching or updated GCP resources') argp.add_argument( '--use_existing_gcp_resources', default=False, action='store_true', help= 'If set, find and use already created GCP resources instead of creating new' ' ones.') argp.add_argument( '--keep_gcp_resources', default=False, action='store_true', help= 'Leave GCP VMs and configuration running after test. Default behavior is ' 'to delete when tests complete.') argp.add_argument('--halt_after_fail', action='store_true', help='Halt and save the resources when test failed.') argp.add_argument( '--compute_discovery_document', default=None, type=str, help= 'If provided, uses this file instead of retrieving via the GCP discovery ' 'API') argp.add_argument( '--alpha_compute_discovery_document', default=None, type=str, help='If provided, uses this file instead of retrieving via the alpha GCP ' 'discovery API') argp.add_argument('--network', default='global/networks/default', help='GCP network to use') _DEFAULT_PORT_RANGE = '8080:8280' argp.add_argument('--service_port_range', default=_DEFAULT_PORT_RANGE, type=parse_port_range, help='Listening port for created gRPC backends. Specified as ' 'either a single int or as a range in the format min:max, in ' 'which case an available port p will be chosen s.t. min <= p ' '<= max') argp.add_argument( '--stats_port', default=8079, type=int, help='Local port for the client process to expose the LB stats service') argp.add_argument('--xds_server', default='trafficdirector.googleapis.com:443', help='xDS server') argp.add_argument('--source_image', default='projects/debian-cloud/global/images/family/debian-9', help='Source image for VMs created during the test') argp.add_argument('--path_to_server_binary', default=None, type=str, help='If set, the server binary must already be pre-built on ' 'the specified source image') argp.add_argument('--machine_type', default='e2-standard-2', help='Machine type for VMs created during the test') argp.add_argument( '--instance_group_size', default=2, type=int, help='Number of VMs to create per instance group. Certain test cases (e.g., ' 'round_robin) may not give meaningful results if this is set to a value ' 'less than 2.') argp.add_argument('--verbose', help='verbose log output', default=False, action='store_true') # TODO(ericgribkoff) Remove this param once the sponge-formatted log files are # visible in all test environments. argp.add_argument('--log_client_output', help='Log captured client output', default=False, action='store_true') # TODO(ericgribkoff) Remove this flag once all test environments are verified to # have access to the alpha compute APIs. argp.add_argument('--only_stable_gcp_apis', help='Do not use alpha compute APIs. Some tests may be ' 'incompatible with this option (gRPC health checks are ' 'currently alpha and required for simulating server failure', default=False, action='store_true') args = argp.parse_args() if args.verbose: logger.setLevel(logging.DEBUG) CLIENT_HOSTS = [] if args.client_hosts: CLIENT_HOSTS = args.client_hosts.split(',') # Each of the config propagation in the control plane should finish within 600s. # Otherwise, it indicates a bug in the control plane. The config propagation # includes all kinds of traffic config update, like updating urlMap, creating # the resources for the first time, updating BackendService, and changing the # status of endpoints in BackendService. _WAIT_FOR_URL_MAP_PATCH_SEC = 600 # In general, fetching load balancing stats only takes ~10s. However, slow # config update could lead to empty EDS or similar symptoms causing the # connection to hang for a long period of time. So, we want to extend the stats # wait time to be the same as urlMap patch time. _WAIT_FOR_STATS_SEC = _WAIT_FOR_URL_MAP_PATCH_SEC _DEFAULT_SERVICE_PORT = 80 _WAIT_FOR_BACKEND_SEC = args.wait_for_backend_sec _WAIT_FOR_OPERATION_SEC = 1200 _INSTANCE_GROUP_SIZE = args.instance_group_size _NUM_TEST_RPCS = 10 * args.qps _CONNECTION_TIMEOUT_SEC = 60 _GCP_API_RETRIES = 5 _BOOTSTRAP_TEMPLATE = """ {{ "node": {{ "id": "{node_id}", "metadata": {{ "TRAFFICDIRECTOR_NETWORK_NAME": "%s", "com.googleapis.trafficdirector.config_time_trace": "TRUE" }}, "locality": {{ "zone": "%s" }} }}, "xds_servers": [{{ "server_uri": "%s", "channel_creds": [ {{ "type": "google_default", "config": {{}} }} ], "server_features": {server_features} }}] }}""" % (args.network.split('/')[-1], args.zone, args.xds_server) # TODO(ericgribkoff) Add change_backend_service to this list once TD no longer # sends an update with no localities when adding the MIG to the backend service # can race with the URL map patch. _TESTS_TO_FAIL_ON_RPC_FAILURE = ['ping_pong', 'round_robin'] # Tests that run UnaryCall and EmptyCall. _TESTS_TO_RUN_MULTIPLE_RPCS = ['path_matching', 'header_matching'] # Tests that make UnaryCall with test metadata. _TESTS_TO_SEND_METADATA = ['header_matching'] _TEST_METADATA_KEY = 'xds_md' _TEST_METADATA_VALUE_UNARY = 'unary_yranu' _TEST_METADATA_VALUE_EMPTY = 'empty_ytpme' # Extra RPC metadata whose value is a number, sent with UnaryCall only. _TEST_METADATA_NUMERIC_KEY = 'xds_md_numeric' _TEST_METADATA_NUMERIC_VALUE = '159' _PATH_MATCHER_NAME = 'path-matcher' _BASE_TEMPLATE_NAME = 'test-template' _BASE_INSTANCE_GROUP_NAME = 'test-ig' _BASE_HEALTH_CHECK_NAME = 'test-hc' _BASE_FIREWALL_RULE_NAME = 'test-fw-rule' _BASE_BACKEND_SERVICE_NAME = 'test-backend-service' _BASE_URL_MAP_NAME = 'test-map' _BASE_SERVICE_HOST = 'grpc-test' _BASE_TARGET_PROXY_NAME = 'test-target-proxy' _BASE_FORWARDING_RULE_NAME = 'test-forwarding-rule' _TEST_LOG_BASE_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), '../../reports') _SPONGE_LOG_NAME = 'sponge_log.log' _SPONGE_XML_NAME = 'sponge_log.xml' def get_client_stats(num_rpcs, timeout_sec): if CLIENT_HOSTS: hosts = CLIENT_HOSTS else: hosts = ['localhost'] for host in hosts: with grpc.insecure_channel('%s:%d' % (host, args.stats_port)) as channel: stub = test_pb2_grpc.LoadBalancerStatsServiceStub(channel) request = messages_pb2.LoadBalancerStatsRequest() request.num_rpcs = num_rpcs request.timeout_sec = timeout_sec rpc_timeout = timeout_sec + _CONNECTION_TIMEOUT_SEC logger.debug('Invoking GetClientStats RPC to %s:%d:', host, args.stats_port) response = stub.GetClientStats(request, wait_for_ready=True, timeout=rpc_timeout) logger.debug('Invoked GetClientStats RPC to %s: %s', host, json_format.MessageToJson(response)) return response def get_client_accumulated_stats(): if CLIENT_HOSTS: hosts = CLIENT_HOSTS else: hosts = ['localhost'] for host in hosts: with grpc.insecure_channel('%s:%d' % (host, args.stats_port)) as channel: stub = test_pb2_grpc.LoadBalancerStatsServiceStub(channel) request = messages_pb2.LoadBalancerAccumulatedStatsRequest() logger.debug('Invoking GetClientAccumulatedStats RPC to %s:%d:', host, args.stats_port) response = stub.GetClientAccumulatedStats( request, wait_for_ready=True, timeout=_CONNECTION_TIMEOUT_SEC) logger.debug('Invoked GetClientAccumulatedStats RPC to %s: %s', host, response) return response def get_client_xds_config_dump(): if CLIENT_HOSTS: hosts = CLIENT_HOSTS else: hosts = ['localhost'] for host in hosts: server_address = '%s:%d' % (host, args.stats_port) with grpc.insecure_channel(server_address) as channel: stub = csds_pb2_grpc.ClientStatusDiscoveryServiceStub(channel) logger.debug('Fetching xDS config dump from %s', server_address) response = stub.FetchClientStatus(csds_pb2.ClientStatusRequest(), wait_for_ready=True, timeout=_CONNECTION_TIMEOUT_SEC) logger.debug('Fetched xDS config dump from %s', server_address) if len(response.config) != 1: logger.error('Unexpected number of ClientConfigs %d: %s', len(response.config), response) return None else: # Converting the ClientStatusResponse into JSON, because many # fields are packed in google.protobuf.Any. It will require many # duplicated code to unpack proto message and inspect values. return json_format.MessageToDict( response.config[0], preserving_proto_field_name=True) def configure_client(rpc_types, metadata=[], timeout_sec=None): if CLIENT_HOSTS: hosts = CLIENT_HOSTS else: hosts = ['localhost'] for host in hosts: with grpc.insecure_channel('%s:%d' % (host, args.stats_port)) as channel: stub = test_pb2_grpc.XdsUpdateClientConfigureServiceStub(channel) request = messages_pb2.ClientConfigureRequest() request.types.extend(rpc_types) for rpc_type, md_key, md_value in metadata: md = request.metadata.add() md.type = rpc_type md.key = md_key md.value = md_value if timeout_sec: request.timeout_sec = timeout_sec logger.debug( 'Invoking XdsUpdateClientConfigureService RPC to %s:%d: %s', host, args.stats_port, request) stub.Configure(request, wait_for_ready=True, timeout=_CONNECTION_TIMEOUT_SEC) logger.debug('Invoked XdsUpdateClientConfigureService RPC to %s', host) class RpcDistributionError(Exception): pass def _verify_rpcs_to_given_backends(backends, timeout_sec, num_rpcs, allow_failures): start_time = time.time() error_msg = None logger.debug('Waiting for %d sec until backends %s receive load' % (timeout_sec, backends)) while time.time() - start_time <= timeout_sec: error_msg = None stats = get_client_stats(num_rpcs, timeout_sec) rpcs_by_peer = stats.rpcs_by_peer for backend in backends: if backend not in rpcs_by_peer: error_msg = 'Backend %s did not receive load' % backend break if not error_msg and len(rpcs_by_peer) > len(backends): error_msg = 'Unexpected backend received load: %s' % rpcs_by_peer if not allow_failures and stats.num_failures > 0: error_msg = '%d RPCs failed' % stats.num_failures if not error_msg: return raise RpcDistributionError(error_msg) def wait_until_all_rpcs_go_to_given_backends_or_fail(backends, timeout_sec, num_rpcs=_NUM_TEST_RPCS): _verify_rpcs_to_given_backends(backends, timeout_sec, num_rpcs, allow_failures=True) def wait_until_all_rpcs_go_to_given_backends(backends, timeout_sec, num_rpcs=_NUM_TEST_RPCS): _verify_rpcs_to_given_backends(backends, timeout_sec, num_rpcs, allow_failures=False) def wait_until_no_rpcs_go_to_given_backends(backends, timeout_sec): start_time = time.time() while time.time() - start_time <= timeout_sec: stats = get_client_stats(_NUM_TEST_RPCS, timeout_sec) error_msg = None rpcs_by_peer = stats.rpcs_by_peer for backend in backends: if backend in rpcs_by_peer: error_msg = 'Unexpected backend %s receives load' % backend break if not error_msg: return raise Exception('Unexpected RPCs going to given backends') def wait_until_rpcs_in_flight(rpc_type, timeout_sec, num_rpcs, threshold): '''Block until the test client reaches the state with the given number of RPCs being outstanding stably. Args: rpc_type: A string indicating the RPC method to check for. Either 'UnaryCall' or 'EmptyCall'. timeout_sec: Maximum number of seconds to wait until the desired state is reached. num_rpcs: Expected number of RPCs to be in-flight. threshold: Number within [0,100], the tolerable percentage by which the actual number of RPCs in-flight can differ from the expected number. ''' if threshold < 0 or threshold > 100: raise ValueError('Value error: Threshold should be between 0 to 100') threshold_fraction = threshold / 100.0 start_time = time.time() error_msg = None logger.debug( 'Waiting for %d sec until %d %s RPCs (with %d%% tolerance) in-flight' % (timeout_sec, num_rpcs, rpc_type, threshold)) while time.time() - start_time <= timeout_sec: error_msg = _check_rpcs_in_flight(rpc_type, num_rpcs, threshold, threshold_fraction) if error_msg: logger.debug('Progress: %s', error_msg) time.sleep(2) else: break # Ensure the number of outstanding RPCs is stable. if not error_msg: time.sleep(5) error_msg = _check_rpcs_in_flight(rpc_type, num_rpcs, threshold, threshold_fraction) if error_msg: raise Exception("Wrong number of %s RPCs in-flight: %s" % (rpc_type, error_msg)) def _check_rpcs_in_flight(rpc_type, num_rpcs, threshold, threshold_fraction): error_msg = None stats = get_client_accumulated_stats() rpcs_started = stats.num_rpcs_started_by_method[rpc_type] rpcs_succeeded = stats.num_rpcs_succeeded_by_method[rpc_type] rpcs_failed = stats.num_rpcs_failed_by_method[rpc_type] rpcs_in_flight = rpcs_started - rpcs_succeeded - rpcs_failed if rpcs_in_flight < (num_rpcs * (1 - threshold_fraction)): error_msg = ('actual(%d) < expected(%d - %d%%)' % (rpcs_in_flight, num_rpcs, threshold)) elif rpcs_in_flight > (num_rpcs * (1 + threshold_fraction)): error_msg = ('actual(%d) > expected(%d + %d%%)' % (rpcs_in_flight, num_rpcs, threshold)) return error_msg def compare_distributions(actual_distribution, expected_distribution, threshold): """Compare if two distributions are similar. Args: actual_distribution: A list of floats, contains the actual distribution. expected_distribution: A list of floats, contains the expected distribution. threshold: Number within [0,100], the threshold percentage by which the actual distribution can differ from the expected distribution. Returns: The similarity between the distributions as a boolean. Returns true if the actual distribution lies within the threshold of the expected distribution, false otherwise. Raises: ValueError: if threshold is not with in [0,100]. Exception: containing detailed error messages. """ if len(expected_distribution) != len(actual_distribution): raise Exception( 'Error: expected and actual distributions have different size (%d vs %d)' % (len(expected_distribution), len(actual_distribution))) if threshold < 0 or threshold > 100: raise ValueError('Value error: Threshold should be between 0 to 100') threshold_fraction = threshold / 100.0 for expected, actual in zip(expected_distribution, actual_distribution): if actual < (expected * (1 - threshold_fraction)): raise Exception("actual(%f) < expected(%f-%d%%)" % (actual, expected, threshold)) if actual > (expected * (1 + threshold_fraction)): raise Exception("actual(%f) > expected(%f+%d%%)" % (actual, expected, threshold)) return True def compare_expected_instances(stats, expected_instances): """Compare if stats have expected instances for each type of RPC. Args: stats: LoadBalancerStatsResponse reported by interop client. expected_instances: a dict with key as the RPC type (string), value as the expected backend instances (list of strings). Returns: Returns true if the instances are expected. False if not. """ for rpc_type, expected_peers in list(expected_instances.items()): rpcs_by_peer_for_type = stats.rpcs_by_method[rpc_type] rpcs_by_peer = rpcs_by_peer_for_type.rpcs_by_peer if rpcs_by_peer_for_type else None logger.debug('rpc: %s, by_peer: %s', rpc_type, rpcs_by_peer) peers = list(rpcs_by_peer.keys()) if set(peers) != set(expected_peers): logger.info('unexpected peers for %s, got %s, want %s', rpc_type, peers, expected_peers) return False return True def test_backends_restart(gcp, backend_service, instance_group): logger.info('Running test_backends_restart') instance_names = get_instance_names(gcp, instance_group) num_instances = len(instance_names) start_time = time.time() wait_until_all_rpcs_go_to_given_backends(instance_names, _WAIT_FOR_STATS_SEC) try: resize_instance_group(gcp, instance_group, 0) wait_until_all_rpcs_go_to_given_backends_or_fail([], _WAIT_FOR_BACKEND_SEC) finally: resize_instance_group(gcp, instance_group, num_instances) wait_for_healthy_backends(gcp, backend_service, instance_group) new_instance_names = get_instance_names(gcp, instance_group) wait_until_all_rpcs_go_to_given_backends(new_instance_names, _WAIT_FOR_BACKEND_SEC) def test_change_backend_service(gcp, original_backend_service, instance_group, alternate_backend_service, same_zone_instance_group): logger.info('Running test_change_backend_service') original_backend_instances = get_instance_names(gcp, instance_group) alternate_backend_instances = get_instance_names(gcp, same_zone_instance_group) patch_backend_service(gcp, alternate_backend_service, [same_zone_instance_group]) wait_for_healthy_backends(gcp, original_backend_service, instance_group) wait_for_healthy_backends(gcp, alternate_backend_service, same_zone_instance_group) wait_until_all_rpcs_go_to_given_backends(original_backend_instances, _WAIT_FOR_STATS_SEC) passed = True try: patch_url_map_backend_service(gcp, alternate_backend_service) wait_until_all_rpcs_go_to_given_backends(alternate_backend_instances, _WAIT_FOR_URL_MAP_PATCH_SEC) except Exception: passed = False raise finally: if passed or not args.halt_after_fail: patch_url_map_backend_service(gcp, original_backend_service) patch_backend_service(gcp, alternate_backend_service, []) def test_gentle_failover(gcp, backend_service, primary_instance_group, secondary_instance_group, swapped_primary_and_secondary=False): logger.info('Running test_gentle_failover') num_primary_instances = len(get_instance_names(gcp, primary_instance_group)) min_instances_for_gentle_failover = 3 # Need >50% failure to start failover passed = True try: if num_primary_instances < min_instances_for_gentle_failover: resize_instance_group(gcp, primary_instance_group, min_instances_for_gentle_failover) patch_backend_service( gcp, backend_service, [primary_instance_group, secondary_instance_group]) primary_instance_names = get_instance_names(gcp, primary_instance_group) secondary_instance_names = get_instance_names(gcp, secondary_instance_group) wait_for_healthy_backends(gcp, backend_service, primary_instance_group) wait_for_healthy_backends(gcp, backend_service, secondary_instance_group) wait_until_all_rpcs_go_to_given_backends(primary_instance_names, _WAIT_FOR_STATS_SEC) instances_to_stop = primary_instance_names[:-1] remaining_instances = primary_instance_names[-1:] try: set_serving_status(instances_to_stop, gcp.service_port, serving=False) wait_until_all_rpcs_go_to_given_backends( remaining_instances + secondary_instance_names, _WAIT_FOR_BACKEND_SEC) finally: set_serving_status(primary_instance_names, gcp.service_port, serving=True) except RpcDistributionError as e: if not swapped_primary_and_secondary and is_primary_instance_group( gcp, secondary_instance_group): # Swap expectation of primary and secondary instance groups. test_gentle_failover(gcp, backend_service, secondary_instance_group, primary_instance_group, swapped_primary_and_secondary=True) else: passed = False raise e except Exception: passed = False raise finally: if passed or not args.halt_after_fail: patch_backend_service(gcp, backend_service, [primary_instance_group]) resize_instance_group(gcp, primary_instance_group, num_primary_instances) instance_names = get_instance_names(gcp, primary_instance_group) wait_until_all_rpcs_go_to_given_backends(instance_names, _WAIT_FOR_BACKEND_SEC) def test_load_report_based_failover(gcp, backend_service, primary_instance_group, secondary_instance_group): logger.info('Running test_load_report_based_failover') passed = True try: patch_backend_service( gcp, backend_service, [primary_instance_group, secondary_instance_group]) primary_instance_names = get_instance_names(gcp, primary_instance_group) secondary_instance_names = get_instance_names(gcp, secondary_instance_group) wait_for_healthy_backends(gcp, backend_service, primary_instance_group) wait_for_healthy_backends(gcp, backend_service, secondary_instance_group) wait_until_all_rpcs_go_to_given_backends(primary_instance_names, _WAIT_FOR_STATS_SEC) # Set primary locality's balance mode to RATE, and RPS to 20% of the # client's QPS. The secondary locality will be used. max_rate = int(args.qps * 1 / 5) logger.info('Patching backend service to RATE with %d max_rate', max_rate) patch_backend_service( gcp, backend_service, [primary_instance_group, secondary_instance_group], balancing_mode='RATE', max_rate=max_rate) wait_until_all_rpcs_go_to_given_backends( primary_instance_names + secondary_instance_names, _WAIT_FOR_BACKEND_SEC) # Set primary locality's balance mode to RATE, and RPS to 120% of the # client's QPS. Only the primary locality will be used. max_rate = int(args.qps * 6 / 5) logger.info('Patching backend service to RATE with %d max_rate', max_rate) patch_backend_service( gcp, backend_service, [primary_instance_group, secondary_instance_group], balancing_mode='RATE', max_rate=max_rate) wait_until_all_rpcs_go_to_given_backends(primary_instance_names, _WAIT_FOR_BACKEND_SEC) logger.info("success") except Exception: passed = False raise finally: if passed or not args.halt_after_fail: patch_backend_service(gcp, backend_service, [primary_instance_group]) instance_names = get_instance_names(gcp, primary_instance_group) wait_until_all_rpcs_go_to_given_backends(instance_names, _WAIT_FOR_BACKEND_SEC) def test_ping_pong(gcp, backend_service, instance_group): logger.info('Running test_ping_pong') wait_for_healthy_backends(gcp, backend_service, instance_group) instance_names = get_instance_names(gcp, instance_group) wait_until_all_rpcs_go_to_given_backends(instance_names, _WAIT_FOR_STATS_SEC) def test_remove_instance_group(gcp, backend_service, instance_group, same_zone_instance_group): logger.info('Running test_remove_instance_group') passed = True try: patch_backend_service(gcp, backend_service, [instance_group, same_zone_instance_group], balancing_mode='RATE') wait_for_healthy_backends(gcp, backend_service, instance_group) wait_for_healthy_backends(gcp, backend_service, same_zone_instance_group) instance_names = get_instance_names(gcp, instance_group) same_zone_instance_names = get_instance_names(gcp, same_zone_instance_group) try: wait_until_all_rpcs_go_to_given_backends( instance_names + same_zone_instance_names, _WAIT_FOR_OPERATION_SEC) remaining_instance_group = same_zone_instance_group remaining_instance_names = same_zone_instance_names except RpcDistributionError as e: # If connected to TD in a different zone, we may route traffic to # only one instance group. Determine which group that is to continue # with the remainder of the test case. try: wait_until_all_rpcs_go_to_given_backends( instance_names, _WAIT_FOR_STATS_SEC) remaining_instance_group = same_zone_instance_group remaining_instance_names = same_zone_instance_names except RpcDistributionError as e: wait_until_all_rpcs_go_to_given_backends( same_zone_instance_names, _WAIT_FOR_STATS_SEC) remaining_instance_group = instance_group remaining_instance_names = instance_names patch_backend_service(gcp, backend_service, [remaining_instance_group], balancing_mode='RATE') wait_until_all_rpcs_go_to_given_backends(remaining_instance_names, _WAIT_FOR_BACKEND_SEC) except Exception: passed = False raise finally: if passed or not args.halt_after_fail: patch_backend_service(gcp, backend_service, [instance_group]) wait_until_all_rpcs_go_to_given_backends(instance_names, _WAIT_FOR_BACKEND_SEC) def test_round_robin(gcp, backend_service, instance_group): logger.info('Running test_round_robin') wait_for_healthy_backends(gcp, backend_service, instance_group) instance_names = get_instance_names(gcp, instance_group) threshold = 1 wait_until_all_rpcs_go_to_given_backends(instance_names, _WAIT_FOR_STATS_SEC) # TODO(ericgribkoff) Delayed config propagation from earlier tests # may result in briefly receiving an empty EDS update, resulting in failed # RPCs. Retry distribution validation if this occurs; long-term fix is # creating new backend resources for each individual test case. # Each attempt takes 10 seconds. Config propagation can take several # minutes. max_attempts = 40 for i in range(max_attempts): stats = get_client_stats(_NUM_TEST_RPCS, _WAIT_FOR_STATS_SEC) requests_received = [stats.rpcs_by_peer[x] for x in stats.rpcs_by_peer] total_requests_received = sum(requests_received) if total_requests_received != _NUM_TEST_RPCS: logger.info('Unexpected RPC failures, retrying: %s', stats) continue expected_requests = total_requests_received / len(instance_names) for instance in instance_names: if abs(stats.rpcs_by_peer[instance] - expected_requests) > threshold: raise Exception( 'RPC peer distribution differs from expected by more than %d ' 'for instance %s (%s)' % (threshold, instance, stats)) return raise Exception('RPC failures persisted through %d retries' % max_attempts) def test_secondary_locality_gets_no_requests_on_partial_primary_failure( gcp, backend_service, primary_instance_group, secondary_instance_group, swapped_primary_and_secondary=False): logger.info( 'Running secondary_locality_gets_no_requests_on_partial_primary_failure' ) passed = True try: patch_backend_service( gcp, backend_service, [primary_instance_group, secondary_instance_group]) wait_for_healthy_backends(gcp, backend_service, primary_instance_group) wait_for_healthy_backends(gcp, backend_service, secondary_instance_group) primary_instance_names = get_instance_names(gcp, primary_instance_group) wait_until_all_rpcs_go_to_given_backends(primary_instance_names, _WAIT_FOR_STATS_SEC) instances_to_stop = primary_instance_names[:1] remaining_instances = primary_instance_names[1:] try: set_serving_status(instances_to_stop, gcp.service_port, serving=False) wait_until_all_rpcs_go_to_given_backends(remaining_instances, _WAIT_FOR_BACKEND_SEC) finally: set_serving_status(primary_instance_names, gcp.service_port, serving=True) except RpcDistributionError as e: if not swapped_primary_and_secondary and is_primary_instance_group( gcp, secondary_instance_group): # Swap expectation of primary and secondary instance groups. test_secondary_locality_gets_no_requests_on_partial_primary_failure( gcp, backend_service, secondary_instance_group, primary_instance_group, swapped_primary_and_secondary=True) else: passed = False raise e finally: if passed or not args.halt_after_fail: patch_backend_service(gcp, backend_service, [primary_instance_group]) def test_secondary_locality_gets_requests_on_primary_failure( gcp, backend_service, primary_instance_group, secondary_instance_group, swapped_primary_and_secondary=False): logger.info('Running secondary_locality_gets_requests_on_primary_failure') passed = True try: patch_backend_service( gcp, backend_service, [primary_instance_group, secondary_instance_group]) wait_for_healthy_backends(gcp, backend_service, primary_instance_group) wait_for_healthy_backends(gcp, backend_service, secondary_instance_group) primary_instance_names = get_instance_names(gcp, primary_instance_group) secondary_instance_names = get_instance_names(gcp, secondary_instance_group) wait_until_all_rpcs_go_to_given_backends(primary_instance_names, _WAIT_FOR_STATS_SEC) try: set_serving_status(primary_instance_names, gcp.service_port, serving=False) wait_until_all_rpcs_go_to_given_backends(secondary_instance_names, _WAIT_FOR_BACKEND_SEC) finally: set_serving_status(primary_instance_names, gcp.service_port, serving=True) except RpcDistributionError as e: if not swapped_primary_and_secondary and is_primary_instance_group( gcp, secondary_instance_group): # Swap expectation of primary and secondary instance groups. test_secondary_locality_gets_requests_on_primary_failure( gcp, backend_service, secondary_instance_group, primary_instance_group, swapped_primary_and_secondary=True) else: passed = False raise e finally: if passed or not args.halt_after_fail: patch_backend_service(gcp, backend_service, [primary_instance_group]) def prepare_services_for_urlmap_tests(gcp, original_backend_service, instance_group, alternate_backend_service, same_zone_instance_group): ''' This function prepares the services to be ready for tests that modifies urlmaps. Returns: Returns original and alternate backend names as lists of strings. ''' logger.info('waiting for original backends to become healthy') wait_for_healthy_backends(gcp, original_backend_service, instance_group) patch_backend_service(gcp, alternate_backend_service, [same_zone_instance_group]) logger.info('waiting for alternate to become healthy') wait_for_healthy_backends(gcp, alternate_backend_service, same_zone_instance_group) original_backend_instances = get_instance_names(gcp, instance_group) logger.info('original backends instances: %s', original_backend_instances) alternate_backend_instances = get_instance_names(gcp, same_zone_instance_group) logger.info('alternate backends instances: %s', alternate_backend_instances) # Start with all traffic going to original_backend_service. logger.info('waiting for traffic to all go to original backends') wait_until_all_rpcs_go_to_given_backends(original_backend_instances, _WAIT_FOR_STATS_SEC) return original_backend_instances, alternate_backend_instances def test_metadata_filter(gcp, original_backend_service, instance_group, alternate_backend_service, same_zone_instance_group): logger.info("Running test_metadata_filter") wait_for_healthy_backends(gcp, original_backend_service, instance_group) original_backend_instances = get_instance_names(gcp, instance_group) alternate_backend_instances = get_instance_names(gcp, same_zone_instance_group) patch_backend_service(gcp, alternate_backend_service, [same_zone_instance_group]) wait_for_healthy_backends(gcp, alternate_backend_service, same_zone_instance_group) passed = True try: with open(bootstrap_path) as f: md = json.load(f)['node']['metadata'] match_labels = [] for k, v in list(md.items()): match_labels.append({'name': k, 'value': v}) not_match_labels = [{'name': 'fake', 'value': 'fail'}] test_route_rules = [ # test MATCH_ALL [ { 'priority': 0, 'matchRules': [{ 'prefixMatch': '/', 'metadataFilters': [{ 'filterMatchCriteria': 'MATCH_ALL', 'filterLabels': not_match_labels }] }], 'service': original_backend_service.url }, { 'priority': 1, 'matchRules': [{ 'prefixMatch': '/', 'metadataFilters': [{ 'filterMatchCriteria': 'MATCH_ALL', 'filterLabels': match_labels }] }], 'service': alternate_backend_service.url }, ], # test mixing MATCH_ALL and MATCH_ANY # test MATCH_ALL: super set labels won't match [ { 'priority': 0, 'matchRules': [{ 'prefixMatch': '/', 'metadataFilters': [{ 'filterMatchCriteria': 'MATCH_ALL', 'filterLabels': not_match_labels + match_labels }] }], 'service': original_backend_service.url }, { 'priority': 1, 'matchRules': [{ 'prefixMatch': '/', 'metadataFilters': [{ 'filterMatchCriteria': 'MATCH_ANY', 'filterLabels': not_match_labels + match_labels }] }], 'service': alternate_backend_service.url }, ], # test MATCH_ANY [ { 'priority': 0, 'matchRules': [{ 'prefixMatch': '/', 'metadataFilters': [{ 'filterMatchCriteria': 'MATCH_ANY', 'filterLabels': not_match_labels }] }], 'service': original_backend_service.url }, { 'priority': 1, 'matchRules': [{ 'prefixMatch': '/', 'metadataFilters': [{ 'filterMatchCriteria': 'MATCH_ANY', 'filterLabels': not_match_labels + match_labels }] }], 'service': alternate_backend_service.url }, ], # test match multiple route rules [ { 'priority': 0, 'matchRules': [{ 'prefixMatch': '/', 'metadataFilters': [{ 'filterMatchCriteria': 'MATCH_ANY', 'filterLabels': match_labels }] }], 'service': alternate_backend_service.url }, { 'priority': 1, 'matchRules': [{ 'prefixMatch': '/', 'metadataFilters': [{ 'filterMatchCriteria': 'MATCH_ALL', 'filterLabels': match_labels }] }], 'service': original_backend_service.url }, ] ] for route_rules in test_route_rules: wait_until_all_rpcs_go_to_given_backends(original_backend_instances, _WAIT_FOR_STATS_SEC) patch_url_map_backend_service(gcp, original_backend_service, route_rules=route_rules) wait_until_no_rpcs_go_to_given_backends(original_backend_instances, _WAIT_FOR_STATS_SEC) wait_until_all_rpcs_go_to_given_backends( alternate_backend_instances, _WAIT_FOR_STATS_SEC) patch_url_map_backend_service(gcp, original_backend_service) except Exception: passed = False raise finally: if passed or not args.halt_after_fail: patch_backend_service(gcp, alternate_backend_service, []) def test_api_listener(gcp, backend_service, instance_group, alternate_backend_service): logger.info("Running api_listener") passed = True new_config_suffix = '' try: wait_for_healthy_backends(gcp, backend_service, instance_group) backend_instances = get_instance_names(gcp, instance_group) wait_until_all_rpcs_go_to_given_backends(backend_instances, _WAIT_FOR_STATS_SEC) # create a second suite of map+tp+fr with the same host name in host rule # and we have to disable proxyless validation because it needs `0.0.0.0` # ip address in fr for proxyless and also we violate ip:port uniqueness # for test purpose. See https://github.com/grpc/grpc-java/issues/8009 new_config_suffix = '2' create_url_map(gcp, url_map_name + new_config_suffix, backend_service, service_host_name) create_target_proxy(gcp, target_proxy_name + new_config_suffix, False) if not gcp.service_port: raise Exception( 'Faied to find a valid port for the forwarding rule') potential_ip_addresses = [] max_attempts = 10 for i in range(max_attempts): potential_ip_addresses.append('10.10.10.%d' % (random.randint(0, 255))) create_global_forwarding_rule(gcp, forwarding_rule_name + new_config_suffix, [gcp.service_port], potential_ip_addresses) if gcp.service_port != _DEFAULT_SERVICE_PORT: patch_url_map_host_rule_with_port(gcp, url_map_name + new_config_suffix, backend_service, service_host_name) wait_until_all_rpcs_go_to_given_backends(backend_instances, _WAIT_FOR_STATS_SEC) delete_global_forwarding_rule(gcp, forwarding_rule_name) delete_target_proxy(gcp, target_proxy_name) delete_url_map(gcp, url_map_name) verify_attempts = int(_WAIT_FOR_URL_MAP_PATCH_SEC / _NUM_TEST_RPCS * args.qps) for i in range(verify_attempts): wait_until_all_rpcs_go_to_given_backends(backend_instances, _WAIT_FOR_STATS_SEC) # delete host rule for the original host name patch_url_map_backend_service(gcp, alternate_backend_service) wait_until_no_rpcs_go_to_given_backends(backend_instances, _WAIT_FOR_STATS_SEC) except Exception: passed = False raise finally: if passed or not args.halt_after_fail: delete_global_forwarding_rule( gcp, forwarding_rule_name + new_config_suffix) delete_target_proxy(gcp, target_proxy_name + new_config_suffix) delete_url_map(gcp, url_map_name + new_config_suffix) create_url_map(gcp, url_map_name, backend_service, service_host_name) create_target_proxy(gcp, target_proxy_name) create_global_forwarding_rule(gcp, forwarding_rule_name, potential_service_ports) if gcp.service_port != _DEFAULT_SERVICE_PORT: patch_url_map_host_rule_with_port(gcp, url_map_name, backend_service, service_host_name) server_uri = service_host_name + ':' + str(gcp.service_port) else: server_uri = service_host_name return server_uri def test_forwarding_rule_port_match(gcp, backend_service, instance_group): logger.info("Running test_forwarding_rule_port_match") passed = True try: wait_for_healthy_backends(gcp, backend_service, instance_group) backend_instances = get_instance_names(gcp, instance_group) wait_until_all_rpcs_go_to_given_backends(backend_instances, _WAIT_FOR_STATS_SEC) delete_global_forwarding_rule(gcp) create_global_forwarding_rule(gcp, forwarding_rule_name, [ x for x in parse_port_range(_DEFAULT_PORT_RANGE) if x != gcp.service_port ]) wait_until_no_rpcs_go_to_given_backends(backend_instances, _WAIT_FOR_STATS_SEC) except Exception: passed = False raise finally: if passed or not args.halt_after_fail: delete_global_forwarding_rule(gcp) create_global_forwarding_rule(gcp, forwarding_rule_name, potential_service_ports) if gcp.service_port != _DEFAULT_SERVICE_PORT: patch_url_map_host_rule_with_port(gcp, url_map_name, backend_service, service_host_name) server_uri = service_host_name + ':' + str(gcp.service_port) else: server_uri = service_host_name return server_uri def test_forwarding_rule_default_port(gcp, backend_service, instance_group): logger.info("Running test_forwarding_rule_default_port") passed = True try: wait_for_healthy_backends(gcp, backend_service, instance_group) backend_instances = get_instance_names(gcp, instance_group) if gcp.service_port == _DEFAULT_SERVICE_PORT: wait_until_all_rpcs_go_to_given_backends(backend_instances, _WAIT_FOR_STATS_SEC) delete_global_forwarding_rule(gcp) create_global_forwarding_rule(gcp, forwarding_rule_name, parse_port_range(_DEFAULT_PORT_RANGE)) patch_url_map_host_rule_with_port(gcp, url_map_name, backend_service, service_host_name) wait_until_no_rpcs_go_to_given_backends(backend_instances, _WAIT_FOR_STATS_SEC) # expect success when no port in client request service uri, and no port in url-map delete_global_forwarding_rule(gcp) delete_target_proxy(gcp) delete_url_map(gcp) create_url_map(gcp, url_map_name, backend_service, service_host_name) create_target_proxy(gcp, gcp.target_proxy.name, False) potential_ip_addresses = [] max_attempts = 10 for i in range(max_attempts): potential_ip_addresses.append('10.10.10.%d' % (random.randint(0, 255))) create_global_forwarding_rule(gcp, forwarding_rule_name, [80], potential_ip_addresses) wait_until_all_rpcs_go_to_given_backends(backend_instances, _WAIT_FOR_STATS_SEC) # expect failure when no port in client request uri, but specify port in url-map patch_url_map_host_rule_with_port(gcp, url_map_name, backend_service, service_host_name) wait_until_no_rpcs_go_to_given_backends(backend_instances, _WAIT_FOR_STATS_SEC) except Exception: passed = False raise finally: if passed or not args.halt_after_fail: delete_global_forwarding_rule(gcp) delete_target_proxy(gcp) delete_url_map(gcp) create_url_map(gcp, url_map_name, backend_service, service_host_name) create_target_proxy(gcp, target_proxy_name) create_global_forwarding_rule(gcp, forwarding_rule_name, potential_service_ports) if gcp.service_port != _DEFAULT_SERVICE_PORT: patch_url_map_host_rule_with_port(gcp, url_map_name, backend_service, service_host_name) server_uri = service_host_name + ':' + str(gcp.service_port) else: server_uri = service_host_name return server_uri def test_traffic_splitting(gcp, original_backend_service, instance_group, alternate_backend_service, same_zone_instance_group): # This test start with all traffic going to original_backend_service. Then # it updates URL-map to set default action to traffic splitting between # original and alternate. It waits for all backends in both services to # receive traffic, then verifies that weights are expected. logger.info('Running test_traffic_splitting') original_backend_instances, alternate_backend_instances = prepare_services_for_urlmap_tests( gcp, original_backend_service, instance_group, alternate_backend_service, same_zone_instance_group) passed = True try: # Patch urlmap, change route action to traffic splitting between # original and alternate. logger.info('patching url map with traffic splitting') original_service_percentage, alternate_service_percentage = 20, 80 patch_url_map_backend_service( gcp, services_with_weights={ original_backend_service: original_service_percentage, alternate_backend_service: alternate_service_percentage, }) # Split percentage between instances: [20,80] -> [10,10,40,40]. expected_instance_percentage = [ original_service_percentage * 1.0 / len(original_backend_instances) ] * len(original_backend_instances) + [ alternate_service_percentage * 1.0 / len(alternate_backend_instances) ] * len(alternate_backend_instances) # Wait for traffic to go to both services. logger.info( 'waiting for traffic to go to all backends (including alternate)') wait_until_all_rpcs_go_to_given_backends( original_backend_instances + alternate_backend_instances, _WAIT_FOR_STATS_SEC) # Verify that weights between two services are expected. retry_count = 10 # Each attempt takes about 10 seconds, 10 retries is equivalent to 100 # seconds timeout. for i in range(retry_count): stats = get_client_stats(_NUM_TEST_RPCS, _WAIT_FOR_STATS_SEC) got_instance_count = [ stats.rpcs_by_peer[i] for i in original_backend_instances ] + [stats.rpcs_by_peer[i] for i in alternate_backend_instances] total_count = sum(got_instance_count) got_instance_percentage = [ x * 100.0 / total_count for x in got_instance_count ] try: compare_distributions(got_instance_percentage, expected_instance_percentage, 5) except Exception as e: logger.info('attempt %d', i) logger.info('got percentage: %s', got_instance_percentage) logger.info('expected percentage: %s', expected_instance_percentage) logger.info(e) if i == retry_count - 1: raise Exception( 'RPC distribution (%s) differs from expected (%s)' % (got_instance_percentage, expected_instance_percentage)) else: logger.info("success") break except Exception: passed = False raise finally: if passed or not args.halt_after_fail: patch_url_map_backend_service(gcp, original_backend_service) patch_backend_service(gcp, alternate_backend_service, []) def test_path_matching(gcp, original_backend_service, instance_group, alternate_backend_service, same_zone_instance_group): # This test start with all traffic (UnaryCall and EmptyCall) going to # original_backend_service. # # Then it updates URL-map to add routes, to make UnaryCall and EmptyCall to # go different backends. It waits for all backends in both services to # receive traffic, then verifies that traffic goes to the expected # backends. logger.info('Running test_path_matching') original_backend_instances, alternate_backend_instances = prepare_services_for_urlmap_tests( gcp, original_backend_service, instance_group, alternate_backend_service, same_zone_instance_group) passed = True try: # A list of tuples (route_rules, expected_instances). test_cases = [ ( [{ 'priority': 0, # FullPath EmptyCall -> alternate_backend_service. 'matchRules': [{ 'fullPathMatch': '/grpc.testing.TestService/EmptyCall' }], 'service': alternate_backend_service.url }], { "EmptyCall": alternate_backend_instances, "UnaryCall": original_backend_instances }), ( [{ 'priority': 0, # Prefix UnaryCall -> alternate_backend_service. 'matchRules': [{ 'prefixMatch': '/grpc.testing.TestService/Unary' }], 'service': alternate_backend_service.url }], { "UnaryCall": alternate_backend_instances, "EmptyCall": original_backend_instances }), ( # This test case is similar to the one above (but with route # services swapped). This test has two routes (full_path and # the default) to match EmptyCall, and both routes set # alternative_backend_service as the action. This forces the # client to handle duplicate Clusters in the RDS response. [ { 'priority': 0, # Prefix UnaryCall -> original_backend_service. 'matchRules': [{ 'prefixMatch': '/grpc.testing.TestService/Unary' }], 'service': original_backend_service.url }, { 'priority': 1, # FullPath EmptyCall -> alternate_backend_service. 'matchRules': [{ 'fullPathMatch': '/grpc.testing.TestService/EmptyCall' }], 'service': alternate_backend_service.url } ], { "UnaryCall": original_backend_instances, "EmptyCall": alternate_backend_instances }), ( [{ 'priority': 0, # Regex UnaryCall -> alternate_backend_service. 'matchRules': [{ 'regexMatch': '^\/.*\/UnaryCall$' # Unary methods with any services. }], 'service': alternate_backend_service.url }], { "UnaryCall": alternate_backend_instances, "EmptyCall": original_backend_instances }), ( [{ 'priority': 0, # ignoreCase EmptyCall -> alternate_backend_service. 'matchRules': [{ # Case insensitive matching. 'fullPathMatch': '/gRpC.tEsTinG.tEstseRvice/empTycaLl', 'ignoreCase': True, }], 'service': alternate_backend_service.url }], { "UnaryCall": original_backend_instances, "EmptyCall": alternate_backend_instances }), ] for (route_rules, expected_instances) in test_cases: logger.info('patching url map with %s', route_rules) patch_url_map_backend_service(gcp, original_backend_service, route_rules=route_rules) # Wait for traffic to go to both services. logger.info( 'waiting for traffic to go to all backends (including alternate)' ) wait_until_all_rpcs_go_to_given_backends( original_backend_instances + alternate_backend_instances, _WAIT_FOR_STATS_SEC) retry_count = 80 # Each attempt takes about 5 seconds, 80 retries is equivalent to 400 # seconds timeout. for i in range(retry_count): stats = get_client_stats(_NUM_TEST_RPCS, _WAIT_FOR_STATS_SEC) if not stats.rpcs_by_method: raise ValueError( 'stats.rpcs_by_method is None, the interop client stats service does not support this test case' ) logger.info('attempt %d', i) if compare_expected_instances(stats, expected_instances): logger.info("success") break elif i == retry_count - 1: raise Exception( 'timeout waiting for RPCs to the expected instances: %s' % expected_instances) except Exception: passed = False raise finally: if passed or not args.halt_after_fail: patch_url_map_backend_service(gcp, original_backend_service) patch_backend_service(gcp, alternate_backend_service, []) def test_header_matching(gcp, original_backend_service, instance_group, alternate_backend_service, same_zone_instance_group): # This test start with all traffic (UnaryCall and EmptyCall) going to # original_backend_service. # # Then it updates URL-map to add routes, to make RPCs with test headers to # go to different backends. It waits for all backends in both services to # receive traffic, then verifies that traffic goes to the expected # backends. logger.info('Running test_header_matching') original_backend_instances, alternate_backend_instances = prepare_services_for_urlmap_tests( gcp, original_backend_service, instance_group, alternate_backend_service, same_zone_instance_group) passed = True try: # A list of tuples (route_rules, expected_instances). test_cases = [ ( [{ 'priority': 0, # Header ExactMatch -> alternate_backend_service. # EmptyCall is sent with the metadata. 'matchRules': [{ 'prefixMatch': '/', 'headerMatches': [{ 'headerName': _TEST_METADATA_KEY, 'exactMatch': _TEST_METADATA_VALUE_EMPTY }] }], 'service': alternate_backend_service.url }], { "EmptyCall": alternate_backend_instances, "UnaryCall": original_backend_instances }), ( [{ 'priority': 0, # Header PrefixMatch -> alternate_backend_service. # UnaryCall is sent with the metadata. 'matchRules': [{ 'prefixMatch': '/', 'headerMatches': [{ 'headerName': _TEST_METADATA_KEY, 'prefixMatch': _TEST_METADATA_VALUE_UNARY[:2] }] }], 'service': alternate_backend_service.url }], { "EmptyCall": original_backend_instances, "UnaryCall": alternate_backend_instances }), ( [{ 'priority': 0, # Header SuffixMatch -> alternate_backend_service. # EmptyCall is sent with the metadata. 'matchRules': [{ 'prefixMatch': '/', 'headerMatches': [{ 'headerName': _TEST_METADATA_KEY, 'suffixMatch': _TEST_METADATA_VALUE_EMPTY[-2:] }] }], 'service': alternate_backend_service.url }], { "EmptyCall": alternate_backend_instances, "UnaryCall": original_backend_instances }), ( [{ 'priority': 0, # Header 'xds_md_numeric' present -> alternate_backend_service. # UnaryCall is sent with the metadata, so will be sent to alternative. 'matchRules': [{ 'prefixMatch': '/', 'headerMatches': [{ 'headerName': _TEST_METADATA_NUMERIC_KEY, 'presentMatch': True }] }], 'service': alternate_backend_service.url }], { "EmptyCall": original_backend_instances, "UnaryCall": alternate_backend_instances }), ( [{ 'priority': 0, # Header invert ExactMatch -> alternate_backend_service. # UnaryCall is sent with the metadata, so will be sent to # original. EmptyCall will be sent to alternative. 'matchRules': [{ 'prefixMatch': '/', 'headerMatches': [{ 'headerName': _TEST_METADATA_KEY, 'exactMatch': _TEST_METADATA_VALUE_UNARY, 'invertMatch': True }] }], 'service': alternate_backend_service.url }], { "EmptyCall": alternate_backend_instances, "UnaryCall": original_backend_instances }), ( [{ 'priority': 0, # Header 'xds_md_numeric' range [100,200] -> alternate_backend_service. # UnaryCall is sent with the metadata in range. 'matchRules': [{ 'prefixMatch': '/', 'headerMatches': [{ 'headerName': _TEST_METADATA_NUMERIC_KEY, 'rangeMatch': { 'rangeStart': '100', 'rangeEnd': '200' } }] }], 'service': alternate_backend_service.url }], { "EmptyCall": original_backend_instances, "UnaryCall": alternate_backend_instances }), ( [{ 'priority': 0, # Header RegexMatch -> alternate_backend_service. # EmptyCall is sent with the metadata. 'matchRules': [{ 'prefixMatch': '/', 'headerMatches': [{ 'headerName': _TEST_METADATA_KEY, 'regexMatch': "^%s.*%s$" % (_TEST_METADATA_VALUE_EMPTY[:2], _TEST_METADATA_VALUE_EMPTY[-2:]) }] }], 'service': alternate_backend_service.url }], { "EmptyCall": alternate_backend_instances, "UnaryCall": original_backend_instances }), ] for (route_rules, expected_instances) in test_cases: logger.info('patching url map with %s -> alternative', route_rules[0]['matchRules']) patch_url_map_backend_service(gcp, original_backend_service, route_rules=route_rules) # Wait for traffic to go to both services. logger.info( 'waiting for traffic to go to all backends (including alternate)' ) wait_until_all_rpcs_go_to_given_backends( original_backend_instances + alternate_backend_instances, _WAIT_FOR_STATS_SEC) retry_count = 80 # Each attempt takes about 5 seconds, 80 retries is equivalent to 400 # seconds timeout. for i in range(retry_count): stats = get_client_stats(_NUM_TEST_RPCS, _WAIT_FOR_STATS_SEC) if not stats.rpcs_by_method: raise ValueError( 'stats.rpcs_by_method is None, the interop client stats service does not support this test case' ) logger.info('attempt %d', i) if compare_expected_instances(stats, expected_instances): logger.info("success") break elif i == retry_count - 1: raise Exception( 'timeout waiting for RPCs to the expected instances: %s' % expected_instances) except Exception: passed = False raise finally: if passed or not args.halt_after_fail: patch_url_map_backend_service(gcp, original_backend_service) patch_backend_service(gcp, alternate_backend_service, []) def test_circuit_breaking(gcp, original_backend_service, instance_group, same_zone_instance_group): ''' Since backend service circuit_breakers configuration cannot be unset, which causes trouble for restoring validate_for_proxy flag in target proxy/global forwarding rule. This test uses dedicated backend sevices. The url_map and backend services undergoes the following state changes: Before test: original_backend_service -> [instance_group] extra_backend_service -> [] more_extra_backend_service -> [] url_map -> [original_backend_service] In test: extra_backend_service (with circuit_breakers) -> [instance_group] more_extra_backend_service (with circuit_breakers) -> [same_zone_instance_group] url_map -> [extra_backend_service, more_extra_backend_service] After test: original_backend_service -> [instance_group] extra_backend_service (with circuit_breakers) -> [] more_extra_backend_service (with circuit_breakers) -> [] url_map -> [original_backend_service] ''' logger.info('Running test_circuit_breaking') additional_backend_services = [] passed = True try: # TODO(chengyuanzhang): Dedicated backend services created for circuit # breaking test. Once the issue for unsetting backend service circuit # breakers is resolved or configuring backend service circuit breakers is # enabled for config validation, these dedicated backend services can be # eliminated. extra_backend_service_name = _BASE_BACKEND_SERVICE_NAME + '-extra' + gcp_suffix more_extra_backend_service_name = _BASE_BACKEND_SERVICE_NAME + '-more-extra' + gcp_suffix extra_backend_service = add_backend_service(gcp, extra_backend_service_name) additional_backend_services.append(extra_backend_service) more_extra_backend_service = add_backend_service( gcp, more_extra_backend_service_name) additional_backend_services.append(more_extra_backend_service) # The config validation for proxyless doesn't allow setting # circuit_breakers. Disable validate validate_for_proxyless # for this test. This can be removed when validation # accepts circuit_breakers. logger.info('disabling validate_for_proxyless in target proxy') set_validate_for_proxyless(gcp, False) extra_backend_service_max_requests = 500 more_extra_backend_service_max_requests = 1000 patch_backend_service(gcp, extra_backend_service, [instance_group], circuit_breakers={ 'maxRequests': extra_backend_service_max_requests }) logger.info('Waiting for extra backends to become healthy') wait_for_healthy_backends(gcp, extra_backend_service, instance_group) patch_backend_service(gcp, more_extra_backend_service, [same_zone_instance_group], circuit_breakers={ 'maxRequests': more_extra_backend_service_max_requests }) logger.info('Waiting for more extra backend to become healthy') wait_for_healthy_backends(gcp, more_extra_backend_service, same_zone_instance_group) extra_backend_instances = get_instance_names(gcp, instance_group) more_extra_backend_instances = get_instance_names( gcp, same_zone_instance_group) route_rules = [ { 'priority': 0, # UnaryCall -> extra_backend_service 'matchRules': [{ 'fullPathMatch': '/grpc.testing.TestService/UnaryCall' }], 'service': extra_backend_service.url }, { 'priority': 1, # EmptyCall -> more_extra_backend_service 'matchRules': [{ 'fullPathMatch': '/grpc.testing.TestService/EmptyCall' }], 'service': more_extra_backend_service.url }, ] # Make client send UNARY_CALL and EMPTY_CALL. configure_client([ messages_pb2.ClientConfigureRequest.RpcType.UNARY_CALL, messages_pb2.ClientConfigureRequest.RpcType.EMPTY_CALL ]) logger.info('Patching url map with %s', route_rules) patch_url_map_backend_service(gcp, extra_backend_service, route_rules=route_rules) logger.info('Waiting for traffic to go to all backends') wait_until_all_rpcs_go_to_given_backends( extra_backend_instances + more_extra_backend_instances, _WAIT_FOR_STATS_SEC) # Make all calls keep-open. configure_client([ messages_pb2.ClientConfigureRequest.RpcType.UNARY_CALL, messages_pb2.ClientConfigureRequest.RpcType.EMPTY_CALL ], [(messages_pb2.ClientConfigureRequest.RpcType.UNARY_CALL, 'rpc-behavior', 'keep-open'), (messages_pb2.ClientConfigureRequest.RpcType.EMPTY_CALL, 'rpc-behavior', 'keep-open')]) wait_until_rpcs_in_flight( 'UNARY_CALL', (_WAIT_FOR_BACKEND_SEC + int(extra_backend_service_max_requests / args.qps)), extra_backend_service_max_requests, 1) logger.info('UNARY_CALL reached stable state (%d)', extra_backend_service_max_requests) wait_until_rpcs_in_flight( 'EMPTY_CALL', (_WAIT_FOR_BACKEND_SEC + int(more_extra_backend_service_max_requests / args.qps)), more_extra_backend_service_max_requests, 1) logger.info('EMPTY_CALL reached stable state (%d)', more_extra_backend_service_max_requests) # Increment circuit breakers max_requests threshold. extra_backend_service_max_requests = 800 patch_backend_service(gcp, extra_backend_service, [instance_group], circuit_breakers={ 'maxRequests': extra_backend_service_max_requests }) wait_until_rpcs_in_flight( 'UNARY_CALL', (_WAIT_FOR_BACKEND_SEC + int(extra_backend_service_max_requests / args.qps)), extra_backend_service_max_requests, 1) logger.info('UNARY_CALL reached stable state after increase (%d)', extra_backend_service_max_requests) logger.info('success') # Avoid new RPCs being outstanding (some test clients create threads # for sending RPCs) after restoring backend services. configure_client( [messages_pb2.ClientConfigureRequest.RpcType.UNARY_CALL]) except Exception: passed = False raise finally: if passed or not args.halt_after_fail: patch_url_map_backend_service(gcp, original_backend_service) patch_backend_service(gcp, original_backend_service, [instance_group]) for backend_service in additional_backend_services: delete_backend_service(gcp, backend_service) set_validate_for_proxyless(gcp, True) def test_timeout(gcp, original_backend_service, instance_group): logger.info('Running test_timeout') logger.info('waiting for original backends to become healthy') wait_for_healthy_backends(gcp, original_backend_service, instance_group) # UnaryCall -> maxStreamDuration:3s route_rules = [{ 'priority': 0, 'matchRules': [{ 'fullPathMatch': '/grpc.testing.TestService/UnaryCall' }], 'service': original_backend_service.url, 'routeAction': { 'maxStreamDuration': { 'seconds': 3, }, }, }] patch_url_map_backend_service(gcp, original_backend_service, route_rules=route_rules) # A list of tuples (testcase_name, {client_config}, {expected_results}) test_cases = [ ( 'timeout_exceeded (UNARY_CALL), timeout_different_route (EMPTY_CALL)', # UnaryCall and EmptyCall both sleep-4. # UnaryCall timeouts, EmptyCall succeeds. { 'rpc_types': [ messages_pb2.ClientConfigureRequest.RpcType.UNARY_CALL, messages_pb2.ClientConfigureRequest.RpcType.EMPTY_CALL, ], 'metadata': [ (messages_pb2.ClientConfigureRequest.RpcType.UNARY_CALL, 'rpc-behavior', 'sleep-4'), (messages_pb2.ClientConfigureRequest.RpcType.EMPTY_CALL, 'rpc-behavior', 'sleep-4'), ], }, { 'UNARY_CALL': 4, # DEADLINE_EXCEEDED 'EMPTY_CALL': 0, }, ), ( 'app_timeout_exceeded', # UnaryCall only with sleep-2; timeout=1s; calls timeout. { 'rpc_types': [ messages_pb2.ClientConfigureRequest.RpcType.UNARY_CALL, ], 'metadata': [ (messages_pb2.ClientConfigureRequest.RpcType.UNARY_CALL, 'rpc-behavior', 'sleep-2'), ], 'timeout_sec': 1, }, { 'UNARY_CALL': 4, # DEADLINE_EXCEEDED }, ), ( 'timeout_not_exceeded', # UnaryCall only with no sleep; calls succeed. { 'rpc_types': [ messages_pb2.ClientConfigureRequest.RpcType.UNARY_CALL, ], }, { 'UNARY_CALL': 0, }, ) ] passed = True try: first_case = True for (testcase_name, client_config, expected_results) in test_cases: logger.info('starting case %s', testcase_name) configure_client(**client_config) # wait a second to help ensure the client stops sending RPCs with # the old config. We will make multiple attempts if it is failing, # but this improves confidence that the test is valid if the # previous client_config would lead to the same results. time.sleep(1) # Each attempt takes 10 seconds; 20 attempts is equivalent to 200 # second timeout. attempt_count = 20 if first_case: attempt_count = 120 first_case = False before_stats = get_client_accumulated_stats() if not before_stats.stats_per_method: raise ValueError( 'stats.stats_per_method is None, the interop client stats service does not support this test case' ) for i in range(attempt_count): logger.info('%s: attempt %d', testcase_name, i) test_runtime_secs = 10 time.sleep(test_runtime_secs) after_stats = get_client_accumulated_stats() success = True for rpc, status in list(expected_results.items()): qty = (after_stats.stats_per_method[rpc].result[status] - before_stats.stats_per_method[rpc].result[status]) want = test_runtime_secs * args.qps # Allow 10% deviation from expectation to reduce flakiness if qty < (want * .9) or qty > (want * 1.1): logger.info('%s: failed due to %s[%s]: got %d want ~%d', testcase_name, rpc, status, qty, want) success = False if success: logger.info('success') break logger.info('%s attempt %d failed', testcase_name, i) before_stats = after_stats else: raise Exception( '%s: timeout waiting for expected results: %s; got %s' % (testcase_name, expected_results, after_stats.stats_per_method)) except Exception: passed = False raise finally: if passed or not args.halt_after_fail: patch_url_map_backend_service(gcp, original_backend_service) def test_fault_injection(gcp, original_backend_service, instance_group): logger.info('Running test_fault_injection') logger.info('waiting for original backends to become healthy') wait_for_healthy_backends(gcp, original_backend_service, instance_group) testcase_header = 'fi_testcase' def _route(pri, name, fi_policy): return { 'priority': pri, 'matchRules': [{ 'prefixMatch': '/', 'headerMatches': [{ 'headerName': testcase_header, 'exactMatch': name, }], }], 'service': original_backend_service.url, 'routeAction': { 'faultInjectionPolicy': fi_policy }, } def _abort(pct): return { 'abort': { 'httpStatus': 401, 'percentage': pct, } } def _delay(pct): return { 'delay': { 'fixedDelay': { 'seconds': '20' }, 'percentage': pct, } } zero_route = _abort(0) zero_route.update(_delay(0)) route_rules = [ _route(0, 'zero_percent_fault_injection', zero_route), _route(1, 'always_delay', _delay(100)), _route(2, 'always_abort', _abort(100)), _route(3, 'delay_half', _delay(50)), _route(4, 'abort_half', _abort(50)), { 'priority': 5, 'matchRules': [{ 'prefixMatch': '/' }], 'service': original_backend_service.url, }, ] set_validate_for_proxyless(gcp, False) patch_url_map_backend_service(gcp, original_backend_service, route_rules=route_rules) # A list of tuples (testcase_name, {client_config}, {code: percent}). Each # test case will set the testcase_header with the testcase_name for routing # to the appropriate config for the case, defined above. test_cases = [ ( 'zero_percent_fault_injection', {}, { 0: 1 }, # OK ), ( 'non_matching_fault_injection', # Not in route_rules, above. {}, { 0: 1 }, # OK ), ( 'always_delay', { 'timeout_sec': 2 }, { 4: 1 }, # DEADLINE_EXCEEDED ), ( 'always_abort', {}, { 16: 1 }, # UNAUTHENTICATED ), ( 'delay_half', { 'timeout_sec': 2 }, { 4: .5, 0: .5 }, # DEADLINE_EXCEEDED / OK: 50% / 50% ), ( 'abort_half', {}, { 16: .5, 0: .5 }, # UNAUTHENTICATED / OK: 50% / 50% ) ] passed = True try: first_case = True for (testcase_name, client_config, expected_results) in test_cases: logger.info('starting case %s', testcase_name) client_config['metadata'] = [ (messages_pb2.ClientConfigureRequest.RpcType.UNARY_CALL, testcase_header, testcase_name) ] client_config['rpc_types'] = [ messages_pb2.ClientConfigureRequest.RpcType.UNARY_CALL, ] configure_client(**client_config) # wait a second to help ensure the client stops sending RPCs with # the old config. We will make multiple attempts if it is failing, # but this improves confidence that the test is valid if the # previous client_config would lead to the same results. time.sleep(1) # Each attempt takes 10 seconds; 20 attempts is equivalent to 200 # second timeout. attempt_count = 20 if first_case: attempt_count = 120 first_case = False before_stats = get_client_accumulated_stats() if not before_stats.stats_per_method: raise ValueError( 'stats.stats_per_method is None, the interop client stats service does not support this test case' ) for i in range(attempt_count): logger.info('%s: attempt %d', testcase_name, i) test_runtime_secs = 10 time.sleep(test_runtime_secs) after_stats = get_client_accumulated_stats() success = True for status, pct in list(expected_results.items()): rpc = 'UNARY_CALL' qty = (after_stats.stats_per_method[rpc].result[status] - before_stats.stats_per_method[rpc].result[status]) want = pct * args.qps * test_runtime_secs # Allow 10% deviation from expectation to reduce flakiness VARIANCE_ALLOWED = 0.1 if abs(qty - want) > want * VARIANCE_ALLOWED: logger.info('%s: failed due to %s[%s]: got %d want ~%d', testcase_name, rpc, status, qty, want) success = False if success: logger.info('success') break logger.info('%s attempt %d failed', testcase_name, i) before_stats = after_stats else: raise Exception( '%s: timeout waiting for expected results: %s; got %s' % (testcase_name, expected_results, after_stats.stats_per_method)) except Exception: passed = False raise finally: if passed or not args.halt_after_fail: patch_url_map_backend_service(gcp, original_backend_service) set_validate_for_proxyless(gcp, True) def test_csds(gcp, original_backend_service, instance_group, server_uri): test_csds_timeout_s = datetime.timedelta(minutes=5).total_seconds() sleep_interval_between_attempts_s = datetime.timedelta( seconds=2).total_seconds() logger.info('Running test_csds') logger.info('waiting for original backends to become healthy') wait_for_healthy_backends(gcp, original_backend_service, instance_group) # Test case timeout: 5 minutes deadline = time.time() + test_csds_timeout_s cnt = 0 while time.time() <= deadline: client_config = get_client_xds_config_dump() logger.info('test_csds attempt %d: received xDS config %s', cnt, json.dumps(client_config, indent=2)) if client_config is not None: # Got the xDS config dump, now validate it ok = True try: if client_config['node']['locality']['zone'] != args.zone: logger.info('Invalid zone %s != %s', client_config['node']['locality']['zone'], args.zone) ok = False seen = set() for xds_config in client_config['xds_config']: if 'listener_config' in xds_config: listener_name = xds_config['listener_config'][ 'dynamic_listeners'][0]['active_state']['listener'][ 'name'] if listener_name != server_uri: logger.info('Invalid Listener name %s != %s', listener_name, server_uri) ok = False else: seen.add('lds') elif 'route_config' in xds_config: num_vh = len( xds_config['route_config']['dynamic_route_configs'] [0]['route_config']['virtual_hosts']) if num_vh <= 0: logger.info('Invalid number of VirtualHosts %s', num_vh) ok = False else: seen.add('rds') elif 'cluster_config' in xds_config: cluster_type = xds_config['cluster_config'][ 'dynamic_active_clusters'][0]['cluster']['type'] if cluster_type != 'EDS': logger.info('Invalid cluster type %s != EDS', cluster_type) ok = False else: seen.add('cds') elif 'endpoint_config' in xds_config: sub_zone = xds_config["endpoint_config"][ "dynamic_endpoint_configs"][0]["endpoint_config"][ "endpoints"][0]["locality"]["sub_zone"] if args.zone not in sub_zone: logger.info('Invalid endpoint sub_zone %s', sub_zone) ok = False else: seen.add('eds') want = {'lds', 'rds', 'cds', 'eds'} if seen != want: logger.info('Incomplete xDS config dump, seen=%s', seen) ok = False except: logger.exception('Error in xDS config dump:') ok = False finally: if ok: # Successfully fetched xDS config, and they looks good. logger.info('success') return logger.info('test_csds attempt %d failed', cnt) # Give the client some time to fetch xDS resources time.sleep(sleep_interval_between_attempts_s) cnt += 1 raise RuntimeError('failed to receive a valid xDS config in %s seconds' % test_csds_timeout_s) def set_validate_for_proxyless(gcp, validate_for_proxyless): if not gcp.alpha_compute: logger.debug( 'Not setting validateForProxy because alpha is not enabled') return # This function deletes global_forwarding_rule and target_proxy, then # recreate target_proxy with validateForProxyless=False. This is necessary # because patching target_grpc_proxy isn't supported. delete_global_forwarding_rule(gcp) delete_target_proxy(gcp) create_target_proxy(gcp, gcp.target_proxy.name, validate_for_proxyless) create_global_forwarding_rule(gcp, gcp.global_forwarding_rule.name, [gcp.service_port]) def get_serving_status(instance, service_port): with grpc.insecure_channel('%s:%d' % (instance, service_port)) as channel: health_stub = health_pb2_grpc.HealthStub(channel) return health_stub.Check(health_pb2.HealthCheckRequest()) def set_serving_status(instances, service_port, serving): logger.info('setting %s serving status to %s', instances, serving) for instance in instances: with grpc.insecure_channel('%s:%d' % (instance, service_port)) as channel: logger.info('setting %s serving status to %s', instance, serving) stub = test_pb2_grpc.XdsUpdateHealthServiceStub(channel) retry_count = 5 for i in range(5): if serving: stub.SetServing(empty_pb2.Empty()) else: stub.SetNotServing(empty_pb2.Empty()) serving_status = get_serving_status(instance, service_port) logger.info('got instance service status %s', serving_status) want_status = health_pb2.HealthCheckResponse.SERVING if serving else health_pb2.HealthCheckResponse.NOT_SERVING if serving_status.status == want_status: break if i == retry_count - 1: raise Exception( 'failed to set instance service status after %d retries' % retry_count) def is_primary_instance_group(gcp, instance_group): # Clients may connect to a TD instance in a different region than the # client, in which case primary/secondary assignments may not be based on # the client's actual locality. instance_names = get_instance_names(gcp, instance_group) stats = get_client_stats(_NUM_TEST_RPCS, _WAIT_FOR_STATS_SEC) return all( peer in instance_names for peer in list(stats.rpcs_by_peer.keys())) def get_startup_script(path_to_server_binary, service_port): if path_to_server_binary: return 'nohup %s --port=%d 1>/dev/null &' % (path_to_server_binary, service_port) else: return """#!/bin/bash sudo apt update sudo apt install -y git default-jdk mkdir java_server pushd java_server git clone https://github.com/grpc/grpc-java.git pushd grpc-java pushd interop-testing ../gradlew installDist -x test -PskipCodegen=true -PskipAndroid=true nohup build/install/grpc-interop-testing/bin/xds-test-server \ --port=%d 1>/dev/null &""" % service_port def create_instance_template(gcp, name, network, source_image, machine_type, startup_script): config = { 'name': name, 'properties': { 'tags': { 'items': ['allow-health-checks'] }, 'machineType': machine_type, 'serviceAccounts': [{ 'email': 'default', 'scopes': ['https://www.googleapis.com/auth/cloud-platform',] }], 'networkInterfaces': [{ 'accessConfigs': [{ 'type': 'ONE_TO_ONE_NAT' }], 'network': network }], 'disks': [{ 'boot': True, 'initializeParams': { 'sourceImage': source_image }, 'autoDelete': True }], 'metadata': { 'items': [{ 'key': 'startup-script', 'value': startup_script }] } } } logger.debug('Sending GCP request with body=%s', config) result = gcp.compute.instanceTemplates().insert( project=gcp.project, body=config).execute(num_retries=_GCP_API_RETRIES) wait_for_global_operation(gcp, result['name']) gcp.instance_template = GcpResource(config['name'], result['targetLink']) def add_instance_group(gcp, zone, name, size): config = { 'name': name, 'instanceTemplate': gcp.instance_template.url, 'targetSize': size, 'namedPorts': [{ 'name': 'grpc', 'port': gcp.service_port }] } logger.debug('Sending GCP request with body=%s', config) result = gcp.compute.instanceGroupManagers().insert( project=gcp.project, zone=zone, body=config).execute(num_retries=_GCP_API_RETRIES) wait_for_zone_operation(gcp, zone, result['name']) result = gcp.compute.instanceGroupManagers().get( project=gcp.project, zone=zone, instanceGroupManager=config['name']).execute( num_retries=_GCP_API_RETRIES) instance_group = InstanceGroup(config['name'], result['instanceGroup'], zone) gcp.instance_groups.append(instance_group) wait_for_instance_group_to_reach_expected_size(gcp, instance_group, size, _WAIT_FOR_OPERATION_SEC) return instance_group def create_health_check(gcp, name): if gcp.alpha_compute: config = { 'name': name, 'type': 'GRPC', 'grpcHealthCheck': { 'portSpecification': 'USE_SERVING_PORT' } } compute_to_use = gcp.alpha_compute else: config = { 'name': name, 'type': 'TCP', 'tcpHealthCheck': { 'portName': 'grpc' } } compute_to_use = gcp.compute logger.debug('Sending GCP request with body=%s', config) result = compute_to_use.healthChecks().insert( project=gcp.project, body=config).execute(num_retries=_GCP_API_RETRIES) wait_for_global_operation(gcp, result['name']) gcp.health_check = GcpResource(config['name'], result['targetLink']) def create_health_check_firewall_rule(gcp, name): config = { 'name': name, 'direction': 'INGRESS', 'allowed': [{ 'IPProtocol': 'tcp' }], 'sourceRanges': ['35.191.0.0/16', '130.211.0.0/22'], 'targetTags': ['allow-health-checks'], } logger.debug('Sending GCP request with body=%s', config) result = gcp.compute.firewalls().insert( project=gcp.project, body=config).execute(num_retries=_GCP_API_RETRIES) wait_for_global_operation(gcp, result['name']) gcp.health_check_firewall_rule = GcpResource(config['name'], result['targetLink']) def add_backend_service(gcp, name): if gcp.alpha_compute: protocol = 'GRPC' compute_to_use = gcp.alpha_compute else: protocol = 'HTTP2' compute_to_use = gcp.compute config = { 'name': name, 'loadBalancingScheme': 'INTERNAL_SELF_MANAGED', 'healthChecks': [gcp.health_check.url], 'portName': 'grpc', 'protocol': protocol } logger.debug('Sending GCP request with body=%s', config) result = compute_to_use.backendServices().insert( project=gcp.project, body=config).execute(num_retries=_GCP_API_RETRIES) wait_for_global_operation(gcp, result['name']) backend_service = GcpResource(config['name'], result['targetLink']) gcp.backend_services.append(backend_service) return backend_service def create_url_map(gcp, name, backend_service, host_name): config = { 'name': name, 'defaultService': backend_service.url, 'pathMatchers': [{ 'name': _PATH_MATCHER_NAME, 'defaultService': backend_service.url, }], 'hostRules': [{ 'hosts': [host_name], 'pathMatcher': _PATH_MATCHER_NAME }] } logger.debug('Sending GCP request with body=%s', config) result = gcp.compute.urlMaps().insert( project=gcp.project, body=config).execute(num_retries=_GCP_API_RETRIES) wait_for_global_operation(gcp, result['name']) gcp.url_map = GcpResource(config['name'], result['targetLink']) def patch_url_map_host_rule_with_port(gcp, name, backend_service, host_name): config = { 'hostRules': [{ 'hosts': ['%s:%d' % (host_name, gcp.service_port)], 'pathMatcher': _PATH_MATCHER_NAME }] } logger.debug('Sending GCP request with body=%s', config) result = gcp.compute.urlMaps().patch( project=gcp.project, urlMap=name, body=config).execute(num_retries=_GCP_API_RETRIES) wait_for_global_operation(gcp, result['name']) def create_target_proxy(gcp, name, validate_for_proxyless=True): if gcp.alpha_compute: config = { 'name': name, 'url_map': gcp.url_map.url, 'validate_for_proxyless': validate_for_proxyless } logger.debug('Sending GCP request with body=%s', config) result = gcp.alpha_compute.targetGrpcProxies().insert( project=gcp.project, body=config).execute(num_retries=_GCP_API_RETRIES) else: config = { 'name': name, 'url_map': gcp.url_map.url, } logger.debug('Sending GCP request with body=%s', config) result = gcp.compute.targetHttpProxies().insert( project=gcp.project, body=config).execute(num_retries=_GCP_API_RETRIES) wait_for_global_operation(gcp, result['name']) gcp.target_proxy = GcpResource(config['name'], result['targetLink']) def create_global_forwarding_rule(gcp, name, potential_ports, potential_ip_addresses=['0.0.0.0']): if gcp.alpha_compute: compute_to_use = gcp.alpha_compute else: compute_to_use = gcp.compute for port in potential_ports: for ip_address in potential_ip_addresses: try: config = { 'name': name, 'loadBalancingScheme': 'INTERNAL_SELF_MANAGED', 'portRange': str(port), 'IPAddress': ip_address, 'network': args.network, 'target': gcp.target_proxy.url, } logger.debug('Sending GCP request with body=%s', config) result = compute_to_use.globalForwardingRules().insert( project=gcp.project, body=config).execute(num_retries=_GCP_API_RETRIES) wait_for_global_operation(gcp, result['name']) gcp.global_forwarding_rule = GcpResource( config['name'], result['targetLink']) gcp.service_port = port return except googleapiclient.errors.HttpError as http_error: logger.warning( 'Got error %s when attempting to create forwarding rule to ' '%s:%d. Retrying with another port.' % (http_error, ip_address, port)) def get_health_check(gcp, health_check_name): try: result = gcp.compute.healthChecks().get( project=gcp.project, healthCheck=health_check_name).execute() gcp.health_check = GcpResource(health_check_name, result['selfLink']) except Exception as e: gcp.errors.append(e) gcp.health_check = GcpResource(health_check_name, None) def get_health_check_firewall_rule(gcp, firewall_name): try: result = gcp.compute.firewalls().get(project=gcp.project, firewall=firewall_name).execute() gcp.health_check_firewall_rule = GcpResource(firewall_name, result['selfLink']) except Exception as e: gcp.errors.append(e) gcp.health_check_firewall_rule = GcpResource(firewall_name, None) def get_backend_service(gcp, backend_service_name, record_error=True): try: result = gcp.compute.backendServices().get( project=gcp.project, backendService=backend_service_name).execute() backend_service = GcpResource(backend_service_name, result['selfLink']) except Exception as e: if record_error: gcp.errors.append(e) backend_service = GcpResource(backend_service_name, None) gcp.backend_services.append(backend_service) return backend_service def get_url_map(gcp, url_map_name): try: result = gcp.compute.urlMaps().get(project=gcp.project, urlMap=url_map_name).execute() gcp.url_map = GcpResource(url_map_name, result['selfLink']) except Exception as e: gcp.errors.append(e) gcp.url_map = GcpResource(url_map_name, None) def get_target_proxy(gcp, target_proxy_name): try: if gcp.alpha_compute: result = gcp.alpha_compute.targetGrpcProxies().get( project=gcp.project, targetGrpcProxy=target_proxy_name).execute() else: result = gcp.compute.targetHttpProxies().get( project=gcp.project, targetHttpProxy=target_proxy_name).execute() gcp.target_proxy = GcpResource(target_proxy_name, result['selfLink']) except Exception as e: gcp.errors.append(e) gcp.target_proxy = GcpResource(target_proxy_name, None) def get_global_forwarding_rule(gcp, forwarding_rule_name): try: result = gcp.compute.globalForwardingRules().get( project=gcp.project, forwardingRule=forwarding_rule_name).execute() gcp.global_forwarding_rule = GcpResource(forwarding_rule_name, result['selfLink']) except Exception as e: gcp.errors.append(e) gcp.global_forwarding_rule = GcpResource(forwarding_rule_name, None) def get_instance_template(gcp, template_name): try: result = gcp.compute.instanceTemplates().get( project=gcp.project, instanceTemplate=template_name).execute() gcp.instance_template = GcpResource(template_name, result['selfLink']) except Exception as e: gcp.errors.append(e) gcp.instance_template = GcpResource(template_name, None) def get_instance_group(gcp, zone, instance_group_name): try: result = gcp.compute.instanceGroups().get( project=gcp.project, zone=zone, instanceGroup=instance_group_name).execute() gcp.service_port = result['namedPorts'][0]['port'] instance_group = InstanceGroup(instance_group_name, result['selfLink'], zone) except Exception as e: gcp.errors.append(e) instance_group = InstanceGroup(instance_group_name, None, zone) gcp.instance_groups.append(instance_group) return instance_group def delete_global_forwarding_rule(gcp, name=None): if name: forwarding_rule_to_delete = name else: forwarding_rule_to_delete = gcp.global_forwarding_rule.name try: logger.debug('Deleting forwarding rule %s', forwarding_rule_to_delete) result = gcp.compute.globalForwardingRules().delete( project=gcp.project, forwardingRule=forwarding_rule_to_delete).execute( num_retries=_GCP_API_RETRIES) wait_for_global_operation(gcp, result['name']) except googleapiclient.errors.HttpError as http_error: logger.info('Delete failed: %s', http_error) def delete_target_proxy(gcp, name=None): if name: proxy_to_delete = name else: proxy_to_delete = gcp.target_proxy.name try: if gcp.alpha_compute: logger.debug('Deleting grpc proxy %s', proxy_to_delete) result = gcp.alpha_compute.targetGrpcProxies().delete( project=gcp.project, targetGrpcProxy=proxy_to_delete).execute( num_retries=_GCP_API_RETRIES) else: logger.debug('Deleting http proxy %s', proxy_to_delete) result = gcp.compute.targetHttpProxies().delete( project=gcp.project, targetHttpProxy=proxy_to_delete).execute( num_retries=_GCP_API_RETRIES) wait_for_global_operation(gcp, result['name']) except googleapiclient.errors.HttpError as http_error: logger.info('Delete failed: %s', http_error) def delete_url_map(gcp, name=None): if name: url_map_to_delete = name else: url_map_to_delete = gcp.url_map.name try: logger.debug('Deleting url map %s', url_map_to_delete) result = gcp.compute.urlMaps().delete( project=gcp.project, urlMap=url_map_to_delete).execute(num_retries=_GCP_API_RETRIES) wait_for_global_operation(gcp, result['name']) except googleapiclient.errors.HttpError as http_error: logger.info('Delete failed: %s', http_error) def delete_backend_service(gcp, backend_service): try: logger.debug('Deleting backend service %s', backend_service.name) result = gcp.compute.backendServices().delete( project=gcp.project, backendService=backend_service.name).execute( num_retries=_GCP_API_RETRIES) wait_for_global_operation(gcp, result['name']) except googleapiclient.errors.HttpError as http_error: logger.info('Delete failed: %s', http_error) def delete_backend_services(gcp): for backend_service in gcp.backend_services: delete_backend_service(gcp, backend_service) def delete_firewall(gcp): try: logger.debug('Deleting firewall %s', gcp.health_check_firewall_rule.name) result = gcp.compute.firewalls().delete( project=gcp.project, firewall=gcp.health_check_firewall_rule.name).execute( num_retries=_GCP_API_RETRIES) wait_for_global_operation(gcp, result['name']) except googleapiclient.errors.HttpError as http_error: logger.info('Delete failed: %s', http_error) def delete_health_check(gcp): try: logger.debug('Deleting health check %s', gcp.health_check.name) result = gcp.compute.healthChecks().delete( project=gcp.project, healthCheck=gcp.health_check.name).execute( num_retries=_GCP_API_RETRIES) wait_for_global_operation(gcp, result['name']) except googleapiclient.errors.HttpError as http_error: logger.info('Delete failed: %s', http_error) def delete_instance_groups(gcp): for instance_group in gcp.instance_groups: try: logger.debug('Deleting instance group %s %s', instance_group.name, instance_group.zone) result = gcp.compute.instanceGroupManagers().delete( project=gcp.project, zone=instance_group.zone, instanceGroupManager=instance_group.name).execute( num_retries=_GCP_API_RETRIES) wait_for_zone_operation(gcp, instance_group.zone, result['name'], timeout_sec=_WAIT_FOR_BACKEND_SEC) except googleapiclient.errors.HttpError as http_error: logger.info('Delete failed: %s', http_error) def delete_instance_template(gcp): try: logger.debug('Deleting instance template %s', gcp.instance_template.name) result = gcp.compute.instanceTemplates().delete( project=gcp.project, instanceTemplate=gcp.instance_template.name).execute( num_retries=_GCP_API_RETRIES) wait_for_global_operation(gcp, result['name']) except googleapiclient.errors.HttpError as http_error: logger.info('Delete failed: %s', http_error) def patch_backend_service(gcp, backend_service, instance_groups, balancing_mode='UTILIZATION', max_rate=1, circuit_breakers=None): if gcp.alpha_compute: compute_to_use = gcp.alpha_compute else: compute_to_use = gcp.compute config = { 'backends': [{ 'group': instance_group.url, 'balancingMode': balancing_mode, 'maxRate': max_rate if balancing_mode == 'RATE' else None } for instance_group in instance_groups], 'circuitBreakers': circuit_breakers, } logger.debug('Sending GCP request with body=%s', config) result = compute_to_use.backendServices().patch( project=gcp.project, backendService=backend_service.name, body=config).execute(num_retries=_GCP_API_RETRIES) wait_for_global_operation(gcp, result['name'], timeout_sec=_WAIT_FOR_BACKEND_SEC) def resize_instance_group(gcp, instance_group, new_size, timeout_sec=_WAIT_FOR_OPERATION_SEC): result = gcp.compute.instanceGroupManagers().resize( project=gcp.project, zone=instance_group.zone, instanceGroupManager=instance_group.name, size=new_size).execute(num_retries=_GCP_API_RETRIES) wait_for_zone_operation(gcp, instance_group.zone, result['name'], timeout_sec=360) wait_for_instance_group_to_reach_expected_size(gcp, instance_group, new_size, timeout_sec) def patch_url_map_backend_service(gcp, backend_service=None, services_with_weights=None, route_rules=None): '''change url_map's backend service Only one of backend_service and service_with_weights can be not None. ''' if gcp.alpha_compute: compute_to_use = gcp.alpha_compute else: compute_to_use = gcp.compute if backend_service and services_with_weights: raise ValueError( 'both backend_service and service_with_weights are not None.') default_service = backend_service.url if backend_service else None default_route_action = { 'weightedBackendServices': [{ 'backendService': service.url, 'weight': w, } for service, w in list(services_with_weights.items())] } if services_with_weights else None config = { 'pathMatchers': [{ 'name': _PATH_MATCHER_NAME, 'defaultService': default_service, 'defaultRouteAction': default_route_action, 'routeRules': route_rules, }] } logger.debug('Sending GCP request with body=%s', config) result = compute_to_use.urlMaps().patch( project=gcp.project, urlMap=gcp.url_map.name, body=config).execute(num_retries=_GCP_API_RETRIES) wait_for_global_operation(gcp, result['name']) def wait_for_instance_group_to_reach_expected_size(gcp, instance_group, expected_size, timeout_sec): start_time = time.time() while True: current_size = len(get_instance_names(gcp, instance_group)) if current_size == expected_size: break if time.time() - start_time > timeout_sec: raise Exception( 'Instance group had expected size %d but actual size %d' % (expected_size, current_size)) time.sleep(2) def wait_for_global_operation(gcp, operation, timeout_sec=_WAIT_FOR_OPERATION_SEC): start_time = time.time() while time.time() - start_time <= timeout_sec: result = gcp.compute.globalOperations().get( project=gcp.project, operation=operation).execute(num_retries=_GCP_API_RETRIES) if result['status'] == 'DONE': if 'error' in result: raise Exception(result['error']) return time.sleep(2) raise Exception('Operation %s did not complete within %d' % (operation, timeout_sec)) def wait_for_zone_operation(gcp, zone, operation, timeout_sec=_WAIT_FOR_OPERATION_SEC): start_time = time.time() while time.time() - start_time <= timeout_sec: result = gcp.compute.zoneOperations().get( project=gcp.project, zone=zone, operation=operation).execute(num_retries=_GCP_API_RETRIES) if result['status'] == 'DONE': if 'error' in result: raise Exception(result['error']) return time.sleep(2) raise Exception('Operation %s did not complete within %d' % (operation, timeout_sec)) def wait_for_healthy_backends(gcp, backend_service, instance_group, timeout_sec=_WAIT_FOR_BACKEND_SEC): start_time = time.time() config = {'group': instance_group.url} instance_names = get_instance_names(gcp, instance_group) expected_size = len(instance_names) while time.time() - start_time <= timeout_sec: for instance_name in instance_names: try: status = get_serving_status(instance_name, gcp.service_port) logger.info('serving status response from %s: %s', instance_name, status) except grpc.RpcError as rpc_error: logger.info('checking serving status of %s failed: %s', instance_name, rpc_error) result = gcp.compute.backendServices().getHealth( project=gcp.project, backendService=backend_service.name, body=config).execute(num_retries=_GCP_API_RETRIES) if 'healthStatus' in result: logger.info('received GCP healthStatus: %s', result['healthStatus']) healthy = True for instance in result['healthStatus']: if instance['healthState'] != 'HEALTHY': healthy = False break if healthy and expected_size == len(result['healthStatus']): return else: logger.info('no healthStatus received from GCP') time.sleep(5) raise Exception('Not all backends became healthy within %d seconds: %s' % (timeout_sec, result)) def get_instance_names(gcp, instance_group): instance_names = [] result = gcp.compute.instanceGroups().listInstances( project=gcp.project, zone=instance_group.zone, instanceGroup=instance_group.name, body={ 'instanceState': 'ALL' }).execute(num_retries=_GCP_API_RETRIES) if 'items' not in result: return [] for item in result['items']: # listInstances() returns the full URL of the instance, which ends with # the instance name. compute.instances().get() requires using the # instance name (not the full URL) to look up instance details, so we # just extract the name manually. instance_name = item['instance'].split('/')[-1] instance_names.append(instance_name) logger.info('retrieved instance names: %s', instance_names) return instance_names def clean_up(gcp): if gcp.global_forwarding_rule: delete_global_forwarding_rule(gcp) if gcp.target_proxy: delete_target_proxy(gcp) if gcp.url_map: delete_url_map(gcp) delete_backend_services(gcp) if gcp.health_check_firewall_rule: delete_firewall(gcp) if gcp.health_check: delete_health_check(gcp) delete_instance_groups(gcp) if gcp.instance_template: delete_instance_template(gcp) class InstanceGroup(object): def __init__(self, name, url, zone): self.name = name self.url = url self.zone = zone class GcpResource(object): def __init__(self, name, url): self.name = name self.url = url class GcpState(object): def __init__(self, compute, alpha_compute, project, project_num): self.compute = compute self.alpha_compute = alpha_compute self.project = project self.project_num = project_num self.health_check = None self.health_check_firewall_rule = None self.backend_services = [] self.url_map = None self.target_proxy = None self.global_forwarding_rule = None self.service_port = None self.instance_template = None self.instance_groups = [] self.errors = [] logging.debug( "script start time: %s", datetime.datetime.now( datetime.timezone.utc).astimezone().strftime("%Y-%m-%dT%H:%M:%S %Z")) logging.debug("logging local timezone: %s", datetime.datetime.now(datetime.timezone.utc).astimezone().tzinfo) alpha_compute = None if args.compute_discovery_document: with open(args.compute_discovery_document, 'r') as discovery_doc: compute = googleapiclient.discovery.build_from_document( discovery_doc.read()) if not args.only_stable_gcp_apis and args.alpha_compute_discovery_document: with open(args.alpha_compute_discovery_document, 'r') as discovery_doc: alpha_compute = googleapiclient.discovery.build_from_document( discovery_doc.read()) else: compute = googleapiclient.discovery.build('compute', 'v1') if not args.only_stable_gcp_apis: alpha_compute = googleapiclient.discovery.build('compute', 'alpha') test_results = {} failed_tests = [] try: gcp = GcpState(compute, alpha_compute, args.project_id, args.project_num) gcp_suffix = args.gcp_suffix health_check_name = _BASE_HEALTH_CHECK_NAME + gcp_suffix if not args.use_existing_gcp_resources: if args.keep_gcp_resources: # Auto-generating a unique suffix in case of conflict should not be # combined with --keep_gcp_resources, as the suffix actually used # for GCP resources will not match the provided --gcp_suffix value. num_attempts = 1 else: num_attempts = 5 for i in range(num_attempts): try: logger.info('Using GCP suffix %s', gcp_suffix) create_health_check(gcp, health_check_name) break except googleapiclient.errors.HttpError as http_error: gcp_suffix = '%s-%04d' % (gcp_suffix, random.randint(0, 9999)) health_check_name = _BASE_HEALTH_CHECK_NAME + gcp_suffix logger.exception('HttpError when creating health check') if gcp.health_check is None: raise Exception('Failed to create health check name after %d ' 'attempts' % num_attempts) firewall_name = _BASE_FIREWALL_RULE_NAME + gcp_suffix backend_service_name = _BASE_BACKEND_SERVICE_NAME + gcp_suffix alternate_backend_service_name = _BASE_BACKEND_SERVICE_NAME + '-alternate' + gcp_suffix extra_backend_service_name = _BASE_BACKEND_SERVICE_NAME + '-extra' + gcp_suffix more_extra_backend_service_name = _BASE_BACKEND_SERVICE_NAME + '-more-extra' + gcp_suffix url_map_name = _BASE_URL_MAP_NAME + gcp_suffix service_host_name = _BASE_SERVICE_HOST + gcp_suffix target_proxy_name = _BASE_TARGET_PROXY_NAME + gcp_suffix forwarding_rule_name = _BASE_FORWARDING_RULE_NAME + gcp_suffix template_name = _BASE_TEMPLATE_NAME + gcp_suffix instance_group_name = _BASE_INSTANCE_GROUP_NAME + gcp_suffix same_zone_instance_group_name = _BASE_INSTANCE_GROUP_NAME + '-same-zone' + gcp_suffix secondary_zone_instance_group_name = _BASE_INSTANCE_GROUP_NAME + '-secondary-zone' + gcp_suffix potential_service_ports = list(args.service_port_range) random.shuffle(potential_service_ports) if args.use_existing_gcp_resources: logger.info('Reusing existing GCP resources') get_health_check(gcp, health_check_name) get_health_check_firewall_rule(gcp, firewall_name) backend_service = get_backend_service(gcp, backend_service_name) alternate_backend_service = get_backend_service( gcp, alternate_backend_service_name) extra_backend_service = get_backend_service(gcp, extra_backend_service_name, record_error=False) more_extra_backend_service = get_backend_service( gcp, more_extra_backend_service_name, record_error=False) get_url_map(gcp, url_map_name) get_target_proxy(gcp, target_proxy_name) get_global_forwarding_rule(gcp, forwarding_rule_name) get_instance_template(gcp, template_name) instance_group = get_instance_group(gcp, args.zone, instance_group_name) same_zone_instance_group = get_instance_group( gcp, args.zone, same_zone_instance_group_name) secondary_zone_instance_group = get_instance_group( gcp, args.secondary_zone, secondary_zone_instance_group_name) if gcp.errors: raise Exception(gcp.errors) else: create_health_check_firewall_rule(gcp, firewall_name) backend_service = add_backend_service(gcp, backend_service_name) alternate_backend_service = add_backend_service( gcp, alternate_backend_service_name) create_url_map(gcp, url_map_name, backend_service, service_host_name) create_target_proxy(gcp, target_proxy_name) create_global_forwarding_rule(gcp, forwarding_rule_name, potential_service_ports) if not gcp.service_port: raise Exception( 'Failed to find a valid ip:port for the forwarding rule') if gcp.service_port != _DEFAULT_SERVICE_PORT: patch_url_map_host_rule_with_port(gcp, url_map_name, backend_service, service_host_name) startup_script = get_startup_script(args.path_to_server_binary, gcp.service_port) create_instance_template(gcp, template_name, args.network, args.source_image, args.machine_type, startup_script) instance_group = add_instance_group(gcp, args.zone, instance_group_name, _INSTANCE_GROUP_SIZE) patch_backend_service(gcp, backend_service, [instance_group]) same_zone_instance_group = add_instance_group( gcp, args.zone, same_zone_instance_group_name, _INSTANCE_GROUP_SIZE) secondary_zone_instance_group = add_instance_group( gcp, args.secondary_zone, secondary_zone_instance_group_name, _INSTANCE_GROUP_SIZE) wait_for_healthy_backends(gcp, backend_service, instance_group) if args.test_case: client_env = dict(os.environ) if original_grpc_trace: client_env['GRPC_TRACE'] = original_grpc_trace if original_grpc_verbosity: client_env['GRPC_VERBOSITY'] = original_grpc_verbosity bootstrap_server_features = [] if gcp.service_port == _DEFAULT_SERVICE_PORT: server_uri = service_host_name else: server_uri = service_host_name + ':' + str(gcp.service_port) if args.xds_v3_support: client_env['GRPC_XDS_EXPERIMENTAL_V3_SUPPORT'] = 'true' bootstrap_server_features.append('xds_v3') if args.bootstrap_file: bootstrap_path = os.path.abspath(args.bootstrap_file) else: with tempfile.NamedTemporaryFile(delete=False) as bootstrap_file: bootstrap_file.write( _BOOTSTRAP_TEMPLATE.format( node_id='projects/%s/networks/%s/nodes/%s' % (gcp.project_num, args.network.split('/')[-1], uuid.uuid1()), server_features=json.dumps( bootstrap_server_features)).encode('utf-8')) bootstrap_path = bootstrap_file.name client_env['GRPC_XDS_BOOTSTRAP'] = bootstrap_path client_env['GRPC_XDS_EXPERIMENTAL_CIRCUIT_BREAKING'] = 'true' client_env['GRPC_XDS_EXPERIMENTAL_ENABLE_TIMEOUT'] = 'true' client_env['GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION'] = 'true' for test_case in args.test_case: if test_case in _V3_TEST_CASES and not args.xds_v3_support: logger.info('skipping test %s due to missing v3 support', test_case) continue if test_case in _ALPHA_TEST_CASES and not gcp.alpha_compute: logger.info('skipping test %s due to missing alpha support', test_case) continue if test_case in [ 'api_listener', 'forwarding_rule_port_match', 'forwarding_rule_default_port' ] and CLIENT_HOSTS: logger.info( 'skipping test %s because test configuration is' 'not compatible with client processes on existing' 'client hosts', test_case) continue if test_case == 'forwarding_rule_default_port': server_uri = service_host_name result = jobset.JobResult() log_dir = os.path.join(_TEST_LOG_BASE_DIR, test_case) if not os.path.exists(log_dir): os.makedirs(log_dir) test_log_filename = os.path.join(log_dir, _SPONGE_LOG_NAME) test_log_file = open(test_log_filename, 'w+') client_process = None if test_case in _TESTS_TO_RUN_MULTIPLE_RPCS: rpcs_to_send = '--rpc="UnaryCall,EmptyCall"' else: rpcs_to_send = '--rpc="UnaryCall"' if test_case in _TESTS_TO_SEND_METADATA: metadata_to_send = '--metadata="EmptyCall:{keyE}:{valueE},UnaryCall:{keyU}:{valueU},UnaryCall:{keyNU}:{valueNU}"'.format( keyE=_TEST_METADATA_KEY, valueE=_TEST_METADATA_VALUE_EMPTY, keyU=_TEST_METADATA_KEY, valueU=_TEST_METADATA_VALUE_UNARY, keyNU=_TEST_METADATA_NUMERIC_KEY, valueNU=_TEST_METADATA_NUMERIC_VALUE) else: # Setting the arg explicitly to empty with '--metadata=""' # makes C# client fail # (see https://github.com/commandlineparser/commandline/issues/412), # so instead we just rely on clients using the default when # metadata arg is not specified. metadata_to_send = '' # TODO(ericgribkoff) Temporarily disable fail_on_failed_rpc checks # in the client. This means we will ignore intermittent RPC # failures (but this framework still checks that the final result # is as expected). # # Reason for disabling this is, the resources are shared by # multiple tests, and a change in previous test could be delayed # until the second test starts. The second test may see # intermittent failures because of that. # # A fix is to not share resources between tests (though that does # mean the tests will be significantly slower due to creating new # resources). fail_on_failed_rpc = '' try: if not CLIENT_HOSTS: client_cmd_formatted = args.client_cmd.format( server_uri=server_uri, stats_port=args.stats_port, qps=args.qps, fail_on_failed_rpc=fail_on_failed_rpc, rpcs_to_send=rpcs_to_send, metadata_to_send=metadata_to_send) logger.debug('running client: %s', client_cmd_formatted) client_cmd = shlex.split(client_cmd_formatted) client_process = subprocess.Popen(client_cmd, env=client_env, stderr=subprocess.STDOUT, stdout=test_log_file) if test_case == 'backends_restart': test_backends_restart(gcp, backend_service, instance_group) elif test_case == 'change_backend_service': test_change_backend_service(gcp, backend_service, instance_group, alternate_backend_service, same_zone_instance_group) elif test_case == 'gentle_failover': test_gentle_failover(gcp, backend_service, instance_group, secondary_zone_instance_group) elif test_case == 'load_report_based_failover': test_load_report_based_failover( gcp, backend_service, instance_group, secondary_zone_instance_group) elif test_case == 'ping_pong': test_ping_pong(gcp, backend_service, instance_group) elif test_case == 'remove_instance_group': test_remove_instance_group(gcp, backend_service, instance_group, same_zone_instance_group) elif test_case == 'round_robin': test_round_robin(gcp, backend_service, instance_group) elif test_case == 'secondary_locality_gets_no_requests_on_partial_primary_failure': test_secondary_locality_gets_no_requests_on_partial_primary_failure( gcp, backend_service, instance_group, secondary_zone_instance_group) elif test_case == 'secondary_locality_gets_requests_on_primary_failure': test_secondary_locality_gets_requests_on_primary_failure( gcp, backend_service, instance_group, secondary_zone_instance_group) elif test_case == 'traffic_splitting': test_traffic_splitting(gcp, backend_service, instance_group, alternate_backend_service, same_zone_instance_group) elif test_case == 'path_matching': test_path_matching(gcp, backend_service, instance_group, alternate_backend_service, same_zone_instance_group) elif test_case == 'header_matching': test_header_matching(gcp, backend_service, instance_group, alternate_backend_service, same_zone_instance_group) elif test_case == 'circuit_breaking': test_circuit_breaking(gcp, backend_service, instance_group, same_zone_instance_group) elif test_case == 'timeout': test_timeout(gcp, backend_service, instance_group) elif test_case == 'fault_injection': test_fault_injection(gcp, backend_service, instance_group) elif test_case == 'api_listener': server_uri = test_api_listener(gcp, backend_service, instance_group, alternate_backend_service) elif test_case == 'forwarding_rule_port_match': server_uri = test_forwarding_rule_port_match( gcp, backend_service, instance_group) elif test_case == 'forwarding_rule_default_port': server_uri = test_forwarding_rule_default_port( gcp, backend_service, instance_group) elif test_case == 'metadata_filter': test_metadata_filter(gcp, backend_service, instance_group, alternate_backend_service, same_zone_instance_group) elif test_case == 'csds': test_csds(gcp, backend_service, instance_group, server_uri) else: logger.error('Unknown test case: %s', test_case) sys.exit(1) if client_process and client_process.poll() is not None: raise Exception( 'Client process exited prematurely with exit code %d' % client_process.returncode) result.state = 'PASSED' result.returncode = 0 except Exception as e: logger.exception('Test case %s failed', test_case) failed_tests.append(test_case) result.state = 'FAILED' result.message = str(e) if args.halt_after_fail: # Stop the test suite if one case failed. raise finally: if client_process: if client_process.returncode: logger.info('Client exited with code %d' % client_process.returncode) else: client_process.terminate() test_log_file.close() # Workaround for Python 3, as report_utils will invoke decode() on # result.message, which has a default value of ''. result.message = result.message.encode('UTF-8') test_results[test_case] = [result] if args.log_client_output: logger.info('Client output:') with open(test_log_filename, 'r') as client_output: logger.info(client_output.read()) if not os.path.exists(_TEST_LOG_BASE_DIR): os.makedirs(_TEST_LOG_BASE_DIR) report_utils.render_junit_xml_report(test_results, os.path.join( _TEST_LOG_BASE_DIR, _SPONGE_XML_NAME), suite_name='xds_tests', multi_target=True) if failed_tests: logger.error('Test case(s) %s failed', failed_tests) sys.exit(1) finally: keep_resources = args.keep_gcp_resources if args.halt_after_fail and failed_tests: logger.info( 'Halt after fail triggered, exiting without cleaning up resources') keep_resources = True if not keep_resources: logger.info('Cleaning up GCP resources. This may take some time.') clean_up(gcp)
apache-2.0
sashinde/VulkanTools
vktrace/src/vktrace_common/vktrace_platform.c
12627
/************************************************************************** * * Copyright 2014-2016 Valve Corporation * Copyright (C) 2014-2016 LunarG, Inc. * All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * Author: Jon Ashburn <[email protected]> * Author: Peter Lohrmann <[email protected]> **************************************************************************/ #include "vktrace_platform.h" #if defined(PLATFORM_LINUX) #include "vktrace_common.h" #include <pthread.h> #endif vktrace_process_id vktrace_get_pid() { #if defined(PLATFORM_LINUX) return getpid(); #elif defined(WIN32) return GetCurrentProcessId(); #endif } char* vktrace_platform_get_current_executable_directory() { char* exePath = (char*)vktrace_malloc(_MAX_PATH); #if defined(WIN32) DWORD s = GetModuleFileName(NULL, exePath, MAX_PATH); #elif defined(PLATFORM_LINUX) ssize_t s = readlink("/proc/self/exe", exePath, _MAX_PATH); if (s >= 0) { exePath[s] = '\0'; } else { exePath[0] = '\0'; } #endif while (s > 0) { if (exePath[s] == '/' || exePath[s] == '\\') { // NULL this location and break so that the shortened string can be returned. exePath[s] = '\0'; break; } --s; } if (s <= 0) { assert(!"Unexpected path returned in vktrace_platform_get_current_executable_directory"); vktrace_free(exePath); exePath = NULL; } return exePath; } BOOL vktrace_is_loaded_into_vktrace() { char exePath[_MAX_PATH]; #if defined(WIN32) char* substr = ((sizeof(void*) == 4)? "vktrace32.exe" : "vktrace.exe"); GetModuleFileName(NULL, exePath, MAX_PATH); #elif defined(PLATFORM_LINUX) char* substr = ((sizeof(void*) == 4)? "vktrace32" : "vktrace"); ssize_t s = readlink("/proc/self/exe", exePath, _MAX_PATH); if (s >= 0) { exePath[s] = '\0'; } else { exePath[0] = '\0'; } #endif return (strstr(exePath, substr) != NULL); } BOOL vktrace_platform_get_next_lib_sym(void * *ppFunc, const char * name) { #if defined(PLATFORM_LINUX) if ((*ppFunc = dlsym(RTLD_NEXT, name)) == NULL) { vktrace_LogError("dlsym: failed to find symbol %s %s", name, dlerror()); return FALSE; } #elif defined(WIN32) vktrace_LogError("unimplemented"); assert(0); return FALSE; #endif return TRUE; } vktrace_thread_id vktrace_platform_get_thread_id() { #if defined(PLATFORM_LINUX) //return (vktrace_thread_id)syscall(SYS_gettid); return pthread_self(); #elif defined(WIN32) return GetCurrentThreadId(); #endif } char *vktrace_get_global_var(const char *name) { #if defined(PLATFORM_LINUX) return getenv(name); #else // TODO: add code for reading from Windows registry // For now we just return the result from getenv return getenv(name); #endif } void vktrace_set_global_var(const char *name, const char *val) { #if defined(PLATFORM_LINUX) setenv(name, val, 1); #else // TODO add code for writing to Windows registry // For now we just do _putenv_s _putenv_s(name, val); #endif } size_t vktrace_platform_rand_s(uint32_t* out_array, size_t out_array_length) { #if defined(PLATFORM_LINUX) static __thread unsigned int s_seed = 0; size_t i = 0; if (s_seed == 0) { // Try to seed rand_r() with /dev/urandom. size_t nbytes = 0; int fd = open("/dev/urandom", O_RDONLY); if (fd != -1) { nbytes = read(fd, &s_seed, sizeof(s_seed)); close(fd); } // If that didn't work, fallback to time and thread id. if (nbytes != sizeof(s_seed)) { struct timeval time; gettimeofday(&time, NULL); s_seed = vktrace_platform_get_thread_id() ^ ((time.tv_sec * 1000) + (time.tv_usec / 1000)); } } for (i = 0; i < out_array_length; ++i) { out_array[i] = rand_r(&s_seed); } return out_array_length; #elif defined(WIN32) //VKTRACE_ASSUME(sizeof(uint32_t) == sizeof(unsigned int)); size_t ret_values = 0; for (ret_values = 0; ret_values < out_array_length; ++ret_values) { if (FAILED(rand_s(&out_array[ret_values]))) return ret_values; } return ret_values; #endif } void * vktrace_platform_open_library(const char* libPath) { #if defined(WIN32) return LoadLibrary(libPath); #elif defined(PLATFORM_LINUX) return dlopen(libPath, RTLD_LAZY); #endif } void * vktrace_platform_get_library_entrypoint(void * libHandle, const char *name) { #ifdef WIN32 FARPROC proc = GetProcAddress((HMODULE)libHandle, name); if (!proc) vktrace_LogError("Failed to find symbol %s in library handle %p", name, libHandle); #else void * proc = dlsym(libHandle, name); if (!proc) vktrace_LogError("Failed to find symbol %s in library handle %p, dlerror: %s", name, libHandle, dlerror()); #endif return proc; } void vktrace_platform_close_library(void* pLibrary) { #if defined(WIN32) FreeLibrary((HMODULE)pLibrary); #elif defined(PLATFORM_LINUX) dlclose(pLibrary); #endif } void vktrace_platform_full_path(const char* partPath, unsigned long bytes, char* buffer) { assert(buffer != NULL); #if defined(WIN32) GetFullPathName(partPath, bytes, buffer, NULL); #elif defined(PLATFORM_LINUX) char *ptr = realpath(partPath, buffer); (void) ptr; #endif } char* vktrace_platform_extract_path(char* _path) { // These functions actually work on const strings, but the C decl version exposed by the macro // takes non-const TCHAR*. char* pDir; size_t newLen; char* pathSepBack = strrchr(_path, '\\'); char* pathSepFor = strrchr(_path, '/'); char* lastPathSep = pathSepBack > pathSepFor ? pathSepBack : pathSepFor; if (lastPathSep == NULL) { return vktrace_allocate_and_copy(".\\"); } pDir = VKTRACE_NEW_ARRAY(char, strlen(_path) + 1); newLen = strlen(_path) - strlen(lastPathSep); strncpy(pDir, _path, newLen); pDir[newLen] = '\0'; return pDir; } // The following linux paths are based on: // standards.freedesktop.org/basedir-spec/basedir-spec-0.8.html char* vktrace_platform_get_settings_path() { #if defined(__linux__) char* xdgConfigHome = getenv("XDG_CONFIG_HOME"); if (xdgConfigHome != NULL && strlen(xdgConfigHome) > 0) { return vktrace_copy_and_append(xdgConfigHome, VKTRACE_PATH_SEPARATOR, "vktrace"); } else { return vktrace_copy_and_append(getenv("HOME"), VKTRACE_PATH_SEPARATOR, ".config/vktrace"); } #elif defined(WIN32) DWORD reqLength = GetEnvironmentVariable("localappdata", NULL, 0); TCHAR* localAppData = VKTRACE_NEW_ARRAY(TCHAR, reqLength); GetEnvironmentVariable("localappdata", localAppData, reqLength); TCHAR* localVktraceData = vktrace_copy_and_append(localAppData, VKTRACE_PATH_SEPARATOR, "vktrace"); VKTRACE_DELETE(localAppData); return localVktraceData; #else assert(!"not implemented"); #endif } char* vktrace_platform_get_data_path() { #if defined(__linux__) char* xdgDataHome = getenv("XDG_DATA_HOME"); if (xdgDataHome != NULL && strlen(xdgDataHome) > 0) { return vktrace_copy_and_append(xdgDataHome, VKTRACE_PATH_SEPARATOR, "vktrace"); } else { return vktrace_copy_and_append(getenv("HOME"), VKTRACE_PATH_SEPARATOR, ".local/share/vktrace"); } #elif defined(WIN32) DWORD reqLength = GetEnvironmentVariable("localappdata", NULL, 0); TCHAR* localAppData = VKTRACE_NEW_ARRAY(TCHAR, reqLength); GetEnvironmentVariable("localappdata", localAppData, reqLength); TCHAR* localVktraceData = vktrace_copy_and_append(localAppData, VKTRACE_PATH_SEPARATOR, "vktrace"); VKTRACE_DELETE(localAppData); return localVktraceData; #else assert(!"not implemented"); #endif } vktrace_thread vktrace_platform_create_thread(VKTRACE_THREAD_ROUTINE_RETURN_TYPE(*start_routine)(LPVOID), void* args) { #if defined(PLATFORM_LINUX) vktrace_thread thread = 0; if(pthread_create(&thread, NULL, (void *(*) (void*)) start_routine, args) != 0) { vktrace_LogError("Failed to create thread"); } return thread; #elif defined(WIN32) return CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)start_routine, args, 0, NULL); #endif } void vktrace_platform_resume_thread(vktrace_thread* pThread) { assert(pThread != NULL); #if defined(PLATFORM_LINUX) assert(!"Add code to resume threads on Linux"); #elif defined(WIN32) if (*pThread != NULL) ResumeThread(*pThread); #endif } void vktrace_platform_sync_wait_for_thread(vktrace_thread* pThread) { assert(pThread != NULL); #if defined(PLATFORM_LINUX) if (pthread_join(*pThread, NULL) != 0) #else if (WaitForSingleObject(*pThread, INFINITE) != WAIT_OBJECT_0) #endif { vktrace_LogError("Error occurred while waiting for thread to end."); } } void vktrace_platform_delete_thread(vktrace_thread* pThread) { assert(pThread != NULL); #if defined(PLATFORM_LINUX) // Don't have to do anything! #elif defined(WIN32) CloseHandle(*pThread); *pThread = NULL; #endif } void vktrace_platform_thread_once(void *ctl, void (* func) (void)) { assert(func != NULL); assert(ctl != NULL); #if defined(PLATFORM_LINUX) pthread_once((pthread_once_t *) ctl, func); #elif defined(WIN32) InitOnceExecuteOnce((PINIT_ONCE) ctl, (PINIT_ONCE_FN) func, NULL, NULL); #endif } void vktrace_create_critical_section(VKTRACE_CRITICAL_SECTION* pCriticalSection) { #if defined(WIN32) InitializeCriticalSection(pCriticalSection); #elif defined(PLATFORM_LINUX) pthread_mutex_init(pCriticalSection, NULL); #endif } void vktrace_enter_critical_section(VKTRACE_CRITICAL_SECTION* pCriticalSection) { #if defined(WIN32) EnterCriticalSection(pCriticalSection); #elif defined(PLATFORM_LINUX) pthread_mutex_lock(pCriticalSection); #endif } void vktrace_leave_critical_section(VKTRACE_CRITICAL_SECTION* pCriticalSection) { #if defined(WIN32) LeaveCriticalSection(pCriticalSection); #elif defined(PLATFORM_LINUX) pthread_mutex_unlock(pCriticalSection); #endif } void vktrace_delete_critical_section(VKTRACE_CRITICAL_SECTION* pCriticalSection) { #if defined(WIN32) DeleteCriticalSection(pCriticalSection); #elif defined(PLATFORM_LINUX) pthread_mutex_destroy(pCriticalSection); #endif } BOOL vktrace_platform_remote_load_library(vktrace_process_handle pProcessHandle, const char* dllPath, vktrace_thread* pTracingThread, char ** ldPreload) { if (dllPath == NULL) return TRUE; #if defined(WIN32) SIZE_T bytesWritten = 0; void* targetProcessMem = NULL; vktrace_thread thread = NULL; size_t byteCount = sizeof(char) * (strlen(dllPath) + 1); targetProcessMem = VirtualAllocEx(pProcessHandle, 0, byteCount, MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE); if (!targetProcessMem) { vktrace_LogError("Failed to inject ourselves into target process--couldn't allocate process memory."); return FALSE; } if (!WriteProcessMemory(pProcessHandle, targetProcessMem, dllPath, byteCount, &bytesWritten)) { vktrace_LogError("Failed to inject ourselves into target process--couldn't write inception DLL name into process."); return FALSE; } thread = CreateRemoteThread(pProcessHandle, NULL, 0, (LPTHREAD_START_ROUTINE)LoadLibrary, targetProcessMem, 0, NULL); if (thread == NULL) { vktrace_LogError("Failed to inject ourselves into target process--couldn't spawn thread."); return FALSE; } assert(pTracingThread != NULL); *pTracingThread = thread; #elif defined(PLATFORM_LINUX) char *tmp; if (ldPreload == NULL) return TRUE; if (*ldPreload == NULL) { tmp = vktrace_copy_and_append("LD_PRELOAD", "=", dllPath); } else { tmp = vktrace_copy_and_append(*ldPreload, " ", dllPath); VKTRACE_DELETE((void*)*ldPreload); } *ldPreload = tmp; #endif return TRUE; }
apache-2.0
RowellKataan/Unity-List-Box
Assets/Unity UI Controls/Scripts/ListBox Scripts/ListBoxControl.cs
40922
// =========================================================================================================== // // Class/Library: ListBox Control - Main Script // Author: Michael Marzilli ( http://www.linkedin.com/in/michaelmarzilli , http://www.develteam.com/Developer/Rowell/Portfolio ) // Created: Jun 10, 2016 // // VERS 1.0.000 : Jun 10, 2016 : Original File Created. Released for Unity 3D. // 1.0.001 : Jun 11, 2016 : Added a SubText field/element to the ListBox Control. // The SubText field is a right justified field that can add additional information. // Such as displaying a price for an item in and item list for a shop. // 1.0.002 : May 04, 2017 : Added delegates for AddListItem and RemoveListItem. // // =========================================================================================================== #if UNITY_EDITOR #define IS_DEBUGGING #else #undef IS_DEBUGGING #endif using UnityEngine; using UnityEngine.UI; using System.Collections; using System.Collections.Generic; public delegate void OnListBoxSelectChanged( GameObject go, int intSelected); public delegate void OnListBoxDoubleClick( GameObject go, int intSelected); public delegate void OnAddListItemEvent( GameObject go, int intAddedIndex); public delegate void OnRemoveListItemEvent( GameObject go, int intRemovedIndex); [System.Serializable] public class ListBoxControl : MonoBehaviour { #region "PRIVATE CONSTANTS" // IF DROPDOWN LIST SELECTION IS NOT BEING PROPERLY SCROLLED TO WHEN THE DROPDOWN LIST IS SELECTED, // TRY INCREASING THE CONSTANT BELOW UNTIL THE SELECTED ITEM SCROLLS INTO VIEW PROPERLY // (THIS CONSTANT IS USED IN THE SetScroll(float fValue) IENUMERATOR private const float SCROLL_DELAY = 0.002f; // BEST DEFAULT: 0.12f ?? #endregion #region "STARTING LIST ITEM CLASS" [System.Serializable] public class StartingListItem { public string Value = ""; public string Text = ""; public string SubText = ""; public Sprite Icon = null; public int Index = -1; public StartingListItem(string strValue, string strText, Sprite imgSprite = null, string strSub = "") { Value = strValue; Text = strText; SubText = strSub; Icon = imgSprite; } } #endregion #region "PRIVATE VARIABLES" // SERIALIZED FIELDS [SerializeField] protected List<StartingListItem> _startArray = new List<StartingListItem>(); [SerializeField] private string _strTitle = ""; [SerializeField] private bool _blnBestFit = false; [SerializeField] private bool _blnAllowDblClick = false; [SerializeField] private bool _blnPartOfDDL = false; private ListBoxModes _lbMode = ListBoxModes.ListBox; private List<ListBoxLineItem> _items = new List<ListBoxLineItem>(); private RectTransform _rtContainer = null; private RectTransform _rtScrollRect = null; private int _intItemCount = 0; private int _intSelectedItem = -1; private List<int> _intSelectedList = new List<int>(); protected bool _blnInitialized = false; #endregion #region "PRIVATE PROPERTIES" private RectTransform ContainerRect { get { if (_rtContainer == null) if (ScrollContainerObject != null) _rtContainer = ScrollContainerObject.GetComponent<RectTransform>(); return _rtContainer; } } private RectTransform ScrollRect { get { if (_rtScrollRect == null) if (ScrollRectObject != null) _rtScrollRect = ScrollRectObject.GetComponent<RectTransform>(); return _rtScrollRect; } } #endregion #region "PUBLIC EDITOR PROPERTIES" public GameObject ScrollBarObject; public GameObject ScrollRectObject; public GameObject ScrollContainerObject; public Text ListBoxTitle; public GameObject ListBoxLineItemPrefabObject; [SerializeField] public Color ItemNormalColor; [SerializeField] public Color ItemHighlightColor; [SerializeField] public Color ItemSelectedColor; [SerializeField] public Color ItemDisabledColor; [SerializeField] public bool CanMultiSelect = false; [SerializeField] public bool AutoMultiSelect = false; [SerializeField] public float Height = 36; [SerializeField] public float Spacing = 4; [SerializeField] public char SeparatorChar = '|'; #endregion #region "PUBLIC PROPERTIES" public enum ListBoxModes : int { ListBox = 0, DropDownList = 1 } public ListBoxModes ListBoxMode { get { return _lbMode; } set { _lbMode = value; } } // HANDLE LISTBOX TITLE public string Title { get { return _strTitle; } set { _strTitle = value.Trim(); if (ListBoxMode == ListBoxModes.ListBox && ListBoxTitle != null) { ListBoxTitle.gameObject.SetActive(_strTitle != ""); ListBoxTitle.text = _strTitle; } else if (ListBoxTitle != null) ListBoxTitle.gameObject.SetActive(false); } } public bool TitleBestFit { get { return _blnBestFit; } set { _blnBestFit = value; if (ListBoxMode == ListBoxModes.ListBox && ListBoxTitle != null) ListBoxTitle.resizeTextForBestFit = _blnBestFit; } } public bool AllowDoubleClick { get { return _blnAllowDblClick && !_blnPartOfDDL && ListBoxMode == ListBoxModes.ListBox; } set { _blnAllowDblClick = value; } } public bool PartOfDDL { get { return _blnPartOfDDL; } set { _blnPartOfDDL = value; } } // HANDLE STARTING LIST ITEMS public List<StartingListItem> StartArray { get { return _startArray; } } // HANDLE SELECTION (GET) public virtual List<ListBoxLineItem> Items { get { if (_items == null) _items = new List<ListBoxLineItem>(); return _items; } } public virtual List<int> SelectedIndexes { get { if (_intSelectedList == null) _intSelectedList = new List<int>(); return _intSelectedList; } } public virtual List<string> SelectedValues { get { if (_intSelectedItem < 0 || _intSelectedList == null || _intSelectedList.Count < 0) return null; List<string> st = new List<string>(); for (int i = 0; i < _intSelectedList.Count; i++) st.Add(Items[_intSelectedList[i]].Value); return st; } } public virtual string SelectedValuesString { get { List<string> st = SelectedValues; if (st == null || st.Count < 1) return ""; string strOut = ""; for (int i = 0; i < st.Count; i++) { if (st[i].Trim() != "") strOut += SeparatorChar + st[i]; } if (strOut.Length > 1) strOut = strOut.Substring(1); return strOut; } } public virtual string SelectedValue { get { if (_intSelectedItem < 0 || _intSelectedList == null || _intSelectedList.Count < 0) return null; return Items[_intSelectedList[0]].Value; } } public virtual string SelectedArrayValue(int intIndex) { if (intIndex > Items[_intSelectedList[0]].Value.Split(SeparatorChar).Length - 1) return ""; return Items[_intSelectedList[0]].Value.Split(SeparatorChar)[intIndex]; } public virtual int SelectedValueInt { get { if (_intSelectedItem < 0 || _intSelectedList == null || _intSelectedList.Count < 0) return -1; return Util.ConvertToInt(Items[_intSelectedList[0]].Value); } } public virtual int SelectedArrayValueInt(int intIndex) { return Util.ConvertToInt(SelectedArrayValue(intIndex)); } public virtual int SelectedIndex { get { return _intSelectedItem; } set { _intSelectedItem = value; } } public virtual string SelectedText { get { if (_intSelectedItem < 0 || _intSelectedList == null || _intSelectedList.Count < 0) return ""; return Items[_intSelectedList[0]].Text; } } public bool IsInitialized { get { return _blnInitialized; } } #endregion #region "PRIVATE FUNCTIONS" private void Awake() { // INITIALIZE THE ITEM LIST _intSelectedItem = -1; _items = new List<ListBoxLineItem>(); _intSelectedList = new List<int>(); // EXIT IF THIS IS A DROPDOWN LIST if (ListBoxMode == ListBoxModes.DropDownList) return; // RE-SIZE THE SCROLL CONTAINER // REMOVE ANY GAMEOBJECTS IN THE CONTAINER if (ScrollContainerObject != null) { // RESIZE THE WIDTH OF THE CONTAINER TO MATCH THE CONTROL Vector2 v2 = ScrollContainerObject.GetComponent<RectTransform>().sizeDelta; v2.x = ScrollContainerObject.transform.parent.GetComponent<RectTransform>().sizeDelta.x; ScrollContainerObject.GetComponent<RectTransform>().sizeDelta = v2; // REMOVE GAMEOBJECTS IN THE CONTAINER if (ScrollContainerObject.transform.childCount > 0) { for (int i = ScrollContainerObject.transform.childCount - 1; i >= 0; i--) Destroy(ScrollContainerObject.transform.GetChild(i).gameObject); } } } private void Start() { if (!gameObject.activeInHierarchy) // && !_blnInitialized) return; // RESIZE THE ITEM CONTAINER TO THE WIDTH OF THE SCROLL RECT if (ContainerRect != null) ContainerRect.sizeDelta = new Vector2(ScrollRect.rect.width, ContainerRect.rect.height); // SET SCROLLBAR SENSITIVITY if (ScrollRectObject != null) ScrollRectObject.GetComponent<ScrollRect>().scrollSensitivity = Height - Spacing; if (ScrollBarObject != null) ScrollBarObject.GetComponent<Scrollbar>().numberOfSteps = 1; // EXIT IF THIS IS A DROPDOWN LIST if (ListBoxMode == ListBoxModes.DropDownList) return; // SET TITLE if (ListBoxTitle != null) Title = _strTitle; // CHECK FOR LINE ITEM PREFAB if (ListBoxLineItemPrefabObject == null) Debug.LogError(gameObject.name + " is Missing the Line Item Prefab. Please add the Prefab."); else if (ListBoxLineItemPrefabObject.GetComponent<ListBoxLineItem>() == null) Debug.LogError(gameObject.name + " is Missing the Line Item Prefab. Please add the Prefab."); // ADD INITIAL LIST ITEMS (IF THERE ARE ANY) if (StartArray.Count > 0) { for (int i = 0; i < StartArray.Count; i++) { AddItem(StartArray[i].Value, StartArray[i].Text, StartArray[i].Icon); } } // MARK CONTROL AS INITIALIZED _blnInitialized = true; } private void OnEnable() { if (!_blnInitialized && gameObject.activeInHierarchy) Start(); // MAKE SURE THAT THE LIST BOX ITEM CONTAINER IS PROPERLY SIZED (HEIGHT) if (ListBoxMode == ListBoxModes.ListBox) UpdateListBoxContainerSize(); } private void ResizeContainer() { if (!Application.isPlaying || ListBoxMode == ListBoxModes.DropDownList) return; float fScroll = 1; if (ScrollBarObject != null) fScroll = ScrollBarObject.GetComponent<Scrollbar>().value; Vector2 v2 = ContainerRect.sizeDelta; v2.y = ((this.Height + this.Spacing) * Items.Count) + this.Spacing; ContainerRect.sizeDelta = v2; try { if (gameObject.activeInHierarchy) StartCoroutine(SetScroll(fScroll)); } catch { } } private void SelectByRange( int intEnd) { // SELECTS A RANGE OF ITEMS STARTING AT _intSelectedItem, EXTENDING TO intEnd int s = (int)Mathf.Sign(intEnd - _intSelectedItem); int i = _intSelectedItem; int e = intEnd; while (e >= 0 && i >= 0 && i < Items.Count && ((s > 0 && i <= e) || (s < 0 && i >= e))) { if (Items[i].Enabled && Items[i].Shown) { Items[i].Select(); _intSelectedList.Add(i); } i += s; } } private void UnSelectItem( int intIndex) { if (ListBoxMode == ListBoxModes.DropDownList) return; // UNSELECT SINGLE ITEM if (intIndex >= 0 && intIndex == _intSelectedItem && Items[intIndex] != null) { Items[_intSelectedItem].UnSelect(); int i = _intSelectedList.FindIndex(x => x == intIndex); _intSelectedList.RemoveAt(i); if (_intSelectedList.Count > 0) _intSelectedItem = _intSelectedList[0]; else _intSelectedItem = -1; } else // UNSELECT THE ITEM FROM THE LIST if (_intSelectedList.Count > 0) { int i = _intSelectedList.FindIndex(x => x == intIndex); if (i >= 0) { Items[_intSelectedList[i]].UnSelect(); _intSelectedList.RemoveAt(i); } } } private void UnSelectByRange(int intEnd) { if (ListBoxMode == ListBoxModes.DropDownList) return; int s = (int)Mathf.Sign(intEnd - _intSelectedItem); int i = _intSelectedItem; int e = intEnd; while (e >= 0 && i >= 0 && i < Items.Count && ((s > 0 && i <= e) || (s < 0 && i >= e))) { Items[_intSelectedList[i]].UnSelect(); _intSelectedList.RemoveAt(i); i += s; } } private void UnSelectAllItems() { if (ListBoxMode == ListBoxModes.DropDownList) return; // UNSELECT SINGLE ITEM if (_intSelectedItem >= 0 && Items[_intSelectedItem] != null) Items[_intSelectedItem].UnSelect(); // UNSELECT MULTIPLY SELECTED ITEMS if (_intSelectedList.Count > 0) { for (int i = _intSelectedList.Count - 1; i >= 0; i--) { Items[_intSelectedList[i]].UnSelect(); _intSelectedList.RemoveAt(i); } } } private IEnumerator SetScroll(float fValue) { yield return new WaitForSeconds(0.001f); if (gameObject.activeInHierarchy && ScrollBarObject != null && ScrollBarObject.activeSelf && ListBoxMode == ListBoxModes.ListBox) { yield return new WaitForSeconds(SCROLL_DELAY); ScrollBarObject.GetComponent<Scrollbar>().value = 0; yield return new WaitForSeconds(0.0001f); ScrollBarObject.GetComponent<Scrollbar>().value = fValue; } } private void PrivAddItem( string strValue, string strText, string strIcon = "", string strSub = "") { // CHECK IF LINE ITEM PREFAB EXISTS if (ListBoxLineItemPrefabObject == null) { Debug.LogError(gameObject.name + " is Missing the Line Item Prefab. Please add the Prefab."); return; } else if (ListBoxLineItemPrefabObject.GetComponent<ListBoxLineItem>() == null) { Debug.LogError(gameObject.name + " is Missing the Line Item Prefab. Please add the Prefab."); return; } // CALCULATE ICON SPRITE Sprite sprIcon = null; if (strIcon != "") { sprIcon = Resources.Load<Sprite>(strIcon); } int i = Items.FindIndex(x => x.Value.ToLower() == strValue.ToLower() || x.Text.ToLower() == strText.ToLower()); if (i >= 0) { // ITEM ALREADY EXISTS -- UPDATE IT Items[i].Value = strValue; Items[i].Text = strText; Items[i].SubText = strSub; Items[i].SetIcon(sprIcon); } else { // ITEM DOES NOT EXIST -- CREATE IT _intItemCount++; i = Items.Count; GameObject go = (GameObject)Instantiate(ListBoxLineItemPrefabObject); PrivAddItem(go, i, strValue, strText, sprIcon, strSub); } } private void PrivAddItem( string strValue, string strText, Sprite sprIcon, string strSub = "") { // CHECK IF LINE ITEM PREFAB EXISTS if (ListBoxLineItemPrefabObject == null) { Debug.LogError(gameObject.name + " is Missing the Line Item Prefab. Please add the Prefab."); return; } else if (ListBoxLineItemPrefabObject.GetComponent<ListBoxLineItem>() == null) { Debug.LogError(gameObject.name + " is Missing the Line Item Prefab. Please add the Prefab."); return; } int i = Items.FindIndex(x => x.Value.ToLower() == strValue.ToLower() || x.Text.ToLower() == strText.ToLower()); if (i >= 0) { // ITEM ALREADY EXISTS -- UPDATE IT Items[i].Value = strValue; Items[i].Text = strText; Items[i].SubText = strSub; Items[i].SetIcon(sprIcon); } else { // ITEM DOES NOT EXIST -- CREATE IT _intItemCount++; i = Items.Count; GameObject go = (GameObject)Instantiate(ListBoxLineItemPrefabObject); PrivAddItem(go, i, strValue, strText, sprIcon, strSub); } } private void PrivAddItem(GameObject go, int intIndex, string strValue, string strText, Sprite sprIcon, string strSub = "") { go.transform.SetParent(ScrollContainerObject.transform, false); CanvasScaler scaler = go.transform.GetComponentInParent<CanvasScaler>(); if (scaler != null && scaler.uiScaleMode == CanvasScaler.ScaleMode.ScaleWithScreenSize) { // If the parent Canvas Scaler has UI Scale Mode set to "ScaleWithScreenSize", it messes up the item's scale, so we reset it to 1 go.GetComponent<RectTransform>().localScale = Vector3.one; go.transform.localScale = Vector3.one; } go.GetComponent<ListBoxLineItem>().ListBoxControlObject = this.gameObject; go.GetComponent<ListBoxLineItem>().Index = intIndex; go.GetComponent<ListBoxLineItem>().Spacing = this.Spacing; go.GetComponent<ListBoxLineItem>().Width = ContainerRect.sizeDelta.x - (this.Spacing * 2); if (this.Height > 0) go.GetComponent<ListBoxLineItem>().Height = this.Height; else this.Height = go.GetComponent<ListBoxLineItem>().Height; go.GetComponent<ListBoxLineItem>().ItemNormalColor = ItemNormalColor; go.GetComponent<ListBoxLineItem>().ItemHighlightColor = ItemHighlightColor; go.GetComponent<ListBoxLineItem>().ItemSelectedColor = ItemSelectedColor; go.GetComponent<ListBoxLineItem>().ItemDisabledColor = ItemDisabledColor; go.GetComponent<ListBoxLineItem>().Value = strValue; go.GetComponent<ListBoxLineItem>().Text = strText; go.GetComponent<ListBoxLineItem>().SubText = strSub; go.GetComponent<ListBoxLineItem>().SetIcon(sprIcon); if (OnAddListItem != null) OnAddListItem(go, intIndex); go.GetComponent<ListBoxLineItem>().AutoSize(); Items.Add(go.GetComponent<ListBoxLineItem>()); ResizeContainer(); } #endregion #region "PUBLIC FUNCTIONS" #region "LIST BOX STARTING ITEMS" // -- CLEAR STARTING LIST public void ClearStartItems() { _startArray = new List<StartingListItem>(); } public void InitStartItems(List<StartingListItem> sli) { ClearStartItems(); foreach (StartingListItem s in sli) { _startArray.Add(s); } } // -- ADD ITEM TO STARTING LIST public virtual void AddStartItem(string strValue, string strText, Sprite sprIcon = null, string strSub = "") { int i = StartArray.FindIndex(x => x.Value.ToLower() == strValue.ToLower() || x.Text.ToLower() == strText.ToLower()); if (i >= 0) { // OVERWRITE EXISTING ITEM StartArray[i].Value = strValue; StartArray[i].Text = strText; StartArray[i].Icon = sprIcon; StartArray[i].SubText = strSub; StartArray[i].Index = i; } else { StartArray.Add(new StartingListItem(strValue, strText, sprIcon, strSub)); StartArray[StartArray.Count - 1].Index = StartArray.Count - 1; } } // -- REMOVE ITEM FROM STARTING LIST public virtual void RemoveStartItemByIndex(int intIndex) { if (intIndex < 0 || intIndex >= StartArray.Count) return; for (int i = StartArray.Count - 1; i >= intIndex; i--) { if (i > intIndex) { // MOVE THE ITEM UP ONE SLOT StartArray[i].Index = i - 1; } else { // REMOVE THE ITEM StartArray.RemoveAt(i); } } } public virtual void RemoveStartItemByValue(string strValue) { int i = StartArray.FindIndex(x => x.Value.ToLower() == strValue.ToLower()); if (i >= 0) RemoveStartItemByIndex(i); } public virtual void RemoveStartItemByText( string strText) { int i = StartArray.FindIndex(x => x.Text.ToLower() == strText.ToLower()); if (i >= 0) RemoveStartItemByIndex(i); } // -- SORT ITEMS IN STARTING LIST public virtual void SortStartByValue() { StartArray.Sort((p1, p2) => p1.Text.CompareTo(p2.Value)); for (int i = 0; i < StartArray.Count; i++) { StartArray[i].Index = i; } } public virtual void SortStartByText() { StartArray.Sort((p1, p2) => p1.Text.CompareTo(p2.Text)); for (int i = 0; i < StartArray.Count; i++) { StartArray[i].Index = i; } } public virtual void SortStartBySub() { StartArray.Sort((p1, p2) => p1.SubText.CompareTo(p2.SubText)); for (int i = 0; i < StartArray.Count; i++) { StartArray[i].Index = i; } } #endregion #region "LIST BOX ITEMS" // HANDLE LISTBOX ITEMS public virtual void Clear() { // INITIALIZE THE ITEM LIST _intItemCount = 0; _intSelectedItem = -1; _items = new List<ListBoxLineItem>(); _intSelectedList = new List<int>(); // REMOVE ANY GAMEOBJECTS IN THE CONTAINER if (ScrollContainerObject.transform.childCount > 0) { for (int i = ScrollContainerObject.transform.childCount - 1; i >= 0; i--) Destroy(ScrollContainerObject.transform.GetChild(i).gameObject); } } // -- ADD ITEM TO LISTBOX public virtual void AddItem(string strValue, string strText, string strIcon = "", string strSub = "") { PrivAddItem(strValue, strText, strIcon, strSub); } public virtual void AddItem(string strValue, string strText, Sprite sprIcon, string strSub = "") { PrivAddItem(strValue, strText, sprIcon, strSub); } public virtual void AddItem(string strValue, string strText, string strIcon, int intSub) { AddItem(strValue, strText, strIcon, intSub.ToString()); } public virtual void AddItem(string strValue, string strText, string strIcon, float fSub) { AddItem(strValue, strText, strIcon, fSub.ToString()); } public virtual void AddItem(string strValue, string strText, Sprite sprIcon, int intSub) { AddItem(strValue, strText, sprIcon, intSub.ToString()); } public virtual void AddItem(string strValue, string strText, Sprite sprIcon, float fSub) { AddItem(strValue, strText, sprIcon, fSub.ToString()); } public virtual void AddItem(string[] strValue, string strText) { if (strValue != null && strValue.Length > 0 && strText.Trim() != "") { string strNewVal = ""; for (int i = 0; i < strValue.Length; i++) strNewVal += SeparatorChar + strValue[i]; strNewVal = strNewVal.Substring(1); AddItem(strNewVal, strText); } } public virtual void AddItem(string[] strValue, string strText, string strIcon) { if (strValue != null && strValue.Length > 0 && strText.Trim() != "") { string strNewVal = ""; for (int i = 0; i < strValue.Length; i++) strNewVal += SeparatorChar + strValue[i]; strNewVal = strNewVal.Substring(1); AddItem(strNewVal, strText, strIcon); } } public virtual void AddItem(string[] strValue, string strText, string strIcon, string strSub) { if (strValue != null && strValue.Length > 0 && strText.Trim() != "") { string strNewVal = ""; for (int i = 0; i < strValue.Length; i++) strNewVal += SeparatorChar + strValue[i]; strNewVal = strNewVal.Substring(1); AddItem(strNewVal, strText, strIcon, strSub); } } public virtual void AddItem(string[] strValue, string strText, string strIcon, int intSub) { if (strValue != null && strValue.Length > 0 && strText.Trim() != "") { string strNewVal = ""; for (int i = 0; i < strValue.Length; i++) strNewVal += SeparatorChar + strValue[i]; strNewVal = strNewVal.Substring(1); AddItem(strNewVal, strText, strIcon, intSub.ToString()); } } public virtual void AddItem(string[] strValue, string strText, string strIcon, float fSub) { if (strValue != null && strValue.Length > 0 && strText.Trim() != "") { string strNewVal = ""; for (int i = 0; i < strValue.Length; i++) strNewVal += SeparatorChar + strValue[i]; strNewVal = strNewVal.Substring(1); AddItem(strNewVal, strText, strIcon, fSub.ToString()); } } public virtual void AddItem(string[] strValue, string strText, Sprite sprIcon) { if (strValue != null && strValue.Length > 0 && strText.Trim() != "") { string strNewVal = ""; for (int i = 0; i < strValue.Length; i++) strNewVal += SeparatorChar + strValue[i]; strNewVal = strNewVal.Substring(1); AddItem(strNewVal, strText, sprIcon); } } public virtual void AddItem(string[] strValue, string strText, Sprite sprIcon, string strSub) { if (strValue != null && strValue.Length > 0 && strText.Trim() != "") { string strNewVal = ""; for (int i = 0; i < strValue.Length; i++) strNewVal += SeparatorChar + strValue[i]; strNewVal = strNewVal.Substring(1); AddItem(strNewVal, strText, sprIcon, strSub); } } public virtual void AddItem(string[] strValue, string strText, Sprite sprIcon, int intSub) { if (strValue != null && strValue.Length > 0 && strText.Trim() != "") { string strNewVal = ""; for (int i = 0; i < strValue.Length; i++) strNewVal += SeparatorChar + strValue[i]; strNewVal = strNewVal.Substring(1); AddItem(strNewVal, strText, sprIcon, intSub.ToString()); } } public virtual void AddItem(string[] strValue, string strText, Sprite sprIcon, float fSub) { if (strValue != null && strValue.Length > 0 && strText.Trim() != "") { string strNewVal = ""; for (int i = 0; i < strValue.Length; i++) strNewVal += SeparatorChar + strValue[i]; strNewVal = strNewVal.Substring(1); AddItem(strNewVal, strText, sprIcon, fSub.ToString()); } } public virtual void AddItem(int intValue, string strText) { AddItem(intValue.ToString(), strText); } public virtual void AddItem(int intValue, string strText, string strIcon) { AddItem(intValue.ToString(), strText, strIcon); } public virtual void AddItem(int intValue, string strText, string strIcon, string strSub) { AddItem(intValue.ToString(), strText, strIcon, strSub); } public virtual void AddItem(int intValue, string strText, string strIcon, int intSub) { AddItem(intValue.ToString(), strText, strIcon, intSub.ToString()); } public virtual void AddItem(int intValue, string strText, string strIcon, float fSub) { AddItem(intValue.ToString(), strText, strIcon, fSub.ToString()); } public virtual void AddItem(int intValue, string strText, Sprite sprIcon) { AddItem(intValue.ToString(), strText, sprIcon); } public virtual void AddItem(int intValue, string strText, Sprite sprIcon, string strSub) { AddItem(intValue.ToString(), strText, sprIcon, strSub); } public virtual void AddItem(int intValue, string strText, Sprite sprIcon, int intSub) { AddItem(intValue.ToString(), strText, sprIcon, intSub.ToString()); } public virtual void AddItem(int intValue, string strText, Sprite sprIcon, float fSub) { AddItem(intValue.ToString(), strText, sprIcon, fSub.ToString()); } // -- REMOVE ITEM FROM LISTBOX public virtual void RemoveItemByIndex(int intIndex) { if (intIndex < 0 || intIndex >= Items.Count) return; if (OnRemoveListItem != null) OnRemoveListItem(Items[intIndex].gameObject, intIndex); for (int i = Items.Count - 1; i >= intIndex; i--) { if (i > intIndex) { // MOVE THE ITEM UP ONE SLOT Items[i].Index = i - 1; Items[i].AutoSize(); } else { // REMOVE THE ITEM Items[i].Destroy(); Items.RemoveAt(i); } } _intItemCount--; _intSelectedItem = -1; _intSelectedList = new List<int>(); ResizeContainer(); } public virtual void RemoveItemByValue(string strValue) { int i = Items.FindIndex(x => x.Value.ToLower() == strValue.ToLower()); if (i >= 0) RemoveItemByIndex(i); } public virtual void RemoveItemByText( string strText) { int i = Items.FindIndex(x => x.Text.ToLower() == strText.ToLower()); if (i >= 0) RemoveItemByIndex(i); } // -- SORT LISTBOX ITEMS public virtual void Sort() { SortByText(); } public virtual void SortByText() { Items.Sort((p1, p2) => p1.Text.CompareTo(p2.Text)); for (int i = 0; i < Items.Count; i++) { Items[i].Index = i; Items[i].AutoSize(); } } public virtual void SortByValue() { Items.Sort((p1, p2) => p1.Value.CompareTo(p2.Value)); for (int i = 0; i < Items.Count; i++) { Items[i].Index = i; Items[i].AutoSize(); } } public virtual void SortBySubText() { Items.Sort((p1, p2) => p1.SubText.CompareTo(p2.SubText)); for (int i = 0; i < Items.Count; i++) { Items[i].Index = i; Items[i].AutoSize(); } } // -- SET LISTBOX SCROLLBAR POSITION public virtual void SetToTop() { if (gameObject.activeInHierarchy) StartCoroutine(SetScroll(1)); } public virtual void SetToBottom() { if (gameObject.activeInHierarchy) StartCoroutine(SetScroll(0)); } public virtual void SetToIndex(int intIndex) { // SET THE SCROLLBAR TO MAKE THE SELECTED INDEX (intIndex) VISIBLE IN THE SCROLL CONTAINER float c = ContainerRect.rect.height; // THE HEIGHT OF THE LISTBOX CONTAINER (VISIBLE TO THE USER) float h = Height + Spacing; // THE HEIGHT OF AN INDIVIDUAL LIST ITEM float t = ((((float) _items.Count - 2) * h) + Spacing); // THE TOTAL HEIGHT OF CONTAINER OF ALL LIST ITEMS float p = (((float) intIndex) * h); // THE Y-POS OF AN INDIVIDUAL LIST ITEM float f = 1.00f; if (p >= t - c ) f = 1.00f - (p / t); else f = 1.00f - (p / (t - c)); if (intIndex < 1) f = 1; if (gameObject.activeInHierarchy) StartCoroutine(SetScroll(f)); } // -- CHECK FOR LISTBOX ITEM WITH VALUE public virtual bool HasItemWithValue(string strValue) { return Items.FindIndex(x => x.Value.Trim().ToLower() == strValue.Trim().ToLower()) >= 0; } public virtual bool HasItemWithValue(int intValue) { return HasItemWithValue(intValue.ToString()); } public virtual bool HasItemWithValue(float fValue) { return HasItemWithValue(fValue.ToString()); } // -- ENABLE ONCLICK FOR LISTBOX ITEM (ALSO ADJUSTS ITEM STYLE) public virtual void EnableByIndex(int intIndex) { if (intIndex >= 0 && intIndex < Items.Count) Items[intIndex].Enabled = true; } public virtual void EnableByValue(string strValue) { EnableByIndex(Items.FindIndex(x => x.Value.ToLower() == strValue.ToLower())); } public virtual void EnableByValue(int intValue) { EnableByIndex(Items.FindIndex(x => x.Value.ToLower() == intValue.ToString().ToLower())); } public virtual void EnableByText(string strText) { EnableByIndex(Items.FindIndex(x => x.Text.ToLower() == strText.ToLower())); } // -- DISABLE ONCLICK FOR LISTBOX ITEM (ALSO ADJUSTS ITEM STYLE) public virtual void DisableByIndex(int intIndex) { if (intIndex >= 0 && intIndex < Items.Count) Items[intIndex].Enabled = false; } public virtual void DisableByValue(string strValue) { DisableByIndex(Items.FindIndex(x => x.Value.ToLower() == strValue.ToLower())); } public virtual void DisableByValue(int intValue) { DisableByIndex(Items.FindIndex(x => x.Value.ToLower() == intValue.ToString().ToLower())); } public virtual void DisableByText(string strText) { DisableByIndex(Items.FindIndex(x => x.Text.ToLower() == strText.ToLower())); } // -- SET LISTBOX ITEM TEXT public virtual void SetItemTextByIndex(int intIndex, string strNewText) { Items[intIndex].Text = strNewText; } public virtual void SetItemTextByValue(string strValue, string strNewText) { int i = Items.FindIndex(x => x.Value == strValue); if (i >= 0) SetItemTextByIndex(i, strNewText); } public virtual void SetItemTextByValue(int intValue, string strNewText) { SetItemTextByValue(intValue.ToString(), strNewText); } // -- SET LISTBOX ITEM SUBTEXT public virtual void SetItemSubTextByIndex(int intIndex, string strNewText) { Items[intIndex].SubText = strNewText; } public virtual void SetItemSubTextByValue(string strValue, string strNewText) { int i = Items.FindIndex(x => x.Value == strValue); if (i >= 0) SetItemSubTextByIndex(i, strNewText); } public virtual void SetItemSubTextByValue(int intValue, string strNewText) { SetItemSubTextByValue(intValue.ToString(), strNewText); } // -- CHANGE ITEM ORDER public virtual bool MoveItemUp( int intIndex) { if (intIndex < 1) return false; // UNSELECT BOTH ITEMS bool blnOrig = IsSelectedByIndex(intIndex); bool blnTrgt = IsSelectedByIndex(intIndex - 1); UnSelectItem(intIndex); UnSelectItem(intIndex - 1); // MOVE THE ITEM ListBoxLineItem liOrig = _items[intIndex]; ListBoxLineItem liTrgt = _items[intIndex - 1]; liOrig.Index--; liTrgt.Index++; _items[intIndex] = liTrgt; _items[intIndex - 1] = liOrig; _items[intIndex].AutoSize(); _items[intIndex - 1].AutoSize(); // UPDATE SELECTION if (blnTrgt) SelectByIndex(intIndex); if (blnOrig) SelectByIndex(intIndex - 1); if (_intSelectedItem == intIndex) _intSelectedItem--; return true; } public virtual bool MoveItemDown( int intIndex) { if (intIndex < 0 || intIndex >= _items.Count - 1) return false; // UNSELECT BOTH ITEMS bool blnOrig = IsSelectedByIndex(intIndex); bool blnTrgt = IsSelectedByIndex(intIndex + 1); UnSelectItem(intIndex); UnSelectItem(intIndex + 1); // MOVE THE ITEM ListBoxLineItem liOrig = _items[intIndex]; ListBoxLineItem liTrgt = _items[intIndex + 1]; liOrig.Index++; liTrgt.Index--; _items[intIndex] = liTrgt; _items[intIndex + 1] = liOrig; _items[intIndex].AutoSize(); _items[intIndex + 1].AutoSize(); // UPDATE SELECTION if (blnTrgt) SelectByIndex(intIndex); if (blnOrig) SelectByIndex(intIndex + 1); if (_intSelectedItem == intIndex) _intSelectedItem++; return true; } // -- GET LISTBOX ITEM VALUE public virtual string GetValueByText(string strText) { int i = Items.FindIndex(x => x.Text.ToLower() == strText.Trim().ToLower()); if (i < 0) return ""; else return Items[i].Value; } public virtual string GetValueByIndex(int intIndex) { if (intIndex < 0 || intIndex >= Items.Count) return ""; return Items[intIndex].Value; } public virtual int GetIntValueByIndex(int intIndex) { if (intIndex < 0 || intIndex >= Items.Count) return -1; return Util.ConvertToInt(Items[intIndex].Value); } // -- GET LISTBOX ITEM TEXT public virtual string GetTextByValue(string strvalue) { int i = Items.FindIndex(x => x.Value.ToLower() == strvalue.Trim().ToLower()); if (i < 0) return ""; else return Items[i].Text; } public virtual string GetTextByValue(int intValue) { return GetTextByValue(intValue.ToString()); } public virtual string GetTextByValue(float fValue) { return GetTextByValue(fValue.ToString()); } public virtual string GetTextByIndex(int intIndex) { if (intIndex < 0 || intIndex >= Items.Count) return ""; return Items[intIndex].Text; } // -- GET LISTBOX ITEM SUBTEXT public virtual string GetSubTextByValue(string strvalue) { int i = Items.FindIndex(x => x.Value.ToLower() == strvalue.Trim().ToLower()); if (i < 0) return ""; else return Items[i].SubText; } public virtual string GetSubTextByValue(int intValue) { return GetSubTextByValue(intValue.ToString()); } public virtual string GetSubTextByValue(float fValue) { return GetSubTextByValue(fValue.ToString()); } public virtual string GetSubTextByIndex(int intIndex) { if (intIndex < 0 || intIndex >= Items.Count) return ""; return Items[intIndex].SubText; } // -- HANDLE SELECTION (SET LISTBOX ITEM SELECTED) public virtual void SelectByIndex(int intIndex, bool blnShifted = false, bool blnCtrled = false) { // DATA INTEGRITY CHECK if (intIndex < -1 || intIndex >= Items.Count) return; // MULTI-SELECT OVERRIDE blnShifted = blnShifted && CanMultiSelect; blnCtrled = blnCtrled && CanMultiSelect; // UNSHIFTED/UNCONTROLLED/UNSELECTED CLICK -- (CLICKING FOR THE FIRST TIME) if ((!blnShifted && !blnCtrled) || _intSelectedItem < 0) { UnSelectAllItems(); _intSelectedItem = intIndex; if (_intSelectedItem >= 0 && Items[_intSelectedItem].Enabled) { Items[_intSelectedItem].Select(); _intSelectedList.Add(intIndex); } // CONTROLLED CLICK -- (ADD ITEM TO SELECTED LIST) } else if (blnCtrled) { if (intIndex >= 0 && intIndex < Items.Count && Items[intIndex].Enabled) { if (IsSelectedByIndex(intIndex)) UnSelectItem( intIndex); else { Items[intIndex].Select(); _intSelectedList.Add(intIndex); } } // SHIFT-CLICK -- (ADD RANGE OF ITEMS TO SELECTED LIST) } else if (blnShifted) { UnSelectAllItems(); SelectByRange(intIndex); } if (_intSelectedItem >= -1) { if (this.OnChange != null) OnChange(this.gameObject, _intSelectedItem); } } public virtual void SelectByValue(string strValue) { int i = Items.FindIndex(x => x.Value.ToLower() == strValue.ToLower()); SelectByIndex(i); } public virtual void SelectByText( string strText) { int i = Items.FindIndex(x => x.Text.ToLower() == strText.ToLower()); SelectByIndex(i); } public virtual void Unselect() { UnSelectAllItems(); _intSelectedItem = -1; _intSelectedList = new List<int>(); } public virtual void HandleDoubleClick(int intIndex) { // DATA INTEGRITY CHECK if (!AllowDoubleClick) return; if (intIndex < -1 || intIndex >= Items.Count) return; // SELECT THE ITEM UnSelectAllItems(); _intSelectedItem = intIndex; if (_intSelectedItem >= 0 && Items[_intSelectedItem].Enabled) { Items[_intSelectedItem].Select(); _intSelectedList.Add(intIndex); } // PASS THE DOUBLE-CLICK EVENT TO THE ONDOUBLECLICK EVeNT if (_intSelectedItem >= 0) { if (this.OnDoubleClick != null) OnDoubleClick(this.gameObject, _intSelectedItem); } } // -- HANDLE SELECTED INDEXES public virtual bool IsSelectedByIndex(int intIndex) { return (_intSelectedItem == intIndex || _intSelectedList.FindIndex(x => x == intIndex) >= 0); } // -- RESIZE THE CONTAINER (IF NECESSARY) public virtual void UpdateListBoxContainerSize() { Vector2 v2 = ContainerRect.sizeDelta; v2.y = ((this.Height + this.Spacing) * Items.Count) + this.Spacing; ContainerRect.sizeDelta = v2; ResizeContainer(); } // -- SHOW/HIDE THE LISTBOX CONTROL public virtual void Hide() { gameObject.SetActive(true); if (ListBoxMode == ListBoxModes.ListBox) { GetComponent<Image>().enabled = false; if (ScrollBarObject != null) ScrollBarObject.SetActive(false); if (ScrollRectObject != null) ScrollRectObject.SetActive(false); if (ListBoxTitle != null) ListBoxTitle.gameObject.SetActive(false); } } public virtual void Show() { gameObject.SetActive(true); if (ListBoxMode == ListBoxModes.ListBox) { GetComponent<Image>().enabled = true; if (ScrollBarObject != null) ScrollBarObject.SetActive(true); if (ScrollRectObject != null) ScrollRectObject.SetActive(true); if (ListBoxTitle != null) ListBoxTitle.gameObject.SetActive(true); } } public virtual bool IsShown { get { if (ListBoxMode == ListBoxModes.ListBox) { return GetComponent<Image>().enabled && ScrollBarObject.activeSelf && ScrollRectObject.activeSelf; } return false; } } #endregion #endregion #region "EVENT FUNCTIONS" public event OnListBoxSelectChanged OnChange; public event OnListBoxDoubleClick OnDoubleClick; public event OnAddListItemEvent OnAddListItem; public event OnRemoveListItemEvent OnRemoveListItem; #endregion }
apache-2.0
dbflute-test/dbflute-test-active-dockside
src/test/java/org/docksidestage/dockside/dbflute/whitebox/cbean/bigartist/innerjoin/WxCBInnerJoinStructuralPossibleTest.java
10990
package org.docksidestage.dockside.dbflute.whitebox.cbean.bigartist.innerjoin; import org.dbflute.cbean.result.ListResultBean; import org.docksidestage.dockside.dbflute.bsentity.dbmeta.MemberAddressDbm; import org.docksidestage.dockside.dbflute.bsentity.dbmeta.MemberDbm; import org.docksidestage.dockside.dbflute.bsentity.dbmeta.MemberServiceDbm; import org.docksidestage.dockside.dbflute.bsentity.dbmeta.MemberStatusDbm; import org.docksidestage.dockside.dbflute.bsentity.dbmeta.MemberWithdrawalDbm; import org.docksidestage.dockside.dbflute.bsentity.dbmeta.ProductDbm; import org.docksidestage.dockside.dbflute.bsentity.dbmeta.ProductStatusDbm; import org.docksidestage.dockside.dbflute.bsentity.dbmeta.ServiceRankDbm; import org.docksidestage.dockside.dbflute.bsentity.dbmeta.SummaryProductDbm; import org.docksidestage.dockside.dbflute.bsentity.dbmeta.WithdrawalReasonDbm; import org.docksidestage.dockside.dbflute.exbhv.PurchaseBhv; import org.docksidestage.dockside.dbflute.exentity.Member; import org.docksidestage.dockside.dbflute.exentity.Product; import org.docksidestage.dockside.dbflute.exentity.ProductStatus; import org.docksidestage.dockside.dbflute.exentity.Purchase; import org.docksidestage.dockside.unit.UnitContainerTestCase; /** * @author jflute * @since 0.6.0 (2008/01/16 Wednesday) */ public class WxCBInnerJoinStructuralPossibleTest extends UnitContainerTestCase { // =================================================================================== // Attribute // ========= private PurchaseBhv purchaseBhv; // =================================================================================== // Basic // ===== public void test_StructuralPossible_without_Query() { // ## Arrange ## ListResultBean<Purchase> purchaseList = purchaseBhv.selectList(cb -> { /* ## Act ## */ cb.enableInnerJoinAutoDetect(); cb.setupSelect_Member().withMemberStatus(); cb.setupSelect_Member().withMemberAddressAsValid(currentLocalDate()); cb.setupSelect_Member().withMemberServiceAsOne().withServiceRank(); cb.setupSelect_Member().withMemberWithdrawalAsOne().withWithdrawalReason(); cb.setupSelect_Product().withProductStatus(); cb.setupSelect_SummaryProduct(); cb.query().addOrderBy_MemberId_Asc().addOrderBy_PurchaseDatetime_Desc(); pushCB(cb); }); // ## Assert ## assertNotSame(0, purchaseList.size()); for (Purchase purchase : purchaseList) { Product product = purchase.getProduct().get(); ProductStatus productStatus = product.getProductStatus().get(); assertNotNull(product); assertNotNull(productStatus); log("[PURCHASE]: " + purchase.getPurchaseId() + ", " + product.getProductName() + ", " + productStatus); Member member = purchase.getMember().get(); assertNotNull(member); assertNotNull(member.getMemberStatus()); member.getMemberWithdrawalAsOne().ifPresent(withdrawal -> { withdrawal.getWithdrawalReason().ifPresent(reason -> { String reasonText = reason.getWithdrawalReasonText(); log(" [WDL-MEMBER]: " + member.getMemberId() + ", " + member.getMemberName() + ", " + reasonText); assertNotNull(reasonText); markHere("existsWithdrawal"); }); }); } String sql = popCB().toDisplaySql(); assertTrue(sql.contains("inner join " + MemberDbm.getInstance().getTableDbName())); assertTrue(sql.contains("inner join " + MemberStatusDbm.getInstance().getTableDbName())); assertTrue(sql.contains("left outer join " + MemberAddressDbm.getInstance().getTableDbName())); assertTrue(sql.contains("left outer join " + MemberServiceDbm.getInstance().getTableDbName())); assertTrue(sql.contains("left outer join " + ServiceRankDbm.getInstance().getTableDbName())); assertTrue(sql.contains("left outer join " + MemberWithdrawalDbm.getInstance().getTableDbName())); assertTrue(sql.contains("left outer join " + WithdrawalReasonDbm.getInstance().getTableDbName())); assertTrue(sql.contains("inner join " + ProductDbm.getInstance().getTableDbName())); assertTrue(sql.contains("inner join " + ProductStatusDbm.getInstance().getTableDbName())); assertTrue(sql.contains("left outer join " + SummaryProductDbm.getInstance().getTableDbName())); assertMarked("existsWithdrawal"); } public void test_StructuralPossible_trace_is_ManualInnerJoin() { // ## Arrange ## ListResultBean<Purchase> purchaseList = purchaseBhv.selectList(cb -> { /* ## Act ## */ cb.enableInnerJoinAutoDetect(); cb.setupSelect_Member().withMemberStatus(); cb.setupSelect_Member().withMemberAddressAsValid(currentLocalDate()); cb.setupSelect_Member().withMemberServiceAsOne().withServiceRank(); cb.setupSelect_Member().withMemberWithdrawalAsOne().withWithdrawalReason(); cb.setupSelect_Product().withProductStatus(); cb.setupSelect_SummaryProduct(); cb.query().queryMember().queryMemberServiceAsOne().innerJoin(); cb.query().addOrderBy_MemberId_Asc().addOrderBy_PurchaseDatetime_Desc(); pushCB(cb); }); // ## Assert ## assertNotSame(0, purchaseList.size()); for (Purchase purchase : purchaseList) { Product product = purchase.getProduct().get(); ProductStatus productStatus = product.getProductStatus().get(); assertNotNull(product); assertNotNull(productStatus); log("[PURCHASE]: " + purchase.getPurchaseId() + ", " + product.getProductName() + ", " + productStatus); Member member = purchase.getMember().get(); assertNotNull(member); assertNotNull(member.getMemberStatus()); member.getMemberWithdrawalAsOne().ifPresent(withdrawal -> { withdrawal.getWithdrawalReason().ifPresent(reason -> { String reasonText = reason.getWithdrawalReasonText(); log(" [WDL-MEMBER]: " + member.getMemberId() + ", " + member.getMemberName() + ", " + reasonText); assertNotNull(reasonText); markHere("existsWithdrawal"); }); }); } String sql = popCB().toDisplaySql(); assertTrue(sql.contains("inner join " + MemberDbm.getInstance().getTableDbName())); assertTrue(sql.contains("inner join " + MemberStatusDbm.getInstance().getTableDbName())); assertTrue(sql.contains("left outer join " + MemberAddressDbm.getInstance().getTableDbName())); assertTrue(sql.contains("inner join " + MemberServiceDbm.getInstance().getTableDbName())); assertTrue(sql.contains("inner join " + ServiceRankDbm.getInstance().getTableDbName())); // point assertTrue(sql.contains("left outer join " + MemberWithdrawalDbm.getInstance().getTableDbName())); assertTrue(sql.contains("left outer join " + WithdrawalReasonDbm.getInstance().getTableDbName())); assertTrue(sql.contains("inner join " + ProductDbm.getInstance().getTableDbName())); assertTrue(sql.contains("inner join " + ProductStatusDbm.getInstance().getTableDbName())); assertTrue(sql.contains("left outer join " + SummaryProductDbm.getInstance().getTableDbName())); assertMarked("existsWithdrawal"); } public void test_StructuralPossible_trace_is_WhereUsedInnerJoin() { // ## Arrange ## ListResultBean<Purchase> purchaseList = purchaseBhv.selectList(cb -> { /* ## Act ## */ cb.enableInnerJoinAutoDetect(); cb.setupSelect_Member().withMemberStatus(); cb.setupSelect_Member().withMemberAddressAsValid(currentLocalDate()); cb.setupSelect_Member().withMemberServiceAsOne().withServiceRank(); cb.setupSelect_Member().withMemberWithdrawalAsOne().withWithdrawalReason(); cb.setupSelect_Product().withProductStatus(); cb.setupSelect_SummaryProduct(); cb.query().queryMember().queryMemberServiceAsOne().setServiceRankCode_Equal_Gold(); cb.query().addOrderBy_MemberId_Asc().addOrderBy_PurchaseDatetime_Desc(); pushCB(cb); }); // ## Assert ## assertHasAnyElement(purchaseList); for (Purchase purchase : purchaseList) { purchase.getProduct().alwaysPresent(product -> { assertTrue(product.getProductStatus().isPresent()); log("[PURCHASE]: " + purchase.getPurchaseId() + ", " + product.getProductName() + ", " + product.getProductStatus()); }); purchase.getMember().alwaysPresent(member -> { assertTrue(member.getMemberStatus().isPresent()); member.getMemberWithdrawalAsOne().ifPresent(withdrawal -> { withdrawal.getWithdrawalReason().ifPresent(reason -> { String reasonText = reason.getWithdrawalReasonText(); log(" [WDL-MEMBER]: " + member.getMemberId() + ", " + member.getMemberName() + ", " + reasonText); assertNotNull(reasonText); markHere("existsWithdrawal"); }); }); }); } String sql = popCB().toDisplaySql(); assertTrue(sql.contains("inner join " + MemberDbm.getInstance().getTableDbName())); assertTrue(sql.contains("inner join " + MemberStatusDbm.getInstance().getTableDbName())); assertTrue(sql.contains("left outer join " + MemberAddressDbm.getInstance().getTableDbName())); assertTrue(sql.contains("inner join " + MemberServiceDbm.getInstance().getTableDbName())); assertTrue(sql.contains("inner join " + ServiceRankDbm.getInstance().getTableDbName())); // point assertTrue(sql.contains("left outer join " + MemberWithdrawalDbm.getInstance().getTableDbName())); assertTrue(sql.contains("left outer join " + WithdrawalReasonDbm.getInstance().getTableDbName())); assertTrue(sql.contains("inner join " + ProductDbm.getInstance().getTableDbName())); assertTrue(sql.contains("inner join " + ProductStatusDbm.getInstance().getTableDbName())); assertTrue(sql.contains("left outer join " + SummaryProductDbm.getInstance().getTableDbName())); assertMarked("existsWithdrawal"); } }
apache-2.0
minxinjituan/micro
dicServiceBean/src/main/java/com/mx/dic/holder/DataSourceHolder.java
314
package com.mx.dic.holder; import javax.sql.DataSource; public class DataSourceHolder { public static DataSource dataSource=null; public static DataSource getDataSource() { return dataSource; } public void setDataSource(DataSource dataSource) { DataSourceHolder.dataSource = dataSource; } }
apache-2.0
LBCoderLee/iOS_XianYu
XianYu/Classes/Post/Controller/LBpostViewController.h
218
// // LBpostViewController.h // XianYu // // Created by li bo on 16/5/28. // Copyright © 2016年 li bo. All rights reserved. // #import <UIKit/UIKit.h> @interface LBpostViewController : UIViewController @end
apache-2.0
EAGrahamJr/jinks
src/main/java/org/thevortex/lighting/jinks/devices/hubs/HubLastReading.java
2817
/* * Copyright (c) 2017 by E. A. Graham, Jr. * * 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.thevortex.lighting.jinks.devices.hubs; import org.thevortex.lighting.jinks.devices.ConnectionReading; import org.thevortex.lighting.jinks.devices.FirmwareReading; import org.thevortex.lighting.jinks.devices.Reading; /** * Hub last reading states. * * @author E. A. Graham Jr. */ public class HubLastReading extends Reading implements FirmwareReading, ConnectionReading { public Value<String> getAgentSessionId() { return getFor("agent_session_id"); } public Value<Long> getDesiredKiddeRadioCode() { return getFor("desired_kidde_radio_code"); } public Value<String> getDesiredPairingMode() { return getFor("desired_pairing_mode"); } public Value<String> getDesiredPairingModeDuration() { return getFor("desired_pairing_mode_duration"); } public Value<String> getDesiredPairingPrefix() { return getFor("desired_pairing_mode_prefix"); } public Value<String> getHubVersion() { return getFor("hub_version"); } public Value<String> getIpAddress() { return getFor("ip_address"); } public Value<Long> getKiddeRadioCode() { return getFor("kidde_radio_code"); } public Value<String> getLocalControlId() { return getFor("local_control_id"); } public Value<String> getLocalControlPublicKey() { return getFor("local_control_public_key"); } public Value<String> getLocalControlPublicKeyHash() { return getFor("local_control_public_key_hash"); } public Value<String> getMacAddress() { return getFor("mac_address"); } public Value<String> getPairingMode() { return getFor("pairing_mode"); } public Value<Integer> getPairingModeDuration() { return getFor("pairing_mode_duration"); } public Value<String> getPairingPrefix() { return getFor("pairing_prefix"); } public Value<Boolean> getRemotePairable() { return getFor("remote_pairable"); } public Value<Boolean> getUpdateNeeded() { return getFor("update_needed"); } public Value<Boolean> getUpdatingFirmware() { return getFor("updating_firmware"); } }
apache-2.0
vjanmey/EpicMudfia
com/planet_ink/coffee_mud/Items/Basic/Chair.java
1893
package com.planet_ink.coffee_mud.Items.Basic; import com.planet_ink.coffee_mud.core.interfaces.*; import com.planet_ink.coffee_mud.core.*; import com.planet_ink.coffee_mud.core.collections.*; import com.planet_ink.coffee_mud.Abilities.interfaces.*; import com.planet_ink.coffee_mud.Areas.interfaces.*; import com.planet_ink.coffee_mud.Behaviors.interfaces.*; import com.planet_ink.coffee_mud.CharClasses.interfaces.*; import com.planet_ink.coffee_mud.Commands.interfaces.*; import com.planet_ink.coffee_mud.Common.interfaces.*; import com.planet_ink.coffee_mud.Exits.interfaces.*; import com.planet_ink.coffee_mud.Items.interfaces.*; import com.planet_ink.coffee_mud.Locales.interfaces.*; import com.planet_ink.coffee_mud.MOBS.interfaces.*; import com.planet_ink.coffee_mud.Races.interfaces.*; import java.util.*; /* Copyright 2000-2014 Bo Zimmerman 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. */ public class Chair extends StdRideable { @Override public String ID(){ return "Chair";} protected String readableText=""; public Chair() { super(); setName("a chair"); basePhyStats.setWeight(150); setDisplayText("a chair is here."); setDescription("Looks like a nice comfortable wooden chair"); material=RawMaterial.RESOURCE_OAK; baseGoldValue=5; basePhyStats().setLevel(1); setRideBasis(Rideable.RIDEABLE_SIT); setRiderCapacity(1); recoverPhyStats(); } }
apache-2.0
Ripolin/potato411
README.md
1664
# potato411 [![Build Status](https://travis-ci.org/Ripolin/potato411.svg?branch=ci)](https://travis-ci.org/Ripolin/potato411) [![Coverage Status](https://coveralls.io/repos/github/Ripolin/potato411/badge.svg?branch=master)](https://coveralls.io/github/Ripolin/potato411?branch=master) T411 torrent provider implementation for CouchPotato. It uses the official [T411's API](https://api.t411.al) without parsing any HTML files. ## How to install Once checkout, copy the `t411` directory directly under the `DATA_DIR/data/customs_plugin` directory of your CouchPotato server. When it's done, restart it. You'll see a new entry T411 on the Settings>Searcher location. ## Development Be sure you're running the latest version of [Python 2.7](http://python.org/). ### Tests More information in the [test directory](test). ## Issues Use issue tracker. ## Additional information It's not the purpose of this plugin to manage additional languages for searching torrents. As lucky we are, CouchPotato does this job. Just verify in your `settings.conf` file in your `DATA_DIR` directory that you have the property `languages` correctly filled in the `core` section. Example : ```ini [core] ... languages = fr ``` Now CouchPotato is able to retrieve any movie's french title. Just select it and the plugin does the rest. The `languages` property is a comma separated list of locales and CouchPotato recognize the first entry value as the default one. Furthermore it's useless to append the english locale `en` to this list cause CouchPotato always use it automatically. Multiple locales configuration example : ```ini [core] ... languages = fr,de,sp,it ```
apache-2.0
YoungDigitalPlanet/empiria.player
src/test/java/eu/ydp/empiria/player/client/module/sourcelist/view/SourceListViewImplTest.java
8356
/* * Copyright 2017 Young Digital Planet S.A. * * 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 eu.ydp.empiria.player.client.module.sourcelist.view; import static org.fest.assertions.api.Assertions.*; import static org.mockito.Matchers.anyString; import static org.mockito.Matchers.eq; import static org.mockito.Mockito.*; import com.google.gwt.event.dom.client.DragDropEventBase; import com.google.gwt.junit.GWTMockUtilities; import com.google.inject.Provider; import eu.ydp.empiria.player.client.controller.body.InlineBodyGeneratorSocket; import eu.ydp.empiria.player.client.gin.factory.TouchReservationFactory; import eu.ydp.empiria.player.client.module.dragdrop.*; import eu.ydp.empiria.player.client.module.sourcelist.presenter.SourceListPresenter; import eu.ydp.empiria.player.client.ui.drop.FlowPanelWithDropZone; import eu.ydp.empiria.player.client.util.dom.drag.DragDataObject; import eu.ydp.empiria.player.client.util.events.internal.dragdrop.DragDropEventTypes; import eu.ydp.gwtutil.client.util.geom.HasDimensions; import org.junit.*; import org.junit.runner.RunWith; import org.mockito.*; import org.mockito.invocation.InvocationOnMock; import org.mockito.runners.MockitoJUnitRunner; import org.mockito.stubbing.Answer; @RunWith(MockitoJUnitRunner.class) public class SourceListViewImplTest { @InjectMocks private SourceListViewImpl testObj; @Mock private SourceListPresenter sourceListPresenter; @Mock private TouchReservationFactory touchReservationFactory; @Mock private Provider<SourceListViewItem> sourceListViewItemProvider; @Mock private SourceListViewItem viewItem; @Mock private InlineBodyGeneratorSocket inlineBodyGeneratorSocket; @Mock private FlowPanelWithDropZone items; private final int sourceListViewItemHeight = 11; private final int sourceListViewItemWidth = 12; @BeforeClass public static void disarm() { GWTMockUtilities.disarm(); } @AfterClass public static void rearm() { GWTMockUtilities.restore(); } @Before public void before() { when(sourceListViewItemProvider.get()).then(new Answer<SourceListViewItem>() { @Override public SourceListViewItem answer(InvocationOnMock invocation) throws Throwable { doReturn(sourceListViewItemHeight).when(viewItem).getHeight(); doReturn(sourceListViewItemWidth).when(viewItem).getWidth(); return viewItem; } }); testObj.items = items; } @Test public void testOnDragEventDragStart() throws Exception { // given String itemContent = "itemContent"; String itemId = "item"; SourceListPresenter sourceListPresenter = mock(SourceListPresenter.class); String json = "{}"; DragDataObject dataObject = mock(DragDataObject.class); doReturn(json).when(dataObject).toJSON(); when(sourceListPresenter.getDragDataObject(anyString())).thenReturn(dataObject); DragDropEventBase event = mock(DragDropEventBase.class); // when testObj.createItem(new SourcelistItemValue(SourcelistItemType.TEXT, itemContent, itemId), inlineBodyGeneratorSocket); testObj.setSourceListPresenter(sourceListPresenter); testObj.onDragEvent(DragDropEventTypes.DRAG_START, viewItem, event); // then verify(event).setData(eq("json"), eq(json)); verify(sourceListPresenter).onDragEvent(eq(DragDropEventTypes.DRAG_START), eq(itemId)); } @Test public void shouldNotSetData_whenNotDragStartEvent() throws Exception { // given String itemContent = "itemContent"; String itemId = "item"; DragDropEventBase event = mock(DragDropEventBase.class); // when testObj.createItem(new SourcelistItemValue(SourcelistItemType.TEXT, itemContent, itemId), inlineBodyGeneratorSocket); testObj.setSourceListPresenter(sourceListPresenter); testObj.onDragEvent(DragDropEventTypes.DRAG_CANCEL, viewItem, event); // then verify(event, never()).setData(eq("json"), anyString()); verify(sourceListPresenter).onDragEvent(eq(DragDropEventTypes.DRAG_CANCEL), eq(itemId)); } @Test public void shouldGetItemValue() { // given testObj.createItem(new SourcelistItemValue(SourcelistItemType.TEXT, "a", "a"), inlineBodyGeneratorSocket); // when testObj.getItemValue("a"); // then verify(viewItem).getItemContent(); } @Test public void shouldCreateItem() { // given String itemContent = "itemContent"; String itemId = "item"; doReturn(viewItem).when(sourceListViewItemProvider).get(); // when SourcelistItemValue sourcelistItemValue = new SourcelistItemValue(SourcelistItemType.TEXT, itemId, itemContent); testObj.createItem(sourcelistItemValue, inlineBodyGeneratorSocket); // then verify(sourceListViewItemProvider).get(); verify(items).add(eq(sourceListViewItemProvider.get())); verify(sourceListViewItemProvider.get()).setSourceListView(eq(testObj)); verify(sourceListViewItemProvider.get()).createAndBindUi(eq(sourcelistItemValue), eq(inlineBodyGeneratorSocket)); } @Test public void shouldHideItem() { // given testObj.createItem(new SourcelistItemValue(SourcelistItemType.TEXT, "a", "a"), inlineBodyGeneratorSocket); // when testObj.hideItem("a"); // then verify(viewItem).hide(); } @Test public void shouldNotHideItem_whenIdNotPresent() { // given testObj.createItem(new SourcelistItemValue(SourcelistItemType.TEXT, "a", "a"), inlineBodyGeneratorSocket); // when testObj.hideItem("aa"); // then verify(viewItem, never()).show(); } @Test public void shouldShowItem() { // given testObj.createItem(new SourcelistItemValue(SourcelistItemType.TEXT, "a", "a"), inlineBodyGeneratorSocket); // when testObj.showItem("a"); // then verify(viewItem).show(); } @Test public void shouldNotShowItem_whenIdNotPresent() { // given testObj.createItem(new SourcelistItemValue(SourcelistItemType.TEXT, "a", "a"), inlineBodyGeneratorSocket); // when testObj.showItem("aa"); // then verify(viewItem, never()).show(); } @Test public void shouldLockItemForDrag() { // given testObj.createItem(new SourcelistItemValue(SourcelistItemType.TEXT, "a", "a"), inlineBodyGeneratorSocket); // when testObj.lockItemForDragDrop("a"); // then verify(viewItem).lockForDragDrop(); } @Test public void shouldUnlockItemForDrag() { // given testObj.createItem(new SourcelistItemValue(SourcelistItemType.TEXT, "a", "a"), inlineBodyGeneratorSocket); // when testObj.unlockItemForDragDrop("a"); // then verify(viewItem).unlockForDragDrop(); } @Test public void shouldGetMaxItemSize() { // given testObj.createItem(new SourcelistItemValue(SourcelistItemType.TEXT, "a", "a"), inlineBodyGeneratorSocket); // when HasDimensions maxItemSize = testObj.getMaxItemSize(); // then assertThat(maxItemSize.getHeight()).isEqualTo(sourceListViewItemHeight); assertThat(maxItemSize.getWidth()).isEqualTo(sourceListViewItemWidth); } }
apache-2.0
martincostello/alexa-london-travel
test/LondonTravel.Skill.Tests/AlexaFunctionTests.cs
3076
// Copyright (c) Martin Costello, 2017. All rights reserved. // Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information. using Alexa.NET.Request; using Alexa.NET.Request.Type; using Alexa.NET.Response; using Amazon.Lambda.Core; namespace MartinCostello.LondonTravel.Skill; public class AlexaFunctionTests : FunctionTests { public AlexaFunctionTests(ITestOutputHelper outputHelper) : base(outputHelper) { } [Fact] public async Task Cannot_Invoke_Function_If_Application_Id_Incorrect() { // Arrange AlexaFunction function = await CreateFunctionAsync(); SkillRequest request = CreateIntentRequest("AMAZON.HelpIntent"); request.Session.Application.ApplicationId = "not-my-skill-id"; ILambdaContext context = CreateContext(); // Act InvalidOperationException exception = await Assert.ThrowsAsync<InvalidOperationException>( async () => await function.HandlerAsync(request, context)); // Assert exception.Message.ShouldBe("Request application Id 'not-my-skill-id' and configured skill Id 'my-skill-id' mismatch."); } [Theory] [InlineData(null)] [InlineData("")] [InlineData(" ")] [InlineData("____")] [InlineData("qps-Ploc")] public async Task Can_Invoke_Function_If_Locale_Is_Invalid(string locale) { // Arrange AlexaFunction function = await CreateFunctionAsync(); SkillRequest request = CreateIntentRequest("AMAZON.HelpIntent"); request.Request.Locale = locale; ILambdaContext context = CreateContext(); // Act SkillResponse actual = await function.HandlerAsync(request, context); // Assert ResponseBody response = AssertResponse(actual, shouldEndSession: false); response.OutputSpeech.ShouldNotBeNull(); response.OutputSpeech.Type.ShouldBe("SSML"); } [Fact] public async Task Cannot_Invoke_Function_With_System_Failure() { // Arrange AlexaFunction function = await CreateFunctionAsync(); ILambdaContext context = CreateContext(); var error = new SystemExceptionRequest() { Error = new Error() { Message = "Internal error.", Type = ErrorType.InternalError, }, ErrorCause = new ErrorCause() { requestId = "my-request-id", }, }; var request = CreateRequest(error); // Act SkillResponse actual = await function.HandlerAsync(request, context); // Assert ResponseBody response = AssertResponse(actual); response.Card.ShouldBeNull(); response.Reprompt.ShouldBeNull(); response.OutputSpeech.ShouldNotBeNull(); response.OutputSpeech.Type.ShouldBe("SSML"); var ssml = response.OutputSpeech.ShouldBeOfType<SsmlOutputSpeech>(); ssml.Ssml.ShouldBe("<speak>Sorry, something went wrong.</speak>"); } }
apache-2.0
tmalaska/hadcom.utils
src/main/java/com/cloudera/sa/hcu/io/utils/LocalFileUtils.java
1160
package com.cloudera.sa.hcu.io.utils; import java.io.File; import java.util.ArrayList; public class LocalFileUtils { public static File[] createFileArray(String[] filePathArray) { ArrayList<File> fileList = new ArrayList<File>(); File[] tempFileArray; for (String filePath: filePathArray) { File origFile = new File(filePath); if (origFile.isDirectory()) { tempFileArray = origFile.listFiles(); for (File file: tempFileArray) { fileList.add(file); } }else { fileList.add(origFile); } } return fileList.toArray(new File[0]); } public static String[] createStringArrayOfFiles(String[] filePathArray) { ArrayList<String> filePathList = new ArrayList<String>(); File[] tempFileArray; for (String filePath: filePathArray) { File origFile = new File(filePath); if (origFile.isDirectory()) { tempFileArray = origFile.listFiles(); for (File file: tempFileArray) { filePathList.add(file.getAbsolutePath()); } }else { filePathList.add(origFile.getAbsolutePath()); } } return filePathList.toArray(new String[0]); } }
apache-2.0
dcastro/DequeNET
tests/DequeNet.Tests/Properties/AssemblyInfo.cs
1364
using System.Reflection; 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: AssemblyTitle("DequeNet.Tests")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("DequeNet.Tests")] [assembly: AssemblyCopyright("Copyright © 2013")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // 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("8e1adf9b-2cb7-4477-9c01-69ea8b221522")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
apache-2.0
bayvictor/distributed-polling-system
bin/install_3d_editor.sh
887
sudo apt-get install -y --force-yes libirrlicht-dev #- High performance realtime 3D engine development library sudo apt-get install -y --force-yes libirrlicht-doc #- High performance realtime 3D engine (API documentation) sudo apt-get install -y --force-yes libirrlicht1.7a #- High performance realtime 3D engine sudo apt-get install -y --force-yes bkchem #- Chemical structures editor sudo apt-get install -y --force-yes mm3d #- OpenGL based 3D model editor sudo apt-get install -y --force-yes python-editobj #- Python object editor sudo apt-get install -y --force-yes qcake #- programming environment and scene editor for 3D games sudo apt-get install -y --force-yes qcake-data #- programming environment and scene editor for 3D games #- data files sudo apt-get install -y --force-yes whitedune #- graphical VRML97/X3D viewer, editor, 3D modeller and animation tool
apache-2.0
Asmod4n/ruby-ffi-libsodium
lib/crypto/secret_box.rb
5944
require 'ffi' require_relative '../sodium/utils' require_relative '../random_bytes' require_relative '../sodium/secret_buffer' require_relative '../sodium' module Crypto module SecretBox extend FFI::Library extend Sodium::Utils ffi_lib :libsodium attach_function :primitive, :crypto_secretbox_primitive, [], :string attach_function :keybytes, :crypto_secretbox_keybytes, [], :size_t attach_function :noncebytes, :crypto_secretbox_noncebytes, [], :size_t attach_function :macbytes, :crypto_secretbox_macbytes, [], :size_t PRIMITIVE = primitive.freeze KEYBYTES = keybytes.freeze NONCEBYTES = noncebytes.freeze MACBYTES = macbytes.freeze attach_function :crypto_secretbox_easy, [:buffer_out, :buffer_in, :ulong_long, :buffer_in, :buffer_in], :int attach_function :crypto_secretbox_open_easy, [:buffer_out, :buffer_in, :ulong_long, :buffer_in, :buffer_in], :int attach_function :crypto_secretbox_detached, [:buffer_out, :buffer_out, :buffer_in, :ulong_long, :buffer_in, :buffer_in], :int attach_function :crypto_secretbox_open_detached, [:buffer_out, :buffer_out, :buffer_in, :ulong_long, :buffer_in, :buffer_in], :int module_function def nonce RandomBytes.buf(NONCEBYTES) end def secretbox(message, nonce, key) message_len = get_size(message) check_length(nonce, NONCEBYTES, :Nonce) check_length(key, KEYBYTES, :SecretKey) ciphertext = zeros(message_len + MACBYTES) key.readonly if key.is_a?(Sodium::SecretBuffer) crypto_secretbox_easy(ciphertext, message, message_len, nonce, key) ciphertext ensure key.noaccess if key.is_a?(Sodium::SecretBuffer) end def open(ciphertext, nonce, key, encoding = nil) ciphertext_len = get_size(ciphertext) check_length(nonce, NONCEBYTES, :Nonce) check_length(key, KEYBYTES, :SecretKey) decrypted = zeros(ciphertext_len - MACBYTES) key.readonly if key.is_a?(Sodium::SecretBuffer) if crypto_secretbox_open_easy(decrypted, ciphertext, ciphertext_len, nonce, key) == -1 raise Sodium::CryptoError, "Message forged", caller end if encoding decrypted.force_encoding(encoding) end decrypted ensure key.noaccess if key.is_a?(Sodium::SecretBuffer) end def secretbox!(data, nonce, key) message = String(data) check_length(nonce, NONCEBYTES, :Nonce) check_length(key, KEYBYTES, :SecretKey) message_len = message.bytesize message << zeros(MACBYTES) key.readonly if key.is_a?(Sodium::SecretBuffer) crypto_secretbox_easy(message, message, message_len, nonce, key) message.force_encoding(Encoding::ASCII_8BIT) ensure key.noaccess if key.is_a?(Sodium::SecretBuffer) end def open!(data, nonce, key, encoding = nil) ciphertext = String(data) if (message_len = (ciphertext_len = ciphertext.bytesize) - MACBYTES) < 0 fail Sodium::LengthError, "Ciphertext is too short", caller end check_length(nonce, NONCEBYTES, :Nonce) check_length(key, KEYBYTES, :SecretKey) key.readonly if key.is_a?(Sodium::SecretBuffer) if crypto_secretbox_open_easy(ciphertext, ciphertext, ciphertext_len, nonce, key) == -1 raise Sodium::CryptoError, "Message forged", caller end ciphertext.slice!(message_len..-1) if encoding ciphertext.force_encoding(encoding) end ciphertext ensure key.noaccess if key.is_a?(Sodium::SecretBuffer) end def detached(message, nonce, key) message_len = get_size(message) check_length(nonce, NONCEBYTES, :Nonce) check_length(key, KEYBYTES, :SecretKey) ciphertext = zeros(message_len) mac = zeros(MACBYTES) key.readonly if key.is_a?(Sodium::SecretBuffer) crypto_secretbox_detached(ciphertext, mac, message, message_len, nonce, key) [ciphertext, mac] ensure key.noaccess if key.is_a?(Sodium::SecretBuffer) end def open_detached(ciphertext, mac, nonce, key, encoding = nil) ciphertext_len = get_size(ciphertext) check_length(mac, MACBYTES, :Mac) check_length(nonce, NONCEBYTES, :Nonce) check_length(key, KEYBYTES, :SecretKey) message = zeros(ciphertext_len) key.readonly if key.is_a?(Sodium::SecretBuffer) if crypto_secretbox_open_detached(message, ciphertext, mac, ciphertext_len, nonce, key) == -1 raise Sodium::CryptoError, "Message forged", caller end if encoding message.force_encoding(encoding) end message ensure key.noaccess if key.is_a?(Sodium::SecretBuffer) end def detached!(message, nonce, key) check_length(nonce, NONCEBYTES, :Nonce) check_length(key, KEYBYTES, :SecretKey) mac = zeros(MACBYTES) key.readonly if key.is_a?(Sodium::SecretBuffer) crypto_secretbox_detached(message, mac, message, get_size(message), nonce, key) [message, mac] ensure key.noaccess if key.is_a?(Sodium::SecretBuffer) end def open_detached!(ciphertext, mac, nonce, key, encoding = nil) check_length(mac, MACBYTES, :Mac) check_length(nonce, NONCEBYTES, :Nonce) check_length(key, KEYBYTES, :SecretKey) key.readonly if key.is_a?(Sodium::SecretBuffer) if crypto_secretbox_open_detached(ciphertext, ciphertext, mac, get_size(ciphertext), nonce, key) == -1 raise Sodium::CryptoError, "Message forged", caller end if encoding && ciphertext.respond_to?(:force_encoding) ciphertext.force_encoding(encoding) end ciphertext ensure key.noaccess if key.is_a?(Sodium::SecretBuffer) end end SecretBox.freeze module_function def secretbox(*args) SecretBox.secretbox(*args) end def secretbox!(*args) SecretBox.secretbox!(*args) end end
apache-2.0
domeo/DomeoClient
src/org/mindinformatics/gwt/domeo/plugins/persistence/annotopia/serializers/SAnnotationSetSerializer.java
5833
/* * Copyright 2014 Massachusetts General Hospital * * 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.mindinformatics.gwt.domeo.plugins.persistence.annotopia.serializers; import java.util.List; import org.mindinformatics.gwt.domeo.model.MAnnotation; import org.mindinformatics.gwt.domeo.model.MAnnotationSet; import org.mindinformatics.gwt.domeo.model.persistence.ontologies.IDomeoOntology; import org.mindinformatics.gwt.domeo.model.persistence.ontologies.IPavOntology; import org.mindinformatics.gwt.domeo.model.persistence.ontologies.IRdfsOntology; import org.mindinformatics.gwt.domeo.plugins.persistence.annotopia.model.IAnnotopia; import org.mindinformatics.gwt.framework.src.Utils; import com.google.gwt.json.client.JSONArray; import com.google.gwt.json.client.JSONObject; import com.google.gwt.json.client.JSONString; /** * This class serializes the Annotation Set to Annotopia JSON format. * * @author Paolo Ciccarese <[email protected]> */ public class SAnnotationSetSerializer extends AAnnotopiaSerializer implements IAnnotopiaSerializer { @Override public JSONObject serialize(AnnotopiaSerializerManager manager, Object obj) { MAnnotationSet annotationSet = (MAnnotationSet) obj; JSONObject annotationSetJson = new JSONObject(); annotationSetJson.put(IRdfsOntology.type, new JSONString(IAnnotopia.ANNOTATION_SET)); // These have to exist and defined // TODO HIGH track exception when any of these is null or blank annotationSetJson.put("@context",new JSONString(Utils.getAnnotopiaContextPath( ))); annotationSetJson.put(IRdfsOntology.id, new JSONString(annotationSet.getIndividualUri())); annotationSetJson.put(IDomeoOntology.transientLocalId, new JSONString(Long.toString(annotationSet.getLocalId()))); annotationSetJson.put("serializedBy",new JSONString("urn:application:domeo")); //annotationSetJson.put(IDomeoOntology.annotates, new JSONString(annotationSet.getTargetResource().getUrl())); //manager.addResourceToSerialize(annotationSet.getTargetResource()); // Creation // -------------------------------------------------------------------- if(annotationSet.getCreatedBy()!=null) { //manager.addAgentToSerialize(annotationSet.getCreatedBy()); annotationSetJson.put("createdBy", manager.serialize(annotationSet.getCreatedBy())); //annotationSetJson.put(IPavOntology.createdBy, serializeAgent(manager, annotationSet.getCreatedBy())); } else { // Warning/Exception? } if(annotationSet.getCreatedOn()!=null) { annotationSetJson.put("createdAt", new JSONString(Utils.fullfmt2.format(annotationSet.getCreatedOn()))); } else { // Warning/Exception? } if(annotationSet.getCreatedWith()!=null) { //manager.addAgentToSerialize(annotationSet.getCreatedWith()); annotationSetJson.put("createdWith", manager.serialize(annotationSet.getCreatedWith())); //annotationSetJson.put(IPavOntology.createdWith, serializeAgent(manager, annotationSet.getCreatedWith())); } else { // Warning/Exception? } if(annotationSet.getLastSavedOn()!=null) { annotationSetJson.put("lastUpdateOn", new JSONString(Utils.fullfmt2.format(annotationSet.getLastSavedOn()))); } // Imports // -------------------------------------------------------------------- if(annotationSet.getImportedFrom()!=null) { //manager.addAgentToSerialize(annotationSet.getImportedFrom()); annotationSetJson.put(IPavOntology.importedFrom, new JSONString(annotationSet.getImportedFrom().getUri())); //annotationSetJson.put(IPavOntology.importedFrom, serializeAgent(manager, annotationSet.getImportedFrom())); } if(annotationSet.getImportedBy()!=null) { //manager.addAgentToSerialize(annotationSet.getImportedBy()); annotationSetJson.put(IPavOntology.importedBy, new JSONString(annotationSet.getImportedBy().getUri())); //annotationSetJson.put(IPavOntology.importedBy, serializeAgent(manager, annotationSet.getImportedBy())); } if(annotationSet.getImportedOn()!=null) { annotationSetJson.put(IPavOntology.importedOn, new JSONString(Utils.fullfmt2.format(annotationSet.getImportedOn()))); } // These translate null values into blank strings annotationSetJson.put("label", nullable(annotationSet.getLabel())); annotationSetJson.put("description", nullable(annotationSet.getDescription())); annotationSetJson.put("lineageUri", nullable(annotationSet.getLineageUri())); annotationSetJson.put("version", nullable(annotationSet.getVersionNumber())); annotationSetJson.put("previousVersion", nullable(annotationSet.getPreviousVersion())); annotationSetJson.put("deleted", nullableBoolean(annotationSet.getIsDeleted())); // Serialization of the annotation items that have changed JSONArray annotations = new JSONArray(); List<MAnnotation> annotationsList = annotationSet.getAnnotations(); for(int i=0; i<annotationsList.size(); i++) { //if(annotationsList.get(i).getHasChanged()) annotations.set(i, manager.serialize(annotationsList.get(i))); } annotationSetJson.put("annotations", annotations); return annotationSetJson; } }
apache-2.0
ndlib/scholarsphere
app/models/batch_update_job.rb
2932
# Copyright © 2012 The Pennsylvania State University # # 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. class BatchUpdateJob include Hydra::AccessControlsEnforcement include GenericFileHelper include Rails.application.routes.url_helpers def self.queue :batch_update end def self.perform(*args) new(*args) end def initialize(login, params, perms) params = HashWithIndifferentAccess.new(params) perms = HashWithIndifferentAccess.new(perms) batch = Batch.find_or_create(params[:id]) user = User.find_by_login(login) saved = [] denied = [] batch.generic_files.each do |gf| unless user.can? :edit, get_permissions_solr_response_for_doc_id(gf.pid)[1] logger.error "User #{user.login} DEEEENIED access to #{gf.pid}!" denied << gf next end gf.title = params[:title][gf.pid] if params[:title][gf.pid] rescue gf.label gf.update_attributes(params[:generic_file]) gf.set_visibility(params) save_tries = 0 begin gf.save rescue RSolr::Error::Http => error save_tries += 1 logger.warn "BatchUpdateJob caught RSOLR error on #{gf.pid}: #{error.inspect}" # fail for good if the tries is greater than 3 rescue_action_without_handler(error) if save_tries >=3 sleep 0.01 retry end # begin Resque.enqueue(ContentUpdateEventJob, gf.pid, login) rescue Redis::CannotConnectError logger.error "Redis is down!" end saved << gf end batch.update_attributes({status:["Complete"]}) job_user = User.where(login:"batchuser").first job_user = User.create(login:"batchuser", email:"batchmail") unless job_user message = '<a class="batchid ui-helper-hidden">ss-'+batch.noid+'</a>The file(s) '+ file_list(saved)+ " have been saved." unless saved.empty? job_user.send_message(user, message, 'Batch upload complete') unless saved.empty? message = '<a class="batchid ui-helper-hidden">'+batch.noid+'</a>The file(s) '+ file_list(denied)+" could not be updated. You do not have sufficient privileges to edit it." unless denied.empty? job_user.send_message(user, message, 'Batch upload permission denied') unless denied.empty? end def file_list ( files) return files.map {|gf| '<a href="'+generic_files_path+'/'+gf.noid+'">'+display_title(gf)+'</a>'}.join(', ') end end
apache-2.0
endian675/ignite
modules/platforms/dotnet/Apache.Ignite.Core/Impl/Transactions/TransactionImpl.cs
13246
/* * 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. */ namespace Apache.Ignite.Core.Impl.Transactions { using System; using System.Globalization; using System.Threading; using System.Threading.Tasks; using Apache.Ignite.Core.Impl.Common; using Apache.Ignite.Core.Transactions; /// <summary> /// Grid cache transaction implementation. /// </summary> internal sealed class TransactionImpl : IDisposable { /** Metadatas. */ private object[] _metas; /** Unique transaction ID.*/ private readonly long _id; /** Cache. */ private readonly TransactionsImpl _txs; /** TX concurrency. */ private readonly TransactionConcurrency _concurrency; /** TX isolation. */ private readonly TransactionIsolation _isolation; /** Timeout. */ private readonly TimeSpan _timeout; /** Start time. */ private readonly DateTime _startTime; /** Owning thread ID. */ private readonly int _threadId; /** Originating node ID. */ private readonly Guid _nodeId; /** State holder. */ private StateHolder _state; // ReSharper disable once InconsistentNaming /** Transaction for this thread. */ [ThreadStatic] private static TransactionImpl THREAD_TX; /// <summary> /// Constructor. /// </summary> /// <param name="id">ID.</param> /// <param name="txs">Transactions.</param> /// <param name="concurrency">TX concurrency.</param> /// <param name="isolation">TX isolation.</param> /// <param name="timeout">Timeout.</param> /// <param name="nodeId">The originating node identifier.</param> public TransactionImpl(long id, TransactionsImpl txs, TransactionConcurrency concurrency, TransactionIsolation isolation, TimeSpan timeout, Guid nodeId) { _id = id; _txs = txs; _concurrency = concurrency; _isolation = isolation; _timeout = timeout; _nodeId = nodeId; _startTime = DateTime.Now; _threadId = Thread.CurrentThread.ManagedThreadId; THREAD_TX = this; } /// <summary> /// Transaction assigned to this thread. /// </summary> public static Transaction Current { get { var tx = THREAD_TX; if (tx == null) return null; if (tx.IsClosed) { THREAD_TX = null; return null; } return new Transaction(tx); } } /// <summary> /// Executes prepare step of the two phase commit. /// </summary> public void Prepare() { lock (this) { ThrowIfClosed(); _txs.TxPrepare(this); } } /// <summary> /// Commits this tx and closes it. /// </summary> public void Commit() { lock (this) { ThrowIfClosed(); _state = new StateHolder(_txs.TxCommit(this)); } } /// <summary> /// Rolls this tx back and closes it. /// </summary> public void Rollback() { lock (this) { ThrowIfClosed(); _state = new StateHolder(_txs.TxRollback(this)); } } /// <summary> /// Sets the rollback only flag. /// </summary> public bool SetRollbackOnly() { lock (this) { ThrowIfClosed(); return _txs.TxSetRollbackOnly(this); } } /// <summary> /// Gets a value indicating whether this instance is rollback only. /// </summary> public bool IsRollbackOnly { get { lock (this) { var state0 = _state == null ? State : _state.State; return state0 == TransactionState.MarkedRollback || state0 == TransactionState.RollingBack || state0 == TransactionState.RolledBack; } } } /// <summary> /// Gets the state. /// </summary> public TransactionState State { get { lock (this) { return _state != null ? _state.State : _txs.TxState(this); } } } /// <summary> /// Gets the isolation. /// </summary> public TransactionIsolation Isolation { get { return _isolation; } } /// <summary> /// Gets the concurrency. /// </summary> public TransactionConcurrency Concurrency { get { return _concurrency; } } /// <summary> /// Gets the timeout. /// </summary> public TimeSpan Timeout { get { return _timeout; } } /// <summary> /// Gets the start time. /// </summary> public DateTime StartTime { get { return _startTime; } } /// <summary> /// Gets the node identifier. /// </summary> public Guid NodeId { get { return _nodeId; } } /// <summary> /// Gets the thread identifier. /// </summary> public long ThreadId { get { return _threadId; } } /// <summary> /// Adds a new metadata. /// </summary> public void AddMeta<TV>(string name, TV val) { if (name == null) throw new ArgumentException("Meta name cannot be null."); lock (this) { if (_metas != null) { int putIdx = -1; for (int i = 0; i < _metas.Length; i += 2) { if (name.Equals(_metas[i])) { _metas[i + 1] = val; return; } if (_metas[i] == null && putIdx == -1) // Preserve empty space index. putIdx = i; } // No meta with the given name found. if (putIdx == -1) { // Extend array. putIdx = _metas.Length; object[] metas0 = new object[putIdx + 2]; Array.Copy(_metas, metas0, putIdx); _metas = metas0; } _metas[putIdx] = name; _metas[putIdx + 1] = val; } else _metas = new object[] { name, val }; } } /// <summary> /// Gets metadata by name. /// </summary> public TV Meta<TV>(string name) { if (name == null) throw new ArgumentException("Meta name cannot be null."); lock (this) { if (_metas != null) { for (int i = 0; i < _metas.Length; i += 2) { if (name.Equals(_metas[i])) return (TV)_metas[i + 1]; } } return default(TV); } } /// <summary> /// Removes metadata by name. /// </summary> public TV RemoveMeta<TV>(string name) { if (name == null) throw new ArgumentException("Meta name cannot be null."); lock (this) { if (_metas != null) { for (int i = 0; i < _metas.Length; i += 2) { if (name.Equals(_metas[i])) { TV val = (TV)_metas[i + 1]; _metas[i] = null; _metas[i + 1] = null; return val; } } } return default(TV); } } /// <summary> /// Commits tx in async mode. /// </summary> internal Task CommitAsync() { lock (this) { ThrowIfClosed(); return CloseWhenComplete(_txs.CommitAsync(this)); } } /// <summary> /// Rolls tx back in async mode. /// </summary> internal Task RollbackAsync() { lock (this) { ThrowIfClosed(); return CloseWhenComplete(_txs.RollbackAsync(this)); } } /// <summary> /// Transaction ID. /// </summary> internal long Id { get { return _id; } } /** <inheritdoc /> */ public void Dispose() { try { Close(); } finally { GC.SuppressFinalize(this); } } /// <summary> /// Gets a value indicating whether this transaction is closed. /// </summary> private bool IsClosed { get { return _state != null; } } /// <summary> /// Gets the closed exception. /// </summary> private InvalidOperationException GetClosedException() { return new InvalidOperationException(string.Format(CultureInfo.InvariantCulture, "Transaction {0} is closed, state is {1}", Id, State)); } /// <summary> /// Creates a task via provided factory if IsClosed is false; otherwise, return a task with an error. /// </summary> internal Task GetTask(Func<Task> operationFactory) { lock (this) { return IsClosed ? GetExceptionTask() : operationFactory(); } } /// <summary> /// Gets the task that throws an exception. /// </summary> private Task GetExceptionTask() { var tcs = new TaskCompletionSource<object>(); tcs.SetException(GetClosedException()); return tcs.Task; } /// <summary> /// Closes the transaction and releases unmanaged resources. /// </summary> private void Close() { lock (this) { _state = _state ?? new StateHolder((TransactionState) _txs.TxClose(this)); } } /// <summary> /// Throws and exception if transaction is closed. /// </summary> private void ThrowIfClosed() { if (IsClosed) throw GetClosedException(); } /// <summary> /// Closes this transaction upon task completion. /// </summary> private Task CloseWhenComplete(Task task) { return task.ContWith(x => Close()); } /** <inheritdoc /> */ ~TransactionImpl() { Dispose(); } /// <summary> /// State holder. /// </summary> private class StateHolder { /** Current state. */ private readonly TransactionState _state; /// <summary> /// Constructor. /// </summary> /// <param name="state">State.</param> public StateHolder(TransactionState state) { _state = state; } /// <summary> /// Current state. /// </summary> public TransactionState State { get { return _state; } } } } }
apache-2.0
tahmid29/blogpostapi
src/main/java/com/nwea/dao/BlogpostDAO.java
502
package com.nwea.dao; import com.nwea.bean.Blogpost; import java.sql.SQLException; /** * This interface will be used to invoke the database related operations. * * * Created by tahmidchowdhury on 2/9/17. */ public interface BlogpostDAO { //This method returns all the Blogposts from the database public Blogpost[] getAllPosts() throws SQLException; //This method inserts data into database table public boolean insertBlogpost(String title, String body) throws SQLException; }
apache-2.0
googleapis/common-protos-ruby
googleapis-common-protos-types/lib/google/api/quota_pb.rb
1330
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/api/quota.proto require 'google/protobuf' Google::Protobuf::DescriptorPool.generated_pool.build do add_file("google/api/quota.proto", :syntax => :proto3) do add_message "google.api.Quota" do repeated :limits, :message, 3, "google.api.QuotaLimit" repeated :metric_rules, :message, 4, "google.api.MetricRule" end add_message "google.api.MetricRule" do optional :selector, :string, 1 map :metric_costs, :string, :int64, 2 end add_message "google.api.QuotaLimit" do optional :name, :string, 6 optional :description, :string, 2 optional :default_limit, :int64, 3 optional :max_limit, :int64, 4 optional :free_tier, :int64, 7 optional :duration, :string, 5 optional :metric, :string, 8 optional :unit, :string, 9 map :values, :string, :int64, 10 optional :display_name, :string, 12 end end end module Google module Api Quota = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.Quota").msgclass MetricRule = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.MetricRule").msgclass QuotaLimit = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.QuotaLimit").msgclass end end
apache-2.0
palantir/atlasdb
atlasdb-commons/src/test/java/com/palantir/util/CachedComposedSupplierTest.java
5427
/* * (c) Copyright 2018 Palantir Technologies Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.palantir.util; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.when; import com.palantir.common.concurrent.PTExecutors; import java.util.concurrent.ExecutorService; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicLong; import java.util.function.Supplier; import org.junit.Before; import org.junit.Test; import org.mockito.Mockito; public class CachedComposedSupplierTest { private long counter; private long supplierCounter; private Supplier<VersionedType<Long>> mockVersionedSupplier; private Supplier<Long> testSupplier; @Before public void setup() { counter = 0; supplierCounter = 0; mockVersionedSupplier = Mockito.mock(Supplier.class); testSupplier = new CachedComposedSupplier<>(this::countingFunction, mockVersionedSupplier); } @Test public void appliesFunctionToNullValue() { when(mockVersionedSupplier.get()).thenReturn(VersionedType.of(null, 0)); assertThat(counter).isEqualTo(0); assertThat(testSupplier.get()).isNull(); assertThat(counter).isEqualTo(1); } @Test public void appliesFunctionOnlyOnceWhenUnderlyingSupplierIsConstant() { when(mockVersionedSupplier.get()).thenReturn(VersionedType.of(3L, 0)); assertThat(counter).isEqualTo(0); assertThat(testSupplier.get()).isEqualTo(6); assertThat(testSupplier.get()).isEqualTo(6); assertThat(testSupplier.get()).isEqualTo(6); assertThat(counter).isEqualTo(1); } @Test public void appliesFunctionEachTimeGetIsInvokedAndSuppliedVersionChanged() { when(mockVersionedSupplier.get()).thenReturn(VersionedType.of(null, 0)); assertThat(testSupplier.get()).isNull(); assertThat(counter).isEqualTo(1); when(mockVersionedSupplier.get()).thenReturn(VersionedType.of(3L, 1)); assertThat(testSupplier.get()).isEqualTo(6); assertThat(counter).isEqualTo(2); when(mockVersionedSupplier.get()).thenReturn(VersionedType.of(3L, 2)); assertThat(testSupplier.get()).isEqualTo(6); assertThat(testSupplier.get()).isEqualTo(6); assertThat(counter).isEqualTo(3); when(mockVersionedSupplier.get()).thenReturn(VersionedType.of(8L, 3)); assertThat(testSupplier.get()).isEqualTo(16); assertThat(counter).isEqualTo(4); } @Test public void doesNotApplyFunctionIfGetIsInvokedAndSuppliedVersionConstant() { when(mockVersionedSupplier.get()).thenReturn(VersionedType.of(null, 0)); assertThat(testSupplier.get()).isNull(); assertThat(counter).isEqualTo(1); when(mockVersionedSupplier.get()).thenReturn(VersionedType.of(3L, 0)); assertThat(testSupplier.get()).isNull(); assertThat(counter).isEqualTo(1); when(mockVersionedSupplier.get()).thenReturn(VersionedType.of(8L, 0)); assertThat(testSupplier.get()).isNull(); assertThat(counter).isEqualTo(1); when(mockVersionedSupplier.get()).thenReturn(VersionedType.of(3L, 1)); assertThat(testSupplier.get()).isEqualTo(6); assertThat(counter).isEqualTo(2); } @Test public void appliesFunctionExactlyOncePerSuppliedValueChange() throws InterruptedException { testSupplier = new CachedComposedSupplier<>(this::countingFunction, this::increasingNumber); ExecutorService executorService = PTExecutors.newFixedThreadPool(16); for (int i = 0; i < 100_000; i++) { executorService.submit(testSupplier::get); } executorService.shutdown(); executorService.awaitTermination(1, TimeUnit.MINUTES); assertThat(supplierCounter).isGreaterThan(100_000); assertThat(counter).isEqualTo(1 + supplierCounter / 100); } @Test @SuppressWarnings("ReturnValueIgnored") // Test relating to properties of a Supplier public void recomputesIfSupplierHasNotUpdatedForTooLong() { AtomicLong clockCounter = new AtomicLong(); testSupplier = new CachedComposedSupplier<>(this::countingFunction, this::constantNumber, 5, clockCounter::get); for (int i = 0; i < 25; i++) { clockCounter.incrementAndGet(); testSupplier.get(); } assertThat(counter).isEqualTo(5); } private Long countingFunction(Long input) { counter++; if (input == null) { return null; } return input * 2; } private synchronized VersionedType<Long> increasingNumber() { supplierCounter++; return VersionedType.of(supplierCounter, supplierCounter / 100); } private VersionedType<Long> constantNumber() { return VersionedType.of(1L, 0); } }
apache-2.0
yroffin/wordpress
themes/yrosimple/inc/bootstrap.php
12965
<?php /** * Copyright 2015 yannick. * 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 */ /** * Create HTML list of nav menu items. * * @since 3.0.0 * @uses Walker */ class Custom_walker_Nav_Menu extends Walker_Nav_Menu { /** * What the class handles. * * @see Walker::$tree_type * @since 3.0.0 * @var string */ public $tree_type = array('post_type', 'taxonomy', 'custom'); /** * Database fields to use. * * @see Walker::$db_fields * @since 3.0.0 * @todo Decouple this. * @var array */ public $db_fields = array('parent' => 'menu_item_parent', 'id' => 'db_id'); /** * Starts the list before the elements are added. * * @see Walker::start_lvl() * * @since 3.0.0 * * @param string $output Passed by reference. Used to append additional content. * @param int $depth Depth of menu item. Used for padding. * @param array $args An array of arguments. @see wp_nav_menu() */ public function start_lvl(&$output, $depth = 0, $args = array()) { $indent = str_repeat("\t", $depth); $output .= "\n$indent<ul class=\"dropdown-menu\" role=\"menu\">\n"; } /** * Ends the list of after the elements are added. * * @see Walker::end_lvl() * * @since 3.0.0 * * @param string $output Passed by reference. Used to append additional content. * @param int $depth Depth of menu item. Used for padding. * @param array $args An array of arguments. @see wp_nav_menu() */ public function end_lvl(&$output, $depth = 0, $args = array()) { $indent = str_repeat("\t", $depth); $output .= "$indent</ul>\n"; } /** * Start the element output. * * @see Walker::start_el() * * @since 3.0.0 * * @param string $output Passed by reference. Used to append additional content. * @param object $item Menu item data object. * @param int $depth Depth of menu item. Used for padding. * @param array $args An array of arguments. @see wp_nav_menu() * @param int $id Current item ID. */ public function start_el(&$output, $item, $depth = 0, $args = array(), $id = 0) { $indent = ( $depth ) ? str_repeat("\t", $depth) : ''; /** * Filter the ID applied to a menu item's list item element. * * @since 3.0.1 * @since 4.1.0 The `$depth` parameter was added. * * @param string $menu_id The ID that is applied to the menu item's `<li>` element. * @param object $item The current menu item. * @param array $args An array of {@see wp_nav_menu()} arguments. * @param int $depth Depth of menu item. Used for padding. */ $id = apply_filters('nav_menu_item_id', 'menu-item-' . $item->ID, $item, $args, $depth); $id = $id ? ' id="' . esc_attr($id) . '"' : ''; $atts = array(); $atts['title'] = !empty($item->attr_title) ? $item->attr_title : ''; $atts['target'] = !empty($item->target) ? $item->target : ''; $atts['rel'] = !empty($item->xfn) ? $item->xfn : ''; $atts['href'] = !empty($item->url) ? $item->url : ''; /** * Detect sub menu condition. */ if (!("$this->has_children" == "1")) { $output .= $indent . '<li>'; if(is_object($args)) $args->link_after = ''; } else { $output .= $indent . "<li class=\"dropdown\">"; $atts['class'] = 'dropdown-toggle'; $atts['data-toggle'] = 'dropdown'; $atts['role'] = 'button'; $atts['aria-expanded'] = 'false'; $args->link_after = ' <span class="caret"></span>'; } /** * Filter the HTML attributes applied to a menu item's anchor element. * * @since 3.6.0 * @since 4.1.0 The `$depth` parameter was added. * * @param array $atts { * The HTML attributes applied to the menu item's `<a>` element, empty strings are ignored. * * @type string $title Title attribute. * @type string $target Target attribute. * @type string $rel The rel attribute. * @type string $href The href attribute. * } * @param object $item The current menu item. * @param array $args An array of {@see wp_nav_menu()} arguments. * @param int $depth Depth of menu item. Used for padding. */ $atts = apply_filters('nav_menu_link_attributes', $atts, $item, $args, $depth); $attributes = ''; foreach ($atts as $attr => $value) { if (!empty($value)) { $value = ( 'href' === $attr ) ? esc_url($value) : esc_attr($value); $attributes .= ' ' . $attr . '="' . $value . '"'; } } $item_output = $args->before; $item_output .= '<a' . $attributes . '>'; /** This filter is documented in wp-includes/post-template.php */ $item_output .= $args->link_before . apply_filters('the_title', $item->title, $item->ID) . $args->link_after; $item_output .= '</a>'; $item_output .= $args->after; /** * Filter a menu item's starting output. * * The menu item's starting output only includes `$args->before`, the opening `<a>`, * the menu item's title, the closing `</a>`, and `$args->after`. Currently, there is * no filter for modifying the opening and closing `<li>` for a menu item. * * @since 3.0.0 * * @param string $item_output The menu item's starting HTML output. * @param object $item Menu item data object. * @param int $depth Depth of menu item. Used for padding. * @param array $args An array of {@see wp_nav_menu()} arguments. */ $output .= apply_filters('walker_nav_menu_start_el', $item_output, $item, $depth, $args); } /** * Ends the element output, if needed. * * @see Walker::end_el() * * @since 3.0.0 * * @param string $output Passed by reference. Used to append additional content. * @param object $item Page data object. Not used. * @param int $depth Depth of page. Not Used. * @param array $args An array of arguments. @see wp_nav_menu() */ public function end_el(&$output, $item, $depth = 0, $args = array()) { /** * Detect sub menu condition. */ if (!("$this->has_children" == "1")) { $output .= "</li>\n"; } } } // Walker_Nav_Menu /** * Description of boostrap * * @author yannick */ class bootstrap { /** * build menu */ public static function menu() { $defaults = array( 'theme_location' => '', 'menu' => '', 'container' => 'div', 'container_class' => 'collapse navbar-collapse', 'container_id' => 'bs-example-navbar-collapse-1', 'menu_class' => '', 'menu_id' => '', 'echo' => true, 'fallback_cb' => 'wp_page_menu', 'items_wrap' => '<ul id="%1$s" class="nav navbar-nav">%3$s</ul>', 'depth' => 0, 'walker' => new Custom_walker_Nav_Menu ); ?> <nav class="navbar navbar-default"> <div class="navbar-header"> <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="#"><?php bloginfo('name') ?></a> </div> <!-- Collect the nav links, forms, and other content for toggling --> <div class="container-fluid"> <?php wp_nav_menu($defaults); ?> </div> </nav> <?php } /** * build menu */ public static function carousel() { ?> <div id="carousel-example-generic" class="carousel slide" data-ride="carousel"> <!-- Indicators --> <ol class="carousel-indicators"> <li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li> <li data-target="#carousel-example-generic" data-slide-to="1"></li> <li data-target="#carousel-example-generic" data-slide-to="2"></li> </ol> <!-- Wrapper for slides --> <div class="carousel-inner" role="listbox"> <?php $category_id = get_theme_mod('illeetzick_set_carousel', '0'); ?> <?php $url_img = get_theme_mod('illeetzick_url_carousel', '0'); ?> <?php $query = new WP_Query( 'cat='.$category_id ); $count = 0; ?> <?php if ( $query->have_posts() ) : while ( $query->have_posts() ) : $query->the_post(); $active = ($count == 0)?> <div class="item <?php if($active) {echo "active";} ?> fix-carousel"> <img class="img-responsive img-rounded" src="<?php echo $url_img; ?>" alt="Responsive image" /> <div class="carousel-caption"> <h3><?php the_title(); ?></h3> <?php the_content(); ?> </div> </div> <?php $count=$count+1; endwhile; endif; wp_reset_postdata(); ?> <!-- Controls --> <a class="left carousel-control" href="#carousel-example-generic" role="button" data-slide="prev"> <span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span> <span class="sr-only">Previous</span> </a> <a class="right carousel-control" href="#carousel-example-generic" role="button" data-slide="next"> <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span> <span class="sr-only">Next</span> </a> </div> </div> <?php } /** * build menu */ public static function post() { ?> <br> <blockquote> <em>Posted on:</em> <?php the_time('F jS, Y') ?> <em>by</em> <?php the_author() ?> <a href="<?php the_permalink() ?>"><?php the_title(); ?></a> <?php the_tags('Tags: ', ', ', '<br />'); ?> <p>Categories: <?php the_category( ' ' ); ?></p> </blockquote> <!-- Post <?php the_ID() ?> --> <div class="panel-group" id="panel-the-post"> <div class="panel panel-default"> <div class="panel-heading"> <a class="panel-title" data-toggle="collapse" data-parent="#panel-the-post" href="#panel-element-content"> <?php the_title(); ?> </a> </div> <div id="panel-element-content" class="panel-collapse in" style="height: auto;"> <div class="panel-body"> <!-- Post <?php the_ID() ?> content begin --> <?php the_content(); ?> <!-- Post <?php the_ID() ?> content end --> </div> </div> </div> <div class="panel panel-default"> <div class="panel-heading"> <a class="panel-title collapsed" data-toggle="collapse" data-parent="#panel-the-post" href="#panel-element-comments"> Comments </a> </div> <div id="panel-element-comments" class="panel-collapse collapse" style="height: 0px;"> <div class="panel-body"> <?php comments_template(); ?> </div> </div> </div> </div> <?php } }
apache-2.0
osmdroid/OsmdroidXamarin
OsmdroidThirdPartyBinding/JavaDocs/osmdroid-third-party-5.0.1-javadoc/org/osmdroid/google/wrapper/class-use/MyLocationOverlay.html
4439
<!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_05) on Thu Nov 12 23:46:28 CET 2015 --> <meta http-equiv="Content-Type" content="text/html" charset="UTF-8"> <title>Uses of Class org.osmdroid.google.wrapper.MyLocationOverlay (OSMdroid Third Party 5.0.1 API)</title> <meta name="date" content="2015-11-12"> <link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style"> </head> <body> <script type="text/javascript"><!-- if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Class org.osmdroid.google.wrapper.MyLocationOverlay (OSMdroid Third Party 5.0.1 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/osmdroid/google/wrapper/MyLocationOverlay.html" title="class in org.osmdroid.google.wrapper">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?org/osmdroid/google/wrapper/class-use/MyLocationOverlay.html" target="_top">Frames</a></li> <li><a href="MyLocationOverlay.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.osmdroid.google.wrapper.MyLocationOverlay" class="title">Uses of Class<br>org.osmdroid.google.wrapper.MyLocationOverlay</h2> </div> <div class="classUseContainer">No usage of org.osmdroid.google.wrapper.MyLocationOverlay</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/osmdroid/google/wrapper/MyLocationOverlay.html" title="class in org.osmdroid.google.wrapper">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?org/osmdroid/google/wrapper/class-use/MyLocationOverlay.html" target="_top">Frames</a></li> <li><a href="MyLocationOverlay.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>Copyright &#169; 2015. All Rights Reserved.</small></p> </body> </html>
apache-2.0
nikhilapatil/solr-monitor
lib/basic.php
1380
<?php /** Copyright 2013 Nikhil Patil 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. **/ // Current version define ( "VERSION", "0.1" ); // Configuration file path define ( "CONF_PATH", "./conf/solr.php" ); // Error messages define ( "ERROR_MISSING_CORE_INFO", "Cores could not be loaded" ); define ( "ERROR_UPDATING_CONF_FILE", "Error updating configuration file at " . CONF_PATH . " Please check file permissions" ); define ( "ERROR_MISSING_SYSTEM_INFO", "System info could not be retrieved. Solr older than 1.4?" ); define ( "ERROR_MISSING_CORE_STATS", "Stats for this core could not be retrieved" ); define ( "ERROR_NO_ACTIVE_HANDLERS", "There are no active handlers on this core" ); define ( "ERROR_NO_CACHE_INFO", "Details about cache unavailable" ); // Autoloader function __autoload($class) { require_once strtolower ( str_replace ( '_', DIRECTORY_SEPARATOR, $class ) ) . '.php'; }
apache-2.0
nafae/developer
modules/dfp_axis/src/main/java/com/google/api/ads/dfp/axis/v201308/QuotaError.java
4190
/** * QuotaError.java * * This file was auto-generated from WSDL * by the Apache Axis 1.4 Mar 02, 2009 (07:08:06 PST) WSDL2Java emitter. */ package com.google.api.ads.dfp.axis.v201308; /** * Describes a client-side error on which a user is attempting * to perform an action to which they have no quota remaining. */ public class QuotaError extends com.google.api.ads.dfp.axis.v201308.ApiError implements java.io.Serializable { private com.google.api.ads.dfp.axis.v201308.QuotaErrorReason reason; public QuotaError() { } public QuotaError( java.lang.String fieldPath, java.lang.String trigger, java.lang.String errorString, java.lang.String apiErrorType, com.google.api.ads.dfp.axis.v201308.QuotaErrorReason reason) { super( fieldPath, trigger, errorString, apiErrorType); this.reason = reason; } /** * Gets the reason value for this QuotaError. * * @return reason */ public com.google.api.ads.dfp.axis.v201308.QuotaErrorReason getReason() { return reason; } /** * Sets the reason value for this QuotaError. * * @param reason */ public void setReason(com.google.api.ads.dfp.axis.v201308.QuotaErrorReason reason) { this.reason = reason; } private java.lang.Object __equalsCalc = null; public synchronized boolean equals(java.lang.Object obj) { if (!(obj instanceof QuotaError)) return false; QuotaError other = (QuotaError) obj; if (obj == null) return false; if (this == obj) return true; if (__equalsCalc != null) { return (__equalsCalc == obj); } __equalsCalc = obj; boolean _equals; _equals = super.equals(obj) && ((this.reason==null && other.getReason()==null) || (this.reason!=null && this.reason.equals(other.getReason()))); __equalsCalc = null; return _equals; } private boolean __hashCodeCalc = false; public synchronized int hashCode() { if (__hashCodeCalc) { return 0; } __hashCodeCalc = true; int _hashCode = super.hashCode(); if (getReason() != null) { _hashCode += getReason().hashCode(); } __hashCodeCalc = false; return _hashCode; } // Type metadata private static org.apache.axis.description.TypeDesc typeDesc = new org.apache.axis.description.TypeDesc(QuotaError.class, true); static { typeDesc.setXmlType(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201308", "QuotaError")); org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); elemField.setFieldName("reason"); elemField.setXmlName(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201308", "reason")); elemField.setXmlType(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201308", "QuotaError.Reason")); elemField.setMinOccurs(0); elemField.setNillable(false); typeDesc.addFieldDesc(elemField); } /** * Return type metadata object */ public static org.apache.axis.description.TypeDesc getTypeDesc() { return typeDesc; } /** * Get Custom Serializer */ public static org.apache.axis.encoding.Serializer getSerializer( java.lang.String mechType, java.lang.Class _javaType, javax.xml.namespace.QName _xmlType) { return new org.apache.axis.encoding.ser.BeanSerializer( _javaType, _xmlType, typeDesc); } /** * Get Custom Deserializer */ public static org.apache.axis.encoding.Deserializer getDeserializer( java.lang.String mechType, java.lang.Class _javaType, javax.xml.namespace.QName _xmlType) { return new org.apache.axis.encoding.ser.BeanDeserializer( _javaType, _xmlType, typeDesc); } }
apache-2.0
tramchamploo/buffer-slayer
benchmark/src/main/java/io/github/tramchamploo/bufferslayer/ConcurrentSizeBoundedQueueBenchmark.java
1452
package io.github.tramchamploo.bufferslayer; import io.github.tramchamploo.bufferslayer.Message.MessageKey; import io.github.tramchamploo.bufferslayer.OverflowStrategy.Strategy; import java.util.concurrent.TimeUnit; import org.openjdk.jmh.annotations.BenchmarkMode; import org.openjdk.jmh.annotations.Fork; import org.openjdk.jmh.annotations.Measurement; import org.openjdk.jmh.annotations.Mode; import org.openjdk.jmh.annotations.OutputTimeUnit; import org.openjdk.jmh.annotations.Scope; import org.openjdk.jmh.annotations.State; import org.openjdk.jmh.annotations.Warmup; import org.openjdk.jmh.runner.Runner; import org.openjdk.jmh.runner.RunnerException; import org.openjdk.jmh.runner.options.Options; import org.openjdk.jmh.runner.options.OptionsBuilder; @Measurement(iterations = 5, time = 1) @Warmup(iterations = 10, time = 1) @Fork(3) @BenchmarkMode(Mode.Throughput) @OutputTimeUnit(TimeUnit.SECONDS) @State(Scope.Group) public class ConcurrentSizeBoundedQueueBenchmark extends AbstractSizeBoundedQueueBenchmark { @Override protected AbstractSizeBoundedQueue newQueue(int maxSize, Strategy strategy, MessageKey key) { return new ConcurrentSizeBoundedQueue(maxSize, strategy, key); } public static void main(String[] args) throws RunnerException { Options opt = new OptionsBuilder() .include(".*" + ConcurrentSizeBoundedQueueBenchmark.class.getSimpleName() + ".*") .build(); new Runner(opt).run(); } }
apache-2.0
edu1910/C_Unipe
questao9.c
273
#include <stdio.h> void printstr(const char* string) { int idx = 0; while (*(string+idx) != '\0') { printf("%c\n", *(string+idx)); idx++; } } int main(int argc, char *argv[]) { char str[] = "Teste!"; printstr(str); return 0; }
apache-2.0
WopsS/sampgdk
lib/sampgdk/sampgdk.c
374
#define IN_SAMPGDK #ifndef SAMPGDK_AMALGAMATION #define SAMPGDK_AMALGAMATION #endif #include "sampgdk.h" #if SAMPGDK_WINDOWS #ifdef _MSC_VER #pragma warning(disable: 4996) #endif #undef CreateMenu #undef DestroyMenu #undef GetTickCount #undef KillTimer #undef SelectObject #undef SetTimer #define WIN32_LEAN_AND_MEAN #include <windows.h> #endif
apache-2.0
tsegismont/simone
src/main/java/org/rhq/simone/system/SystemServiceFactory.java
1715
/* * Copyright 2014 Red Hat, 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 org.rhq.simone.system; import static jnr.ffi.Platform.getNativePlatform; import jnr.ffi.Platform; import jnr.posix.POSIX; import jnr.posix.POSIXFactory; import org.rhq.simone.system.linux.LinuxSystemService; import org.rhq.simone.util.log.Log; import org.rhq.simone.util.log.LogFactory; /** * @author Thomas Segismont */ public class SystemServiceFactory { private static final Log LOG = LogFactory.getLog(SystemServiceFactory.class); private SystemServiceFactory() { // Factory } public static SystemService createSystemService() { return createSystemService(POSIXFactory.getPOSIX()); } public static SystemService createSystemService(POSIX posix) { try { Platform.OS os = getNativePlatform().getOS(); switch (os) { case LINUX: return createLinuxSystemService(posix); default: return null; } } catch (Throwable t) { LOG.error("Failed to create SystemService", t); return null; } } public static SystemService createLinuxSystemService(POSIX posix) { return new LinuxSystemService(posix); } }
apache-2.0
ryanobjc/hadoop-cloudera
docs/api/org/apache/hadoop/io/retry/package-use.html
7012
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!--NewPage--> <HTML> <HEAD> <!-- Generated by javadoc (build 1.6.0_16) on Mon Jun 28 12:45:12 PDT 2010 --> <TITLE> Uses of Package org.apache.hadoop.io.retry (Hadoop 0.20.2+320 API) </TITLE> <META NAME="date" CONTENT="2010-06-28"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Package org.apache.hadoop.io.retry (Hadoop 0.20.2+320 API)"; } } </SCRIPT> <NOSCRIPT> </NOSCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <HR> <!-- ========= START OF TOP NAVBAR ======= --> <A NAME="navbar_top"><!-- --></A> <A HREF="#skip-navbar_top" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_top_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;PREV&nbsp; &nbsp;NEXT</FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../index.html?org/apache/hadoop/io/retry/package-use.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="package-use.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_top"></A> <!-- ========= END OF TOP NAVBAR ========= --> <HR> <CENTER> <H2> <B>Uses of Package<br>org.apache.hadoop.io.retry</B></H2> </CENTER> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> Packages that use <A HREF="../../../../../org/apache/hadoop/io/retry/package-summary.html">org.apache.hadoop.io.retry</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><A HREF="#org.apache.hadoop.io.retry"><B>org.apache.hadoop.io.retry</B></A></TD> <TD> A mechanism for selectively retrying methods that throw exceptions under certain circumstances.&nbsp;</TD> </TR> </TABLE> &nbsp; <P> <A NAME="org.apache.hadoop.io.retry"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> Classes in <A HREF="../../../../../org/apache/hadoop/io/retry/package-summary.html">org.apache.hadoop.io.retry</A> used by <A HREF="../../../../../org/apache/hadoop/io/retry/package-summary.html">org.apache.hadoop.io.retry</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><B><A HREF="../../../../../org/apache/hadoop/io/retry/class-use/RetryPolicy.html#org.apache.hadoop.io.retry"><B>RetryPolicy</B></A></B> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Specifies a policy for retrying method failures.</TD> </TR> </TABLE> &nbsp; <P> <HR> <!-- ======= START OF BOTTOM NAVBAR ====== --> <A NAME="navbar_bottom"><!-- --></A> <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_bottom_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;PREV&nbsp; &nbsp;NEXT</FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../index.html?org/apache/hadoop/io/retry/package-use.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="package-use.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_bottom"></A> <!-- ======== END OF BOTTOM NAVBAR ======= --> <HR> Copyright &copy; 2009 The Apache Software Foundation </BODY> </HTML>
apache-2.0
ubuntuvim/my_emberjs_code
chapter3_routes/app/routes/form.js
532
// app/routes/form.js import Ember from 'ember'; export default Ember.Route.extend({ actions: { willTransition: function(transition) { // 如果是使用this.get('key')获取不了页面输入值,因为不是通过action提交表单的 var v = this.controller.get('firstName'); // 任意获取一个作为判断表单输入值 if (v && !confirm("你确定要离开这个页面吗??")) { transition.abort(); } else { return true; } } } });
apache-2.0
leafclick/intellij-community
platform/core-api/src/com/intellij/psi/PsiPolyVariantReference.java
1460
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.psi; import com.intellij.model.SymbolResolveResult; import com.intellij.util.containers.ContainerUtil; import org.jetbrains.annotations.NotNull; import java.util.Collection; /** * Inherit this interface if you want the reference to resolve to more than one element, * or if you want to provide resolve result(s) for a superset of valid resolve cases. * e.g. in Java references in static context are resolved to non-static methods in case * there is no valid candidate. isValidResult() in this case should return false * for later analysis by highlighting pass. * * @see PsiPolyVariantReferenceBase */ public interface PsiPolyVariantReference extends PsiReference { /** * Returns the results of resolving the reference. * * @param incompleteCode if true, the code in the context of which the reference is * being resolved is considered incomplete, and the method may return additional * invalid results. * * @return the array of results for resolving the reference. */ ResolveResult @NotNull [] multiResolve(boolean incompleteCode); @NotNull @Override default Collection<? extends SymbolResolveResult> resolveReference() { ResolveResult[] results = multiResolve(false); return ContainerUtil.filter(results, it -> it.getElement() != null); } }
apache-2.0
cs-au-dk/TAJS
test-resources/src/micro-different-loop-kinds/AGHeap.js
813
/* General Loops - Abstract Case - Free variable */ function f1() { return 1; } function f2() { return 2; } function f3() { return 3; } var b = !Date.now(); // non-deterministic boolean value. var o1 = {x: f1, y: f2, z: f3}; var o2 = {}; var arr = []; if (b) { arr.push("x"); arr.push("y"); } else { arr.push("z"); arr.push("y"); arr.push("x"); } // the array ’arr’ is not concrete when we assume the // path-insensitive analysis. var i = arr.length; while (i--) { // the analysis cannot enumerate all the concrete iterations. var t = arr[i]; var v = o1[t]; o2[t] = (function(v) { return function() { return v; }; }(v)); } var result = o2.x() !== f2; TAJS_assert(result); // TAJS-determinacy: BoolTop // LSA: BoolTop // CompAbs: true
apache-2.0
GoatOfRafin/MSolve
ISAAR.MSolve.FEM/Entities/Cluster.cs
385
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ISAAR.MSolve.FEM.Entities { public class Cluster { private readonly IList<Subdomain> subdomains = new List<Subdomain>(); public IList<Subdomain> Subdomains { get { return subdomains; } } public int ID { get; set; } } }
apache-2.0
kfrapin/mission-recensement
src/Atos/MissionRecensementBundle/Entity/Mission.php
9462
<?php namespace Atos\MissionRecensementBundle\Entity; use Doctrine\ORM\Mapping as ORM; /** * Mission * * @ORM\Table() * @ORM\Entity(repositoryClass="Atos\MissionRecensementBundle\Entity\MissionRepository") */ class Mission { /** * @var integer * * @ORM\Column(name="id", type="integer") * @ORM\Id * @ORM\GeneratedValue(strategy="AUTO") */ private $id; /** * @var string * * @ORM\Column(name="nom", type="string", length=100) */ private $nom; /** * @var string * * @ORM\Column(name="descriptionProcessus", type="string", length=255, nullable=true) */ private $descriptionProcessus; /** * @var string * * @ORM\Column(name="descriptionTechnique", type="string", length=255, nullable=true) */ private $descriptionTechnique; /** * @var string * * @ORM\Column(name="descriptionFonction", type="string", length=255, nullable=true) */ private $descriptionFonction; /** * @var \Date * * @ORM\Column(name="dateDebut", type="date") */ private $dateDebut; /** * @var \Date * * @ORM\Column(name="dateFin", type="date", nullable=true) */ private $dateFin; /** * @ORM\ManyToOne(targetEntity="Atos\MissionRecensementBundle\Entity\Employe") */ private $employe; /** * @ORM\ManyToOne(targetEntity="Atos\MissionRecensementBundle\Entity\Client") */ private $client; /** * @ORM\ManyToOne(targetEntity="Atos\MissionRecensementBundle\Entity\Metier") */ private $metier; /** * @ORM\ManyToOne(targetEntity="Atos\MissionRecensementBundle\Entity\TypePrestation") */ private $typePrestation; /** * @ORM\ManyToOne(targetEntity="Atos\MissionRecensementBundle\Entity\Niveau") */ private $niveau; /** * @ORM\ManyToOne(targetEntity="Atos\MissionRecensementBundle\Entity\Type") */ private $type; /** * @ORM\ManyToOne(targetEntity="Atos\MissionRecensementBundle\Entity\Domaine") */ private $domaine; /** * @ORM\ManyToOne(targetEntity="Atos\MissionRecensementBundle\Entity\Domaine") */ private $sousDomaine; /** * Get id * * @return integer */ public function getId() { return $this->id; } /** * Set descriptionProcessus * * @param string $descriptionProcessus * @return Mission */ public function setDescriptionProcessus($descriptionProcessus) { $this->descriptionProcessus = $descriptionProcessus; return $this; } /** * Get descriptionProcessus * * @return string */ public function getDescriptionProcessus() { return $this->descriptionProcessus; } /** * Set descriptionTechnique * * @param string $descriptionTechnique * @return Mission */ public function setDescriptionTechnique($descriptionTechnique) { $this->descriptionTechnique = $descriptionTechnique; return $this; } /** * Get descriptionTechnique * * @return string */ public function getDescriptionTechnique() { return $this->descriptionTechnique; } /** * Set descriptionFonction * * @param string $descriptionFonction * @return Mission */ public function setDescriptionFonction($descriptionFonction) { $this->descriptionFonction = $descriptionFonction; return $this; } /** * Get descriptionFonction * * @return string */ public function getDescriptionFonction() { return $this->descriptionFonction; } /** * Set dateDebut * * @param \Date $dateDebut * @return Mission */ public function setDateDebut($dateDebut) { $this->dateDebut = $dateDebut; return $this; } /** * Get dateDebut * * @return \Date */ public function getDateDebut() { return $this->dateDebut; } /** * Set dateFin * * @param \Date $dateFin * @return Mission */ public function setDateFin($dateFin) { $this->dateFin = $dateFin; return $this; } /** * Get dateFin * * @return \Date */ public function getDateFin() { return $this->dateFin; } /** * Set employe * * @param \Atos\MissionRecensementBundle\Entity\Employe $employe * @return Mission */ public function setEmploye(\Atos\MissionRecensementBundle\Entity\Employe $employe = null) { $this->employe = $employe; return $this; } /** * Get employe * * @return \Atos\MissionRecensementBundle\Entity\Employe */ public function getEmploye() { return $this->employe; } /** * Set client * * @param \Atos\MissionRecensementBundle\Entity\Client $client * @return Mission */ public function setClient(\Atos\MissionRecensementBundle\Entity\Client $client = null) { $this->client = $client; return $this; } /** * Get client * * @return \Atos\MissionRecensementBundle\Entity\Client */ public function getClient() { return $this->client; } /** * Set metier * * @param \Atos\MissionRecensementBundle\Entity\Metier $metier * @return Mission */ public function setMetier(\Atos\MissionRecensementBundle\Entity\Metier $metier = null) { $this->metier = $metier; return $this; } /** * Get metier * * @return \Atos\MissionRecensementBundle\Entity\Metier */ public function getMetier() { return $this->metier; } /** * Set typePrestation * * @param \Atos\MissionRecensementBundle\Entity\TypePrestation $typePrestation * @return Mission */ public function setTypePrestation(\Atos\MissionRecensementBundle\Entity\TypePrestation $typePrestation = null) { $this->typePrestation = $typePrestation; return $this; } /** * Get typePrestation * * @return \Atos\MissionRecensementBundle\Entity\TypePrestation */ public function getTypePrestation() { return $this->typePrestation; } /** * Set niveau * * @param \Atos\MissionRecensementBundle\Entity\Niveau $niveau * @return Mission */ public function setNiveau(\Atos\MissionRecensementBundle\Entity\Niveau $niveau = null) { $this->niveau = $niveau; return $this; } /** * Get niveau * * @return \Atos\MissionRecensementBundle\Entity\Niveau */ public function getNiveau() { return $this->niveau; } /** * Set type * * @param \Atos\MissionRecensementBundle\Entity\Type $type * @return Mission */ public function setType(\Atos\MissionRecensementBundle\Entity\Type $type = null) { $this->type = $type; return $this; } /** * Get type * * @return \Atos\MissionRecensementBundle\Entity\Type */ public function getType() { return $this->type; } /** * Set nom * * @param string $nom * @return Mission */ public function setNom($nom) { $this->nom = $nom; return $this; } /** * Get nom * * @return string */ public function getNom() { return $this->nom; } /** * Get date interval. * * @return DateInterval */ public function getDateInterval() { $start = $this->getDateDebut(); $end = $this->getDateFin(); if($end) { return $start->diff($end); } return null; } /** * Get duree annees. * * @return integer */ public function getDureeAnnees() { $interval = $this->getDateInterval(); if($interval) { return $interval->y; } } /** * Get duree mois. * * @return integer */ public function getDureeMois() { $interval = $this->getDateInterval(); if($interval) { return $interval->m; } } /** * Set domaine * * @param \Atos\MissionRecensementBundle\Entity\Domaine $domaine * @return Mission */ public function setDomaine(\Atos\MissionRecensementBundle\Entity\Domaine $domaine = null) { $this->domaine = $domaine; return $this; } /** * Get domaine * * @return \Atos\MissionRecensementBundle\Entity\Domaine */ public function getDomaine() { return $this->domaine; } /** * Set sousDomaine * * @param \Atos\MissionRecensementBundle\Entity\Domaine $sousDomaine * @return Mission */ public function setSousDomaine(\Atos\MissionRecensementBundle\Entity\Domaine $sousDomaine = null) { $this->sousDomaine = $sousDomaine; return $this; } /** * Get sousDomaine * * @return \Atos\MissionRecensementBundle\Entity\Domaine */ public function getSousDomaine() { return $this->sousDomaine; } }
apache-2.0
cs-au-dk/TAJS
test-resources/src/micro/test109.js
514
function f() { return 42} TAJS_assert(f.call.call.call(f) === 42) TAJS_assert(f.apply.apply.apply(f) === 42) TAJS_assert(Function.prototype.apply.apply(f) == 42) TAJS_dumpValue(f.apply.apply.apply(f)) function g(x) { return x + 1} TAJS_assert(Function.prototype.call(g,45) === undefined) TAJS_assert(isNaN(g.call.call(g,45))) TAJS_dumpValue(g.call.call(g,45)) TAJS_assert(Function.prototype.call.call(g, null, 87), 'isMaybeNumUInt||isMaybeNaN'); TAJS_dumpValue(Function.prototype.call.call(g,null,87));
apache-2.0
SnailJin/house
apps/agent/admin.py
461
#-*- coding: utf-8 -*- ''' Created on Jul 4, 2013 @author: jin ''' from django.contrib import admin from apps.agent.models import Client, RecommendRecord class ClientAdmin(admin.ModelAdmin): search_fields = ('username','user_username','IDCard') class RecommendRecordAdmin(admin.ModelAdmin): search_fields = ('user_username','client_username') admin.site.register(Client,ClientAdmin) admin.site.register(RecommendRecord,RecommendRecordAdmin)
apache-2.0
iBuildApp/android_module_CustomForm
src/main/java/com/ibuildapp/romanblack/CustomFormPlugin/xmlparser/FormButton.java
464
package com.ibuildapp.romanblack.CustomFormPlugin.xmlparser; /** * Entity class that form submit button. */ public class FormButton { private String label = ""; /** * Returns the button label. * @return the label */ public String getLabel() { return label; } /** * Sets the button label. * @param label the label to set */ public void setLabel(String label) { this.label = label; } }
apache-2.0
codyer/CleanFramework
app/src/main/java/com/cody/app/framework/fragment/WithHeaderFragment.java
1317
/* * Copyright (c) Created by Cody.yi on 2016/8/26. */ package com.cody.app.framework.fragment; import android.databinding.ViewDataBinding; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.v4.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import com.cody.handler.framework.presenter.Presenter; import com.cody.handler.framework.viewmodel.HeaderViewModel; import com.cody.handler.framework.viewmodel.IWithHeaderViewModel; /** * A simple {@link Fragment} subclass. */ public abstract class WithHeaderFragment<P extends Presenter<VM>, VM extends IWithHeaderViewModel, B extends ViewDataBinding> extends BaseBindingFragment<P, VM, B> { /** * 创建标题 * 返回空或者默认的HeaderViewModel不会显示头部,必须设置头部的visible * * @see HeaderViewModel#setVisible */ protected abstract void initHeader(HeaderViewModel header); @Nullable @Override public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { View view = super.onCreateView(inflater, container, savedInstanceState); initHeader(getViewModel().getHeaderViewModel()); return view; } }
apache-2.0
josetonyp/elements
spec/test_app/config/application.rb
1226
require File.expand_path('../boot', __FILE__) # Pick the frameworks you want: require "active_record/railtie" require "action_controller/railtie" require "action_mailer/railtie" require "action_view/railtie" require "sprockets/railtie" # require "rails/test_unit/railtie" Bundler.require(*Rails.groups) require "elements" module TestApp class Application < Rails::Application # Settings in config/environments/* take precedence over those specified here. # Application configuration should go into files in config/initializers # -- all .rb files in that directory are automatically loaded. # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone. # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC. # config.time_zone = 'Central Time (US & Canada)' # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded. # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s] # config.i18n.default_locale = :de # Do not swallow errors in after_commit/after_rollback callbacks. config.active_record.raise_in_transactional_callbacks = true end end
artistic-2.0
GlowstoneMC/glowstonemc.github.io
content/jd/glowstone/1.16/net/glowstone/block/blocktype/class-use/BlockDoublePlant.html
3019
<!DOCTYPE HTML> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (16) on Sat Dec 18 21:56:37 UTC 2021 --> <title>Uses of Class net.glowstone.block.blocktype.BlockDoublePlant (Glowstone 2021.7.1-SNAPSHOT API)</title> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta name="dc.created" content="2021-12-18"> <meta name="description" content="use: package: net.glowstone.block.blocktype, class: BlockDoublePlant"> <meta name="generator" content="javadoc/ClassUseWriter"> <link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style"> <link rel="stylesheet" type="text/css" href="../../../../../script-dir/jquery-ui.min.css" title="Style"> <link rel="stylesheet" type="text/css" href="../../../../../jquery-ui.overrides.css" title="Style"> <script type="text/javascript" src="../../../../../script.js"></script> <script type="text/javascript" src="../../../../../script-dir/jquery-3.5.1.min.js"></script> <script type="text/javascript" src="../../../../../script-dir/jquery-ui.min.js"></script> </head> <body class="class-use-page"> <script type="text/javascript">var pathtoroot = "../../../../../"; loadScripts(document, 'script');</script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <div class="flex-box"> <header role="banner" class="flex-header"> <nav role="navigation"> <!-- ========= START OF TOP NAVBAR ======= --> <div class="top-nav" id="navbar.top"> <div class="skip-nav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <ul id="navbar.top.firstrow" class="nav-list" title="Navigation"> <li><a href="../../../../../index.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../BlockDoublePlant.html" title="class in net.glowstone.block.blocktype">Class</a></li> <li class="nav-bar-cell1-rev">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="sub-nav"> <div class="nav-list-search"><label for="search">SEARCH:</label> <input type="text" id="search" value="search" disabled="disabled"> <input type="reset" id="reset" value="reset" disabled="disabled"> </div> </div> <!-- ========= END OF TOP NAVBAR ========= --> <span class="skip-nav" id="skip.navbar.top"> <!-- --> </span></nav> </header> <div class="flex-content"> <main role="main"> <div class="header"> <h1 title="Uses of Class net.glowstone.block.blocktype.BlockDoublePlant" class="title">Uses of Class<br>net.glowstone.block.blocktype.BlockDoublePlant</h1> </div> No usage of net.glowstone.block.blocktype.BlockDoublePlant</main> <footer role="contentinfo"> <hr> <p class="legal-copy"><small>Copyright &#169; 2021. All rights reserved.</small></p> </footer> </div> </div> </body> </html>
artistic-2.0
met3or/djangoproject
README.md
36
# djangoproject 48 hour django site
artistic-2.0
acidsalad/theFamily
enemy.h
180
#pragma once class Enemy{ public: Enemy(){ hp = 0; pp = 0; name = "default"; } int attack(); protected: int hp; int pp; string name; int attackPrivate(int); };
artistic-2.0
miyorineko/pixmicat-materialize
module/mod_siokara.php
10573
<?php /* mod_siokara : Pixmicat! siokara management subset (Alpha) by: scribe */ class mod_siokara extends ModuleHelper { private $mypage; private $LANGUAGE=array( 'zh_TW' => array( 'siokara_admin_fsage' => '強制sage', 'siokara_admin_ufsage' => '解除強制sage', 'siokara_admin_htmb' => '替換縮圖', 'siokara_admin_uhtmb' => '解除替換縮圖', 'siokara_admin_agif' => '替換縮圖為靜態縮圖', 'siokara_admin_uagif' => '解除替換靜態縮圖', 'siokara_extra_opt' => '附加選項', 'siokara_anigif' => '動態GIF', 'siokara_warn_sage' => '此討論串已被強制sage。', 'siokara_warn_hidethumb' => '縮圖已被替換。' ), 'ja_JP' => array( 'siokara_admin_fsage' => '強制sage', 'siokara_admin_ufsage' => '強制sage解除', 'siokara_admin_htmb' => 'サムネイル差替', 'siokara_admin_uhtmb' => 'サムネイル差替解除', 'siokara_admin_agif' => 'GIFをサムネイル化する', 'siokara_admin_uagif' => 'GIFサムネイル化解除', 'siokara_extra_opt' => '余分なオプション', 'siokara_anigif' => 'GIFアニメ', 'siokara_warn_sage' => 'このスレは管理者によりsage指定されています。理由はお察しください。', 'siokara_warn_hidethumb' => 'この記事の画像は管理者によりサムネイルが差し替えられています。理由はお察しください。<br/>サムネイルをクリックすると元の画像を表示します。' ), 'en_US' => array( 'siokara_admin_fsage' => 'Force sage', 'siokara_admin_ufsage' => 'unForce sage', 'siokara_admin_htmb' => 'Replace thumbnail with nothumb image', 'siokara_admin_uhtmb' => 'Use orginal thumbnail', 'siokara_admin_agif' => 'Use still image of GIF image', 'siokara_admin_uagif' => 'Use Animated GIF', 'siokara_extra_opt' => 'Extra Options', 'siokara_anigif' => 'Animated GIF', 'siokara_warn_sage' => 'This thread was forced sage by administrator.', 'siokara_warn_hidethumb' => 'The thumbnail was replaced by administrator.' ) ); public function __construct($PMS) { parent::__construct($PMS); $this->mypage = $this->getModulePageURL(); $this->attachLanguage( $this->LANGUAGE); // 載入語言檔 } /* Get the name of module */ public function getModuleName(){ return 'mod_siokara : しおから式管理擴充套件'; } /* Get the module version infomation */ public function getModuleVersionInfo(){ return 'v140531'; } public function autoHookAdminList(&$modFunc, $post, $isres){ $FileIO = PMCLibrary::getFileIOInstance(); extract($post); $fh=new FlagHelper($status); if(!$isres) $modFunc .= '[<a href="'.$this->mypage.'&amp;no='.$no.'&amp;action=sage"'.($fh->value('asage')?' title="'.$this->_T('siokara_admin_ufsage').'">s':' title="'.$this->_T('siokara_admin_fsage').'">S').'</a>]'; if($ext && $FileIO->imageExists($tim.$ext)) { $modFunc .= '[<a href="'.$this->mypage.'&amp;no='.$no.'&amp;action=thumb"'.($fh->value('htmb')?' title="'.$this->_T('siokara_admin_uhtmb').'">t':' title="'.$this->_T('siokara_admin_htmb').'">T').'</a>]'; if($ext == '.gif') $modFunc .= '[<a href="'.$this->mypage.'&amp;no='.$no.'&amp;action=agif"'.($fh->value('agif')?' title="'.$this->_T('siokara_admin_agif').'">g':' title="'.$this->_T('siokara_admin_uagif').'">G').'</a>]'; } } public function autoHookPostForm(&$form){ $form .= '<tr><td class="Form_bg"><b>'.$this->_T('siokara_extra_opt').'</b></td><td>[<input type="checkbox" name="anigif" id="anigif" value="on" /><label for="anigif">'.$this->_T('siokara_anigif').'</label>]</td></tr>'; } public function autoHookThreadPost(&$arrLabels, $post, $isReply){ $PIO = PMCLibrary::getPIOInstance(); $FileIO = PMCLibrary::getFileIOInstance(); $fh = new FlagHelper($post['status']); if($fh->value('asage')) { // 強制sage if($arrLabels['{$COM}']) $arrLabels['{$WARN_ENDREPLY}'].='<br/><span class="warn_txt"><small>'.$this->_T('siokara_warn_sage').'<br/></small></span>'; else $arrLabels['{$WARN_ENDREPLY}'] = '<span class="warn_txt"><small>'.$this->_T('siokara_warn_sage').'<br/></small></span>'; } if($FileIO->imageExists($post['tim'].$post['ext'])) { if($fh->value('agif')) { // 動態GIF $imgURL = $FileIO->getImageURL($post['tim'].$post['ext']); $arrLabels['{$IMG_SRC}']=preg_replace('/<img src=".*"/U','<img src="'.$imgURL.'"',$arrLabels['{$IMG_SRC}']); $arrLabels['{$IMG_BAR}'].='<small>['.$this->_T('siokara_anigif').']</small>'; } if($fh->value('htmb')) { // 替換縮圖 $arrLabels['{$IMG_SRC}']=preg_replace('/<img src=".*" style="width: \d+px; height: \d+px;"/U','<img src="nothumb.gif"',$arrLabels['{$IMG_SRC}']); $arrLabels['{$COM}'].='<br/><br/><span class="warn_txt"><small>'.$this->_T('siokara_warn_hidethumb').'<br/></small></span>'; } } } public function autoHookThreadReply(&$arrLabels, $post, $isReply){ $this->autoHookThreadPost($arrLabels, $post, $isReply); } public function autoHookRegistBeforeCommit(&$name, &$email, &$sub, &$com, &$category, &$age, $dest, $isReply, $imgWH, &$status){ $PIO = PMCLibrary::getPIOInstance(); $fh = new FlagHelper($status); $size = @getimagesize($dest); if(isset($_POST['anigif']) && ($size[2] == 1)) { // 動態GIF $fh->toggle('agif'); $status = $fh->toString(); } if($isReply) { $rpost = $PIO->fetchPosts($isReply); // 強制sage $rfh = new FlagHelper($rpost[0]['status']); if($rfh->value('asage')) $age = false; } } /* function _loadLanguage() { global $language; if(PIXMICAT_LANGUAGE != 'zh_TW' && PIXMICAT_LANGUAGE != 'ja_JP' && PIXMICAT_LANGUAGE != 'en_US') $lang = 'en_US'; else $lang = PIXMICAT_LANGUAGE; // builtin language strings if($lang == 'zh_TW') { $language['siokara_admin_fsage'] = '強制sage'; $language['siokara_admin_ufsage'] = '解除強制sage'; $language['siokara_admin_htmb'] = '替換縮圖'; $language['siokara_admin_uhtmb'] = '解除替換縮圖'; $language['siokara_admin_agif'] = '替換縮圖為靜態縮圖'; $language['siokara_admin_uagif'] = '解除替換靜態縮圖'; $language['siokara_extra_opt'] = '附加選項'; $language['siokara_anigif'] = '動態GIF'; $language['siokara_warn_sage'] = '此討論串已被強制sage。'; $language['siokara_warn_hidethumb'] = '縮圖已被替換。'; } else if($lang == 'ja_JP'){ $language['siokara_admin_fsage'] = '強制sage'; $language['siokara_admin_ufsage'] = '強制sage解除'; $language['siokara_admin_htmb'] = 'サムネイル差替'; $language['siokara_admin_uhtmb'] = 'サムネイル差替解除'; $language['siokara_admin_agif'] = 'GIFをサムネイル化する'; $language['siokara_admin_uagif'] = 'GIFサムネイル化解除'; $language['siokara_extra_opt'] = '余分なオプション'; $language['siokara_anigif'] = 'GIFアニメ'; $language['siokara_warn_sage'] = 'このスレは管理者によりsage指定されています。理由はお察しください。'; $language['siokara_warn_hidethumb'] = 'この記事の画像は管理者によりサムネイルが差し替えられています。理由はお察しください。<br/>サムネイルをクリックすると元の画像を表示します。'; } else if($lang == 'en_US'){ $language['siokara_admin_fsage'] = 'Force sage'; $language['siokara_admin_ufsage'] = 'unForce sage'; $language['siokara_admin_htmb'] = 'Replace thumbnail with nothumb image'; $language['siokara_admin_uhtmb'] = 'Use orginal thumbnail'; $language['siokara_admin_agif'] = 'Use still image of GIF image'; $language['siokara_admin_uagif'] = 'Use Animated GIF'; $language['siokara_extra_opt'] = 'Extra Options'; $language['siokara_anigif'] = 'Animated GIF'; $language['siokara_warn_sage'] = 'This thread was forced sage by administrator.'; $language['siokara_warn_hidethumb'] = 'The thumbnail was replaced by administrator.'; } // external language file if(file_exists($langfile=str_replace('.php','.lang.php',__FILE__))) include_once($langfile); } */ public function ModulePage(){ $PIO = PMCLibrary::getPIOInstance(); $FileIO = PMCLibrary::getFileIOInstance(); if(!adminAuthenticate('check')) die('403 Access denied'); $act=isset($_GET['action'])?$_GET['action']:''; switch($act) { case 'sage'; // 強制sage if($PIO->isThread($_GET['no'])) { $post = $PIO->fetchPosts($_GET['no']); if(!count($post)) die('[Error] Post does not exist.'); $flgh = $PIO->getPostStatus($post[0]['status']); $flgh->toggle('asage'); $PIO->setPostStatus($post[0]['no'], $flgh->toString()); $PIO->dbCommit(); //die('Done. Please go back.'); die('Done. Please go <script type="text/javascript"> document.write("<"+"a href=\""+document.referrer+"\">back</a>."); </script><noscript>back.</noscript> '); } else die('[Error] Thread does not exist.'); break; case 'thumb'; // 替換縮圖 $post = $PIO->fetchPosts($_GET['no']); if(!count($post)) die('[Error] Post does not exist.'); if($post[0]['ext']) { if(!$FileIO->imageExists($post[0]['tim'].$post[0]['ext'])) die('[Error] attachment does not exist.'); $flgh = $PIO->getPostStatus($post[0]['status']); $flgh->toggle('htmb'); $PIO->setPostStatus($post[0]['no'], $flgh->toString()); $PIO->dbCommit(); //die('Done. Please go back.'); die('Done. Please go <script type="text/javascript"> document.write("<"+"a href=\""+document.referrer+"\">back</a>."); </script><noscript>back.</noscript> '); } else die('[Error] Post does not have attechment.'); break; case 'agif'; // 動態GIF $post = $PIO->fetchPosts($_GET['no']); if(!count($post)) die('[Error] Post does not exist.'); if($post[0]['ext'] && $post[0]['ext'] == '.gif') { if(!$FileIO->imageExists($post[0]['tim'].$post[0]['ext'])) die('[Error] attachment does not exist.'); $flgh = $PIO->getPostStatus($post[0]['status']); $flgh->toggle('agif'); $PIO->setPostStatus($post[0]['no'], $flgh->toString()); $PIO->dbCommit(); die('Done. Please go <script type="text/javascript"> document.write("<"+"a href=\""+document.referrer+"\">back</a>."); </script><noscript>back.</noscript> '); } else die('[Error] Post does not have attechment.'); break; } } }
artistic-2.0
GlowstoneMC/glowstonemc.github.io
content/jd/glowstone/1.12/net/glowstone/entity/projectile/class-use/GlowWitherSkull.html
4724
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (1.8.0_302) on Sun Aug 29 01:47:02 UTC 2021 --> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Uses of Class net.glowstone.entity.projectile.GlowWitherSkull (Glowstone 2021.7.0-SNAPSHOT API)</title> <meta name="date" content="2021-08-29"> <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 net.glowstone.entity.projectile.GlowWitherSkull (Glowstone 2021.7.0-SNAPSHOT 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="../../../../../net/glowstone/entity/projectile/GlowWitherSkull.html" title="class in net.glowstone.entity.projectile">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../../../../../overview-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?net/glowstone/entity/projectile/class-use/GlowWitherSkull.html" target="_top">Frames</a></li> <li><a href="GlowWitherSkull.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 net.glowstone.entity.projectile.GlowWitherSkull" class="title">Uses of Class<br>net.glowstone.entity.projectile.GlowWitherSkull</h2> </div> <div class="classUseContainer">No usage of net.glowstone.entity.projectile.GlowWitherSkull</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="../../../../../net/glowstone/entity/projectile/GlowWitherSkull.html" title="class in net.glowstone.entity.projectile">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../../../../../overview-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?net/glowstone/entity/projectile/class-use/GlowWitherSkull.html" target="_top">Frames</a></li> <li><a href="GlowWitherSkull.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; 2021. All rights reserved.</small></p> </body> </html>
artistic-2.0
emojicode/emojicode
docs/html/class_emojicode_compiler_1_1_a_s_t_error_type.html
15721
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta name="generator" content="Doxygen 1.8.14"/> <meta name="viewport" content="width=device-width, initial-scale=1"/> <title>Emojicode: EmojicodeCompiler::ASTErrorType Class Reference</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="search/searchdata.js"></script> <script type="text/javascript" src="search/search.js"></script> <link href="doxygen.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td id="projectalign" style="padding-left: 0.5em;"> <div id="projectname">Emojicode &#160;<span id="projectnumber">0.6</span> </div> <div id="projectbrief">World’s only programming language that’s bursting with emojis</div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.14 --> <script type="text/javascript"> /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */ var searchBox = new SearchBox("searchBox", "search",false,'Search'); /* @license-end */ </script> <script type="text/javascript" src="menudata.js"></script> <script type="text/javascript" src="menu.js"></script> <script type="text/javascript"> /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */ $(function() { initMenu('',true,false,'search.php','Search'); $(document).ready(function() { init_search(); }); }); /* @license-end */</script> <div id="main-nav"></div> <!-- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> </div> <!-- iframe showing the search results (closed by default) --> <div id="MSearchResultsWindow"> <iframe src="javascript:void(0)" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> <div id="nav-path" class="navpath"> <ul> <li class="navelem"><a class="el" href="namespace_emojicode_compiler.html">EmojicodeCompiler</a></li><li class="navelem"><a class="el" href="class_emojicode_compiler_1_1_a_s_t_error_type.html">ASTErrorType</a></li> </ul> </div> </div><!-- top --> <div class="header"> <div class="summary"> <a href="#pub-methods">Public Member Functions</a> &#124; <a href="class_emojicode_compiler_1_1_a_s_t_error_type-members.html">List of all members</a> </div> <div class="headertitle"> <div class="title">EmojicodeCompiler::ASTErrorType Class Reference</div> </div> </div><!--header--> <div class="contents"> <div class="dynheader"> Inheritance diagram for EmojicodeCompiler::ASTErrorType:</div> <div class="dyncontent"> <div class="center"><img src="class_emojicode_compiler_1_1_a_s_t_error_type__inherit__graph.png" border="0" usemap="#_emojicode_compiler_1_1_a_s_t_error_type_inherit__map" alt="Inheritance graph"/></div> <map name="_emojicode_compiler_1_1_a_s_t_error_type_inherit__map" id="_emojicode_compiler_1_1_a_s_t_error_type_inherit__map"> <area shape="rect" id="node2" href="class_emojicode_compiler_1_1_a_s_t_type.html" title="Abstract parent class of all abstract syntax tree nodes representing a $type$. " alt="" coords="5,92,150,131"/> <area shape="rect" id="node3" href="class_emojicode_compiler_1_1_a_s_t_node.html" title="ASTNode is the parent class of all nodes in the abstract syntax tree. " alt="" coords="5,5,150,44"/> </map> <center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div> <div class="dynheader"> Collaboration diagram for EmojicodeCompiler::ASTErrorType:</div> <div class="dyncontent"> <div class="center"><img src="class_emojicode_compiler_1_1_a_s_t_error_type__coll__graph.png" border="0" usemap="#_emojicode_compiler_1_1_a_s_t_error_type_coll__map" alt="Collaboration graph"/></div> <map name="_emojicode_compiler_1_1_a_s_t_error_type_coll__map" id="_emojicode_compiler_1_1_a_s_t_error_type_coll__map"> <area shape="rect" id="node2" href="class_emojicode_compiler_1_1_a_s_t_type.html" title="Abstract parent class of all abstract syntax tree nodes representing a $type$. " alt="" coords="5,92,150,131"/> <area shape="rect" id="node3" href="class_emojicode_compiler_1_1_a_s_t_node.html" title="ASTNode is the parent class of all nodes in the abstract syntax tree. " alt="" coords="5,5,150,44"/> </map> <center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div> <table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a> Public Member Functions</h2></td></tr> <tr class="memitem:a74b43bdf83feddec66455d1c34581162"><td class="memItemLeft" align="right" valign="top"><a id="a74b43bdf83feddec66455d1c34581162"></a> &#160;</td><td class="memItemRight" valign="bottom"><b>ASTErrorType</b> (std::unique_ptr&lt; <a class="el" href="class_emojicode_compiler_1_1_a_s_t_type.html">ASTType</a> &gt; enumeration, std::unique_ptr&lt; <a class="el" href="class_emojicode_compiler_1_1_a_s_t_type.html">ASTType</a> &gt; type, <a class="el" href="struct_emojicode_compiler_1_1_source_position.html">SourcePosition</a> p, <a class="el" href="class_emojicode_compiler_1_1_package.html">Package</a> *package)</td></tr> <tr class="separator:a74b43bdf83feddec66455d1c34581162"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a5c9f70ab9b6d7a9e7bbde6c1efcb3ac5"><td class="memItemLeft" align="right" valign="top"><a id="a5c9f70ab9b6d7a9e7bbde6c1efcb3ac5"></a> void&#160;</td><td class="memItemRight" valign="bottom"><b>toCodeType</b> (<a class="el" href="class_emojicode_compiler_1_1_pretty_stream.html">PrettyStream</a> &amp;pretty) const override</td></tr> <tr class="separator:a5c9f70ab9b6d7a9e7bbde6c1efcb3ac5"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a84c4d71cfc7d1d5361943409671117d7"><td class="memItemLeft" align="right" valign="top"><a id="a84c4d71cfc7d1d5361943409671117d7"></a> <a class="el" href="class_emojicode_compiler_1_1_type.html">Type</a>&#160;</td><td class="memItemRight" valign="bottom"><b>getType</b> (const <a class="el" href="class_emojicode_compiler_1_1_type_context.html">TypeContext</a> &amp;typeContext) const override</td></tr> <tr class="separator:a84c4d71cfc7d1d5361943409671117d7"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="inherit_header pub_methods_class_emojicode_compiler_1_1_a_s_t_type"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_class_emojicode_compiler_1_1_a_s_t_type')"><img src="closed.png" alt="-"/>&#160;Public Member Functions inherited from <a class="el" href="class_emojicode_compiler_1_1_a_s_t_type.html">EmojicodeCompiler::ASTType</a></td></tr> <tr class="memitem:ab1d4c3ccc9a429842d8cd044994354d0 inherit pub_methods_class_emojicode_compiler_1_1_a_s_t_type"><td class="memItemLeft" align="right" valign="top"><a id="ab1d4c3ccc9a429842d8cd044994354d0"></a> <a class="el" href="class_emojicode_compiler_1_1_type.html">Type</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><b>analyseType</b> (const <a class="el" href="class_emojicode_compiler_1_1_type_context.html">TypeContext</a> &amp;typeContext)</td></tr> <tr class="separator:ab1d4c3ccc9a429842d8cd044994354d0 inherit pub_methods_class_emojicode_compiler_1_1_a_s_t_type"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a2436fbc3cf2668b508c510207b6a9b72 inherit pub_methods_class_emojicode_compiler_1_1_a_s_t_type"><td class="memItemLeft" align="right" valign="top"><a id="a2436fbc3cf2668b508c510207b6a9b72"></a> <a class="el" href="class_emojicode_compiler_1_1_type.html">Type</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><b>type</b> ()</td></tr> <tr class="separator:a2436fbc3cf2668b508c510207b6a9b72 inherit pub_methods_class_emojicode_compiler_1_1_a_s_t_type"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a6ee7475ee5b9114a6ab5c7584ed627d6 inherit pub_methods_class_emojicode_compiler_1_1_a_s_t_type"><td class="memItemLeft" align="right" valign="top"><a id="a6ee7475ee5b9114a6ab5c7584ed627d6"></a> const <a class="el" href="class_emojicode_compiler_1_1_type.html">Type</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><b>type</b> () const</td></tr> <tr class="separator:a6ee7475ee5b9114a6ab5c7584ed627d6 inherit pub_methods_class_emojicode_compiler_1_1_a_s_t_type"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a8c8edade2af12749bcaf1017f1bf2f4e inherit pub_methods_class_emojicode_compiler_1_1_a_s_t_type"><td class="memItemLeft" align="right" valign="top"><a id="a8c8edade2af12749bcaf1017f1bf2f4e"></a> void&#160;</td><td class="memItemRight" valign="bottom"><b>setOptional</b> (bool optional)</td></tr> <tr class="separator:a8c8edade2af12749bcaf1017f1bf2f4e inherit pub_methods_class_emojicode_compiler_1_1_a_s_t_type"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a55128d8b13a43eb35c8d3999557e6af6 inherit pub_methods_class_emojicode_compiler_1_1_a_s_t_type"><td class="memItemLeft" align="right" valign="top"><a id="a55128d8b13a43eb35c8d3999557e6af6"></a> bool&#160;</td><td class="memItemRight" valign="bottom"><b>wasAnalysed</b> () const</td></tr> <tr class="separator:a55128d8b13a43eb35c8d3999557e6af6 inherit pub_methods_class_emojicode_compiler_1_1_a_s_t_type"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a60453e9c710a01d87195d49d5fc17d71 inherit pub_methods_class_emojicode_compiler_1_1_a_s_t_type"><td class="memItemLeft" align="right" valign="top"><a id="a60453e9c710a01d87195d49d5fc17d71"></a> void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_emojicode_compiler_1_1_a_s_t_type.html#a60453e9c710a01d87195d49d5fc17d71">toCode</a> (<a class="el" href="class_emojicode_compiler_1_1_pretty_stream.html">PrettyStream</a> &amp;pretty) const override</td></tr> <tr class="memdesc:a60453e9c710a01d87195d49d5fc17d71 inherit pub_methods_class_emojicode_compiler_1_1_a_s_t_type"><td class="mdescLeft">&#160;</td><td class="mdescRight">Appends code that leads to the creation of a node like this to the provided Prettyprinter. <br /></td></tr> <tr class="separator:a60453e9c710a01d87195d49d5fc17d71 inherit pub_methods_class_emojicode_compiler_1_1_a_s_t_type"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="inherit_header pub_methods_class_emojicode_compiler_1_1_a_s_t_node"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_class_emojicode_compiler_1_1_a_s_t_node')"><img src="closed.png" alt="-"/>&#160;Public Member Functions inherited from <a class="el" href="class_emojicode_compiler_1_1_a_s_t_node.html">EmojicodeCompiler::ASTNode</a></td></tr> <tr class="memitem:a9e9d8252f628458755697eff2adc9160 inherit pub_methods_class_emojicode_compiler_1_1_a_s_t_node"><td class="memItemLeft" align="right" valign="top"><a id="a9e9d8252f628458755697eff2adc9160"></a> &#160;</td><td class="memItemRight" valign="bottom"><b>ASTNode</b> (<a class="el" href="struct_emojicode_compiler_1_1_source_position.html">SourcePosition</a> p)</td></tr> <tr class="separator:a9e9d8252f628458755697eff2adc9160 inherit pub_methods_class_emojicode_compiler_1_1_a_s_t_node"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a169020f6c66090c16b98247e339ac255 inherit pub_methods_class_emojicode_compiler_1_1_a_s_t_node"><td class="memItemLeft" align="right" valign="top"><a id="a169020f6c66090c16b98247e339ac255"></a> const <a class="el" href="struct_emojicode_compiler_1_1_source_position.html">SourcePosition</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_emojicode_compiler_1_1_a_s_t_node.html#a169020f6c66090c16b98247e339ac255">position</a> () const</td></tr> <tr class="memdesc:a169020f6c66090c16b98247e339ac255 inherit pub_methods_class_emojicode_compiler_1_1_a_s_t_node"><td class="mdescLeft">&#160;</td><td class="mdescRight">The source position that caused this node to be created. <br /></td></tr> <tr class="separator:a169020f6c66090c16b98247e339ac255 inherit pub_methods_class_emojicode_compiler_1_1_a_s_t_node"><td class="memSeparator" colspan="2">&#160;</td></tr> </table><table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="inherited"></a> Additional Inherited Members</h2></td></tr> <tr class="inherit_header pro_methods_class_emojicode_compiler_1_1_a_s_t_type"><td colspan="2" onclick="javascript:toggleInherit('pro_methods_class_emojicode_compiler_1_1_a_s_t_type')"><img src="closed.png" alt="-"/>&#160;Protected Member Functions inherited from <a class="el" href="class_emojicode_compiler_1_1_a_s_t_type.html">EmojicodeCompiler::ASTType</a></td></tr> <tr class="memitem:a41073085384c30b6fcc94059f6d55a86 inherit pro_methods_class_emojicode_compiler_1_1_a_s_t_type"><td class="memItemLeft" align="right" valign="top"><a id="a41073085384c30b6fcc94059f6d55a86"></a> &#160;</td><td class="memItemRight" valign="bottom"><b>ASTType</b> (<a class="el" href="struct_emojicode_compiler_1_1_source_position.html">SourcePosition</a> p, <a class="el" href="class_emojicode_compiler_1_1_package.html">Package</a> *package)</td></tr> <tr class="separator:a41073085384c30b6fcc94059f6d55a86 inherit pro_methods_class_emojicode_compiler_1_1_a_s_t_type"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:af175a5fe83e0ede54e540adeb31257fb inherit pro_methods_class_emojicode_compiler_1_1_a_s_t_type"><td class="memItemLeft" align="right" valign="top"><a id="af175a5fe83e0ede54e540adeb31257fb"></a> &#160;</td><td class="memItemRight" valign="bottom"><b>ASTType</b> (<a class="el" href="class_emojicode_compiler_1_1_type.html">Type</a> type)</td></tr> <tr class="separator:af175a5fe83e0ede54e540adeb31257fb inherit pro_methods_class_emojicode_compiler_1_1_a_s_t_type"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:afbd5d6cfabe611ba62aa0a044b67de6b inherit pro_methods_class_emojicode_compiler_1_1_a_s_t_type"><td class="memItemLeft" align="right" valign="top"><a id="afbd5d6cfabe611ba62aa0a044b67de6b"></a> <a class="el" href="class_emojicode_compiler_1_1_package.html">Package</a> *&#160;</td><td class="memItemRight" valign="bottom"><b>package</b> () const</td></tr> <tr class="separator:afbd5d6cfabe611ba62aa0a044b67de6b inherit pro_methods_class_emojicode_compiler_1_1_a_s_t_type"><td class="memSeparator" colspan="2">&#160;</td></tr> </table> <hr/>The documentation for this class was generated from the following files:<ul> <li>/Users/theo/Documents/emojicode/emojicode/Compiler/AST/<a class="el" href="_a_s_t_type_8hpp_source.html">ASTType.hpp</a></li> <li>/Users/theo/Documents/emojicode/emojicode/Compiler/AST/ASTType.cpp</li> <li>/Users/theo/Documents/emojicode/emojicode/Compiler/Prettyprint/ASTToCode.cpp</li> </ul> </div><!-- contents --> <!-- start footer part --> <hr class="footer"/><address class="footer"><small> Generated by &#160;<a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/> </a> 1.8.14 </small></address> </body> </html>
artistic-2.0
eos-13/YaCMS
main/admin/view/conf.php
6240
<?php class view_conf extends admin_common { public $message = false; private function set_tinymce_vars($section=array()) { $tmp = 'var all_tinymce=" '; //$tmpA = array('tinymce'); $tmp .='";'; $tmp .= 'var content_css_set="'.make_path("css","admin","css",false,true).'";'; global $conf; $tmp .= 'var main_base_path="'.$conf->main_base_path.'"'; $this->set_js_code($tmp); } private function js_for_page($conf_data) { $js = ""; global $conf; $this->set_tinymce_vars(); $js .= <<<EOF jQuery(document).ready(function(){ EOF; foreach($conf_data as $key=>$val) { if ($val['type'] == 'tinymce') { $js.= 'jQuery("#'. $val['key'] .'").editInPlace({ url: "conf", show_buttons: true, value_required: true, field_type: "textarea", params: "action=update", delegate: delegateeip, use_html: true }); '."\n"; } else { $js .= 'jQuery("#'.$val['key'].'").editInPlace({ url: "conf", show_buttons: true, value_required: true, field_type: "'.$val['type'].'", params: "action=update", delegate: delegatebutton, use_html: true });'."\n"; } $js.= 'jQuery("#desc_'. $val['key'] .'").editInPlace({ url: "conf", show_buttons: true, value_required: true, field_type: "textarea", params: "action=update_description", delegate: delegateeip }); '."\n"; } $js.='});'; return $js; } public function display_result($result) { echo $result; } public function run($conf_data) { $this->set_title(_("Configuration")); $title=$this->req; $this->set_css_code('table { border-collapse: collapse;}'); $this->set_css(array('admin',"jquery.growl",$this->req,'jquery-ui.min')); $this->set_js(array('tinymce_var',"jquery.growl",'admin','jquery','jquery-ui.min','jquery-migrate-1.2.1','tinymce/tinymce.min','jquery.editinplace','tinymce/jquery.tinymce.min','validation/jquery.validate.min','validation/additional-methods.min',$this->req,)); $this->set_js_code($this->js_for_page($conf_data)); $this->set_extra_render('conf_data', $conf_data); global $lang,$conf; $tmpLang = substr($lang,0,2); if ($tmpLang != "en") { if (is_file(make_path('js', "validation/localization/messages_".$lang, "js"))) { $this->set_js('validation/localization/messages_'.$lang.'.js'); } elseif (is_file(make_path('js', "validation/localization/messages_".$tmpLang, "js"))) { $this->set_js('validation/localization/messages_'.$tmpLang.'.js'); } else { $tmpLang = substr($conf->default_lang,0,2); if (is_file(make_path('js', "validation/localization/messages_".$conf->default_lang, "js"))) { $this->set_js('validation/localization/messages_'.$conf->default_lang.'.js'); } else { $this->set_js('validation/localization/messages_'.$tmpLang.'.js'); } } } $this->set_js(array ( 'tinymce/themes/modern/theme.min', 'tinymce/plugins/pagebreak/plugin.min', 'tinymce/plugins/layer/plugin.min', 'tinymce/plugins/table/plugin.min', 'tinymce/plugins/save/plugin.min', 'tinymce/plugins/emoticons/plugin.min', 'tinymce/plugins/insertdatetime/plugin.min', 'tinymce/plugins/preview/plugin.min', 'tinymce/plugins/media/plugin.min', 'tinymce/plugins/searchreplace/plugin.min', 'tinymce/plugins/print/plugin.min', 'tinymce/plugins/contextmenu/plugin.min', 'tinymce/plugins/paste/plugin.min', 'tinymce/plugins/directionality/plugin.min', 'tinymce/plugins/fullscreen/plugin.min', 'tinymce/plugins/hr/plugin.min', 'tinymce/plugins/wordcount/plugin.min', 'tinymce/plugins/noneditable/plugin.min', 'tinymce/plugins/visualchars/plugin.min', 'tinymce/plugins/nonbreaking/plugin.min', 'tinymce/plugins/template/plugin.min', 'tinymce/plugins/image/plugin.min', 'tinymce/plugins/code/plugin.min')); global $lang,$conf; $tmpLang = substr($lang,0,2); if (is_file(make_path('js', "tinymce/langs/".$lang, "js"))) { $this->set_js('tinymce/langs/'.$lang.'.js'); } elseif (is_file(make_path('js', "tinymce/langs/".$tmpLang, "js"))) { $this->set_js('tinymce/langs/'.$tmpLang.'.js'); } else { $tmpLang = substr($conf->default_lang,0,2); if (is_file(make_path('js', "tinymce/langs/".$conf->default_lang, "js"))) { $this->set_js('tinymce/langs/'.$conf->default_lang.'.js'); } else { $this->set_js('tinymce/langs/'.$tmpLang.'.js'); } } if ($this->message) { $this->set_js_code(' jQuery(document).ready(function(){ jQuery.growl({ title: "'._("Résultat").'", message: "'.$this->message.'", location: "tr", duration: 3200 }); }); '); } echo $this->gen_page(); } }
artistic-2.0