code
stringlengths 3
1.01M
| repo_name
stringlengths 5
116
| path
stringlengths 3
311
| language
stringclasses 30
values | license
stringclasses 15
values | size
int64 3
1.01M
|
|---|---|---|---|---|---|
# Ficus neumanni Cels ex Kunth & Bouche SPECIES
#### Status
ACCEPTED
#### According to
International Plant Names Index
#### Published in
null
#### Original name
null
### Remarks
null
|
mdoering/backbone
|
life/Plantae/Magnoliophyta/Magnoliopsida/Rosales/Moraceae/Ficus/Ficus neumanni/README.md
|
Markdown
|
apache-2.0
| 187
|
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<link rel="shortcut icon" href="bootstrap/assets/ico/favicon.png">
<title>Sticky Footer Navbar Template for Bootstrap</title>
<!-- Bootstrap core CSS -->
<link href="bootstrap/dist/css/bootstrap.css" rel="stylesheet">
<!-- Custom styles for this template -->
<link href="sticky-footer-navbar.css" rel="stylesheet">
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="../../assets/js/html5shiv.js"></script>
<script src="../../assets/js/respond.min.js"></script>
<![endif]-->
</head>
<body>
<!-- Wrap all page content here -->
<div id="wrap">
<!-- Fixed navbar -->
<div class="navbar navbar-fixed-top">
<div class="container">
<!-- navbar --->
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">GSage</a>
</div>
<div class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li class="active"><a href="#">Home</a></li>
<li><a href="#about">About</a></li>
<li><a href="#contact">Contact</a></li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Configure <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="#">Action</a></li>
<li><a href="#">Another action</a></li>
<li><a href="#">Something else here</a></li>
<li class="divider"></li>
<li class="dropdown-header">Nav header</li>
<li><a href="#">Separated link</a></li>
<li><a href="#">One more separated link</a></li>
</ul>
</li>
</ul>
</div><!--/.nav-collapse -->
</div>
</div>
<!-- Begin page content -->
<div class="container">
<div class="page-header">
<h1>Overview</h1>
</div>
<p class="lead">This will contain an overview of the network, compute and storage resources associated with a project.</p>
</div>
</div>
<div id="footer">
<div class="container">
<p class="text-muted credit">Developed by b<a href="http://www.washington.edu">The University of Washington</a>.</p>
</div>
</div>
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="bootstrap/assets/js/jquery.js"></script>
<script src="bootstrap/dist/js/bootstrap.min.js"></script>
</body>
</html>
|
chrissmall22/GSage
|
mockups/bs_demo.html
|
HTML
|
apache-2.0
| 3,181
|
//
// ZKShop.h
// ZKWaterflow(瀑布流)
//
// Created by 闫振奎 on 16/6/22.
// Copyright © 2016年 TowMen. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
@interface ZKShop : NSObject
@property (nonatomic, assign) CGFloat w;
@property (nonatomic, assign) CGFloat h;
@property (nonatomic, copy) NSString *img;
@property (nonatomic, copy) NSString *price;
@end
|
yanzhenkui/MySampleCode
|
ZKWaterflow/ZKWaterflow(瀑布流)/ZKWaterflow(瀑布流)/ZKShop.h
|
C
|
apache-2.0
| 404
|
/*
* Copyright (C) 2017-2019 Dremio Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.dremio.sabot.exec.context;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import com.dremio.exec.context.AdditionalContext;
import com.dremio.exec.proto.CoordExecRPC.QueryContextInformation;
import com.dremio.exec.proto.UserBitShared.QueryId;
import com.dremio.exec.proto.UserBitShared.UserCredentials;
/**
* Default implementation of ContextInformation.
*/
public class ContextInformationImpl implements ContextInformation {
private final String queryUser;
private final String currentDefaultSchema;
private final long queryStartTime;
private final int rootFragmentTimeZone;
private final QueryId lastQueryId;
private boolean isLastQueryIdPresent = false;
private boolean isPlanCacheable = true;
private final Map<Class<? extends AdditionalContext>, AdditionalContext> additionalInfo = new ConcurrentHashMap<>(1);
public ContextInformationImpl(final UserCredentials userCredentials, final QueryContextInformation queryContextInfo) {
this.queryUser = userCredentials.getUserName();
this.currentDefaultSchema = queryContextInfo.getDefaultSchemaName();
this.queryStartTime = queryContextInfo.getQueryStartTime();
this.rootFragmentTimeZone = queryContextInfo.getTimeZone();
this.lastQueryId = (queryContextInfo.hasLastQueryId() ? queryContextInfo.getLastQueryId() : null);
}
@Override
public String getQueryUser() {
return queryUser;
}
@Override
public String getCurrentDefaultSchema() {
return currentDefaultSchema;
}
@Override
public long getQueryStartTime() {
return queryStartTime;
}
@Override
public int getRootFragmentTimeZone() {
return rootFragmentTimeZone;
}
@Override
public QueryId getLastQueryId() {
return lastQueryId;
}
@Override
public void registerAdditionalInfo(AdditionalContext object) {
// this event is rare and mostly once in the ContextInformation lifetime
// should be once per AdditionalContext type
AdditionalContext prevValue = additionalInfo.putIfAbsent(object.getClass(), object);
if (prevValue != null) {
throw new RuntimeException("Trying to set AdditionalContext of type: " + object.getClass() + " multiple times");
}
}
@Override
public boolean isPlanCacheable() {
return isPlanCacheable;
}
@Override
public void setPlanCacheable(boolean isPlanCacheable) {
this.isPlanCacheable = isPlanCacheable;
}
@Override
public <T extends AdditionalContext> T getAdditionalInfo(Class<T> claz) {
return (T) additionalInfo.get(claz);
}
}
|
dremio/dremio-oss
|
sabot/kernel/src/main/java/com/dremio/sabot/exec/context/ContextInformationImpl.java
|
Java
|
apache-2.0
| 3,165
|
<!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_72) on Wed May 13 11:47:54 EDT 2015 -->
<title>Uses of Class org.apache.cassandra.cql3.statements.SelectStatement (apache-cassandra API)</title>
<meta name="date" content="2015-05-13">
<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Uses of Class org.apache.cassandra.cql3.statements.SelectStatement (apache-cassandra API)";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!-- -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../overview-summary.html">Overview</a></li>
<li><a href="../package-summary.html">Package</a></li>
<li><a href="../../../../../../org/apache/cassandra/cql3/statements/SelectStatement.html" title="class in org.apache.cassandra.cql3.statements">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?org/apache/cassandra/cql3/statements/class-use/SelectStatement.html" target="_top">Frames</a></li>
<li><a href="SelectStatement.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip-navbar_top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<div class="header">
<h2 title="Uses of Class org.apache.cassandra.cql3.statements.SelectStatement" class="title">Uses of Class<br>org.apache.cassandra.cql3.statements.SelectStatement</h2>
</div>
<div class="classUseContainer">No usage of org.apache.cassandra.cql3.statements.SelectStatement</div>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!-- -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../overview-summary.html">Overview</a></li>
<li><a href="../package-summary.html">Package</a></li>
<li><a href="../../../../../../org/apache/cassandra/cql3/statements/SelectStatement.html" title="class in org.apache.cassandra.cql3.statements">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?org/apache/cassandra/cql3/statements/class-use/SelectStatement.html" target="_top">Frames</a></li>
<li><a href="SelectStatement.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 © 2015 The Apache Software Foundation</small></p>
</body>
</html>
|
anuragkapur/cassandra-2.1.2-ak-skynet
|
apache-cassandra-2.0.15/javadoc/org/apache/cassandra/cql3/statements/class-use/SelectStatement.html
|
HTML
|
apache-2.0
| 4,513
|
package gov.cdc.epiinfo.interpreter;
import goldengine.java.Reduction;
import goldengine.java.Token;
import gov.cdc.epiinfo.FormLayoutManager;
import android.view.View;
public class Cmd_Hide implements ICommand {
private Token identifierList;
private FormLayoutManager controlHelper;
public Cmd_Hide(Reduction reduction, FormLayoutManager controlHelper)
{
this.controlHelper = controlHelper;
identifierList = reduction.getToken(1);
}
public void Execute()
{
Reduction idReduction = (Reduction)identifierList.getData();
Token identifier = idReduction.getToken(0);
System.out.println(".........Hiding " + identifier.getData() + " field");
View control = controlHelper.controlsByName.get(identifier.getData());
control.setVisibility(View.INVISIBLE);
View prompt = controlHelper.controlsByName.get(identifier.getData() + "|prompt");
if (prompt != null)
{
prompt.setVisibility(View.INVISIBLE);
}
}
}
|
Epi-Info/Epi-Info-Android
|
src/main/java/gov/cdc/epiinfo/interpreter/Cmd_Hide.java
|
Java
|
apache-2.0
| 941
|
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Serenity Reports</title>
<link rel="shortcut icon" href="favicon.ico">
<link rel="stylesheet" href="font-awesome/css/font-awesome.min.css">
<!--[if IE 7]>
<link rel="stylesheet" href="font-awesome/css/font-awesome-ie7.min.css">
<![endif]--><!-- JQuery -->
<script type="text/javascript" src="scripts/jquery-1.11.1.min.js"></script><!-- Bootstrap -->
<link href="bootstrap/css/bootstrap.min.css" rel="stylesheet">
<script src="bootstrap/js/bootstrap.min.js"></script><link rel="stylesheet" href="css/core.css"/>
<link rel="stylesheet" href="css/link.css"/>
<link type="text/css" media="screen" href="css/screen.css" rel="Stylesheet"/><!-- JQuery-UI -->
<link type="text/css" href="jqueryui/1.11.2-start/jquery-ui.min.css" rel="Stylesheet" />
<script type="text/javascript" src="jqueryui/1.11.2-start/jquery-ui.min.js"></script><!-- DataTables -->
<link type="text/css" href="datatables/1.10.4/media/jqueryui/dataTables.jqueryui.css" rel="Stylesheet"/>
<link type="text/css" href="css/tables.css" rel="stylesheet" />
<script type="text/javascript" src="datatables/1.10.4/media/js/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="datatables/1.10.4/media/jqueryui/dataTables.jqueryui.min.js"></script><!-- jQplot -->
<!--[if IE]>
<script language="javascript" type="text/javascript" src="excanvas/3/excanvas.compiled.js"></script>
<![endif]--><link rel="stylesheet" type="text/css" href="jqplot/1.0.8/jquery.jqplot.min.css"/>
<script type="text/javascript" src="jqplot/1.0.8/jquery.jqplot.min.js"></script>
<script type="text/javascript" src="jqplot/1.0.8/plugins/jqplot.pieRenderer.min.js"></script>
<script class="code" type="text/javascript">$(document).ready(function () {
var test_results_plot = $.jqplot('test_results_pie_chart', [
[
['Passing', 1],
['Pending', 0],
['Ignored', 0],
['Failing', 0],
['Errors', 0],
['Compromised', 0]
]
], {
gridPadding: {top: 0, bottom: 38, left: 0, right: 0},
seriesColors: ['#30cb23',
'#a2f2f2',
'#eeeadd',
'#f8001f',
'#fc6e1f',
'fuchsia'],
seriesDefaults: {
renderer: $.jqplot.PieRenderer,
trendline: { show: false },
rendererOptions: { padding: 8, showDataLabels: true }
},
legend: {
show: true,
placement: 'outside',
rendererOptions: {
numberRows: 2
},
location: 's',
marginTop: '15px'
},
series: [
{label: '2 / 2 tests passed' },
{label: '0 / 2 tests pending'},
{label: '0 / 2 tests not executed'},
{label: '0 / 2 tests failed'},
{label: '0 / 2 errors'},
{label: '0 / 2 compromised tests'}
]
});
var weighted_test_results_plot = $.jqplot('weighted_test_results_pie_chart', [
[
['Passing', 1],
['Pending', 0],
['Ignored', 0],
['Failing', 0],
['Errors', 0],
['Compromised', 0],
]
], {
gridPadding: {top: 0, bottom: 38, left: 0, right: 0},
seriesColors: ['#30cb23',
'#a2f2f2',
'#eeeadd',
'#f8001f',
'#fc6e1f',
'mediumvioletred'],
seriesDefaults: {
renderer: $.jqplot.PieRenderer,
trendline: { show: false },
rendererOptions: { padding: 8, showDataLabels: true }
},
legend: {
show: true,
placement: 'outside',
rendererOptions: {
numberRows: 2
},
location: 's',
marginTop: '15px'
},
series: [
{label: '2 / 2 tests passed (1% of all test steps)' },
{label: '0 / 2 tests pending'},
{label: '0 / 2 tests not executed'},
{label: '0 / 2 tests failed (0% of all test steps)'},
{label: '0 / 2 errors (0% of all test steps)'}
]
});
// Results table
$('#test-results-table').DataTable({
"order": [
[ 1, "asc" ]
],
"pageLength": 100,
"lengthMenu": [ [50, 100, 200, -1] , [50, 100, 200, "All"] ]
});
// Pie charts
$('#test-results-tabs').tabs();
$('#toggleNormalPieChart').click(function () {
$("#test_results_pie_chart").toggle();
});
$('#toggleWeightedPieChart').click(function () {
$("#weighted_test_results_pie_chart").toggle();
});
})
;
</script>
</head>
<body class="results-page">
<div id="topheader">
<div id="topbanner">
<div id="logo"><a href="index.html"><img src="images/serenity-bdd-logo.png" border="0"/></a></div>
<div id="projectname-banner" style="float:right">
<span class="projectname"></span>
</div>
</div>
</div>
<div class="middlecontent">
<div id="contenttop">
<div class="middlebg">
<span class="breadcrumbs"><a href="index.html">Home</a>
> Passing Tests
</span>
</div>
<div class="rightbg"></div>
</div>
<div class="clr"></div>
<!--/* starts second table*/-->
<div>
<ul class="nav nav-tabs" role="tablist">
<li class="active">
<a href="#"><i class="fa fa-check-square-o"></i> Overall Test Results</a>
</li>
<li >
<a href="capabilities.html"><i class="fa fa-book"></i> Requirements</a>
</li>
<li >
<a href="e3a5a59a6d792683cf33d050ee0f6f92.html"><i class="fa fa-comments-o"></i> Capabilities</a>
</li>
<li >
<a href="d782c44557441225cc92a5e35bf4b23b.html"><i class="fa fa-comments-o"></i> Features</a>
</li>
<li >
<a href="5f5dee50b3955739bfb580c79f480d2e.html"><i class="fa fa-comments-o"></i> Stories</a>
</li>
</ul>
<span class="date-and-time"><a href="build-info.html"><i class="fa fa-info-circle"></i></a> Report generated 12-07-2018 19:09</span>
<br style="clear:left"/>
</div>
<div class="clr"></div>
<div id="beforetable"></div>
<div id="results-dashboard">
<div class="middlb">
<div class="table">
<h2>Passing Tests</h2>
<table class='overview'>
<tr>
<td width="375px" valign="top">
<div class="test-count-summary">
<span class="test-count-title">2
test scenarios </span>
<div>
<span class="test-count"> |
2
passed
</span>
|
<a href="ce81faa7993810e83b16bc3457e28b78.csv" title="Download CSV"> <i class="fa fa-download" title="Download CSV"></i></a>
</div>
</div>
<div id="test-results-tabs">
<ul>
<li><a href="#test-results-tabs-1">Test Count</a></li>
<li><a href="#test-results-tabs-2">Weighted Tests</a></li>
</ul>
<div id="test-results-tabs-1">
<table>
<tr>
<td colspan="2">
<span class="caption">Distribution of tests (including rows in data-driven tests) by test result.</span>
<span class="togglePieChart" id="toggleNormalPieChart"><a href="#">Show/Hide Pie Chart</a></span>
</td>
</tr>
<tr>
<td style="vertical-align: text-top;">
<div id="test_results_pie_chart"></div>
</td>
<td class="related-tags-section">
<div>
<div>
<h4>Test Result Summary</h4>
<table class="summary-table">
<head>
<tr>
<th>Test Type</th>
<th>Total</th>
<th>Pass <i class="icon-check"/> </th>
<th>Fail <i class="icon-thumbs-down"/></th>
<th>Pending <i class="icon-calendar"/></th>
<th>Ignored <i class="icon-ban-circle"/></th>
</tr>
</head>
<body>
<tr>
<td class="summary-leading-column">Automated</td>
<td>2</td>
<td>2 (100%)</td>
<td>0 (0%)</td>
<td>0 (0%)</td>
<td>0 (0%)</td>
</tr>
<tr>
<td class="summary-leading-column">Manual</td>
<td>0</td>
<td>0 (0%)</td>
<td>0 (0%)</td>
<td>0 (0%)</td>
<td>0 (0%)</td>
</tr>
<tr>
<td class="summary-leading-column">Total</td>
<td>2</td>
<td>2 (100%)</td>
<td>0 (0%)</td>
<td>0 (0%)</td>
<td>0 (0%)</td>
</tr>
<tr>
<td class="summary-leading-column">Total Duration</td>
<td colspan="5">19 seconds</td>
</tr>
</body>
</table>
</div> </div>
<div>
<table class="tags-summary-table">
<tr>
<td width="300px"><h3>Related Tags</h3></td>
<td width="90px" class="tag-count-header">% Passed</td>
<td width="130px" class="test-count"> </td>
<td class="tag-count-header">Test count</td>
</tr>
</table>
<table class="test-summary-table">
<tr>
<td colspan="3">
<div class="tagTypeTitle">Capabilities
</div>
</td>
</tr>
<tr>
<td class="bluetext" class="tag-title">
<span class="SUCCESS-text ellipsis">
<a href="e00849d12b3dcca7e678293eff805927.html" title="Manage Shipments">Manage Shipments</a>
</span>
</td>
<td width="220px" class="table-figure">
<table>
<tr>
<td class="related-tag-percentage"><span title="2 out of 2 tests (12 steps) passing">100%</span></td>
<td width="150px">
<a href="e00849d12b3dcca7e678293eff805927.html">
<div class="pendingbar"
title="0 out of 2 tests (0 steps) pending"
style="width: 150px;">
<div class="ignoredbar"
style="width: 150px;"
title="0 out of 2 tests (0 steps) skipped or ignored">
<div class="compromisedbar"
style="width: 150px;"
title="0 out of 2 tests (0 steps) compromised">
<div class="errorbar"
style="width: 150px;"
title="0 out of 2 tests (0 steps) broken">
<div class="failingbar"
style="width: 150px;"
title="0 out of 2 tests (0 steps) failing">
<div class="passingbar"
style="width: 150px;"
title="2 out of 2 tests (12 steps) passing">
</div>
</div>
</div>
</div>
</div>
</div>
</a>
</td>
<td class="related-tag-count"><span class="result-test-count" title="2 tests">2</span></td>
</tr>
</table>
</td>
</tr>
</table>
<table class="test-summary-table">
<tr>
<td colspan="3">
<div class="tagTypeTitle">Features
</div>
</td>
</tr>
<tr>
<td class="bluetext" class="tag-title">
<span class="SUCCESS-text ellipsis">
<a href="6ab500073c0dd3a6024314cdfa98a07e.html" title="Show List Of Shipments">Show List Of Shipments</a>
</span>
</td>
<td width="220px" class="table-figure">
<table>
<tr>
<td class="related-tag-percentage"><span title="2 out of 2 tests (12 steps) passing">100%</span></td>
<td width="150px">
<a href="6ab500073c0dd3a6024314cdfa98a07e.html">
<div class="pendingbar"
title="0 out of 2 tests (0 steps) pending"
style="width: 150px;">
<div class="ignoredbar"
style="width: 150px;"
title="0 out of 2 tests (0 steps) skipped or ignored">
<div class="compromisedbar"
style="width: 150px;"
title="0 out of 2 tests (0 steps) compromised">
<div class="errorbar"
style="width: 150px;"
title="0 out of 2 tests (0 steps) broken">
<div class="failingbar"
style="width: 150px;"
title="0 out of 2 tests (0 steps) failing">
<div class="passingbar"
style="width: 150px;"
title="2 out of 2 tests (12 steps) passing">
</div>
</div>
</div>
</div>
</div>
</div>
</a>
</td>
<td class="related-tag-count"><span class="result-test-count" title="2 tests">2</span></td>
</tr>
</table>
</td>
</tr>
</table>
<table class="test-summary-table">
<tr>
<td colspan="3">
<div class="tagTypeTitle">Stories
</div>
</td>
</tr>
<tr>
<td class="bluetext" class="tag-title">
<span class="SUCCESS-text ellipsis">
<a href="ed5341d7f910e881df469cf300699931.html" title="Show Current Shipments">Show Current Shipments</a>
</span>
</td>
<td width="220px" class="table-figure">
<table>
<tr>
<td class="related-tag-percentage"><span title="2 out of 2 tests (12 steps) passing">100%</span></td>
<td width="150px">
<a href="ed5341d7f910e881df469cf300699931.html">
<div class="pendingbar"
title="0 out of 2 tests (0 steps) pending"
style="width: 150px;">
<div class="ignoredbar"
style="width: 150px;"
title="0 out of 2 tests (0 steps) skipped or ignored">
<div class="compromisedbar"
style="width: 150px;"
title="0 out of 2 tests (0 steps) compromised">
<div class="errorbar"
style="width: 150px;"
title="0 out of 2 tests (0 steps) broken">
<div class="failingbar"
style="width: 150px;"
title="0 out of 2 tests (0 steps) failing">
<div class="passingbar"
style="width: 150px;"
title="2 out of 2 tests (12 steps) passing">
</div>
</div>
</div>
</div>
</div>
</div>
</a>
</td>
<td class="related-tag-count"><span class="result-test-count" title="2 tests">2</span></td>
</tr>
</table>
</td>
</tr>
</table>
</div>
</td>
</tr>
</table>
</div>
<div id="test-results-tabs-2">
<table>
<tr>
<td colspan="2">
<span class="caption">Test results weighted by test size in steps (average steps per test: 6) .</span>
<span class="togglePieChart" id="toggleWeightedPieChart"><a href="#">Show/Hide Pie
Chart</a></span>
</td>
</tr>
<tr>
<td style="vertical-align: text-top;">
<div id="weighted_test_results_pie_chart"></div>
</td>
<td class="related-tags-section">
<div>
<div>
<h4>Test Result Summary</h4>
<table class="summary-table">
<head>
<tr>
<th>Test Type</th>
<th>Total</th>
<th>Pass <i class="icon-check"/> </th>
<th>Fail <i class="icon-thumbs-down"/></th>
<th>Pending <i class="icon-calendar"/></th>
<th>Ignored <i class="icon-ban-circle"/></th>
</tr>
</head>
<body>
<tr>
<td class="summary-leading-column">Automated</td>
<td>2</td>
<td>2 (100%)</td>
<td>0 (0%)</td>
<td>0 (0%)</td>
<td>0 (0%)</td>
</tr>
<tr>
<td class="summary-leading-column">Manual</td>
<td>0</td>
<td>0 (0%)</td>
<td>0 (0%)</td>
<td>0 (0%)</td>
<td>0 (0%)</td>
</tr>
<tr>
<td class="summary-leading-column">Total</td>
<td>2</td>
<td>2 (100%)</td>
<td>0 (0%)</td>
<td>0 (0%)</td>
<td>0 (0%)</td>
</tr>
<tr>
<td class="summary-leading-column">Total Duration</td>
<td colspan="5">19 seconds</td>
</tr>
</body>
</table>
</div> </div>
<div>
<table class="tags-summary-table">
<tr>
<td width="300px"><h3>Related Tags</h3></td>
<td width="90px" class="tag-count-header">% Passed</td>
<td width="130px" class="test-count"> </td>
<td class="tag-count-header">Test count</td>
</tr>
</table>
<table class="test-summary-table">
<tr>
<td colspan="3">
<div class="tagTypeTitle">Capabilities
</div>
</td>
</tr>
<tr>
<td class="bluetext" class="tag-title">
<span class="SUCCESS-text ellipsis">
<a href="e00849d12b3dcca7e678293eff805927.html" title="Manage Shipments">Manage Shipments</a>
</span>
</td>
<td width="220px" class="table-figure">
<table>
<tr>
<td class="related-tag-percentage"><span title="2 out of 2 tests (12 steps) passing">100%</span></td>
<td width="150px">
<a href="e00849d12b3dcca7e678293eff805927.html">
<div class="pendingbar"
title="0 out of 2 tests (0 steps) pending"
style="width: 150px;">
<div class="ignoredbar"
style="width: 150px;"
title="0 out of 2 tests (0 steps) skipped or ignored">
<div class="compromisedbar"
style="width: 150px;"
title="0 out of 2 tests (0 steps) compromised">
<div class="errorbar"
style="width: 150px;"
title="0 out of 2 tests (0 steps) broken">
<div class="failingbar"
style="width: 150px;"
title="0 out of 2 tests (0 steps) failing">
<div class="passingbar"
style="width: 150px;"
title="2 out of 2 tests (12 steps) passing">
</div>
</div>
</div>
</div>
</div>
</div>
</a>
</td>
<td class="related-tag-count"><span class="result-test-count" title="2 tests">2</span></td>
</tr>
</table>
</td>
</tr>
</table>
<table class="test-summary-table">
<tr>
<td colspan="3">
<div class="tagTypeTitle">Features
</div>
</td>
</tr>
<tr>
<td class="bluetext" class="tag-title">
<span class="SUCCESS-text ellipsis">
<a href="6ab500073c0dd3a6024314cdfa98a07e.html" title="Show List Of Shipments">Show List Of Shipments</a>
</span>
</td>
<td width="220px" class="table-figure">
<table>
<tr>
<td class="related-tag-percentage"><span title="2 out of 2 tests (12 steps) passing">100%</span></td>
<td width="150px">
<a href="6ab500073c0dd3a6024314cdfa98a07e.html">
<div class="pendingbar"
title="0 out of 2 tests (0 steps) pending"
style="width: 150px;">
<div class="ignoredbar"
style="width: 150px;"
title="0 out of 2 tests (0 steps) skipped or ignored">
<div class="compromisedbar"
style="width: 150px;"
title="0 out of 2 tests (0 steps) compromised">
<div class="errorbar"
style="width: 150px;"
title="0 out of 2 tests (0 steps) broken">
<div class="failingbar"
style="width: 150px;"
title="0 out of 2 tests (0 steps) failing">
<div class="passingbar"
style="width: 150px;"
title="2 out of 2 tests (12 steps) passing">
</div>
</div>
</div>
</div>
</div>
</div>
</a>
</td>
<td class="related-tag-count"><span class="result-test-count" title="2 tests">2</span></td>
</tr>
</table>
</td>
</tr>
</table>
<table class="test-summary-table">
<tr>
<td colspan="3">
<div class="tagTypeTitle">Stories
</div>
</td>
</tr>
<tr>
<td class="bluetext" class="tag-title">
<span class="SUCCESS-text ellipsis">
<a href="ed5341d7f910e881df469cf300699931.html" title="Show Current Shipments">Show Current Shipments</a>
</span>
</td>
<td width="220px" class="table-figure">
<table>
<tr>
<td class="related-tag-percentage"><span title="2 out of 2 tests (12 steps) passing">100%</span></td>
<td width="150px">
<a href="ed5341d7f910e881df469cf300699931.html">
<div class="pendingbar"
title="0 out of 2 tests (0 steps) pending"
style="width: 150px;">
<div class="ignoredbar"
style="width: 150px;"
title="0 out of 2 tests (0 steps) skipped or ignored">
<div class="compromisedbar"
style="width: 150px;"
title="0 out of 2 tests (0 steps) compromised">
<div class="errorbar"
style="width: 150px;"
title="0 out of 2 tests (0 steps) broken">
<div class="failingbar"
style="width: 150px;"
title="0 out of 2 tests (0 steps) failing">
<div class="passingbar"
style="width: 150px;"
title="2 out of 2 tests (12 steps) passing">
</div>
</div>
</div>
</div>
</div>
</div>
</a>
</td>
<td class="related-tag-count"><span class="result-test-count" title="2 tests">2</span></td>
</tr>
</table>
</td>
</tr>
</table>
</div>
</td>
</tr>
</table>
</div>
</div>
</td>
</tr>
</table>
<table>
<tr>
<td>
<div><h3>Tests</h3></div>
<div id="test_list_tests" class="table">
<div class="test-results">
<table id="test-results-table">
<thead>
<tr>
<th width="50" class="test-results-heading"> </th>
<th width="%" class="test-results-heading">Tests</th>
<th width="70" class="test-results-heading">Steps</th>
<th width="100" class="test-results-heading">Duration<br>(seconds)</th>
</tr>
</thead>
<tbody>
<tr class="test-SUCCESS">
<td><span class="summary-icon"><i class='fa fa-check-square-o success-icon ' title='SUCCESS'></i></span>
<span style="display:none">SUCCESS</span></td>
<td class="SUCCESS-text">
<div class="ellipsis">
<a href="2138514dcc65741a4a3776bb7a15278b.html" class="ellipsis" title="">
List Open Shipments With 1 Shipment
<span class="related-issue-title"></span>
</a>
</div>
</td>
<td class="lightgreentext">7</td>
<td class="lightgreentext">10.76</td>
</tr>
<tr class="test-SUCCESS">
<td><span class="summary-icon"><i class='fa fa-check-square-o success-icon ' title='SUCCESS'></i></span>
<span style="display:none">SUCCESS</span></td>
<td class="SUCCESS-text">
<div class="ellipsis">
<a href="7df2af59c516ecb71869fc11844aff09.html" class="ellipsis" title="">
List Open Shipments Without Shipments
<span class="related-issue-title"></span>
</a>
</div>
</td>
<td class="lightgreentext">5</td>
<td class="lightgreentext">7.86</td>
</tr>
</tbody>
</table>
</div>
</div>
</td>
</tr>
</table>
</div>
</div>
</div>
</div>
</div>
<div id="beforefooter"></div>
<div id="bottomfooter">
<span class="version">Serenity version 1.2.2</span>
</div>
</body>
</html>
|
EduCaMa/EduCaMa.github.io
|
site/serenity/ce81faa7993810e83b16bc3457e28b78.html
|
HTML
|
apache-2.0
| 35,248
|
package com.github.gserv.serv.wx.controller;
import java.io.PrintWriter;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.github.gserv.serv.wx.service.accept.NoticeAcceptContext;
import com.github.gserv.serv.wx.service.accept.NoticeAcceptService;
import org.apache.commons.io.IOUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.Controller;
import com.github.gserv.serv.commons.JsonUtils;
import com.github.gserv.serv.wx.support.MessageHandlerException;
/**
* 微信入口控制器
*
* @author shiying @ caituo
*
*/
public class WxNoticeController implements Controller {
private static final Logger logger = LoggerFactory.getLogger(WxNoticeController.class);
private NoticeAcceptService noticeAcceptService;
@Override
public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) throws Exception {
try {
// 创建上下文
NoticeAcceptContext noticeAcceptContext = new NoticeAcceptContext();
// 获取参数
noticeAcceptContext.setAccessid(request.getParameter("accessid"));
noticeAcceptContext.setSign(request.getParameter("sign"));
noticeAcceptContext.setSignature(request.getParameter("signature"));
noticeAcceptContext.setTimestamp(request.getParameter("timestamp"));
noticeAcceptContext.setNonce(request.getParameter("nonce"));
noticeAcceptContext.setEchostr(request.getParameter("echostr"));
noticeAcceptContext.setServerBasePath(request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + request.getContextPath() + "/");
noticeAcceptContext.setReqbody(IOUtils.toString(request.getInputStream(), "UTF-8"));
//
logger.debug("weixin notict accept, context[{}]", JsonUtils.toJson(noticeAcceptContext));
String resbody = noticeAcceptService.accept(noticeAcceptContext);
if (resbody == null) {
return null;
}
//
response.setHeader("Content-type", "text/xml;charset=UTF-8");
PrintWriter out = response.getWriter();
out.write(resbody);
out.flush();
out.close();
return null;
} catch (MessageHandlerException e) {
logger.warn("weixin message handle exception.", e);
return null;
}
}
public NoticeAcceptService getNoticeAcceptService() {
return noticeAcceptService;
}
public void setNoticeAcceptService(NoticeAcceptService noticeAcceptService) {
this.noticeAcceptService = noticeAcceptService;
}
}
|
gserv/serv
|
serv-wx/src/main/java/com/github/gserv/serv/wx/controller/WxNoticeController.java
|
Java
|
apache-2.0
| 2,537
|
package com.reubenk.gmessengertest;
import android.app.Activity;
import android.os.AsyncTask;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;
import org.json.JSONException;
import org.json.JSONObject;
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.menu_main, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
//noinspection SimplifiableIfStatement
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
}
public void readMessage(View v)
{
DownloadTask dt = new DownloadTask();
dt.execute();
}
public class DownloadTask extends AsyncTask<Void, Void, Void> {
String text;
@Override
protected void onPreExecute() {
super.onPreExecute();
Toast.makeText(getApplicationContext(), "Updating...", Toast.LENGTH_SHORT).show();
}
@Override
protected Void doInBackground(Void... params) {
try {
ServiceHandler sh = new ServiceHandler();
// Making a request to url and getting response
String jsonStr = sh.makeServiceCall("http://gconnect.azurewebsites.net/api/test1/GetMessage/1,1", ServiceHandler.GET);
String jsonStr2 = "{\"message\": " + jsonStr + "} ";
JSONObject jsonObj = new JSONObject(jsonStr2);
text = jsonObj.getString("message");
// looping through All Contacts
} catch (JSONException e) {
e.printStackTrace();
}
return null;
}
@Override
protected void onPostExecute(Void result) {
super.onPostExecute(result);
Toast.makeText(getApplicationContext(), "message " + text, Toast.LENGTH_SHORT).show();
TextView tv = (TextView)findViewById(R.id.textViewMessage);
tv.setText(text);
}
}
}
|
S-Kantor/GMessengerApp
|
SourceTree_GApp/app/src/main/java/com/reubenk/gmessengertest/MainActivity.java
|
Java
|
apache-2.0
| 2,734
|
# some experimental code for data structure and algrithm
|
speedmax123/data_structure
|
README.md
|
Markdown
|
apache-2.0
| 57
|
/*
* Copyright 2017-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package com.amazonaws.services.pinpoint.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.AmazonWebServiceRequest;
/**
*
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetApps" target="_top">AWS API
* Documentation</a>
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class GetAppsRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable {
/**
* <p>
* The maximum number of items to include in each page of a paginated response. This parameter is not supported for
* application, campaign, and journey metrics.
* </p>
*/
private String pageSize;
/**
* <p>
* The NextToken string that specifies which page of results to return in a paginated response.
* </p>
*/
private String token;
/**
* <p>
* The maximum number of items to include in each page of a paginated response. This parameter is not supported for
* application, campaign, and journey metrics.
* </p>
*
* @param pageSize
* The maximum number of items to include in each page of a paginated response. This parameter is not
* supported for application, campaign, and journey metrics.
*/
public void setPageSize(String pageSize) {
this.pageSize = pageSize;
}
/**
* <p>
* The maximum number of items to include in each page of a paginated response. This parameter is not supported for
* application, campaign, and journey metrics.
* </p>
*
* @return The maximum number of items to include in each page of a paginated response. This parameter is not
* supported for application, campaign, and journey metrics.
*/
public String getPageSize() {
return this.pageSize;
}
/**
* <p>
* The maximum number of items to include in each page of a paginated response. This parameter is not supported for
* application, campaign, and journey metrics.
* </p>
*
* @param pageSize
* The maximum number of items to include in each page of a paginated response. This parameter is not
* supported for application, campaign, and journey metrics.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public GetAppsRequest withPageSize(String pageSize) {
setPageSize(pageSize);
return this;
}
/**
* <p>
* The NextToken string that specifies which page of results to return in a paginated response.
* </p>
*
* @param token
* The NextToken string that specifies which page of results to return in a paginated response.
*/
public void setToken(String token) {
this.token = token;
}
/**
* <p>
* The NextToken string that specifies which page of results to return in a paginated response.
* </p>
*
* @return The NextToken string that specifies which page of results to return in a paginated response.
*/
public String getToken() {
return this.token;
}
/**
* <p>
* The NextToken string that specifies which page of results to return in a paginated response.
* </p>
*
* @param token
* The NextToken string that specifies which page of results to return in a paginated response.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public GetAppsRequest withToken(String token) {
setToken(token);
return this;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getPageSize() != null)
sb.append("PageSize: ").append(getPageSize()).append(",");
if (getToken() != null)
sb.append("Token: ").append(getToken());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof GetAppsRequest == false)
return false;
GetAppsRequest other = (GetAppsRequest) obj;
if (other.getPageSize() == null ^ this.getPageSize() == null)
return false;
if (other.getPageSize() != null && other.getPageSize().equals(this.getPageSize()) == false)
return false;
if (other.getToken() == null ^ this.getToken() == null)
return false;
if (other.getToken() != null && other.getToken().equals(this.getToken()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getPageSize() == null) ? 0 : getPageSize().hashCode());
hashCode = prime * hashCode + ((getToken() == null) ? 0 : getToken().hashCode());
return hashCode;
}
@Override
public GetAppsRequest clone() {
return (GetAppsRequest) super.clone();
}
}
|
aws/aws-sdk-java
|
aws-java-sdk-pinpoint/src/main/java/com/amazonaws/services/pinpoint/model/GetAppsRequest.java
|
Java
|
apache-2.0
| 6,080
|
/*
* Copyright 2017-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package com.amazonaws.services.lexruntimev2.model.transform;
import java.math.*;
import javax.annotation.Generated;
import com.amazonaws.services.lexruntimev2.model.*;
import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*;
import com.amazonaws.transform.*;
import com.fasterxml.jackson.core.JsonToken;
import static com.fasterxml.jackson.core.JsonToken.*;
/**
* AccessDeniedException JSON Unmarshaller
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class AccessDeniedExceptionUnmarshaller extends EnhancedJsonErrorUnmarshaller {
private AccessDeniedExceptionUnmarshaller() {
super(com.amazonaws.services.lexruntimev2.model.AccessDeniedException.class, "AccessDeniedException");
}
@Override
public com.amazonaws.services.lexruntimev2.model.AccessDeniedException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {
com.amazonaws.services.lexruntimev2.model.AccessDeniedException accessDeniedException = new com.amazonaws.services.lexruntimev2.model.AccessDeniedException(
null);
int originalDepth = context.getCurrentDepth();
String currentParentElement = context.getCurrentParentElement();
int targetDepth = originalDepth + 1;
JsonToken token = context.getCurrentToken();
if (token == null)
token = context.nextToken();
if (token == VALUE_NULL) {
return null;
}
while (true) {
if (token == null)
break;
if (token == FIELD_NAME || token == START_OBJECT) {
} else if (token == END_ARRAY || token == END_OBJECT) {
if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {
if (context.getCurrentDepth() <= originalDepth)
break;
}
}
token = context.nextToken();
}
return accessDeniedException;
}
private static AccessDeniedExceptionUnmarshaller instance;
public static AccessDeniedExceptionUnmarshaller getInstance() {
if (instance == null)
instance = new AccessDeniedExceptionUnmarshaller();
return instance;
}
}
|
aws/aws-sdk-java
|
aws-java-sdk-lexruntimev2/src/main/java/com/amazonaws/services/lexruntimev2/model/transform/AccessDeniedExceptionUnmarshaller.java
|
Java
|
apache-2.0
| 2,862
|
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# 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.
"""Remote process implementation."""
from clusterfuzz._internal.metrics import logs
from clusterfuzz._internal.protos import untrusted_runner_pb2
from clusterfuzz._internal.system import new_process
from clusterfuzz._internal.system import process_handler
from . import protobuf_utils
def process_result_to_proto(process_result):
"""Convert new_process.ProcessResult to proto."""
process_result_proto = untrusted_runner_pb2.ProcessResult(
return_code=process_result.return_code,
output=process_result.output,
time_executed=process_result.time_executed,
timed_out=process_result.timed_out)
process_result_proto.command.extend(process_result.command)
return process_result_proto
def run_and_wait(request, _):
"""Implementation of RunAndWait."""
process_runner = new_process.ProcessRunner(request.executable_path,
request.default_args)
args = {}
protobuf_utils.get_protobuf_field(args, request.popen_args, 'bufsize')
protobuf_utils.get_protobuf_field(args, request.popen_args, 'executable')
protobuf_utils.get_protobuf_field(args, request.popen_args, 'shell')
protobuf_utils.get_protobuf_field(args, request.popen_args, 'cwd')
if request.popen_args.env_is_set:
args['env'] = request.popen_args.env
else:
args['env'] = None
args['additional_args'] = request.additional_args
protobuf_utils.get_protobuf_field(args, request, 'timeout')
protobuf_utils.get_protobuf_field(args, request, 'terminate_before_kill')
protobuf_utils.get_protobuf_field(args, request, 'terminate_wait_time')
protobuf_utils.get_protobuf_field(args, request, 'input_data')
protobuf_utils.get_protobuf_field(args, request, 'max_stdout_len')
logs.log('Running command: %s' % process_runner.get_command())
return untrusted_runner_pb2.RunAndWaitResponse(
result=process_result_to_proto(process_runner.run_and_wait(**args)))
def run_process(request, _):
"""Implementation of RunProcess."""
args = {}
protobuf_utils.get_protobuf_field(args, request, 'cmdline')
protobuf_utils.get_protobuf_field(args, request, 'current_working_directory')
protobuf_utils.get_protobuf_field(args, request, 'timeout')
protobuf_utils.get_protobuf_field(args, request, 'need_shell')
if request.gestures:
args['gestures'] = request.gestures
if request.env_copy:
args['env_copy'] = request.env_copy
protobuf_utils.get_protobuf_field(args, request, 'testcase_run')
protobuf_utils.get_protobuf_field(args, request, 'ignore_children')
return_code, execution_time, output = process_handler.run_process(**args)
response = untrusted_runner_pb2.RunProcessResponse(
return_code=return_code, execution_time=execution_time, output=output)
return response
|
google/clusterfuzz
|
src/clusterfuzz/_internal/bot/untrusted_runner/remote_process.py
|
Python
|
apache-2.0
| 3,341
|
package fr.javatronic.blog.massive.annotation1.sub1;
import fr.javatronic.blog.processor.Annotation_001;
@Annotation_001
public class Class_0490 {
}
|
lesaint/experimenting-annotation-processing
|
experimenting-rounds/massive-count-of-annotated-classes/src/main/java/fr/javatronic/blog/massive/annotation1/sub1/Class_0490.java
|
Java
|
apache-2.0
| 151
|
/*
* Copyright 2014-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package com.amazonaws.services.cognitoidp.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.AmazonWebServiceRequest;
/**
*
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/CreateResourceServer" target="_top">AWS
* API Documentation</a>
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class CreateResourceServerRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable {
/**
* <p>
* The user pool ID for the user pool.
* </p>
*/
private String userPoolId;
/**
* <p>
* A unique resource server identifier for the resource server. This could be an HTTPS endpoint where the resource
* server is located. For example, <code>https://my-weather-api.example.com</code>.
* </p>
*/
private String identifier;
/**
* <p>
* A friendly name for the resource server.
* </p>
*/
private String name;
/**
* <p>
* A list of scopes. Each scope is map, where the keys are <code>name</code> and <code>description</code>.
* </p>
*/
private java.util.List<ResourceServerScopeType> scopes;
/**
* <p>
* The user pool ID for the user pool.
* </p>
*
* @param userPoolId
* The user pool ID for the user pool.
*/
public void setUserPoolId(String userPoolId) {
this.userPoolId = userPoolId;
}
/**
* <p>
* The user pool ID for the user pool.
* </p>
*
* @return The user pool ID for the user pool.
*/
public String getUserPoolId() {
return this.userPoolId;
}
/**
* <p>
* The user pool ID for the user pool.
* </p>
*
* @param userPoolId
* The user pool ID for the user pool.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateResourceServerRequest withUserPoolId(String userPoolId) {
setUserPoolId(userPoolId);
return this;
}
/**
* <p>
* A unique resource server identifier for the resource server. This could be an HTTPS endpoint where the resource
* server is located. For example, <code>https://my-weather-api.example.com</code>.
* </p>
*
* @param identifier
* A unique resource server identifier for the resource server. This could be an HTTPS endpoint where the
* resource server is located. For example, <code>https://my-weather-api.example.com</code>.
*/
public void setIdentifier(String identifier) {
this.identifier = identifier;
}
/**
* <p>
* A unique resource server identifier for the resource server. This could be an HTTPS endpoint where the resource
* server is located. For example, <code>https://my-weather-api.example.com</code>.
* </p>
*
* @return A unique resource server identifier for the resource server. This could be an HTTPS endpoint where the
* resource server is located. For example, <code>https://my-weather-api.example.com</code>.
*/
public String getIdentifier() {
return this.identifier;
}
/**
* <p>
* A unique resource server identifier for the resource server. This could be an HTTPS endpoint where the resource
* server is located. For example, <code>https://my-weather-api.example.com</code>.
* </p>
*
* @param identifier
* A unique resource server identifier for the resource server. This could be an HTTPS endpoint where the
* resource server is located. For example, <code>https://my-weather-api.example.com</code>.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateResourceServerRequest withIdentifier(String identifier) {
setIdentifier(identifier);
return this;
}
/**
* <p>
* A friendly name for the resource server.
* </p>
*
* @param name
* A friendly name for the resource server.
*/
public void setName(String name) {
this.name = name;
}
/**
* <p>
* A friendly name for the resource server.
* </p>
*
* @return A friendly name for the resource server.
*/
public String getName() {
return this.name;
}
/**
* <p>
* A friendly name for the resource server.
* </p>
*
* @param name
* A friendly name for the resource server.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateResourceServerRequest withName(String name) {
setName(name);
return this;
}
/**
* <p>
* A list of scopes. Each scope is map, where the keys are <code>name</code> and <code>description</code>.
* </p>
*
* @return A list of scopes. Each scope is map, where the keys are <code>name</code> and <code>description</code>.
*/
public java.util.List<ResourceServerScopeType> getScopes() {
return scopes;
}
/**
* <p>
* A list of scopes. Each scope is map, where the keys are <code>name</code> and <code>description</code>.
* </p>
*
* @param scopes
* A list of scopes. Each scope is map, where the keys are <code>name</code> and <code>description</code>.
*/
public void setScopes(java.util.Collection<ResourceServerScopeType> scopes) {
if (scopes == null) {
this.scopes = null;
return;
}
this.scopes = new java.util.ArrayList<ResourceServerScopeType>(scopes);
}
/**
* <p>
* A list of scopes. Each scope is map, where the keys are <code>name</code> and <code>description</code>.
* </p>
* <p>
* <b>NOTE:</b> This method appends the values to the existing list (if any). Use
* {@link #setScopes(java.util.Collection)} or {@link #withScopes(java.util.Collection)} if you want to override the
* existing values.
* </p>
*
* @param scopes
* A list of scopes. Each scope is map, where the keys are <code>name</code> and <code>description</code>.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateResourceServerRequest withScopes(ResourceServerScopeType... scopes) {
if (this.scopes == null) {
setScopes(new java.util.ArrayList<ResourceServerScopeType>(scopes.length));
}
for (ResourceServerScopeType ele : scopes) {
this.scopes.add(ele);
}
return this;
}
/**
* <p>
* A list of scopes. Each scope is map, where the keys are <code>name</code> and <code>description</code>.
* </p>
*
* @param scopes
* A list of scopes. Each scope is map, where the keys are <code>name</code> and <code>description</code>.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateResourceServerRequest withScopes(java.util.Collection<ResourceServerScopeType> scopes) {
setScopes(scopes);
return this;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getUserPoolId() != null)
sb.append("UserPoolId: ").append(getUserPoolId()).append(",");
if (getIdentifier() != null)
sb.append("Identifier: ").append(getIdentifier()).append(",");
if (getName() != null)
sb.append("Name: ").append(getName()).append(",");
if (getScopes() != null)
sb.append("Scopes: ").append(getScopes());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof CreateResourceServerRequest == false)
return false;
CreateResourceServerRequest other = (CreateResourceServerRequest) obj;
if (other.getUserPoolId() == null ^ this.getUserPoolId() == null)
return false;
if (other.getUserPoolId() != null && other.getUserPoolId().equals(this.getUserPoolId()) == false)
return false;
if (other.getIdentifier() == null ^ this.getIdentifier() == null)
return false;
if (other.getIdentifier() != null && other.getIdentifier().equals(this.getIdentifier()) == false)
return false;
if (other.getName() == null ^ this.getName() == null)
return false;
if (other.getName() != null && other.getName().equals(this.getName()) == false)
return false;
if (other.getScopes() == null ^ this.getScopes() == null)
return false;
if (other.getScopes() != null && other.getScopes().equals(this.getScopes()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getUserPoolId() == null) ? 0 : getUserPoolId().hashCode());
hashCode = prime * hashCode + ((getIdentifier() == null) ? 0 : getIdentifier().hashCode());
hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode());
hashCode = prime * hashCode + ((getScopes() == null) ? 0 : getScopes().hashCode());
return hashCode;
}
@Override
public CreateResourceServerRequest clone() {
return (CreateResourceServerRequest) super.clone();
}
}
|
jentfoo/aws-sdk-java
|
aws-java-sdk-cognitoidp/src/main/java/com/amazonaws/services/cognitoidp/model/CreateResourceServerRequest.java
|
Java
|
apache-2.0
| 10,644
|
/*
* Copyright 2014-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package com.amazonaws.services.workspaces.model.transform;
import java.math.*;
import javax.annotation.Generated;
import com.amazonaws.services.workspaces.model.*;
import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*;
import com.amazonaws.transform.*;
import com.fasterxml.jackson.core.JsonToken;
import static com.fasterxml.jackson.core.JsonToken.*;
/**
* CreateIpGroupResult JSON Unmarshaller
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class CreateIpGroupResultJsonUnmarshaller implements Unmarshaller<CreateIpGroupResult, JsonUnmarshallerContext> {
public CreateIpGroupResult unmarshall(JsonUnmarshallerContext context) throws Exception {
CreateIpGroupResult createIpGroupResult = new CreateIpGroupResult();
int originalDepth = context.getCurrentDepth();
String currentParentElement = context.getCurrentParentElement();
int targetDepth = originalDepth + 1;
JsonToken token = context.getCurrentToken();
if (token == null)
token = context.nextToken();
if (token == VALUE_NULL) {
return createIpGroupResult;
}
while (true) {
if (token == null)
break;
if (token == FIELD_NAME || token == START_OBJECT) {
if (context.testExpression("GroupId", targetDepth)) {
context.nextToken();
createIpGroupResult.setGroupId(context.getUnmarshaller(String.class).unmarshall(context));
}
} else if (token == END_ARRAY || token == END_OBJECT) {
if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {
if (context.getCurrentDepth() <= originalDepth)
break;
}
}
token = context.nextToken();
}
return createIpGroupResult;
}
private static CreateIpGroupResultJsonUnmarshaller instance;
public static CreateIpGroupResultJsonUnmarshaller getInstance() {
if (instance == null)
instance = new CreateIpGroupResultJsonUnmarshaller();
return instance;
}
}
|
jentfoo/aws-sdk-java
|
aws-java-sdk-workspaces/src/main/java/com/amazonaws/services/workspaces/model/transform/CreateIpGroupResultJsonUnmarshaller.java
|
Java
|
apache-2.0
| 2,803
|
/*
* Copyright 2014-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package com.amazonaws.services.lexruntime.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.AmazonWebServiceRequest;
/**
*
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/runtime.lex-2016-11-28/DeleteSession" target="_top">AWS API
* Documentation</a>
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class DeleteSessionRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable {
/**
* <p>
* The name of the bot that contains the session data.
* </p>
*/
private String botName;
/**
* <p>
* The alias in use for the bot that contains the session data.
* </p>
*/
private String botAlias;
/**
* <p>
* The identifier of the user associated with the session data.
* </p>
*/
private String userId;
/**
* <p>
* The name of the bot that contains the session data.
* </p>
*
* @param botName
* The name of the bot that contains the session data.
*/
public void setBotName(String botName) {
this.botName = botName;
}
/**
* <p>
* The name of the bot that contains the session data.
* </p>
*
* @return The name of the bot that contains the session data.
*/
public String getBotName() {
return this.botName;
}
/**
* <p>
* The name of the bot that contains the session data.
* </p>
*
* @param botName
* The name of the bot that contains the session data.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DeleteSessionRequest withBotName(String botName) {
setBotName(botName);
return this;
}
/**
* <p>
* The alias in use for the bot that contains the session data.
* </p>
*
* @param botAlias
* The alias in use for the bot that contains the session data.
*/
public void setBotAlias(String botAlias) {
this.botAlias = botAlias;
}
/**
* <p>
* The alias in use for the bot that contains the session data.
* </p>
*
* @return The alias in use for the bot that contains the session data.
*/
public String getBotAlias() {
return this.botAlias;
}
/**
* <p>
* The alias in use for the bot that contains the session data.
* </p>
*
* @param botAlias
* The alias in use for the bot that contains the session data.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DeleteSessionRequest withBotAlias(String botAlias) {
setBotAlias(botAlias);
return this;
}
/**
* <p>
* The identifier of the user associated with the session data.
* </p>
*
* @param userId
* The identifier of the user associated with the session data.
*/
public void setUserId(String userId) {
this.userId = userId;
}
/**
* <p>
* The identifier of the user associated with the session data.
* </p>
*
* @return The identifier of the user associated with the session data.
*/
public String getUserId() {
return this.userId;
}
/**
* <p>
* The identifier of the user associated with the session data.
* </p>
*
* @param userId
* The identifier of the user associated with the session data.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DeleteSessionRequest withUserId(String userId) {
setUserId(userId);
return this;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getBotName() != null)
sb.append("BotName: ").append(getBotName()).append(",");
if (getBotAlias() != null)
sb.append("BotAlias: ").append(getBotAlias()).append(",");
if (getUserId() != null)
sb.append("UserId: ").append(getUserId());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof DeleteSessionRequest == false)
return false;
DeleteSessionRequest other = (DeleteSessionRequest) obj;
if (other.getBotName() == null ^ this.getBotName() == null)
return false;
if (other.getBotName() != null && other.getBotName().equals(this.getBotName()) == false)
return false;
if (other.getBotAlias() == null ^ this.getBotAlias() == null)
return false;
if (other.getBotAlias() != null && other.getBotAlias().equals(this.getBotAlias()) == false)
return false;
if (other.getUserId() == null ^ this.getUserId() == null)
return false;
if (other.getUserId() != null && other.getUserId().equals(this.getUserId()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getBotName() == null) ? 0 : getBotName().hashCode());
hashCode = prime * hashCode + ((getBotAlias() == null) ? 0 : getBotAlias().hashCode());
hashCode = prime * hashCode + ((getUserId() == null) ? 0 : getUserId().hashCode());
return hashCode;
}
@Override
public DeleteSessionRequest clone() {
return (DeleteSessionRequest) super.clone();
}
}
|
jentfoo/aws-sdk-java
|
aws-java-sdk-lex/src/main/java/com/amazonaws/services/lexruntime/model/DeleteSessionRequest.java
|
Java
|
apache-2.0
| 6,667
|
/**
* GNU AFFERO GENERAL PUBLIC LICENSE
* Version 3, 19 November 2007
*
* Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
* Everyone is permitted to copy and distribute verbatim copies
* of this license document, but changing it is not allowed.
*
* Preamble
*
* The GNU Affero General Public License is a free, copyleft license for
* software and other kinds of works, specifically designed to ensure
* cooperation with the community in the case of network server software.
*
* The licenses for most software and other practical works are designed
* to take away your freedom to share and change the works. By contrast,
* our General Public Licenses are intended to guarantee your freedom to
* share and change all versions of a program--to make sure it remains free
* software for all its users.
*
* When we speak of free software, we are referring to freedom, not
* price. Our General Public Licenses are designed to make sure that you
* have the freedom to distribute copies of free software (and charge for
* them if you wish), that you receive source code or can get it if you
* want it, that you can change the software or use pieces of it in new
* free programs, and that you know you can do these things.
*
* Developers that use our General Public Licenses protect your rights
* with two steps: (1) assert copyright on the software, and (2) offer
* you this License which gives you legal permission to copy, distribute
* and/or modify the software.
*
* A secondary benefit of defending all users' freedom is that
* improvements made in alternate versions of the program, if they
* receive widespread use, become available for other developers to
* incorporate. Many developers of free software are heartened and
* encouraged by the resulting cooperation. However, in the case of
* software used on network servers, this result may fail to come about.
* The GNU General Public License permits making a modified version and
* letting the public access it on a server without ever releasing its
* source code to the public.
*
* The GNU Affero General Public License is designed specifically to
* ensure that, in such cases, the modified source code becomes available
* to the community. It requires the operator of a network server to
* provide the source code of the modified version running there to the
* users of that server. Therefore, public use of a modified version, on
* a publicly accessible server, gives the public access to the source
* code of the modified version.
*
* An older license, called the Affero General Public License and
* published by Affero, was designed to accomplish similar goals. This is
* a different license, not a version of the Affero GPL, but Affero has
* released a new version of the Affero GPL which permits relicensing under
* this license.
*
* The precise terms and conditions for copying, distribution and
* modification follow.
*
* TERMS AND CONDITIONS
*
* 0. Definitions.
*
* "This License" refers to version 3 of the GNU Affero General Public License.
*
* "Copyright" also means copyright-like laws that apply to other kinds of
* works, such as semiconductor masks.
*
* "The Program" refers to any copyrightable work licensed under this
* License. Each licensee is addressed as "you". "Licensees" and
* "recipients" may be individuals or organizations.
*
* To "modify" a work means to copy from or adapt all or part of the work
* in a fashion requiring copyright permission, other than the making of an
* exact copy. The resulting work is called a "modified version" of the
* earlier work or a work "based on" the earlier work.
*
* A "covered work" means either the unmodified Program or a work based
* on the Program.
*
* To "propagate" a work means to do anything with it that, without
* permission, would make you directly or secondarily liable for
* infringement under applicable copyright law, except executing it on a
* computer or modifying a private copy. Propagation includes copying,
* distribution (with or without modification), making available to the
* public, and in some countries other activities as well.
*
* To "convey" a work means any kind of propagation that enables other
* parties to make or receive copies. Mere interaction with a user through
* a computer network, with no transfer of a copy, is not conveying.
*
* An interactive user interface displays "Appropriate Legal Notices"
* to the extent that it includes a convenient and prominently visible
* feature that (1) displays an appropriate copyright notice, and (2)
* tells the user that there is no warranty for the work (except to the
* extent that warranties are provided), that licensees may convey the
* work under this License, and how to view a copy of this License. If
* the interface presents a list of user commands or options, such as a
* menu, a prominent item in the list meets this criterion.
*
* 1. Source Code.
*
* The "source code" for a work means the preferred form of the work
* for making modifications to it. "Object code" means any non-source
* form of a work.
*
* A "Standard Interface" means an interface that either is an official
* standard defined by a recognized standards body, or, in the case of
* interfaces specified for a particular programming language, one that
* is widely used among developers working in that language.
*
* The "System Libraries" of an executable work include anything, other
* than the work as a whole, that (a) is included in the normal form of
* packaging a Major Component, but which is not part of that Major
* Component, and (b) serves only to enable use of the work with that
* Major Component, or to implement a Standard Interface for which an
* implementation is available to the public in source code form. A
* "Major Component", in this context, means a major essential component
* (kernel, window system, and so on) of the specific operating system
* (if any) on which the executable work runs, or a compiler used to
* produce the work, or an object code interpreter used to run it.
*
* The "Corresponding Source" for a work in object code form means all
* the source code needed to generate, install, and (for an executable
* work) run the object code and to modify the work, including scripts to
* control those activities. However, it does not include the work's
* System Libraries, or general-purpose tools or generally available free
* programs which are used unmodified in performing those activities but
* which are not part of the work. For example, Corresponding Source
* includes interface definition files associated with source files for
* the work, and the source code for shared libraries and dynamically
* linked subprograms that the work is specifically designed to require,
* such as by intimate data communication or control flow between those
* subprograms and other parts of the work.
*
* The Corresponding Source need not include anything that users
* can regenerate automatically from other parts of the Corresponding
* Source.
*
* The Corresponding Source for a work in source code form is that
* same work.
*
* 2. Basic Permissions.
*
* All rights granted under this License are granted for the term of
* copyright on the Program, and are irrevocable provided the stated
* conditions are met. This License explicitly affirms your unlimited
* permission to run the unmodified Program. The output from running a
* covered work is covered by this License only if the output, given its
* content, constitutes a covered work. This License acknowledges your
* rights of fair use or other equivalent, as provided by copyright law.
*
* You may make, run and propagate covered works that you do not
* convey, without conditions so long as your license otherwise remains
* in force. You may convey covered works to others for the sole purpose
* of having them make modifications exclusively for you, or provide you
* with facilities for running those works, provided that you comply with
* the terms of this License in conveying all material for which you do
* not control copyright. Those thus making or running the covered works
* for you must do so exclusively on your behalf, under your direction
* and control, on terms that prohibit them from making any copies of
* your copyrighted material outside their relationship with you.
*
* Conveying under any other circumstances is permitted solely under
* the conditions stated below. Sublicensing is not allowed; section 10
* makes it unnecessary.
*
* 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
*
* No covered work shall be deemed part of an effective technological
* measure under any applicable law fulfilling obligations under article
* 11 of the WIPO copyright treaty adopted on 20 December 1996, or
* similar laws prohibiting or restricting circumvention of such
* measures.
*
* When you convey a covered work, you waive any legal power to forbid
* circumvention of technological measures to the extent such circumvention
* is effected by exercising rights under this License with respect to
* the covered work, and you disclaim any intention to limit operation or
* modification of the work as a means of enforcing, against the work's
* users, your or third parties' legal rights to forbid circumvention of
* technological measures.
*
* 4. Conveying Verbatim Copies.
*
* You may convey verbatim copies of the Program's source code as you
* receive it, in any medium, provided that you conspicuously and
* appropriately publish on each copy an appropriate copyright notice;
* keep intact all notices stating that this License and any
* non-permissive terms added in accord with section 7 apply to the code;
* keep intact all notices of the absence of any warranty; and give all
* recipients a copy of this License along with the Program.
*
* You may charge any price or no price for each copy that you convey,
* and you may offer support or warranty protection for a fee.
*
* 5. Conveying Modified Source Versions.
*
* You may convey a work based on the Program, or the modifications to
* produce it from the Program, in the form of source code under the
* terms of section 4, provided that you also meet all of these conditions:
*
* a) The work must carry prominent notices stating that you modified
* it, and giving a relevant date.
*
* b) The work must carry prominent notices stating that it is
* released under this License and any conditions added under section
* 7. This requirement modifies the requirement in section 4 to
* "keep intact all notices".
*
* c) You must license the entire work, as a whole, under this
* License to anyone who comes into possession of a copy. This
* License will therefore apply, along with any applicable section 7
* additional terms, to the whole of the work, and all its parts,
* regardless of how they are packaged. This License gives no
* permission to license the work in any other way, but it does not
* invalidate such permission if you have separately received it.
*
* d) If the work has interactive user interfaces, each must display
* Appropriate Legal Notices; however, if the Program has interactive
* interfaces that do not display Appropriate Legal Notices, your
* work need not make them do so.
*
* A compilation of a covered work with other separate and independent
* works, which are not by their nature extensions of the covered work,
* and which are not combined with it such as to form a larger program,
* in or on a volume of a storage or distribution medium, is called an
* "aggregate" if the compilation and its resulting copyright are not
* used to limit the access or legal rights of the compilation's users
* beyond what the individual works permit. Inclusion of a covered work
* in an aggregate does not cause this License to apply to the other
* parts of the aggregate.
*
* 6. Conveying Non-Source Forms.
*
* You may convey a covered work in object code form under the terms
* of sections 4 and 5, provided that you also convey the
* machine-readable Corresponding Source under the terms of this License,
* in one of these ways:
*
* a) Convey the object code in, or embodied in, a physical product
* (including a physical distribution medium), accompanied by the
* Corresponding Source fixed on a durable physical medium
* customarily used for software interchange.
*
* b) Convey the object code in, or embodied in, a physical product
* (including a physical distribution medium), accompanied by a
* written offer, valid for at least three years and valid for as
* long as you offer spare parts or customer support for that product
* model, to give anyone who possesses the object code either (1) a
* copy of the Corresponding Source for all the software in the
* product that is covered by this License, on a durable physical
* medium customarily used for software interchange, for a price no
* more than your reasonable cost of physically performing this
* conveying of source, or (2) access to copy the
* Corresponding Source from a network server at no charge.
*
* c) Convey individual copies of the object code with a copy of the
* written offer to provide the Corresponding Source. This
* alternative is allowed only occasionally and noncommercially, and
* only if you received the object code with such an offer, in accord
* with subsection 6b.
*
* d) Convey the object code by offering access from a designated
* place (gratis or for a charge), and offer equivalent access to the
* Corresponding Source in the same way through the same place at no
* further charge. You need not require recipients to copy the
* Corresponding Source along with the object code. If the place to
* copy the object code is a network server, the Corresponding Source
* may be on a different server (operated by you or a third party)
* that supports equivalent copying facilities, provided you maintain
* clear directions next to the object code saying where to find the
* Corresponding Source. Regardless of what server hosts the
* Corresponding Source, you remain obligated to ensure that it is
* available for as long as needed to satisfy these requirements.
*
* e) Convey the object code using peer-to-peer transmission, provided
* you inform other peers where the object code and Corresponding
* Source of the work are being offered to the general public at no
* charge under subsection 6d.
*
* A separable portion of the object code, whose source code is excluded
* from the Corresponding Source as a System Library, need not be
* included in conveying the object code work.
*
* A "User Product" is either (1) a "consumer product", which means any
* tangible personal property which is normally used for personal, family,
* or household purposes, or (2) anything designed or sold for incorporation
* into a dwelling. In determining whether a product is a consumer product,
* doubtful cases shall be resolved in favor of coverage. For a particular
* product received by a particular user, "normally used" refers to a
* typical or common use of that class of product, regardless of the status
* of the particular user or of the way in which the particular user
* actually uses, or expects or is expected to use, the product. A product
* is a consumer product regardless of whether the product has substantial
* commercial, industrial or non-consumer uses, unless such uses represent
* the only significant mode of use of the product.
*
* "Installation Information" for a User Product means any methods,
* procedures, authorization keys, or other information required to install
* and execute modified versions of a covered work in that User Product from
* a modified version of its Corresponding Source. The information must
* suffice to ensure that the continued functioning of the modified object
* code is in no case prevented or interfered with solely because
* modification has been made.
*
* If you convey an object code work under this section in, or with, or
* specifically for use in, a User Product, and the conveying occurs as
* part of a transaction in which the right of possession and use of the
* User Product is transferred to the recipient in perpetuity or for a
* fixed term (regardless of how the transaction is characterized), the
* Corresponding Source conveyed under this section must be accompanied
* by the Installation Information. But this requirement does not apply
* if neither you nor any third party retains the ability to install
* modified object code on the User Product (for example, the work has
* been installed in ROM).
*
* The requirement to provide Installation Information does not include a
* requirement to continue to provide support service, warranty, or updates
* for a work that has been modified or installed by the recipient, or for
* the User Product in which it has been modified or installed. Access to a
* network may be denied when the modification itself materially and
* adversely affects the operation of the network or violates the rules and
* protocols for communication across the network.
*
* Corresponding Source conveyed, and Installation Information provided,
* in accord with this section must be in a format that is publicly
* documented (and with an implementation available to the public in
* source code form), and must require no special password or key for
* unpacking, reading or copying.
*
* 7. Additional Terms.
*
* "Additional permissions" are terms that supplement the terms of this
* License by making exceptions from one or more of its conditions.
* Additional permissions that are applicable to the entire Program shall
* be treated as though they were included in this License, to the extent
* that they are valid under applicable law. If additional permissions
* apply only to part of the Program, that part may be used separately
* under those permissions, but the entire Program remains governed by
* this License without regard to the additional permissions.
*
* When you convey a copy of a covered work, you may at your option
* remove any additional permissions from that copy, or from any part of
* it. (Additional permissions may be written to require their own
* removal in certain cases when you modify the work.) You may place
* additional permissions on material, added by you to a covered work,
* for which you have or can give appropriate copyright permission.
*
* Notwithstanding any other provision of this License, for material you
* add to a covered work, you may (if authorized by the copyright holders of
* that material) supplement the terms of this License with terms:
*
* a) Disclaiming warranty or limiting liability differently from the
* terms of sections 15 and 16 of this License; or
*
* b) Requiring preservation of specified reasonable legal notices or
* author attributions in that material or in the Appropriate Legal
* Notices displayed by works containing it; or
*
* c) Prohibiting misrepresentation of the origin of that material, or
* requiring that modified versions of such material be marked in
* reasonable ways as different from the original version; or
*
* d) Limiting the use for publicity purposes of names of licensors or
* authors of the material; or
*
* e) Declining to grant rights under trademark law for use of some
* trade names, trademarks, or service marks; or
*
* f) Requiring indemnification of licensors and authors of that
* material by anyone who conveys the material (or modified versions of
* it) with contractual assumptions of liability to the recipient, for
* any liability that these contractual assumptions directly impose on
* those licensors and authors.
*
* All other non-permissive additional terms are considered "further
* restrictions" within the meaning of section 10. If the Program as you
* received it, or any part of it, contains a notice stating that it is
* governed by this License along with a term that is a further
* restriction, you may remove that term. If a license document contains
* a further restriction but permits relicensing or conveying under this
* License, you may add to a covered work material governed by the terms
* of that license document, provided that the further restriction does
* not survive such relicensing or conveying.
*
* If you add terms to a covered work in accord with this section, you
* must place, in the relevant source files, a statement of the
* additional terms that apply to those files, or a notice indicating
* where to find the applicable terms.
*
* Additional terms, permissive or non-permissive, may be stated in the
* form of a separately written license, or stated as exceptions;
* the above requirements apply either way.
*
* 8. Termination.
*
* You may not propagate or modify a covered work except as expressly
* provided under this License. Any attempt otherwise to propagate or
* modify it is void, and will automatically terminate your rights under
* this License (including any patent licenses granted under the third
* paragraph of section 11).
*
* However, if you cease all violation of this License, then your
* license from a particular copyright holder is reinstated (a)
* provisionally, unless and until the copyright holder explicitly and
* finally terminates your license, and (b) permanently, if the copyright
* holder fails to notify you of the violation by some reasonable means
* prior to 60 days after the cessation.
*
* Moreover, your license from a particular copyright holder is
* reinstated permanently if the copyright holder notifies you of the
* violation by some reasonable means, this is the first time you have
* received notice of violation of this License (for any work) from that
* copyright holder, and you cure the violation prior to 30 days after
* your receipt of the notice.
*
* Termination of your rights under this section does not terminate the
* licenses of parties who have received copies or rights from you under
* this License. If your rights have been terminated and not permanently
* reinstated, you do not qualify to receive new licenses for the same
* material under section 10.
*
* 9. Acceptance Not Required for Having Copies.
*
* You are not required to accept this License in order to receive or
* run a copy of the Program. Ancillary propagation of a covered work
* occurring solely as a consequence of using peer-to-peer transmission
* to receive a copy likewise does not require acceptance. However,
* nothing other than this License grants you permission to propagate or
* modify any covered work. These actions infringe copyright if you do
* not accept this License. Therefore, by modifying or propagating a
* covered work, you indicate your acceptance of this License to do so.
*
* 10. Automatic Licensing of Downstream Recipients.
*
* Each time you convey a covered work, the recipient automatically
* receives a license from the original licensors, to run, modify and
* propagate that work, subject to this License. You are not responsible
* for enforcing compliance by third parties with this License.
*
* An "entity transaction" is a transaction transferring control of an
* organization, or substantially all assets of one, or subdividing an
* organization, or merging organizations. If propagation of a covered
* work results from an entity transaction, each party to that
* transaction who receives a copy of the work also receives whatever
* licenses to the work the party's predecessor in interest had or could
* give under the previous paragraph, plus a right to possession of the
* Corresponding Source of the work from the predecessor in interest, if
* the predecessor has it or can get it with reasonable efforts.
*
* You may not impose any further restrictions on the exercise of the
* rights granted or affirmed under this License. For example, you may
* not impose a license fee, royalty, or other charge for exercise of
* rights granted under this License, and you may not initiate litigation
* (including a cross-claim or counterclaim in a lawsuit) alleging that
* any patent claim is infringed by making, using, selling, offering for
* sale, or importing the Program or any portion of it.
*
* 11. Patents.
*
* A "contributor" is a copyright holder who authorizes use under this
* License of the Program or a work on which the Program is based. The
* work thus licensed is called the contributor's "contributor version".
*
* A contributor's "essential patent claims" are all patent claims
* owned or controlled by the contributor, whether already acquired or
* hereafter acquired, that would be infringed by some manner, permitted
* by this License, of making, using, or selling its contributor version,
* but do not include claims that would be infringed only as a
* consequence of further modification of the contributor version. For
* purposes of this definition, "control" includes the right to grant
* patent sublicenses in a manner consistent with the requirements of
* this License.
*
* Each contributor grants you a non-exclusive, worldwide, royalty-free
* patent license under the contributor's essential patent claims, to
* make, use, sell, offer for sale, import and otherwise run, modify and
* propagate the contents of its contributor version.
*
* In the following three paragraphs, a "patent license" is any express
* agreement or commitment, however denominated, not to enforce a patent
* (such as an express permission to practice a patent or covenant not to
* sue for patent infringement). To "grant" such a patent license to a
* party means to make such an agreement or commitment not to enforce a
* patent against the party.
*
* If you convey a covered work, knowingly relying on a patent license,
* and the Corresponding Source of the work is not available for anyone
* to copy, free of charge and under the terms of this License, through a
* publicly available network server or other readily accessible means,
* then you must either (1) cause the Corresponding Source to be so
* available, or (2) arrange to deprive yourself of the benefit of the
* patent license for this particular work, or (3) arrange, in a manner
* consistent with the requirements of this License, to extend the patent
* license to downstream recipients. "Knowingly relying" means you have
* actual knowledge that, but for the patent license, your conveying the
* covered work in a country, or your recipient's use of the covered work
* in a country, would infringe one or more identifiable patents in that
* country that you have reason to believe are valid.
*
* If, pursuant to or in connection with a single transaction or
* arrangement, you convey, or propagate by procuring conveyance of, a
* covered work, and grant a patent license to some of the parties
* receiving the covered work authorizing them to use, propagate, modify
* or convey a specific copy of the covered work, then the patent license
* you grant is automatically extended to all recipients of the covered
* work and works based on it.
*
* A patent license is "discriminatory" if it does not include within
* the scope of its coverage, prohibits the exercise of, or is
* conditioned on the non-exercise of one or more of the rights that are
* specifically granted under this License. You may not convey a covered
* work if you are a party to an arrangement with a third party that is
* in the business of distributing software, under which you make payment
* to the third party based on the extent of your activity of conveying
* the work, and under which the third party grants, to any of the
* parties who would receive the covered work from you, a discriminatory
* patent license (a) in connection with copies of the covered work
* conveyed by you (or copies made from those copies), or (b) primarily
* for and in connection with specific products or compilations that
* contain the covered work, unless you entered into that arrangement,
* or that patent license was granted, prior to 28 March 2007.
*
* Nothing in this License shall be construed as excluding or limiting
* any implied license or other defenses to infringement that may
* otherwise be available to you under applicable patent law.
*
* 12. No Surrender of Others' Freedom.
*
* If conditions are imposed on you (whether by court order, agreement or
* otherwise) that contradict the conditions of this License, they do not
* excuse you from the conditions of this License. If you cannot convey a
* covered work so as to satisfy simultaneously your obligations under this
* License and any other pertinent obligations, then as a consequence you may
* not convey it at all. For example, if you agree to terms that obligate you
* to collect a royalty for further conveying from those to whom you convey
* the Program, the only way you could satisfy both those terms and this
* License would be to refrain entirely from conveying the Program.
*
* 13. Remote Network Interaction; Use with the GNU General Public License.
*
* Notwithstanding any other provision of this License, if you modify the
* Program, your modified version must prominently offer all users
* interacting with it remotely through a computer network (if your version
* supports such interaction) an opportunity to receive the Corresponding
* Source of your version by providing access to the Corresponding Source
* from a network server at no charge, through some standard or customary
* means of facilitating copying of software. This Corresponding Source
* shall include the Corresponding Source for any work covered by version 3
* of the GNU General Public License that is incorporated pursuant to the
* following paragraph.
*
* Notwithstanding any other provision of this License, you have
* permission to link or combine any covered work with a work licensed
* under version 3 of the GNU General Public License into a single
* combined work, and to convey the resulting work. The terms of this
* License will continue to apply to the part which is the covered work,
* but the work with which it is combined will remain governed by version
* 3 of the GNU General Public License.
*
* 14. Revised Versions of this License.
*
* The Free Software Foundation may publish revised and/or new versions of
* the GNU Affero General Public License from time to time. Such new versions
* will be similar in spirit to the present version, but may differ in detail to
* address new problems or concerns.
*
* Each version is given a distinguishing version number. If the
* Program specifies that a certain numbered version of the GNU Affero General
* Public License "or any later version" applies to it, you have the
* option of following the terms and conditions either of that numbered
* version or of any later version published by the Free Software
* Foundation. If the Program does not specify a version number of the
* GNU Affero General Public License, you may choose any version ever published
* by the Free Software Foundation.
*
* If the Program specifies that a proxy can decide which future
* versions of the GNU Affero General Public License can be used, that proxy's
* public statement of acceptance of a version permanently authorizes you
* to choose that version for the Program.
*
* Later license versions may give you additional or different
* permissions. However, no additional obligations are imposed on any
* author or copyright holder as a result of your choosing to follow a
* later version.
*
* 15. Disclaimer of Warranty.
*
* THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
* APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
* HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
* OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
* IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
* ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
*
* 16. Limitation of Liability.
*
* IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
* WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
* THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
* GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
* USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
* DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
* PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
* EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGES.
*
* 17. Interpretation of Sections 15 and 16.
*
* If the disclaimer of warranty and limitation of liability provided
* above cannot be given local legal effect according to their terms,
* reviewing courts shall apply local law that most closely approximates
* an absolute waiver of all civil liability in connection with the
* Program, unless a warranty or assumption of liability accompanies a
* copy of the Program in return for a fee.
*
* END OF TERMS AND CONDITIONS
*
* How to Apply These Terms to Your New Programs
*
* If you develop a new program, and you want it to be of the greatest
* possible use to the public, the best way to achieve this is to make it
* free software which everyone can redistribute and change under these terms.
*
* To do so, attach the following notices to the program. It is safest
* to attach them to the start of each source file to most effectively
* state the exclusion of warranty; and each file should have at least
* the "copyright" line and a pointer to where the full notice is found.
*
* Copyright (C) 2009-2010 Gianfranco Tognana gianfranco.tognana@gmail.com
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* Also add information on how to contact you by electronic and paper mail.
*
* If your software can interact with users remotely through a computer
* network, you should also make sure that it provides a way for users to
* get its source. For example, if your program is a web application, its
* interface could display a "Source" link that leads users to an archive
* of the code. There are many ways you could offer source, and different
* solutions will be better for different programs; see section 13 for the
* specific requirements.
*
* You should also get your employer (if you work as a programmer) or school,
* if any, to sign a "copyright disclaimer" for the program, if necessary.
* For more information on this, and how to apply and follow the GNU AGPL, see
* <http://www.gnu.org/licenses/>.
*/
package org.gft.demo;
public interface Sale {
Person getSeller();
Person getBuyer();
Car getCar();
double getCost();
int hashCode();
}
|
tectronics/jacle
|
src/test/java/org/gft/demo/Sale.java
|
Java
|
apache-2.0
| 36,495
|
import gevent
import gevent.pool
import uuid
import logging
def get_trace(greenlet=None):
greenlet = greenlet or gevent.getcurrent()
if not hasattr(greenlet, '_iris_trace'):
greenlet._iris_trace = {}
return greenlet._iris_trace
def spawn(*args, **kwargs):
greenlet = gevent.Greenlet(*args, **kwargs)
greenlet._iris_trace = get_trace().copy()
greenlet.start()
return greenlet
_spawn = spawn
class Group(gevent.pool.Group):
def spawn(self, *args, **kwargs):
g = _spawn(*args, **kwargs)
self.add(g)
return g
def trace(**kwargs):
get_trace().update(kwargs)
def set_id(trace_id=None):
trace_id = trace_id or uuid.uuid4().hex
trace(iris_trace_id=trace_id)
return trace_id
def get_id():
return get_trace().get('iris_trace_id')
class TraceFormatter(logging.Formatter):
def format(self, record):
record.trace_id = get_id()
return super(TraceFormatter, self).format(record)
|
kpanic/lymph
|
iris/core/trace.py
|
Python
|
apache-2.0
| 983
|
/* @flow */
import { bool, node, number, oneOfType, string } from 'prop-types';
export const iconPropTypes = {
children: node,
color: string,
rtl: bool,
size: oneOfType([number, string]),
title: string
};
|
mineral-ui/mineral-ui
|
src/library/Icon/propTypes.js
|
JavaScript
|
apache-2.0
| 216
|
#!/bin/bash
CHECKPOINT_DIR="model/model_final/model.ckpt-34865"
python polyvore/fashion_compatibility.py \
--checkpoint_path=${CHECKPOINT_DIR} \
--label_file="data/label/fashion_compatibility_prediction.txt" \
--feature_file="data/features/test_features.pkl" \
--rnn_type="lstm" \
--direction="2" \
--result_file="fashion_compatibility.pkl"
|
xthan/polyvore
|
predict_compatibility.sh
|
Shell
|
apache-2.0
| 354
|
# Iriarteaceae O. F. Cook & Doyle FAMILY
#### Status
SYNONYM
#### According to
GRIN Taxonomy for Plants
#### Published in
null
#### Original name
null
### Remarks
null
|
mdoering/backbone
|
life/Plantae/Magnoliophyta/Liliopsida/Arecales/Arecaceae/ Syn. Iriarteaceae/README.md
|
Markdown
|
apache-2.0
| 172
|
# Calliblepharis ciliata (Hudson) Kützing SPECIES
#### Status
ACCEPTED
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null
|
mdoering/backbone
|
life/Plantae/Rhodophyta/Florideophyceae/Gigartinales/Cystocloniaceae/Calliblepharis/Calliblepharis ciliata/README.md
|
Markdown
|
apache-2.0
| 198
|
# Woloszynskia cestocoedes (Thompson) Thompson SPECIES
#### Status
ACCEPTED
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null
|
mdoering/backbone
|
life/Protozoa/Dinophyta/Dinophyceae/Gymnodiniales/Woloszynskiaceae/Woloszynskia/Woloszynskia cestocoedes/README.md
|
Markdown
|
apache-2.0
| 202
|
# Lavatera althaeifolia Mill. SPECIES
#### Status
ACCEPTED
#### According to
International Plant Names Index
#### Published in
null
#### Original name
null
### Remarks
null
|
mdoering/backbone
|
life/Plantae/Magnoliophyta/Magnoliopsida/Malvales/Malvaceae/Lavatera/Lavatera althaeifolia/README.md
|
Markdown
|
apache-2.0
| 177
|
# Rubus amblyphyllus Kupcsok SPECIES
#### Status
ACCEPTED
#### According to
International Plant Names Index
#### Published in
null
#### Original name
null
### Remarks
null
|
mdoering/backbone
|
life/Plantae/Magnoliophyta/Magnoliopsida/Rosales/Rosaceae/Rubus/Rubus amblyphyllus/README.md
|
Markdown
|
apache-2.0
| 176
|
# Heptameria lineolaris (Niessl) Cooke, 1889 SPECIES
#### Status
SYNONYM
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null
|
mdoering/backbone
|
life/Fungi/Ascomycota/Dothideomycetes/Pleosporales/Phaeosphaeriaceae/Phaeosphaeria/Phaeosphaeria nigrans/ Syn. Heptameria lineolaris/README.md
|
Markdown
|
apache-2.0
| 199
|
# Arenaria tweedyi Rydb. SPECIES
#### Status
ACCEPTED
#### According to
International Plant Names Index
#### Published in
null
#### Original name
null
### Remarks
null
|
mdoering/backbone
|
life/Plantae/Magnoliophyta/Magnoliopsida/Caryophyllales/Caryophyllaceae/Arenaria/Arenaria tweedyi/README.md
|
Markdown
|
apache-2.0
| 172
|
# Aquadiscula Shearer & J.L. Crane GENUS
#### Status
ACCEPTED
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
Mycologia 77(3): 441 (1985)
#### Original name
Aquadiscula Shearer & J.L. Crane
### Remarks
null
|
mdoering/backbone
|
life/Fungi/Ascomycota/Leotiomycetes/Helotiales/Helotiaceae/Aquadiscula/README.md
|
Markdown
|
apache-2.0
| 239
|
# Collema socotrense var. socotrense VARIETY
#### Status
ACCEPTED
#### According to
Index Fungorum
#### Published in
null
#### Original name
Collema socotrense var. socotrense
### Remarks
null
|
mdoering/backbone
|
life/Fungi/Ascomycota/Lecanoromycetes/Peltigerales/Collemataceae/Collema/Collema socotrense/Collema socotrense socotrense/README.md
|
Markdown
|
apache-2.0
| 197
|
# Cyrtochilum hartwegii var. parviflorum VARIETY
#### Status
SYNONYM
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null
|
mdoering/backbone
|
life/Plantae/Magnoliophyta/Liliopsida/Asparagales/Orchidaceae/Cyrtochilum/Cyrtochilum flexuosum/ Syn. Cyrtochilum hartwegii parviflorum/README.md
|
Markdown
|
apache-2.0
| 195
|
# Fritillaria tortifolia var. barlikensis VARIETY
#### Status
SYNONYM
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null
|
mdoering/backbone
|
life/Plantae/Magnoliophyta/Liliopsida/Liliales/Liliaceae/Fritillaria/Fritillaria tortifolia/ Syn. Fritillaria tortifolia barlikensis/README.md
|
Markdown
|
apache-2.0
| 196
|
# Rhodophyllus alboroseus Romagn. & Gilles SPECIES
#### Status
ACCEPTED
#### According to
Index Fungorum
#### Published in
Beih. Nova Hedwigia 59: 171 (1979)
#### Original name
Rhodophyllus alboroseus Romagn. & Gilles
### Remarks
null
|
mdoering/backbone
|
life/Fungi/Basidiomycota/Agaricomycetes/Agaricales/Entolomataceae/Rhodophyllus/Rhodophyllus alboroseus/README.md
|
Markdown
|
apache-2.0
| 239
|
# Tabebuia densifolia Urb. SPECIES
#### Status
ACCEPTED
#### According to
International Plant Names Index
#### Published in
null
#### Original name
null
### Remarks
null
|
mdoering/backbone
|
life/Plantae/Magnoliophyta/Magnoliopsida/Lamiales/Bignoniaceae/Tabebuia/Tabebuia densifolia/README.md
|
Markdown
|
apache-2.0
| 174
|
# Neocinnamomum atjehense Kosterm. SPECIES
#### Status
ACCEPTED
#### According to
International Plant Names Index
#### Published in
null
#### Original name
null
### Remarks
null
|
mdoering/backbone
|
life/Plantae/Magnoliophyta/Magnoliopsida/Laurales/Lauraceae/Neocinnamomum/Neocinnamomum atjehense/README.md
|
Markdown
|
apache-2.0
| 182
|
# Prunus iwatensis H.Koidz. SPECIES
#### Status
ACCEPTED
#### According to
International Plant Names Index
#### Published in
null
#### Original name
null
### Remarks
null
|
mdoering/backbone
|
life/Plantae/Magnoliophyta/Magnoliopsida/Rosales/Rosaceae/Prunus/Prunus iwatensis/README.md
|
Markdown
|
apache-2.0
| 175
|
open-keno
=========
Version 0.1.0
Introduction
------------
Open-keno is an extensible library for playing various styles of Keno. It provides a default reference
implementation, but can be extended to support network play, custom paytables, and ball providers.
Contents
--------
### Standard Keno
Keno is a simple game of luck where the player chooses numbers and hope as many as possible match those randomly drawn
#### Rules
1. The player makes a wager and indicates which numbers he wishes to pick. The picks are made on a slip of paper in live keno and by touching the screen in video keno. The range of numbers the player may pick from is 1 to 80.
2. The number of picks the player may make depends on the game itself. Usually the range is 2 to 10 or 1 to 15.
3. The game will randomly choose 20 out of 80 balls.
4. If the game chooses a number the player chose that is known as a "catch." The player is paid according to the number of balls he catchs.
### Power Keno
The rules in Power Keno are the same as standard keno, except if the player catches the 20th ball drawn, then any winnings are quadrupled.
### Super Keno
The rules in Super Keno the same as standard keno, except if the player catches the 1st ball drawn, then any winnings are quadrupled.
### Top-Bottom Keno
Top-bottom keno pays according to how many balls fall into a half (top or bottom) chosen by the player.
Usage
-----
### Basic Usage
For the standard keno game, instantiate the StandardKeno class and any tickets to play:
Keno keno = new StandardKeno();
Ticket ticket = new DefaultTicket();
ticket.markNumber(25);
RaceResult result = keno.playTicket(ticket);
Current Status
--------------
- *Standard Keno* - Complete
- *Power Keno* - Complete
- *Super Keno* - In progress
- *Top-Bottom Keno* - Planning
|
jsillitoe/open-keno
|
README.md
|
Markdown
|
apache-2.0
| 1,821
|
/*
* Copyright 2016, Google 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 io.opencensus.trace.base;
import static com.google.common.truth.Truth.assertThat;
import com.google.common.testing.EqualsTester;
import java.util.Arrays;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
/** Unit tests for {@link TraceId}. */
@RunWith(JUnit4.class)
public class TraceIdTest {
private static final byte[] firstBytes =
new byte[] {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'a'};
private static final byte[] secondBytes =
new byte[] {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'A'};
private static final TraceId first = TraceId.fromBytes(firstBytes);
private static final TraceId second = TraceId.fromBytes(secondBytes);
@Test
public void invalidTraceId() {
assertThat(TraceId.INVALID.getBytes()).isEqualTo(new byte[16]);
}
@Test
public void isValid() {
assertThat(TraceId.INVALID.isValid()).isFalse();
assertThat(first.isValid()).isTrue();
assertThat(second.isValid()).isTrue();
}
@Test
public void getBytes() {
assertThat(first.getBytes()).isEqualTo(firstBytes);
assertThat(second.getBytes()).isEqualTo(secondBytes);
}
@Test
public void traceId_CompareTo() {
assertThat(first.compareTo(second)).isGreaterThan(0);
assertThat(second.compareTo(first)).isLessThan(0);
assertThat(first.compareTo(TraceId.fromBytes(firstBytes))).isEqualTo(0);
}
@Test
public void traceId_EqualsAndHashCode() {
EqualsTester tester = new EqualsTester();
tester.addEqualityGroup(TraceId.INVALID, TraceId.INVALID);
tester.addEqualityGroup(first, TraceId.fromBytes(Arrays.copyOf(firstBytes, firstBytes.length)));
tester.addEqualityGroup(
second, TraceId.fromBytes(Arrays.copyOf(secondBytes, secondBytes.length)));
tester.testEquals();
}
@Test
public void traceId_ToString() {
assertThat(TraceId.INVALID.toString()).contains("00000000000000000000000000000000");
assertThat(first.toString()).contains("00000000000000000000000000000061");
assertThat(second.toString()).contains("00000000000000000000000000000041");
}
}
|
dinooliva/instrumentation-java
|
api/src/test/java/io/opencensus/trace/base/TraceIdTest.java
|
Java
|
apache-2.0
| 2,685
|
<!DOCTYPE html>
<html lang="en" class="js csstransforms3d">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="generator" content="Hugo 0.56.0" />
<meta name="description" content="Documentation for Selenium">
<link rel="icon" href="https://seleniumhq.github.io/docs/site/en/images/favicon.png" type="image/png">
<title>Getting started :: Documentation for Selenium</title>
<link href="https://seleniumhq.github.io/docs/site/en/css/nucleus.css?1571349416" rel="stylesheet">
<link href="https://seleniumhq.github.io/docs/site/en/css/fontawesome-all.min.css?1571349416" rel="stylesheet">
<link href="https://seleniumhq.github.io/docs/site/en/css/hybrid.css?1571349416" rel="stylesheet">
<link href="https://seleniumhq.github.io/docs/site/en/css/featherlight.min.css?1571349416" rel="stylesheet">
<link href="https://seleniumhq.github.io/docs/site/en/css/perfect-scrollbar.min.css?1571349416" rel="stylesheet">
<link href="https://seleniumhq.github.io/docs/site/en/css/auto-complete.css?1571349416" rel="stylesheet">
<link href="https://seleniumhq.github.io/docs/site/en/css/atom-one-dark-reasonable.css?1571349416" rel="stylesheet">
<link href="https://seleniumhq.github.io/docs/site/en/css/theme.css?1571349416" rel="stylesheet">
<link href="https://seleniumhq.github.io/docs/site/en/css/hugo-theme.css?1571349416" rel="stylesheet">
<link href="https://seleniumhq.github.io/docs/site/en/css/theme-selenium.css?1571349416" rel="stylesheet">
<script src="https://seleniumhq.github.io/docs/site/en/js/jquery-3.3.1.min.js?1571349416"></script>
<style>
:root #header + #content > #left > #rlblock_left{
display:none !important;
}
</style>
</head>
<body class="" data-url="/getting_started/">
<nav id="sidebar" class="showVisitedLinks">
<div id="header-wrapper">
<div id="header">
<a id="logo" href="https://seleniumhq.github.io/docs/site/en">
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 139.38 34"
width="100%" height="100%" xml:space="preserve">
<defs>
<style>.cls-1{fill:#fff;}</style>
</defs>
<title>Selenium</title>
<path class="cls-1" d="M46.2,26.37a18.85,18.85,0,0,1-2.57-.2,25,25,0,0,1-2.74-.53l0-1.39a25.31,25.31,0,0,0,2.71.53,18,18,0,0,0,2.5.2,5.51,5.51,0,0,0,3.29-.84,2.79,2.79,0,0,0,1.14-2.39,2.85,2.85,0,0,0-1.24-2.49A6,6,0,0,0,48,18.55q-.78-.29-1.67-.55A15.93,15.93,0,0,1,44,17.13a5.92,5.92,0,0,1-1.58-1.05,3.6,3.6,0,0,1-.9-1.34A5,5,0,0,1,41.23,13a4.46,4.46,0,0,1,.41-1.93,4.31,4.31,0,0,1,1.17-1.5,5.26,5.26,0,0,1,1.82-1A8,8,0,0,1,47,8.28a20.51,20.51,0,0,1,4.41.57l0,1.42a20,20,0,0,0-2.23-.44,15.2,15.2,0,0,0-2-.15,4.86,4.86,0,0,0-3.08.9A2.9,2.9,0,0,0,42.88,13a3.25,3.25,0,0,0,.21,1.21,2.61,2.61,0,0,0,.7,1,4.83,4.83,0,0,0,1.27.79,14.31,14.31,0,0,0,2,.68q1.11.33,2.06.71a6.21,6.21,0,0,1,1.65.94,4.09,4.09,0,0,1,1.1,1.38,4.54,4.54,0,0,1,.4,2,4.15,4.15,0,0,1-1.56,3.48A7.16,7.16,0,0,1,46.2,26.37Z"/>
<path class="cls-1" d="M60.62,26.32a5.46,5.46,0,0,1-4.28-1.62A6.9,6.9,0,0,1,54.88,20a7.8,7.8,0,0,1,1.43-5,5,5,0,0,1,4.14-1.75,4.24,4.24,0,0,1,3.47,1.43A6.48,6.48,0,0,1,65.1,18.8q0,.54,0,.92a3.22,3.22,0,0,1-.09.64H56.44a5.39,5.39,0,0,0,1.17,3.5A4.18,4.18,0,0,0,60.8,25a10.52,10.52,0,0,0,1.82-.17,11.77,11.77,0,0,0,1.93-.52l.12,1.27a10.68,10.68,0,0,1-2,.55A11.47,11.47,0,0,1,60.62,26.32ZM60.4,14.43q-3.68,0-3.94,4.74h7.15a6.49,6.49,0,0,0-.78-3.63A2.76,2.76,0,0,0,60.4,14.43Z"/>
<path class="cls-1" d="M68.64,7h1.58V26.11H68.64Z"/>
<path class="cls-1" d="M79.56,26.32a5.46,5.46,0,0,1-4.28-1.62A6.9,6.9,0,0,1,73.83,20a7.8,7.8,0,0,1,1.43-5,5,5,0,0,1,4.14-1.75,4.24,4.24,0,0,1,3.47,1.43A6.48,6.48,0,0,1,84,18.8q0,.54,0,.92a3.22,3.22,0,0,1-.09.64H75.38a5.4,5.4,0,0,0,1.17,3.5A4.18,4.18,0,0,0,79.75,25a10.52,10.52,0,0,0,1.82-.17,11.8,11.8,0,0,0,1.93-.52l.12,1.27a10.68,10.68,0,0,1-2,.55A11.47,11.47,0,0,1,79.56,26.32Zm-.21-11.89q-3.68,0-3.94,4.74h7.15a6.49,6.49,0,0,0-.78-3.63A2.76,2.76,0,0,0,79.35,14.43Z"/>
<path class="cls-1" d="M87.51,13.37h1.32l.12,1.49h.12q.94-.45,1.72-.78t1.43-.54a8.42,8.42,0,0,1,1.2-.31,6.54,6.54,0,0,1,1.1-.09A3.3,3.3,0,0,1,97,14a3.63,3.63,0,0,1,.83,2.63v9.51H96.24v-9a3,3,0,0,0-.55-2,2.18,2.18,0,0,0-1.69-.6,7.25,7.25,0,0,0-2.24.41,20.1,20.1,0,0,0-2.67,1.12v10H87.51Z"/>
<path class="cls-1" d="M102.75,10.52a.93.93,0,0,1-1.06-1,1.06,1.06,0,0,1,2.12,0A.93.93,0,0,1,102.75,10.52Zm-.8,2.85h1.58V26.11h-1.58Z"/>
<path class="cls-1" d="M110.81,26.34q-3.14,0-3.14-3.47V13.37h1.58v9a3.16,3.16,0,0,0,.48,2,1.92,1.92,0,0,0,1.59.6,6.83,6.83,0,0,0,2.48-.48q1.25-.48,2.59-1.14V13.37H118V26.11h-1.32l-.12-1.58h-.09l-1.73.81q-.74.34-1.38.57a7.9,7.9,0,0,1-1.23.33A7.34,7.34,0,0,1,110.81,26.34Z"/>
<path class="cls-1" d="M122.18,13.37h1.3l.14,1.49h.09a19.53,19.53,0,0,1,2.58-1.31,5.51,5.51,0,0,1,2-.41,2.83,2.83,0,0,1,3,1.77h.12q.8-.5,1.45-.83a12.61,12.61,0,0,1,1.2-.54,6.17,6.17,0,0,1,1-.31,5.18,5.18,0,0,1,1-.09,3.3,3.3,0,0,1,2.45.84,3.63,3.63,0,0,1,.83,2.63v9.51h-1.56v-9a2.9,2.9,0,0,0-.55-2,2.21,2.21,0,0,0-1.69-.59,5.14,5.14,0,0,0-1.78.38A14.45,14.45,0,0,0,131.6,16v10.1H130v-9a2.9,2.9,0,0,0-.55-2,2.21,2.21,0,0,0-1.69-.59,5.24,5.24,0,0,0-1.86.4A14,14,0,0,0,123.76,16V26.11h-1.58Z"/>
<path class="cls-1" d="M21.45,21.51a2.49,2.49,0,0,0-2.55,2.21.08.08,0,0,0,.08.1h4.95a.08.08,0,0,0,.08-.09A2.41,2.41,0,0,0,21.45,21.51Z"/>
<path class="cls-1" d="M32.06,4.91,21.56,16.7a.32.32,0,0,1-.47,0l-5.36-5.53a.32.32,0,0,1,0-.4l1.77-2.27a.32.32,0,0,1,.52,0l3,3.32a.32.32,0,0,0,.49,0L29.87.36A.23.23,0,0,0,29.69,0H.25A.25.25,0,0,0,0,.25v33.5A.25.25,0,0,0,.25,34h32a.25.25,0,0,0,.25-.25V5.06A.23.23,0,0,0,32.06,4.91Zm-23,25.36a8.08,8.08,0,0,1-5.74-2,.31.31,0,0,1,0-.41l1.25-1.75A.31.31,0,0,1,5,26a6.15,6.15,0,0,0,4.2,1.64c1.64,0,2.44-.76,2.44-1.56,0-2.48-8.08-.78-8.08-6.06,0-2.33,2-4.27,5.32-4.27a7.88,7.88,0,0,1,5.25,1.76.31.31,0,0,1,0,.43L12.9,19.65a.31.31,0,0,1-.45.05,6.08,6.08,0,0,0-3.84-1.32c-1.28,0-2,.57-2,1.41,0,2.23,8.06.74,8.06,6C14.67,28.33,12.84,30.27,9.05,30.27ZM26.68,25.4a.27.27,0,0,1-.28.28H19a.09.09,0,0,0-.08.1,2.81,2.81,0,0,0,3,2.32,4.62,4.62,0,0,0,2.56-.84.27.27,0,0,1,.4.06l.9,1.31a.28.28,0,0,1-.06.37,6.67,6.67,0,0,1-4.1,1.28,5.28,5.28,0,0,1-5.57-5.48,5.31,5.31,0,0,1,5.4-5.46c3.11,0,5.22,2.33,5.22,5.74Z"/>
</svg>
</a>
</div>
<div class="searchbox">
<label for="search-by"><i class="fas fa-search"></i></label>
<input data-search-input id="search-by" type="search" placeholder="Search...">
<span data-search-clear=""><i class="fas fa-times"></i></span>
</div>
<script type="text/javascript" src="https://seleniumhq.github.io/docs/site/en/js/lunr.min.js?1571349416"></script>
<script type="text/javascript" src="https://seleniumhq.github.io/docs/site/en/js/auto-complete.js?1571349416"></script>
<script type="text/javascript">
var baseurl = "https:\/\/seleniumhq.github.io\/docs\/site\/en\/en";
</script>
<script type="text/javascript" src="https://seleniumhq.github.io/docs/site/en/js/search.js?1571349416"></script>
</div>
<div class="highlightable">
<ul class="topics">
<li data-nav-id="/getting_started/" title="Getting started" class="dd-item
parent
active
">
<a href="https://seleniumhq.github.io/docs/site/en/getting_started/">
Getting started
<i class="fas fa-check read-icon"></i>
</a>
<ul>
<li data-nav-id="/getting_started/quick/" title="Quick tour" class="dd-item ">
<a href="https://seleniumhq.github.io/docs/site/en/getting_started/quick/">
Quick tour
<i class="fas fa-check read-icon"></i>
</a>
</li>
<li data-nav-id="/getting_started/html-runner/" title="HTML runner" class="dd-item ">
<a href="https://seleniumhq.github.io/docs/site/en/getting_started/html-runner/">
HTML runner
<i class="fas fa-check read-icon"></i>
</a>
</li>
</ul>
</li>
<li data-nav-id="/introduction/" title="Introduction" class="dd-item
">
<a href="https://seleniumhq.github.io/docs/site/en/introduction/">
Introduction
<i class="fas fa-check read-icon"></i>
</a>
<ul>
<li data-nav-id="/introduction/the_selenium_project_and_tools/" title="The Selenium project and tools" class="dd-item ">
<a href="https://seleniumhq.github.io/docs/site/en/introduction/the_selenium_project_and_tools/">
The Selenium project and tools
<i class="fas fa-check read-icon"></i>
</a>
</li>
<li data-nav-id="/introduction/on_test_automation/" title="On test automation" class="dd-item ">
<a href="https://seleniumhq.github.io/docs/site/en/introduction/on_test_automation/">
On test automation
<i class="fas fa-check read-icon"></i>
</a>
</li>
<li data-nav-id="/introduction/types_of_testing/" title="Types of testing" class="dd-item ">
<a href="https://seleniumhq.github.io/docs/site/en/introduction/types_of_testing/">
Types of testing
<i class="fas fa-check read-icon"></i>
</a>
</li>
<li data-nav-id="/introduction/about_this_documentation/" title="About this documentation" class="dd-item ">
<a href="https://seleniumhq.github.io/docs/site/en/introduction/about_this_documentation/">
About this documentation
<i class="fas fa-check read-icon"></i>
</a>
</li>
</ul>
</li>
<li data-nav-id="/selenium_installation/" title="Selenium installation" class="dd-item
">
<a href="https://seleniumhq.github.io/docs/site/en/selenium_installation/">
Selenium installation
<i class="fas fa-check read-icon"></i>
</a>
<ul>
<li data-nav-id="/selenium_installation/installing_selenium_libraries/" title="Installing Selenium libraries" class="dd-item ">
<a href="https://seleniumhq.github.io/docs/site/en/selenium_installation/installing_selenium_libraries/">
Installing Selenium libraries
<i class="fas fa-check read-icon"></i>
</a>
</li>
<li data-nav-id="/selenium_installation/installing_webdriver_binaries/" title="Installing WebDriver binaries" class="dd-item ">
<a href="https://seleniumhq.github.io/docs/site/en/selenium_installation/installing_webdriver_binaries/">
Installing WebDriver binaries
<i class="fas fa-check read-icon"></i>
</a>
</li>
<li data-nav-id="/selenium_installation/installing_standalone_server/" title="Installing Standalone server" class="dd-item ">
<a href="https://seleniumhq.github.io/docs/site/en/selenium_installation/installing_standalone_server/">
Installing Standalone server
<i class="fas fa-check read-icon"></i>
</a>
</li>
</ul>
</li>
<li data-nav-id="/getting_started_with_webdriver/" title="Getting started with WebDriver" class="dd-item
">
<a href="https://seleniumhq.github.io/docs/site/en/getting_started_with_webdriver/">
Getting started with WebDriver
<i class="fas fa-check read-icon"></i>
</a>
<ul>
<li data-nav-id="/getting_started_with_webdriver/browsers/" title="Browsers" class="dd-item ">
<a href="https://seleniumhq.github.io/docs/site/en/getting_started_with_webdriver/browsers/">
Browsers
<i class="fas fa-check read-icon"></i>
</a>
</li>
<li data-nav-id="/getting_started_with_webdriver/third_party_drivers_and_plugins/" title="Third party drivers and plugins" class="dd-item ">
<a href="https://seleniumhq.github.io/docs/site/en/getting_started_with_webdriver/third_party_drivers_and_plugins/">
Third party drivers and plugins
<i class="fas fa-check read-icon"></i>
</a>
</li>
<li data-nav-id="/getting_started_with_webdriver/locating_elements/" title="Locating elements" class="dd-item ">
<a href="https://seleniumhq.github.io/docs/site/en/getting_started_with_webdriver/locating_elements/">
Locating elements
<i class="fas fa-check read-icon"></i>
</a>
</li>
<li data-nav-id="/getting_started_with_webdriver/performing_actions_on_the_aut/" title="Performing actions on the AUT*" class="dd-item ">
<a href="https://seleniumhq.github.io/docs/site/en/getting_started_with_webdriver/performing_actions_on_the_aut/">
Performing actions on the AUT*
<i class="fas fa-check read-icon"></i>
</a>
</li>
</ul>
</li>
<li data-nav-id="/webdriver/" title="WebDriver" class="dd-item
">
<a href="https://seleniumhq.github.io/docs/site/en/webdriver/">
WebDriver
<i class="fas fa-check read-icon"></i>
</a>
<ul>
<li data-nav-id="/webdriver/understanding_the_components/" title="Understanding the components" class="dd-item ">
<a href="https://seleniumhq.github.io/docs/site/en/webdriver/understanding_the_components/">
Understanding the components
<i class="fas fa-check read-icon"></i>
</a>
</li>
<li data-nav-id="/webdriver/driver_requirements/" title="Driver requirements" class="dd-item ">
<a href="https://seleniumhq.github.io/docs/site/en/webdriver/driver_requirements/">
Driver requirements
<i class="fas fa-check read-icon"></i>
</a>
</li>
<li data-nav-id="/webdriver/browser_manipulation/" title="Browser manipulation" class="dd-item ">
<a href="https://seleniumhq.github.io/docs/site/en/webdriver/browser_manipulation/">
Browser manipulation
<i class="fas fa-check read-icon"></i>
</a>
</li>
<li data-nav-id="/webdriver/waits/" title="Waits" class="dd-item ">
<a href="https://seleniumhq.github.io/docs/site/en/webdriver/waits/">
Waits
<i class="fas fa-check read-icon"></i>
</a>
</li>
<li data-nav-id="/webdriver/support_classes/" title="Support classes" class="dd-item ">
<a href="https://seleniumhq.github.io/docs/site/en/webdriver/support_classes/">
Support classes
<i class="fas fa-check read-icon"></i>
</a>
</li>
<li data-nav-id="/webdriver/js_alerts_prompts_and_confirmations/" title="JavaScript alerts, prompts and confirmations" class="dd-item ">
<a href="https://seleniumhq.github.io/docs/site/en/webdriver/js_alerts_prompts_and_confirmations/">
JavaScript alerts, prompts and confirmations
<i class="fas fa-check read-icon"></i>
</a>
</li>
<li data-nav-id="/webdriver/http_proxies/" title="Http proxies" class="dd-item ">
<a href="https://seleniumhq.github.io/docs/site/en/webdriver/http_proxies/">
Http proxies
<i class="fas fa-check read-icon"></i>
</a>
</li>
<li data-nav-id="/webdriver/page_loading_strategy/" title="Page loading strategy" class="dd-item ">
<a href="https://seleniumhq.github.io/docs/site/en/webdriver/page_loading_strategy/">
Page loading strategy
<i class="fas fa-check read-icon"></i>
</a>
</li>
<li data-nav-id="/webdriver/web_element/" title="Web element" class="dd-item ">
<a href="https://seleniumhq.github.io/docs/site/en/webdriver/web_element/">
Web element
<i class="fas fa-check read-icon"></i>
</a>
</li>
<li data-nav-id="/webdriver/keyboard/" title="Keyboard" class="dd-item ">
<a href="https://seleniumhq.github.io/docs/site/en/webdriver/keyboard/">
Keyboard
<i class="fas fa-check read-icon"></i>
</a>
</li>
<li data-nav-id="/webdriver/mouse/" title="Mouse" class="dd-item ">
<a href="https://seleniumhq.github.io/docs/site/en/webdriver/mouse/">
Mouse
<i class="fas fa-check read-icon"></i>
</a>
</li>
</ul>
</li>
<li data-nav-id="/remote_webdriver/" title="Remote WebDriver" class="dd-item
">
<a href="https://seleniumhq.github.io/docs/site/en/remote_webdriver/">
Remote WebDriver
<i class="fas fa-check read-icon"></i>
</a>
<ul>
<li data-nav-id="/remote_webdriver/remote_webdriver_server/" title="Remote WebDriver server" class="dd-item ">
<a href="https://seleniumhq.github.io/docs/site/en/remote_webdriver/remote_webdriver_server/">
Remote WebDriver server
<i class="fas fa-check read-icon"></i>
</a>
</li>
<li data-nav-id="/remote_webdriver/remote_webdriver_client/" title="Remote WebDriver client" class="dd-item ">
<a href="https://seleniumhq.github.io/docs/site/en/remote_webdriver/remote_webdriver_client/">
Remote WebDriver client
<i class="fas fa-check read-icon"></i>
</a>
</li>
</ul>
</li>
<li data-nav-id="/guidelines_and_recommendations/" title="Guidelines and recommendations" class="dd-item
">
<a href="https://seleniumhq.github.io/docs/site/en/guidelines_and_recommendations/">
Guidelines
<i class="fas fa-check read-icon"></i>
</a>
<ul>
<li data-nav-id="/guidelines_and_recommendations/page_object_models/" title="Page object models" class="dd-item ">
<a href="https://seleniumhq.github.io/docs/site/en/guidelines_and_recommendations/page_object_models/">
Page object models
<i class="fas fa-check read-icon"></i>
</a>
</li>
<li data-nav-id="/guidelines_and_recommendations/domain_specific_language/" title="Domain specific language" class="dd-item ">
<a href="https://seleniumhq.github.io/docs/site/en/guidelines_and_recommendations/domain_specific_language/">
Domain specific language
<i class="fas fa-check read-icon"></i>
</a>
</li>
<li data-nav-id="/guidelines_and_recommendations/generating_application_state/" title="Generating application state" class="dd-item ">
<a href="https://seleniumhq.github.io/docs/site/en/guidelines_and_recommendations/generating_application_state/">
Generating application state
<i class="fas fa-check read-icon"></i>
</a>
</li>
<li data-nav-id="/guidelines_and_recommendations/mock_external_services/" title="Mock external services" class="dd-item ">
<a href="https://seleniumhq.github.io/docs/site/en/guidelines_and_recommendations/mock_external_services/">
Mock external services
<i class="fas fa-check read-icon"></i>
</a>
</li>
<li data-nav-id="/guidelines_and_recommendations/improved_reporting/" title="Improved reporting" class="dd-item ">
<a href="https://seleniumhq.github.io/docs/site/en/guidelines_and_recommendations/improved_reporting/">
Improved reporting
<i class="fas fa-check read-icon"></i>
</a>
</li>
<li data-nav-id="/guidelines_and_recommendations/avoid_sharing_state/" title="Avoid sharing state" class="dd-item ">
<a href="https://seleniumhq.github.io/docs/site/en/guidelines_and_recommendations/avoid_sharing_state/">
Avoid sharing state
<i class="fas fa-check read-icon"></i>
</a>
</li>
<li data-nav-id="/guidelines_and_recommendations/test_independency/" title="Test independency" class="dd-item ">
<a href="https://seleniumhq.github.io/docs/site/en/guidelines_and_recommendations/test_independency/">
Test independency
<i class="fas fa-check read-icon"></i>
</a>
</li>
<li data-nav-id="/guidelines_and_recommendations/consider_using_a_fluent_api/" title="Consider using a fluent API" class="dd-item ">
<a href="https://seleniumhq.github.io/docs/site/en/guidelines_and_recommendations/consider_using_a_fluent_api/">
Consider using a fluent API
<i class="fas fa-check read-icon"></i>
</a>
</li>
<li data-nav-id="/guidelines_and_recommendations/fresh_browser_per_test/" title="Fresh browser per test" class="dd-item ">
<a href="https://seleniumhq.github.io/docs/site/en/guidelines_and_recommendations/fresh_browser_per_test/">
Fresh browser per test
<i class="fas fa-check read-icon"></i>
</a>
</li>
</ul>
</li>
<li data-nav-id="/worst_practices/" title="Worst practices" class="dd-item
">
<a href="https://seleniumhq.github.io/docs/site/en/worst_practices/">
Worst practices
<i class="fas fa-check read-icon"></i>
</a>
<ul>
<li data-nav-id="/worst_practices/captchas/" title="Captchas" class="dd-item ">
<a href="https://seleniumhq.github.io/docs/site/en/worst_practices/captchas/">
Captchas
<i class="fas fa-check read-icon"></i>
</a>
</li>
<li data-nav-id="/worst_practices/file_downloads/" title="File downloads" class="dd-item ">
<a href="https://seleniumhq.github.io/docs/site/en/worst_practices/file_downloads/">
File downloads
<i class="fas fa-check read-icon"></i>
</a>
</li>
<li data-nav-id="/worst_practices/http_response_codes/" title="HTTP response codes" class="dd-item ">
<a href="https://seleniumhq.github.io/docs/site/en/worst_practices/http_response_codes/">
HTTP response codes
<i class="fas fa-check read-icon"></i>
</a>
</li>
<li data-nav-id="/worst_practices/gmail_email_and_facebook_logins/" title="Gmail, email and Facebook logins" class="dd-item ">
<a href="https://seleniumhq.github.io/docs/site/en/worst_practices/gmail_email_and_facebook_logins/">
Gmail, email and Facebook
<i class="fas fa-check read-icon"></i>
</a>
</li>
<li data-nav-id="/worst_practices/test_dependency/" title="Test dependency" class="dd-item ">
<a href="https://seleniumhq.github.io/docs/site/en/worst_practices/test_dependency/">
Test dependency
<i class="fas fa-check read-icon"></i>
</a>
</li>
<li data-nav-id="/worst_practices/performance_testing/" title="Performance testing" class="dd-item ">
<a href="https://seleniumhq.github.io/docs/site/en/worst_practices/performance_testing/">
Performance testing
<i class="fas fa-check read-icon"></i>
</a>
</li>
<li data-nav-id="/worst_practices/link_spidering/" title="Link spidering" class="dd-item ">
<a href="https://seleniumhq.github.io/docs/site/en/worst_practices/link_spidering/">
Link spidering
<i class="fas fa-check read-icon"></i>
</a>
</li>
</ul>
</li>
<li data-nav-id="/grid/" title="Grid" class="dd-item
">
<a href="https://seleniumhq.github.io/docs/site/en/grid/">
Grid
<i class="fas fa-check read-icon"></i>
</a>
<ul>
<li data-nav-id="/grid/purposes_and_main_functionalities/" title="Purposes and main functionalities" class="dd-item ">
<a href="https://seleniumhq.github.io/docs/site/en/grid/purposes_and_main_functionalities/">
Purposes and functionalities
<i class="fas fa-check read-icon"></i>
</a>
</li>
<li data-nav-id="/grid/components_of_a_grid/" title="Components of a Grid" class="dd-item ">
<a href="https://seleniumhq.github.io/docs/site/en/grid/components_of_a_grid/">
Components of a Grid
<i class="fas fa-check read-icon"></i>
</a>
</li>
<li data-nav-id="/grid/setting_up_your_own_grid/" title="Setting up your own Grid" class="dd-item ">
<a href="https://seleniumhq.github.io/docs/site/en/grid/setting_up_your_own_grid/">
Setting up your own Grid
<i class="fas fa-check read-icon"></i>
</a>
</li>
</ul>
</li>
<li data-nav-id="/driver_idiosyncrasies/" title="Driver idiosyncrasies" class="dd-item
">
<a href="https://seleniumhq.github.io/docs/site/en/driver_idiosyncrasies/">
Driver idiosyncrasies
<i class="fas fa-check read-icon"></i>
</a>
<ul>
<li data-nav-id="/driver_idiosyncrasies/shared_capabilities/" title="Shared capabilities" class="dd-item ">
<a href="https://seleniumhq.github.io/docs/site/en/driver_idiosyncrasies/shared_capabilities/">
Shared capabilities
<i class="fas fa-check read-icon"></i>
</a>
</li>
<li data-nav-id="/driver_idiosyncrasies/driver_specific_capabilities/" title="Driver specific capabilities" class="dd-item ">
<a href="https://seleniumhq.github.io/docs/site/en/driver_idiosyncrasies/driver_specific_capabilities/">
Driver specific capabilities
<i class="fas fa-check read-icon"></i>
</a>
</li>
</ul>
</li>
<li data-nav-id="/support_packages/" title="Support packages" class="dd-item
">
<a href="https://seleniumhq.github.io/docs/site/en/support_packages/">
Support packages
<i class="fas fa-check read-icon"></i>
</a>
<ul>
<li data-nav-id="/support_packages/browser_navigation/" title="Browser navigation" class="dd-item ">
<a href="https://seleniumhq.github.io/docs/site/en/support_packages/browser_navigation/">
Browser navigation
<i class="fas fa-check read-icon"></i>
</a>
</li>
<li data-nav-id="/support_packages/working_with_colours/" title="Working with colours" class="dd-item ">
<a href="https://seleniumhq.github.io/docs/site/en/support_packages/working_with_colours/">
Working with colours
<i class="fas fa-check read-icon"></i>
</a>
</li>
<li data-nav-id="/support_packages/working_with_select_elements/" title="Working with select elements" class="dd-item ">
<a href="https://seleniumhq.github.io/docs/site/en/support_packages/working_with_select_elements/">
Working with select elements
<i class="fas fa-check read-icon"></i>
</a>
</li>
<li data-nav-id="/support_packages/mouse_and_keyboard_actions_in_detail/" title="Mouse and keyboard actions in detail" class="dd-item ">
<a href="https://seleniumhq.github.io/docs/site/en/support_packages/mouse_and_keyboard_actions_in_detail/">
Mouse and keyboard actions in detail
<i class="fas fa-check read-icon"></i>
</a>
</li>
<li data-nav-id="/support_packages/working_with_web_elements/" title="Working with web elements" class="dd-item ">
<a href="https://seleniumhq.github.io/docs/site/en/support_packages/working_with_web_elements/">
Working with web elements
<i class="fas fa-check read-icon"></i>
</a>
</li>
</ul>
</li>
<li data-nav-id="/front_matter/" title="Front matter" class="dd-item
">
<a href="https://seleniumhq.github.io/docs/site/en/front_matter/">
Front matter
<i class="fas fa-check read-icon"></i>
</a>
<ul>
<li data-nav-id="/front_matter/copyright_and_attributions/" title="Copyright and attributions" class="dd-item ">
<a href="https://seleniumhq.github.io/docs/site/en/front_matter/copyright_and_attributions/">
Copyright and attributions
<i class="fas fa-check read-icon"></i>
</a>
</li>
<li data-nav-id="/front_matter/typographical_conventions/" title="Typographical conventions" class="dd-item ">
<a href="https://seleniumhq.github.io/docs/site/en/front_matter/typographical_conventions/">
Typographical conventions
<i class="fas fa-check read-icon"></i>
</a>
</li>
</ul>
</li>
</ul>
<section id="shortcuts">
<h3>More</h3>
<ul>
<li>
<a class="padding" href="https://github.com/SeleniumHQ/docs"><i class='fab fa-fw fa-github'></i> GitHub repo</a>
</li>
<li>
<a class="padding" href="https://github.com/seleniumhq/docs/issues"><i class='fas fa-fw fa-exclamation-triangle'></i> Report a bug</a>
</li>
<li>
<a class="padding" href="https://seleniumhq.github.io/docs/site/en/front_matter/copyright_and_attributions"><i class='fas fa-fw fa-bullhorn'></i> Credits</a>
</li>
<li>
<a class="padding" href="https://seleniumhq.github.io/docs/site/en/contributing"><i class='fas fa-fw fa-bullhorn'></i> How to contribute</a>
</li>
</ul>
</section>
<section id="prefooter">
<hr/>
<ul>
<li>
<a class="padding">
<i class="fas fa-language fa-fw"></i>
<div class="select-style">
<select id="select-language" onchange="location = this.value;">
<option id="en" value="https://seleniumhq.github.io/docs/site/en/getting_started/" selected>English</option>
<option id="es" value="https://seleniumhq.github.io/docs/site/es/getting_started/">Español</option>
<option id="nl" value="https://seleniumhq.github.io/docs/site/nl/getting_started/">Nederlands</option>
<option id="zh-cn" value="https://seleniumhq.github.io/docs/site/zh-cn/getting_started/">中文简体</option>
<option id="fr" value="https://seleniumhq.github.io/docs/site/fr/getting_started/">Français</option>
<option id="ja" value="https://seleniumhq.github.io/docs/site/ja/getting_started/">日本語</option>
</select>
<svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="255px" height="255px" viewBox="0 0 255 255" style="enable-background:new 0 0 255 255;" xml:space="preserve">
<g>
<g id="arrow-drop-down">
<polygon points="0,63.75 127.5,191.25 255,63.75 " />
</g>
</g>
</svg>
</div>
</a>
</li>
<li><a class="padding" href="#" data-clear-history-toggle=""><i class="fas fa-history fa-fw"></i> Clear History</a></li>
</ul>
</section>
<section id="footer">
<p>
© 2013-2019
</p>
<p>
Software Freedom Conservancy (SFC)
</p>
</section>
</div>
</nav>
<section id="body">
<div id="overlay"></div>
<div class="padding highlightable">
<div>
<div id="top-bar">
<div id="top-github-link">
<a class="github-link" title='Edit this page' href="https://github.com/SeleniumHQ/docs/edit/gh-pages/docs_source_files/content/getting_started/_index.en.md" target="blank">
<i class="fas fa-code-branch"></i>
<span id="top-github-link-text">Edit this page</span>
</a>
</div>
<div id="breadcrumbs" itemscope="" itemtype="http://data-vocabulary.org/Breadcrumb">
<span id="sidebar-toggle-span">
<a href="#" id="sidebar-toggle" data-sidebar-toggle="">
<i class="fas fa-bars"></i>
</a>
</span>
<span class="links">
<a href='https://seleniumhq.github.io/docs/site/en/'>The Selenium Browser Automation Project</a> > Getting started
</span>
</div>
</div>
</div>
<div id="head-tags">
</div>
<div id="chapter">
<div id="body-inner">
<h1 id="getting-started">Getting started</h1>
<p>If you are new to Selenium,
we have a few resources that can help you
get up to speed right away.</p>
<ul>
<li><a href="https://seleniumhq.github.io/docs/site/en/getting_started/quick/">Quick tour</a>
<ul>
<li><a href="https://seleniumhq.github.io/docs/site/en/getting_started/quick/#webdriver">WebDriver</a></li>
<li><a href="https://seleniumhq.github.io/docs/site/en/getting_started/quick/#remote-control">Remote Control</a></li>
<li><a href="https://seleniumhq.github.io/docs/site/en/getting_started/quick/#ide">IDE</a></li>
<li><a href="https://seleniumhq.github.io/docs/site/en/getting_started/quick/#grid">Grid</a></li>
<li><a href="https://seleniumhq.github.io/docs/site/en/getting_started/quick/#html-runner">HTML Runner</a></li>
</ul></li>
</ul>
<footer class=" footline" >
</footer>
<h5 class="meta-data">
<a href="https://seleniumhq.github.io/docs/site/en/getting_started/">
“Getting started”
</a> was last updated on: 25 Aug 2019 18:58:49 +0000: <a href="https://github.com/SeleniumHQ/docs/commit/0796e9a2e9ff438d6431521ef7d11bab85df016d">Publishing site on Sun Aug 25 18:58:49 UTC 2019, commit 95da9c5fb67f3ee0d8643391d33c432194496c59 and job 795.1, [skip ci] (0796e9a2)</a>
</h5>
</div>
</div>
</div>
<div id="navigation">
<a class="nav nav-prev" href="https://seleniumhq.github.io/docs/site/en/" title="The Selenium Browser Automation Project"> <i class="fa fa-chevron-left"></i></a>
<a class="nav nav-next" href="https://seleniumhq.github.io/docs/site/en/getting_started/quick/" title="Quick tour" style="margin-right: 0px;"><i class="fa fa-chevron-right"></i></a>
</div>
</section>
<div style="left: -1000px; overflow: scroll; position: absolute; top: -1000px; border: none; box-sizing: content-box; height: 200px; margin: 0px; padding: 0px; width: 200px;">
<div style="border: none; box-sizing: content-box; height: 200px; margin: 0px; padding: 0px; width: 200px;"></div>
</div>
<script src="https://seleniumhq.github.io/docs/site/en/js/clipboard.min.js?1571349416"></script>
<script src="https://seleniumhq.github.io/docs/site/en/js/perfect-scrollbar.min.js?1571349416"></script>
<script src="https://seleniumhq.github.io/docs/site/en/js/perfect-scrollbar.jquery.min.js?1571349416"></script>
<script src="https://seleniumhq.github.io/docs/site/en/js/jquery.sticky.js?1571349416"></script>
<script src="https://seleniumhq.github.io/docs/site/en/js/featherlight.min.js?1571349416"></script>
<script src="https://seleniumhq.github.io/docs/site/en/js/highlight.pack.js?1571349416"></script>
<script>hljs.initHighlightingOnLoad();</script>
<script src="https://seleniumhq.github.io/docs/site/en/js/modernizr.custom-3.6.0.js?1571349416"></script>
<script src="https://seleniumhq.github.io/docs/site/en/js/learn.js?1571349416"></script>
<script src="https://seleniumhq.github.io/docs/site/en/js/hugo-learn.js?1571349416"></script>
<link href="https://seleniumhq.github.io/docs/site/en/mermaid/mermaid.css?1571349416" rel="stylesheet" />
<script src="https://seleniumhq.github.io/docs/site/en/mermaid/mermaid.js?1571349416"></script>
<script>
mermaid.initialize({ startOnLoad: true });
</script>
</body>
</html>
|
SeleniumHQ/docs
|
site/en/getting_started/index.html
|
HTML
|
apache-2.0
| 61,090
|
default_app_config = 'leonardo.apps.LeonardoConfig'
__import__('pkg_resources').declare_namespace(__name__)
try:
from leonardo.base import leonardo # noqa
except ImportError:
import warnings
def simple_warn(message, category, filename, lineno, file=None, line=None):
return '%s: %s' % (category.__name__, message)
msg = ("Could not import Leonardo dependencies. "
"This is normal during installation.\n")
warnings.formatwarning = simple_warn
warnings.warn(msg, Warning)
|
amboycharlie/Child-Friendly-LCMS
|
leonardo/__init__.py
|
Python
|
apache-2.0
| 520
|
<?php
/**
* PHPUnit
*
* Copyright (c) 2002-2008, Sebastian Bergmann <sb@sebastian-bergmann.de>.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* * Neither the name of Sebastian Bergmann nor the names of his
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* @category Testing
* @package PHPUnit
* @author Sebastian Bergmann <sb@sebastian-bergmann.de>
* @copyright 2002-2008 Sebastian Bergmann <sb@sebastian-bergmann.de>
* @license http://www.opensource.org/licenses/bsd-license.php BSD License
* @version SVN: $Id: TestSuiteIterator.php 1985 2007-12-26 18:11:55Z sb $
* @link http://www.phpunit.de/
* @since File available since Release 3.1.0
*/
require_once 'PHPUnit/Util/Filter.php';
PHPUnit_Util_Filter::addFileToFilter(__FILE__, 'PHPUNIT');
/**
* Iterator for test suites.
*
* @category Testing
* @package PHPUnit
* @author Sebastian Bergmann <sb@sebastian-bergmann.de>
* @copyright 2002-2008 Sebastian Bergmann <sb@sebastian-bergmann.de>
* @license http://www.opensource.org/licenses/bsd-license.php BSD License
* @version Release: 3.2.9
* @link http://www.phpunit.de/
* @since Class available since Release 3.1.0
*/
class PHPUnit_Util_TestSuiteIterator implements RecursiveIterator
{
/**
* @var integer
* @access protected
*/
protected $position;
/**
* @var PHPUnit_Framework_Test[]
* @access protected
*/
protected $tests;
/**
* Constructor.
*
* @param PHPUnit_Framework_TestSuite $suite
* @access public
*/
public function __construct(PHPUnit_Framework_TestSuite $testSuite)
{
$this->tests = $testSuite->tests();
}
/**
* Rewinds the Iterator to the first element.
*
* @access public
*/
public function rewind()
{
$this->position = 0;
}
/**
* Checks if there is a current element after calls to rewind() or next().
*
* @return boolean
* @access public
*/
public function valid()
{
return $this->position < count($this->tests);
}
/**
* Returns the key of the current element.
*
* @return integer
* @access public
*/
public function key()
{
return $this->position;
}
/**
* Returns the current element.
*
* @return PHPUnit_Framework_Test
* @access public
*/
public function current()
{
return $this->valid() ? $this->tests[$this->position] : NULL;
}
/**
* Moves forward to next element.
*
* @access public
*/
public function next()
{
$this->position++;
}
/**
* Returns the sub iterator for the current element.
*
* @return PHPUnit_Util_TestSuiteIterator
* @access public
*/
public function getChildren()
{
return new PHPUnit_Util_TestSuiteIterator($this->tests[$this->position]);
}
/**
* Checks whether the current element has children.
*
* @return boolean
* @access public
*/
public function hasChildren()
{
return $this->tests[$this->position] instanceof PHPUnit_Framework_TestSuite;
}
}
?>
|
nevali/shindig
|
php/external/PHPUnit/Util/TestSuiteIterator.php
|
PHP
|
apache-2.0
| 4,626
|
<?php
require '../404.php';
?>
|
Citizenxin/nyweb
|
company/404.php
|
PHP
|
apache-2.0
| 32
|
# Seriphidium ciniforme (Krasch. & Popov ex Poljakov) Poljakov SPECIES
#### Status
SYNONYM
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null
|
mdoering/backbone
|
life/Plantae/Magnoliophyta/Magnoliopsida/Asterales/Asteraceae/Artemisia ciniformis/ Syn. Seriphidium ciniforme/README.md
|
Markdown
|
apache-2.0
| 217
|
package com.ib.booking.basket.controller;
import com.ib.booking.basket.proxies.ProductRepositoryProxy;
import com.ib.booking.basket.repositories.BasketRepository;
import com.ib.commercial.model.Basket;
import com.ib.commercial.model.Product;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.security.oauth2.resource.EnableOAuth2Resource;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import java.security.Principal;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@RestController
@RequestMapping("/basket")
@EnableOAuth2Resource
public class BasketController {
private static final Logger log = LoggerFactory.getLogger(BasketController.class);
@Autowired
private ProductRepositoryProxy productrepository;
@Autowired
private BasketRepository basketRepository;
@RequestMapping(value = "/create/{basketId}", method = RequestMethod.PUT)
ResponseEntity<?> create(@PathVariable String basketId) {
log.debug("Create");
//log.debug("ProductApi: User={}, Auth={}, called with productId={}", currentUser.getName(), authorizationHeader, basketId);
basketRepository.insert(new Basket(basketId));
Basket basket = basketRepository.findOne(basketId);
return new ResponseEntity<>(basket, null, HttpStatus.CREATED);
}
@RequestMapping(value = "/remove/{basketId}", method = RequestMethod.DELETE)
ResponseEntity<?> delete(@PathVariable String basketId) {
log.debug("Remove Basket#"+basketId);
basketRepository.delete(basketId);
return new ResponseEntity<>(null, null, HttpStatus.GONE);
}
@RequestMapping(value = "/clearall", method = RequestMethod.DELETE)
ResponseEntity<?> clearall() {
log.debug("Clearing all Baskets");
basketRepository.deleteAll();
return new ResponseEntity<>(null, null, HttpStatus.GONE);
}
@RequestMapping(value = "/{basketId}/add/{productId}", method = RequestMethod.PUT)
ResponseEntity<Basket> add(@PathVariable String basketId, @PathVariable String productId) {
log.debug("Basket #"+basketId+" Add Product#"+productId);
Product product = productrepository.getProduct(productId);
Basket basket = basketRepository.findOne(basketId);
if (basket.getProducts() != null) {
basket.getProducts().add(product);
}
else {
basket.setProducts(new ArrayList<>());
basket.getProducts().add(product);
}
basketRepository.save(basket);
basket = basketRepository.findOne(basketId);
return new ResponseEntity<>(basket, null, HttpStatus.OK);
}
@RequestMapping(value = "/{basketId}/remove/{productId}", method = RequestMethod.DELETE)
ResponseEntity<Basket> remove(@PathVariable String basketId, @PathVariable String productId) {
log.debug("Basket #"+basketId+" Add Product#"+productId);
Product product = productrepository.getProduct(productId);
Basket basket = basketRepository.findOne(basketId);
if (basket.getProducts() != null) {
basket.getProducts().remove(product);
}
basketRepository.save(basket);
basket = basketRepository.findOne(basketId);
return new ResponseEntity<>(basket, null, HttpStatus.OK);
}
@RequestMapping(value = "/{basketId}/empty", method = RequestMethod.POST)
ResponseEntity<Basket> empty(@PathVariable String basketId) {
log.debug("Basket #"+basketId+" Emptying");
Basket basket = basketRepository.findOne(basketId);
if (basket.getProducts() != null) {
basket.getProducts().clear();
}
basketRepository.save(basket);
basket = basketRepository.findOne(basketId);
return new ResponseEntity<>(basket, null, HttpStatus.OK);
}
@RequestMapping(value = "/{basketId}", method = RequestMethod.GET)
ResponseEntity<Basket> get(@PathVariable String basketId) {
log.debug("Get basket : "+basketId);
Basket basket = basketRepository.findOne(basketId);
return new ResponseEntity<>(basket, null, HttpStatus.OK);
}
@RequestMapping(value = "/list", method = RequestMethod.GET)
ResponseEntity<List<Basket>> list() {
log.debug("List baskets");
List<Basket> baskets = basketRepository.findAll();
return new ResponseEntity<>(baskets, null, HttpStatus.OK);
}
}
|
justindav1s/spring-boot-cloud
|
basket/src/main/java/com/ib/booking/basket/controller/BasketController.java
|
Java
|
apache-2.0
| 4,627
|
## Getting started on [CoreOS](http://coreos.com)
There are multiple guides on running QingYuan with [CoreOS](http://coreos.com):
* [Single Node Cluster](coreos/coreos_single_node_cluster.md)
* [Multi-node Cluster](coreos/coreos_multinode_cluster.md)
* [Setup Multi-node Cluster on GCE in an easy way](https://github.com/rimusz/coreos-multi-node-k8s-gce/blob/master/README.md)
* [Multi-node cluster using cloud-config and Weave on Vagrant](https://github.com/errordeveloper/weave-demos/blob/master/poseidon/README.md)
* [Multi-node cluster using cloud-config and Vagrant](https://github.com/pires/qingyuan-vagrant-coreos-cluster/blob/master/README.md)
* [Yet another multi-node cluster using cloud-config and Vagrant](https://github.com/AntonioMeireles/qingyuan-vagrant-coreos-cluster/blob/master/README.md) (similar to the one above but with an increased, more *aggressive* focus on features and flexibility)
* [Multi-node cluster with Vagrant and fleet units using a small OS X App](https://github.com/rimusz/coreos-osx-gui-qingyuan-cluster/blob/master/README.md)
* [Resizable multi-node cluster on Azure with Weave](coreos/azure/README.md)
[]()
|
qingyuancloud/qingyuan
|
docs/getting-started-guides/coreos.md
|
Markdown
|
apache-2.0
| 1,265
|
package controller
import "fmt"
import "html/template"
import "net/http"
import . "model"
func Deploy(response http.ResponseWriter, request *http.Request) {
liumiaocn := Person{Id: 1001, Name: "liumiaocn", Country: "China"}
tmpl, err := template.ParseFiles("./view/deploy.html")
if err != nil {
fmt.Println("Error happened..")
}
tmpl.Execute(response, liumiaocn)
}
|
liumiaocn/goal
|
src/controller/Deploy.go
|
GO
|
apache-2.0
| 375
|
<!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_67) on Sun Sep 07 15:29:30 CEST 2014 -->
<title>CQL3Type (apache-cassandra API)</title>
<meta name="date" content="2014-09-07">
<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="CQL3Type (apache-cassandra 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 class="navBarCell1Rev">Class</li>
<li><a href="class-use/CQL3Type.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../org/apache/cassandra/cql3/CQL3Row.RowIterator.html" title="interface in org.apache.cassandra.cql3"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../../org/apache/cassandra/cql3/CQL3Type.Collection.html" title="class in org.apache.cassandra.cql3"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/apache/cassandra/cql3/CQL3Type.html" target="_top">Frames</a></li>
<li><a href="CQL3Type.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary: </li>
<li><a href="#nested_class_summary">Nested</a> | </li>
<li>Field | </li>
<li>Constr | </li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li>Field | </li>
<li>Constr | </li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">org.apache.cassandra.cql3</div>
<h2 title="Interface CQL3Type" class="title">Interface CQL3Type</h2>
</div>
<div class="contentContainer">
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Known Implementing Classes:</dt>
<dd><a href="../../../../org/apache/cassandra/cql3/CQL3Type.Collection.html" title="class in org.apache.cassandra.cql3">CQL3Type.Collection</a>, <a href="../../../../org/apache/cassandra/cql3/CQL3Type.Custom.html" title="class in org.apache.cassandra.cql3">CQL3Type.Custom</a>, <a href="../../../../org/apache/cassandra/cql3/CQL3Type.Native.html" title="enum in org.apache.cassandra.cql3">CQL3Type.Native</a>, <a href="../../../../org/apache/cassandra/cql3/CQL3Type.Tuple.html" title="class in org.apache.cassandra.cql3">CQL3Type.Tuple</a>, <a href="../../../../org/apache/cassandra/cql3/CQL3Type.UserDefined.html" title="class in org.apache.cassandra.cql3">CQL3Type.UserDefined</a></dd>
</dl>
<hr>
<br>
<pre>public interface <span class="strong">CQL3Type</span></pre>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== NESTED CLASS SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="nested_class_summary">
<!-- -->
</a>
<h3>Nested Class Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Nested Class Summary table, listing nested classes, and an explanation">
<caption><span>Nested Classes</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Interface and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static class </code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/cassandra/cql3/CQL3Type.Collection.html" title="class in org.apache.cassandra.cql3">CQL3Type.Collection</a></strong></code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static class </code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/cassandra/cql3/CQL3Type.Custom.html" title="class in org.apache.cassandra.cql3">CQL3Type.Custom</a></strong></code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static class </code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/cassandra/cql3/CQL3Type.Native.html" title="enum in org.apache.cassandra.cql3">CQL3Type.Native</a></strong></code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static class </code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/cassandra/cql3/CQL3Type.Raw.html" title="class in org.apache.cassandra.cql3">CQL3Type.Raw</a></strong></code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static class </code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/cassandra/cql3/CQL3Type.Tuple.html" title="class in org.apache.cassandra.cql3">CQL3Type.Tuple</a></strong></code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static class </code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/cassandra/cql3/CQL3Type.UserDefined.html" title="class in org.apache.cassandra.cql3">CQL3Type.UserDefined</a></strong></code> </td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method_summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span>Methods</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../org/apache/cassandra/db/marshal/AbstractType.html" title="class in org.apache.cassandra.db.marshal">AbstractType</a><?></code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/cassandra/cql3/CQL3Type.html#getType()">getType</a></strong>()</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/cassandra/cql3/CQL3Type.html#isCollection()">isCollection</a></strong>()</code> </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="isCollection()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isCollection</h4>
<pre>boolean isCollection()</pre>
</li>
</ul>
<a name="getType()">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>getType</h4>
<pre><a href="../../../../org/apache/cassandra/db/marshal/AbstractType.html" title="class in org.apache.cassandra.db.marshal">AbstractType</a><?> getType()</pre>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!-- -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/CQL3Type.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../org/apache/cassandra/cql3/CQL3Row.RowIterator.html" title="interface in org.apache.cassandra.cql3"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../../org/apache/cassandra/cql3/CQL3Type.Collection.html" title="class in org.apache.cassandra.cql3"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/apache/cassandra/cql3/CQL3Type.html" target="_top">Frames</a></li>
<li><a href="CQL3Type.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary: </li>
<li><a href="#nested_class_summary">Nested</a> | </li>
<li>Field | </li>
<li>Constr | </li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li>Field | </li>
<li>Constr | </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 © 2014 The Apache Software Foundation</small></p>
</body>
</html>
|
varunmc/cassandra-server
|
apache-cassandra-2.1.0/javadoc/org/apache/cassandra/cql3/CQL3Type.html
|
HTML
|
apache-2.0
| 10,439
|
package org.act.tstream.ui.model;
/**
* componentpage:ComponentSummary
*
* @author xin.zhou
*
*/
import java.io.Serializable;
public class ComponentSummary implements Serializable {
private static final long serialVersionUID = 681219575043845569L;
private String componentId;
private String topologyname;
private String parallelism;
public ComponentSummary() {
}
public String getComponentId() {
return componentId;
}
public void setComponentId(String componentId) {
this.componentId = componentId;
}
public String getTopologyname() {
return topologyname;
}
public void setTopologyname(String topologyname) {
this.topologyname = topologyname;
}
public String getParallelism() {
return parallelism;
}
public void setParallelism(String parallelism) {
this.parallelism = parallelism;
}
}
|
greeenSY/Tstream
|
tstream-ui/src/main/java/org/act/tstream/ui/model/ComponentSummary.java
|
Java
|
apache-2.0
| 876
|
package com.example.rubi.projectsgs;
import android.content.Intent;
import android.net.Uri;
import android.webkit.WebView;
import android.webkit.WebViewClient;
/**
* Created by Rubi on 13/04/2015.
*/
public class YtbClient extends WebViewClient {
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
if(Uri.parse(url).getHost().endsWith("www.youtube.com")) {
return false;
}
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
view.getContext().startActivity(intent);
return true;
}
}
|
itctillage/Projectsgs
|
app/src/main/java/com/example/rubi/projectsgs/YtbClient.java
|
Java
|
apache-2.0
| 592
|
package lb.themike10452.purityu2d;
import android.animation.ValueAnimator;
import android.app.Activity;
import android.app.NotificationManager;
import android.app.ProgressDialog;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageButton;
import android.widget.ProgressBar;
import android.widget.SeekBar;
import android.widget.Switch;
import android.widget.TextView;
import android.widget.Toast;
import com.themike10452.purityu2d.R;
import java.io.File;
import java.util.ArrayList;
import lb.themike10452.purityu2d.filebrowser.FileBrowser;
/**
* Created by Mike on 4/15/2015.
*/
public class InstallationActivity extends Activity {
public static String EXTRA_INITIAL_ZIP = "extra_initial_zip";
private Activity mActivity;
private ArrayList<ViewHolder> queue;
private ProgressBar progressBar;
private SeekBar seekBar;
private SharedPreferences preferences;
private ViewGroup queueList;
@Override
protected void onStart() {
super.onStart();
NotificationManager manager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
manager.cancel(Keys.TAG_NOTIF, 3721);
manager.cancel(Keys.TAG_NOTIF, 3722);
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
if (item.getItemId() == android.R.id.home) {
if (MainActivity.preferences != null) {
onBackPressed();
} else {
Intent i = new Intent(this, MainActivity.class);
i.setAction(Intent.ACTION_MAIN);
i.addCategory(Intent.CATEGORY_LAUNCHER);
startActivity(i);
}
return true;
}
return false;
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
overridePendingTransition(R.anim.slide_in_rtl, R.anim.slide_out_rtl);
setContentView(R.layout.install);
assert getActionBar() != null;
getActionBar().setDisplayHomeAsUpEnabled(true);
mActivity = this;
preferences = getSharedPreferences(Keys.SharedPrefsKey, MODE_PRIVATE);
queue = new ArrayList<>();
progressBar = (ProgressBar) findViewById(R.id.progressBar);
queueList = (ViewGroup) findViewById(R.id.queueList);
seekBar = (SeekBar) findViewById(R.id.install_slider);
findViewById(R.id.button_add).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (queueList.getChildCount() <= 10) {
addFileToQueue();
} else {
Toast.makeText(mActivity.getApplicationContext(), "10/10", Toast.LENGTH_SHORT).show();
}
}
});
seekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
@Override
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
}
@Override
public void onStartTrackingTouch(SeekBar seekBar) {
}
@Override
public void onStopTrackingTouch(final SeekBar seekBar) {
if (seekBar.getProgress() < seekBar.getMax()) {
resetSlider(seekBar);
} else {
final ProgressDialog dialog = new ProgressDialog(InstallationActivity.this);
dialog.setIndeterminate(true);
dialog.setCancelable(false);
dialog.setMessage(getString(R.string.msg_pleaseWait));
dialog.show();
seekBar.postDelayed(new Runnable() {
@Override
public void run() {
resetSlider(seekBar);
if (dialog.isShowing()) {
dialog.dismiss();
}
}
}, 10000);
rebootAndInstall();
}
}
});
if (getIntent().hasExtra(EXTRA_INITIAL_ZIP)) {
addFileToQueue(getIntent().getStringExtra(EXTRA_INITIAL_ZIP));
}
onPostQueueModification();
}
@Override
public void onBackPressed() {
super.onBackPressed();
finish();
}
private void rebootAndInstall() {
Switch backupKernel = (Switch) findViewById(R.id.switch_restoreKernel);
Switch wipeCache = (Switch) findViewById(R.id.switch_wipeCache);
Switch wipeDalvik = (Switch) findViewById(R.id.switch_wipeDalvik);
Switch factoryReset = (Switch) findViewById(R.id.switch_wipeData);
int FLAGS = 0;
if (backupKernel.isChecked())
FLAGS = addFlag(FLAGS, RecoveryScriptHandler.FLAG_MAINTAIN_KERNEL);
if (factoryReset.isChecked()) {
FLAGS = addFlag(FLAGS, RecoveryScriptHandler.FLAG_WIPE_DATA);
FLAGS = addFlag(FLAGS, RecoveryScriptHandler.FLAG_WIPE_CACHE);
FLAGS = addFlag(FLAGS, RecoveryScriptHandler.FLAG_WIPE_DALVIK);
} else {
if (wipeCache.isChecked())
FLAGS = addFlag(FLAGS, RecoveryScriptHandler.FLAG_WIPE_CACHE);
if (wipeDalvik.isChecked())
FLAGS = addFlag(FLAGS, RecoveryScriptHandler.FLAG_WIPE_DALVIK);
}
int size;
String[] FILES = new String[size = queue.size()];
for (int i = 0; i < size; i++) {
FILES[i] = queue.get(i).absolutePath;
}
RecoveryScriptHandler.FLAGS = FLAGS;
RecoveryScriptHandler.FILES = FILES;
RecoveryScriptHandler.flush(getApplicationContext());
}
private int addFlag(int flags, int flag) {
return flags | flag;
}
private void addFileToQueue() {
Intent intent = new Intent(mActivity, FileBrowser.class);
intent.putExtra(FileBrowser.EXTRA_START_DIRECTORY, preferences.getString(Keys.KEY_SETTINGS_DOWNLOADLOCATION, ""));
intent.putExtra(FileBrowser.EXTRA_SHOW_FOLDERS_ONLY, false);
intent.putExtra(FileBrowser.EXTRA_ALLOWED_EXTENSIONS, new String[]{"zip"});
startActivity(intent);
BroadcastReceiver receiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
unregisterReceiver(this);
if (FileBrowser.ACTION_FILE_SELECTED.equals(intent.getAction())) {
addFileToQueue(intent.getStringExtra("file"));
}
}
};
IntentFilter filter = new IntentFilter(FileBrowser.ACTION_FILE_SELECTED);
filter.addAction(FileBrowser.ACTION_CANCELED);
registerReceiver(receiver, filter);
}
private void addFileToQueue(String filePath) {
final View view = getLayoutInflater().inflate(R.layout.queue_item, null, false);
final ViewHolder holder = new ViewHolder();
holder.textView = (TextView) view.findViewById(R.id.text);
holder.button = (ImageButton) view.findViewById(R.id.button_remove);
holder.absolutePath = filePath;
holder.tag = holder.toString();
holder.textView.setText(filePath.substring(filePath.lastIndexOf(File.separator) + 1));
holder.button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
queueList.removeView(view);
queue.remove(holder);
onPostQueueModification();
}
});
queue.add(holder);
queueList.addView(view);
onPostQueueModification();
}
private void setQueueProgress(int progress) {
int currentProgress;
if (progress >= 0 && progress != (currentProgress = progressBar.getProgress())) {
ValueAnimator animator = ValueAnimator.ofInt(currentProgress, progress * 100);
animator.setDuration(1000);
animator.setStartDelay(200);
animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
progressBar.setProgress((Integer) animation.getAnimatedValue());
}
});
animator.start();
}
}
private void onPostQueueModification() {
setQueueProgress((queueList.getChildCount() - 1));
if (queue.size() == 0) {
seekBar.setEnabled(false);
queueList.getChildAt(0).setVisibility(View.VISIBLE);
} else {
seekBar.setEnabled(true);
queueList.getChildAt(0).setVisibility(View.GONE);
}
}
private void resetSlider(final SeekBar seekBar) {
ValueAnimator animator = ValueAnimator.ofInt(seekBar.getProgress(), 0);
animator.setDuration(500);
animator.setStartDelay(100);
animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
seekBar.setProgress((Integer) animation.getAnimatedValue());
}
});
animator.start();
}
private class ViewHolder {
String tag;
String absolutePath;
TextView textView;
ImageButton button;
}
}
|
themike10452/Purity_U2D
|
PurityU2D/src/main/java/lb/themike10452/PurityU2D/InstallationActivity.java
|
Java
|
apache-2.0
| 9,711
|
package com.lucadev.mcprotocol.util;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.util.zip.DataFormatException;
import java.util.zip.Deflater;
import java.util.zip.Inflater;
/**
* Zlib packets compression.
* https://qupera.blogspot.nl/2013/02/howto-compress-and-uncompress-java-byte.html
*/
public class CompressionUtil {
public int compress(int varint) {
Deflater comp = new Deflater();
return 0;
}
public int compressedLength(int varint) {
return 0;
}
public static byte[] compress(byte[] data) throws IOException {
Deflater deflater = new Deflater();
deflater.setInput(data);
ByteArrayOutputStream outputStream = new ByteArrayOutputStream(data.length);
deflater.finish();
byte[] buffer = new byte[1024];
while (!deflater.finished()) {
int count = deflater.deflate(buffer); // returns the generated code... index
outputStream.write(buffer, 0, count);
}
outputStream.close();
byte[] output = outputStream.toByteArray();
deflater.end();
return output;
}
public static byte[] decompress(byte[] data) throws IOException {
Inflater inflater = new Inflater();
inflater.setInput(data);
ByteArrayOutputStream outputStream = new ByteArrayOutputStream(data.length);
byte[] buffer = new byte[1024];
while (!inflater.finished()) {
int count = 0;
try {
count = inflater.inflate(buffer);
} catch (DataFormatException e) {
e.printStackTrace();
}
outputStream.write(buffer, 0, count);
}
outputStream.close();
byte[] output = outputStream.toByteArray();
inflater.end();
return output;
}
}
|
Camphul/MCProtocol
|
src/main/java/com/lucadev/mcprotocol/util/CompressionUtil.java
|
Java
|
apache-2.0
| 1,863
|
module Contrail
VERSION = "0.0.1"
end
|
JNPRAutomate/contrail-gem
|
lib/contrail/version.rb
|
Ruby
|
apache-2.0
| 40
|
class CreateStates < ActiveRecord::Migration
def change
create_table :states do |t|
t.string :state_code, :limit=>20
t.string :country_code, :limit=>2
t.string :name
t.string :path
t.integer :priority
t.timestamps
end
end
end
|
matthucke/graveyards4
|
db/migrate/20140413154006_create_states.rb
|
Ruby
|
apache-2.0
| 275
|
<!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_111) on Wed Jan 04 22:31:33 EST 2017 -->
<title>Uses of Class org.drip.sequence.functional.IdempotentUnivariateRandom</title>
<meta name="date" content="2017-01-04">
<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 org.drip.sequence.functional.IdempotentUnivariateRandom";
}
}
catch(err) {
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="../package-summary.html">Package</a></li>
<li><a href="../../../../../org/drip/sequence/functional/IdempotentUnivariateRandom.html" title="class in org.drip.sequence.functional">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-files/index-1.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/drip/sequence/functional/class-use/IdempotentUnivariateRandom.html" target="_top">Frames</a></li>
<li><a href="IdempotentUnivariateRandom.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.drip.sequence.functional.IdempotentUnivariateRandom" class="title">Uses of Class<br>org.drip.sequence.functional.IdempotentUnivariateRandom</h2>
</div>
<div class="classUseContainer">
<ul class="blockList">
<li class="blockList">
<table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing packages, and an explanation">
<caption><span>Packages that use <a href="../../../../../org/drip/sequence/functional/IdempotentUnivariateRandom.html" title="class in org.drip.sequence.functional">IdempotentUnivariateRandom</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Package</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><a href="#org.drip.sequence.functional">org.drip.sequence.functional</a></td>
<td class="colLast"> </td>
</tr>
</tbody>
</table>
</li>
<li class="blockList">
<ul class="blockList">
<li class="blockList"><a name="org.drip.sequence.functional">
<!-- -->
</a>
<h3>Uses of <a href="../../../../../org/drip/sequence/functional/IdempotentUnivariateRandom.html" title="class in org.drip.sequence.functional">IdempotentUnivariateRandom</a> in <a href="../../../../../org/drip/sequence/functional/package-summary.html">org.drip.sequence.functional</a></h3>
<table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing subclasses, and an explanation">
<caption><span>Subclasses of <a href="../../../../../org/drip/sequence/functional/IdempotentUnivariateRandom.html" title="class in org.drip.sequence.functional">IdempotentUnivariateRandom</a> in <a href="../../../../../org/drip/sequence/functional/package-summary.html">org.drip.sequence.functional</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Class and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code>class </code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/drip/sequence/functional/BinaryIdempotentUnivariateRandom.html" title="class in org.drip.sequence.functional">BinaryIdempotentUnivariateRandom</a></span></code>
<div class="block">BinaryIdempotentUnivariateRandom contains the Implementation of the Objective Function dependent on
Binary Idempotent Univariate Random Variable.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>class </code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/drip/sequence/functional/BoundedIdempotentUnivariateRandom.html" title="class in org.drip.sequence.functional">BoundedIdempotentUnivariateRandom</a></span></code>
<div class="block">BoundedIdempotentUnivariateRandom contains the Implementation of the Objective Function dependent on
Bounded Idempotent Univariate Random Variable.</div>
</td>
</tr>
</tbody>
</table>
</li>
</ul>
</li>
</ul>
</div>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="../package-summary.html">Package</a></li>
<li><a href="../../../../../org/drip/sequence/functional/IdempotentUnivariateRandom.html" title="class in org.drip.sequence.functional">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-files/index-1.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/drip/sequence/functional/class-use/IdempotentUnivariateRandom.html" target="_top">Frames</a></li>
<li><a href="IdempotentUnivariateRandom.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 ======= -->
</body>
</html>
|
lakshmiDRIP/DRIP
|
Javadoc/org/drip/sequence/functional/class-use/IdempotentUnivariateRandom.html
|
HTML
|
apache-2.0
| 7,333
|
# Copyright The Cloud Custodian Authors.
# SPDX-License-Identifier: Apache-2.0
from .common import BaseTest
import jmespath
class TestApacheAirflow(BaseTest):
def test_airflow_environment_value_filter(self):
session_factory = self.replay_flight_data('test_airflow_environment_value_filter')
p = self.load_policy(
{
"name": "airflow-name-filter",
"resource": "airflow",
"filters": [
{
"type": "value",
"key": "Name",
"op": "eq",
"value": "testEnvironment",
}
]
},
session_factory=session_factory,
)
resources = p.run()
self.assertEqual(len(resources), 1)
self.assertEqual(resources[0]['Name'], 'testEnvironment')
self.assertEqual(resources[0]['c7n:MatchedFilters'], ['Name'])
def test_airflow_environment_kms_filter(self):
session_factory = self.replay_flight_data('test_airflow_environment_kms_filter')
kms = session_factory().client('kms')
expression = 'KmsKey'
p = self.load_policy(
{
"name": "airflow-kms-filter",
"resource": "airflow",
"filters": [
{
"type": "kms-key",
"key": "c7n:AliasName",
"value": "alias/mwaa",
}
]
},
session_factory=session_factory,
)
resources = p.run()
self.assertTrue(len(resources), 1)
aliases = kms.list_aliases(KeyId=(jmespath.search(expression, resources[0])))
self.assertEqual(aliases['Aliases'][0]['AliasName'], 'alias/mwaa')
def test_airflow_environment_tag(self):
session_factory = self.replay_flight_data('test_airflow_environment_tag')
new_tag = {'env': 'dev'}
p = self.load_policy(
{
'name': 'airflow-tag',
'resource': 'airflow',
'filters': [{
'tag:env': 'absent'
}],
'actions': [{
'type': 'tag',
'tags': new_tag
}]
},
session_factory=session_factory
)
resources = p.run()
self.assertEqual(1, len(resources))
name = resources[0].get('Name')
airflow = session_factory().client('mwaa')
call = airflow.get_environment(Name=name)
self.assertEqual(new_tag, call['Environment'].get('Tags'))
def test_airflow_environment_untag(self):
session_factory = self.replay_flight_data('test_airflow_environment_untag')
p = self.load_policy(
{
'name': 'airflow-untag',
'resource': 'airflow',
'filters': [{
'tag:env': 'dev'
}],
'actions': [{
'type': 'remove-tag',
'tags': ['env']
}]
},
session_factory=session_factory
)
resources = p.run()
self.assertEqual(1, len(resources))
name = resources[0].get('Name')
airflow = session_factory().client('mwaa')
call = airflow.get_environment(Name=name)
self.assertEqual({}, call['Environment'].get('Tags'))
|
thisisshi/cloud-custodian
|
tests/test_airflow.py
|
Python
|
apache-2.0
| 3,504
|
/*!
* Bootstrap-select v1.6.4 (http://silviomoreto.github.io/bootstrap-select)
*
* Copyright 2013-2015 bootstrap-select
* Licensed under MIT (https://github.com/silviomoreto/bootstrap-select/blob/master/LICENSE)
*/
(function ($) {
$.fn.selectpicker.defaults = {
noneSelectedText: 'Nu a fost selectat nimic',
noneResultsText: 'Nu exista niciun rezultat {0}',
countSelectedText: '{0} din {1} selectat(e)',
maxOptionsText: ['Limita a fost atinsa ({n} {var} max)', 'Limita de grup a fost atinsa ({n} {var} max)', ['iteme', 'item']],
multipleSeparator: ', '
};
})(jQuery);
|
qorio/maestro
|
clients/sing-angular/vendor/bootstrap-select/dist/js/i18n/defaults-ro_RO.js
|
JavaScript
|
apache-2.0
| 612
|
/*
* Copyright 2010-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
using System;
using System.Net;
using Amazon.Redshift.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
namespace Amazon.Redshift.Model.Internal.MarshallTransformations
{
/// <summary>
/// Response Unmarshaller for CopyClusterSnapshot operation
/// </summary>
internal class CopyClusterSnapshotResponseUnmarshaller : XmlResponseUnmarshaller
{
public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context)
{
CopyClusterSnapshotResponse response = new CopyClusterSnapshotResponse();
while (context.Read())
{
if (context.IsStartElement)
{
if(context.TestExpression("CopyClusterSnapshotResult", 2))
{
response.CopyClusterSnapshotResult = CopyClusterSnapshotResultUnmarshaller.GetInstance().Unmarshall(context);
continue;
}
if (context.TestExpression("ResponseMetadata", 2))
{
response.ResponseMetadata = ResponseMetadataUnmarshaller.GetInstance().Unmarshall(context);
}
}
}
return response;
}
public override AmazonServiceException UnmarshallException(XmlUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode)
{
ErrorResponse errorResponse = ErrorResponseUnmarshaller.GetInstance().Unmarshall(context);
if (errorResponse.Code != null && errorResponse.Code.Equals("ClusterSnapshotAlreadyExists"))
{
return new ClusterSnapshotAlreadyExistsException(errorResponse.Message, innerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, statusCode);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("ClusterSnapshotNotFound"))
{
return new ClusterSnapshotNotFoundException(errorResponse.Message, innerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, statusCode);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("ClusterSnapshotQuotaExceeded"))
{
return new ClusterSnapshotQuotaExceededException(errorResponse.Message, innerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, statusCode);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("InvalidClusterSnapshotState"))
{
return new InvalidClusterSnapshotStateException(errorResponse.Message, innerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, statusCode);
}
return new AmazonRedshiftException(errorResponse.Message, innerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, statusCode);
}
private static CopyClusterSnapshotResponseUnmarshaller instance;
public static CopyClusterSnapshotResponseUnmarshaller GetInstance()
{
if (instance == null)
{
instance = new CopyClusterSnapshotResponseUnmarshaller();
}
return instance;
}
}
}
|
emcvipr/dataservices-sdk-dotnet
|
AWSSDK/Amazon.Redshift/Model/Internal/MarshallTransformations/CopyClusterSnapshotResponseUnmarshaller.cs
|
C#
|
apache-2.0
| 4,074
|
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<link rel="SHORTCUT ICON" href="../../../../../img/clover.ico" />
<link rel="stylesheet" href="../../../../../aui/css/aui.min.css" media="all"/>
<link rel="stylesheet" href="../../../../../aui/css/aui-experimental.min.css" media="all"/>
<!--[if IE 9]><link rel="stylesheet" href="../../../../../aui/css/aui-ie9.min.css" media="all"/><![endif]-->
<style type="text/css" media="all">
@import url('../../../../../style.css');
@import url('../../../../../tree.css');
</style>
<script src="../../../../../jquery-1.8.3.min.js" type="text/javascript"></script>
<script src="../../../../../aui/js/aui.min.js" type="text/javascript"></script>
<script src="../../../../../aui/js/aui-experimental.min.js" type="text/javascript"></script>
<script src="../../../../../aui/js/aui-soy.min.js" type="text/javascript"></script>
<script src="../../../../../package-nodes-tree.js" type="text/javascript"></script>
<script src="../../../../../clover-tree.js" type="text/javascript"></script>
<script src="../../../../../clover.js" type="text/javascript"></script>
<script src="../../../../../clover-descriptions.js" type="text/javascript"></script>
<script src="../../../../../cloud.js" type="text/javascript"></script>
<title>ABA Route Transit Number Validator 1.0.1-SNAPSHOT</title>
</head>
<body>
<div id="page">
<header id="header" role="banner">
<nav class="aui-header aui-dropdown2-trigger-group" role="navigation">
<div class="aui-header-inner">
<div class="aui-header-primary">
<h1 id="logo" class="aui-header-logo aui-header-logo-clover">
<a href="http://openclover.org" title="Visit OpenClover home page"><span class="aui-header-logo-device">OpenClover</span></a>
</h1>
</div>
<div class="aui-header-secondary">
<ul class="aui-nav">
<li id="system-help-menu">
<a class="aui-nav-link" title="Open online documentation" target="_blank"
href="http://openclover.org/documentation">
<span class="aui-icon aui-icon-small aui-iconfont-help"> Help</span>
</a>
</li>
</ul>
</div>
</div>
</nav>
</header>
<div class="aui-page-panel">
<div class="aui-page-panel-inner">
<div class="aui-page-panel-nav aui-page-panel-nav-clover">
<div class="aui-page-header-inner" style="margin-bottom: 20px;">
<div class="aui-page-header-image">
<a href="http://cardatechnologies.com" target="_top">
<div class="aui-avatar aui-avatar-large aui-avatar-project">
<div class="aui-avatar-inner">
<img src="../../../../../img/clover_logo_large.png" alt="Clover icon"/>
</div>
</div>
</a>
</div>
<div class="aui-page-header-main" >
<h1>
<a href="http://cardatechnologies.com" target="_top">
ABA Route Transit Number Validator 1.0.1-SNAPSHOT
</a>
</h1>
</div>
</div>
<nav class="aui-navgroup aui-navgroup-vertical">
<div class="aui-navgroup-inner">
<ul class="aui-nav">
<li class="">
<a href="../../../../../dashboard.html">Project overview</a>
</li>
</ul>
<div class="aui-nav-heading packages-nav-heading">
<strong>Packages</strong>
</div>
<div class="aui-nav project-packages">
<form method="get" action="#" class="aui package-filter-container">
<input type="text" autocomplete="off" class="package-filter text"
placeholder="Type to filter packages..." name="package-filter" id="package-filter"
title="Start typing package name (or part of the name) to search through the tree. Use arrow keys and the Enter key to navigate."/>
</form>
<p class="package-filter-no-results-message hidden">
<small>No results found.</small>
</p>
<div class="packages-tree-wrapper" data-root-relative="../../../../../" data-package-name="com.cardatechnologies.utils.validators.abaroutevalidator">
<div class="packages-tree-container"></div>
<div class="clover-packages-lozenges"></div>
</div>
</div>
</div>
</nav> </div>
<section class="aui-page-panel-content">
<div class="aui-page-panel-content-clover">
<div class="aui-page-header-main"><ol class="aui-nav aui-nav-breadcrumbs">
<li><a href="../../../../../dashboard.html"> Project Clover database Sat Aug 7 2021 12:29:33 MDT</a></li>
<li><a href="test-pkg-summary.html">Package com.cardatechnologies.utils.validators.abaroutevalidator</a></li>
<li><a href="test-Test_AbaRouteValidator_13a.html">Class Test_AbaRouteValidator_13a</a></li>
</ol></div>
<h1 class="aui-h2-clover">
Test testAbaNumberCheck_25546_bad
</h1>
<table class="aui">
<thead>
<tr>
<th>Test</th>
<th><label title="The test result. Either a Pass, Fail or Error.">Status</label></th>
<th><label title="When the test execution was started">Start time</label></th>
<th><label title="The total time in seconds taken to run this test.">Time (seconds)</label></th>
<th><label title="A failure or error message if the test is not successful.">Message</label></th>
</tr>
</thead>
<tbody>
<tr>
<td>
<a href="../../../../../com/cardatechnologies/utils/validators/abaroutevalidator/Test_AbaRouteValidator_13a.html?line=13169#src-13169" >testAbaNumberCheck_25546_bad</a>
</td>
<td>
<span class="sortValue">1</span><span class="aui-lozenge aui-lozenge-success">PASS</span>
</td>
<td>
7 Aug 12:41:53
</td>
<td>
0.0 </td>
<td>
<div></div>
<div class="errorMessage"></div>
</td>
</tr>
</tbody>
</table>
<div> </div>
<table class="aui aui-table-sortable">
<thead>
<tr>
<th style="white-space:nowrap;"><label title="A class that was directly hit by this test.">Target Class</label></th>
<th colspan="4"><label title="The percentage of coverage contributed by each single test.">Coverage contributed by</label> testAbaNumberCheck_25546_bad</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<span class="sortValue">com.cardatechnologies.utils.validators.abaroutevalidator.exceptions.AbaRouteValidationException</span>
  <a href="../../../../../com/cardatechnologies/utils/validators/abaroutevalidator/exceptions/AbaRouteValidationException.html?id=36853#AbaRouteValidationException" title="AbaRouteValidationException" name="sl-43">com.cardatechnologies.utils.validators.abaroutevalidator.exceptions.AbaRouteValidationException</a>
</td>
<td>
<span class="sortValue">0.5714286</span>57.1%
</td>
<td class="align-middle" style="width: 100%" colspan="3">
<div>
<div title="57.1% Covered" style="min-width:40px;" class="barNegative contribBarNegative contribBarNegative"><div class="barPositive contribBarPositive contribBarPositive" style="width:57.1%"></div></div></div> </td>
</tr>
<tr>
<td>
<span class="sortValue">com.cardatechnologies.utils.validators.abaroutevalidator.ErrorCodes</span>
  <a href="../../../../../com/cardatechnologies/utils/validators/abaroutevalidator/ErrorCodes.html?id=36853#ErrorCodes" title="ErrorCodes" name="sl-42">com.cardatechnologies.utils.validators.abaroutevalidator.ErrorCodes</a>
</td>
<td>
<span class="sortValue">0.5714286</span>57.1%
</td>
<td class="align-middle" style="width: 100%" colspan="3">
<div>
<div title="57.1% Covered" style="min-width:40px;" class="barNegative contribBarNegative contribBarNegative"><div class="barPositive contribBarPositive contribBarPositive" style="width:57.1%"></div></div></div> </td>
</tr>
<tr>
<td>
<span class="sortValue">com.cardatechnologies.utils.validators.abaroutevalidator.AbaRouteValidator</span>
  <a href="../../../../../com/cardatechnologies/utils/validators/abaroutevalidator/AbaRouteValidator.html?id=36853#AbaRouteValidator" title="AbaRouteValidator" name="sl-47">com.cardatechnologies.utils.validators.abaroutevalidator.AbaRouteValidator</a>
</td>
<td>
<span class="sortValue">0.29411766</span>29.4%
</td>
<td class="align-middle" style="width: 100%" colspan="3">
<div>
<div title="29.4% Covered" style="min-width:40px;" class="barNegative contribBarNegative contribBarNegative"><div class="barPositive contribBarPositive contribBarPositive" style="width:29.4%"></div></div></div> </td>
</tr>
</tbody>
</table>
</div> <!-- class="aui-page-panel-content-clover" -->
<footer id="footer" role="contentinfo">
<section class="footer-body">
<ul>
<li>
Report generated by <a target="_new" href="http://openclover.org">OpenClover</a> v 4.4.1
on Sat Aug 7 2021 12:49:26 MDT using coverage data from Sat Aug 7 2021 12:47:23 MDT.
</li>
</ul>
<ul>
<li>OpenClover is free and open-source software. </li>
</ul>
</section>
</footer> </section> <!-- class="aui-page-panel-content" -->
</div> <!-- class="aui-page-panel-inner" -->
</div> <!-- class="aui-page-panel" -->
</div> <!-- id="page" -->
</body>
</html>
|
dcarda/aba.route.validator
|
target13/site/clover/com/cardatechnologies/utils/validators/abaroutevalidator/Test_AbaRouteValidator_13a_testAbaNumberCheck_25546_bad_sfp.html
|
HTML
|
apache-2.0
| 10,990
|
using System;
using System.Diagnostics;
using System.Threading.Tasks;
using GgpGrpc.Models;
using YetiVSI.ProjectSystem.Abstractions;
using YetiVSI.Shared.Metrics;
namespace YetiVSI.Metrics
{
public interface IProjectPropertiesMetricsParser
{
Task<VSIProjectProperties> GetStadiaProjectPropertiesAsync(IAsyncProject project);
}
public class ProjectPropertiesMetricsParser : IProjectPropertiesMetricsParser
{
public async Task<VSIProjectProperties> GetStadiaProjectPropertiesAsync(
IAsyncProject project) =>
new VSIProjectProperties
{
Debugging = new VSIProjectProperties.Types.Debugging
{
DeployExecutableOnLaunch = await GetDeployExecutableOnLaunchAsync(project),
SurfaceEnforcementMode = await GetSurfaceEnforcementModeAsync(project),
LaunchWithRenderDoc = await GetLaunchWithRenderDocAsync(project),
LaunchWithRgp = await GetLaunchWithRgpAsync(project),
VulkanDriverVariant = await GetVulkanDriverVariantAsync(project),
StadiaEndpoint = await GetStadiaEndpointAsync(project)
}
};
async Task<VSIProjectProperties.Types.BoolValue> GetLaunchWithRenderDocAsync(
IAsyncProject project)
{
try
{
return GetBoolValue(await project.GetLaunchWithRenderDocRawAsync());
}
catch (Exception e)
{
Trace.TraceError("Could not get 'Launch with RenderDoc' value.\r\n" +
$"Message: {e.Message}.\r\nStack trace: {e.StackTrace}");
return null;
}
}
async Task<VSIProjectProperties.Types.BoolValue> GetLaunchWithRgpAsync(
IAsyncProject project)
{
try
{
return GetBoolValue(await project.GetLaunchWithRgpRawAsync());
}
catch (Exception e)
{
Trace.TraceError("Could not get 'Launch with RGP' value.\r\n" +
$"Message: {e.Message}.\r\nStack trace: {e.StackTrace}");
return null;
}
}
VSIProjectProperties.Types.BoolValue GetBoolValue(string rawValue)
{
if (string.IsNullOrWhiteSpace(rawValue))
{
return new VSIProjectProperties.Types.BoolValue
{
IsDefault = true,
Value = VSIProjectProperties.Types.BoolValue.Types.Value.BoolNo
};
}
if (!bool.TryParse(rawValue, out bool projectPropertyValue))
{
return new VSIProjectProperties.Types.BoolValue
{
IsDefault = false,
Value = VSIProjectProperties.Types.BoolValue.Types.Value.BoolOther
};
}
return new VSIProjectProperties.Types.BoolValue
{
IsDefault = false,
Value = projectPropertyValue
? VSIProjectProperties.Types.BoolValue.Types.Value.BoolYes
: VSIProjectProperties.Types.BoolValue.Types.Value.BoolNo
};
}
async Task<VSIProjectProperties.Types.Debugging.Types.DeployExecutableOnLaunch?>
GetDeployExecutableOnLaunchAsync(IAsyncProject project)
{
try
{
string rawValue = await project.GetDeployExecutableOnLaunchRawAsync();
if (!Enum.TryParse(rawValue, true, out DeployOnLaunchSetting deployOnLaunch))
{
return string.IsNullOrWhiteSpace(rawValue)
? VSIProjectProperties.Types.Debugging.Types.DeployExecutableOnLaunch
.DeployDefault
: VSIProjectProperties.Types.Debugging.Types.DeployExecutableOnLaunch
.DeployOther;
}
switch (deployOnLaunch)
{
case DeployOnLaunchSetting.ALWAYS:
return VSIProjectProperties.Types.Debugging.Types.DeployExecutableOnLaunch
.YesAlways;
case DeployOnLaunchSetting.DELTA:
return VSIProjectProperties.Types.Debugging.Types.DeployExecutableOnLaunch
.YesBinaryDiff;
case DeployOnLaunchSetting.FALSE:
return VSIProjectProperties.Types.Debugging.Types.DeployExecutableOnLaunch
.DeployNo;
default:
return VSIProjectProperties.Types.Debugging.Types.DeployExecutableOnLaunch
.DeployOther;
}
}
catch (Exception e)
{
Trace.TraceError("Could not get 'Deploy executable on launch' value.\r\n" +
$"Message: {e.Message}.\r\nStack trace: {e.StackTrace}");
return null;
}
}
async Task<VSIProjectProperties.Types.Debugging.Types.SurfaceEnforcement?>
GetSurfaceEnforcementModeAsync(IAsyncProject project)
{
try
{
string rawValue = await project.GetSurfaceEnforcementModeRawAsync();
if (!Enum.TryParse(rawValue, true,
out SurfaceEnforcementSetting surfaceEnforcement))
{
return string.IsNullOrWhiteSpace(rawValue)
? VSIProjectProperties.Types.Debugging.Types.SurfaceEnforcement
.SurfaceDefault
: VSIProjectProperties.Types.Debugging.Types.SurfaceEnforcement
.SurfaceOther;
}
switch (surfaceEnforcement)
{
case SurfaceEnforcementSetting.Block:
return VSIProjectProperties.Types.Debugging.Types.SurfaceEnforcement
.SurfaceBlock;
case SurfaceEnforcementSetting.Off:
return VSIProjectProperties.Types.Debugging.Types.SurfaceEnforcement
.SurfaceOff;
case SurfaceEnforcementSetting.Warn:
return VSIProjectProperties.Types.Debugging.Types.SurfaceEnforcement
.SurfaceWarn;
default:
return VSIProjectProperties.Types.Debugging.Types.SurfaceEnforcement
.SurfaceOther;
}
}
catch (Exception e)
{
Trace.TraceError("Could not get 'Stadia instance surface enforcement' value.\r\n" +
$"Message: {e.Message}.\r\nStack trace: {e.StackTrace}");
return null;
}
}
async Task<VSIProjectProperties.Types.Debugging.Types.VulkanDriverVariant?>
GetVulkanDriverVariantAsync(IAsyncProject project)
{
try
{
string rawValue = await project.GetVulkanDriverVariantRawAsync();
if (string.IsNullOrWhiteSpace(rawValue))
{
return VSIProjectProperties.Types.Debugging.Types.VulkanDriverVariant
.VulkanDefault;
}
if (rawValue == "opt")
{
return VSIProjectProperties.Types.Debugging.Types.VulkanDriverVariant.Optimized;
}
if (rawValue == "optprintasserts")
{
return VSIProjectProperties.Types.Debugging.Types.VulkanDriverVariant
.PrintingAssertions;
}
if (rawValue == "dbgtrapasserts")
{
return VSIProjectProperties.Types.Debugging.Types.VulkanDriverVariant
.TrappingAssertions;
}
return VSIProjectProperties.Types.Debugging.Types.VulkanDriverVariant.VulkanOther;
}
catch (Exception e)
{
Trace.TraceError("Could not get 'Vulkan driver variant' value.\r\n" +
$"Message: {e.Message}.\r\nStack trace: {e.StackTrace}");
return null;
}
}
async Task<VSIProjectProperties.Types.Debugging.Types.StadiaEndpoint?>
GetStadiaEndpointAsync(IAsyncProject project)
{
try
{
string rawValue = await project.GetStadiaEndpointRawAsync();
if (!Enum.TryParse(rawValue, true, out StadiaEndpoint endpoint))
{
return string.IsNullOrWhiteSpace(rawValue)
? VSIProjectProperties.Types.Debugging.Types.StadiaEndpoint.EndpointDefault
: VSIProjectProperties.Types.Debugging.Types.StadiaEndpoint.EndpointOther;
}
switch (endpoint)
{
case StadiaEndpoint.AnyEndpoint:
return VSIProjectProperties.Types.Debugging.Types.StadiaEndpoint
.AnyEndpoint;
case StadiaEndpoint.PlayerEndpoint:
return VSIProjectProperties.Types.Debugging.Types.StadiaEndpoint
.PlayerWebEndpoint;
case StadiaEndpoint.TestClient:
return VSIProjectProperties.Types.Debugging.Types.StadiaEndpoint.TestClient;
default:
return VSIProjectProperties.Types.Debugging.Types.StadiaEndpoint
.EndpointOther;
}
}
catch (Exception e)
{
Trace.TraceError("Could not get 'Stadia Endpoint' value.\r\n" +
$"Message: {e.Message}.\r\nStack trace: {e.StackTrace}");
return null;
}
}
}
}
|
googlestadia/vsi-lldb
|
YetiVSI/Metrics/ProjectPropertiesMetricsParser.cs
|
C#
|
apache-2.0
| 10,324
|
#
# Node snapshot setup file
# https://github.com/turboapps/turbome/tree/master/node/current
#
# Licensed under the Apache License, Version 2.0
# http://www.apache.org/licenses/LICENSE-2.0
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
$content = (Invoke-WebRequest -URI "https://nodejs.org/en/download/current/").Content
$content -match "https://nodejs.org/dist/v(?<version>\d+.\d+.\d+)/node-v\k<version>-x86.msi" | Out-Null
if (-not $Matches) {
Write-Error "Failed to find Node version"
exit 1
}
$tag = $Matches['version']
Write-Host "Node version $tag"
"nodejs/nodejs:$tag" | Set-Content "image.txt"
if(!(Test-Path ".\installFiles")) { New-Item ".\installFiles" -type directory}
(New-Object System.Net.WebClient).DownloadFile("https://nodejs.org/dist/v$tag/node-v$tag-x86.msi", ".\installFiles\install.msi")
|
turboapps/turbome
|
node/current/snapshot.ps1
|
PowerShell
|
apache-2.0
| 856
|
# Agaricus majalis var. majalis VARIETY
#### Status
ACCEPTED
#### According to
Index Fungorum
#### Published in
Observ. mycol. (Havniae) 2: 172 (1818)
#### Original name
Agaricus majalis var. majalis
### Remarks
null
|
mdoering/backbone
|
life/Fungi/Basidiomycota/Agaricomycetes/Agaricales/Entolomataceae/Entoloma/Entoloma saundersii/Agaricus majalis majalis/README.md
|
Markdown
|
apache-2.0
| 221
|
[](https://www.apache.org/licenses/LICENSE-2.0.txt)
[![][NUBOMEDIA Logo]][NUBOMEDIA]
Copyright © 2016 [VTT]. Licensed under [Apache 2.0 License].
jsonrpc-ws-android
==================
This repository contains an Android library for sending JSON-RPC messages over a WebSocket connection.
What is NUBOMEDIA
-----------------
This project is part of [NUBOMEDIA], which is an open source cloud Platform as a
Service (PaaS) which makes possible to integrate Real Time Communications (RTC)
and multimedia through advanced media processing capabilities. The aim of
NUBOMEDIA is to democratize multimedia technologies helping all developers to
include advanced multimedia capabilities into their Web and smartphone
applications in a simple, direct and fast manner. To accomplish that objective,
NUBOMEDIA provides a set of APIs that try to abstract all the low level details
of service deployment, management, and exploitation allowing applications to
transparently scale and adapt to the required load while preserving QoS
guarantees.
Repository structure
--------------------
This repository consists of an Android Studio library project with gradle build scripts.
Documentation
--------------------
Javadoc is available in [Github]. The more detailed Developers Guide and Installation Guide are available at
[project documentation page].
Usage
--------
You can import this project to your own Android Studio project via Maven (jCenter or Maven Central) by adding the following line to module's `build.gradle` file:
```
compile 'fi.vtt.nubomedia:jsonrpc-ws-android:(version-code)'
```
The latest version code of the artifact can be found on [maven artifact page].
Source
------
The source code is available in [Github]
Licensing and distribution
--------------------------
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
[Apache 2.0 License]
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.
Contribution policy
-------------------
You can contribute to the Nubomedia community through bug-reports, bug-fixes, new
code or new documentation. For contributing to the Nubomedia community, drop a
post to the [Nubomedia Public Mailing List] providing full information about your
contribution and its value. In your contributions, you must comply with the
following guidelines
* You must specify the specific contents of your contribution either through a
detailed bug description, through a pull-request or through a patch.
* You must specify the licensing restrictions of the code you contribute.
* For newly created code to be incorporated in the Nubomedia code-base, you must
accept Nubomedia to own the code copyright, so that its open source nature is
guaranteed.
* You must justify appropriately the need and value of your contribution. The
Nubomedia project has no obligations in relation to accepting contributions
from third parties.
* The Nubomedia project leaders have the right of asking for further
explanations, tests or validations of any code contributed to the community
before it being incorporated into the Nubomedia code-base. You must be ready to
addressing all these kind of concerns before having your code approved.
Support
-------
Support is provided through the [Nubomedia Public Mailing List]
[NUBOMEDIA]: http://www.nubomedia.eu
[VTT]: http://www.vtt.fi
[NUBOMEDIA Logo]: http://www.nubomedia.eu/sites/default/files/nubomedia_logo-small.png
[Apache 2.0 License]: https://www.apache.org/licenses/LICENSE-2.0.txt
[Github]: https://github.com/nubomedia-vtt/jsonrpc-ws-android
[Nubomedia Public Mailing List]: https://groups.google.com/forum/#!forum/nubomedia-dev
[project documentation page]: http://jsonrpc-ws-android.readthedocs.org/en/latest/
[maven artifact page]: http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22fi.vtt.nubomedia%22%20AND%20a%3A%22kurento-room-client-android%22
|
nubomedia-vtt/jsonrpc-ws-android
|
README.md
|
Markdown
|
apache-2.0
| 4,291
|
{% extends "horizon_lib/common/_modal_form.html" %}
{% load url from future %}
{% load i18n %}
{% block form_id %}create_cluster_form{% endblock %}
{% block form_action %}{% url 'horizon:project:data_processing.clusters:create' %}{% endblock %}
{% block modal-header %}{% trans "Launch Cluster" %}{% endblock %}
{% block modal-body %}
<div class="left">
<fieldset>
{% include "horizon_lib/common/_form_fields.html" %}
</fieldset>
</div>
{% endblock %}
{% block modal-footer %}
<input class="btn btn-primary pull-right" id="create_cluster_btn" type="submit" value="{% trans " Done" %}"/>
<a href="{% url 'horizon:project:data_processing.clusters:index' %}" class="btn btn-default secondary cancel close">{% trans "Cancel" %}</a>
{% endblock %}
|
mrunge/openstack_horizon
|
openstack_horizon/dashboards/project/data_processing/clusters/templates/data_processing.clusters/_create_cluster.html
|
HTML
|
apache-2.0
| 793
|
package de.peeeq.wurstio.jassinterpreter.providers;
import de.peeeq.wurstio.jassinterpreter.mocks.TriggerMock;
import de.peeeq.wurstscript.intermediatelang.*;
import de.peeeq.wurstscript.intermediatelang.interpreter.AbstractInterpreter;
public class TriggerProvider extends Provider {
public TriggerProvider(AbstractInterpreter interpreter) {
super(interpreter);
}
public IlConstHandle CreateTrigger() {
return new IlConstHandle(NameProvider.getRandomName("trigger"), new TriggerMock());
}
public void DestroyTrigger(IlConstHandle trigger) {
}
public ILconstBool TriggerEvaluate(IlConstHandle trigger) {
return ((TriggerMock) trigger.getObj()).evaluate(interpreter);
}
public void TriggerAddCondition(IlConstHandle trigger, IlConstHandle boolexpr) {
TriggerMock triggerMock = (TriggerMock) trigger.getObj();
triggerMock.addCondition(boolexpr);
}
public void TriggerClearConditions(IlConstHandle trigger) {
TriggerMock triggerMock = (TriggerMock) trigger.getObj();
triggerMock.clearConditions();
}
public void TriggerAddAction(IlConstHandle trigger, ILconstFuncRef code) {
TriggerMock triggerMock = (TriggerMock) trigger.getObj();
triggerMock.addAction(code);
}
public void TriggerRegisterPlayerChatEvent(IlConstHandle trigger, IlConstHandle whichPlayer, ILconstString chatMessageToDetect, ILconstBool
exactMatchOnly) {
TriggerMock triggerMock = (TriggerMock) trigger.getObj();
// TODO
// triggerMock.registerEvent();
}
public void TriggerRegisterVariableEvent(IlConstHandle trigger, ILconstString varName, IlConstHandle opcode, ILconstReal limitval) {
TriggerMock triggerMock = (TriggerMock) trigger.getObj();
// TODO
// triggerMock.registerEvent();
}
public IlConstHandle Condition(ILconstFuncRef code) {
return new IlConstHandle(NameProvider.getRandomName("conditionfunc"), code);
}
public IlConstHandle Filter(ILconstFuncRef code) {
return new IlConstHandle(NameProvider.getRandomName("filterfunc"), code);
}
}
|
wurstscript/WurstScript
|
de.peeeq.wurstscript/src/main/java/de/peeeq/wurstio/jassinterpreter/providers/TriggerProvider.java
|
Java
|
apache-2.0
| 2,162
|
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.5-b10
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2015.06.13 at 03:17:43 PM CST
//
package org.ovirt.engine.api.model;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for Hosts complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="Hosts">
* <complexContent>
* <extension base="{}BaseResources">
* <sequence>
* <element ref="{}host" maxOccurs="unbounded" minOccurs="0"/>
* </sequence>
* </extension>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "Hosts", propOrder = {
"hosts"
})
public class Hosts
extends BaseResources
{
@XmlElement(name = "host")
protected List<Host> hosts;
/**
* Gets the value of the hosts property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the hosts property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getHosts().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link Host }
*
*
*/
public List<Host> getHosts() {
if (hosts == null) {
hosts = new ArrayList<Host>();
}
return this.hosts;
}
public boolean isSetHosts() {
return ((this.hosts!= null)&&(!this.hosts.isEmpty()));
}
public void unsetHosts() {
this.hosts = null;
}
}
|
phoenixsbk/kvmmgr
|
backend/manager/modules/restapi/interface/definition/xjc/org/ovirt/engine/api/model/Hosts.java
|
Java
|
apache-2.0
| 2,318
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="de">
<head>
<!-- Generated by javadoc (version 1.7.0_40) on Wed Aug 20 19:02:55 CEST 2014 -->
<title>org.bulldog.examples Class Hierarchy</title>
<meta name="date" content="2014-08-20">
<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="org.bulldog.examples Class Hierarchy";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!-- -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li>Class</li>
<li class="navBarCell1Rev">Tree</li>
<li><a href="../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../index-all.html">Index</a></li>
<li><a href="../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../org/bulldog/devices/switches/package-tree.html">Prev</a></li>
<li><a href="../../../org/bulldog/linux/gpio/package-tree.html">Next</a></li>
</ul>
<ul class="navList">
<li><a href="../../../index.html?org/bulldog/examples/package-tree.html" target="_top">Frames</a></li>
<li><a href="package-tree.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">
<h1 class="title">Hierarchy For Package org.bulldog.examples</h1>
<span class="strong">Package Hierarchies:</span>
<ul class="horizontal">
<li><a href="../../../overview-tree.html">All Packages</a></li>
</ul>
</div>
<div class="contentContainer">
<h2 title="Class Hierarchy">Class Hierarchy</h2>
<ul>
<li type="circle">java.lang.Object
<ul>
<li type="circle">org.bulldog.examples.<a href="../../../org/bulldog/examples/AdafruitServoDriverExample.html" title="class in org.bulldog.examples"><span class="strong">AdafruitServoDriverExample</span></a></li>
<li type="circle">org.bulldog.examples.<a href="../../../org/bulldog/examples/AdcExample.html" title="class in org.bulldog.examples"><span class="strong">AdcExample</span></a></li>
<li type="circle">org.bulldog.examples.<a href="../../../org/bulldog/examples/App.html" title="class in org.bulldog.examples"><span class="strong">App</span></a></li>
<li type="circle">org.bulldog.examples.<a href="../../../org/bulldog/examples/ButtonExample.html" title="class in org.bulldog.examples"><span class="strong">ButtonExample</span></a></li>
<li type="circle">org.bulldog.examples.<a href="../../../org/bulldog/examples/DigitalOutputExample.html" title="class in org.bulldog.examples"><span class="strong">DigitalOutputExample</span></a></li>
<li type="circle">org.bulldog.examples.<a href="../../../org/bulldog/examples/GPIOExample.html" title="class in org.bulldog.examples"><span class="strong">GPIOExample</span></a></li>
<li type="circle">org.bulldog.examples.<a href="../../../org/bulldog/examples/I2cExample.html" title="class in org.bulldog.examples"><span class="strong">I2cExample</span></a></li>
<li type="circle">org.bulldog.examples.<a href="../../../org/bulldog/examples/LcdExample.html" title="class in org.bulldog.examples"><span class="strong">LcdExample</span></a></li>
<li type="circle">org.bulldog.examples.<a href="../../../org/bulldog/examples/LedExample.html" title="class in org.bulldog.examples"><span class="strong">LedExample</span></a></li>
<li type="circle">org.bulldog.examples.<a href="../../../org/bulldog/examples/PCF8574Example.html" title="class in org.bulldog.examples"><span class="strong">PCF8574Example</span></a></li>
<li type="circle">org.bulldog.examples.<a href="../../../org/bulldog/examples/PinIOGroupExample.html" title="class in org.bulldog.examples"><span class="strong">PinIOGroupExample</span></a></li>
<li type="circle">org.bulldog.examples.<a href="../../../org/bulldog/examples/PwmExample.html" title="class in org.bulldog.examples"><span class="strong">PwmExample</span></a></li>
<li type="circle">org.bulldog.examples.<a href="../../../org/bulldog/examples/RotaryEncoderExample.html" title="class in org.bulldog.examples"><span class="strong">RotaryEncoderExample</span></a></li>
<li type="circle">org.bulldog.examples.<a href="../../../org/bulldog/examples/SerialExample.html" title="class in org.bulldog.examples"><span class="strong">SerialExample</span></a></li>
<li type="circle">org.bulldog.examples.<a href="../../../org/bulldog/examples/ServoExample.html" title="class in org.bulldog.examples"><span class="strong">ServoExample</span></a></li>
<li type="circle">org.bulldog.examples.<a href="../../../org/bulldog/examples/SpiExample.html" title="class in org.bulldog.examples"><span class="strong">SpiExample</span></a></li>
</ul>
</li>
</ul>
</div>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!-- -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li>Class</li>
<li class="navBarCell1Rev">Tree</li>
<li><a href="../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../index-all.html">Index</a></li>
<li><a href="../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../org/bulldog/devices/switches/package-tree.html">Prev</a></li>
<li><a href="../../../org/bulldog/linux/gpio/package-tree.html">Next</a></li>
</ul>
<ul class="navList">
<li><a href="../../../index.html?org/bulldog/examples/package-tree.html" target="_top">Frames</a></li>
<li><a href="package-tree.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 ======= -->
</body>
</html>
|
Datenheld/Bulldog
|
dist/Version-0.1.0/javadoc/org/bulldog/examples/package-tree.html
|
HTML
|
apache-2.0
| 7,063
|
import React, { useState, useEffect } from "react";
import { HexGrid, Layout, Hexagon, Text, GridGenerator } from 'react-hexgrid';
import * as R from 'ramda';
import ProblemsByProject from 'components/ProblemsByProject';
import { LoadingPageNoHeader } from 'pages/_loading';
import { ErrorNoHeader } from 'pages/_error';
import { bp, color } from 'lib/variables';
import './styling.css';
const config = {
"width": 1200,
"height": 100,
"layout": {"width": 4, "height": 4, "flat": false, "spacing": 1.08},
"origin": {"x": 0, "y": 0},
"map": "rectangle",
};
const Honeycomb = ({ data, filter }) => {
const { projectsProblems } = data || [];
const [projects, setProjects] = useState(projects);
const [projectInView, setProjectInView] = useState(false);
const [display, setDisplay] = useState({type: "normal", multiplier: 2});
const generator = GridGenerator.getGenerator(config.map);
const projectCount = projectsProblems && parseInt(projectsProblems.length);
const displayMultiple = display && parseInt(display.multiplier * 8);
let rows = projectsProblems && parseInt(projectCount / displayMultiple);
const hexs = generator.apply(config, [displayMultiple, ++rows]);
const layout = config.layout;
const size = {
x: parseInt(display.hexSize * layout.width),
y: parseInt(display.hexSize * layout.height)
};
const handleHexClick = (project) => {
const {environments, id, name} = project || [];
const problems = environments && environments.filter(e => e instanceof Object).map(e => {
return e.problems;
});
const problemsPerProject = Array.prototype.concat.apply([], problems);
const critical = problemsPerProject.filter(p => p.severity === 'CRITICAL').length;
const high = problemsPerProject.filter(p => p.severity === 'HIGH').length;
const medium = problemsPerProject.filter(p => p.severity === 'MEDIUM').length;
const low = problemsPerProject.filter(p => p.severity === 'LOW').length;
setProjectInView({name: name, environments: environments, severityCount: {critical: critical, high: high, medium: medium, low: low}});
};
const flattenProblems = (project) => {
const {environments} = project || [];
const filterProblems = environments && environments.filter(e => e instanceof Object).map(e => {
return e.problems;
});
return Array.prototype.concat.apply([], filterProblems);
};
const sortByProjects = (projects) => {
return projects && projects.sort((a, b) => {
const aProblems = flattenProblems(a);
const bProblems = flattenProblems(b);
return bProblems.length - aProblems.length;
});
};
const getClassName = (critical) => {
if (critical === 0) { return "no-critical" }
if (critical === 1) { return "light-red" } else
if (critical >= 1 && critical <= 5) { return "red" } else
if (critical >= 5 && critical < 10) { return "dark-red" } else
if (critical >= 10) { return "darker-red" }
};
useEffect(() => {
const count = projectsProblems && projectsProblems.length;
if (count <= 48) setDisplay({type: "normal", multiplier: 2, hexSize: 4, viewBox: "180 -20 100 100"});
if (count >= 49 && count <= 120) setDisplay({type: "small", multiplier: 3, hexSize: 2, viewBox: "125 -20 100 100"});
if (count >= 121 && count <= 384) setDisplay({type: "smaller", multiplier: 4, hexSize: 1, viewBox: "70 -10 100 100"});
if (count >= 385) setDisplay({type: "smallest", multiplier: 5, hexSize: 0.66, viewBox: "30 -10 100 100"});
const filterProjects = !filter.showCleanProjects ? projectsProblems && projectsProblems.filter(p => {
return !R.isEmpty(flattenProblems(p))
}) : projectsProblems && projectsProblems;
const sortProjects = filterProjects && sortByProjects(filterProjects);
setProjects(sortProjects);
}, [projectsProblems, filter]);
return (
<div className="honeycomb-display">
{projects &&
<div className="content-wrapper results">
<div className="content">
<label>Projects: {projects.length}</label>
</div>
</div>
}
{projects &&
<>
<HexGrid width={config.width} height={parseInt(display.multiplier * config.height)} viewBox={display.viewBox}>
<Layout size={size} flat={layout.flat} spacing={layout.spacing} origin={config.origin}>
{hexs.slice(0, projects.length).map((hex, i) => {
const project = projects[i] || null;
const {environments, id, name} = project;
const filterProblems = environments && environments.filter(e => e instanceof Object).map(e => {
return e.problems;
});
const problemsPerProject = Array.prototype.concat.apply([], filterProblems);
const critical = problemsPerProject.filter(p => p.severity === 'CRITICAL').length;
const problemCount = problemsPerProject.length || 0;
const HexText = () => {
const classes = display.type !== "normal" ? "no-text" : 'text';
if (problemsPerProject.length) {
return (<Text className={classes}>
{`P: ${problemCount}, C: ${critical}`}
</Text>);
}
else {
return <Text className={classes}>{`P: ${problemCount}`}</Text>
}
};
return (
<Hexagon key={i} q={hex.q} r={hex.r} s={hex.s} className={getClassName(critical)} onClick={() => handleHexClick(project)}>
<HexText />
</Hexagon>
)})}
</Layout>
</HexGrid>
<div className="project-details">
<div className="content-wrapper">
<div className="content">
{projectInView ?
<>
<div className="project"><label>Project: {projectInView.name}</label></div>
{projectInView.environments && projectInView.environments.map(environment => {
const problems = Array.prototype.concat.apply([], environment.problems);
return (
<div key={environment.id} className="environment-wrapper">
<div className="environment">
<label>Environment: {environment.name}</label>
<div className="overview">
<ul className="overview-list">
<li className="result"><label>Problems </label><span className="text-large">{Object.keys(problems).length}</span></li>
<li className="result"><label>Critical </label><span className="text-large red">{problems.filter(p => p.severity === 'CRITICAL').length}</span></li>
<li className="result"><label>High </label><span className="text-large blue">{problems.filter(p => p.severity === 'HIGH').length}</span></li>
<li className="result"><label>Medium </label><span className="text-large yellow">{problems.filter(p => p.severity === 'MEDIUM').length}</span></li>
<li className="result"><label>Low </label><span className="text-large grey">{problems.filter(p => p.severity === 'LOW').length}</span></li>
</ul>
</div>
</div>
<ProblemsByProject key={environment.id} problems={environment.problems || [] } minified={true}/>
</div>
)
})}
</>
: <div className="project">No project selected</div>
}
</div>
</div>
</div>
</>
}
<style jsx>{`
.content-wrapper {
&.results {
background: #f1f1f1;
margin-bottom: 20px;
.content {
padding: 0 15px;
}
}
.content {
margin: 0 calc((100vw / 16) * 1) 0;
@media ${bp.wideUp} {
margin: 0 calc((100vw / 16) * 2) 0;
}
@media ${bp.extraWideUp} {
margin: 0 calc((100vw / 16) * 3) 0;
}
li.result {
display: inline;
}
.project {
padding: 20px;
background: ${color.white};
margin-bottom: 20px;
}
.environment-wrapper {
padding-bottom: 20px;
.environment {
display: flex;
justify-content: space-between;
padding: 10px 20px;
margin-top: 0;
background: #f3f3f3;
}
}
.overview-list {
margin: 0;
}
}
.loading {
margin: 2em calc(100vw / 2) 0;
}
}
`}</style>
</div>
);
};
export default Honeycomb;
|
amazeeio/lagoon
|
services/ui/src/components/Honeycomb/index.js
|
JavaScript
|
apache-2.0
| 10,678
|
/// <reference path='../typings/browser.d.ts' />
// TypeScript definitions for browserify-zlib:
// https://github.com/devongovett/browserify-zlib
//
// Note that this is a tiny fraction of available
// methods; for a reference, see the Node.js zlib
// documentation.
declare module 'browserify-zlib' {
function gzipSync(buffer:Buffer) : Buffer;
function gunzipSync(buffer:Buffer) : Buffer;
}
|
jpevarnek/uproxy
|
third_party/browserify-zlib/browserify-zlib.d.ts
|
TypeScript
|
apache-2.0
| 400
|
<?php
/**
* efxphp (http://emilmalinov.com/efxphp)
*
* @copyright Copyright (c) 2015 Emil Malinov
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0
* @link http://github.com/emilkm/efxphp
* @package efxphp
*/
namespace flex\messaging\messages;
use emilkm\efxphp\Amf\Constants;
/**
* @author Emil Malinov
* @package efxphp
* @subpackage amf
*/
class CommandMessage extends AsyncMessage
{
const SUBSCRIBE_OPERATION = 0;
const UNSUSBSCRIBE_OPERATION = 1;
const POLL_OPERATION = 2;
const CLIENT_SYNC_OPERATION = 4;
const CLIENT_PING_OPERATION = 5;
const CLUSTER_REQUEST_OPERATION = 7;
const LOGIN_OPERATION = 8;
const LOGOUT_OPERATION = 9;
const SESSION_INVALIDATE_OPERATION = 10;
const MULTI_SUBSCRIBE_OPERATION = 11;
const DISCONNECT_OPERATION = 12;
const UNKNOWN_OPERATION = 10000;
public $operation = self::UNKNOWN_OPERATION;
/**
* Incoming: the deserializer will set all properties with values
* from the AMF packet.
* Outgoing: constructor parameters must be provided.
*
* @param mixed $operation
*/
public function __construct($operation = null)
{
if ($operation == null) {
return;
}
$remoteClassField = Constants::REMOTE_CLASS_FIELD;
$this->$remoteClassField = 'flex.messaging.messages.CommandMessage';
if ($operation == self::CLIENT_PING_OPERATION) {
$this->operation = self::CLIENT_PING_OPERATION;
$this->destination = null;
$this->messageId = $this->generateId();
$this->timestamp = $this->timestampMilli();
$this->timeToLive = 0;
$this->clientId = null;
$this->headers = (object) array('DSId' => 'nil');
$this->body = (object) array();
}
}
}
|
emilkm/efxphp
|
src/Amf/flex/messaging/messages/CommandMessage.php
|
PHP
|
apache-2.0
| 1,900
|
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title> Require Luvit 2.5.6 Manual & Documentation</title>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Lato:400,700,400italic">
<link rel="stylesheet" href="assets/style.css">
<link rel="stylesheet" href="assets/sh.css">
<link rel="luvit contributors" href="https://luvit.io/api/require.html">
</head>
<body class="alt apidoc" id="api-section-require">
<div id="content" class="clearfix">
<div id="column2" class="interior">
<div id="intro" class="interior">
<a href="/" title="Go back to the home page">
Luvit (1)
</a>
</div>
<ul>
<li><a class="nav-documentation" href="documentation.html">About these Docs</a></li>
<li><a class="nav-synopsis" href="synopsis.html">Synopsis</a></li>
<li><a class="nav-buffer" href="buffer.html">Buffer</a></li>
<li><a class="nav-childprocess" href="childprocess.html">Child Process</a></li>
<li><a class="nav-codec" href="codec.html">Codec</a></li>
<li><a class="nav-core" href="core.html">Core</a></li>
<li><a class="nav-dgram" href="dgram.html">Datagram/UDP</a></li>
<li><a class="nav-dns" href="dns.html">DNS</a></li>
<li><a class="nav-fs" href="fs.html">File System</a></li>
<li><a class="nav-helpful" href="helpful.html">Helpful</a></li>
<li><a class="nav-http-codec" href="http-codec.html">HTTP Codec</a></li>
<li><a class="nav-http" href="http.html">HTTP</a></li>
<li><a class="nav-https" href="https.html">HTTPS</a></li>
<li><a class="nav-json" href="json.html">JSON</a></li>
<li><a class="nav-los" href="los.html">Light Operating System helper(los)</a></li>
<li><a class="nav-net" href="net.html">Net</a></li>
<li><a class="nav-path" href="path.html">Path</a></li>
<li><a class="nav-pretty-print" href="pretty-print.html">Pretty print</a></li>
<li><a class="nav-process" href="process.html">Process</a></li>
<li><a class="nav-querystring" href="querystring.html">Query String</a></li>
<li><a class="nav-readline" href="readline.html">Readline</a></li>
<li><a class="nav-repl" href="repl.html">REPL</a></li>
<li><a class="nav-require active" href="require.html">Require</a></li>
<li><a class="nav-stream" href="stream.html">Stream</a></li>
<li><a class="nav-thread" href="thread.html">Thread</a></li>
<li><a class="nav-timer" href="timer.html">Timer</a></li>
<li><a class="nav-url" href="url.html">URL</a></li>
<li><a class="nav-utils" href="utils.html">Utilities</a></li>
</ul>
</div>
<div id="column1" data-id="require" class="interior">
<header>
<h1>Luvit 2.5.6 Documentation</h1>
<div id="gtoc">
<p>
<a href="index.html" name="toc">Index</a> |
<a href="all.html">View on single page</a> |
<a href="require.json">View as JSON</a>
</p>
</div>
<hr>
</header>
<div id="toc">
<h2>Table of Contents</h2>
<ul>
<li><a href="#require_require">Require</a></li>
</ul>
</div>
<div id="apicontent">
<h1>Require<span><a class="mark" href="#require_require" id="require_require">#</a></span></h1>
<p>Luvit's custom require system with relative requires and sane search paths.<br>This allows us to have the convenience of having node style require statements to include libraries.
</p>
</div>
</div>
</div>
<div id="footer">
</div>
<script src="assets/sh_main.js"></script>
<script src="assets/sh_javascript.min.js"></script>
<script>highlight(undefined, undefined, 'pre');</script>
</body>
</html>
|
luvit/luvit.io
|
static/api/require.html
|
HTML
|
apache-2.0
| 3,568
|
package com.taobao.tddl.common.exception;
import java.io.PrintStream;
import java.io.PrintWriter;
import java.sql.SQLException;
import org.apache.commons.lang.exception.Nestable;
import org.apache.commons.lang.exception.NestableDelegate;
/**
* Tddl nestabled {@link SQLException}
*
* @author jianghang 2013-10-24 下午2:54:56
* @since 5.1.0
*/
public class TddlSQLException extends SQLException implements Nestable {
private static final long serialVersionUID = -4558269080286141706L;
public TddlSQLException(SQLException cause){
this(null, cause);
}
public TddlSQLException(String message, SQLException cause){
super(message);
if (cause == null) {
throw new IllegalArgumentException("必须填入SQLException");
}
this.cause = cause;
}
protected NestableDelegate delegate = new NestableDelegate(this);
protected final SQLException cause;
/**
* {@inheritDoc}
*/
public SQLException getCause() {
return cause;
}
public String getMessage() {
if (super.getMessage() != null) {
return super.getMessage();
} else if (cause != null) {
return cause.toString();
} else {
return null;
}
}
/**
* {@inheritDoc}
*/
public String getMessage(int index) {
if (index == 0) {
return super.getMessage();
}
return delegate.getMessage(index);
}
/**
* {@inheritDoc}
*/
public String[] getMessages() {
return delegate.getMessages();
}
/**
* {@inheritDoc}
*/
public Throwable getThrowable(int index) {
return delegate.getThrowable(index);
}
/**
* {@inheritDoc}
*/
public int getThrowableCount() {
return delegate.getThrowableCount();
}
/**
* {@inheritDoc}
*/
public Throwable[] getThrowables() {
return delegate.getThrowables();
}
/**
* {@inheritDoc}
*/
public int indexOfThrowable(Class type) {
return delegate.indexOfThrowable(type, 0);
}
/**
* {@inheritDoc}
*/
public int indexOfThrowable(Class type, int fromIndex) {
return delegate.indexOfThrowable(type, fromIndex);
}
/**
* {@inheritDoc}
*/
public void printStackTrace() {
delegate.printStackTrace();
}
/**
* {@inheritDoc}
*/
public void printStackTrace(PrintStream out) {
delegate.printStackTrace(out);
}
/**
* {@inheritDoc}
*/
public void printStackTrace(PrintWriter out) {
delegate.printStackTrace(out);
}
/**
* {@inheritDoc}
*/
public final void printPartialStackTrace(PrintWriter out) {
super.printStackTrace(out);
}
}
|
sdgdsffdsfff/tddl
|
tddl-common/src/main/java/com/taobao/tddl/common/exception/TddlSQLException.java
|
Java
|
apache-2.0
| 2,831
|
# Suitcase
[](https://jitpack.io/#com.guerinet/suitcase)
[](https://www.codacy.com/app/jguerinet/Suitcase?utm_source=github.com&utm_medium=referral&utm_content=jguerinet/Suitcase&utm_campaign=Badge_Grade)
## Summary
Android utility classes and methods that I use in all of my projects. When off on a coding
adventure, don't forget to pack your suitcase!
Note: We are slowly moving to start supporting Kotlin Multiplatform (KMP).
## Instructions
To include this in your project, you can add it with Gradle by using [JitPack](https://jitpack.io).
Replace X.X.X below with the latest version found on the status badge above:
repositories {
maven { url "https://jitpack.io" }
}
def suitcase_version = 'X.X.X'
dependencies {
// Analytics interface, used by firebase-analytics.
implementation "com.guerinet.suitcase:analytics:$suitcase_version"
// Coroutines extension functions and models, uses Kotlin Coroutines
implementation "com.guerinet.suitcase:coroutines:$suitcase_version"
// Date utility methods and classes, uses Kotlinx DateTime
implementation "com.guerinet.suitcase:date:$suitcase_version"
// Date utility formatting methods and classes specifically for Android, uses Kotlinx DateTime
implementation "com.guerinet.suitcase:date-android:$suitcase_version"
// Dialog utility methods, uses Material Dialogs
implementation "com.guerinet.suitcase:dialog:$suitcase_version"
// Firebase analytics extension functions, uses Firebase
implementation "com.guerinet.suitcase:firebase-analytics:$suitcase_version"
// I/O utility methods, uses Okio
implementation "com.guerinet.suitcase:io:$suitcase_version"
// Lifecycle utility methods, uses the Android Lifecycle components
implementation "com.guerinet.suitcase:lifecycle:$suitcase_version"
// Logging utility methods and classes, uses Timber. Also a Logger for Koin, but Koin is explicitly needed as a dependency
implementation "com.guerinet.suitcase:log:$suitcase_version"
// Key-value utility methods and classes (i.e. SharedPreferences on Android), uses Multiplatform Settings
implementation "com.guerinet.suitcase:settings:$suitcase_version"
// Room utility methods, uses Room
implementation "com.guerinet.suitcase:room:$suitcase_version"
// UI utility methods and classes
implementation "com.guerinet.suitcase:ui:$suitcase_version"
// Basic utility methods and resources
implementation "com.guerinet.suitcase:util:$suitcase_version"
}
- [Coroutines](https://github.com/Kotlin/kotlinx.coroutines)
- [Kotlinx DateTime](https://github.com/Kotlin/kotlinx-datetime)
- [Material Dialogs](https://github.com/afollestad/material-dialogs)
- [Firebase](https://firebase.google.com/docs/analytics/)
- [Okio](https://github.com/square/okio)
- [Timber](https://github.com/JakeWharton/timber)
- [Koin](https://github.com/InsertKoinIO/koin)
- [Multiplatform Settings](https://github.com/russhwolf/multiplatform-settings)
## Contributors
- [Julien Guerinet](https://github.com/jguerinet)
## Version History
See the [Change Log](CHANGELOG.md).
## Copyright
Copyright 2016-2021 Julien Guerinet
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.
|
jguerinet/Suitcase
|
README.md
|
Markdown
|
apache-2.0
| 4,033
|
#
# Cookbook Name:: aws_volume
# Recipe:: default
#
#
chef_gem "aws-sdk" do
version node['aws_volume']['aws_sdk_version']
action :install
end
require 'aws-sdk'
|
unixworld/chef-aws-volume
|
recipes/default.rb
|
Ruby
|
apache-2.0
| 166
|
'''
Created on Aug 29, 2015
@author: kevinchien
'''
import datetime
# from bson import ObjectId
from tornado.gen import Task, Return
from tornado.gen import coroutine
from src.common.logutil import get_logger
# from src.core.mongoutil import get_instance
#
# @coroutine
# def update_auth(auth_info):
# new_auth_info = auth_info.copy()
# new_auth_info['updated_at'] = datetime.datetime.utcnow()
#
# criteria = {"user_id": new_auth_info.get('user_id'),
# "access_token": new_auth_info.get('access_token'),
# "refresh_token": new_auth_info.get('refresh_token')}
#
# fields = {'$set': new_auth_info}
#
# result, error = yield Task(get_instance().auth_info.update, criteria, fields)
# if error is not None:
# raise error
#
# raise Return(result)
|
cchienhao/data_collector
|
src/collectors/fitbit/dao.py
|
Python
|
apache-2.0
| 841
|
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
#include <string.h>
#include <strings.h>
#include <sys/stat.h>
#include "mbedtls/ssl.h"
#include "mbedtls/net.h"
#include "mbedtls/sha256.h"
#include "splinter.h"
void upload_file(struct compression* decompress, struct ssl_conn* client_conn)
{
size_t file_size = 0, size_recv = 0 ;
FILE* remote_file;
char *first_file = NULL, *second_file = NULL, *command_start = NULL;
char *command = malloc(BUFFER_SIZE);
unsigned int remain_data = 0;
unsigned char sha1_output[32];
unsigned int j;
mbedtls_sha256_context file_hash;
memset(command, 0, BUFFER_SIZE);
command_start = strncpy(command, (char*)decompress->orig_buffer, BUFFER_SIZE);
strsep(&command, " ");
first_file = strsep(&command, " ");
second_file = strsep(&command, " ");
#ifdef DEBUG
printf("File upload: %s -> %s\n", first_file, second_file);
#endif
remote_file = fopen(second_file, "wb");
if (remote_file == NULL) {
#ifdef DEBUG
fprintf(stderr, "Failed to open file foo --> %s\n", strerror(errno));
#endif
exit(-1);
}
file_size = 0;
size_recv = 0;
if ((size_recv = mbedtls_ssl_read(&client_conn->ssl_fd, (unsigned char*) &file_size, sizeof(size_t))) > 0) {
if (size_recv == (unsigned int)-1) {
perror("Error recving");
}
}
#ifdef DEBUG
printf("File size %zd\n", file_size);
#endif
//Initialize SHA1 hash
mbedtls_sha256_init(&file_hash);
mbedtls_sha256_starts(&file_hash, 0);
remain_data = 0;
memset(decompress->transformed_buffer, 0, BUFFER_SIZE);
memset(decompress->orig_buffer, 0, BUFFER_SIZE);
while (((decompress->orig_size = mbedtls_ssl_read(&client_conn->ssl_fd, decompress->orig_buffer, BUFFER_SIZE)) > 0) || (remain_data < file_size)) {
decompress_buffer(decompress);
mbedtls_sha256_update(&file_hash, decompress->transformed_buffer, decompress->transformed_size);
remain_data += fwrite(decompress->transformed_buffer, 1, decompress->transformed_size, remote_file);
#ifdef DEBUG
fprintf(stdout, "Received %d bytes out of %d bytes\n", decompress->transformed_size, (int)file_size);
#endif
memset(decompress->orig_buffer, 0, BUFFER_SIZE);
memset(decompress->transformed_buffer, 0, BUFFER_SIZE);
if (remain_data == file_size) {
break;
}
}
#ifdef DEBUG
printf("Finished writing file %s\n", second_file);
#endif
//Hash check
mbedtls_sha256_finish(&file_hash, sha1_output);
#ifdef DEBUG
printf("\nSha1 hash: ");
for (j = 0; j < sizeof(sha1_output); j++) {
printf("%02x", sha1_output[j]);
}
printf("\n");
#endif
if (mbedtls_ssl_write(&client_conn->ssl_fd, sha1_output, sizeof(sha1_output)) < 0) {
#ifdef DEBUG
printf("Error sending SHA1 hash\n");
#endif
}
#ifdef DEBUG
printf("Changing permissions to 700\n");
#endif
if (chmod(second_file, S_IRWXU) == -1) {
//Should just send this over the socket
#ifdef DEBUG
printf("Unable to chmod\n");
#endif
}
free(command_start);
fclose(remote_file);
return;
}
void download_file(struct compression* compress, struct ssl_conn* client_conn)
{
int fd = 0;
size_t file_size = 0, sent_bytes = 0, total_sent = 0;
FILE* remote_file = NULL;
char *first_file = NULL, *second_file = NULL, *command_start = NULL;
char *command = malloc(BUFFER_SIZE);
unsigned int remain_data = 0;
unsigned char sha1_output[32];
unsigned int i = 0;
struct stat st;
mbedtls_sha256_context file_hash;
memset(command, 0, BUFFER_SIZE);
command_start = strncpy(command, (char*)compress->orig_buffer, BUFFER_SIZE);
if (strsep(&command, " ") == NULL){
perror("Error parsing download");
}
first_file = strsep(&command, " ");
second_file = strsep(&command, " ");
#ifdef DEBUG
printf("File download: %s -> %s\n", first_file, second_file);
#endif
memset(compress->orig_buffer, 0, BUFFER_SIZE);
memset(compress->transformed_buffer, 0, BUFFER_SIZE);
if (access(first_file, F_OK) == -1) {
#ifdef DEBUG
printf("File not found\n");
#endif
if ( mbedtls_ssl_write(&client_conn->ssl_fd, (unsigned char*)&file_size, sizeof(file_size)) == -1 ) {
#ifdef DEBUG
printf("Error: %s", strerror(errno));
#endif
return;
}
strncpy((char*)compress->orig_buffer, "File doesn't exist", BUFFER_SIZE);
compress_buffer(compress);
mbedtls_ssl_write(&client_conn->ssl_fd, compress->transformed_buffer, compress->transformed_size);
free(command_start);
return;
}
if (access(first_file, R_OK) == -1) {
if ( mbedtls_ssl_write(&client_conn->ssl_fd, (unsigned char*)&file_size, sizeof(file_size)) == -1 ) {
#ifdef DEBUG
printf("Error: %s", strerror(errno));
#endif
return;
}
strncpy((char*)compress->orig_buffer, "Insufficient permissions", BUFFER_SIZE);
compress_buffer(compress);
mbedtls_ssl_write(&client_conn->ssl_fd, compress->transformed_buffer, compress->transformed_size);
free(command_start);
return;
}
//Get local file size
memset(&st, 0, sizeof(struct stat));
if (stat(first_file, &st) == -1) {
perror("stat error");
}
//Get the file size
file_size = st.st_size;
#ifdef DEBUG
printf("File size %zd\n", file_size);
#endif
if (file_size == 0){
if ( mbedtls_ssl_write(&client_conn->ssl_fd, (unsigned char*)&file_size, sizeof(file_size)) == -1 ) {
#ifdef DEBUG
printf("Error: %s", strerror(errno));
#endif
return;
}
strncpy((char*)compress->orig_buffer, "Zero byte file", BUFFER_SIZE);
compress_buffer(compress);
mbedtls_ssl_write(&client_conn->ssl_fd, compress->transformed_buffer, compress->transformed_size);
free(command_start);
return;
}
remote_file = fopen(first_file, "rb");
if (remote_file == NULL) {
#ifdef DEBUG
fprintf(stderr, "Failed to open file foo --> %s\n", strerror(errno));
#endif
exit(-1);
}
fd = fileno(remote_file);
if (fd == -1) {
perror("Unable to get fileno");
}
//Send file size for the other side to receive
if ( mbedtls_ssl_write(&client_conn->ssl_fd, (unsigned char*)&file_size, sizeof(file_size)) == -1 ) {
#ifdef DEBUG
printf("Error: %s", strerror(errno));
#endif
return;
}
remain_data = file_size;
sent_bytes = 0;
total_sent = 0;
//Initialize for SHA256 hash
mbedtls_sha256_init(&file_hash);
mbedtls_sha256_starts(&file_hash, 0);
memset(compress->orig_buffer, 0, BUFFER_SIZE);
memset(compress->transformed_buffer, 0, BUFFER_SIZE);
compress->orig_size = 0;
compress->transformed_size = 0;
// Sending file data
while ((compress->orig_size = fread((char*) compress->orig_buffer, 1, BUFFER_SIZE, remote_file)) > 0) {
mbedtls_sha256_update(&file_hash, compress->orig_buffer, compress->orig_size);
compress_buffer(compress);
sent_bytes = mbedtls_ssl_write(&client_conn->ssl_fd, compress->transformed_buffer, compress->transformed_size);
#ifdef DEBUG
fprintf(stdout, "Sent %zu bytes from file's data, remaining data = %d\n", sent_bytes, remain_data);
#endif
total_sent += compress->orig_size;
remain_data -= compress->orig_size;
memset(compress->orig_buffer, 0, BUFFER_SIZE);
memset(compress->transformed_buffer, 0, BUFFER_SIZE);
}
if (total_sent < file_size) {
#ifdef DEBUG
fprintf(stderr, "incomplete transfer from sendfile: %zu of %zu bytes\n", total_sent, file_size);
#endif
} else {
#ifdef DEBUG
printf("Finished transferring %s\n", first_file);
#endif
}
mbedtls_sha256_finish(&file_hash, sha1_output);
#ifdef DEBUG
printf("\nSHA1 hash: ");
for (i = 0; i < sizeof(sha1_output); i++) {
printf("%02x", sha1_output[i]);
}
printf("\n");
#endif
if (mbedtls_ssl_write(&client_conn->ssl_fd, sha1_output, sizeof(sha1_output)) < 0) {
//Should probably check this eventually
#ifdef DEBUG
printf("Error recving Sha1 hash\n");
#endif
}
mbedtls_sha256_free(&file_hash);
fclose(remote_file);
free(command_start);
return;
}
|
snap-tastic/splinter
|
src/server/file_operations.c
|
C
|
apache-2.0
| 8,709
|
=head1 LICENSE
Copyright [1999-2015] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics Institute
Copyright [2016-2021] EMBL-European Bioinformatics Institute
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.
=cut
package EnsEMBL::Web::Query::GlyphSet::Marker;
use strict;
use warnings;
use parent qw(EnsEMBL::Web::Query::Generic::GlyphSet);
our $VERSION = 15;
sub href {
my ($self,$f,$args) = @_;
return {
species => $args->{'species'},
type => 'Marker',
m => $f->{'drawing_id'}
};
}
sub colour_key { return lc $_[1]->marker->type; }
sub precache {
return {
markers => {
parts => 10,
loop => ['species','genome'],
args => {
}
}
}
}
sub fixup {
my ($self) = @_;
$self->fixup_slice('slice','species',1000000);
$self->fixup_location('start','slice',0);
$self->fixup_location('end','slice',1);
$self->fixup_unique('_unique');
$self->fixup_href('href');
$self->fixup_colour('colour','magenta');
$self->fixup_colour('label_colour','magenta');
$self->SUPER::fixup();
}
sub get {
my ($self,$args) = @_;
my $slice = $args->{'slice'};
my $length = $slice->length;
my $data = [];
# Get them
my @features;
if($args->{'text_export'}) {
@features = @{$slice->get_all_MarkerFeatures};
} else {
my $map_weight = 2;
@features = @{$slice->get_all_MarkerFeatures($args->{'logic_name'},
$args->{'priority'},
$map_weight)};
# Force add marker with our id if missed out above
if($args->{'marker_id'} and
!grep {$_->display_id eq $args->{'marker_id'}} @features) {
my $m = $slice->get_MarkerFeatures_by_Name($args->{'marker_id'});
push @features,@$m;
}
}
# Determine drawing_id for each marker
foreach my $f (@features) {
my $ms = $f->marker->display_MarkerSynonym;
my $id = $ms ? $ms->name : '';
($id) = grep $_ ne '-', map $_->name, @{$f->marker->get_all_MarkerSynonyms || []} if $id eq '-' || $id eq '';
$f->{'drawing_id'} = $id;
}
# Build output
foreach my $f (sort { $a->seq_region_start <=> $b->seq_region_start } @features) {
my $id = $f->{'drawing_id'};
my $feature_colour = $self->colour_key($f);
push @$data, {
'_unique' => join(':',$id,$f->start,$f->end),
'start' => $f->start,
'end' => $f->end,
'colour' => $feature_colour,
'label' => $id,
'label_colour' => $feature_colour,
'href' => $self->href($f,$args),
};
}
return $data;
}
1;
|
Ensembl/ensembl-webcode
|
modules/EnsEMBL/Web/Query/GlyphSet/Marker.pm
|
Perl
|
apache-2.0
| 3,216
|
package com.xcuber.actuator.health;
import org.springframework.boot.actuate.health.AbstractHealthIndicator;
import org.springframework.boot.actuate.health.Health.Builder;
import org.springframework.stereotype.Component;
@Component
public class MyHealthIndicator extends AbstractHealthIndicator {
@Override
protected void doHealthCheck(Builder builder) throws Exception {
builder.up().withDetail("name", "junyan1");
}
}
|
glomie/xcuber-boot
|
src/main/java/com/xcuber/actuator/health/MyHealthIndicator.java
|
Java
|
apache-2.0
| 443
|
//This file has been modified with suggestions from forum users.
/*
* This file is part of UniERM ReportDesigner, based on reportFU by Josh Wilson,
* the work of Kim Sheffield and the fyiReporting project.
*
* Prior Copyrights:
* _________________________________________________________
* |Copyright (C) 2010 devFU Pty Ltd, Josh Wilson and Others|
* | (http://reportfu.org) |
* =========================================================
* _________________________________________________________
* |Copyright (C) 2004-2008 fyiReporting Software, LLC |
* |For additional information, email info@fyireporting.com |
* |or visit the website www.fyiReporting.com. |
* =========================================================
*
* License:
*
* 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.
*/
using System;
using Reporting.Rdl;
using System.IO;
using System.Collections;
using System.Collections.Generic;
using System.Drawing.Imaging;
using System.Text;
using System.Xml;
using System.Globalization;
using System.Drawing;
namespace Reporting.Rdl
{
///<summary>
/// Renders a report to HTML. This handles some page formating but does not do true page formatting.
///</summary>
internal class RenderExcel: IPresent
{
Report r; // report
IStreamGen _sg; // stream generater
Bitmap _bm=null; // bm and
Graphics _g=null; // g are needed when calculating string heights
// Excel currentcy
int _ExcelRow = -1; // current row
int _ExcelCol = -1; // current col
ExcelValet _Excel;
string SheetName; // current sheetname
public RenderExcel(Report rep, IStreamGen sg)
{
r = rep;
_sg = sg; // We need this in future
_Excel = new ExcelValet();
}
//Replaced from forum, User: Aulofee http://www.fyireporting.com/forum/viewtopic.php?t=793
//~RenderExcel()
public void Dispose()
{
// These should already be cleaned up; but in case of an unexpected error
// these still need to be disposed of
if (_bm != null)
_bm.Dispose();
if (_g != null)
_g.Dispose();
}
public Report Report()
{
return r;
}
public bool IsPagingNeeded()
{
return false;
}
public void Start()
{
return;
}
private Graphics GetGraphics
{
get
{
if (_g == null)
{
_bm = new Bitmap(10, 10);
_g = Graphics.FromImage(_bm);
}
return _g;
}
}
public void End()
{
Stream fs = _sg.GetStream();
_Excel.WriteExcel(fs);
if (_g != null)
{
_g.Dispose();
_g = null;
}
if (_bm != null)
{
_bm.Dispose();
_bm = null;
}
return;
}
// Body: main container for the report
public void BodyStart(Body b)
{
}
public void BodyEnd(Body b)
{
}
public void PageHeaderStart(PageHeader ph)
{
}
public void PageHeaderEnd(PageHeader ph)
{
}
public void PageFooterStart(PageFooter pf)
{
}
public void PageFooterEnd(PageFooter pf)
{
}
public void Textbox(Textbox tb, string t, Row row)
{
if (InTable(tb))
_Excel.SetCell(_ExcelRow, _ExcelCol, t, GetStyle(tb, row));
else if (InList(tb))
{
_ExcelCol++;
_Excel.SetCell(_ExcelRow, _ExcelCol, t, GetStyle(tb, row));
}
}
private StyleInfo GetStyle(ReportItem ri, Row row)
{
if (ri.Style == null)
return null;
return ri.Style.GetStyleInfo(r, row);
}
private static bool InTable(ReportItem tb)
{
Type tp = tb.Parent.Parent.GetType();
return (tp == typeof(TableCell) ||
tp == typeof(Corner) ||
tp == typeof(DynamicColumns) ||
tp == typeof(DynamicRows) ||
tp == typeof(StaticRow) ||
tp == typeof(StaticColumn) ||
tp == typeof(Subtotal) ||
tp == typeof(MatrixCell));
}
private static bool InList(ReportItem tb)
{
Type tp = tb.Parent.Parent.GetType();
return (tp == typeof(List));
}
public void DataRegionNoRows(DataRegion d, string noRowsMsg) // no rows in table
{
}
// Lists
public bool ListStart(List l, Row r)
{
_Excel.AddSheet(l.Name.Nm);
SheetName = l.Name.Nm; //keep track of sheet name
_ExcelRow = -1;
int ci = 0;
foreach (ReportItem ri in l.ReportItems)
{
if (ri is Textbox)
{
if (ri.Width != null)
_Excel.SetColumnWidth(ci, ri.Width.ToPoints());
ci++;
}
}
return true;
}
public void ListEnd(List l, Row r)
{
}
public void ListEntryBegin(List l, Row r)
{
_ExcelRow++;
_ExcelCol = -1;
// calc height of tallest Textbox
float height = float.MinValue;
foreach (ReportItem ri in l.ReportItems)
{
if (ri is Textbox)
{
if (ri.Height != null)
height = Math.Max(height, ri.Height.ToPoints());
}
}
if (height != float.MinValue)
_Excel.SetRowHeight(_ExcelRow, height);
}
public void ListEntryEnd(List l, Row r)
{
}
// Tables // Report item table
public bool TableStart(Table t, Row row)
{
_Excel.AddSheet(t.Name.Nm);
SheetName = t.Name.Nm; //keep track of sheet name
_ExcelRow = -1;
for (int ci = 0; ci < t.TableColumns.Items.Count; ci++)
{
TableColumn tc = t.TableColumns[ci];
_Excel.SetColumnWidth(ci, tc.Width.ToPoints());
}
return true;
}
public bool IsTableSortable(Table t)
{
return false; // can't have tableGroups; must have 1 detail row
}
public void TableEnd(Table t, Row row)
{
_ExcelRow++;
return;
}
public void TableBodyStart(Table t, Row row)
{
}
public void TableBodyEnd(Table t, Row row)
{
}
public void TableFooterStart(Footer f, Row row)
{
}
public void TableFooterEnd(Footer f, Row row)
{
}
public void TableHeaderStart(Header h, Row row)
{
}
public void TableHeaderEnd(Header h, Row row)
{
}
public void TableRowStart(TableRow tr, Row row)
{
_ExcelRow++;
_Excel.SetRowHeight(_ExcelRow, tr.HeightOfRow(r, this.GetGraphics, row));
_ExcelCol = -1;
}
public void TableRowEnd(TableRow tr, Row row)
{
}
public void TableCellStart(TableCell t, Row row)
{
_ExcelCol++;
if (t.ColSpan > 1) {
_Excel.SetMerge(string.Format("{0}{1}:{2}{3}", (char)('A' + _ExcelCol), _ExcelRow + 1, (char)('A' + _ExcelCol + t.ColSpan - 1), _ExcelRow + 1), SheetName);
}
return;
}
public void TableCellEnd(TableCell t, Row row)
{
// ajm 20062008 need to increase to cover the merged cells, excel still defines every cell
_ExcelCol += t.ColSpan - 1;
return;
}
public bool MatrixStart(Matrix m, MatrixCellEntry[,] matrix, Row r, int headerRows, int maxRows, int maxCols) // called first
{
_Excel.AddSheet(m.Name.Nm);
_ExcelRow = -1;
// set the widths of the columns
float[] widths = m.ColumnWidths(matrix, maxCols);
for (int i = 0; i < maxCols; i++)
{
_Excel.SetColumnWidth(i, widths[i]);
}
return true;
}
public void MatrixColumns(Matrix m, MatrixColumns mc) // called just after MatrixStart
{
}
public void MatrixCellStart(Matrix m, ReportItem ri, int row, int column, Row r, float h, float w, int colSpan)
{
_ExcelCol++;
}
public void MatrixCellEnd(Matrix m, ReportItem ri, int row, int column, Row r)
{
}
public void MatrixRowStart(Matrix m, int row, Row r)
{
// we handle RowStart when the column is 0 so that we have a ReportItem to figure out the border information
_ExcelRow++;
_ExcelCol = -1;
}
public void MatrixRowEnd(Matrix m, int row, Row r)
{
}
public void MatrixEnd(Matrix m, Row r) // called last
{
_ExcelRow++;
return;
}
public void Chart(Chart c, Row row, ChartBase cb)
{
}
public void Image(Image i, Row r, string mimeType, Stream ioin)
{
}
public void Line(Line l, Row r)
{
return;
}
public bool RectangleStart(Rdl.Rectangle rect, Row r)
{
return true;
}
public void RectangleEnd(Rdl.Rectangle rect, Row r)
{
}
// Subreport:
public void Subreport(Subreport s, Row r)
{
}
public void GroupingStart(Grouping g) // called at start of grouping
{
}
public void GroupingInstanceStart(Grouping g) // called at start for each grouping instance
{
}
public void GroupingInstanceEnd(Grouping g) // called at start for each grouping instance
{
}
public void GroupingEnd(Grouping g) // called at end of grouping
{
}
public void RunPages(Pages pgs) // we don't have paging turned on for html
{
}
}
}
|
isgmbh/UniERM-ReportDesigner
|
src/RdlEngine/Render/Excel/RenderExcel.cs
|
C#
|
apache-2.0
| 10,506
|
package scala.tools.nsc.transform
import org.junit.Assert.assertEquals
import org.junit.{Assert, Test}
import scala.tools.nsc.symtab.SymbolTableForUnitTesting
class SpecializationTest {
object symbolTable extends SymbolTableForUnitTesting
@Test def testHardCodedAssumptionsAboutTupleAndFunction(): Unit = {
// The specialization phase always runs its info transform on the specialized Function and Tuple types
// so that the later phases can see them, even with the optimization in the specialization info transform
// that makes it a no-op after the global phase has passed specialize.
//
// Initially, we just called `exitingSpecialize { TupleClass.seq.map(_.info); Function.seq.map(_.info) }`
// but this was wasteful, as it loaded the seldom used, high-arity Tuple and Function classes, some of which
// are pretty big in bytecode!
//
// So we know bake the knowledge about the max arity for which specialization is used into that code.
// This test asserts the assumption still holds.
import symbolTable.definitions._
for (i <- (0 to MaxFunctionArity)) {
val cls = FunctionClass.apply(i)
val actual = cls.typeParams.exists(_.isSpecialized)
val expected = i <= MaxFunctionAritySpecialized
assertEquals(cls.toString, expected, actual)
}
for (i <- (1 to MaxTupleArity)) {
val cls = TupleClass.apply(i)
val actual = cls.typeParams.exists(_.isSpecialized)
val expected = i <= MaxTupleAritySpecialized
assertEquals(cls.toString, expected, actual)
}
for (i <- (1 to MaxProductArity)) {
val cls = ProductClass.apply(i)
val actual = cls.typeParams.exists(_.isSpecialized)
val expected = i <= MaxProductAritySpecialized
assertEquals(cls.toString, expected, actual)
}
}
}
|
martijnhoekstra/scala
|
test/junit/scala/tools/nsc/transform/SpecializationTest.scala
|
Scala
|
apache-2.0
| 1,819
|
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Tests for the Google Drive database plugin."""
from __future__ import unicode_literals
import unittest
from plaso.formatters import gdrive as _ # pylint: disable=unused-import
from plaso.lib import definitions
from plaso.parsers.sqlite_plugins import gdrive
from tests.parsers.sqlite_plugins import test_lib
class GoogleDrivePluginTest(test_lib.SQLitePluginTestCase):
"""Tests for the Google Drive database plugin."""
def testProcess(self):
"""Tests the Process function on a Google Drive database file."""
plugin = gdrive.GoogleDrivePlugin()
storage_writer = self._ParseDatabaseFileWithPlugin(['snapshot.db'], plugin)
self.assertEqual(storage_writer.number_of_warnings, 0)
self.assertEqual(storage_writer.number_of_events, 30)
# Let's verify that we've got the correct balance of cloud and local
# entry events.
# 10 files mounting to:
# 20 Cloud Entries (two timestamps per entry).
# 10 Local Entries (one timestamp per entry).
local_entries = []
cloud_entries = []
for event in storage_writer.GetEvents():
event_data = self._GetEventDataOfEvent(storage_writer, event)
if event_data.data_type == 'gdrive:snapshot:local_entry':
local_entries.append(event)
else:
cloud_entries.append(event)
self.assertEqual(len(local_entries), 10)
self.assertEqual(len(cloud_entries), 20)
# Test one local and one cloud entry.
event = local_entries[5]
self.CheckTimestamp(event.timestamp, '2014-01-28 00:11:25.000000')
event_data = self._GetEventDataOfEvent(storage_writer, event)
file_path = (
'%local_sync_root%/Top Secret/Enn meiri '
'leyndarmál/Sýnileiki - Örverpi.gdoc')
self.assertEqual(event_data.path, file_path)
expected_message = 'File Path: {0:s} Size: 184'.format(file_path)
self._TestGetMessageStrings(
event_data, expected_message, file_path)
event = cloud_entries[16]
self.CheckTimestamp(event.timestamp, '2014-01-28 00:12:27.000000')
self.assertEqual(
event.timestamp_desc, definitions.TIME_DESCRIPTION_MODIFICATION)
event_data = self._GetEventDataOfEvent(storage_writer, event)
self.assertEqual(event_data.document_type, 6)
expected_url = (
'https://docs.google.com/document/d/'
'1ypXwXhQWliiMSQN9S5M0K6Wh39XF4Uz4GmY-njMf-Z0/edit?usp=docslist_api')
self.assertEqual(event_data.url, expected_url)
expected_message = (
'File Path: /Almenningur/Saklausa hliðin '
'[Private] '
'Size: 0 '
'URL: {0:s} '
'Type: DOCUMENT').format(expected_url)
expected_short_message = '/Almenningur/Saklausa hliðin'
self._TestGetMessageStrings(
event_data, expected_message, expected_short_message)
if __name__ == '__main__':
unittest.main()
|
rgayon/plaso
|
tests/parsers/sqlite_plugins/gdrive.py
|
Python
|
apache-2.0
| 2,876
|
package com.cloudera.sa.copybook.spark;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.Text;
import org.apache.spark.api.java.JavaPairRDD;
import org.apache.spark.api.java.JavaRDD;
import org.apache.spark.api.java.JavaSparkContext;
import org.apache.spark.api.java.function.Function;
import scala.Tuple2;
import com.cloudera.sa.copybook.mapreduce.CopybookInputFormat;
public class CopybookSparkExample {
public static void main(String[] args) {
if (args.length == 0) {
}
if (args.length == 0) {
System.out
.println("CopybookSparkExample {master} {copybookInputPath} {dataFileInputPath} {outputFolder}");
return;
}
String master = args[0];
String copybookInputPath = args[1];
String dataFileInputPath = args[2];
String outputPath = args[3];
JavaSparkContext jsc = new JavaSparkContext(master,
"UniqueSeqGenerator", null, "SparkCopybookExample.jar");
Configuration config = new Configuration();
config.addResource(new Path("/etc/hadoop/conf/hdfs-site.xml"));
config.addResource(new Path("/etc/hadoop/conf/mapred-site.xml"));
config.addResource(new Path("/etc/hadoop/conf/yarn-site.xml"));
config.addResource(new Path("/etc/hadoop/conf/core-site.xml"));
CopybookInputFormat.setCopybookHdfsPath(config, copybookInputPath);
JavaPairRDD<LongWritable, Text> rdd = jsc.newAPIHadoopFile(dataFileInputPath, CopybookInputFormat.class, LongWritable.class, Text.class, config);
JavaRDD<String> pipeDelimiter = rdd.map(new MapFunction());
pipeDelimiter.saveAsTextFile(outputPath);
}
public static class MapFunction extends Function<Tuple2<LongWritable, Text>, String> {
@Override
public String call(Tuple2<LongWritable, Text> line) throws Exception {
String[] cells = line._2.toString().split(new Character((char) 0x01).toString());
StringBuilder strBuilder = new StringBuilder();
for (String cell: cells) {
strBuilder.append(cell + "|");
}
return strBuilder.toString();
}
}
}
|
tmalaska/CopybookInputFormat
|
copybook.spark/src/main/java/com/cloudera/sa/copybook/spark/CopybookSparkExample.java
|
Java
|
apache-2.0
| 2,071
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="de">
<head>
<title>PrivacyCriterion (ARX Developer Documentation)</title>
<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="PrivacyCriterion (ARX Developer Documentation)";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!-- -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/PrivacyCriterion.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../org/deidentifier/arx/criteria/PopulationUniqueness.html" title="class in org.deidentifier.arx.criteria"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../../org/deidentifier/arx/criteria/RecursiveCLDiversity.html" title="class in org.deidentifier.arx.criteria"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/deidentifier/arx/criteria/PrivacyCriterion.html" target="_top">Frames</a></li>
<li><a href="PrivacyCriterion.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary: </li>
<li>Nested | </li>
<li>Field | </li>
<li><a href="#constructor_summary">Constr</a> | </li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li>Field | </li>
<li><a href="#constructor_detail">Constr</a> | </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.deidentifier.arx.criteria</div>
<h2 title="Class PrivacyCriterion" class="title">Class PrivacyCriterion</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object</li>
<li>
<ul class="inheritance">
<li>org.deidentifier.arx.criteria.PrivacyCriterion</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Implemented Interfaces:</dt>
<dd>java.io.Serializable</dd>
</dl>
<dl>
<dt>Direct Known Subclasses:</dt>
<dd><a href="../../../../org/deidentifier/arx/criteria/ExplicitPrivacyCriterion.html" title="class in org.deidentifier.arx.criteria">ExplicitPrivacyCriterion</a>, <a href="../../../../org/deidentifier/arx/criteria/ImplicitPrivacyCriterion.html" title="class in org.deidentifier.arx.criteria">ImplicitPrivacyCriterion</a>, <a href="../../../../org/deidentifier/arx/criteria/SampleBasedCriterion.html" title="class in org.deidentifier.arx.criteria">SampleBasedCriterion</a></dd>
</dl>
<hr>
<br>
<pre>public abstract class <span class="strong">PrivacyCriterion</span>
extends java.lang.Object
implements java.io.Serializable</pre>
<div class="block">An abstract base class for privacy criteria.</div>
<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../serialized-form.html#org.deidentifier.arx.criteria.PrivacyCriterion">Serialized Form</a></dd></dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_summary">
<!-- -->
</a>
<h3>Constructor Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><strong><a href="../../../../org/deidentifier/arx/criteria/PrivacyCriterion.html#PrivacyCriterion(boolean,%20boolean)">PrivacyCriterion</a></strong>(boolean monotonicWithSuppression,
boolean monotonicWithGeneralization)</code>
<div class="block">Instantiates a new criterion.</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method_summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span>Methods</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>abstract <a href="../../../../org/deidentifier/arx/criteria/PrivacyCriterion.html" title="class in org.deidentifier.arx.criteria">PrivacyCriterion</a></code></td>
<td class="colLast"><code><strong><a href="../../../../org/deidentifier/arx/criteria/PrivacyCriterion.html#clone()">clone</a></strong>()</code>
<div class="block">Clone</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../org/deidentifier/arx/ARXPopulationModel.html" title="class in org.deidentifier.arx">ARXPopulationModel</a></code></td>
<td class="colLast"><code><strong><a href="../../../../org/deidentifier/arx/criteria/PrivacyCriterion.html#getPopulationModel()">getPopulationModel</a></strong>()</code>
<div class="block">Returns the associated population model, <code>null</code> if there is none.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>abstract int</code></td>
<td class="colLast"><code><strong><a href="../../../../org/deidentifier/arx/criteria/PrivacyCriterion.html#getRequirements()">getRequirements</a></strong>()</code>
<div class="block">Returns the criterion's requirements.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>double</code></td>
<td class="colLast"><code><strong><a href="../../../../org/deidentifier/arx/criteria/PrivacyCriterion.html#getRiskThresholdJournalist()">getRiskThresholdJournalist</a></strong>()</code>
<div class="block">Return journalist risk threshold, 1 if there is none</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>double</code></td>
<td class="colLast"><code><strong><a href="../../../../org/deidentifier/arx/criteria/PrivacyCriterion.html#getRiskThresholdMarketer()">getRiskThresholdMarketer</a></strong>()</code>
<div class="block">Return marketer risk threshold, 1 if there is none</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>double</code></td>
<td class="colLast"><code><strong><a href="../../../../org/deidentifier/arx/criteria/PrivacyCriterion.html#getRiskThresholdProsecutor()">getRiskThresholdProsecutor</a></strong>()</code>
<div class="block">Return prosecutor risk threshold, 1 if there is none</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../org/deidentifier/arx/DataSubset.html" title="class in org.deidentifier.arx">DataSubset</a></code></td>
<td class="colLast"><code><strong><a href="../../../../org/deidentifier/arx/criteria/PrivacyCriterion.html#getSubset()">getSubset</a></strong>()</code>
<div class="block">Returns a research subset, <code>null</code> if no subset is available</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../org/deidentifier/arx/criteria/PrivacyCriterion.html#initialize(org.deidentifier.arx.framework.data.DataManager)">initialize</a></strong>(<a href="../../../../org/deidentifier/arx/framework/data/DataManager.html" title="class in org.deidentifier.arx.framework.data">DataManager</a> manager)</code>
<div class="block">Override this to initialize the criterion.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>abstract boolean</code></td>
<td class="colLast"><code><strong><a href="../../../../org/deidentifier/arx/criteria/PrivacyCriterion.html#isAnonymous(org.deidentifier.arx.framework.check.groupify.HashGroupifyEntry)">isAnonymous</a></strong>(<a href="../../../../org/deidentifier/arx/framework/check/groupify/HashGroupifyEntry.html" title="class in org.deidentifier.arx.framework.check.groupify">HashGroupifyEntry</a> entry)</code>
<div class="block">Implement this, to enforce the criterion.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>abstract boolean</code></td>
<td class="colLast"><code><strong><a href="../../../../org/deidentifier/arx/criteria/PrivacyCriterion.html#isLocalRecodingSupported()">isLocalRecodingSupported</a></strong>()</code>
<div class="block">Returns whether the criterion supports local recoding.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><strong><a href="../../../../org/deidentifier/arx/criteria/PrivacyCriterion.html#isMonotonicWithGeneralization()">isMonotonicWithGeneralization</a></strong>()</code>
<div class="block">Returns whether the criterion is monotonic with generalization.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><strong><a href="../../../../org/deidentifier/arx/criteria/PrivacyCriterion.html#isMonotonicWithSuppression()">isMonotonicWithSuppression</a></strong>()</code>
<div class="block">Returns whether the criterion is monotonic with tuple suppression.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><strong><a href="../../../../org/deidentifier/arx/criteria/PrivacyCriterion.html#isSampleBased()">isSampleBased</a></strong>()</code>
<div class="block">Is this criterion based on the overall sample</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>abstract java.lang.String</code></td>
<td class="colLast"><code><strong><a href="../../../../org/deidentifier/arx/criteria/PrivacyCriterion.html#toString()">toString</a></strong>()</code>
<div class="block">Returns a string representation.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_java.lang.Object">
<!-- -->
</a>
<h3>Methods inherited from class java.lang.Object</h3>
<code>equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait</code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_detail">
<!-- -->
</a>
<h3>Constructor Detail</h3>
<a name="PrivacyCriterion(boolean, boolean)">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>PrivacyCriterion</h4>
<pre>public PrivacyCriterion(boolean monotonicWithSuppression,
boolean monotonicWithGeneralization)</pre>
<div class="block">Instantiates a new criterion.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>monotonicWithSuppression</code> - </dd><dd><code>monotonicWithGeneralization</code> - </dd></dl>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method_detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="clone()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>clone</h4>
<pre>public abstract <a href="../../../../org/deidentifier/arx/criteria/PrivacyCriterion.html" title="class in org.deidentifier.arx.criteria">PrivacyCriterion</a> clone()</pre>
<div class="block">Clone</div>
<dl>
<dt><strong>Overrides:</strong></dt>
<dd><code>clone</code> in class <code>java.lang.Object</code></dd>
</dl>
</li>
</ul>
<a name="getPopulationModel()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getPopulationModel</h4>
<pre>public <a href="../../../../org/deidentifier/arx/ARXPopulationModel.html" title="class in org.deidentifier.arx">ARXPopulationModel</a> getPopulationModel()</pre>
<div class="block">Returns the associated population model, <code>null</code> if there is none.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>the populationModel</dd></dl>
</li>
</ul>
<a name="getRequirements()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getRequirements</h4>
<pre>public abstract int getRequirements()</pre>
<div class="block">Returns the criterion's requirements.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd></dd></dl>
</li>
</ul>
<a name="getRiskThresholdJournalist()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getRiskThresholdJournalist</h4>
<pre>public double getRiskThresholdJournalist()</pre>
<div class="block">Return journalist risk threshold, 1 if there is none</div>
<dl><dt><span class="strong">Returns:</span></dt><dd></dd></dl>
</li>
</ul>
<a name="getRiskThresholdMarketer()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getRiskThresholdMarketer</h4>
<pre>public double getRiskThresholdMarketer()</pre>
<div class="block">Return marketer risk threshold, 1 if there is none</div>
<dl><dt><span class="strong">Returns:</span></dt><dd></dd></dl>
</li>
</ul>
<a name="getRiskThresholdProsecutor()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getRiskThresholdProsecutor</h4>
<pre>public double getRiskThresholdProsecutor()</pre>
<div class="block">Return prosecutor risk threshold, 1 if there is none</div>
<dl><dt><span class="strong">Returns:</span></dt><dd></dd></dl>
</li>
</ul>
<a name="initialize(org.deidentifier.arx.framework.data.DataManager)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>initialize</h4>
<pre>public void initialize(<a href="../../../../org/deidentifier/arx/framework/data/DataManager.html" title="class in org.deidentifier.arx.framework.data">DataManager</a> manager)</pre>
<div class="block">Override this to initialize the criterion.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>manager</code> - </dd></dl>
</li>
</ul>
<a name="getSubset()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getSubset</h4>
<pre>public <a href="../../../../org/deidentifier/arx/DataSubset.html" title="class in org.deidentifier.arx">DataSubset</a> getSubset()</pre>
<div class="block">Returns a research subset, <code>null</code> if no subset is available</div>
<dl><dt><span class="strong">Returns:</span></dt><dd></dd></dl>
</li>
</ul>
<a name="isAnonymous(org.deidentifier.arx.framework.check.groupify.HashGroupifyEntry)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isAnonymous</h4>
<pre>public abstract boolean isAnonymous(<a href="../../../../org/deidentifier/arx/framework/check/groupify/HashGroupifyEntry.html" title="class in org.deidentifier.arx.framework.check.groupify">HashGroupifyEntry</a> entry)</pre>
<div class="block">Implement this, to enforce the criterion.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>entry</code> - </dd>
<dt><span class="strong">Returns:</span></dt><dd></dd></dl>
</li>
</ul>
<a name="isLocalRecodingSupported()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isLocalRecodingSupported</h4>
<pre>public abstract boolean isLocalRecodingSupported()</pre>
<div class="block">Returns whether the criterion supports local recoding.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd></dd></dl>
</li>
</ul>
<a name="isMonotonicWithGeneralization()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isMonotonicWithGeneralization</h4>
<pre>public boolean isMonotonicWithGeneralization()</pre>
<div class="block">Returns whether the criterion is monotonic with generalization.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd></dd></dl>
</li>
</ul>
<a name="isMonotonicWithSuppression()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isMonotonicWithSuppression</h4>
<pre>public boolean isMonotonicWithSuppression()</pre>
<div class="block">Returns whether the criterion is monotonic with tuple suppression.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd></dd></dl>
</li>
</ul>
<a name="isSampleBased()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isSampleBased</h4>
<pre>public boolean isSampleBased()</pre>
<div class="block">Is this criterion based on the overall sample</div>
<dl><dt><span class="strong">Returns:</span></dt><dd></dd></dl>
</li>
</ul>
<a name="toString()">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>toString</h4>
<pre>public abstract java.lang.String toString()</pre>
<div class="block">Returns a string representation.</div>
<dl>
<dt><strong>Overrides:</strong></dt>
<dd><code>toString</code> in class <code>java.lang.Object</code></dd>
<dt><span class="strong">Returns:</span></dt><dd></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><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/PrivacyCriterion.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../org/deidentifier/arx/criteria/PopulationUniqueness.html" title="class in org.deidentifier.arx.criteria"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../../org/deidentifier/arx/criteria/RecursiveCLDiversity.html" title="class in org.deidentifier.arx.criteria"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/deidentifier/arx/criteria/PrivacyCriterion.html" target="_top">Frames</a></li>
<li><a href="PrivacyCriterion.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary: </li>
<li>Nested | </li>
<li>Field | </li>
<li><a href="#constructor_summary">Constr</a> | </li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li>Field | </li>
<li><a href="#constructor_detail">Constr</a> | </li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>
|
fstahnke/arx
|
doc/dev/org/deidentifier/arx/criteria/PrivacyCriterion.html
|
HTML
|
apache-2.0
| 20,938
|
package org.wikipedia.wikidata;
import org.junit.Test;
import org.wikipedia.WikipediaApp;
import org.wikipedia.dataclient.WikiSite;
import org.wikipedia.page.PageTitle;
import org.wikipedia.testlib.TestLatch;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.notNullValue;
import static org.wikipedia.test.TestUtil.runOnMainSync;
/**
* Tests retrieval of Wikidata descriptions through enwiki.
*/
public class GetDescriptionsTaskTest {
private static final WikiSite WIKI = WikiSite.forLanguageCode("en");
@Test public void testOneTitle() throws Throwable {
getWikidataDescriptions(new PageTitle[] {
new PageTitle("Test", WIKI)}
);
}
@Test public void testThreeTitles() {
getWikidataDescriptions(new PageTitle[] {
new PageTitle("SAT", WIKI),
new PageTitle("Miller–Rabin primality test", WIKI),
new PageTitle("Radiocarbon dating", WIKI)
});
}
private void getWikidataDescriptions(final PageTitle[] ids) {
final List<PageTitle> idList = new ArrayList<>(Arrays.asList(ids));
final TestLatch latch = new TestLatch();
runOnMainSync(new Runnable() {
@Override
public void run() {
WikipediaApp app = WikipediaApp.getInstance();
new GetDescriptionsTask(app.getAPIForSite(WIKI), WIKI, idList) {
@Override
public void onFinish(Map<PageTitle, Void> descriptionsMap) {
assertThat(descriptionsMap, notNullValue());
assertThat(descriptionsMap.size(), is(idList.size()));
for (PageTitle title : idList) {
assertThat(title.getDescription(), notNullValue());
}
latch.countDown();
}
}.execute();
}
});
latch.await();
}
}
|
SAGROUP2/apps-android-wikipedia
|
app/src/androidTest/java/org/wikipedia/wikidata/GetDescriptionsTaskTest.java
|
Java
|
apache-2.0
| 2,146
|
package org.springside.examples.showcase.demos.schedule;
import static org.junit.Assert.*;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.springframework.test.annotation.DirtiesContext;
import org.springframework.test.context.ContextConfiguration;
import org.springside.examples.showcase.demos.schedule.QuartzClusterableJob;
import org.springside.modules.test.category.UnStable;
import org.springside.modules.test.log.Log4jMockAppender;
import org.springside.modules.test.spring.SpringTransactionalTestCase;
import org.springside.modules.utils.Threads;
/**
* Quartz可集群Timer Job测试.
*
* @author calvin
*/
@Category(UnStable.class)
@DirtiesContext
@ContextConfiguration(locations = { "/applicationContext.xml", "/schedule/applicationContext-quartz-timer-cluster.xml" })
public class QuartzTimerClusterJobTest extends SpringTransactionalTestCase {
@Test
public void scheduleJob() throws Exception {
//加载测试用logger appender
Log4jMockAppender appender = new Log4jMockAppender();
appender.addToLogger(QuartzClusterableJob.class);
//等待任务延时启动
Threads.sleep(4000);
//验证任务已执行
assertEquals(1, appender.getLogsCount());
assertEquals("There are 6 user in database, printed by quartz cluster job on node default.",
appender.getFirstMessage());
appender.removeFromLogger(QuartzClusterableJob.class);
}
}
|
liuweizaixian/springside4
|
examples/showcase/src/test/java/org/springside/examples/showcase/demos/schedule/QuartzTimerClusterJobTest.java
|
Java
|
apache-2.0
| 1,414
|
package org.apereo.cas.support.events;
import org.apereo.cas.authentication.CoreAuthenticationTestUtils;
import org.apereo.cas.authentication.DefaultAuthenticationTransaction;
import org.apereo.cas.mock.MockTicketGrantingTicket;
import org.apereo.cas.support.events.authentication.CasAuthenticationPolicyFailureEvent;
import org.apereo.cas.support.events.authentication.CasAuthenticationTransactionFailureEvent;
import org.apereo.cas.support.events.authentication.adaptive.CasRiskyAuthenticationDetectedEvent;
import org.apereo.cas.support.events.config.CasCoreEventsConfiguration;
import org.apereo.cas.support.events.dao.AbstractCasEventRepository;
import org.apereo.cas.support.events.dao.CasEvent;
import org.apereo.cas.support.events.ticket.CasTicketGrantingTicketCreatedEvent;
import org.apereo.cas.util.CollectionUtils;
import org.apereo.cas.util.HttpRequestUtils;
import lombok.val;
import org.apereo.inspektr.common.web.ClientInfo;
import org.apereo.inspektr.common.web.ClientInfoHolder;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.context.TestConfiguration;
import org.springframework.cloud.autoconfigure.RefreshAutoConfiguration;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Lazy;
import org.springframework.mock.web.MockHttpServletRequest;
import javax.security.auth.login.FailedLoginException;
import java.util.Collection;
import java.util.LinkedHashSet;
import static org.junit.jupiter.api.Assertions.*;
/**
* This is {@link DefaultCasEventListenerTests}.
*
* @author Misagh Moayyed
* @since 5.3.0
*/
@SpringBootTest(classes = {
DefaultCasEventListenerTests.EventTestConfiguration.class,
CasCoreEventsConfiguration.class,
RefreshAutoConfiguration.class
})
@Tag("Simple")
public class DefaultCasEventListenerTests {
@Autowired
private ConfigurableApplicationContext applicationContext;
@Autowired
@Qualifier("casEventRepository")
private CasEventRepository casEventRepository;
@BeforeEach
public void initialize() {
val request = new MockHttpServletRequest();
request.setRemoteAddr("123.456.789.000");
request.setLocalAddr("123.456.789.000");
request.addHeader(HttpRequestUtils.USER_AGENT_HEADER, "test");
ClientInfoHolder.setClientInfo(new ClientInfo(request));
}
@Test
public void verifyCasAuthenticationTransactionFailureEvent() {
val event = new CasAuthenticationTransactionFailureEvent(this,
CollectionUtils.wrap("error", new FailedLoginException()),
CollectionUtils.wrap(CoreAuthenticationTestUtils.getCredentialsWithSameUsernameAndPassword()));
applicationContext.publishEvent(event);
assertFalse(casEventRepository.load().isEmpty());
}
@Test
public void verifyTicketGrantingTicketCreated() {
val tgt = new MockTicketGrantingTicket("casuser");
val event = new CasTicketGrantingTicketCreatedEvent(this, tgt);
applicationContext.publishEvent(event);
assertFalse(casEventRepository.load().isEmpty());
}
@Test
public void verifyCasAuthenticationPolicyFailureEvent() {
val event = new CasAuthenticationPolicyFailureEvent(this,
CollectionUtils.wrap("error", new FailedLoginException()),
new DefaultAuthenticationTransaction(CoreAuthenticationTestUtils.getService(),
CollectionUtils.wrap(CoreAuthenticationTestUtils.getCredentialsWithSameUsernameAndPassword())),
CoreAuthenticationTestUtils.getAuthentication());
applicationContext.publishEvent(event);
assertFalse(casEventRepository.load().isEmpty());
}
@Test
public void verifyCasRiskyAuthenticationDetectedEvent() {
val event = new CasRiskyAuthenticationDetectedEvent(this,
CoreAuthenticationTestUtils.getAuthentication(),
CoreAuthenticationTestUtils.getRegisteredService(),
new Object());
applicationContext.publishEvent(event);
assertFalse(casEventRepository.load().isEmpty());
}
@TestConfiguration("EventTestConfiguration")
@Lazy(false)
public static class EventTestConfiguration {
@Bean
public CasEventRepository casEventRepository() {
return new AbstractCasEventRepository(CasEventRepositoryFilter.noOp()) {
private final Collection<CasEvent> events = new LinkedHashSet<>();
@Override
public void saveInternal(final CasEvent event) {
events.add(event);
}
@Override
public Collection<CasEvent> load() {
return events;
}
};
}
}
}
|
pdrados/cas
|
core/cas-server-core-events/src/test/java/org/apereo/cas/support/events/DefaultCasEventListenerTests.java
|
Java
|
apache-2.0
| 5,093
|
namespace AH.ModuleController.UI.ACCMS.Reports.ParameterForms
{
partial class frmACCMSReportLedger
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
this.smartLabel1 = new AtiqsControlLibrary.SmartLabel();
this.cboCompany = new AtiqsControlLibrary.SmartComboBox();
this.lblLabel = new AtiqsControlLibrary.SmartLabel();
this.lvlStartDate = new AtiqsControlLibrary.SmartLabel();
this.lvlEndDate = new AtiqsControlLibrary.SmartLabel();
this.dtStartDate = new System.Windows.Forms.DateTimePicker();
this.dtEndDate = new System.Windows.Forms.DateTimePicker();
this.cboLedgerName = new System.Windows.Forms.ComboBox();
this.txtCodeAllocation = new System.Windows.Forms.TextBox();
this.DGLedger = new AtiqsControlLibrary.SmartDataGridView();
this.Column11 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column12 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.txtLName = new System.Windows.Forms.TextBox();
this.txtLCode = new System.Windows.Forms.TextBox();
this.lblName = new AtiqsControlLibrary.SmartLabel();
this.pnlMain.SuspendLayout();
this.pnlTop.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.DGLedger)).BeginInit();
this.SuspendLayout();
//
// btnClose
//
this.btnClose.Location = new System.Drawing.Point(473, 324);
//
// btnPrint
//
this.btnPrint.Location = new System.Drawing.Point(359, 324);
this.btnPrint.Click += new System.EventHandler(this.btnPrint_Click);
//
// frmLabel
//
this.frmLabel.Location = new System.Drawing.Point(240, 9);
this.frmLabel.Size = new System.Drawing.Size(0, 32);
this.frmLabel.Text = "";
//
// pnlMain
//
this.pnlMain.Controls.Add(this.DGLedger);
this.pnlMain.Controls.Add(this.lblName);
this.pnlMain.Controls.Add(this.txtLCode);
this.pnlMain.Controls.Add(this.txtLName);
this.pnlMain.Controls.Add(this.txtCodeAllocation);
this.pnlMain.Controls.Add(this.cboLedgerName);
this.pnlMain.Controls.Add(this.dtEndDate);
this.pnlMain.Controls.Add(this.dtStartDate);
this.pnlMain.Controls.Add(this.lvlStartDate);
this.pnlMain.Controls.Add(this.lvlEndDate);
this.pnlMain.Controls.Add(this.lblLabel);
this.pnlMain.Controls.Add(this.smartLabel1);
this.pnlMain.Controls.Add(this.cboCompany);
this.pnlMain.Location = new System.Drawing.Point(0, 60);
this.pnlMain.Size = new System.Drawing.Size(694, 261);
//
// pnlTop
//
this.pnlTop.Size = new System.Drawing.Size(584, 57);
//
// smartLabel1
//
this.smartLabel1.AutoSize = true;
this.smartLabel1.BackColor = System.Drawing.Color.Transparent;
this.smartLabel1.Font = new System.Drawing.Font("Book Antiqua", 9.75F, System.Drawing.FontStyle.Bold);
this.smartLabel1.Location = new System.Drawing.Point(103, 34);
this.smartLabel1.Name = "smartLabel1";
this.smartLabel1.Size = new System.Drawing.Size(109, 18);
this.smartLabel1.TabIndex = 27;
this.smartLabel1.Text = "Company Name:";
//
// cboCompany
//
this.cboCompany.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cboCompany.Font = new System.Drawing.Font("Microsoft Sans Serif", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.cboCompany.ForeColor = System.Drawing.Color.Blue;
this.cboCompany.FormattingEnabled = true;
this.cboCompany.Location = new System.Drawing.Point(223, 31);
this.cboCompany.Name = "cboCompany";
this.cboCompany.Size = new System.Drawing.Size(346, 26);
this.cboCompany.TabIndex = 26;
this.cboCompany.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.cboCompany_KeyPress);
//
// lblLabel
//
this.lblLabel.AutoSize = true;
this.lblLabel.BackColor = System.Drawing.Color.Transparent;
this.lblLabel.Font = new System.Drawing.Font("Book Antiqua", 9.75F, System.Drawing.FontStyle.Bold);
this.lblLabel.Location = new System.Drawing.Point(125, 81);
this.lblLabel.Name = "lblLabel";
this.lblLabel.Size = new System.Drawing.Size(87, 18);
this.lblLabel.TabIndex = 29;
this.lblLabel.Text = "Ledger Code:";
//
// lvlStartDate
//
this.lvlStartDate.AutoSize = true;
this.lvlStartDate.BackColor = System.Drawing.Color.Transparent;
this.lvlStartDate.Font = new System.Drawing.Font("Book Antiqua", 9.75F, System.Drawing.FontStyle.Bold);
this.lvlStartDate.Location = new System.Drawing.Point(135, 182);
this.lvlStartDate.Name = "lvlStartDate";
this.lvlStartDate.Size = new System.Drawing.Size(71, 18);
this.lvlStartDate.TabIndex = 32;
this.lvlStartDate.Text = "Start Date:";
//
// lvlEndDate
//
this.lvlEndDate.AutoSize = true;
this.lvlEndDate.BackColor = System.Drawing.Color.Transparent;
this.lvlEndDate.Font = new System.Drawing.Font("Book Antiqua", 9.75F, System.Drawing.FontStyle.Bold);
this.lvlEndDate.Location = new System.Drawing.Point(365, 183);
this.lvlEndDate.Name = "lvlEndDate";
this.lvlEndDate.Size = new System.Drawing.Size(67, 18);
this.lvlEndDate.TabIndex = 33;
this.lvlEndDate.Text = "End Date:";
//
// dtStartDate
//
this.dtStartDate.Font = new System.Drawing.Font("Verdana", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.dtStartDate.Format = System.Windows.Forms.DateTimePickerFormat.Short;
this.dtStartDate.Location = new System.Drawing.Point(223, 179);
this.dtStartDate.Name = "dtStartDate";
this.dtStartDate.Size = new System.Drawing.Size(131, 26);
this.dtStartDate.TabIndex = 34;
this.dtStartDate.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.dtStartDate_KeyPress);
//
// dtEndDate
//
this.dtEndDate.Font = new System.Drawing.Font("Verdana", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.dtEndDate.Format = System.Windows.Forms.DateTimePickerFormat.Short;
this.dtEndDate.Location = new System.Drawing.Point(440, 179);
this.dtEndDate.Name = "dtEndDate";
this.dtEndDate.Size = new System.Drawing.Size(129, 26);
this.dtEndDate.TabIndex = 35;
this.dtEndDate.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.dtEndDate_KeyPress);
//
// cboLedgerName
//
this.cboLedgerName.Font = new System.Drawing.Font("Verdana", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.cboLedgerName.FormattingEnabled = true;
this.cboLedgerName.Location = new System.Drawing.Point(11, 59);
this.cboLedgerName.Name = "cboLedgerName";
this.cboLedgerName.Size = new System.Drawing.Size(42, 24);
this.cboLedgerName.TabIndex = 36;
this.cboLedgerName.Visible = false;
this.cboLedgerName.KeyUp += new System.Windows.Forms.KeyEventHandler(this.cboLedgerName_KeyUp);
//
// txtCodeAllocation
//
this.txtCodeAllocation.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.txtCodeAllocation.Font = new System.Drawing.Font("Verdana", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.txtCodeAllocation.Location = new System.Drawing.Point(223, 78);
this.txtCodeAllocation.Name = "txtCodeAllocation";
this.txtCodeAllocation.Size = new System.Drawing.Size(343, 27);
this.txtCodeAllocation.TabIndex = 37;
this.txtCodeAllocation.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtLName_KeyDown);
this.txtCodeAllocation.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.txtLName_KeyPress);
this.txtCodeAllocation.KeyUp += new System.Windows.Forms.KeyEventHandler(this.txtLName_KeyUp);
//
// DGLedger
//
this.DGLedger.AllowUserToAddRows = false;
this.DGLedger.AllowUserToDeleteRows = false;
this.DGLedger.AllowUserToOrderColumns = true;
this.DGLedger.AllowUserToResizeColumns = false;
this.DGLedger.AllowUserToResizeRows = false;
this.DGLedger.BackgroundColor = System.Drawing.Color.White;
this.DGLedger.ColumnHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.Single;
dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle1.BackColor = System.Drawing.Color.LightGreen;
dataGridViewCellStyle1.Font = new System.Drawing.Font("Tahoma", 8F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
dataGridViewCellStyle1.ForeColor = System.Drawing.Color.Black;
dataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
this.DGLedger.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle1;
this.DGLedger.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.DGLedger.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.Column11,
this.Column12,
this.Column1});
dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle3.BackColor = System.Drawing.Color.White;
dataGridViewCellStyle3.Font = new System.Drawing.Font("Tahoma", 8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
dataGridViewCellStyle3.ForeColor = System.Drawing.Color.Black;
dataGridViewCellStyle3.SelectionBackColor = System.Drawing.Color.Lavender;
dataGridViewCellStyle3.SelectionForeColor = System.Drawing.Color.Crimson;
dataGridViewCellStyle3.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
this.DGLedger.DefaultCellStyle = dataGridViewCellStyle3;
this.DGLedger.Location = new System.Drawing.Point(132, 107);
this.DGLedger.MultiSelect = false;
this.DGLedger.Name = "DGLedger";
this.DGLedger.RowHeadersVisible = false;
dataGridViewCellStyle4.BackColor = System.Drawing.Color.White;
this.DGLedger.RowsDefaultCellStyle = dataGridViewCellStyle4;
this.DGLedger.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
this.DGLedger.Size = new System.Drawing.Size(437, 140);
this.DGLedger.TabIndex = 143;
this.DGLedger.Visible = false;
this.DGLedger.DoubleClick += new System.EventHandler(this.DGLedger_DoubleClick);
this.DGLedger.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.DGLedger_KeyPress);
//
// Column11
//
dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.TopCenter;
this.Column11.DefaultCellStyle = dataGridViewCellStyle2;
this.Column11.HeaderText = "L Code";
this.Column11.Name = "Column11";
this.Column11.ReadOnly = true;
this.Column11.Width = 120;
//
// Column12
//
this.Column12.HeaderText = "Code";
this.Column12.Name = "Column12";
this.Column12.ReadOnly = true;
this.Column12.Visible = false;
//
// Column1
//
this.Column1.HeaderText = "Name";
this.Column1.Name = "Column1";
this.Column1.ReadOnly = true;
this.Column1.Width = 300;
//
// txtLName
//
this.txtLName.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.txtLName.Enabled = false;
this.txtLName.Font = new System.Drawing.Font("Verdana", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.txtLName.ForeColor = System.Drawing.SystemColors.Window;
this.txtLName.Location = new System.Drawing.Point(223, 111);
this.txtLName.Name = "txtLName";
this.txtLName.Size = new System.Drawing.Size(343, 27);
this.txtLName.TabIndex = 144;
//
// txtLCode
//
this.txtLCode.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.txtLCode.Font = new System.Drawing.Font("Verdana", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.txtLCode.Location = new System.Drawing.Point(48, 2);
this.txtLCode.Name = "txtLCode";
this.txtLCode.Size = new System.Drawing.Size(142, 27);
this.txtLCode.TabIndex = 145;
this.txtLCode.Visible = false;
//
// lblName
//
this.lblName.AutoSize = true;
this.lblName.BackColor = System.Drawing.Color.Transparent;
this.lblName.Font = new System.Drawing.Font("Book Antiqua", 9.75F, System.Drawing.FontStyle.Bold);
this.lblName.Location = new System.Drawing.Point(119, 114);
this.lblName.Name = "lblName";
this.lblName.Size = new System.Drawing.Size(93, 18);
this.lblName.TabIndex = 146;
this.lblName.Text = "Ledger Name:";
//
// frmACCMSReportLedger
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.ClientSize = new System.Drawing.Size(584, 386);
this.KeyPreview = false;
this.Name = "frmACCMSReportLedger";
this.Load += new System.EventHandler(this.frmACCMSReportLedger_Load);
this.pnlMain.ResumeLayout(false);
this.pnlMain.PerformLayout();
this.pnlTop.ResumeLayout(false);
this.pnlTop.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.DGLedger)).EndInit();
this.ResumeLayout(false);
}
#endregion
private AtiqsControlLibrary.SmartLabel smartLabel1;
private AtiqsControlLibrary.SmartComboBox cboCompany;
private AtiqsControlLibrary.SmartLabel lblLabel;
private AtiqsControlLibrary.SmartLabel lvlStartDate;
private AtiqsControlLibrary.SmartLabel lvlEndDate;
private System.Windows.Forms.DateTimePicker dtEndDate;
private System.Windows.Forms.DateTimePicker dtStartDate;
private System.Windows.Forms.ComboBox cboLedgerName;
private System.Windows.Forms.TextBox txtCodeAllocation;
private AtiqsControlLibrary.SmartDataGridView DGLedger;
private System.Windows.Forms.TextBox txtLName;
private System.Windows.Forms.TextBox txtLCode;
private AtiqsControlLibrary.SmartLabel lblName;
private System.Windows.Forms.DataGridViewTextBoxColumn Column11;
private System.Windows.Forms.DataGridViewTextBoxColumn Column12;
private System.Windows.Forms.DataGridViewTextBoxColumn Column1;
}
}
|
atiq-shumon/DotNetProjects
|
Hospital_ERP_VS13-WCF_WF/AH.ModuleController/UI/ACCMS/Reports/ParameterForms/frmACCMSReportLedger.Designer.cs
|
C#
|
apache-2.0
| 17,825
|
package com.azhuoinfo.cqurity.view.imageview.round;
import android.content.Context;
import android.content.res.ColorStateList;
import android.content.res.Resources;
import android.content.res.TypedArray;
import android.graphics.Bitmap;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.LayerDrawable;
import android.net.Uri;
import android.util.AttributeSet;
import android.util.Log;
import android.widget.ImageView;
import com.azhuoinfo.cqurity.R;
@SuppressWarnings("UnusedDeclaration")
public class RoundedImageView extends ImageView {
public static final String TAG = "RoundedImageView";
public static final float DEFAULT_RADIUS = 0f;
public static final float DEFAULT_BORDER_WIDTH = 0f;
private static final ScaleType[] SCALE_TYPES = { ScaleType.MATRIX,
ScaleType.FIT_XY, ScaleType.FIT_START, ScaleType.FIT_CENTER,
ScaleType.FIT_END, ScaleType.CENTER, ScaleType.CENTER_CROP,
ScaleType.CENTER_INSIDE };
private float cornerRadius = DEFAULT_RADIUS;
private float borderWidth = DEFAULT_BORDER_WIDTH;
private ColorStateList borderColor = ColorStateList
.valueOf(RoundedDrawable.DEFAULT_BORDER_COLOR);
private boolean isOval = false;
private boolean mutateBackground = false;
private int mResource;
private Drawable mDrawable;
private Drawable mBackgroundDrawable;
private ScaleType mScaleType;
public RoundedImageView(Context context) {
this(context, null, 0);
}
public RoundedImageView(Context context, AttributeSet attrs) {
this(context, attrs, 0);
}
public RoundedImageView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
TypedArray a = context.obtainStyledAttributes(attrs,
R.styleable.RoundedImageView, defStyle, 0);
int index = a
.getInt(R.styleable.RoundedImageView_android_scaleType, -1);
if (index >= 0) {
setScaleType(SCALE_TYPES[index]);
} else {
// default scaletype to FIT_CENTER
setScaleType(ScaleType.FIT_CENTER);
}
cornerRadius = a.getDimensionPixelSize(
R.styleable.RoundedImageView_corner_radius, -1);
borderWidth = a.getDimensionPixelSize(
R.styleable.RoundedImageView_border_width, -1);
// don't allow negative values for radius and border
if (cornerRadius < 0) {
cornerRadius = DEFAULT_RADIUS;
}
if (borderWidth < 0) {
borderWidth = DEFAULT_BORDER_WIDTH;
}
borderColor = a
.getColorStateList(R.styleable.RoundedImageView_border_color);
if (borderColor == null) {
borderColor = ColorStateList
.valueOf(RoundedDrawable.DEFAULT_BORDER_COLOR);
}
mutateBackground = a.getBoolean(
R.styleable.RoundedImageView_mutate_background, false);
isOval = a.getBoolean(R.styleable.RoundedImageView_oval, false);
updateDrawableAttrs();
updateBackgroundDrawableAttrs(true);
a.recycle();
}
@Override
protected void drawableStateChanged() {
super.drawableStateChanged();
invalidate();
}
/**
* Return the current scale type in use by this ImageView.
*
* @attr ref android.R.styleable#ImageView_scaleType
* @see android.widget.ImageView.ScaleType
*/
@Override
public ScaleType getScaleType() {
return mScaleType;
}
/**
* Controls how the image should be resized or moved to match the size of
* this ImageView.
*
* @param scaleType
* The desired scaling mode.
* @attr ref android.R.styleable#ImageView_scaleType
*/
@Override
public void setScaleType(ScaleType scaleType) {
assert scaleType != null;
if (mScaleType != scaleType) {
mScaleType = scaleType;
switch (scaleType) {
case CENTER:
case CENTER_CROP:
case CENTER_INSIDE:
case FIT_CENTER:
case FIT_START:
case FIT_END:
case FIT_XY:
super.setScaleType(ScaleType.FIT_XY);
break;
default:
super.setScaleType(scaleType);
break;
}
updateDrawableAttrs();
updateBackgroundDrawableAttrs(false);
invalidate();
}
}
@Override
public void setImageDrawable(Drawable drawable) {
mResource = 0;
mDrawable = RoundedDrawable.fromDrawable(drawable);
updateDrawableAttrs();
super.setImageDrawable(mDrawable);
}
@Override
public void setImageBitmap(Bitmap bm) {
mResource = 0;
mDrawable = RoundedDrawable.fromBitmap(bm);
updateDrawableAttrs();
super.setImageDrawable(mDrawable);
}
@Override
public void setImageResource(int resId) {
if (mResource != resId) {
mResource = resId;
mDrawable = resolveResource();
updateDrawableAttrs();
super.setImageDrawable(mDrawable);
}
}
@Override
public void setImageURI(Uri uri) {
super.setImageURI(uri);
setImageDrawable(getDrawable());
}
private Drawable resolveResource() {
Resources rsrc = getResources();
if (rsrc == null) {
return null;
}
Drawable d = null;
if (mResource != 0) {
try {
d = rsrc.getDrawable(mResource);
} catch (Exception e) {
Log.w(TAG, "Unable to find resource: " + mResource, e);
// Don't try again.
mResource = 0;
}
}
return RoundedDrawable.fromDrawable(d);
}
@Override
public void setBackground(Drawable background) {
setBackgroundDrawable(background);
}
private void updateDrawableAttrs() {
updateAttrs(mDrawable);
}
private void updateBackgroundDrawableAttrs(boolean convert) {
if (mutateBackground) {
if (convert) {
mBackgroundDrawable = RoundedDrawable
.fromDrawable(mBackgroundDrawable);
}
updateAttrs(mBackgroundDrawable);
}
}
private void updateAttrs(Drawable drawable) {
if (drawable == null) {
return;
}
if (drawable instanceof RoundedDrawable) {
((RoundedDrawable) drawable).setScaleType(mScaleType)
.setCornerRadius(cornerRadius).setBorderWidth(borderWidth)
.setBorderColor(borderColor).setOval(isOval);
} else if (drawable instanceof LayerDrawable) {
// loop through layers to and set drawable attrs
LayerDrawable ld = ((LayerDrawable) drawable);
for (int i = 0, layers = ld.getNumberOfLayers(); i < layers; i++) {
updateAttrs(ld.getDrawable(i));
}
}
}
@Override
@Deprecated
public void setBackgroundDrawable(Drawable background) {
mBackgroundDrawable = background;
updateBackgroundDrawableAttrs(true);
super.setBackgroundDrawable(mBackgroundDrawable);
}
public float getCornerRadius() {
return cornerRadius;
}
public void setCornerRadius(int resId) {
setCornerRadius(getResources().getDimension(resId));
}
public void setCornerRadius(float radius) {
if (cornerRadius == radius) {
return;
}
cornerRadius = radius;
updateDrawableAttrs();
updateBackgroundDrawableAttrs(false);
}
public float getBorderWidth() {
return borderWidth;
}
public void setBorderWidth(int resId) {
setBorderWidth(getResources().getDimension(resId));
}
public void setBorderWidth(float width) {
if (borderWidth == width) {
return;
}
borderWidth = width;
updateDrawableAttrs();
updateBackgroundDrawableAttrs(false);
invalidate();
}
public int getBorderColor() {
return borderColor.getDefaultColor();
}
public void setBorderColor(int color) {
setBorderColor(ColorStateList.valueOf(color));
}
public ColorStateList getBorderColors() {
return borderColor;
}
public void setBorderColor(ColorStateList colors) {
if (borderColor.equals(colors)) {
return;
}
borderColor = (colors != null) ? colors : ColorStateList
.valueOf(RoundedDrawable.DEFAULT_BORDER_COLOR);
updateDrawableAttrs();
updateBackgroundDrawableAttrs(false);
if (borderWidth > 0) {
invalidate();
}
}
public boolean isOval() {
return isOval;
}
public void setOval(boolean oval) {
isOval = oval;
updateDrawableAttrs();
updateBackgroundDrawableAttrs(false);
invalidate();
}
public boolean isMutateBackground() {
return mutateBackground;
}
public void setMutateBackground(boolean mutate) {
if (mutateBackground == mutate) {
return;
}
mutateBackground = mutate;
updateBackgroundDrawableAttrs(true);
invalidate();
}
}
|
VuCant/CQurity
|
app/src/com/azhuoinfo/cqurity/view/imageview/round/RoundedImageView.java
|
Java
|
apache-2.0
| 7,908
|
---
layout: default
title: Welcome
---
|
kt4records/kt4records.github.io
|
index.html
|
HTML
|
apache-2.0
| 39
|
package io.teamed.quizz;
/**
* Saves a given text as string to a location which depends
* on the implementation.
*
* @author jerome
*
*/
@FunctionalInterface
public interface WriteableText {
/**
* @param content text to save
* @throws RuntimeException when could not be saved
*/
void save(String content);
}
|
jloisel/quiz
|
src/main/java/io/teamed/quizz/WriteableText.java
|
Java
|
apache-2.0
| 332
|
# -*- coding: utf-8 -*-
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# 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.
#
from collections import OrderedDict
import os
import re
from typing import Dict, Optional, Sequence, Tuple, Type, Union
import pkg_resources
from google.api_core import client_options as client_options_lib
from google.api_core import exceptions as core_exceptions
from google.api_core import gapic_v1
from google.api_core import retry as retries
from google.auth import credentials as ga_credentials # type: ignore
from google.auth.transport import mtls # type: ignore
from google.auth.transport.grpc import SslCredentials # type: ignore
from google.auth.exceptions import MutualTLSChannelError # type: ignore
from google.oauth2 import service_account # type: ignore
try:
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
except AttributeError: # pragma: NO COVER
OptionalRetry = Union[retries.Retry, object] # type: ignore
from google.cloud.errorreporting_v1beta1.types import report_errors_service
from .transports.base import ReportErrorsServiceTransport, DEFAULT_CLIENT_INFO
from .transports.grpc import ReportErrorsServiceGrpcTransport
from .transports.grpc_asyncio import ReportErrorsServiceGrpcAsyncIOTransport
class ReportErrorsServiceClientMeta(type):
"""Metaclass for the ReportErrorsService client.
This provides class-level methods for building and retrieving
support objects (e.g. transport) without polluting the client instance
objects.
"""
_transport_registry = (
OrderedDict()
) # type: Dict[str, Type[ReportErrorsServiceTransport]]
_transport_registry["grpc"] = ReportErrorsServiceGrpcTransport
_transport_registry["grpc_asyncio"] = ReportErrorsServiceGrpcAsyncIOTransport
def get_transport_class(
cls, label: str = None,
) -> Type[ReportErrorsServiceTransport]:
"""Returns an appropriate transport class.
Args:
label: The name of the desired transport. If none is
provided, then the first transport in the registry is used.
Returns:
The transport class to use.
"""
# If a specific transport is requested, return that one.
if label:
return cls._transport_registry[label]
# No transport is requested; return the default (that is, the first one
# in the dictionary).
return next(iter(cls._transport_registry.values()))
class ReportErrorsServiceClient(metaclass=ReportErrorsServiceClientMeta):
"""An API for reporting error events."""
@staticmethod
def _get_default_mtls_endpoint(api_endpoint):
"""Converts api endpoint to mTLS endpoint.
Convert "*.sandbox.googleapis.com" and "*.googleapis.com" to
"*.mtls.sandbox.googleapis.com" and "*.mtls.googleapis.com" respectively.
Args:
api_endpoint (Optional[str]): the api endpoint to convert.
Returns:
str: converted mTLS api endpoint.
"""
if not api_endpoint:
return api_endpoint
mtls_endpoint_re = re.compile(
r"(?P<name>[^.]+)(?P<mtls>\.mtls)?(?P<sandbox>\.sandbox)?(?P<googledomain>\.googleapis\.com)?"
)
m = mtls_endpoint_re.match(api_endpoint)
name, mtls, sandbox, googledomain = m.groups()
if mtls or not googledomain:
return api_endpoint
if sandbox:
return api_endpoint.replace(
"sandbox.googleapis.com", "mtls.sandbox.googleapis.com"
)
return api_endpoint.replace(".googleapis.com", ".mtls.googleapis.com")
DEFAULT_ENDPOINT = "clouderrorreporting.googleapis.com"
DEFAULT_MTLS_ENDPOINT = _get_default_mtls_endpoint.__func__( # type: ignore
DEFAULT_ENDPOINT
)
@classmethod
def from_service_account_info(cls, info: dict, *args, **kwargs):
"""Creates an instance of this client using the provided credentials
info.
Args:
info (dict): The service account private key info.
args: Additional arguments to pass to the constructor.
kwargs: Additional arguments to pass to the constructor.
Returns:
ReportErrorsServiceClient: The constructed client.
"""
credentials = service_account.Credentials.from_service_account_info(info)
kwargs["credentials"] = credentials
return cls(*args, **kwargs)
@classmethod
def from_service_account_file(cls, filename: str, *args, **kwargs):
"""Creates an instance of this client using the provided credentials
file.
Args:
filename (str): The path to the service account private key json
file.
args: Additional arguments to pass to the constructor.
kwargs: Additional arguments to pass to the constructor.
Returns:
ReportErrorsServiceClient: The constructed client.
"""
credentials = service_account.Credentials.from_service_account_file(filename)
kwargs["credentials"] = credentials
return cls(*args, **kwargs)
from_service_account_json = from_service_account_file
@property
def transport(self) -> ReportErrorsServiceTransport:
"""Returns the transport used by the client instance.
Returns:
ReportErrorsServiceTransport: The transport used by the client
instance.
"""
return self._transport
@staticmethod
def common_billing_account_path(billing_account: str,) -> str:
"""Returns a fully-qualified billing_account string."""
return "billingAccounts/{billing_account}".format(
billing_account=billing_account,
)
@staticmethod
def parse_common_billing_account_path(path: str) -> Dict[str, str]:
"""Parse a billing_account path into its component segments."""
m = re.match(r"^billingAccounts/(?P<billing_account>.+?)$", path)
return m.groupdict() if m else {}
@staticmethod
def common_folder_path(folder: str,) -> str:
"""Returns a fully-qualified folder string."""
return "folders/{folder}".format(folder=folder,)
@staticmethod
def parse_common_folder_path(path: str) -> Dict[str, str]:
"""Parse a folder path into its component segments."""
m = re.match(r"^folders/(?P<folder>.+?)$", path)
return m.groupdict() if m else {}
@staticmethod
def common_organization_path(organization: str,) -> str:
"""Returns a fully-qualified organization string."""
return "organizations/{organization}".format(organization=organization,)
@staticmethod
def parse_common_organization_path(path: str) -> Dict[str, str]:
"""Parse a organization path into its component segments."""
m = re.match(r"^organizations/(?P<organization>.+?)$", path)
return m.groupdict() if m else {}
@staticmethod
def common_project_path(project: str,) -> str:
"""Returns a fully-qualified project string."""
return "projects/{project}".format(project=project,)
@staticmethod
def parse_common_project_path(path: str) -> Dict[str, str]:
"""Parse a project path into its component segments."""
m = re.match(r"^projects/(?P<project>.+?)$", path)
return m.groupdict() if m else {}
@staticmethod
def common_location_path(project: str, location: str,) -> str:
"""Returns a fully-qualified location string."""
return "projects/{project}/locations/{location}".format(
project=project, location=location,
)
@staticmethod
def parse_common_location_path(path: str) -> Dict[str, str]:
"""Parse a location path into its component segments."""
m = re.match(r"^projects/(?P<project>.+?)/locations/(?P<location>.+?)$", path)
return m.groupdict() if m else {}
@classmethod
def get_mtls_endpoint_and_cert_source(
cls, client_options: Optional[client_options_lib.ClientOptions] = None
):
"""Return the API endpoint and client cert source for mutual TLS.
The client cert source is determined in the following order:
(1) if `GOOGLE_API_USE_CLIENT_CERTIFICATE` environment variable is not "true", the
client cert source is None.
(2) if `client_options.client_cert_source` is provided, use the provided one; if the
default client cert source exists, use the default one; otherwise the client cert
source is None.
The API endpoint is determined in the following order:
(1) if `client_options.api_endpoint` if provided, use the provided one.
(2) if `GOOGLE_API_USE_CLIENT_CERTIFICATE` environment variable is "always", use the
default mTLS endpoint; if the environment variabel is "never", use the default API
endpoint; otherwise if client cert source exists, use the default mTLS endpoint, otherwise
use the default API endpoint.
More details can be found at https://google.aip.dev/auth/4114.
Args:
client_options (google.api_core.client_options.ClientOptions): Custom options for the
client. Only the `api_endpoint` and `client_cert_source` properties may be used
in this method.
Returns:
Tuple[str, Callable[[], Tuple[bytes, bytes]]]: returns the API endpoint and the
client cert source to use.
Raises:
google.auth.exceptions.MutualTLSChannelError: If any errors happen.
"""
if client_options is None:
client_options = client_options_lib.ClientOptions()
use_client_cert = os.getenv("GOOGLE_API_USE_CLIENT_CERTIFICATE", "false")
use_mtls_endpoint = os.getenv("GOOGLE_API_USE_MTLS_ENDPOINT", "auto")
if use_client_cert not in ("true", "false"):
raise ValueError(
"Environment variable `GOOGLE_API_USE_CLIENT_CERTIFICATE` must be either `true` or `false`"
)
if use_mtls_endpoint not in ("auto", "never", "always"):
raise MutualTLSChannelError(
"Environment variable `GOOGLE_API_USE_MTLS_ENDPOINT` must be `never`, `auto` or `always`"
)
# Figure out the client cert source to use.
client_cert_source = None
if use_client_cert == "true":
if client_options.client_cert_source:
client_cert_source = client_options.client_cert_source
elif mtls.has_default_client_cert_source():
client_cert_source = mtls.default_client_cert_source()
# Figure out which api endpoint to use.
if client_options.api_endpoint is not None:
api_endpoint = client_options.api_endpoint
elif use_mtls_endpoint == "always" or (
use_mtls_endpoint == "auto" and client_cert_source
):
api_endpoint = cls.DEFAULT_MTLS_ENDPOINT
else:
api_endpoint = cls.DEFAULT_ENDPOINT
return api_endpoint, client_cert_source
def __init__(
self,
*,
credentials: Optional[ga_credentials.Credentials] = None,
transport: Union[str, ReportErrorsServiceTransport, None] = None,
client_options: Optional[client_options_lib.ClientOptions] = None,
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
) -> None:
"""Instantiates the report errors service client.
Args:
credentials (Optional[google.auth.credentials.Credentials]): The
authorization credentials to attach to requests. These
credentials identify the application to the service; if none
are specified, the client will attempt to ascertain the
credentials from the environment.
transport (Union[str, ReportErrorsServiceTransport]): The
transport to use. If set to None, a transport is chosen
automatically.
client_options (google.api_core.client_options.ClientOptions): Custom options for the
client. It won't take effect if a ``transport`` instance is provided.
(1) The ``api_endpoint`` property can be used to override the
default endpoint provided by the client. GOOGLE_API_USE_MTLS_ENDPOINT
environment variable can also be used to override the endpoint:
"always" (always use the default mTLS endpoint), "never" (always
use the default regular endpoint) and "auto" (auto switch to the
default mTLS endpoint if client certificate is present, this is
the default value). However, the ``api_endpoint`` property takes
precedence if provided.
(2) If GOOGLE_API_USE_CLIENT_CERTIFICATE environment variable
is "true", then the ``client_cert_source`` property can be used
to provide client certificate for mutual TLS transport. If
not provided, the default SSL client certificate will be used if
present. If GOOGLE_API_USE_CLIENT_CERTIFICATE is "false" or not
set, no client certificate will be used.
client_info (google.api_core.gapic_v1.client_info.ClientInfo):
The client info used to send a user-agent string along with
API requests. If ``None``, then default info will be used.
Generally, you only need to set this if you're developing
your own client library.
Raises:
google.auth.exceptions.MutualTLSChannelError: If mutual TLS transport
creation failed for any reason.
"""
if isinstance(client_options, dict):
client_options = client_options_lib.from_dict(client_options)
if client_options is None:
client_options = client_options_lib.ClientOptions()
api_endpoint, client_cert_source_func = self.get_mtls_endpoint_and_cert_source(
client_options
)
api_key_value = getattr(client_options, "api_key", None)
if api_key_value and credentials:
raise ValueError(
"client_options.api_key and credentials are mutually exclusive"
)
# Save or instantiate the transport.
# Ordinarily, we provide the transport, but allowing a custom transport
# instance provides an extensibility point for unusual situations.
if isinstance(transport, ReportErrorsServiceTransport):
# transport is a ReportErrorsServiceTransport instance.
if credentials or client_options.credentials_file or api_key_value:
raise ValueError(
"When providing a transport instance, "
"provide its credentials directly."
)
if client_options.scopes:
raise ValueError(
"When providing a transport instance, provide its scopes "
"directly."
)
self._transport = transport
else:
import google.auth._default # type: ignore
if api_key_value and hasattr(
google.auth._default, "get_api_key_credentials"
):
credentials = google.auth._default.get_api_key_credentials(
api_key_value
)
Transport = type(self).get_transport_class(transport)
self._transport = Transport(
credentials=credentials,
credentials_file=client_options.credentials_file,
host=api_endpoint,
scopes=client_options.scopes,
client_cert_source_for_mtls=client_cert_source_func,
quota_project_id=client_options.quota_project_id,
client_info=client_info,
always_use_jwt_access=True,
)
def report_error_event(
self,
request: Union[report_errors_service.ReportErrorEventRequest, dict] = None,
*,
project_name: str = None,
event: report_errors_service.ReportedErrorEvent = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> report_errors_service.ReportErrorEventResponse:
r"""Report an individual error event and record the event to a log.
This endpoint accepts **either** an OAuth token, **or** an `API
key <https://support.google.com/cloud/answer/6158862>`__ for
authentication. To use an API key, append it to the URL as the
value of a ``key`` parameter. For example:
``POST https://clouderrorreporting.googleapis.com/v1beta1/{projectName}/events:report?key=123ABC456``
**Note:** `Error Reporting </error-reporting>`__ is a global
service built on Cloud Logging and doesn't analyze logs stored
in regional log buckets or logs routed to other Google Cloud
projects.
For more information, see `Using Error Reporting with
regionalized logs </error-reporting/docs/regionalization>`__.
.. code-block:: python
from google.cloud import errorreporting_v1beta1
def sample_report_error_event():
# Create a client
client = errorreporting_v1beta1.ReportErrorsServiceClient()
# Initialize request argument(s)
event = errorreporting_v1beta1.ReportedErrorEvent()
event.message = "message_value"
request = errorreporting_v1beta1.ReportErrorEventRequest(
project_name="project_name_value",
event=event,
)
# Make the request
response = client.report_error_event(request=request)
# Handle the response
print(response)
Args:
request (Union[google.cloud.errorreporting_v1beta1.types.ReportErrorEventRequest, dict]):
The request object. A request for reporting an
individual error event.
project_name (str):
Required. The resource name of the Google Cloud Platform
project. Written as ``projects/{projectId}``, where
``{projectId}`` is the `Google Cloud Platform project
ID <https://support.google.com/cloud/answer/6158840>`__.
Example: // ``projects/my-project-123``.
This corresponds to the ``project_name`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
event (google.cloud.errorreporting_v1beta1.types.ReportedErrorEvent):
Required. The error event to be
reported.
This corresponds to the ``event`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
retry (google.api_core.retry.Retry): Designation of what errors, if any,
should be retried.
timeout (float): The timeout for this request.
metadata (Sequence[Tuple[str, str]]): Strings which should be
sent along with the request as metadata.
Returns:
google.cloud.errorreporting_v1beta1.types.ReportErrorEventResponse:
Response for reporting an individual
error event. Data may be added to this
message in the future.
"""
# Create or coerce a protobuf request object.
# Quick check: If we got a request object, we should *not* have
# gotten any keyword arguments that map to the request.
has_flattened_params = any([project_name, event])
if request is not None and has_flattened_params:
raise ValueError(
"If the `request` argument is set, then none of "
"the individual field arguments should be set."
)
# Minor optimization to avoid making a copy if the user passes
# in a report_errors_service.ReportErrorEventRequest.
# There's no risk of modifying the input as we've already verified
# there are no flattened fields.
if not isinstance(request, report_errors_service.ReportErrorEventRequest):
request = report_errors_service.ReportErrorEventRequest(request)
# If we have keyword arguments corresponding to fields on the
# request, apply these.
if project_name is not None:
request.project_name = project_name
if event is not None:
request.event = event
# Wrap the RPC method; this adds retry and timeout information,
# and friendly error handling.
rpc = self._transport._wrapped_methods[self._transport.report_error_event]
# Certain fields should be provided within the metadata header;
# add these here.
metadata = tuple(metadata) + (
gapic_v1.routing_header.to_grpc_metadata(
(("project_name", request.project_name),)
),
)
# Send the request.
response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
# Done; return the response.
return response
def __enter__(self):
return self
def __exit__(self, type, value, traceback):
"""Releases underlying transport's resources.
.. warning::
ONLY use as a context manager if the transport is NOT shared
with other clients! Exiting the with block will CLOSE the transport
and may cause errors in other clients!
"""
self.transport.close()
try:
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
gapic_version=pkg_resources.get_distribution(
"google-cloud-errorreporting",
).version,
)
except pkg_resources.DistributionNotFound:
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
__all__ = ("ReportErrorsServiceClient",)
|
googleapis/python-error-reporting
|
google/cloud/errorreporting_v1beta1/services/report_errors_service/client.py
|
Python
|
apache-2.0
| 22,790
|
/************************************************************
* °æÈ¨ËùÓÐ (c)2011, hxf<p>
* ÎļþÃû³Æ £ºOrderDishAdapter.java<p>
*
* ´´½¨Ê±¼ä £º2015Äê10ÔÂ17ÈÕ ÏÂÎç6:55:30
* µ±Ç°°æ±¾ºÅ£ºv1.0
************************************************************/
package com.example.orderservice.adapter;
import java.io.IOException;
import java.io.InputStream;
import java.util.List;
import com.example.orderservice.R;
import com.example.orderservice.model.DishInfoBean;
import android.content.Context;
import android.content.res.AssetManager;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.TextView;
/************************************************************
* ÄÚÈÝÕªÒª £º<p>
*
* ×÷Õß £ºhxf
* ´´½¨Ê±¼ä £º2015Äê10ÔÂ17ÈÕ ÏÂÎç6:55:30
* µ±Ç°°æ±¾ºÅ£ºv1.0
* ÀúÊ·¼Ç¼ :
* ÈÕÆÚ : 2015Äê10ÔÂ17ÈÕ ÏÂÎç6:55:30 ÐÞ¸ÄÈË£º
* ÃèÊö :
************************************************************/
public class OrderDishAdapter extends ArrayAdapter<DishInfoBean> {
private int resourceId;
private Context context;
//±»Ñ¡ÖеıêÖ¾
private int clickItem = -1;
public void setSelectedItem(int position){
clickItem = position;
}
/**
* ¹¹Ô캯Êý£ºOrderDishAdapter
* º¯Êý¹¦ÄÜ:
* ²ÎÊý˵Ã÷£º
* @param context
* @param resource
* @param objects
*/
public OrderDishAdapter(Context context, int resource, List<DishInfoBean> dishInfoList) {
super(context, resource, dishInfoList);
this.resourceId = resource;
this.context = context;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
DishInfoBean dishInfoBean = getItem(position);
if (convertView == null) {
convertView = LayoutInflater.from(getContext()).inflate(resourceId, parent, false);
}
ImageView imageView = (ImageView) convertView.findViewById(R.id.iv_dish_photo);
TextView textView = (TextView) convertView.findViewById(R.id.tv_dish_info);
TextView tvDishPrice = (TextView) convertView.findViewById(R.id.tv_dish_price);
//-----------------------------------------¡·
//»ñȡͼƬ·¾¶£¬°Ñ·¾¶±£´æÔÚÊý¾Ý¿â£¬È»ºó´ÓÊý¾Ý¿âÈ¡³ö·¾¶£¬»ñµÃͼƬµÄÊäÈëÁ÷£¬ÓÃBitmapFactory½âÎö³ÉBitmap Õâ¸ö¹ý³Ì³öÏÖÎÊÌâ
//-----------------------------------------¡·
//´ÓdishInfoBeanÖлñȡͼƬµÄ·¾¶£¨¸Ã·¾¶ÊÇ´æÔÚÊý¾Ý¿âPHOTO×Ö¶ÎÖУ©
String photoPath = dishInfoBean.getPhoto();
//ÓÃBitmap½âÎöÊäÈëÁ÷»ñµÃBitmap¶ÔÏó
Bitmap bitmap = getImageFromAssetsFile(photoPath);
//°ÑͼƬÉèÖøøImageView
imageView.setImageBitmap(bitmap);
//ÉèÖÃÑ¡ÖÐʱͼƬµÄ͸Ã÷¶È
if (clickItem == position) {
imageView.setImageAlpha(70);
}else{ //Èç¹û²»¼ÓelseÓï¾äµÄ»°£¬ÄÇôѡÖÐÒ»¸öͼƬºó£¬ÔÙÑ¡ÔñÒ»¸öͼƬʱ£¬Ç°ÄǸöͼƬ͸Ã÷¶È»¹ÊDZ»ÉèÖÃΪ70£¬Ò²¾ÍÊÇ˵±»Ñ¡Öкó²»Äָܻ´
imageView.setImageAlpha(255);
}
//´ÓdishInfoBeanÖлñµÃCURRENCY_TYPEËù¶ÔÓ¦µÄT_TABLE_DICTIONARY±íÖеĻõ±ÒÃû³Æ
String currencyTypeName = dishInfoBean.getCurrencyTypeName();
//»ñÈ¡²ËµÄ¼Û¸ñ
float price = dishInfoBean.getPrice();
//»ñÈ¡²ËµÄÃû×Ö
String dishName = dishInfoBean.getName();
//´ÓdishInfoBeanÖлñµÃUNITËù¶ÔÓ¦µÄT_TABLE_DICTIONARY±íÖеIJ˵ĵ¥Î»
String dishUnitName = dishInfoBean.getUnitName();
textView.setText(dishName);
tvDishPrice.setText(price+currencyTypeName+"/"+dishUnitName);
return convertView;
}
/**
* ´ÓAssetsÖжÁȡͼƬ
*/
private Bitmap getImageFromAssetsFile(String photoPath)
{
Bitmap image = null;
//Context.getResources() ·µ»Ø Resources¶ÔÏó
AssetManager am = context.getResources().getAssets();
try
{
InputStream is = am.open(photoPath);//ʹÓ÷¾¶»ñµÃÊäÈëÁ÷
image = BitmapFactory.decodeStream(is);
is.close();
}
catch (IOException e)
{
e.printStackTrace();
}
return image;
}
}
|
snsdTJ/order_dish
|
src/com/example/orderservice/adapter/OrderDishAdapter.java
|
Java
|
apache-2.0
| 3,992
|
/*
* Copyright 2016-present Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License. You may obtain
* a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
package com.facebook.buck.artifact_cache;
import com.facebook.buck.artifact_cache.config.ArtifactCacheMode;
import com.facebook.buck.artifact_cache.config.CacheReadMode;
import com.facebook.buck.core.cell.TestCellPathResolver;
import com.facebook.buck.core.model.impl.JsonTargetConfigurationSerializer;
import com.facebook.buck.core.parser.buildtargetparser.ParsingUnconfiguredBuildTargetFactory;
import com.facebook.buck.core.rulekey.RuleKey;
import com.facebook.buck.event.BuckEventBusForTests;
import com.facebook.buck.io.file.BorrowablePath;
import com.facebook.buck.io.file.LazyPath;
import com.facebook.buck.io.filesystem.impl.FakeProjectFilesystem;
import com.facebook.buck.slb.HttpService;
import com.facebook.buck.util.concurrent.FakeListeningExecutorService;
import com.google.common.collect.ImmutableSet;
import com.google.common.util.concurrent.ListenableFuture;
import com.google.common.util.concurrent.ListeningExecutorService;
import java.nio.file.Path;
import java.util.List;
import java.util.Optional;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.atomic.AtomicInteger;
import org.junit.Assert;
import org.junit.Test;
public class AbstractNetworkCacheTest {
@Test
public void testBigArtifactIsNotStored() throws InterruptedException, ExecutionException {
testStoreCall(0, Optional.of(10L), 11, 111);
}
@Test
public void testBigArtifactIsStored() throws InterruptedException, ExecutionException {
testStoreCall(2, Optional.of(10L), 5, 10);
}
@Test
public void testBigArtifactIsStoredWhenMaxIsNotDefined()
throws InterruptedException, ExecutionException {
testStoreCall(4, Optional.empty(), 5, 10, 100, 1000);
}
private void testStoreCall(
int expectStoreCallCount, Optional<Long> maxArtifactSizeBytes, int... artifactBytes)
throws InterruptedException, ExecutionException {
AtomicInteger storeCallCount = new AtomicInteger(0);
FakeProjectFilesystem filesystem = new FakeProjectFilesystem();
ListeningExecutorService service =
new FakeListeningExecutorService() {
@Override
public void execute(Runnable command) {
command.run();
}
};
HttpService httpService = new TestHttpService();
AbstractNetworkCache cache =
new AbstractNetworkCache(
NetworkCacheArgs.builder()
.setCacheName("AbstractNetworkCacheTest")
.setCacheMode(ArtifactCacheMode.http)
.setRepository("some_repository")
.setScheduleType("some_schedule_type")
.setFetchClient(httpService)
.setStoreClient(httpService)
.setCacheReadMode(CacheReadMode.READWRITE)
.setTargetConfigurationSerializer(new JsonTargetConfigurationSerializer())
.setUnconfiguredBuildTargetFactory(
target ->
new ParsingUnconfiguredBuildTargetFactory()
.create(TestCellPathResolver.get(filesystem), target))
.setProjectFilesystem(filesystem)
.setBuckEventBus(BuckEventBusForTests.newInstance())
.setHttpWriteExecutorService(service)
.setHttpFetchExecutorService(service)
.setErrorTextTemplate("super error message")
.setErrorTextLimit(100)
.setMaxStoreSizeBytes(maxArtifactSizeBytes)
.build()) {
@Override
protected FetchResult fetchImpl(RuleKey ruleKey, LazyPath output) {
return null;
}
@Override
protected MultiContainsResult multiContainsImpl(ImmutableSet<RuleKey> ruleKeys) {
return null;
}
@Override
protected StoreResult storeImpl(ArtifactInfo info, Path file) {
storeCallCount.incrementAndGet();
return StoreResult.builder().build();
}
@Override
protected MultiFetchResult multiFetchImpl(
Iterable<AbstractAsynchronousCache.FetchRequest> requests) {
return null;
}
@Override
protected CacheDeleteResult deleteImpl(List<RuleKey> ruleKeys) {
throw new RuntimeException("Delete operation is not supported");
}
};
for (int bytes : artifactBytes) {
Path path = filesystem.getPathForRelativePath("topspin_" + this.getClass().getName());
filesystem.writeBytesToPath(new byte[bytes], path);
ListenableFuture<Void> future =
cache.store(ArtifactInfo.builder().build(), BorrowablePath.notBorrowablePath(path));
future.get();
}
Assert.assertEquals(expectStoreCallCount, storeCallCount.get());
}
}
|
SeleniumHQ/buck
|
test/com/facebook/buck/artifact_cache/AbstractNetworkCacheTest.java
|
Java
|
apache-2.0
| 5,374
|
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Repsaj.Submerged.Common.SubscriptionSchema
{
public class TankModel
{
public string Name { get; set; }
public string DisplayName { get; set; }
public string Description { get; set; }
public int? OrderNumber { get; set; }
public TankModel(string name, string description)
{
this.Name = name;
this.Description = description;
}
public static TankModel BuildModel(string name, string description)
{
TankModel model = new TankModel(name, description);
return model;
}
}
}
|
jsiegmund/submerged
|
src/API/Repsaj.Submerged.API.Common/SubscriptionSchema/TankModel.cs
|
C#
|
apache-2.0
| 771
|
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.hadoop.hive.metastore.client;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.hive.metastore.IMetaStoreClient;
import org.apache.hadoop.hive.metastore.MetaStoreTestUtils;
import org.apache.hadoop.hive.metastore.annotation.MetastoreCheckinTest;
import org.apache.hadoop.hive.metastore.api.AlreadyExistsException;
import org.apache.hadoop.hive.metastore.api.Catalog;
import org.apache.hadoop.hive.metastore.api.Database;
import org.apache.hadoop.hive.metastore.api.FieldSchema;
import org.apache.hadoop.hive.metastore.api.InvalidObjectException;
import org.apache.hadoop.hive.metastore.api.MetaException;
import org.apache.hadoop.hive.metastore.api.Partition;
import org.apache.hadoop.hive.metastore.api.SerDeInfo;
import org.apache.hadoop.hive.metastore.api.SkewedInfo;
import org.apache.hadoop.hive.metastore.api.StorageDescriptor;
import org.apache.hadoop.hive.metastore.api.Table;
import org.apache.hadoop.hive.metastore.client.builder.CatalogBuilder;
import org.apache.hadoop.hive.metastore.client.builder.DatabaseBuilder;
import org.apache.hadoop.hive.metastore.client.builder.PartitionBuilder;
import org.apache.hadoop.hive.metastore.client.builder.TableBuilder;
import org.apache.hadoop.hive.metastore.minihms.AbstractMetaStoreService;
import org.apache.thrift.TException;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import com.google.common.collect.Lists;
/**
* Tests for creating partitions.
*/
@RunWith(Parameterized.class)
@Category(MetastoreCheckinTest.class)
public class TestAddPartitions extends MetaStoreClientTest {
private AbstractMetaStoreService metaStore;
private IMetaStoreClient client;
private static final String DB_NAME = "test_partition_db";
private static final String TABLE_NAME = "test_partition_table";
private static final String DEFAULT_PARAM_VALUE = "partparamvalue";
private static final String DEFAULT_PARAM_KEY = "partparamkey";
private static final String DEFAULT_YEAR_VALUE = "2017";
private static final String DEFAULT_COL_TYPE = "string";
private static final String YEAR_COL_NAME = "year";
private static final String MONTH_COL_NAME = "month";
private static final short MAX = -1;
public TestAddPartitions(String name, AbstractMetaStoreService metaStore) {
this.metaStore = metaStore;
}
@Before
public void setUp() throws Exception {
// Get new client
client = metaStore.getClient();
// Clean up the database
client.dropDatabase(DB_NAME, true, true, true);
metaStore.cleanWarehouseDirs();
new DatabaseBuilder().
setName(DB_NAME).
create(client, metaStore.getConf());
}
@After
public void tearDown() throws Exception {
try {
try {
client.close();
} catch (Exception e) {
// HIVE-19729: Shallow the exceptions based on the discussion in the Jira
}
} finally {
client = null;
}
}
// Tests for the Partition add_partition(Partition partition) method
@Test
public void testAddPartition() throws Exception {
Table table = createTable();
Partition partition =
buildPartition(Lists.newArrayList(DEFAULT_YEAR_VALUE), getYearPartCol(), 1);
Partition resultPart = client.add_partition(partition);
Assert.assertNotNull(resultPart);
verifyPartition(table, "year=2017", Lists.newArrayList(DEFAULT_YEAR_VALUE), 1);
}
@Test
public void testAddPartitionTwoValues() throws Exception {
String tableLocation = metaStore.getWarehouseRoot() + "/" + TABLE_NAME;
Table table = createTable(DB_NAME, TABLE_NAME, getYearAndMonthPartCols(), tableLocation);
Partition partition =
buildPartition(Lists.newArrayList("2017", "march"), getYearAndMonthPartCols(), 1);
client.add_partition(partition);
verifyPartition(table, "year=2017/month=march", Lists.newArrayList("2017", "march"), 1);
}
@Test
public void addPartitionOtherCatalog() throws TException {
String catName = "add_partition_catalog";
Catalog cat = new CatalogBuilder()
.setName(catName)
.setLocation(MetaStoreTestUtils.getTestWarehouseDir(catName))
.build();
client.createCatalog(cat);
String dbName = "add_partition_database_in_other_catalog";
Database db = new DatabaseBuilder()
.setName(dbName)
.setCatalogName(catName)
.create(client, metaStore.getConf());
String tableName = "table_in_other_catalog";
Table table = new TableBuilder()
.inDb(db)
.setTableName(tableName)
.addCol("id", "int")
.addCol("name", "string")
.addPartCol("partcol", "string")
.create(client, metaStore.getConf());
Partition[] parts = new Partition[5];
for (int i = 0; i < parts.length; i++) {
parts[i] = new PartitionBuilder()
.inTable(table)
.addValue("a" + i)
.build(metaStore.getConf());
}
client.add_partition(parts[0]);
Assert.assertEquals(2, client.add_partitions(Arrays.asList(parts[1], parts[2])));
client.add_partitions(Arrays.asList(parts), true, false);
for (int i = 0; i < parts.length; i++) {
Partition fetched = client.getPartition(catName, dbName, tableName,
Collections.singletonList("a" + i));
Assert.assertEquals(catName, fetched.getCatName());
Assert.assertEquals(dbName, fetched.getDbName());
Assert.assertEquals(tableName, fetched.getTableName());
}
client.dropDatabase(catName, dbName, true, true, true);
client.dropCatalog(catName);
}
@Test(expected = InvalidObjectException.class)
public void noSuchCatalog() throws TException {
String tableName = "table_for_no_such_catalog";
Table table = new TableBuilder()
.setTableName(tableName)
.addCol("id", "int")
.addCol("name", "string")
.addPartCol("partcol", "string")
.create(client, metaStore.getConf());
Partition part = new PartitionBuilder()
.inTable(table)
.addValue("a")
.build(metaStore.getConf());
// Explicitly mis-set the catalog name
part.setCatName("nosuch");
client.add_partition(part);
}
@Test
public void testAddPartitionWithDefaultAttributes() throws Exception {
Table table = createTable();
Partition partition = new PartitionBuilder()
.setDbName(DB_NAME)
.setTableName(TABLE_NAME)
.addValue("2017")
.setCols(getYearPartCol())
.addCol("test_id", "int", "test col id")
.addCol("test_value", "string", "test col value")
.build(metaStore.getConf());
client.add_partition(partition);
// Check if the default values are set for all unfilled attributes
Partition part = client.getPartition(DB_NAME, TABLE_NAME, "year=2017");
Assert.assertNotNull(part);
Assert.assertEquals(TABLE_NAME, part.getTableName());
Assert.assertEquals(DB_NAME, part.getDbName());
Assert.assertEquals(Lists.newArrayList("2017"), part.getValues());
List<FieldSchema> cols = new ArrayList<>();
cols.addAll(getYearPartCol());
cols.add(new FieldSchema("test_id", "int", "test col id"));
cols.add(new FieldSchema("test_value", "string", "test col value"));
Assert.assertEquals(cols, part.getSd().getCols());
verifyPartitionAttributesDefaultValues(part, table.getSd().getLocation());
}
@Test
public void testAddPartitionUpperCase() throws Exception {
String tableLocation = metaStore.getWarehouseRoot() + "/" + TABLE_NAME;
createTable(DB_NAME, TABLE_NAME, getMonthPartCol(), tableLocation);
Partition partition = buildPartition(Lists.newArrayList("APRIL"), getMonthPartCol(), 1);
client.add_partition(partition);
Partition part = client.getPartition(DB_NAME, TABLE_NAME, "month=APRIL");
Assert.assertNotNull(part);
Assert.assertEquals(TABLE_NAME, part.getTableName());
Assert.assertEquals(DB_NAME, part.getDbName());
Assert.assertEquals("APRIL", part.getValues().get(0));
Assert.assertEquals(tableLocation + "/month=APRIL", part.getSd().getLocation());
Assert.assertTrue(metaStore.isPathExists(new Path(part.getSd().getLocation())));
}
@Test
public void testAddPartitionUpperCaseDBAndTableName() throws Exception {
// Create table 'test_partition_db.test_add_part_table'
String tableName = "test_add_part_table";
String tableLocation = metaStore.getWarehouseRoot() + "/" + tableName.toUpperCase();
createTable(DB_NAME, tableName, getYearPartCol(), tableLocation);
// Create partition with table name 'TEST_ADD_PART_TABLE' and db name 'TEST_PARTITION_DB'
Partition partition = buildPartition(DB_NAME.toUpperCase(), tableName.toUpperCase(),
"2013", tableLocation + "/year=2013");
client.add_partition(partition);
// Validate the partition attributes
// The db and table name should be all lower case: 'test_partition_db' and
// 'test_add_part_table'
// The location should be saved case-sensitive, it should be
// warehouse dir + "TEST_ADD_PART_TABLE/year=2017"
Partition part = client.getPartition(DB_NAME, tableName, "year=2013");
Assert.assertNotNull(part);
Assert.assertEquals(tableName, part.getTableName());
Assert.assertEquals(DB_NAME, part.getDbName());
Assert.assertEquals(tableLocation + "/year=2013", part.getSd().getLocation());
Partition part1 = client.getPartition(DB_NAME.toUpperCase(), tableName.toUpperCase(), "year=2013");
Assert.assertEquals(part, part1);
}
@Test(expected = InvalidObjectException.class)
public void testAddPartitionNonExistingDb() throws Exception {
Partition partition = buildPartition("nonexistingdb", TABLE_NAME, DEFAULT_YEAR_VALUE);
client.add_partition(partition);
}
@Test(expected = InvalidObjectException.class)
public void testAddPartitionNonExistingTable() throws Exception {
Partition partition = buildPartition(DB_NAME, "nonexistingtable", DEFAULT_YEAR_VALUE);
client.add_partition(partition);
}
@Test(expected = MetaException.class)
public void testAddPartitionNullDb() throws Exception {
Partition partition = buildPartition(null, TABLE_NAME, DEFAULT_YEAR_VALUE);
client.add_partition(partition);
}
@Test(expected = MetaException.class)
public void testAddPartitionNullTable() throws Exception {
Partition partition = buildPartition(DB_NAME, null, DEFAULT_YEAR_VALUE);
client.add_partition(partition);
}
@Test(expected = InvalidObjectException.class)
public void testAddPartitionEmptyDb() throws Exception {
Partition partition = buildPartition("", TABLE_NAME, DEFAULT_YEAR_VALUE);
client.add_partition(partition);
}
@Test(expected = InvalidObjectException.class)
public void testAddPartitionEmptyTable() throws Exception {
Partition partition = buildPartition(DB_NAME, "", DEFAULT_YEAR_VALUE);
client.add_partition(partition);
}
@Test(expected = AlreadyExistsException.class)
public void testAddPartitionAlreadyExists() throws Exception {
createTable();
Partition partition1 = buildPartition(DB_NAME, TABLE_NAME, DEFAULT_YEAR_VALUE);
Partition partition2 = buildPartition(DB_NAME, TABLE_NAME, DEFAULT_YEAR_VALUE);
client.add_partition(partition1);
client.add_partition(partition2);
}
@Test
public void testAddPartitionsWithSameNameCaseSensitive() throws Exception {
createTable(DB_NAME, TABLE_NAME, getMonthPartCol(),
metaStore.getWarehouseRoot() + "/" + TABLE_NAME);
Partition partition1 = buildPartition(Lists.newArrayList("may"), getMonthPartCol(), 1);
Partition partition2 = buildPartition(Lists.newArrayList("MAY"), getMonthPartCol(), 2);
client.add_partition(partition1);
client.add_partition(partition2);
Partition part = client.getPartition(DB_NAME, TABLE_NAME, "month=MAY");
Assert.assertEquals(DEFAULT_PARAM_VALUE + "2",
part.getParameters().get(DEFAULT_PARAM_KEY + "2"));
Assert.assertEquals(metaStore.getWarehouseRoot() + "/" + TABLE_NAME + "/month=MAY",
part.getSd().getLocation());
}
@Test(expected = MetaException.class)
public void testAddPartitionNullSd() throws Exception {
createTable();
Partition partition = buildPartition(DB_NAME, TABLE_NAME, DEFAULT_YEAR_VALUE);
partition.setSd(null);
client.add_partition(partition);
}
@Test
public void testAddPartitionNullColsInSd() throws Exception {
createTable();
Partition partition = buildPartition(DB_NAME, TABLE_NAME, DEFAULT_YEAR_VALUE);
partition.getSd().setCols(null);
client.add_partition(partition);
// TODO: Not sure that this is the correct behavior. It doesn't make sense to create the
// partition without column info. This should be investigated later.
Partition part =
client.getPartition(DB_NAME, TABLE_NAME, Lists.newArrayList(DEFAULT_YEAR_VALUE));
Assert.assertNotNull(part);
Assert.assertNull(part.getSd().getCols());
}
@Test
public void testAddPartitionEmptyColsInSd() throws Exception {
createTable();
Partition partition = buildPartition(DB_NAME, TABLE_NAME, DEFAULT_YEAR_VALUE);
partition.getSd().setCols(new ArrayList<>());
client.add_partition(partition);
// TODO: Not sure that this is the correct behavior. It doesn't make sense to create the
// partition without column info. This should be investigated later.
Partition part =
client.getPartition(DB_NAME, TABLE_NAME, Lists.newArrayList(DEFAULT_YEAR_VALUE));
Assert.assertNotNull(part);
Assert.assertTrue(part.getSd().getCols().isEmpty());
}
@Test(expected = MetaException.class)
public void testAddPartitionNullColTypeInSd() throws Exception {
createTable();
Partition partition = buildPartition(DB_NAME, TABLE_NAME, DEFAULT_YEAR_VALUE);
partition.getSd().getCols().get(0).setType(null);
client.add_partition(partition);
}
@Test(expected = MetaException.class)
public void testAddPartitionNullColNameInSd() throws Exception {
createTable();
Partition partition = buildPartition(DB_NAME, TABLE_NAME, DEFAULT_YEAR_VALUE);
partition.getSd().getCols().get(0).setName(null);
client.add_partition(partition);
}
@Test
public void testAddPartitionInvalidColTypeInSd() throws Exception {
createTable();
Partition partition = buildPartition(DB_NAME, TABLE_NAME, DEFAULT_YEAR_VALUE);
partition.getSd().getCols().get(0).setType("xyz");
client.add_partition(partition);
// TODO: Not sure that this is the correct behavior. It doesn't make sense to create the
// partition with column with invalid type. This should be investigated later.
Partition part =
client.getPartition(DB_NAME, TABLE_NAME, Lists.newArrayList(DEFAULT_YEAR_VALUE));
Assert.assertNotNull(part);
Assert.assertEquals("xyz", part.getSd().getCols().get(0).getType());
}
@Test(expected = MetaException.class)
public void testAddPartitionEmptySerdeInfo() throws Exception {
createTable();
Partition partition = buildPartition(DB_NAME, TABLE_NAME, DEFAULT_YEAR_VALUE);
partition.getSd().setSerdeInfo(null);
client.add_partition(partition);
}
@Test
public void testAddPartitionNullLocation() throws Exception {
createTable(DB_NAME, TABLE_NAME, metaStore.getWarehouseRoot() + "/addparttest2");
Partition partition = buildPartition(DB_NAME, TABLE_NAME, DEFAULT_YEAR_VALUE, null);
client.add_partition(partition);
Partition part = client.getPartition(DB_NAME, TABLE_NAME, "year=2017");
Assert.assertEquals(metaStore.getWarehouseRoot() + "/addparttest2/year=2017",
part.getSd().getLocation());
Assert.assertTrue(metaStore.isPathExists(new Path(part.getSd().getLocation())));
}
@Test
public void testAddPartitionEmptyLocation() throws Exception {
createTable(DB_NAME, TABLE_NAME, metaStore.getWarehouseRoot() + "/addparttest3");
Partition partition = buildPartition(DB_NAME, TABLE_NAME, DEFAULT_YEAR_VALUE, "");
client.add_partition(partition);
Partition part = client.getPartition(DB_NAME, TABLE_NAME, "year=2017");
Assert.assertEquals(metaStore.getWarehouseRoot() + "/addparttest3/year=2017",
part.getSd().getLocation());
Assert.assertTrue(metaStore.isPathExists(new Path(part.getSd().getLocation())));
}
@Test
public void testAddPartitionNullLocationInTableToo() throws Exception {
createTable(DB_NAME, TABLE_NAME, null);
Partition partition = buildPartition(DB_NAME, TABLE_NAME, DEFAULT_YEAR_VALUE, null);
client.add_partition(partition);
Partition part = client.getPartition(DB_NAME, TABLE_NAME, "year=2017");
Assert.assertEquals(
metaStore.getWarehouseRoot() + "/test_partition_db.db/test_partition_table/year=2017",
part.getSd().getLocation());
Assert.assertTrue(metaStore.isPathExists(new Path(part.getSd().getLocation())));
}
@Test(expected = MetaException.class)
public void testAddPartitionForView() throws Exception {
String tableName = "test_add_partition_view";
createView(tableName);
Partition partition = buildPartition(DB_NAME, tableName, DEFAULT_YEAR_VALUE);
client.add_partition(partition);
}
@Test
public void testAddPartitionsForViewNullPartLocation() throws Exception {
String tableName = "test_add_partition_view";
createView(tableName);
Partition partition = buildPartition(DB_NAME, tableName, DEFAULT_YEAR_VALUE);
partition.getSd().setLocation(null);
List<Partition> partitions = Lists.newArrayList(partition);
client.add_partitions(partitions);
Partition part = client.getPartition(DB_NAME, tableName, "year=2017");
Assert.assertNull(part.getSd().getLocation());
}
@Test
public void testAddPartitionsForViewNullPartSd() throws Exception {
String tableName = "test_add_partition_view";
createView(tableName);
Partition partition = buildPartition(DB_NAME, tableName, DEFAULT_YEAR_VALUE);
partition.setSd(null);
List<Partition> partitions = Lists.newArrayList(partition);
client.add_partitions(partitions);
Partition part = client.getPartition(DB_NAME, tableName, "year=2017");
Assert.assertNull(part.getSd());
}
@Test
public void testAddPartitionForExternalTable() throws Exception {
String tableName = "part_add_ext_table";
String tableLocation = metaStore.getWarehouseRoot() + "/" + tableName;
String partitionLocation = tableLocation + "/addparttest";
createExternalTable(tableName, tableLocation);
Partition partition = buildPartition(DB_NAME, tableName, DEFAULT_YEAR_VALUE, partitionLocation);
client.add_partition(partition);
Partition resultPart =
client.getPartition(DB_NAME, tableName, Lists.newArrayList(DEFAULT_YEAR_VALUE));
Assert.assertNotNull(resultPart);
Assert.assertNotNull(resultPart.getSd());
Assert.assertEquals(partitionLocation, resultPart.getSd().getLocation());
}
@Test
public void testAddPartitionForExternalTableNullLocation() throws Exception {
String tableName = "part_add_ext_table";
createExternalTable(tableName, null);
Partition partition = buildPartition(DB_NAME, tableName, DEFAULT_YEAR_VALUE, null);
client.add_partition(partition);
Partition resultPart =
client.getPartition(DB_NAME, tableName, Lists.newArrayList(DEFAULT_YEAR_VALUE));
Assert.assertNotNull(resultPart);
Assert.assertNotNull(resultPart.getSd());
String defaultTableLocation = metaStore.getWarehouseRoot() + "/" + DB_NAME + ".db/" + tableName;
String defaulPartitionLocation = defaultTableLocation + "/year=2017";
Assert.assertEquals(defaulPartitionLocation, resultPart.getSd().getLocation());
}
@Test(expected = MetaException.class)
public void testAddPartitionTooManyValues() throws Exception {
createTable();
Partition partition = buildPartition(Lists.newArrayList(DEFAULT_YEAR_VALUE, "march"),
getYearAndMonthPartCols(), 1);
client.add_partition(partition);
}
@Test(expected = MetaException.class)
public void testAddPartitionNoPartColOnTable() throws Exception {
new TableBuilder()
.setDbName(DB_NAME)
.setTableName(TABLE_NAME)
.addCol("test_id", "int", "test col id")
.addCol("test_value", "string", "test col value")
.create(client, metaStore.getConf());
Partition partition = buildPartition(DB_NAME, TABLE_NAME, DEFAULT_YEAR_VALUE);
client.add_partition(partition);
}
@Test(expected=MetaException.class)
public void testAddPartitionNoColInPartition() throws Exception {
createTable();
Partition partition = new PartitionBuilder()
.setDbName(DB_NAME)
.setTableName(TABLE_NAME)
.addValue(DEFAULT_YEAR_VALUE)
.setLocation(metaStore.getWarehouseRoot() + "/addparttest")
.build(metaStore.getConf());
client.add_partition(partition);
}
@Test
public void testAddPartitionDifferentNamesAndTypesInColAndTableCol() throws Exception {
createTable();
Partition partition = new PartitionBuilder()
.setDbName(DB_NAME)
.setTableName(TABLE_NAME)
.addValue("1000")
.addCol("time", "int")
.build(metaStore.getConf());
client.add_partition(partition);
Partition part = client.getPartition(DB_NAME, TABLE_NAME, "year=1000");
Assert.assertNotNull(part);
Assert.assertEquals(TABLE_NAME, part.getTableName());
Assert.assertEquals("1000", part.getValues().get(0));
Assert.assertTrue(metaStore.isPathExists(new Path(part.getSd().getLocation())));
}
@Test(expected = MetaException.class)
public void testAddPartitionNoValueInPartition() throws Exception {
createTable();
Partition partition = new PartitionBuilder()
.setDbName(DB_NAME)
.setTableName(TABLE_NAME)
.addCol(YEAR_COL_NAME, DEFAULT_COL_TYPE)
.setLocation(metaStore.getWarehouseRoot() + "/addparttest")
.build(metaStore.getConf());
client.add_partition(partition);
}
@Test(expected = MetaException.class)
public void testAddPartitionMorePartColInTable() throws Exception {
createTable(DB_NAME, TABLE_NAME, getYearAndMonthPartCols(), null);
Partition partition = buildPartition(DB_NAME, TABLE_NAME, DEFAULT_YEAR_VALUE);
client.add_partition(partition);
}
@Test(expected = MetaException.class)
public void testAddPartitionNullPartition() throws Exception {
client.add_partition(null);
}
@Test(expected = MetaException.class)
public void testAddPartitionNullValues() throws Exception {
createTable();
Partition partition = buildPartition(DB_NAME, TABLE_NAME, null);
partition.setValues(null);
client.add_partition(partition);
}
@Test
public void testAddPartitionEmptyValue() throws Exception {
createTable();
Partition partition = buildPartition(DB_NAME, TABLE_NAME, "");
client.add_partition(partition);
List<String> partitionNames = client.listPartitionNames(DB_NAME, TABLE_NAME, (short) 10);
Assert.assertNotNull(partitionNames);
Assert.assertTrue(partitionNames.size() == 1);
Assert.assertEquals("year=__HIVE_DEFAULT_PARTITION__", partitionNames.get(0));
}
@Test(expected = MetaException.class)
public void testAddPartitionSetInvalidLocation() throws Exception {
createTable();
Partition partition =
buildPartition(DB_NAME, TABLE_NAME, DEFAULT_YEAR_VALUE, "%^#$$%#$testlocation/part1");
client.add_partition(partition);
}
// Tests for int add_partitions(List<Partition> partitions) method
@Test
public void testAddPartitions() throws Exception {
Table table = createTable();
List<Partition> partitions = new ArrayList<>();
Partition partition1 = buildPartition(Lists.newArrayList("2017"), getYearPartCol(), 1);
Partition partition2 = buildPartition(Lists.newArrayList("2016"), getYearPartCol(), 2);
Partition partition3 = buildPartition(Lists.newArrayList("2015"), getYearPartCol(), 3);
partitions.add(partition1);
partitions.add(partition2);
partitions.add(partition3);
int numberOfCreatedParts = client.add_partitions(partitions);
Assert.assertEquals(3, numberOfCreatedParts);
verifyPartition(table, "year=2017", Lists.newArrayList("2017"), 1);
verifyPartition(table, "year=2016", Lists.newArrayList("2016"), 2);
verifyPartition(table, "year=2015", Lists.newArrayList("2015"), 3);
}
@Test
public void testAddPartitionsMultipleValues() throws Exception {
Table table = createTable(DB_NAME, TABLE_NAME, getYearAndMonthPartCols(),
metaStore.getWarehouseRoot() + "/" + TABLE_NAME);
Partition partition1 =
buildPartition(Lists.newArrayList("2017", "march"), getYearAndMonthPartCols(), 1);
Partition partition2 =
buildPartition(Lists.newArrayList("2017", "june"), getYearAndMonthPartCols(), 2);
Partition partition3 =
buildPartition(Lists.newArrayList("2016", "march"), getYearAndMonthPartCols(), 3);
List<Partition> partitions = new ArrayList<>();
partitions.add(partition1);
partitions.add(partition2);
partitions.add(partition3);
client.add_partitions(partitions);
verifyPartition(table, "year=2017/month=march", Lists.newArrayList("2017", "march"), 1);
verifyPartition(table, "year=2017/month=june", Lists.newArrayList("2017", "june"), 2);
verifyPartition(table, "year=2016/month=march", Lists.newArrayList("2016", "march"), 3);
}
@Test
public void testAddPartitionsWithDefaultAttributes() throws Exception {
Table table = createTable();
Partition partition = new PartitionBuilder()
.setDbName(DB_NAME)
.setTableName(TABLE_NAME)
.addValue("2017")
.setCols(getYearPartCol())
.addCol("test_id", "int", "test col id")
.addCol("test_value", "string", "test col value")
.build(metaStore.getConf());
client.add_partitions(Lists.newArrayList(partition));
// Check if the default values are set for all unfilled attributes
List<Partition> parts =
client.getPartitionsByNames(DB_NAME, TABLE_NAME, Lists.newArrayList("year=2017"));
Assert.assertEquals(1, parts.size());
Partition part = parts.get(0);
Assert.assertNotNull(part);
Assert.assertEquals(TABLE_NAME, part.getTableName());
Assert.assertEquals(DB_NAME, part.getDbName());
Assert.assertEquals(Lists.newArrayList("2017"), part.getValues());
List<FieldSchema> cols = new ArrayList<>();
cols.addAll(getYearPartCol());
cols.add(new FieldSchema("test_id", "int", "test col id"));
cols.add(new FieldSchema("test_value", "string", "test col value"));
Assert.assertEquals(cols, part.getSd().getCols());
verifyPartitionAttributesDefaultValues(part, table.getSd().getLocation());
}
@Test
public void testAddPartitionsUpperCaseDBAndTableName() throws Exception {
// Create table 'test_partition_db.test_add_part_table'
String tableName = "test_add_part_table";
String tableLocation = metaStore.getWarehouseRoot() + "/" + tableName.toUpperCase();
createTable(DB_NAME, tableName, getYearPartCol(), tableLocation);
// Create partitions with table name 'TEST_ADD_PART_TABLE' and db name 'TEST_PARTITION_DB'
Partition partition1 = buildPartition(DB_NAME.toUpperCase(), tableName.toUpperCase(), "2017",
tableLocation + "/year=2017");
Partition partition2 = buildPartition(DB_NAME.toUpperCase(), tableName.toUpperCase(), "2018",
tableLocation + "/year=2018");
client.add_partitions(Lists.newArrayList(partition1, partition2));
// Validate the partitions attributes
// The db and table name should be all lower case: 'test_partition_db' and
// 'test_add_part_table'
// The location should be saved case-sensitive, it should be
// warehouse dir + "TEST_ADD_PART_TABLE/year=2017" and
// warehouse dir + "TEST_ADD_PART_TABLE/year=2018"
Partition part = client.getPartition(DB_NAME, tableName, "year=2017");
Assert.assertNotNull(part);
Assert.assertEquals(tableName, part.getTableName());
Assert.assertEquals(DB_NAME, part.getDbName());
Assert.assertEquals(tableLocation + "/year=2017", part.getSd().getLocation());
part = client.getPartition(DB_NAME, tableName, "year=2018");
Assert.assertNotNull(part);
Assert.assertEquals(tableName, part.getTableName());
Assert.assertEquals(DB_NAME, part.getDbName());
Assert.assertEquals(tableLocation + "/year=2018", part.getSd().getLocation());
}
@Test
public void testAddPartitionsUpperCaseDBAndTableNameInOnePart() throws Exception {
// Create table 'test_partition_db.test_add_part_table'
String tableName = "test_add_part_table";
String tableLocation = metaStore.getWarehouseRoot() + "/" + tableName.toUpperCase();
createTable(DB_NAME, tableName, getYearPartCol(), tableLocation);
// Create two partitions with table name 'test_add_part_table' and db name 'test_partition_db'
// Create one partition with table name 'TEST_ADD_PART_TABLE' and db name 'TEST_PARTITION_DB'
Partition partition1 = buildPartition(DB_NAME, tableName, "2017", tableLocation + "/year=2017");
Partition partition2 = buildPartition(DB_NAME.toUpperCase(), tableName.toUpperCase(), "2018",
tableLocation + "/year=2018");
Partition partition3 = buildPartition(DB_NAME, tableName, "2019", tableLocation + "/year=2019");
try {
client.add_partitions(Lists.newArrayList(partition1, partition2, partition3));
Assert.fail("MetaException should have been thrown.");
} catch (MetaException e) {
// Expected exception
}
List<String> partitionNames = client.listPartitionNames(DB_NAME, tableName, MAX);
Assert.assertNotNull(partitionNames);
Assert.assertTrue(partitionNames.isEmpty());
}
@Test(expected = MetaException.class)
public void testAddPartitionsNullList() throws Exception {
client.add_partitions(null);
}
@Test
public void testAddPartitionsEmptyList() throws Exception {
client.add_partitions(new ArrayList<>());
}
@Test(expected = MetaException.class)
public void testAddPartitionsDifferentTable() throws Exception {
String tableName1 = TABLE_NAME + "1";
String tableName2 = TABLE_NAME + "2";
createTable(DB_NAME, tableName1, null);
createTable(DB_NAME, tableName2, null);
Partition partition1 = buildPartition(DB_NAME, tableName1, "2017");
Partition partition2 = buildPartition(DB_NAME, tableName2, "2016");
Partition partition3 = buildPartition(DB_NAME, tableName1, "2018");
List<Partition> partitions = new ArrayList<>();
partitions.add(partition1);
partitions.add(partition2);
partitions.add(partition3);
client.add_partitions(partitions);
}
@Test
public void testAddPartitionsDifferentDBs() throws Exception {
createDB("parttestdb2");
createTable();
createTable("parttestdb2", TABLE_NAME, null);
Partition partition1 = buildPartition(DB_NAME, TABLE_NAME, "2017");
Partition partition2 = buildPartition("parttestdb2", TABLE_NAME, "2016");
Partition partition3 = buildPartition(DB_NAME, TABLE_NAME, "2018");
List<Partition> partitions = new ArrayList<>();
partitions.add(partition1);
partitions.add(partition2);
partitions.add(partition3);
try {
client.add_partitions(partitions);
Assert.fail("MetaException should have been thrown.");
} catch (MetaException e) {
// Expected exception
}
client.dropDatabase("parttestdb2", true, true, true);
}
@Test
public void testAddPartitionsDuplicateInTheList() throws Exception {
createTable();
List<Partition> partitions = buildPartitions(DB_NAME, TABLE_NAME,
Lists.newArrayList("2014", "2015", "2017", "2017", "2018", "2019"));
try {
client.add_partitions(partitions);
Assert.fail("MetaException should have happened.");
} catch (MetaException e) {
// Expected exception
}
List<Partition> parts = client.listPartitions(DB_NAME, TABLE_NAME, MAX);
Assert.assertNotNull(parts);
Assert.assertTrue(parts.isEmpty());
for (Partition partition : partitions) {
Assert.assertFalse(metaStore.isPathExists(new Path(partition.getSd().getLocation())));
}
}
@Test
public void testAddPartitionsWithSameNameInTheListCaseSensitive() throws Exception {
createTable();
Partition partition1 = buildPartition(DB_NAME, TABLE_NAME, "this");
Partition partition2 = buildPartition(DB_NAME, TABLE_NAME, "next");
Partition partition3 = buildPartition(DB_NAME, TABLE_NAME, "THIS");
List<Partition> partitions = new ArrayList<>();
partitions.add(partition1);
partitions.add(partition2);
partitions.add(partition3);
client.add_partitions(partitions);
List<String> parts = client.listPartitionNames(DB_NAME, TABLE_NAME, MAX);
Assert.assertEquals(3, parts.size());
Assert.assertTrue(parts.contains("year=this"));
Assert.assertTrue(parts.contains("year=next"));
Assert.assertTrue(parts.contains("year=THIS"));
}
@Test
public void testAddPartitionsAlreadyExists() throws Exception {
createTable();
String tableLocation = metaStore.getWarehouseRoot() + "/" + TABLE_NAME;
Partition partition =
buildPartition(DB_NAME, TABLE_NAME, "2016", tableLocation + "/year=2016a");
client.add_partition(partition);
List<Partition> partitions = buildPartitions(DB_NAME, TABLE_NAME,
Lists.newArrayList("2014", "2015", "2016", "2017", "2018"));
try {
client.add_partitions(partitions);
Assert.fail("AlreadyExistsException should have happened.");
} catch (AlreadyExistsException e) {
// Expected exception
}
List<Partition> parts = client.listPartitions(DB_NAME, TABLE_NAME, MAX);
Assert.assertNotNull(parts);
Assert.assertEquals(1, parts.size());
Assert.assertEquals(partition.getValues(), parts.get(0).getValues());
for (Partition part : partitions) {
Assert.assertFalse(metaStore.isPathExists(new Path(part.getSd().getLocation())));
}
}
@Test(expected = MetaException.class)
public void testAddPartitionsNonExistingTable() throws Exception {
createTable();
Partition partition1 = buildPartition(DB_NAME, TABLE_NAME, "2016");
Partition partition2 = buildPartition(DB_NAME, "nonexistingtable", "2017");
List<Partition> partitions = new ArrayList<>();
partitions.add(partition1);
partitions.add(partition2);
client.add_partitions(partitions);
}
@Test(expected = InvalidObjectException.class)
public void testAddPartitionsNonExistingDb() throws Exception {
createTable();
Partition partition1 = buildPartition("nonexistingdb", TABLE_NAME, "2017");
Partition partition2 = buildPartition(DB_NAME, TABLE_NAME, "2016");
List<Partition> partitions = new ArrayList<>();
partitions.add(partition1);
partitions.add(partition2);
client.add_partitions(partitions);
}
@Test(expected = MetaException.class)
public void testAddPartitionsNullDb() throws Exception {
createTable();
Partition partition1 = buildPartition(DB_NAME, TABLE_NAME, "2016");
Partition partition2 = buildPartition(DB_NAME, TABLE_NAME, "2017");
partition2.setDbName(null);
List<Partition> partitions = new ArrayList<>();
partitions.add(partition1);
partitions.add(partition2);
client.add_partitions(partitions);
}
@Test(expected = MetaException.class)
public void testAddPartitionsEmptyDb() throws Exception {
createTable();
Partition partition1 = buildPartition(DB_NAME, TABLE_NAME, "2016");
Partition partition2 = buildPartition("", TABLE_NAME, "2017");
List<Partition> partitions = new ArrayList<>();
partitions.add(partition1);
partitions.add(partition2);
client.add_partitions(partitions);
}
@Test(expected = MetaException.class)
public void testAddPartitionsNullTable() throws Exception {
createTable();
Partition partition1 = buildPartition(DB_NAME, TABLE_NAME, "2016");
Partition partition2 = buildPartition(DB_NAME, TABLE_NAME, "2017");
partition2.setTableName(null);
List<Partition> partitions = new ArrayList<>();
partitions.add(partition1);
partitions.add(partition2);
client.add_partitions(partitions);
}
@Test(expected = MetaException.class)
public void testAddPartitionsEmptyTable() throws Exception {
createTable();
Partition partition1 = buildPartition(DB_NAME, TABLE_NAME, "2016");
Partition partition2 = buildPartition(DB_NAME, "", "2017");
List<Partition> partitions = new ArrayList<>();
partitions.add(partition1);
partitions.add(partition2);
client.add_partitions(partitions);
}
@Test
public void testAddPartitionsOneInvalid() throws Exception {
createTable();
String tableLocation = metaStore.getWarehouseRoot() + "/" + TABLE_NAME;
Partition partition1 =
buildPartition(DB_NAME, TABLE_NAME, "2016", tableLocation + "/year=2016");
Partition partition2 =
buildPartition(DB_NAME, TABLE_NAME, "2017", tableLocation + "/year=2017");
Partition partition3 =
buildPartition(Lists.newArrayList("2015", "march"), getYearAndMonthPartCols(), 1);
partition3.getSd().setLocation(tableLocation + "/year=2015/month=march");
Partition partition4 =
buildPartition(DB_NAME, TABLE_NAME, "2018", tableLocation + "/year=2018");
Partition partition5 =
buildPartition(DB_NAME, TABLE_NAME, "2019", tableLocation + "/year=2019");
List<Partition> partitions = new ArrayList<>();
partitions.add(partition1);
partitions.add(partition2);
partitions.add(partition3);
partitions.add(partition4);
partitions.add(partition5);
try {
client.add_partitions(partitions);
Assert.fail("MetaException should have happened.");
} catch (MetaException e) {
// Expected exception
}
List<Partition> parts = client.listPartitions(DB_NAME, TABLE_NAME, MAX);
Assert.assertNotNull(parts);
Assert.assertTrue(parts.isEmpty());
for (Partition part : partitions) {
Assert.assertFalse(metaStore.isPathExists(new Path(part.getSd().getLocation())));
}
}
@Test(expected = MetaException.class)
public void testAddPartitionsNullSd() throws Exception {
createTable();
Partition partition = buildPartition(DB_NAME, TABLE_NAME, DEFAULT_YEAR_VALUE);
partition.setSd(null);
List<Partition> partitions = new ArrayList<>();
partitions.add(partition);
client.add_partitions(partitions);
}
@Test
public void testAddPartitionsNullColsInSd() throws Exception {
createTable();
Partition partition = buildPartition(DB_NAME, TABLE_NAME, DEFAULT_YEAR_VALUE);
partition.getSd().setCols(null);
client.add_partitions(Lists.newArrayList(partition));
// TODO: Not sure that this is the correct behavior. It doesn't make sense to create the
// partition without column info. This should be investigated later.
Partition part =
client.getPartition(DB_NAME, TABLE_NAME, Lists.newArrayList(DEFAULT_YEAR_VALUE));
Assert.assertNotNull(part);
Assert.assertNull(part.getSd().getCols());
}
@Test
public void testAddPartitionsEmptyColsInSd() throws Exception {
createTable();
Partition partition = buildPartition(DB_NAME, TABLE_NAME, DEFAULT_YEAR_VALUE);
partition.getSd().setCols(new ArrayList<>());
client.add_partitions(Lists.newArrayList(partition));
// TODO: Not sure that this is the correct behavior. It doesn't make sense to create the
// partition without column info. This should be investigated later.
Partition part =
client.getPartition(DB_NAME, TABLE_NAME, Lists.newArrayList(DEFAULT_YEAR_VALUE));
Assert.assertNotNull(part);
Assert.assertTrue(part.getSd().getCols().isEmpty());
}
@Test(expected = MetaException.class)
public void testAddPartitionsNullColTypeInSd() throws Exception {
createTable();
Partition partition = buildPartition(DB_NAME, TABLE_NAME, DEFAULT_YEAR_VALUE);
partition.getSd().getCols().get(0).setType(null);
client.add_partitions(Lists.newArrayList(partition));
}
@Test(expected = MetaException.class)
public void testAddPartitionsNullColNameInSd() throws Exception {
createTable();
Partition partition = buildPartition(DB_NAME, TABLE_NAME, DEFAULT_YEAR_VALUE);
partition.getSd().getCols().get(0).setName(null);
client.add_partitions(Lists.newArrayList(partition));
}
@Test
public void testAddPartitionsInvalidColTypeInSd() throws Exception {
createTable();
Partition partition = buildPartition(DB_NAME, TABLE_NAME, DEFAULT_YEAR_VALUE);
partition.getSd().getCols().get(0).setType("xyz");
client.add_partitions(Lists.newArrayList(partition));
// TODO: Not sure that this is the correct behavior. It doesn't make sense to create the
// partition with column with invalid type. This should be investigated later.
Partition part =
client.getPartition(DB_NAME, TABLE_NAME, Lists.newArrayList(DEFAULT_YEAR_VALUE));
Assert.assertNotNull(part);
Assert.assertEquals("xyz", part.getSd().getCols().get(0).getType());
}
@Test(expected = MetaException.class)
public void testAddPartitionsEmptySerdeInfo() throws Exception {
createTable();
Partition partition = buildPartition(DB_NAME, TABLE_NAME, DEFAULT_YEAR_VALUE);
partition.getSd().setSerdeInfo(null);
client.add_partitions(Lists.newArrayList(partition));
}
@Test
public void testAddPartitionNullAndEmptyLocation() throws Exception {
createTable(DB_NAME, TABLE_NAME, metaStore.getWarehouseRoot() + "/addparttest2");
List<Partition> partitions = new ArrayList<>();
Partition partition1 = buildPartition(DB_NAME, TABLE_NAME, "2017", null);
Partition partition2 = buildPartition(DB_NAME, TABLE_NAME, "2016", "");
partitions.add(partition1);
partitions.add(partition2);
client.add_partitions(partitions);
Partition part1 = client.getPartition(DB_NAME, TABLE_NAME, "year=2017");
Assert.assertEquals(metaStore.getWarehouseRoot() + "/addparttest2/year=2017",
part1.getSd().getLocation());
Assert.assertTrue(metaStore.isPathExists(new Path(part1.getSd().getLocation())));
Partition part2 = client.getPartition(DB_NAME, TABLE_NAME, "year=2016");
Assert.assertEquals(metaStore.getWarehouseRoot() + "/addparttest2/year=2016",
part2.getSd().getLocation());
Assert.assertTrue(metaStore.isPathExists(new Path(part2.getSd().getLocation())));
}
@Test
public void testAddPartitionsNullLocationInTableToo() throws Exception {
createTable(DB_NAME, TABLE_NAME, null);
List<Partition> partitions = new ArrayList<>();
Partition partition = buildPartition(DB_NAME, TABLE_NAME, DEFAULT_YEAR_VALUE, null);
partitions.add(partition);
client.add_partitions(partitions);
Partition part = client.getPartition(DB_NAME, TABLE_NAME, "year=2017");
Assert.assertEquals(
metaStore.getWarehouseRoot() + "/test_partition_db.db/test_partition_table/year=2017",
part.getSd().getLocation());
Assert.assertTrue(metaStore.isPathExists(new Path(part.getSd().getLocation())));
}
@Test(expected=MetaException.class)
public void testAddPartitionsForView() throws Exception {
String tableName = "test_add_partition_view";
createView(tableName);
Partition partition = buildPartition(DB_NAME, tableName, DEFAULT_YEAR_VALUE);
List<Partition> partitions = Lists.newArrayList(partition);
client.add_partitions(partitions);
}
@Test
public void testAddPartitionsForExternalTable() throws Exception {
String tableName = "part_add_ext_table";
String tableLocation = metaStore.getWarehouseRoot() + "/" + tableName;
createExternalTable(tableName, tableLocation);
String location1 = tableLocation + "/addparttest2017";
String location2 = tableLocation + "/addparttest2018";
Partition partition1 = buildPartition(DB_NAME, tableName, "2017", location1);
Partition partition2 = buildPartition(DB_NAME, tableName, "2018", location2);
List<Partition> partitions = Lists.newArrayList(partition1, partition2);
client.add_partitions(partitions);
List<Partition> resultParts = client.getPartitionsByNames(DB_NAME, tableName,
Lists.newArrayList("year=2017", "year=2018"));
Assert.assertNotNull(resultParts);
Assert.assertEquals(2, resultParts.size());
if (resultParts.get(0).getValues().get(0).equals("2017")) {
Assert.assertEquals(location1, resultParts.get(0).getSd().getLocation());
Assert.assertEquals(location2, resultParts.get(1).getSd().getLocation());
} else {
Assert.assertEquals(location2, resultParts.get(0).getSd().getLocation());
Assert.assertEquals(location1, resultParts.get(1).getSd().getLocation());
}
}
@Test
public void testAddPartitionsForExternalTableNullLocation() throws Exception {
String tableName = "part_add_ext_table";
createExternalTable(tableName, null);
Partition partition1 = buildPartition(DB_NAME, tableName, "2017", null);
Partition partition2 = buildPartition(DB_NAME, tableName, "2018", null);
List<Partition> partitions = Lists.newArrayList(partition1, partition2);
client.add_partitions(partitions);
List<Partition> resultParts = client.getPartitionsByNames(DB_NAME, tableName,
Lists.newArrayList("year=2017", "year=2018"));
Assert.assertNotNull(resultParts);
Assert.assertEquals(2, resultParts.size());
String defaultTableLocation = metaStore.getWarehouseRoot() + "/" + DB_NAME + ".db/" + tableName;
String defaultPartLocation1 = defaultTableLocation + "/year=2017";
String defaultPartLocation2 = defaultTableLocation + "/year=2018";
if (resultParts.get(0).getValues().get(0).equals("2017")) {
Assert.assertEquals(defaultPartLocation1, resultParts.get(0).getSd().getLocation());
Assert.assertEquals(defaultPartLocation2, resultParts.get(1).getSd().getLocation());
} else {
Assert.assertEquals(defaultPartLocation2, resultParts.get(0).getSd().getLocation());
Assert.assertEquals(defaultPartLocation1, resultParts.get(1).getSd().getLocation());
}
}
@Test(expected=MetaException.class)
public void testAddPartitionsNoValueInPartition() throws Exception {
createTable();
Partition partition = new PartitionBuilder()
.setDbName(DB_NAME)
.setTableName(TABLE_NAME)
.addCol(YEAR_COL_NAME, DEFAULT_COL_TYPE)
.setLocation(metaStore.getWarehouseRoot() + "/addparttest")
.build(metaStore.getConf());
List<Partition> partitions = new ArrayList<>();
partitions.add(partition);
client.add_partitions(partitions);
}
@Test(expected=MetaException.class)
public void testAddPartitionsMorePartColInTable() throws Exception {
createTable(DB_NAME, TABLE_NAME, getYearAndMonthPartCols(), null);
Partition partition = buildPartition(DB_NAME, TABLE_NAME, DEFAULT_YEAR_VALUE);
List<Partition> partitions = new ArrayList<>();
partitions.add(partition);
client.add_partitions(partitions);
}
@Test(expected = MetaException.class)
public void testAddPartitionsNullPartition() throws Exception {
List<Partition> partitions = new ArrayList<>();
partitions.add(null);
client.add_partitions(partitions);
}
@Test(expected = MetaException.class)
public void testAddPartitionsNullValues() throws Exception {
createTable();
Partition partition = buildPartition(DB_NAME, TABLE_NAME, null);
partition.setValues(null);
List<Partition> partitions = new ArrayList<>();
partitions.add(partition);
client.add_partitions(partitions);
}
@Test
public void testAddPartitionsEmptyValue() throws Exception {
createTable();
Partition partition = buildPartition(DB_NAME, TABLE_NAME, "");
List<Partition> partitions = new ArrayList<>();
partitions.add(partition);
client.add_partitions(partitions);
List<String> partitionNames = client.listPartitionNames(DB_NAME, TABLE_NAME, MAX);
Assert.assertNotNull(partitionNames);
Assert.assertTrue(partitionNames.size() == 1);
Assert.assertEquals("year=__HIVE_DEFAULT_PARTITION__", partitionNames.get(0));
}
@Test
public void testAddPartitionsInvalidLocation() throws Exception {
createTable();
String tableLocation = metaStore.getWarehouseRoot() + "/" + TABLE_NAME;
Map<String, String> valuesAndLocations = new HashMap<>();
valuesAndLocations.put("2014", tableLocation + "/year=2014");
valuesAndLocations.put("2015", tableLocation + "/year=2015");
valuesAndLocations.put("2016", "invalidhost:80000/wrongfolder");
valuesAndLocations.put("2017", tableLocation + "/year=2017");
valuesAndLocations.put("2018", tableLocation + "/year=2018");
List<Partition> partitions = buildPartitions(DB_NAME, TABLE_NAME, valuesAndLocations);
try {
client.add_partitions(partitions);
Assert.fail("MetaException should have happened.");
} catch (MetaException e) {
}
List<Partition> parts = client.listPartitions(DB_NAME, TABLE_NAME, MAX);
Assert.assertNotNull(parts);
Assert.assertTrue(parts.isEmpty());
for (Partition partition : partitions) {
if (!"invalidhost:80000/wrongfolder".equals(partition.getSd().getLocation())) {
Assert.assertFalse(metaStore.isPathExists(new Path(partition.getSd().getLocation())));
}
}
}
@Test
public void testAddPartitionsMoreThanThreadCountsOneFails() throws Exception {
createTable();
String tableLocation = metaStore.getWarehouseRoot() + "/" + TABLE_NAME;
List<Partition> partitions = new ArrayList<>();
for (int i = 0; i < 50; i++) {
String value = String.valueOf(2000 + i);
String location = tableLocation + "/year=" + value;
if (i == 30) {
location = "invalidhost:80000/wrongfolder";
}
Partition partition = buildPartition(DB_NAME, TABLE_NAME, value, location);
partitions.add(partition);
}
try {
client.add_partitions(partitions);
Assert.fail("MetaException should have happened.");
} catch (MetaException e) {
}
List<Partition> parts = client.listPartitions(DB_NAME, TABLE_NAME, MAX);
Assert.assertNotNull(parts);
Assert.assertTrue(parts.isEmpty());
for (Partition partition : partitions) {
if (!"invalidhost:80000/wrongfolder".equals(partition.getSd().getLocation())) {
Assert.assertFalse(metaStore.isPathExists(new Path(partition.getSd().getLocation())));
}
}
}
// Tests for List<Partition> add_partitions(List<Partition> partitions,
// boolean ifNotExists, boolean needResults) method
@Test
public void testAddParts() throws Exception {
Table table = createTable();
List<Partition> partitions = new ArrayList<>();
Partition partition1 = buildPartition(Lists.newArrayList("2017"), getYearPartCol(), 1);
Partition partition2 = buildPartition(Lists.newArrayList("2016"), getYearPartCol(), 2);
Partition partition3 = buildPartition(Lists.newArrayList("2015"), getYearPartCol(), 3);
partitions.add(partition1);
partitions.add(partition2);
partitions.add(partition3);
List<Partition> addedPartitions = client.add_partitions(partitions, false, false);
Assert.assertNull(addedPartitions);
verifyPartition(table, "year=2017", Lists.newArrayList("2017"), 1);
verifyPartition(table, "year=2016", Lists.newArrayList("2016"), 2);
verifyPartition(table, "year=2015", Lists.newArrayList("2015"), 3);
}
@Test
public void testAddPartsMultipleValues() throws Exception {
Table table = createTable(DB_NAME, TABLE_NAME, getYearAndMonthPartCols(),
metaStore.getWarehouseRoot() + "/" + TABLE_NAME);
Partition partition1 =
buildPartition(Lists.newArrayList("2017", "march"), getYearAndMonthPartCols(), 1);
Partition partition2 =
buildPartition(Lists.newArrayList("2017", "june"), getYearAndMonthPartCols(), 2);
Partition partition3 =
buildPartition(Lists.newArrayList("2016", "march"), getYearAndMonthPartCols(), 3);
List<Partition> partitions = new ArrayList<>();
partitions.add(partition1);
partitions.add(partition2);
partitions.add(partition3);
List<Partition> addedPartitions = client.add_partitions(partitions, false, true);
Assert.assertNotNull(addedPartitions);
Assert.assertEquals(3, addedPartitions.size());
verifyPartition(table, "year=2017/month=march", Lists.newArrayList("2017", "march"), 1);
verifyPartition(table, "year=2017/month=june", Lists.newArrayList("2017", "june"), 2);
verifyPartition(table, "year=2016/month=march", Lists.newArrayList("2016", "march"), 3);
}
@Test(expected = MetaException.class)
public void testAddPartsNullList() throws Exception {
client.add_partitions(null, false, false);
}
@Test
public void testAddPartsEmptyList() throws Exception {
List<Partition> addedPartitions =
client.add_partitions(new ArrayList<>(), false, true);
Assert.assertNotNull(addedPartitions);
Assert.assertTrue(addedPartitions.isEmpty());
}
@Test(expected = MetaException.class)
public void testAddPartsDifferentTable() throws Exception {
String tableName1 = TABLE_NAME + "1";
String tableName2 = TABLE_NAME + "2";
createTable(DB_NAME, tableName1, null);
createTable(DB_NAME, tableName2, null);
Partition partition1 = buildPartition(DB_NAME, tableName1, "2017");
Partition partition2 = buildPartition(DB_NAME, tableName2, "2016");
Partition partition3 = buildPartition(DB_NAME, tableName1, "2018");
List<Partition> partitions = new ArrayList<>();
partitions.add(partition1);
partitions.add(partition2);
partitions.add(partition3);
client.add_partitions(partitions, false, false);
}
@Test
public void testAddPartsDifferentDBs() throws Exception {
createDB("parttestdb2");
createTable();
createTable("parttestdb2", TABLE_NAME, null);
Partition partition1 = buildPartition(DB_NAME, TABLE_NAME, "2017");
Partition partition2 = buildPartition("parttestdb2", TABLE_NAME, "2016");
Partition partition3 = buildPartition(DB_NAME, TABLE_NAME, "2018");
List<Partition> partitions = new ArrayList<>();
partitions.add(partition1);
partitions.add(partition2);
partitions.add(partition3);
try {
client.add_partitions(partitions, false, false);
Assert.fail("MetaException should have been thrown.");
} catch (MetaException e) {
// Expected exception
}
client.dropDatabase("parttestdb2", true, true, true);
}
@Test(expected = MetaException.class)
public void testAddPartsDuplicateInTheList() throws Exception {
createTable();
Partition partition1 = buildPartition(DB_NAME, TABLE_NAME, "2017");
Partition partition2 = buildPartition(DB_NAME, TABLE_NAME, "2016");
Partition partition3 = buildPartition(DB_NAME, TABLE_NAME, "2017");
List<Partition> partitions = new ArrayList<>();
partitions.add(partition1);
partitions.add(partition2);
partitions.add(partition3);
client.add_partitions(partitions, true, false);
}
@Test(expected = AlreadyExistsException.class)
public void testAddPartsAlreadyExists() throws Exception {
createTable();
Partition partition = buildPartition(DB_NAME, TABLE_NAME, "2017");
client.add_partition(partition);
Partition partition1 = buildPartition(DB_NAME, TABLE_NAME, "2015");
Partition partition2 = buildPartition(DB_NAME, TABLE_NAME, "2017");
Partition partition3 = buildPartition(DB_NAME, TABLE_NAME, "2016");
List<Partition> partitions = new ArrayList<>();
partitions.add(partition1);
partitions.add(partition2);
partitions.add(partition3);
client.add_partitions(partitions, false, false);
}
@Test
public void testAddPartsAlreadyExistsIfExistsTrue() throws Exception {
createTable();
Partition partition = buildPartition(DB_NAME, TABLE_NAME, "2017");
client.add_partition(partition);
Partition partition1 = buildPartition(DB_NAME, TABLE_NAME, "2015");
Partition partition2 = buildPartition(DB_NAME, TABLE_NAME, "2017");
Partition partition3 = buildPartition(DB_NAME, TABLE_NAME, "2016");
List<Partition> partitions = new ArrayList<>();
partitions.add(partition1);
partitions.add(partition2);
partitions.add(partition3);
List<Partition> addedPartitions = client.add_partitions(partitions, true, true);
Assert.assertEquals(2, addedPartitions.size());
List<String> partitionNames = client.listPartitionNames(DB_NAME, TABLE_NAME, MAX);
Assert.assertEquals(3, partitionNames.size());
Assert.assertTrue(partitionNames.contains("year=2015"));
Assert.assertTrue(partitionNames.contains("year=2016"));
Assert.assertTrue(partitionNames.contains("year=2017"));
}
@Test(expected = MetaException.class)
public void testAddPartsNullPartition() throws Exception {
List<Partition> partitions = new ArrayList<>();
partitions.add(null);
client.add_partitions(partitions, false, false);
}
// Helper methods
private void createDB(String dbName) throws TException {
new DatabaseBuilder().setName(dbName).create(client, metaStore.getConf());
}
private Table createTable() throws Exception {
return createTable(DB_NAME, TABLE_NAME, metaStore.getWarehouseRoot() + "/" + TABLE_NAME);
}
private Table createTable(String dbName, String tableName, String location) throws Exception {
return createTable(dbName, tableName, getYearPartCol(), location);
}
private Table createTable(String dbName, String tableName, List<FieldSchema> partCols,
String location) throws Exception {
new TableBuilder()
.setDbName(dbName)
.setTableName(tableName)
.addCol("test_id", "int", "test col id")
.addCol("test_value", "string", "test col value")
.addTableParam("partTestTableParamKey", "partTestTableParamValue")
.setPartCols(partCols)
.addStorageDescriptorParam("partTestSDParamKey", "partTestSDParamValue")
.setSerdeName(tableName)
.setStoredAsSubDirectories(false)
.addSerdeParam("partTestSerdeParamKey", "partTestSerdeParamValue")
.setLocation(location)
.create(client, metaStore.getConf());
return client.getTable(dbName, tableName);
}
private void createExternalTable(String tableName, String location) throws Exception {
new TableBuilder()
.setDbName(DB_NAME)
.setTableName(tableName)
.addCol("test_id", "int", "test col id")
.addCol("test_value", DEFAULT_COL_TYPE, "test col value")
.addPartCol(YEAR_COL_NAME, DEFAULT_COL_TYPE)
.addTableParam("EXTERNAL", "TRUE")
.setLocation(location)
.create(client, metaStore.getConf());
}
private Partition buildPartition(String dbName, String tableName, String value)
throws MetaException {
return buildPartition(dbName, tableName, value,
metaStore.getWarehouseRoot() + "/" + tableName + "/addparttest");
}
private Partition buildPartition(String dbName, String tableName, String value,
String location) throws MetaException {
Partition partition = new PartitionBuilder()
.setDbName(dbName)
.setTableName(tableName)
.addValue(value)
.addCol(YEAR_COL_NAME, DEFAULT_COL_TYPE)
.addCol("test_id", "int", "test col id")
.addCol("test_value", "string", "test col value")
.addPartParam(DEFAULT_PARAM_KEY, DEFAULT_PARAM_VALUE)
.setLocation(location)
.build(metaStore.getConf());
return partition;
}
private Partition buildPartition(List<String> values, List<FieldSchema> partCols,
int index) throws MetaException {
Partition partition = new PartitionBuilder()
.setDbName(DB_NAME)
.setTableName(TABLE_NAME)
.setValues(values)
.addPartParam(DEFAULT_PARAM_KEY + index, DEFAULT_PARAM_VALUE + index)
.setInputFormat("TestInputFormat" + index)
.setOutputFormat("TestOutputFormat" + index)
.setSerdeName("partserde" + index)
.addStorageDescriptorParam("partsdkey" + index, "partsdvalue" + index)
.setCols(partCols)
.setCreateTime(123456)
.setLastAccessTime(123456)
.addCol("test_id", "int", "test col id")
.addCol("test_value", "string", "test col value")
.build(metaStore.getConf());
return partition;
}
private static List<FieldSchema> getYearAndMonthPartCols() {
List<FieldSchema> cols = new ArrayList<>();
cols.add(new FieldSchema(YEAR_COL_NAME, DEFAULT_COL_TYPE, "year part col"));
cols.add(new FieldSchema(MONTH_COL_NAME, DEFAULT_COL_TYPE, "month part col"));
return cols;
}
private static List<FieldSchema> getYearPartCol() {
List<FieldSchema> cols = new ArrayList<>();
cols.add(new FieldSchema(YEAR_COL_NAME, DEFAULT_COL_TYPE, "year part col"));
return cols;
}
private static List<FieldSchema> getMonthPartCol() {
List<FieldSchema> cols = new ArrayList<>();
cols.add(new FieldSchema(MONTH_COL_NAME, DEFAULT_COL_TYPE, "month part col"));
return cols;
}
private void verifyPartition(Table table, String name, List<String> values, int index)
throws Exception {
Partition part = client.getPartition(table.getDbName(), table.getTableName(), name);
Assert.assertNotNull("The partition should not be null.", part);
Assert.assertEquals("The table name in the partition is not correct.", table.getTableName(),
part.getTableName());
List<String> partValues = part.getValues();
Assert.assertEquals(values.size(), partValues.size());
Assert.assertTrue("The partition has wrong values.", partValues.containsAll(values));
Assert.assertEquals("The DB name in the partition is not correct.", table.getDbName(),
part.getDbName());
Assert.assertEquals("The last access time is not correct.", 123456, part.getLastAccessTime());
Assert.assertNotEquals(123456, part.getCreateTime());
Assert.assertEquals(
"The partition's parameter map should contain the partparamkey - partparamvalue pair.",
DEFAULT_PARAM_VALUE + index, part.getParameters().get(DEFAULT_PARAM_KEY + index));
StorageDescriptor sd = part.getSd();
Assert.assertNotNull("The partition's storage descriptor must not be null.", sd);
Assert.assertEquals("The input format is not correct.", "TestInputFormat" + index,
sd.getInputFormat());
Assert.assertEquals("The output format is not correct.", "TestOutputFormat" + index,
sd.getOutputFormat());
Assert.assertEquals("The serdeInfo name is not correct.", "partserde" + index,
sd.getSerdeInfo().getName());
Assert.assertEquals(
"The parameter map of the partition's storage descriptor should contain the partsdkey - partsdvalue pair.",
"partsdvalue" + index, sd.getParameters().get("partsdkey" + index));
Assert.assertEquals("The parameter's location is not correct.",
metaStore.getWarehouseRoot() + "/" + TABLE_NAME + "/" + name, sd.getLocation());
Assert.assertTrue("The parameter's location should exist on the file system.",
metaStore.isPathExists(new Path(sd.getLocation())));
// If the 'metastore.partition.inherit.table.properties' property is set in the metastore
// config, the partition inherits the listed table parameters.
// This property is not set in this test, therefore the partition doesn't inherit the table
// parameters.
Assert.assertFalse("The partition should not inherit the table parameters.",
part.getParameters().keySet().contains(table.getParameters().keySet()));
}
private void verifyPartitionAttributesDefaultValues(Partition partition, String tableLocation) {
Assert.assertNotEquals("The partition's last access time should be set.", 0,
partition.getLastAccessTime());
Assert.assertNotEquals("The partition's create time should be set.", 0,
partition.getCreateTime());
Assert.assertEquals(
"The partition has to have the 'transient_lastDdlTime' parameter per default.", 1,
partition.getParameters().size());
Assert.assertNotNull(
"The partition has to have the 'transient_lastDdlTime' parameter per default.",
partition.getParameters().get("transient_lastDdlTime"));
StorageDescriptor sd = partition.getSd();
Assert.assertNotNull("The storage descriptor of the partition must not be null.", sd);
Assert.assertEquals("The partition location is not correct.", tableLocation + "/year=2017",
sd.getLocation());
Assert.assertEquals("The input format doesn't have the default value.",
"org.apache.hadoop.hive.ql.io.HiveInputFormat", sd.getInputFormat());
Assert.assertEquals("The output format doesn't have the default value.",
"org.apache.hadoop.hive.ql.io.HiveOutputFormat", sd.getOutputFormat());
Assert.assertFalse("The compressed attribute doesn't have the default value.",
sd.isCompressed());
Assert.assertFalse("The storedAsSubDirectories attribute doesn't have the default value.",
sd.isStoredAsSubDirectories());
Assert.assertEquals("The numBuckets attribute doesn't have the default value.", 0,
sd.getNumBuckets());
Assert.assertTrue("The default value of the attribute 'bucketCols' should be an empty list.",
sd.getBucketCols().isEmpty());
Assert.assertTrue("The default value of the attribute 'sortCols' should be an empty list.",
sd.getSortCols().isEmpty());
Assert.assertTrue("Per default the storage descriptor parameters should be empty.",
sd.getParameters().isEmpty());
SerDeInfo serdeInfo = sd.getSerdeInfo();
Assert.assertNotNull("The serdeInfo attribute should not be null.", serdeInfo);
Assert.assertNull("The default value of the serde's name attribute should be null.",
serdeInfo.getName());
Assert.assertEquals("The serde's 'serializationLib' attribute doesn't have the default value.",
"org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe", serdeInfo.getSerializationLib());
Assert.assertTrue("Per default the serde info parameters should be empty.",
serdeInfo.getParameters().isEmpty());
SkewedInfo skewedInfo = sd.getSkewedInfo();
Assert.assertTrue("Per default the skewedInfo column names list should be empty.",
skewedInfo.getSkewedColNames().isEmpty());
Assert.assertTrue("Per default the skewedInfo column value list should be empty.",
skewedInfo.getSkewedColValues().isEmpty());
Assert.assertTrue("Per default the skewedInfo column value location map should be empty.",
skewedInfo.getSkewedColValueLocationMaps().isEmpty());
}
private List<Partition> buildPartitions(String dbName, String tableName, List<String> values)
throws MetaException {
String tableLocation = metaStore.getWarehouseRoot() + "/" + tableName;
List<Partition> partitions = new ArrayList<>();
for (String value : values) {
Partition partition =
buildPartition(dbName, tableName, value, tableLocation + "/year=" + value);
partitions.add(partition);
}
return partitions;
}
private List<Partition> buildPartitions(String dbName, String tableName,
Map<String, String> valuesAndLocations) throws MetaException {
List<Partition> partitions = new ArrayList<>();
for (Map.Entry<String, String> valueAndLocation : valuesAndLocations.entrySet()) {
Partition partition =
buildPartition(dbName, tableName, valueAndLocation.getKey(), valueAndLocation.getValue());
partitions.add(partition);
}
return partitions;
}
private void createView(String tableName) throws Exception {
new TableBuilder()
.setDbName(DB_NAME)
.setTableName(tableName)
.setType("VIRTUAL_VIEW")
.addCol("test_id", "int", "test col id")
.addCol("test_value", "string", "test col value")
.addPartCol(YEAR_COL_NAME, DEFAULT_COL_TYPE)
.setLocation(null)
.create(client, metaStore.getConf());
}
}
|
alanfgates/hive
|
standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/client/TestAddPartitions.java
|
Java
|
apache-2.0
| 69,265
|
<html>
<head>
<title>ChainOrchestra flow nodes</title>
<link rel="stylesheet" type="text/css" href="css/ChainOrchestra.css">
</head>
<body>
<center>
<h1>ChainOrchestra flow nodes</h1>
</center>
<hr>
<table style="width:100%">
<tr>
<td>
<img src="flowNodes.png" style="float:left">
</td>
<td>
Use the ChainOrchestra flow nodes to wire blockchain queries and transactions in a Node-RED flow graph, as in the following samples for the
<a href="https://github.com/ChainOrchestra/ChainOrchestra-SDK/tree/master/examples/registration">guest registration example</a>.
<ul>
<li>The <a href="flowGate.html">gate flow</a> handles the gate operations in the guest <a href="http://chainorchestra.net/#/4">registration</a> live demo page.
<li>The <a href="flowGuests.html">guests list flow</a> displays a list of registered guests in the debug log.
</ul>
</td>
</tr>
</table>
<hr>
<h2>The <b>Connection node</b> makes a login connection.</h2>
<img src="nodeConnection.png">
<h2>The <b>Chaincode node</b> deploys chaincode.</h2>
<img src="nodeChaincode.png">
<h2>The <b>Query node</b> runs a query.</h2>
<img src="nodeQuery.png">
<h2>The <b>Transaction node</b> executes a transaction.</h2>
<img src="nodeTransaction.png">
</body>
</html>
|
ChainOrchestra/ChainOrchestra-SDK
|
docs/flowNodes.html
|
HTML
|
apache-2.0
| 1,260
|
using System;
namespace Core.Extensions
{
public static class StringExtensions
{
#region Public members
public static bool IsNullOrEmpty(this string pInput)
{
return (pInput == null || pInput == string.Empty);
}
public static string Replace(this string pInput, string pPattern, string pReplacement)
{
if (pInput.IsNullOrEmpty() || pPattern.IsNullOrEmpty())
{
return pInput;
}
var retval = new StringBuilder();
int startIndex = 0;
int matchIndex;
while ((matchIndex = pInput.IndexOf(pPattern, startIndex)) >= 0)
{
if (matchIndex > startIndex)
{
retval.Append(pInput.Substring(startIndex, matchIndex - startIndex));
}
retval.Append(pReplacement);
matchIndex += pPattern.Length;
startIndex = matchIndex;
}
if (startIndex < pInput.Length)
{
retval.Append(pInput.Substring(startIndex));
}
return retval.ToString();
}
public static string PadRight(this string pInput, int pTotalLength)
{
if (pInput.IsNullOrEmpty())
{
throw new ArgumentNullException("pInput");
}
if (pInput.Length >= pTotalLength)
{
return pInput;
}
char[] retval = new string(' ', pTotalLength).ToCharArray();
Array.Copy(pInput.ToCharArray(), retval, pInput.Length);
return new string(retval);
}
public static bool StartsWith(this string pInput, string pPattern)
{
if (pInput.IsNullOrEmpty())
{
throw new ArgumentNullException("pInput");
}
if (pPattern.IsNullOrEmpty())
{
throw new ArgumentNullException("pPattern");
}
return (pInput.IndexOf(pPattern) == 0);
}
/// <summary>
/// Converts a string to GUID
/// </summary>
/// <param name="s">string GUID</param>
/// <returns>Guid from the given string</returns>
public static Guid ToGuid(this string s)
{
var parts = s.Split('-');
var fs = string.Concat(parts);
var n = fs.Length / 2;
var bts = new byte[n];
for (var x = 0; x < n; ++x)
{
bts[x] = byte.Parse(fs.Substring(x, 2));
}
var uid = new Guid(bts);
return uid;
}
/// <summary>
/// Converts a string to float
/// </summary>
/// <param name="s">string to convert</param>
/// <returns>floating point number</returns>
public static float ToFloat(this string s)
{
var d = double.Parse(s);
var f = (float)d;
return f;
}
/// <summary>
/// COnverts a string to DateTime using DeviceHive notation
/// </summary>
/// <param name="s">string to convert</param>
/// <returns>DateTime object</returns>
public static DateTime ToDateTime(this string s)
{
var parts = s.Split('T', '-', ':', '.');
var year = int.Parse(parts[0]);
var month = int.Parse(parts[1]);
var day = int.Parse(parts[2]);
var hour = int.Parse(parts[3]);
var min = int.Parse(parts[4]);
var sec = int.Parse(parts[5]);
var sec100 = int.Parse(parts[6]);
var dt = new DateTime(year, month, day, hour, min, sec, sec100 / 1000);
dt += new TimeSpan(sec100 % 1000 * 10);
return dt;
}
#endregion
}
}
|
graham22/SkyeTracker
|
code/Archive/Netduino/Core/Extensions/StringExtensions.cs
|
C#
|
apache-2.0
| 3,904
|
/*
* Copyright 2010-2021 James Pether Sörling
*
* 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.
*
* $Id$
* $HeadURL$
*/
package com.hack23.cia.web.impl.ui.application.views.user.goverment.pagemode;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.annotation.Secured;
import org.springframework.stereotype.Component;
import com.hack23.cia.model.internal.application.system.impl.ApplicationEventGroup;
import com.hack23.cia.web.impl.ui.application.action.ViewAction;
import com.hack23.cia.web.impl.ui.application.views.common.chartfactory.api.GovernmentBodyChartDataManager;
import com.hack23.cia.web.impl.ui.application.views.common.viewnames.MinistryPageMode;
import com.vaadin.ui.Layout;
import com.vaadin.ui.MenuBar;
import com.vaadin.ui.Panel;
import com.vaadin.ui.VerticalLayout;
/**
* The Class MinistryRankingGovernmentBodiesPageModContentFactoryImpl.
*/
@Component
public final class MinistryRankingGovernmentBodiesPageModContentFactoryImpl extends AbstractMinistryRankingPageModContentFactoryImpl {
/** The Constant OVERVIEW. */
private static final String GOVERNMENT_BODIES = "Government body";
@Autowired
private GovernmentBodyChartDataManager governmentBodyChartDataManager;
/**
* Instantiates a new ministry ranking government bodies page mod content
* factory impl.
*/
public MinistryRankingGovernmentBodiesPageModContentFactoryImpl() {
super();
}
@Secured({ "ROLE_ANONYMOUS", "ROLE_USER", "ROLE_ADMIN" })
@Override
public Layout createContent(final String parameters, final MenuBar menuBar, final Panel panel) {
final VerticalLayout panelContent = createPanelContent();
getMinistryRankingMenuItemFactory().createMinistryRankingMenuBar(menuBar);
final String pageId = getPageId(parameters);
panel.setCaption(NAME + "::" + GOVERNMENT_BODIES + parameters);
governmentBodyChartDataManager.createMinistryGovernmentBodyHeadcountSummaryChart(panelContent);
getPageActionEventHelper().createPageEvent(ViewAction.VISIT_MINISTRY_RANKING_VIEW, ApplicationEventGroup.USER, NAME,
parameters, pageId);
return panelContent;
}
@Override
public boolean matches(final String page, final String parameters) {
return NAME.equals(page) && StringUtils.contains(parameters, MinistryPageMode.GOVERNMENT_BODIES_HEADCOUNT.toString());
}
}
|
Hack23/cia
|
citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/goverment/pagemode/MinistryRankingGovernmentBodiesPageModContentFactoryImpl.java
|
Java
|
apache-2.0
| 2,905
|
/*
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.batik.dom.svg;
import org.apache.batik.dom.AbstractDocument;
import org.apache.batik.dom.util.DoublyIndexedTable;
import org.apache.batik.dom.util.XLinkSupport;
import org.apache.batik.dom.util.XMLSupport;
import org.apache.batik.util.SVGTypes;
import org.w3c.dom.DOMException;
import org.w3c.dom.Node;
import org.w3c.dom.svg.SVGAnimatedBoolean;
import org.w3c.dom.svg.SVGScriptElement;
/**
* This class implements {@link org.w3c.dom.svg.SVGScriptElement}.
*
* @author <a href="mailto:stephane@hillion.org">Stephane Hillion</a>
* @version $Id: SVGOMScriptElement.java 489964 2006-12-24 01:30:23Z cam $
*/
public class SVGOMScriptElement
extends SVGOMURIReferenceElement
implements SVGScriptElement {
/**
* Table mapping XML attribute names to TraitInformation objects.
*/
protected static DoublyIndexedTable xmlTraitInformation;
static {
DoublyIndexedTable t =
new DoublyIndexedTable(SVGOMURIReferenceElement.xmlTraitInformation);
t.put(null, SVG_EXTERNAL_RESOURCES_REQUIRED_ATTRIBUTE,
new TraitInformation(true, SVGTypes.TYPE_BOOLEAN));
// t.put(null, SVG_TYPE_ATTRIBUTE,
// new TraitInformation(false, SVGTypes.TYPE_CDATA));
xmlTraitInformation = t;
}
/**
* The attribute initializer.
*/
protected static final AttributeInitializer attributeInitializer;
static {
attributeInitializer = new AttributeInitializer(1);
attributeInitializer.addAttribute(XMLSupport.XMLNS_NAMESPACE_URI,
null, "xmlns:xlink",
XLinkSupport.XLINK_NAMESPACE_URI);
attributeInitializer.addAttribute(XLinkSupport.XLINK_NAMESPACE_URI,
"xlink", "type", "simple");
attributeInitializer.addAttribute(XLinkSupport.XLINK_NAMESPACE_URI,
"xlink", "show", "other");
attributeInitializer.addAttribute(XLinkSupport.XLINK_NAMESPACE_URI,
"xlink", "actuate", "onLoad");
}
/**
* The 'externalResourcesRequired' attribute value.
*/
protected SVGOMAnimatedBoolean externalResourcesRequired;
/**
* Creates a new SVGOMScriptElement object.
*/
protected SVGOMScriptElement() {
}
/**
* Creates a new SVGOMScriptElement object.
* @param prefix The namespace prefix.
* @param owner The owner document.
*/
public SVGOMScriptElement(String prefix, AbstractDocument owner) {
super(prefix, owner);
initializeLiveAttributes();
}
/**
* Initializes all live attributes for this element.
*/
protected void initializeAllLiveAttributes() {
super.initializeAllLiveAttributes();
initializeLiveAttributes();
}
/**
* Initializes the live attribute values of this element.
*/
private void initializeLiveAttributes() {
externalResourcesRequired =
createLiveAnimatedBoolean
(null, SVG_EXTERNAL_RESOURCES_REQUIRED_ATTRIBUTE, false);
}
/**
* <b>DOM</b>: Implements {@link Node#getLocalName()}.
*/
public String getLocalName() {
return SVG_SCRIPT_TAG;
}
/**
* <b>DOM</b>: Implements {@link SVGScriptElement#getType()}.
*/
public String getType() {
return getAttributeNS(null, SVG_TYPE_ATTRIBUTE);
}
/**
* <b>DOM</b>: Implements {@link SVGScriptElement#setType(String)}.
*/
public void setType(String type) throws DOMException {
setAttributeNS(null, SVG_TYPE_ATTRIBUTE, type);
}
// SVGExternalResourcesRequired support /////////////////////////////
/**
* <b>DOM</b>: Implements {@link
* org.w3c.dom.svg.SVGExternalResourcesRequired}.
*/
public SVGAnimatedBoolean getExternalResourcesRequired() {
return externalResourcesRequired;
}
/**
* Returns the AttributeInitializer for this element type.
* @return null if this element has no attribute with a default value.
*/
protected AttributeInitializer getAttributeInitializer() {
return attributeInitializer;
}
/**
* Returns a new uninitialized instance of this object's class.
*/
protected Node newNode() {
return new SVGOMScriptElement();
}
/**
* Returns the table of TraitInformation objects for this element.
*/
protected DoublyIndexedTable getTraitInformationTable() {
return xmlTraitInformation;
}
}
|
Groostav/CMPT880-term-project
|
intruder/benchs/batik/batik-1.7/sources/org/apache/batik/dom/svg/SVGOMScriptElement.java
|
Java
|
apache-2.0
| 5,420
|
from boten.core import BaseBot
import payloads
class TestBot(BaseBot):
def command_arg_bot(self, user_name):
yield "hello {}".format(user_name)
def command_no_arg_bot(self):
yield "hello"
def command_optional_arg_bot(self, optional="default"):
yield "hello {}".format(optional)
def command_two_message_bot(self):
yield "message1"
yield "message2"
def foo(self):
pass
def test_available_commands():
bot = TestBot({})
available_commands = bot.commands
assert "arg_bot" in available_commands
assert "no_arg_bot" in available_commands
assert "optional_arg_bot" in available_commands
assert "two_message_bot" in available_commands
assert "foo" not in available_commands
def test_arg_bot_with_arg():
bot = TestBot({})
response = list(bot.run_command(payloads.arg_bot_with_arg))
assert response[0] == "hello derp"
def test_arg_bot_with_no_args():
bot = TestBot({})
response = list(bot.run_command(payloads.arg_bot_with_no_args))
assert response[0].startswith("Got TypeError") # Help message
def test_no_arg_bot_without_arg():
bot = TestBot({})
response = list(bot.run_command(payloads.no_arg_bot_without_arg))
assert response[0] == "hello"
def test_no_arg_bot_with_arg():
bot = TestBot({})
response = list(bot.run_command(payloads.no_arg_bot_with_arg))
assert response[0].startswith("Got TypeError") # Help message
def test_optional_arg_bot_with_optional_arg():
bot = TestBot({})
response = list(bot.run_command(payloads.optional_arg_bot_with_optional_arg))
assert response[0] == 'hello derp'
def test_optional_arg_bot_with_no_arg():
bot = TestBot({})
response = list(bot.run_command(payloads.optional_arg_bot_with_no_arg))
assert response[0] == 'hello default'
def test_two_message_bot():
bot = TestBot({})
response = list(bot.run_command(payloads.two_message_bot))
assert len(response) == 2
def test_help_subcommand():
bot = TestBot({})
response = list(bot.run_command(payloads.no_arg_bot_with_arg))
assert response[0].startswith("Got TypeError") # Help message
|
forter/boten
|
test/test_botparse.py
|
Python
|
apache-2.0
| 2,177
|
package forcomp
import common._
object Anagrams {
/** A word is simply a `String`. */
type Word = String
/** A sentence is a `List` of words. */
type Sentence = List[Word]
/** `Occurrences` is a `List` of pairs of characters and positive integers saying
* how often the character appears.
* This list is sorted alphabetically w.r.t. to the character in each pair.
* All characters in the occurrence list are lowercase.
*
* Any list of pairs of lowercase characters and their frequency which is not sorted
* is **not** an occurrence list.
*
* Note: If the frequency of some character is zero, then that character should not be
* in the list.
*/
type Occurrences = List[(Char, Int)]
/** The dictionary is simply a sequence of words.
* It is predefined and obtained as a sequence using the utility method `loadDictionary`.
*/
val dictionary: List[Word] = loadDictionary
/** Converts the word into its character occurence list.
*
* Note: the uppercase and lowercase version of the character are treated as the
* same character, and are represented as a lowercase character in the occurrence list.
*/
def wordOccurrences(w: Word): Occurrences = w.toLowerCase().groupBy((c: Char) => c).toList.sortBy(c => c._1) map (s => (s._1, s._2.length))
/** Converts a sentence into its character occurrence list. */
def sentenceOccurrences(s: Sentence): Occurrences = wordOccurrences(s.mkString)
/** The `dictionaryByOccurrences` is a `Map` from different occurrences to a sequence of all
* the words that have that occurrence count.
* This map serves as an easy way to obtain all the anagrams of a word given its occurrence list.
*
* For example, the word "eat" has the following character occurrence list:
*
* `List(('a', 1), ('e', 1), ('t', 1))`
*
* Incidentally, so do the words "ate" and "tea".
*
* This means that the `dictionaryByOccurrences` map will contain an entry:
*
* List(('a', 1), ('e', 1), ('t', 1)) -> Seq("ate", "eat", "tea")
*
*/
lazy val dictionaryByOccurrences: Map[Occurrences, List[Word]] = dictionary.groupBy(d => wordOccurrences(d)).withDefaultValue(List())
/** Returns all the anagrams of a given word. */
def wordAnagrams(word: Word): List[Word] = dictionaryByOccurrences(wordOccurrences(word))
/** Returns the list of all subsets of the occurrence list.
* This includes the occurrence itself, i.e. `List(('k', 1), ('o', 1))`
* is a subset of `List(('k', 1), ('o', 1))`.
* It also include the empty subset `List()`.
*
* Example: the subsets of the occurrence list `List(('a', 2), ('b', 2))` are:
*
* List(
* List(),
* List(('a', 1)),
* List(('a', 2)),
* List(('b', 1)),
* List(('a', 1), ('b', 1)),
* List(('a', 2), ('b', 1)),
* List(('b', 2)),
* List(('a', 1), ('b', 2)),
* List(('a', 2), ('b', 2))
* )
*
* Note that the order of the occurrence list subsets does not matter -- the subsets
* in the example above could have been displayed in some other order.
*/
def combinations(occurrences: Occurrences): List[Occurrences] = occurrences match{
case List() => List(List())
case x :: xs => (for (n <- 0 to x._2; left_subsets <- combinations(xs)) yield (x._1, n) :: left_subsets).toList.map(subsets => subsets filter(_._2 != 0))
}
/** Subtracts occurrence list `y` from occurrence list `x`.
*
* The precondition is that the occurrence list `y` is a subset of
* the occurrence list `x` -- any character appearing in `y` must
* appear in `x`, and its frequency in `y` must be smaller or equal
* than its frequency in `x`.
*
* Note: the resulting value is an occurrence - meaning it is sorted
* and has no zero-entries.
*/
// sorted !!!
def subtract(x: Occurrences, y: Occurrences): Occurrences = ((y.toMap foldLeft x.toMap)(subtract_value)).toList.filter(_._2 != 0).sorted
def subtract_value(orig: Map[Char, Int], sub_term: (Char, Int)): Map[Char, Int] = orig.updated(sub_term._1, orig.apply(sub_term._1) - sub_term._2)
/** Returns a list of all anagram sentences of the given sentence.
*
* An anagram of a sentence is formed by taking the occurrences of all the characters of
* all the words in the sentence, and producing all possible combinations of words with those characters,
* such that the words have to be from the dictionary.
*
* The number of words in the sentence and its anagrams does not have to correspond.
* For example, the sentence `List("I", "love", "you")` is an anagram of the sentence `List("You", "olive")`.
*
* Also, two sentences with the same words but in a different order are considered two different anagrams.
* For example, sentences `List("You", "olive")` and `List("olive", "you")` are different anagrams of
* `List("I", "love", "you")`.
*
* Here is a full example of a sentence `List("Yes", "man")` and its anagrams for our dictionary:
*
* List(
* List(en, as, my),
* List(en, my, as),
* List(man, yes),
* List(men, say),
* List(as, en, my),
* List(as, my, en),
* List(sane, my),
* List(Sean, my),
* List(my, en, as),
* List(my, as, en),
* List(my, sane),
* List(my, Sean),
* List(say, men),
* List(yes, man)
* )
*
* The different sentences do not have to be output in the order shown above - any order is fine as long as
* all the anagrams are there. Every returned word has to exist in the dictionary.
*
* Note: in case that the words of the sentence are in the dictionary, then the sentence is the anagram of itself,
* so it has to be returned in this list.
*
* Note: There is only one anagram of an empty sentence.
*/
def sentenceAnagrams(sentence: Sentence): List[Sentence] = sentenceOccurs(sentenceOccurrences(sentence))
def sentenceOccurs(occurs: Occurrences): List[Sentence] = occurs match {
case List() => List(List())
case x :: xs =>
for (one_occur <- combinations(occurs).filter( _.length != 0);
word <- dictionaryByOccurrences.apply(one_occur);
sentence <- sentenceOccurs(subtract(occurs, one_occur));
if (dictionaryByOccurrences.contains(one_occur)))
yield word :: sentence
}
}
|
xupeixiang/scala-course
|
progfun-forcomp/src/main/scala/forcomp/Anagrams.scala
|
Scala
|
apache-2.0
| 6,439
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.