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
|
|---|---|---|---|---|---|
<!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_05.html">Class Test_AbaRouteValidator_05</a></li>
</ol></div>
<h1 class="aui-h2-clover">
Test testAbaNumberCheck_8962_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_05.html?line=35128#src-35128" >testAbaNumberCheck_8962_bad</a>
</td>
<td>
<span class="sortValue">1</span><span class="aui-lozenge aui-lozenge-success">PASS</span>
</td>
<td>
7 Aug 12:35:17
</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_8962_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=12784#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=12784#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=12784#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_05_testAbaNumberCheck_8962_bad_9v4.html
|
HTML
|
apache-2.0
| 10,984
|
/**
* 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.drill.exec.planner.physical.visitor;
import org.apache.drill.exec.planner.physical.ExchangePrel;
import org.apache.drill.exec.planner.physical.JoinPrel;
import org.apache.drill.exec.planner.physical.Prel;
import org.apache.drill.exec.planner.physical.ProjectPrel;
import org.apache.drill.exec.planner.physical.ScanPrel;
import org.apache.drill.exec.planner.physical.ScreenPrel;
import org.apache.drill.exec.planner.physical.WriterPrel;
public interface PrelVisitor<RETURN, EXTRA, EXCEP extends Throwable> {
static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(PrelVisitor.class);
public RETURN visitExchange(ExchangePrel prel, EXTRA value) throws EXCEP;
public RETURN visitScreen(ScreenPrel prel, EXTRA value) throws EXCEP;
public RETURN visitWriter(WriterPrel prel, EXTRA value) throws EXCEP;
public RETURN visitScan(ScanPrel prel, EXTRA value) throws EXCEP;
public RETURN visitJoin(JoinPrel prel, EXTRA value) throws EXCEP;
public RETURN visitProject(ProjectPrel prel, EXTRA value) throws EXCEP;
public RETURN visitPrel(Prel prel, EXTRA value) throws EXCEP;
}
|
KulykRoman/drill
|
exec/java-exec/src/main/java/org/apache/drill/exec/planner/physical/visitor/PrelVisitor.java
|
Java
|
apache-2.0
| 1,925
|
package edu.colorado.walautil
import com.ibm.wala.ssa.ISSABasicBlock
object Types {
/** type aliases */
type MSet[T] = scala.collection.mutable.Set[T]
type MMap[K,V] = scala.collection.mutable.Map[K,V]
type MStack[T] = scala.collection.mutable.Stack[T]
type CmpOp = com.ibm.wala.shrikeBT.IConditionalBranchInstruction.IOperator
type BinOp = com.ibm.wala.shrikeBT.IBinaryOpInstruction.IOperator
type UnOp = com.ibm.wala.shrikeBT.IUnaryOpInstruction.IOperator
type WalaBlock = ISSABasicBlock
}
|
cuplv/walautil
|
src/main/scala/edu/colorado/walautil/Types.scala
|
Scala
|
apache-2.0
| 511
|
/*jshint expr: true*/
describe('selectBy', function() {
before(h.setup());
describe('VisibleText', function() {
it('should find element without special conditions', function() {
return this.client.selectByVisibleText('#selectTest', 'seis').getValue('#selectTest').then(function (value) {
value.should.be.exactly('someValue6');
});
});
it('should find element with spaces before and after the text', function() {
return this.client.selectByVisibleText('#selectTest', 'dos').getValue('#selectTest').then(function (value) {
value.should.be.exactly('someValue2');
});
});
it('should find element with spaces before and after the text parameter', function() {
return this.client.selectByVisibleText('#selectTest', ' cinco ').getValue('#selectTest').then(function (value) {
value.should.be.exactly('someValue5');
});
});
it('should find element with quotes around the text', function() {
return this.client.selectByVisibleText('#selectTest', '"siete"').getValue('#selectTest').then(function (value) {
value.should.be.exactly('someValue7');
});
});
it('should find element with quotes in the text', function() {
return this.client.selectByVisibleText('#selectTest', 'ocho "huit" (otto)').getValue('#selectTest').then(function (value) {
value.should.be.exactly('someValue8');
});
});
it('should find element with a quote in the text', function() {
return this.client.selectByVisibleText('#selectTest', 'nu"eve').getValue('#selectTest').then(function (value) {
value.should.be.exactly('someValue9');
});
});
it('should find element with a quote at the end of the text', function() {
return this.client.selectByVisibleText('#selectTest', 'diez"').getValue('#selectTest').then(function (value) {
value.should.be.exactly('someValue10');
});
});
});
describe('Index', function() {
it('should find element without special conditions', function() {
return this.client.selectByIndex('#selectTest', 3).getValue('#selectTest').then(function (value) {
value.should.be.exactly('someValue4');
});
});
it('should throw error if index is negative', function() {
return this.client.selectByIndex('#selectTest', -2).catch(function(err) {
assert.ifError(!!!err);
});
});
it('should throw error if index is higher than number of options', function() {
return this.client.selectByIndex('#selectTest', 99).catch(function(err) {
assert.ifError(!!!err);
});
});
});
describe('Name', function() {
it('should find element without special conditions', function() {
return this.client.selectByName('#selectTest', 'someName7').getValue('#selectTest').then(function (value) {
value.should.be.exactly('someValue7');
});
});
it('should find element with spaces before and after the name', function() {
return this.client.selectByName('#selectTest', 'someName9').getValue('#selectTest').then(function (value) {
value.should.be.exactly('someValue9');
});
});
it('should find element with spaces before and after the name parameter', function() {
return this.client.selectByName('#selectTest', ' someName8 ').getValue('#selectTest').then(function (value) {
value.should.be.exactly('someValue8');
});
});
});
describe('Value', function() {
it('should find element without special conditions', function() {
return this.client.selectByValue('#selectTest', 'someValue1').getValue('#selectTest').then(function (value) {
value.should.be.exactly('someValue1');
});
});
it('should find element with spaces before and after the value', function() {
return this.client.selectByValue('#selectTest', 'someValue3').getValue('#selectTest').then(function (value) {
value.should.be.exactly('someValue3');
});
});
it('should find element with spaces before and after the value parameter', function() {
return this.client.selectByValue('#selectTest', ' someValue5 ').getValue('#selectTest').then(function (value) {
value.should.be.exactly('someValue5');
});
});
});
});
|
CoderHam/WebScraper
|
node_modules/webdriverio/test/spec/selectBy.js
|
JavaScript
|
apache-2.0
| 4,906
|
/*
* Copyright (C) 2015-2016 Aurelitec
* http://www.aurelitec.com
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.aurelitec.injuredpixels;
import android.content.Intent;
import android.os.Bundle;
import android.view.GestureDetector;
import android.view.KeyEvent;
import android.view.MenuItem;
import android.view.MotionEvent;
import android.view.View;
/**
* The InjuredPixels main activity.
*/
public class InjuredPixelsActivity extends InjuredPixelsBaseActivity {
//region Fields
/**
* Instance state key for saving the Full Screen current setting.
*/
private static final String STATE_FULL_SCREEN = "full_screen";
/**
* The gesture detector.
*/
private GestureDetector mDoubleClickDetector;
//endregion
//region Activity Lifecycle
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_injured_pixels);
// Find views and init the overflow menu and the gesture detector
findInitViews();
initOverflowMenu(R.menu.popup_menu);
mDoubleClickDetector = new GestureDetector(this, new MyGestureListener());
// Go full screen immersive sticky
Utils.setCrossFadeRotationAnimation(getWindow());
Utils.setImmersiveFullScreen(getWindow());
}
/**
* Set immersive full screen mode when window gets focus.
*/
@Override
public void onWindowFocusChanged(boolean hasFocus) {
super.onWindowFocusChanged(hasFocus);
if (hasFocus) {
Utils.setImmersiveFullScreen(getWindow());
}
}
/**
* Load and apply preferences when the activity is resumed.
*/
@Override
protected void onResume() {
super.onResume();
loadPreferences();
}
/**
* Restore the full screen mode when the instance state is restored.
*/
@Override
protected void onRestoreInstanceState(Bundle savedInstanceState) {
super.onRestoreInstanceState(savedInstanceState);
if (savedInstanceState != null) {
setFullScreen(savedInstanceState.getBoolean(STATE_FULL_SCREEN));
}
}
/**
* Connect the double click gesture detector on touch events.
*/
@Override
public boolean onTouchEvent(MotionEvent event) {
this.mDoubleClickDetector.onTouchEvent(event);
return super.onTouchEvent(event);
}
/**
* Update the color when the Named Colors Activity returns.
*/
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == ColorPickerActivity.REQUEST_NAMED_COLOR) {
if (resultCode == RESULT_OK) {
int resultColor = data.getIntExtra(ColorPickerActivity.EXTRA_SELECTED_COLOR, 0);
if (resultColor != 0) {
setCustomColor(resultColor);
savePreferences();
}
}
}
}
/**
* Save preferences when the activity is paused.
*/
@Override
protected void onPause() {
super.onPause();
savePreferences();
}
/**
* Save the full screen mode when the instance state is saved.
*/
@Override
protected void onSaveInstanceState(Bundle outState) {
outState.putBoolean(STATE_FULL_SCREEN, isFullScreen());
super.onSaveInstanceState(outState);
}
//endregion
//region Activity UI Controls
/**
* Update the color when a new color button is clicked.
*/
public void colorButtonClick(View view) {
setTestColor(view);
}
/**
* Override onKeyDown to cycle through colors when the user presses the volume buttons.
*/
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
switch (keyCode) {
case KeyEvent.KEYCODE_VOLUME_UP:
previousColor();
return true;
case KeyEvent.KEYCODE_VOLUME_DOWN:
nextColor();
return true;
}
return super.onKeyDown(keyCode, event);
}
/**
* Disable the audible beep when pressing the Volume buttons.
*/
@Override
public boolean onKeyUp(int keyCode, KeyEvent event) {
return (keyCode == KeyEvent.KEYCODE_VOLUME_UP) || (keyCode == KeyEvent.KEYCODE_VOLUME_DOWN) ||
super.onKeyUp(keyCode, event);
}
/**
* Toggle full screen mode when the user double taps the screen.
*/
private class MyGestureListener extends GestureDetector.SimpleOnGestureListener {
@Override
public boolean onDown(MotionEvent event) {
return true;
}
@Override
public boolean onDoubleTap(MotionEvent e) {
setFullScreen(!isFullScreen());
return true;
}
}
//endregion
//region Popup Menu
/**
* Show the popup menu when the overflow button is clicked.
*/
@SuppressWarnings("UnusedParameters")
public void menuButtonClick(View view) {
showOverflowMenu();
}
/**
* "Set custom color" menu item: open a color picker dialog activity to allow the user to pick a custom color.
*/
@SuppressWarnings("UnusedParameters")
public void actionSetCustomColor(MenuItem item) {
Intent intent = new Intent(this, ColorPickerActivity.class);
intent.putExtra(ColorPickerActivity.EXTRA_SELECTED_COLOR, getCustomColor());
startActivityForResult(intent, ColorPickerActivity.REQUEST_NAMED_COLOR);
}
/**
* "Max brightness" menu item: toggle screen full brightness.
*/
public void actionMaxBrightness(MenuItem item) {
toggleMaxBrightness();
item.setChecked(isMaxBrightness());
Utils.setFullBrightness(getWindow(), isMaxBrightness());
}
/**
* "Rate app" menu item: open the app page in Google Play to allow the user to rate the app.
*/
@SuppressWarnings("UnusedParameters")
public void actionRate(MenuItem item) {
Utils.viewUrl(InjuredPixelsActivity.this, getString(R.string.action_rate_url));
}
/**
* "Help" menu item: open the app home page to allow the user to read more info about the app.
*/
@SuppressWarnings("UnusedParameters")
public void actionHelp(MenuItem item) {
Utils.viewUrl(InjuredPixelsActivity.this, getString(R.string.action_help_url));
}
//endregion
}
|
aurelitec/injuredpixels-android
|
InjuredPixels/app/src/main/java/com/aurelitec/injuredpixels/InjuredPixelsActivity.java
|
Java
|
apache-2.0
| 6,999
|
package org.webant.extension.test.derby;
import java.sql.*;
import java.util.Properties;
public class DerbyTestEmbedded {
private final static String DB_URL = "jdbc:derby:data/derby/data;create=true";
// private final static String DERBY_DRIVER = "org.apache.derby.jdbc.ClientDriver";
private final static String DERBY_DRIVER = "org.apache.derby.jdbc.EmbeddedDriver";
public static void main(String[] args) {
Connection conn = null;
try {
Class.forName(DERBY_DRIVER);
Properties properties = new Properties();
// properties.put("create", "false"); // 新建数据库
// properties.put("user", "APP"); // 用户名
// properties.put("password", "APP"); // 密码
// properties.put("retreiveMessagesFromServerOnGetMessage", "true");
conn = DriverManager.getConnection(DB_URL, properties);
Statement stat = conn.createStatement();
ResultSet result = stat.executeQuery("SELECT * FROM ijtest");
while (result.next()) {
System.out.println("序号 : " + result.getInt(1));
}
result.close();
stat.close();
conn.close();
} catch (ClassNotFoundException e) {
e.printStackTrace();
} catch (SQLException e) {
e.printStackTrace();
} finally {
// 内嵌模式数据库操作用完之后需要关闭数据库,这里没有执行数据库名称则全部关闭.
try {
DriverManager.getConnection("jdbc:derby:;shutdown=true");
} catch (SQLException e) {
e.getMessage();
}
}
}}
|
sutine/webant
|
webant-extension/src/test/scala/org/webant/extension/test/derby/DerbyTestEmbedded.java
|
Java
|
apache-2.0
| 1,723
|
package com.ismai.miguel.countdownclock;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() throws Exception {
assertEquals(4, 2 + 2);
}
}
|
mini890/ComputacaoMovel
|
CountdownClock/app/src/test/java/com/ismai/miguel/countdownclock/ExampleUnitTest.java
|
Java
|
apache-2.0
| 409
|
//
// Pythagoras - a collection of geometry classes
// http://github.com/samskivert/pythagoras
package pythagoras.f;
import java.io.Serializable;
/**
* Represents an arc defined by a framing rectangle, start angle, angular extend, and closure type.
*/
public class Arc extends AbstractArc implements Serializable
{
private static final long serialVersionUID = 378120636227888073L;
/** The x-coordinate of this arc's framing rectangle. */
public float x;
/** The y-coordinate of this arc's framing rectangle. */
public float y;
/** The width of this arc's framing rectangle. */
public float width;
/** The height of this arc's framing rectangle. */
public float height;
/** The starting angle of this arc. */
public float start;
/** The angular extent of this arc. */
public float extent;
/**
* Creates an open arc with frame (0x0+0+0) and zero angles.
*/
public Arc () {
this(OPEN);
}
/**
* Creates an arc of the specified type with frame (0x0+0+0) and zero angles.
*/
public Arc (int type) {
setArcType(type);
}
/**
* Creates an arc of the specified type with the specified framing rectangle, starting angle
* and angular extent.
*/
public Arc (float x, float y, float width, float height, float start, float extent, int type) {
setArc(x, y, width, height, start, extent, type);
}
/**
* Creates an arc of the specified type with the supplied framing rectangle, starting angle and
* angular extent.
*/
public Arc (IRectangle bounds, float start, float extent, int type) {
setArc(bounds.x(), bounds.y(), bounds.width(), bounds.height(),
start, extent, type);
}
@Override // from interface IArc
public int arcType () {
return type;
}
@Override // from interface IArc
public float x () {
return x;
}
@Override // from interface IArc
public float y () {
return y;
}
@Override // from interface IArc
public float width () {
return width;
}
@Override // from interface IArc
public float height () {
return height;
}
@Override // from interface IArc
public float angleStart () {
return start;
}
@Override // from interface IArc
public float angleExtent () {
return extent;
}
/**
* Sets the type of this arc to the specified value.
*/
public void setArcType (int type) {
if (type != OPEN && type != CHORD && type != PIE) {
throw new IllegalArgumentException("Invalid Arc type: " + type);
}
this.type = type;
}
/**
* Sets the starting angle of this arc to the specified value.
*/
public void setAngleStart (float start) {
this.start = start;
}
/**
* Sets the angular extent of this arc to the specified value.
*/
public void setAngleExtent (float extent) {
this.extent = extent;
}
/**
* Sets the location, size, angular extents, and closure type of this arc to the specified
* values.
*/
public void setArc (float x, float y, float width, float height,
float start, float extent, int type) {
setArcType(type);
this.x = x;
this.y = y;
this.width = width;
this.height = height;
this.start = start;
this.extent = extent;
}
/**
* Sets the location, size, angular extents, and closure type of this arc to the specified
* values.
*/
public void setArc (XY point, IDimension size, float start, float extent, int type) {
setArc(point.x(), point.y(), size.width(), size.height(), start, extent, type);
}
/**
* Sets the location, size, angular extents, and closure type of this arc to the specified
* values.
*/
public void setArc (IRectangle rect, float start, float extent, int type) {
setArc(rect.x(), rect.y(), rect.width(), rect.height(), start, extent, type);
}
/**
* Sets the location, size, angular extents, and closure type of this arc to the same values as
* the supplied arc.
*/
public void setArc (IArc arc) {
setArc(arc.x(), arc.y(), arc.width(), arc.height(), arc.angleStart(),
arc.angleExtent(), arc.arcType());
}
/**
* Sets the location, size, angular extents, and closure type of this arc based on the
* specified values.
*/
public void setArcByCenter (float x, float y, float radius,
float start, float extent, int type) {
setArc(x - radius, y - radius, radius * 2f, radius * 2f, start, extent, type);
}
/**
* Sets the location, size, angular extents, and closure type of this arc based on the
* specified values.
*/
public void setArcByTangent (XY p1, XY p2, XY p3, float radius) {
// use simple geometric calculations of arc center, radius and angles by tangents
float a1 = -FloatMath.atan2(p1.y() - p2.y(), p1.x() - p2.x());
float a2 = -FloatMath.atan2(p3.y() - p2.y(), p3.x() - p2.x());
float am = (a1 + a2) / 2f;
float ah = a1 - am;
float d = radius / Math.abs(FloatMath.sin(ah));
float x = p2.x() + d * FloatMath.cos(am);
float y = p2.y() - d * FloatMath.sin(am);
ah = ah >= 0f ? FloatMath.PI * 1.5f - ah : FloatMath.PI * 0.5f - ah;
a1 = normAngle(FloatMath.toDegrees(am - ah));
a2 = normAngle(FloatMath.toDegrees(am + ah));
float delta = a2 - a1;
if (delta <= 0f) {
delta += 360f;
}
setArcByCenter(x, y, radius, a1, delta, type);
}
/**
* Sets the starting angle of this arc to the angle defined by the supplied point relative to
* the center of this arc.
*/
public void setAngleStart (XY point) {
float angle = FloatMath.atan2(point.y() - centerY(), point.x() - centerX());
setAngleStart(normAngle(-FloatMath.toDegrees(angle)));
}
/**
* Sets the starting angle and angular extent of this arc using two sets of coordinates. The
* first set of coordinates is used to determine the angle of the starting point relative to
* the arc's center. The second set of coordinates is used to determine the angle of the end
* point relative to the arc's center. The arc will always be non-empty and extend
* counterclockwise from the first point around to the second point.
*/
public void setAngles (float x1, float y1, float x2, float y2) {
float cx = centerX();
float cy = centerY();
float a1 = normAngle(-FloatMath.toDegrees(FloatMath.atan2(y1 - cy, x1 - cx)));
float a2 = normAngle(-FloatMath.toDegrees(FloatMath.atan2(y2 - cy, x2 - cx)));
a2 -= a1;
if (a2 <= 0f) {
a2 += 360f;
}
setAngleStart(a1);
setAngleExtent(a2);
}
/**
* Sets the starting angle and angular extent of this arc using two sets of coordinates. The
* first set of coordinates is used to determine the angle of the starting point relative to
* the arc's center. The second set of coordinates is used to determine the angle of the end
* point relative to the arc's center. The arc will always be non-empty and extend
* counterclockwise from the first point around to the second point.
*/
public void setAngles (XY p1, XY p2) {
setAngles(p1.x(), p1.y(), p2.x(), p2.y());
}
@Override // from RectangularShape
public void setFrame (float x, float y, float width, float height) {
setArc(x, y, width, height, angleStart(), angleExtent(), type);
}
private int type;
}
|
samskivert/pythagoras
|
src/main/java/pythagoras/f/Arc.java
|
Java
|
apache-2.0
| 7,812
|
/*Copyright 2014-2015 George Karagoulis
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.*/
#ifndef GUTIL_SOURCESANDSINKS_H
#define GUTIL_SOURCESANDSINKS_H
#include <gutil/iio.h>
#include <gutil/string.h>
#include <cstdarg>
NAMESPACE_GUTIL;
/** Defines a byte array input source. The byte array must exist
* for the lifetime of this instance. The caller retains ownership
* of the byte array.
*/
class ByteArrayInput : public GUtil::IRandomAccessInput
{
byte const *const m_start;
byte const *const m_end;
byte const *m_cur;
public:
/** Initialize from a byte array. */
ByteArrayInput(byte const *ba, GUINT32 len)
:m_start(ba), m_end(m_start + len), m_cur(m_start) {}
/** Initialize from a char array. */
ByteArrayInput(char const *ba, GUINT32 len)
:m_start((byte const *)ba), m_end(m_start + len), m_cur(m_start) {}
ByteArrayInput(const String &s)
:m_start((byte const *)s.ConstData()), m_end(m_start + s.Length()), m_cur(m_start) {}
ByteArrayInput(const GUtil::Vector<byte> &s)
:m_start((byte const *)s.ConstData()), m_end(m_start + s.Length()), m_cur(m_start) {}
virtual ~ByteArrayInput();
/** \name GUtil::IRandomAccessInput
\{
*/
virtual GUINT32 ReadBytes(byte *buf, GUINT32 len, GUINT32 to_read);
virtual GUINT64 Pos() const{ return m_cur - m_start; }
virtual GUINT64 Length() const{ return m_end - m_start; }
virtual void Seek(GUINT64 pos){ m_cur = m_start + pos; }
/** \} */
};
/** Takes a large input device and constrains the input to a section of it.
* Like if you only want to read part of a file, not the whole thing, you might
* constrain it as an input.
*/
class ConstrainedInput : public GUtil::IRandomAccessInput
{
IRandomAccessInput &m_input;
const GUINT32 m_start, m_end;
public:
ConstrainedInput(IRandomAccessInput &input, GUINT32 startpos, GUINT32 endpos)
:m_input(input), m_start(startpos), m_end(endpos)
{
GASSERT(m_input.Length() > startpos);
GASSERT(m_input.Length() >= endpos);
GASSERT(endpos >= startpos);
m_input.Seek(startpos);
}
virtual GUINT32 ReadBytes(byte *buf, GUINT32 len, GUINT32 to_read){
return m_input.ReadBytes(buf, len, to_read);
}
virtual GUINT64 Pos() const{ return m_input.Pos() - m_start; }
virtual GUINT64 Length() const{ return m_end - m_start; }
virtual void Seek(GUINT64 pos){ m_input.Seek(m_start + pos); }
};
/** Outputs to a generic byte array. Use as a data sink.
* You must be very careful with this class, and only use it if
* you know your buffer is large enough to receive the data
* This could cause a seg fault if used improperly. If you don't
* know the size of the output, then use VectorByteArrayOutput.
*/
class ByteArrayOutput : public GUtil::IOutput
{
byte *m_cur;
public:
ByteArrayOutput(char *ba) :m_cur((byte *)ba) {}
ByteArrayOutput(byte *ba) :m_cur(ba) {}
virtual GUINT32 WriteBytes(const byte *data, GUINT32 len){
memcpy(m_cur, data, len);
m_cur += len;
return len;
}
};
/** Outputs to a string. Use as a data sink. */
class StringOutput : public GUtil::IOutput
{
String &m_out;
public:
StringOutput(String &ba) :m_out(ba) {}
virtual GUINT32 WriteBytes(const byte *data, GUINT32 len){
m_out.Insert((const char *)data, len, m_out.Length());
return len;
}
};
/** Outputs to a vector byte array. Use as a data sink. */
class VectorByteArrayOutput : public GUtil::IOutput
{
Vector<byte> &m_out;
public:
VectorByteArrayOutput(Vector<byte> &ba) :m_out(ba) {}
virtual GUINT32 WriteBytes(const byte *data, GUINT32 len){
m_out.Insert(data, len, m_out.Length());
return len;
}
};
/** A class that replicates output across several output devices.
The output data received by this device will be replicated to the other devices in the order they are given.
The separate output devices are not owned by the replicator, so you must manage their memory yourself.
If one device encounters an error during output and it throws an exception, all further processing
will be halted. If the device fails silently (i.e. returns less than the desired number of bytes written)
then it will not be known to the outside. The replicator simply skips over it and always returns the
desired number of bytes written.
*/
class OutputReplicator : public GUtil::IOutput
{
Vector<IOutput *> m_outputs;
public:
/** Variadic constructor allows you to make a replicator with arbitrarily many outputs.
The number of arguments must match the first argument N.
*/
OutputReplicator(GUINT32 N = 0, ...)
:m_outputs(N)
{
va_list args;
va_start(args, N);
for(GUINT32 i = 0; i < N; ++i)
m_outputs.PushBack(va_arg(args, IOutput*));
va_end(args);
}
/** Appends an output device to the list. */
void AddOutputDevice(IOutput *o){ m_outputs.PushBack(o); }
/** Returns the current number of outputs to which the data is being replicated. */
GUINT32 NumberOfOutputs() const{ return m_outputs.Length(); }
/** Writes the data to all output devices in the order they were given.
Errors are only presented if an exception is thrown.
*/
virtual GUINT32 WriteBytes(const byte *data, GUINT32 len){
for(GUINT32 i = 0; i < m_outputs.Length(); ++i)
m_outputs[i]->WriteBytes(data, len);
return len;
}
};
END_NAMESPACE_GUTIL;
#endif // GUTIL_SOURCESANDSINKS_H
|
karagog/gutil
|
src/core/data_access/sourcesandsinks.h
|
C
|
apache-2.0
| 6,102
|
<div class="col-md-12 yds-checkbox-wrapper">
<div class="row" >
<div class="col col-md-12">
<h4><span class="label label-default">Geographical Area</span></h4>
<ul>
<li class="col col-md-12 yds-checkbox"
ng-repeat="item in checkboxes"
title="{{item.name}}">
<div>{{item.name}}</div>
<checkbox ng-model="item.selected" class="pull-right"></checkbox>
<!-- *** Apply Different values for true and false ***
ng-true-value="The Truth"
ng-false-value="The Untruth"
ng-change="onChange()"--->
</li>
</ul>
</div>
</div>
<div class="row">
<div class="col col-md-12">
<h4><span class="label label-default">Budget</span></h4>
<rzslider rz-slider-model="budgetSlider.minValue"
rz-slider-high="budgetSlider.maxValue"
rz-slider-options="budgetSlider.options"></rzslider>
</div>
</div>
<div class="row">
<div class="col col-md-12">
<h4><span class="label label-default">Completion Rate</span></h4>
<rzslider rz-slider-model="completionSlider.minValue"
rz-slider-high="completionSlider.maxValue"
rz-slider-options="completionSlider.options"></rzslider>
</div>
</div>
<hr/>
<button type="button" class="btn btn-yds btn-block"
ng-click="applyFilters()" aria-label="Left Align">
Apply
</button>
</div>
|
YourDataStories/components-visualisation
|
src/templates/facets-new.html
|
HTML
|
apache-2.0
| 1,653
|
<?php namespace reinvently\ondemand\core\vendor\mapsdirections\google;
/**
* @copyright Reinvently (c) 2017
* @link http://reinvently.com/
* @license https://opensource.org/licenses/Apache-2.0 Apache License 2.0
*/
class Types
{
const MODE_DRIVING = "driving";
const MODE_WALKING = "walking";
const MODE_BICYCLING = "bicycling";
const MODE_TRANSIT = "transit";
const UNIT_METRIC = "metric";
const UNIT_IMPERIAL = "imperial";
static private $modes = [
self::MODE_DRIVING,
self::MODE_WALKING,
self::MODE_BICYCLING,
self::MODE_TRANSIT
];
static private $units = [
self::UNIT_METRIC,
self::UNIT_IMPERIAL
];
static public function getModesList()
{
return self::$modes;
}
static public function getUnitsList()
{
return self::$units;
}
static public function checkMode($mode)
{
return in_array($mode, self::getModesList());
}
static public function checkUnit($unit)
{
return in_array($unit, self::getUnitsList());
}
}
|
Reinvently/On-Demand-Core
|
src/vendor/MapsDirections/Google/Types.php
|
PHP
|
apache-2.0
| 1,118
|
<?php
/*
* This file is part of the symfony package.
* (c) 2004-2006 Fabien Potencier <fabien.potencier@symfony-project.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
require_once(dirname(__FILE__).'/../../bootstrap/unit.php');
$t = new lime_test(8);
class myConfigHandler extends sfConfigHandler
{
public function execute($configFiles) {}
}
$config = new myConfigHandler();
$config->initialize();
// ->initialize()
$t->diag('->initialize()');
$config->initialize(array('foo' => 'bar'));
$t->is($config->getParameterHolder()->get('foo'), 'bar', '->initialize() takes an array of parameters as its first argument');
// ::replaceConstants()
$t->diag('::replaceConstants()');
sfConfig::set('foo', 'bar');
$t->is(sfConfigHandler::replaceConstants('my value with a %foo% constant'), 'my value with a bar constant', '::replaceConstants() replaces constants enclosed in %');
$t->is(sfConfigHandler::replaceConstants('%Y/%m/%d %H:%M'), '%Y/%m/%d %H:%M', '::replaceConstants() does not replace unknown constants');
sfConfig::set('foo', 'bar');
$value = array(
'foo' => 'my value with a %foo% constant',
'bar' => array(
'foo' => 'my value with a %foo% constant',
),
);
$value = sfConfigHandler::replaceConstants($value);
$t->is($value['foo'], 'my value with a bar constant', '::replaceConstants() replaces constants in arrays recursively');
$t->is($value['bar']['foo'], 'my value with a bar constant', '::replaceConstants() replaces constants in arrays recursively');
// ->getParameterHolder()
$t->diag('->getParameterHolder()');
$t->isa_ok($config->getParameterHolder(), 'sfParameterHolder', "->getParameterHolder() returns a parameter holder instance");
// ->replacePath()
$t->diag('->replacePath()');
sfConfig::set('sf_app_dir', 'ROOTDIR');
$t->is($config->replacePath('test'), 'ROOTDIR/test', '->replacePath() prefix a relative path with "sf_app_dir"');
$t->is($config->replacePath('/test'), '/test', '->replacePath() prefix a relative path with "sf_app_dir"');
|
studiodev/archives
|
2012 - Portfolio V5/lib/vendor/symfony/test/unit/config/sfConfigHandlerTest.php
|
PHP
|
apache-2.0
| 2,128
|
package org.test
object Test {
def foo: String = "bar"
}
|
er1c/scala-idea-template
|
src/main/scala/org/test/Test.scala
|
Scala
|
apache-2.0
| 58
|
/**
* @license Apache-2.0
*
* Copyright (c) 2021 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
/**
* Returns a regular expression to capture everything that is not a space immediately after the `function` keyword and before the first left parenthesis.
*
* @returns {RegExp} regular expression
*
* @example
* var RE_NATIVE_FUNCTION = reNativeFunction();
* var bool = RE_NATIVE_FUNCTION.test( Date.toString() );
* // returns true
*/
function reNativeFunction() {
var str = '';
// Use a native function as a template:
str += Function.prototype.toString.call( Function );
// Escape special RegExp characters:
str = str.replace( /([.*+?^=!:$(){}|[\]\/\\])/g, '\\$1' ); // eslint-disable-line no-useless-escape
// Replace any mentions of `Function` to make template generic and replace `for ...` and additional info provided in other environments, such as Rhino.
str = str.replace( /Function|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?' );
// Bracket the regular expression:
str = '^' + str + '$';
// Create the regular expression:
return new RegExp( str );
}
// EXPORTS //
module.exports = reNativeFunction;
|
stdlib-js/stdlib
|
lib/node_modules/@stdlib/regexp/native-function/lib/main.js
|
JavaScript
|
apache-2.0
| 1,677
|
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
var isPositiveInteger = require( './../lib' );
console.log( isPositiveInteger( 5.0 ) );
// => true
console.log( isPositiveInteger( 0.0 ) );
// => false
console.log( isPositiveInteger( -1.0 ) );
// => false
console.log( isPositiveInteger( 3.14 ) );
// => false
console.log( isPositiveInteger( NaN ) );
// => false
|
stdlib-js/stdlib
|
lib/node_modules/@stdlib/math/base/assert/is-positive-integer/examples/index.js
|
JavaScript
|
apache-2.0
| 951
|
/* $NetBSD: log.c,v 1.1.1.2 2004/07/12 23:27:15 wiz Exp $ */
/* Log file output.
Copyright (C) 2003 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published
by the Free Software Foundation; either version 2, 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
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
USA. */
/* Written by Bruno Haible <bruno@clisp.org>. */
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
/* Print an ASCII string with quotes and escape sequences where needed. */
static void
print_escaped (FILE *stream, const char *str)
{
putc ('"', stream);
for (; *str != '\0'; str++)
if (*str == '\n')
{
fputs ("\\n\"", stream);
if (str[1] == '\0')
return;
fputs ("\n\"", stream);
}
else
{
if (*str == '"' || *str == '\\')
putc ('\\', stream);
putc (*str, stream);
}
putc ('"', stream);
}
/* Add to the log file an entry denoting a failed translation. */
void
_nl_log_untranslated (const char *logfilename, const char *domainname,
const char *msgid1, const char *msgid2, int plural)
{
static char *last_logfilename = NULL;
static FILE *last_logfile = NULL;
FILE *logfile;
/* Can we reuse the last opened logfile? */
if (last_logfilename == NULL || strcmp (logfilename, last_logfilename) != 0)
{
/* Close the last used logfile. */
if (last_logfilename != NULL)
{
if (last_logfile != NULL)
{
fclose (last_logfile);
last_logfile = NULL;
}
free (last_logfilename);
last_logfilename = NULL;
}
/* Open the logfile. */
last_logfilename = (char *) malloc (strlen (logfilename) + 1);
if (last_logfilename == NULL)
return;
strcpy (last_logfilename, logfilename);
last_logfile = fopen (logfilename, "a");
if (last_logfile == NULL)
return;
}
logfile = last_logfile;
fprintf (logfile, "domain ");
print_escaped (logfile, domainname);
fprintf (logfile, "\nmsgid ");
print_escaped (logfile, msgid1);
if (plural)
{
fprintf (logfile, "\nmsgid_plural ");
print_escaped (logfile, msgid2);
fprintf (logfile, "\nmsgstr[0] \"\"\n");
}
else
fprintf (logfile, "\nmsgstr \"\"\n");
putc ('\n', logfile);
}
|
execunix/vinos
|
gnu/dist/texinfo/intl/log.c
|
C
|
apache-2.0
| 2,817
|
using ECQRS.Commons.Commands;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace UserManager.Organizations.Commands
{
public class OrganizationUserGroupAssociate : Command
{
public Guid OrganizationId { get; set; }
public Guid GroupId { get; set; }
public Guid UserId { get; set; }
}
}
|
kendarorg/ECQRSFramrework
|
ECQRSFramrework/Samples/UsersManager/UserManager.Organizations/Commands/OrganizationUserGroupAssociate.cs
|
C#
|
apache-2.0
| 401
|
using System;
using Microsoft.Extensions.Logging;
namespace Microsoft.Extensions.Logging
{
public static class LoggingExtensions
{
public static void ErrorFormat(this ILogger logger, string message, params string[] args)
{
logger.LogError(null, message, args);
}
public static void Error(this ILogger logger, string message, Exception e)
{
logger.LogError(null, e, message);
}
public static void Error(this ILogger logger, string message)
{
logger.LogError(null, message);
}
}
}
|
kerryjiang/NDock
|
src/NRack.Base/DotNetCore/LoggingExtensions.cs
|
C#
|
apache-2.0
| 617
|
brc32 ractl.rc -r -foractl.dcr
brc32 radb.rc -r -foradb.dcr
brc32 rai.rc -r -forai.dcr
|
tavultesoft/keymanweb
|
windows/src/ext/jedi/jvcl/tests/RALib/Images/MakeDCR.bat
|
Batchfile
|
apache-2.0
| 86
|
# Terrella halophila (Bicknell) Nevski SPECIES
#### Status
ACCEPTED
#### According to
International Plant Names Index
#### Published in
null
#### Original name
null
### Remarks
null
|
mdoering/backbone
|
life/Plantae/Magnoliophyta/Liliopsida/Poales/Poaceae/Terrella/Terrella halophila/README.md
|
Markdown
|
apache-2.0
| 186
|
// Copyright 2014-2015 Project Vogue. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/logging.h"
#include "elang/compiler/analysis/analysis.h"
#include "elang/compiler/analysis/type_factory.h"
#include "elang/compiler/analysis/type_values.h"
#include "elang/compiler/ast/class.h"
#include "elang/compiler/compilation_session.h"
#include "elang/compiler/predefined_names.h"
#include "elang/compiler/semantics/nodes.h"
namespace elang {
namespace compiler {
namespace ts {
//////////////////////////////////////////////////////////////////////
//
// The Type Factory
//
Factory::Factory(CompilationSession* session, Zone* zone)
: CompilationSessionUser(session),
ZoneUser(zone),
any_value_(new (zone) AnyValue),
empty_value_(new (zone) EmptyValue()),
literal_cache_map_(zone),
null_value_cache_map_(zone),
bool_value_(NewPredefinedValue(PredefinedName::Bool)),
float32_value_(NewPredefinedValue(PredefinedName::Float32)),
float64_value_(NewPredefinedValue(PredefinedName::Float64)),
int16_value_(NewPredefinedValue(PredefinedName::Int16)),
int32_value_(NewPredefinedValue(PredefinedName::Int32)),
int64_value_(NewPredefinedValue(PredefinedName::Int64)),
int8_value_(NewPredefinedValue(PredefinedName::Int8)),
uint16_value_(NewPredefinedValue(PredefinedName::UInt16)),
uint32_value_(NewPredefinedValue(PredefinedName::UInt32)),
uint64_value_(NewPredefinedValue(PredefinedName::UInt64)),
uint8_value_(NewPredefinedValue(PredefinedName::UInt8)) {
}
Factory::~Factory() {
}
AndValue* Factory::NewAndValue(const std::vector<UnionValue*>& union_values) {
return new (zone()) AndValue(zone(), union_values);
}
Argument* Factory::NewArgument(CallValue* call_value, int position) {
return new (zone()) Argument(call_value, position);
}
CallValue* Factory::NewCallValue(ast::Call* ast_call) {
return new (zone()) CallValue(zone(), ast_call);
}
Value* Factory::NewInvalidValue(ast::Node* node) {
return new (zone()) InvalidValue(node);
}
Value* Factory::NewLiteral(sm::Type* type) {
auto const it = literal_cache_map_.find(type);
if (it != literal_cache_map_.end())
return it->second;
auto const value = new (zone()) Literal(type);
literal_cache_map_[type] = value;
return value;
}
Value* Factory::NewNullValue(Value* base_value) {
auto const it = null_value_cache_map_.find(base_value);
if (it != null_value_cache_map_.end())
return it->second;
auto const value = new (zone()) NullValue(base_value);
null_value_cache_map_[base_value] = value;
return value;
}
Value* Factory::NewPredefinedValue(PredefinedName name) {
return NewLiteral(session()->PredefinedTypeOf(name));
}
Variable* Factory::NewVariable(ast::Node* node, Value* value) {
return new (zone()) Variable(node, value);
}
} // namespace ts
} // namespace compiler
} // namespace elang
|
eval1749/elang
|
elang/compiler/analysis/type_factory.cc
|
C++
|
apache-2.0
| 2,981
|
/*
* Copyright © 2021 Celeral.
*
* 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.celeral.netlet.rpc;
public interface BeanFactory {
Object create(Class<?>[] desiredIfaces, Object... args);
Object create(Class<?> concreteType, Object... args);
void destroy(Object id);
Object get(Object id);
boolean contains(Object id);
}
|
243826/Netlet
|
src/main/java/com/celeral/netlet/rpc/BeanFactory.java
|
Java
|
apache-2.0
| 859
|
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=constant.SDL_SCANCODE_CAPSLOCK.html">
</head>
<body>
<p>Redirecting to <a href="constant.SDL_SCANCODE_CAPSLOCK.html">constant.SDL_SCANCODE_CAPSLOCK.html</a>...</p>
<script>location.replace("constant.SDL_SCANCODE_CAPSLOCK.html" + location.search + location.hash);</script>
</body>
</html>
|
nitro-devs/nitro-game-engine
|
docs/sdl2_sys/scancode/SDL_SCANCODE_CAPSLOCK.v.html
|
HTML
|
apache-2.0
| 381
|
package org.xbib.elasticsearch.index.mapper.langdetect;
import org.elasticsearch.common.io.Streams;
import org.junit.Test;
import org.xbib.elasticsearch.NodeTestUtils;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.StringReader;
import java.io.StringWriter;
import java.net.HttpURLConnection;
import java.net.URL;
import java.nio.charset.StandardCharsets;
import static org.junit.Assert.assertEquals;
/**
*
*/
public class SimpleHttpTest extends NodeTestUtils {
@Test
public void httpPost() throws IOException {
startCluster();
try {
String httpAddress = findHttpAddress(client());
if (httpAddress == null) {
throw new IllegalArgumentException("no HTTP address found");
}
URL base = new URL(httpAddress);
URL url = new URL(base, "_langdetect");
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
connection.setRequestProperty("Content-Type", "application/json");
connection.setRequestProperty("Accept", "application/json");
connection.setRequestMethod("POST");
connection.setDoOutput(true);
connection.setDoInput(true);
Streams.copy(new StringReader("{\"text\":\"Hallo, wie geht es Ihnen?\"}"),
new OutputStreamWriter(connection.getOutputStream(), StandardCharsets.UTF_8));
StringWriter response = new StringWriter();
Streams.copy(new InputStreamReader(connection.getInputStream(), StandardCharsets.UTF_8), response);
assertEquals("{\"languages\":[{\"language\":\"de\",\"probability\":0.9999958626688854}]}",
response.toString());
} finally {
stopCluster();
}
}
@Test
public void httpPostShortProfile() throws IOException {
startCluster();
try {
String httpAddress = findHttpAddress(client());
if (httpAddress == null) {
throw new IllegalArgumentException("no HTTP address found");
}
URL base = new URL(httpAddress);
URL url = new URL(base, "_langdetect/short-text");
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
connection.setRequestProperty("Content-Type", "application/json");
connection.setRequestProperty("Accept", "application/json");
connection.setRequestMethod("POST");
connection.setDoOutput(true);
connection.setDoInput(true);
Streams.copy(new StringReader("{\"text\":\"Das ist ein Text\"}"),
new OutputStreamWriter(connection.getOutputStream(), StandardCharsets.UTF_8));
StringWriter response = new StringWriter();
Streams.copy(new InputStreamReader(connection.getInputStream(), StandardCharsets.UTF_8), response);
assertEquals("{\"profile\":\"short-text\",\"languages\":[{\"language\":\"de\",\"probability\":0.999996853902916}]}",
response.toString());
} finally {
stopCluster();
}
}
@Test
public void httpPostShortProfileInBody() throws IOException {
startCluster();
try {
String httpAddress = findHttpAddress(client());
if (httpAddress == null) {
throw new IllegalArgumentException("no HTTP address found");
}
URL base = new URL(httpAddress);
URL url = new URL(base, "_langdetect");
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
connection.setRequestProperty("Content-Type", "application/json");
connection.setRequestProperty("Accept", "application/json");
connection.setRequestMethod("POST");
connection.setDoOutput(true);
connection.setDoInput(true);
Streams.copy(new StringReader("{\"text\":\"Das ist ein Text\",\"profile\":\"short-text\"}"),
new OutputStreamWriter(connection.getOutputStream(), StandardCharsets.UTF_8));
StringWriter response = new StringWriter();
Streams.copy(new InputStreamReader(connection.getInputStream(), StandardCharsets.UTF_8), response);
assertEquals("{\"profile\":\"short-text\",\"languages\":[{\"language\":\"de\",\"probability\":0.999996853902916}]}",
response.toString());
} finally {
stopCluster();
}
}
}
|
jprante/elasticsearch-langdetect
|
src/test/java/org/xbib/elasticsearch/index/mapper/langdetect/SimpleHttpTest.java
|
Java
|
apache-2.0
| 4,582
|
/*
* Licensed to The Apereo Foundation under one or more contributor license
* agreements. See the NOTICE file distributed with this work for additional
* information regarding copyright ownership.
*
* The Apereo Foundation licenses this file to you under the Apache License,
* Version 2.0, (the "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.tle.admin.harvester.tool;
import com.dytech.gui.TableLayout;
import com.dytech.gui.workers.GlassSwingWorker;
import com.tle.admin.Driver;
import com.tle.admin.baseentity.BaseEntityEditor.AbstractDetailsTab;
import com.tle.admin.baseentity.BaseEntityTab;
import com.tle.admin.gui.EditorException;
import com.tle.admin.gui.common.JNameValuePanel;
import com.tle.admin.gui.i18n.I18nTextField;
import com.tle.admin.harvester.standard.HarvesterPlugin;
import com.tle.beans.entity.BaseEntityLabel;
import com.tle.common.Check;
import com.tle.common.Format;
import com.tle.common.NameValue;
import com.tle.common.applet.gui.AppletGuiUtils;
import com.tle.common.harvester.HarvesterProfile;
import com.tle.common.harvester.HarvesterProfileSettings;
import com.tle.core.remoting.RemoteItemDefinitionService;
import com.tle.core.remoting.RemoteSchemaService;
import com.tle.i18n.BundleCache;
import java.awt.Component;
import java.awt.Rectangle;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.awt.event.KeyListener;
import java.util.Collections;
import java.util.List;
import javax.swing.ButtonGroup;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.JLabel;
import javax.swing.JRadioButton;
import javax.swing.JSeparator;
@SuppressWarnings("nls")
public class HarvesterDetailsTab extends BaseEntityTab<HarvesterProfile>
implements AbstractDetailsTab<HarvesterProfile> {
private String k(String key) {
return getKey("harvestdetails." + key);
}
private String getLocaleString(String key) {
return getString("harvestdetails." + key);
}
private HarvesterPlugin<?> plugin;
protected JNameValuePanel namePanel;
protected I18nTextField nameField;
private final JCheckBox enabled;
protected JSeparator separate1;
protected JSeparator separate2;
protected JComboBox<NameValue> collections;
protected JComboBox<String> transforms;
protected JRadioButton newVersionRadio;
protected JRadioButton updateVersionRadio;
public HarvesterDetailsTab() {
nameField = new I18nTextField(BundleCache.getLanguages());
enabled = new JCheckBox();
separate1 = new JSeparator();
separate2 = new JSeparator();
namePanel = new JNameValuePanel();
collections = new JComboBox<>();
transforms = new JComboBox<>();
ButtonGroup radioGroup = new ButtonGroup();
newVersionRadio = new JRadioButton(getLocaleString("createnew"));
updateVersionRadio = new JRadioButton(getLocaleString("updatecurrent"));
radioGroup.add(newVersionRadio);
radioGroup.add(updateVersionRadio);
namePanel.addTextAndComponent(k("namefield"), nameField);
namePanel.addTextAndComponent(k("enabled"), enabled);
namePanel.addTextAndComponent(k("collections"), collections);
namePanel.addTextAndComponent(k("import"), transforms);
namePanel.addComponent(separate1);
namePanel.addComponent(new JLabel(getLocaleString("updates")));
namePanel.addTextAndComponent(
k("emptyfiller"), new JLabel(getLocaleString("versioningdescriptor")));
namePanel.addTextAndComponent(k("emptyfiller"), newVersionRadio);
namePanel.addTextAndComponent(k("emptyfiller"), updateVersionRadio);
namePanel.addComponent(separate2);
}
@Override
public void setDriver(Driver driver) {
super.setDriver(driver);
plugin.setDriver(driver);
}
@Override
public final void init(Component parent) {
TableLayout layout =
new TableLayout(
new int[] {TableLayout.FILL}, new int[] {TableLayout.DOUBLE_FILL, TableLayout.FILL});
layout.setColumnSize(1, 0);
setLayout(layout);
add(namePanel.getComponent(), new Rectangle(0, 0, 1, 1));
}
@Override
public void addNameListener(KeyListener listener) {
nameField.addKeyListener(listener);
}
@Override
public void load() {
final HarvesterProfile havProfile = state.getEntity();
final HarvesterProfileSettings settings = plugin.newInstance();
settings.load(havProfile);
nameField.load(havProfile.getName());
Boolean enabled2 = havProfile.getEnabled();
if (enabled2 != null) {
enabled.setSelected(enabled2);
} else {
enabled.setSelected(true);
}
// NewVersionOnHarvest flag is true by default
Boolean newVersionOnHarvest = havProfile.getNewVersionOnHarvest();
if (newVersionOnHarvest != null) {
newVersionRadio.setSelected(newVersionOnHarvest);
updateVersionRadio.setSelected(!newVersionOnHarvest);
} else {
newVersionRadio.setSelected(true);
updateVersionRadio.setSelected(false);
}
GlassSwingWorker<?> worker =
new GlassSwingWorker<List<NameValue>>() {
@Override
public List<NameValue> construct() throws Exception {
List<BaseEntityLabel> cols =
clientService.getService(RemoteItemDefinitionService.class).listAll();
List<NameValue> nvs = BundleCache.getNameUuidValues(cols);
Collections.sort(nvs, Format.NAME_VALUE_COMPARATOR);
return nvs;
}
@Override
public void finished() {
AppletGuiUtils.addItemsToJCombo(collections, get());
String collection = havProfile.getAttribute("itemDef");
if (!Check.isEmpty(collection)) {
AppletGuiUtils.selectInJCombo(collections, new NameValue(null, collection), 0);
namePanel.clearChanges();
}
updateTransforms(havProfile, true);
collections.addItemListener(
new ItemListener() {
@Override
public void itemStateChanged(ItemEvent e) {
updateTransforms(havProfile, false);
}
});
}
};
worker.setComponent(collections);
worker.start();
plugin.loadSettings(state.getEntityPack(), settings);
}
private void updateTransforms(final HarvesterProfile havProfile, final boolean clearChanges) {
Object selectedItem = collections.getSelectedItem();
final String uuid;
if (selectedItem instanceof NameValue) {
uuid = ((NameValue) selectedItem).getValue();
} else {
uuid = (String) selectedItem;
}
GlassSwingWorker<?> worker =
new GlassSwingWorker<List<String>>() {
@Override
public List<String> construct() throws Exception {
long schemaId =
clientService
.getService(RemoteItemDefinitionService.class)
.getSchemaIdForCollectionUuid(uuid);
List<String> importSchemaTypes =
clientService.getService(RemoteSchemaService.class).getImportSchemaTypes(schemaId);
return importSchemaTypes;
}
@Override
public void finished() {
String selectedTransform = (String) transforms.getSelectedItem();
transforms.removeAllItems();
if (selectedTransform == null) {
selectedTransform = havProfile.getAttribute("schemaInputTransform");
}
List<String> items = get();
items.add(0, null);
AppletGuiUtils.addItemsToJCombo(transforms, items);
AppletGuiUtils.selectInJCombo(transforms, selectedTransform, 0);
if (clearChanges) {
namePanel.clearChanges();
}
}
};
worker.setComponent(transforms);
worker.start();
}
@Override
public void save() {
final HarvesterProfile havProfile = state.getEntity();
final HarvesterProfileSettings settings = plugin.newInstance();
settings.setName(nameField.save());
havProfile.setEnabled(enabled.isSelected());
// At this stage, we're dealing with a either/or on the version on
// harvest flag/button,
// and hence RadioGroup semantics to guarantee mutual exclUsivity of
// newVersion/updateVersion
havProfile.setNewVersionOnHarvest(newVersionRadio.isSelected());
havProfile.setAttribute("itemDef", ((NameValue) collections.getSelectedItem()).getValue());
havProfile.setAttribute("schemaInputTransform", ((String) transforms.getSelectedItem()));
plugin.saveSettings(settings);
settings.save(havProfile);
}
@Override
public String getTitle() {
return getLocaleString("name");
}
@Override
public void validation() throws EditorException {
if (nameField.isCompletelyEmpty()) {
throw new EditorException(getLocaleString("entername"));
}
if (collections.getSelectedItem() == null
|| collections.getSelectedItem().toString().isEmpty()) {
throw new EditorException(getLocaleString("collection"));
}
plugin.validation();
plugin.validateSchema(collections);
}
public void setPlugin(HarvesterPlugin<?> plugin) {
this.plugin = plugin;
plugin.setPanel(namePanel);
plugin.initGUI();
}
}
|
equella/Equella
|
Source/Plugins/Core/com.equella.admin/src/com/tle/admin/harvester/tool/HarvesterDetailsTab.java
|
Java
|
apache-2.0
| 9,719
|
# Licaria tikalana (Lundell) Lundell 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/Licaria/Licaria tikalana/README.md
|
Markdown
|
apache-2.0
| 184
|
//
// UIView+JHFrameConvenince.h
// 百思不得姐
//
// Created by 李建華 on 16/3/24.
// Copyright © 2016年 lijianhua. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface UIView (JHFrameConvenince)
@property(nonatomic, assign)CGFloat width;
@property(nonatomic, assign)CGFloat height;
@property(nonatomic, assign)CGFloat x;
@property(nonatomic, assign)CGFloat y;
@property(nonatomic, assign)CGSize size;
@property(nonatomic, assign)CGPoint origin;
@property(nonatomic, assign)CGFloat centerX;
@property(nonatomic, assign)CGFloat centerY;
/**
* 判断是否正在被主窗口范围显示
*/
@property(nonatomic, assign, readonly, getter=isShowingInKeyWindow)BOOL showingInKeyWindow;
/**
* 从xib中加载视图
*/
+ (instancetype)loadViewFromXib;
@end
|
xmanbest/JHBaiSi2
|
JHBaiSi2/百思不得姐/Classes/Others/Category/UIView+JHFrameConvenince.h
|
C
|
apache-2.0
| 779
|
# Dasyscypha digitalincolus Rehm SPECIES
#### Status
SYNONYM
#### According to
Index Fungorum
#### Published in
null
#### Original name
Dasyscypha digitalincolus Rehm
### Remarks
null
|
mdoering/backbone
|
life/Fungi/Ascomycota/Leotiomycetes/Helotiales/Hyaloscyphaceae/Dasyscyphus/Dasyscyphus digitalincolus/ Syn. Dasyscypha digitalincolus/README.md
|
Markdown
|
apache-2.0
| 188
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_45) on Sun Jun 09 12:16:18 GMT+05:30 2013 -->
<META http-equiv="Content-Type" content="text/html; charset=utf-8">
<TITLE>
HighlightParams (Solr 4.3.1 API)
</TITLE>
<META NAME="date" CONTENT="2013-06-09">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="HighlightParams (Solr 4.3.1 API)";
}
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<HR>
<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/HighlightParams.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../org/apache/solr/common/params/GroupParams.html" title="interface in org.apache.solr.common.params"><B>PREV CLASS</B></A>
<A HREF="../../../../../org/apache/solr/common/params/MapSolrParams.html" title="class in org.apache.solr.common.params"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../index.html?org/apache/solr/common/params/HighlightParams.html" target="_top"><B>FRAMES</B></A>
<A HREF="HighlightParams.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | CONSTR | METHOD</FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: <A HREF="#field_detail">FIELD</A> | CONSTR | METHOD</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
org.apache.solr.common.params</FONT>
<BR>
Interface HighlightParams</H2>
<HR>
<DL>
<DT><PRE>public interface <B>HighlightParams</B></DL>
</PRE>
<P>
<DL>
<DT><B>Since:</B></DT>
<DD>solr 1.3</DD>
</DL>
<HR>
<P>
<!-- =========== FIELD SUMMARY =========== -->
<A NAME="field_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Field Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/solr/common/params/HighlightParams.html#ALTERNATE_FIELD">ALTERNATE_FIELD</A></B></CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/solr/common/params/HighlightParams.html#ALTERNATE_FIELD_LENGTH">ALTERNATE_FIELD_LENGTH</A></B></CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/solr/common/params/HighlightParams.html#BOUNDARY_SCANNER">BOUNDARY_SCANNER</A></B></CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/solr/common/params/HighlightParams.html#BS_CHARS">BS_CHARS</A></B></CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/solr/common/params/HighlightParams.html#BS_COUNTRY">BS_COUNTRY</A></B></CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/solr/common/params/HighlightParams.html#BS_LANGUAGE">BS_LANGUAGE</A></B></CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/solr/common/params/HighlightParams.html#BS_MAX_SCAN">BS_MAX_SCAN</A></B></CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/solr/common/params/HighlightParams.html#BS_TYPE">BS_TYPE</A></B></CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/solr/common/params/HighlightParams.html#BS_VARIANT">BS_VARIANT</A></B></CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/solr/common/params/HighlightParams.html#DEFAULT_SUMMARY">DEFAULT_SUMMARY</A></B></CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/solr/common/params/HighlightParams.html#ENCODER">ENCODER</A></B></CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/solr/common/params/HighlightParams.html#FIELD_MATCH">FIELD_MATCH</A></B></CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/solr/common/params/HighlightParams.html#FIELDS">FIELDS</A></B></CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/solr/common/params/HighlightParams.html#FORMATTER">FORMATTER</A></B></CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/solr/common/params/HighlightParams.html#FRAG_LIST_BUILDER">FRAG_LIST_BUILDER</A></B></CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/solr/common/params/HighlightParams.html#FRAGMENTER">FRAGMENTER</A></B></CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/solr/common/params/HighlightParams.html#FRAGMENTS_BUILDER">FRAGMENTS_BUILDER</A></B></CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/solr/common/params/HighlightParams.html#FRAGSIZE">FRAGSIZE</A></B></CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/solr/common/params/HighlightParams.html#HIGHLIGHT">HIGHLIGHT</A></B></CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/solr/common/params/HighlightParams.html#HIGHLIGHT_MULTI_TERM">HIGHLIGHT_MULTI_TERM</A></B></CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/solr/common/params/HighlightParams.html#INCREMENT">INCREMENT</A></B></CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/solr/common/params/HighlightParams.html#MAX_CHARS">MAX_CHARS</A></B></CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/solr/common/params/HighlightParams.html#MAX_MULTIVALUED_TO_EXAMINE">MAX_MULTIVALUED_TO_EXAMINE</A></B></CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/solr/common/params/HighlightParams.html#MAX_MULTIVALUED_TO_MATCH">MAX_MULTIVALUED_TO_MATCH</A></B></CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/solr/common/params/HighlightParams.html#MAX_RE_CHARS">MAX_RE_CHARS</A></B></CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/solr/common/params/HighlightParams.html#MERGE_CONTIGUOUS_FRAGMENTS">MERGE_CONTIGUOUS_FRAGMENTS</A></B></CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/solr/common/params/HighlightParams.html#MULTI_VALUED_SEPARATOR">MULTI_VALUED_SEPARATOR</A></B></CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/solr/common/params/HighlightParams.html#PATTERN">PATTERN</A></B></CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/solr/common/params/HighlightParams.html#PHRASE_LIMIT">PHRASE_LIMIT</A></B></CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/solr/common/params/HighlightParams.html#PRESERVE_MULTI">PRESERVE_MULTI</A></B></CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/solr/common/params/HighlightParams.html#Q">Q</A></B></CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/solr/common/params/HighlightParams.html#REGEX">REGEX</A></B></CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/solr/common/params/HighlightParams.html#SCORE">SCORE</A></B></CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/solr/common/params/HighlightParams.html#SCORE_B">SCORE_B</A></B></CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/solr/common/params/HighlightParams.html#SCORE_K1">SCORE_K1</A></B></CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/solr/common/params/HighlightParams.html#SCORE_PIVOT">SCORE_PIVOT</A></B></CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/solr/common/params/HighlightParams.html#SIMPLE">SIMPLE</A></B></CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/solr/common/params/HighlightParams.html#SIMPLE_POST">SIMPLE_POST</A></B></CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/solr/common/params/HighlightParams.html#SIMPLE_PRE">SIMPLE_PRE</A></B></CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/solr/common/params/HighlightParams.html#SLOP">SLOP</A></B></CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/solr/common/params/HighlightParams.html#SNIPPETS">SNIPPETS</A></B></CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/solr/common/params/HighlightParams.html#TAG_ELLIPSIS">TAG_ELLIPSIS</A></B></CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/solr/common/params/HighlightParams.html#TAG_POST">TAG_POST</A></B></CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/solr/common/params/HighlightParams.html#TAG_PRE">TAG_PRE</A></B></CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/solr/common/params/HighlightParams.html#USE_FVH">USE_FVH</A></B></CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/solr/common/params/HighlightParams.html#USE_PHRASE_HIGHLIGHTER">USE_PHRASE_HIGHLIGHTER</A></B></CODE>
<BR>
</TD>
</TR>
</TABLE>
<P>
<!-- ============ FIELD DETAIL =========== -->
<A NAME="field_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Field Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="HIGHLIGHT"><!-- --></A><H3>
HIGHLIGHT</H3>
<PRE>
static final <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <B>HIGHLIGHT</B></PRE>
<DL>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../../../constant-values.html#org.apache.solr.common.params.HighlightParams.HIGHLIGHT">Constant Field Values</A></DL>
</DL>
<HR>
<A NAME="Q"><!-- --></A><H3>
Q</H3>
<PRE>
static final <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <B>Q</B></PRE>
<DL>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../../../constant-values.html#org.apache.solr.common.params.HighlightParams.Q">Constant Field Values</A></DL>
</DL>
<HR>
<A NAME="FIELDS"><!-- --></A><H3>
FIELDS</H3>
<PRE>
static final <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <B>FIELDS</B></PRE>
<DL>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../../../constant-values.html#org.apache.solr.common.params.HighlightParams.FIELDS">Constant Field Values</A></DL>
</DL>
<HR>
<A NAME="SNIPPETS"><!-- --></A><H3>
SNIPPETS</H3>
<PRE>
static final <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <B>SNIPPETS</B></PRE>
<DL>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../../../constant-values.html#org.apache.solr.common.params.HighlightParams.SNIPPETS">Constant Field Values</A></DL>
</DL>
<HR>
<A NAME="FRAGSIZE"><!-- --></A><H3>
FRAGSIZE</H3>
<PRE>
static final <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <B>FRAGSIZE</B></PRE>
<DL>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../../../constant-values.html#org.apache.solr.common.params.HighlightParams.FRAGSIZE">Constant Field Values</A></DL>
</DL>
<HR>
<A NAME="INCREMENT"><!-- --></A><H3>
INCREMENT</H3>
<PRE>
static final <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <B>INCREMENT</B></PRE>
<DL>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../../../constant-values.html#org.apache.solr.common.params.HighlightParams.INCREMENT">Constant Field Values</A></DL>
</DL>
<HR>
<A NAME="MAX_CHARS"><!-- --></A><H3>
MAX_CHARS</H3>
<PRE>
static final <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <B>MAX_CHARS</B></PRE>
<DL>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../../../constant-values.html#org.apache.solr.common.params.HighlightParams.MAX_CHARS">Constant Field Values</A></DL>
</DL>
<HR>
<A NAME="FORMATTER"><!-- --></A><H3>
FORMATTER</H3>
<PRE>
static final <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <B>FORMATTER</B></PRE>
<DL>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../../../constant-values.html#org.apache.solr.common.params.HighlightParams.FORMATTER">Constant Field Values</A></DL>
</DL>
<HR>
<A NAME="ENCODER"><!-- --></A><H3>
ENCODER</H3>
<PRE>
static final <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <B>ENCODER</B></PRE>
<DL>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../../../constant-values.html#org.apache.solr.common.params.HighlightParams.ENCODER">Constant Field Values</A></DL>
</DL>
<HR>
<A NAME="FRAGMENTER"><!-- --></A><H3>
FRAGMENTER</H3>
<PRE>
static final <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <B>FRAGMENTER</B></PRE>
<DL>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../../../constant-values.html#org.apache.solr.common.params.HighlightParams.FRAGMENTER">Constant Field Values</A></DL>
</DL>
<HR>
<A NAME="PRESERVE_MULTI"><!-- --></A><H3>
PRESERVE_MULTI</H3>
<PRE>
static final <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <B>PRESERVE_MULTI</B></PRE>
<DL>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../../../constant-values.html#org.apache.solr.common.params.HighlightParams.PRESERVE_MULTI">Constant Field Values</A></DL>
</DL>
<HR>
<A NAME="FRAG_LIST_BUILDER"><!-- --></A><H3>
FRAG_LIST_BUILDER</H3>
<PRE>
static final <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <B>FRAG_LIST_BUILDER</B></PRE>
<DL>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../../../constant-values.html#org.apache.solr.common.params.HighlightParams.FRAG_LIST_BUILDER">Constant Field Values</A></DL>
</DL>
<HR>
<A NAME="FRAGMENTS_BUILDER"><!-- --></A><H3>
FRAGMENTS_BUILDER</H3>
<PRE>
static final <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <B>FRAGMENTS_BUILDER</B></PRE>
<DL>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../../../constant-values.html#org.apache.solr.common.params.HighlightParams.FRAGMENTS_BUILDER">Constant Field Values</A></DL>
</DL>
<HR>
<A NAME="BOUNDARY_SCANNER"><!-- --></A><H3>
BOUNDARY_SCANNER</H3>
<PRE>
static final <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <B>BOUNDARY_SCANNER</B></PRE>
<DL>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../../../constant-values.html#org.apache.solr.common.params.HighlightParams.BOUNDARY_SCANNER">Constant Field Values</A></DL>
</DL>
<HR>
<A NAME="BS_MAX_SCAN"><!-- --></A><H3>
BS_MAX_SCAN</H3>
<PRE>
static final <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <B>BS_MAX_SCAN</B></PRE>
<DL>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../../../constant-values.html#org.apache.solr.common.params.HighlightParams.BS_MAX_SCAN">Constant Field Values</A></DL>
</DL>
<HR>
<A NAME="BS_CHARS"><!-- --></A><H3>
BS_CHARS</H3>
<PRE>
static final <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <B>BS_CHARS</B></PRE>
<DL>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../../../constant-values.html#org.apache.solr.common.params.HighlightParams.BS_CHARS">Constant Field Values</A></DL>
</DL>
<HR>
<A NAME="BS_TYPE"><!-- --></A><H3>
BS_TYPE</H3>
<PRE>
static final <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <B>BS_TYPE</B></PRE>
<DL>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../../../constant-values.html#org.apache.solr.common.params.HighlightParams.BS_TYPE">Constant Field Values</A></DL>
</DL>
<HR>
<A NAME="BS_LANGUAGE"><!-- --></A><H3>
BS_LANGUAGE</H3>
<PRE>
static final <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <B>BS_LANGUAGE</B></PRE>
<DL>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../../../constant-values.html#org.apache.solr.common.params.HighlightParams.BS_LANGUAGE">Constant Field Values</A></DL>
</DL>
<HR>
<A NAME="BS_COUNTRY"><!-- --></A><H3>
BS_COUNTRY</H3>
<PRE>
static final <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <B>BS_COUNTRY</B></PRE>
<DL>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../../../constant-values.html#org.apache.solr.common.params.HighlightParams.BS_COUNTRY">Constant Field Values</A></DL>
</DL>
<HR>
<A NAME="BS_VARIANT"><!-- --></A><H3>
BS_VARIANT</H3>
<PRE>
static final <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <B>BS_VARIANT</B></PRE>
<DL>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../../../constant-values.html#org.apache.solr.common.params.HighlightParams.BS_VARIANT">Constant Field Values</A></DL>
</DL>
<HR>
<A NAME="FIELD_MATCH"><!-- --></A><H3>
FIELD_MATCH</H3>
<PRE>
static final <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <B>FIELD_MATCH</B></PRE>
<DL>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../../../constant-values.html#org.apache.solr.common.params.HighlightParams.FIELD_MATCH">Constant Field Values</A></DL>
</DL>
<HR>
<A NAME="DEFAULT_SUMMARY"><!-- --></A><H3>
DEFAULT_SUMMARY</H3>
<PRE>
static final <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <B>DEFAULT_SUMMARY</B></PRE>
<DL>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../../../constant-values.html#org.apache.solr.common.params.HighlightParams.DEFAULT_SUMMARY">Constant Field Values</A></DL>
</DL>
<HR>
<A NAME="ALTERNATE_FIELD"><!-- --></A><H3>
ALTERNATE_FIELD</H3>
<PRE>
static final <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <B>ALTERNATE_FIELD</B></PRE>
<DL>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../../../constant-values.html#org.apache.solr.common.params.HighlightParams.ALTERNATE_FIELD">Constant Field Values</A></DL>
</DL>
<HR>
<A NAME="ALTERNATE_FIELD_LENGTH"><!-- --></A><H3>
ALTERNATE_FIELD_LENGTH</H3>
<PRE>
static final <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <B>ALTERNATE_FIELD_LENGTH</B></PRE>
<DL>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../../../constant-values.html#org.apache.solr.common.params.HighlightParams.ALTERNATE_FIELD_LENGTH">Constant Field Values</A></DL>
</DL>
<HR>
<A NAME="MAX_MULTIVALUED_TO_EXAMINE"><!-- --></A><H3>
MAX_MULTIVALUED_TO_EXAMINE</H3>
<PRE>
static final <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <B>MAX_MULTIVALUED_TO_EXAMINE</B></PRE>
<DL>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../../../constant-values.html#org.apache.solr.common.params.HighlightParams.MAX_MULTIVALUED_TO_EXAMINE">Constant Field Values</A></DL>
</DL>
<HR>
<A NAME="MAX_MULTIVALUED_TO_MATCH"><!-- --></A><H3>
MAX_MULTIVALUED_TO_MATCH</H3>
<PRE>
static final <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <B>MAX_MULTIVALUED_TO_MATCH</B></PRE>
<DL>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../../../constant-values.html#org.apache.solr.common.params.HighlightParams.MAX_MULTIVALUED_TO_MATCH">Constant Field Values</A></DL>
</DL>
<HR>
<A NAME="USE_PHRASE_HIGHLIGHTER"><!-- --></A><H3>
USE_PHRASE_HIGHLIGHTER</H3>
<PRE>
static final <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <B>USE_PHRASE_HIGHLIGHTER</B></PRE>
<DL>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../../../constant-values.html#org.apache.solr.common.params.HighlightParams.USE_PHRASE_HIGHLIGHTER">Constant Field Values</A></DL>
</DL>
<HR>
<A NAME="HIGHLIGHT_MULTI_TERM"><!-- --></A><H3>
HIGHLIGHT_MULTI_TERM</H3>
<PRE>
static final <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <B>HIGHLIGHT_MULTI_TERM</B></PRE>
<DL>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../../../constant-values.html#org.apache.solr.common.params.HighlightParams.HIGHLIGHT_MULTI_TERM">Constant Field Values</A></DL>
</DL>
<HR>
<A NAME="MERGE_CONTIGUOUS_FRAGMENTS"><!-- --></A><H3>
MERGE_CONTIGUOUS_FRAGMENTS</H3>
<PRE>
static final <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <B>MERGE_CONTIGUOUS_FRAGMENTS</B></PRE>
<DL>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../../../constant-values.html#org.apache.solr.common.params.HighlightParams.MERGE_CONTIGUOUS_FRAGMENTS">Constant Field Values</A></DL>
</DL>
<HR>
<A NAME="USE_FVH"><!-- --></A><H3>
USE_FVH</H3>
<PRE>
static final <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <B>USE_FVH</B></PRE>
<DL>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../../../constant-values.html#org.apache.solr.common.params.HighlightParams.USE_FVH">Constant Field Values</A></DL>
</DL>
<HR>
<A NAME="TAG_PRE"><!-- --></A><H3>
TAG_PRE</H3>
<PRE>
static final <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <B>TAG_PRE</B></PRE>
<DL>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../../../constant-values.html#org.apache.solr.common.params.HighlightParams.TAG_PRE">Constant Field Values</A></DL>
</DL>
<HR>
<A NAME="TAG_POST"><!-- --></A><H3>
TAG_POST</H3>
<PRE>
static final <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <B>TAG_POST</B></PRE>
<DL>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../../../constant-values.html#org.apache.solr.common.params.HighlightParams.TAG_POST">Constant Field Values</A></DL>
</DL>
<HR>
<A NAME="TAG_ELLIPSIS"><!-- --></A><H3>
TAG_ELLIPSIS</H3>
<PRE>
static final <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <B>TAG_ELLIPSIS</B></PRE>
<DL>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../../../constant-values.html#org.apache.solr.common.params.HighlightParams.TAG_ELLIPSIS">Constant Field Values</A></DL>
</DL>
<HR>
<A NAME="PHRASE_LIMIT"><!-- --></A><H3>
PHRASE_LIMIT</H3>
<PRE>
static final <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <B>PHRASE_LIMIT</B></PRE>
<DL>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../../../constant-values.html#org.apache.solr.common.params.HighlightParams.PHRASE_LIMIT">Constant Field Values</A></DL>
</DL>
<HR>
<A NAME="MULTI_VALUED_SEPARATOR"><!-- --></A><H3>
MULTI_VALUED_SEPARATOR</H3>
<PRE>
static final <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <B>MULTI_VALUED_SEPARATOR</B></PRE>
<DL>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../../../constant-values.html#org.apache.solr.common.params.HighlightParams.MULTI_VALUED_SEPARATOR">Constant Field Values</A></DL>
</DL>
<HR>
<A NAME="SIMPLE"><!-- --></A><H3>
SIMPLE</H3>
<PRE>
static final <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <B>SIMPLE</B></PRE>
<DL>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../../../constant-values.html#org.apache.solr.common.params.HighlightParams.SIMPLE">Constant Field Values</A></DL>
</DL>
<HR>
<A NAME="SIMPLE_PRE"><!-- --></A><H3>
SIMPLE_PRE</H3>
<PRE>
static final <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <B>SIMPLE_PRE</B></PRE>
<DL>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../../../constant-values.html#org.apache.solr.common.params.HighlightParams.SIMPLE_PRE">Constant Field Values</A></DL>
</DL>
<HR>
<A NAME="SIMPLE_POST"><!-- --></A><H3>
SIMPLE_POST</H3>
<PRE>
static final <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <B>SIMPLE_POST</B></PRE>
<DL>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../../../constant-values.html#org.apache.solr.common.params.HighlightParams.SIMPLE_POST">Constant Field Values</A></DL>
</DL>
<HR>
<A NAME="REGEX"><!-- --></A><H3>
REGEX</H3>
<PRE>
static final <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <B>REGEX</B></PRE>
<DL>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../../../constant-values.html#org.apache.solr.common.params.HighlightParams.REGEX">Constant Field Values</A></DL>
</DL>
<HR>
<A NAME="SLOP"><!-- --></A><H3>
SLOP</H3>
<PRE>
static final <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <B>SLOP</B></PRE>
<DL>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../../../constant-values.html#org.apache.solr.common.params.HighlightParams.SLOP">Constant Field Values</A></DL>
</DL>
<HR>
<A NAME="PATTERN"><!-- --></A><H3>
PATTERN</H3>
<PRE>
static final <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <B>PATTERN</B></PRE>
<DL>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../../../constant-values.html#org.apache.solr.common.params.HighlightParams.PATTERN">Constant Field Values</A></DL>
</DL>
<HR>
<A NAME="MAX_RE_CHARS"><!-- --></A><H3>
MAX_RE_CHARS</H3>
<PRE>
static final <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <B>MAX_RE_CHARS</B></PRE>
<DL>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../../../constant-values.html#org.apache.solr.common.params.HighlightParams.MAX_RE_CHARS">Constant Field Values</A></DL>
</DL>
<HR>
<A NAME="SCORE"><!-- --></A><H3>
SCORE</H3>
<PRE>
static final <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <B>SCORE</B></PRE>
<DL>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../../../constant-values.html#org.apache.solr.common.params.HighlightParams.SCORE">Constant Field Values</A></DL>
</DL>
<HR>
<A NAME="SCORE_K1"><!-- --></A><H3>
SCORE_K1</H3>
<PRE>
static final <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <B>SCORE_K1</B></PRE>
<DL>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../../../constant-values.html#org.apache.solr.common.params.HighlightParams.SCORE_K1">Constant Field Values</A></DL>
</DL>
<HR>
<A NAME="SCORE_B"><!-- --></A><H3>
SCORE_B</H3>
<PRE>
static final <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <B>SCORE_B</B></PRE>
<DL>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../../../constant-values.html#org.apache.solr.common.params.HighlightParams.SCORE_B">Constant Field Values</A></DL>
</DL>
<HR>
<A NAME="SCORE_PIVOT"><!-- --></A><H3>
SCORE_PIVOT</H3>
<PRE>
static final <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <B>SCORE_PIVOT</B></PRE>
<DL>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../../../constant-values.html#org.apache.solr.common.params.HighlightParams.SCORE_PIVOT">Constant Field Values</A></DL>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/HighlightParams.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../org/apache/solr/common/params/GroupParams.html" title="interface in org.apache.solr.common.params"><B>PREV CLASS</B></A>
<A HREF="../../../../../org/apache/solr/common/params/MapSolrParams.html" title="class in org.apache.solr.common.params"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../index.html?org/apache/solr/common/params/HighlightParams.html" target="_top"><B>FRAMES</B></A>
<A HREF="HighlightParams.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | CONSTR | METHOD</FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: <A HREF="#field_detail">FIELD</A> | CONSTR | METHOD</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
<i>Copyright © 2000-2013 Apache Software Foundation. All Rights Reserved.</i>
<script src='../../../../../prettify.js' type='text/javascript'></script>
<script type='text/javascript'>
(function(){
var oldonload = window.onload;
if (typeof oldonload != 'function') {
window.onload = prettyPrint;
} else {
window.onload = function() {
oldonload();
prettyPrint();
}
}
})();
</script>
</BODY>
</HTML>
|
rcr-81/SolrCamper
|
docs/solr-solrj/org/apache/solr/common/params/HighlightParams.html
|
HTML
|
apache-2.0
| 51,708
|
<!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_13b.html">Class Test_AbaRouteValidator_13b</a></li>
</ol></div>
<h1 class="aui-h2-clover">
Test testAbaNumberCheck_27970_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_13b.html?line=18544#src-18544" >testAbaNumberCheck_27970_bad</a>
</td>
<td>
<span class="sortValue">1</span><span class="aui-lozenge aui-lozenge-success">PASS</span>
</td>
<td>
7 Aug 12:43:13
</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_27970_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=23526#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=23526#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=23526#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_13b_testAbaNumberCheck_27970_bad_i5i.html
|
HTML
|
apache-2.0
| 10,990
|
<?php
/**
* Forgot password form
*/
class ForgotPasswordForm extends FormModel {
/**
* Could be username or email
* @var type
*/
public $username;
/**
* Success message if validation is passed
* @var type
*/
public $success_message;
/**
* User model
* @var Users
*/
public $user_model;
/**
* The context module of this class
* @var type
*/
public $context_module = null;
public function rules()
{
return array(
array('username', 'required', 'message' => 'Username or Email is required.'),
array('username', 'authenticate'),
);
}
public function attributeLabels()
{
return array(
'username' => 'Username or Email',
);
}
public function beforeValidate()
{
$this->getUserModel();
return parent::beforeValidate();
}
public function afterValidate()
{
if (!$this->hasErrors()) {
$this->sendEmail();
$this->success_message = Lang::t('Check this email ({email}) for instructions on how to get a new password.If you don\'t get email please check your spam and mark it as "not spam"', array('{email}' => $this->user_model->email));
}
return parent::afterValidate();
}
public function authenticate()
{
if (!$this->hasErrors() && $this->user_model === NULL)
$this->addError('username', 'No account associated with the Username/Email.');
}
public function getUserModel()
{
$this->user_model = Users::model()->find('`username`=:t1 OR `email`=:t1', array(':t1' => $this->username));
}
public function sendEmail()
{
$this->user_model->password_reset_code = Common::generateSalt();
$this->user_model->password_reset_request_date = date('Y-m-d H:i:s');
$this->user_model->save(false);
$template = SettingsEmailTemplate::model()->getRow('*', '`key`=:t1', array(':t1' => SettingsEmailTemplate::KEY_FORGOT_PASSWORD));
if (empty($template))
return FALSE;
//placeholders : {name},{link}
$body = Common::myStringReplace($template['body'], array(
'{name}' => Person::model()->get($this->user_model->id, 'CONCAT(first_name," ",last_name)'),
'{link}' => Yii::app()->createAbsoluteUrl('auth/default/resetPassword', array('id' => $this->user_model->id, 'token' => $this->user_model->password_reset_code)),
));
//$from, $this->user_model->email, $template->title, $template->body, true
MsgEmailOutbox::model()->push(array(
'from_name' => Yii::app()->settings->get(Constants::CATEGORY_GENERAL, Constants::KEY_SITE_NAME, Yii::app()->name),
'from_email' => $template['from'],
'to_email' => $this->user_model->email,
'subject' => $template['subject'],
'message' => $body,
));
}
}
|
jacjimus/furahia_mis
|
app/modules/auth/forms/ForgotPasswordForm.php
|
PHP
|
apache-2.0
| 3,469
|
/*
* Copyright 2011 Nate Koenig & Andrew Howard
*
* 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.
*
*/
/* Desc: Camera Visualization Class
* Author: Nate Koenig
*/
#ifndef CONTACTVISUAL_HH
#define CONTACTVISUAL_HH
#include <string>
#include <vector>
#include "rendering/Visual.hh"
namespace Ogre
{
class Entity;
class SceneNode;
}
namespace gazebo
{
namespace rendering
{
class DynamicLines;
class ContactVisual : public Visual
{
public: ContactVisual(const std::string &_name, VisualPtr _vis,
const std::string &_topicName);
public: virtual ~ContactVisual();
private: void Update();
private: void OnContact(
ConstContactsPtr &_msg);
private: void SetupInstancedMaterialToEntity(Ogre::Entity *_ent);
private: transport::NodePtr node;
private: transport::SubscriberPtr contactsSub;
private: boost::shared_ptr<msgs::Contacts const> contactsMsg;
private: std::vector<event::ConnectionPtr> connections;
private: class ContactPoint
{
public: Ogre::SceneNode *sceneNode;
public: DynamicLines *normal, *depth;
};
private: std::vector<ContactVisual::ContactPoint*> points;
};
}
}
#endif
|
nherment/gazebo
|
src/rendering/ContactVisual.hh
|
C++
|
apache-2.0
| 1,807
|
//
// AnnotationXMLParser.h
// Annotation
//
// Created by Adam Fouse on 6/22/09.
// Copyright 2009 __MyCompanyName__. All rights reserved.
//
#import <Cocoa/Cocoa.h>
@class Annotation;
@class AnnotationDocument;
@interface AnnotationXMLParser : NSObject {
NSXMLDocument *xmlDoc;
NSXMLNode *annotationsRoot;
AnnotationDocument *annotationDoc;
NSOperationQueue *xmlOperationsQueue;
NSDateFormatter *dateFormatter;
NSDateFormatter *altDateFormatter;
NSMutableArray *annotations;
BOOL updateAnnotations;
}
@property BOOL updateAnnotations;
- (id)init;
-(id)initForDocument:(AnnotationDocument*)doc;
- (id)initWithFile:(NSString *)file forDocument:(AnnotationDocument*)doc;
- (void)addAnnotation:(Annotation *)annotation;
- (void)removeAnnotation:(Annotation *)annotation;
- (void)updateAnnotation:(Annotation *)annotation;
- (NSArray*)annotations;
- (NSXMLElement*)createAnnotationElement:(Annotation *)annotation;
- (void)setup;
- (NSDateFormatter*)dateFormatter;
- (void)writeToFile:(NSString *)fileName;
- (void)writeToFile:(NSString *)filename waitUntilDone:(BOOL)wait;
@end
|
afouse/chronoviz
|
Classes/Core/AnnotationXMLParser.h
|
C
|
apache-2.0
| 1,114
|
package site.iway.helpers;
import android.app.Activity;
import android.graphics.drawable.ColorDrawable;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.View.OnKeyListener;
import android.view.ViewGroup;
import android.view.animation.AlphaAnimation;
import android.view.animation.Animation;
import android.widget.ImageView;
import android.widget.ImageView.ScaleType;
import android.widget.RelativeLayout;
import android.widget.RelativeLayout.LayoutParams;
@Deprecated
public abstract class MenuAnimated {
public interface OnBackPressedListener {
public void onBackPressed(MenuAnimated menu);
}
public interface OnMenuBgClickListener {
public void onMenuBgClick(MenuAnimated menu);
}
public interface OnMenuHiddenListener {
public void onMenuHidden(MenuAnimated menu, boolean animated);
}
public interface OnMenuShownListener {
public void onMenuShown(MenuAnimated menu, boolean animated);
}
private Activity mActivity;
private RelativeLayout mRootView;
private ImageView mBackgroundView;
private View mContentView;
private boolean mIsShown = false;
private int mAnimationTimeout = 300;
private boolean mWillHideOnBgClicked = true;
private boolean mWillHideOnBackPressed = true;
private OnMenuBgClickListener mOnMenuBgClickListener;
private OnBackPressedListener mOnBackPressedListener;
private OnMenuShownListener mOnMenuShownListener;
private OnMenuHiddenListener mOnMenuHiddenListener;
public MenuAnimated(Activity parent, int backgroundColor) {
mActivity = parent;
mRootView = new RelativeLayout(parent);
mBackgroundView = new ImageView(parent);
mBackgroundView.setScaleType(ScaleType.CENTER_CROP);
mBackgroundView.setImageDrawable(new ColorDrawable(backgroundColor));
mBackgroundView.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
if (mOnMenuBgClickListener != null) {
mOnMenuBgClickListener.onMenuBgClick(MenuAnimated.this);
}
if (mWillHideOnBgClicked) {
hide();
}
}
});
int width = LayoutParams.MATCH_PARENT;
int height = LayoutParams.MATCH_PARENT;
LayoutParams layoutParams = new LayoutParams(width, height);
mRootView.addView(mBackgroundView, layoutParams);
mRootView.setVisibility(View.GONE);
mRootView.setOnKeyListener(new OnKeyListener() {
private boolean mHasKeyDowned;
@Override
public boolean onKey(View v, int keyCode, KeyEvent event) {
if (mIsShown && keyCode == KeyEvent.KEYCODE_BACK) {
switch (event.getAction()) {
case KeyEvent.ACTION_DOWN:
mHasKeyDowned = true;
return true;
case KeyEvent.ACTION_UP:
if (mHasKeyDowned) {
if (mOnBackPressedListener != null) {
mOnBackPressedListener.onBackPressed(MenuAnimated.this);
}
if (mWillHideOnBackPressed) {
hide();
}
mHasKeyDowned = false;
}
return true;
default:
return true;
}
}
return false;
}
});
mRootView.setFocusable(true);
mRootView.setFocusableInTouchMode(true);
mActivity.addContentView(mRootView, layoutParams);
}
public Activity getActivity() {
return mActivity;
}
public int getAnimationTimeout() {
return mAnimationTimeout;
}
public void setAnimationTimeout(int timeout) {
if (timeout < 0) {
throw new IllegalArgumentException("timeout must >= 0");
}
mAnimationTimeout = timeout;
}
public boolean getWillHideOnBgClicked() {
return mWillHideOnBgClicked;
}
public void setWillHideOnBgClicked(boolean value) {
mWillHideOnBgClicked = value;
}
public boolean getWillHideOnBackPressed() {
return mWillHideOnBackPressed;
}
public void setWillHideOnBackPressed(boolean value) {
mWillHideOnBackPressed = value;
mRootView.setFocusable(value);
mRootView.setFocusableInTouchMode(value);
}
public OnMenuBgClickListener getOnMenuBgClickListener() {
return mOnMenuBgClickListener;
}
public void setOnMenuBgClickListener(OnMenuBgClickListener listener) {
mOnMenuBgClickListener = listener;
}
public OnBackPressedListener getOnBackPressedListener() {
return mOnBackPressedListener;
}
public void setOnBackPressedListener(OnBackPressedListener listener) {
mOnBackPressedListener = listener;
}
public OnMenuShownListener getOnMenuShownListener() {
return mOnMenuShownListener;
}
public void setOnMenuShownListener(OnMenuShownListener listener) {
mOnMenuShownListener = listener;
}
public OnMenuHiddenListener getOnMenuHiddenListener() {
return mOnMenuHiddenListener;
}
public void setOnMenuHiddenListener(OnMenuHiddenListener listener) {
mOnMenuHiddenListener = listener;
}
public View getContentView() {
return mContentView;
}
public View findViewById(int id) {
return mContentView == null ? null : mContentView.findViewById(id);
}
public void setLayoutParams(LayoutParams layoutParams) {
if (mContentView != null) {
mContentView.setLayoutParams(layoutParams);
}
}
protected abstract void processContentViewLayoutParams(LayoutParams layoutParams);
private void setOnClickListenerToAll(ViewGroup viewGroup, OnClickListener listener) {
for (int i = 0; i < viewGroup.getChildCount(); i++) {
View child = viewGroup.getChildAt(i);
if (child instanceof ViewGroup)
setOnClickListenerToAll((ViewGroup) child, listener);
else
child.setOnClickListener(listener);
}
}
public void setContentView(View view, OnClickListener listener) {
if (mContentView != null) {
mRootView.removeView(mContentView);
}
mContentView = view;
if (listener != null) {
if (mContentView instanceof ViewGroup)
setOnClickListenerToAll((ViewGroup) mContentView, listener);
else
mContentView.setOnClickListener(listener);
}
LayoutParams params = (LayoutParams) mContentView.getLayoutParams();
processContentViewLayoutParams(params);
mRootView.addView(mContentView);
}
public void setContentView(int layoutId, OnClickListener listener) {
LayoutInflater inflater = mActivity.getLayoutInflater();
View contentView = inflater.inflate(layoutId, mRootView, false);
setContentView(contentView, listener);
}
public boolean isShown() {
return mIsShown;
}
protected abstract void playShowAnimation(View contentView);
public void show() {
if (mIsShown) {
return;
}
mIsShown = true;
mRootView.setVisibility(View.VISIBLE);
if (mWillHideOnBackPressed) {
mRootView.requestFocus();
}
AlphaAnimation animation = new AlphaAnimation(0, 1);
animation.setDuration(mAnimationTimeout);
animation.setAnimationListener(new Animation.AnimationListener() {
@Override
public void onAnimationStart(Animation animation) {
// nothing
}
@Override
public void onAnimationEnd(Animation animation) {
if (mOnMenuShownListener != null) {
mOnMenuShownListener.onMenuShown(MenuAnimated.this, true);
}
}
@Override
public void onAnimationRepeat(Animation animation) {
// nothing
}
});
mBackgroundView.startAnimation(animation);
playShowAnimation(mContentView);
}
public void showImediately() {
if (mIsShown) {
return;
}
mIsShown = true;
mRootView.setVisibility(View.VISIBLE);
if (mWillHideOnBackPressed) {
mRootView.requestFocus();
}
if (mOnMenuShownListener != null) {
mOnMenuShownListener.onMenuShown(this, false);
}
}
public boolean isHidden() {
return !mIsShown;
}
protected abstract void playHideAnimation(View contentView);
public void hide() {
if (!mIsShown) {
return;
}
mIsShown = false;
AlphaAnimation animation = new AlphaAnimation(1, 0);
animation.setDuration(mAnimationTimeout);
animation.setAnimationListener(new Animation.AnimationListener() {
@Override
public void onAnimationStart(Animation animation) {
// nothing
}
@Override
public void onAnimationEnd(Animation animation) {
mRootView.setVisibility(View.GONE);
if (mOnMenuHiddenListener != null) {
mOnMenuHiddenListener.onMenuHidden(MenuAnimated.this, true);
}
}
@Override
public void onAnimationRepeat(Animation animation) {
// nothing
}
});
mBackgroundView.startAnimation(animation);
playHideAnimation(mContentView);
}
public void hideImediately() {
if (!mIsShown) {
return;
}
mIsShown = false;
mRootView.setVisibility(View.GONE);
if (mOnMenuHiddenListener != null) {
mOnMenuHiddenListener.onMenuHidden(this, false);
}
}
}
|
iWay7/Helpers
|
helpers/src/main/java/site/iway/helpers/MenuAnimated.java
|
Java
|
apache-2.0
| 10,342
|
/*
* 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.accessanalyzer.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
* <p>
* A location in a policy that is represented as a path through the JSON representation and a corresponding span.
* </p>
*
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/accessanalyzer-2019-11-01/Location" target="_top">AWS API
* Documentation</a>
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class Location implements Serializable, Cloneable, StructuredPojo {
/**
* <p>
* A path in a policy, represented as a sequence of path elements.
* </p>
*/
private java.util.List<PathElement> path;
/**
* <p>
* A span in a policy.
* </p>
*/
private Span span;
/**
* <p>
* A path in a policy, represented as a sequence of path elements.
* </p>
*
* @return A path in a policy, represented as a sequence of path elements.
*/
public java.util.List<PathElement> getPath() {
return path;
}
/**
* <p>
* A path in a policy, represented as a sequence of path elements.
* </p>
*
* @param path
* A path in a policy, represented as a sequence of path elements.
*/
public void setPath(java.util.Collection<PathElement> path) {
if (path == null) {
this.path = null;
return;
}
this.path = new java.util.ArrayList<PathElement>(path);
}
/**
* <p>
* A path in a policy, represented as a sequence of path elements.
* </p>
* <p>
* <b>NOTE:</b> This method appends the values to the existing list (if any). Use
* {@link #setPath(java.util.Collection)} or {@link #withPath(java.util.Collection)} if you want to override the
* existing values.
* </p>
*
* @param path
* A path in a policy, represented as a sequence of path elements.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Location withPath(PathElement... path) {
if (this.path == null) {
setPath(new java.util.ArrayList<PathElement>(path.length));
}
for (PathElement ele : path) {
this.path.add(ele);
}
return this;
}
/**
* <p>
* A path in a policy, represented as a sequence of path elements.
* </p>
*
* @param path
* A path in a policy, represented as a sequence of path elements.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Location withPath(java.util.Collection<PathElement> path) {
setPath(path);
return this;
}
/**
* <p>
* A span in a policy.
* </p>
*
* @param span
* A span in a policy.
*/
public void setSpan(Span span) {
this.span = span;
}
/**
* <p>
* A span in a policy.
* </p>
*
* @return A span in a policy.
*/
public Span getSpan() {
return this.span;
}
/**
* <p>
* A span in a policy.
* </p>
*
* @param span
* A span in a policy.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Location withSpan(Span span) {
setSpan(span);
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 (getPath() != null)
sb.append("Path: ").append(getPath()).append(",");
if (getSpan() != null)
sb.append("Span: ").append(getSpan());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof Location == false)
return false;
Location other = (Location) obj;
if (other.getPath() == null ^ this.getPath() == null)
return false;
if (other.getPath() != null && other.getPath().equals(this.getPath()) == false)
return false;
if (other.getSpan() == null ^ this.getSpan() == null)
return false;
if (other.getSpan() != null && other.getSpan().equals(this.getSpan()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getPath() == null) ? 0 : getPath().hashCode());
hashCode = prime * hashCode + ((getSpan() == null) ? 0 : getSpan().hashCode());
return hashCode;
}
@Override
public Location clone() {
try {
return (Location) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
@com.amazonaws.annotation.SdkInternalApi
@Override
public void marshall(ProtocolMarshaller protocolMarshaller) {
com.amazonaws.services.accessanalyzer.model.transform.LocationMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}
|
aws/aws-sdk-java
|
aws-java-sdk-accessanalyzer/src/main/java/com/amazonaws/services/accessanalyzer/model/Location.java
|
Java
|
apache-2.0
| 6,370
|
var http = require('http');
if (null == process.env.WORKER_ID)
throw new Error("env.WORKER_ID not set!");
var s = http.createServer(function(req, res) {
var params = req.url.split('/').slice(1);
setTimeout(function() {
res.writeHead(200);
res.end("hello world\n");
}, params[0] || 1);
});
s.listen(8000);
setTimeout(function() {
// Don't exit - to test termination timeout.
setTimeout(function() {
console.log('Finally cleaned up');
}, 5000);
require('cluster').worker.disconnect();
}, 500);
|
badave/doublevision
|
node_modules/recluster/test/lib/server-disconnect-halfsec.js
|
JavaScript
|
apache-2.0
| 555
|
<?php
final class CelerityManagementMapWorkflow
extends CelerityManagementWorkflow {
public function didConstruct() {
$this
->setName('map')
->setExamples('**map** [options]')
->setSynopsis(pht('Rebuild static resource maps.'))
->setArguments(
array());
}
public function execute(PhutilArgumentParser $args) {
$resources_map = CelerityPhysicalResources::getAll();
$this->log(
pht(
'Rebuilding %d resource source(s).',
new PhutilNumber(count($resources_map))));
foreach ($resources_map as $name => $resources) {
$this->rebuildResources($resources);
}
$this->log(pht('Done.'));
return 0;
}
/**
* Rebuild the resource map for a resource source.
*
* @param CelerityPhysicalResources Resource source to rebuild.
* @return void
*/
private function rebuildResources(CelerityPhysicalResources $resources) {
$this->log(
pht(
'Rebuilding resource source "%s" (%s)...',
$resources->getName(),
get_class($resources)));
$binary_map = $this->rebuildBinaryResources($resources);
$this->log(
pht(
'Found %d binary resources.',
new PhutilNumber(count($binary_map))));
$xformer = id(new CelerityResourceTransformer())
->setMinify(false)
->setRawURIMap(ipull($binary_map, 'uri'));
$text_map = $this->rebuildTextResources($resources, $xformer);
$this->log(
pht(
'Found %d text resources.',
new PhutilNumber(count($text_map))));
$resource_graph = array();
$requires_map = array();
$symbol_map = array();
foreach ($text_map as $name => $info) {
if (isset($info['provides'])) {
$symbol_map[$info['provides']] = $info['hash'];
// We only need to check for cycles and add this to the requires map
// if it actually requires anything.
if (!empty($info['requires'])) {
$resource_graph[$info['provides']] = $info['requires'];
$requires_map[$info['hash']] = $info['requires'];
}
}
}
$this->detectGraphCycles($resource_graph);
$name_map = ipull($binary_map, 'hash') + ipull($text_map, 'hash');
$hash_map = array_flip($name_map);
$package_map = $this->rebuildPackages(
$resources,
$symbol_map,
$hash_map);
$this->log(
pht(
'Found %d packages.',
new PhutilNumber(count($package_map))));
$component_map = array();
foreach ($package_map as $package_name => $package_info) {
foreach ($package_info['symbols'] as $symbol) {
$component_map[$symbol] = $package_name;
}
}
$name_map = $this->mergeNameMaps(
array(
array(pht('Binary'), ipull($binary_map, 'hash')),
array(pht('Text'), ipull($text_map, 'hash')),
array(pht('Package'), ipull($package_map, 'hash')),
));
$package_map = ipull($package_map, 'symbols');
ksort($name_map);
ksort($symbol_map);
ksort($requires_map);
ksort($package_map);
$map_content = $this->formatMapContent(array(
'names' => $name_map,
'symbols' => $symbol_map,
'requires' => $requires_map,
'packages' => $package_map,
));
$map_path = $resources->getPathToMap();
$this->log(pht('Writing map "%s".', Filesystem::readablePath($map_path)));
Filesystem::writeFile($map_path, $map_content);
}
/**
* Find binary resources (like PNG and SWF) and return information about
* them.
*
* @param CelerityPhysicalResources Resource map to find binary resources for.
* @return map<string, map<string, string>> Resource information map.
*/
private function rebuildBinaryResources(
CelerityPhysicalResources $resources) {
$binary_map = $resources->findBinaryResources();
$result_map = array();
foreach ($binary_map as $name => $data_hash) {
$hash = $resources->getCelerityHash($data_hash.$name);
$result_map[$name] = array(
'hash' => $hash,
'uri' => $resources->getResourceURI($hash, $name),
);
}
return $result_map;
}
/**
* Find text resources (like JS and CSS) and return information about them.
*
* @param CelerityPhysicalResources Resource map to find text resources for.
* @param CelerityResourceTransformer Configured resource transformer.
* @return map<string, map<string, string>> Resource information map.
*/
private function rebuildTextResources(
CelerityPhysicalResources $resources,
CelerityResourceTransformer $xformer) {
$text_map = $resources->findTextResources();
$result_map = array();
foreach ($text_map as $name => $data_hash) {
$raw_data = $resources->getResourceData($name);
$xformed_data = $xformer->transformResource($name, $raw_data);
$data_hash = $resources->getCelerityHash($xformed_data);
$hash = $resources->getCelerityHash($data_hash.$name);
list($provides, $requires) = $this->getProvidesAndRequires(
$name,
$raw_data);
$result_map[$name] = array(
'hash' => $hash,
);
if ($provides !== null) {
$result_map[$name] += array(
'provides' => $provides,
'requires' => $requires,
);
}
}
return $result_map;
}
/**
* Parse the `@provides` and `@requires` symbols out of a text resource, like
* JS or CSS.
*
* @param string Resource name.
* @param string Resource data.
* @return pair<string|null, list<string>|null> The `@provides` symbol and the
* list of `@requires` symbols. If the resource is not part of the
* dependency graph, both are null.
*/
private function getProvidesAndRequires($name, $data) {
$parser = new PhutilDocblockParser();
$matches = array();
$ok = preg_match('@/[*][*].*?[*]/@s', $data, $matches);
if (!$ok) {
throw new Exception(
pht(
'Resource "%s" does not have a header doc comment. Encode '.
'dependency data in a header docblock.',
$name));
}
list($description, $metadata) = $parser->parse($matches[0]);
$provides = preg_split('/\s+/', trim(idx($metadata, 'provides')));
$requires = preg_split('/\s+/', trim(idx($metadata, 'requires')));
$provides = array_filter($provides);
$requires = array_filter($requires);
if (!$provides) {
// Tests and documentation-only JS is permitted to @provide no targets.
return array(null, null);
}
if (count($provides) > 1) {
throw new Exception(
pht(
'Resource "%s" must @provide at most one Celerity target.',
$name));
}
return array(head($provides), $requires);
}
/**
* Check for dependency cycles in the resource graph. Raises an exception if
* a cycle is detected.
*
* @param map<string, list<string>> Map of `@provides` symbols to their
* `@requires` symbols.
* @return void
*/
private function detectGraphCycles(array $nodes) {
$graph = id(new CelerityResourceGraph())
->addNodes($nodes)
->setResourceGraph($nodes)
->loadGraph();
foreach ($nodes as $provides => $requires) {
$cycle = $graph->detectCycles($provides);
if ($cycle) {
throw new Exception(
pht(
'Cycle detected in resource graph: %s',
implode(' > ', $cycle)));
}
}
}
/**
* Build package specifications for a given resource source.
*
* @param CelerityPhysicalResources Resource source to rebuild.
* @param list<string, string> Map of `@provides` to hashes.
* @param list<string, string> Map of hashes to resource names.
* @return map<string, map<string, string>> Package information maps.
*/
private function rebuildPackages(
CelerityPhysicalResources $resources,
array $symbol_map,
array $reverse_map) {
$package_map = array();
$package_spec = $resources->getResourcePackages();
foreach ($package_spec as $package_name => $package_symbols) {
$type = null;
$hashes = array();
foreach ($package_symbols as $symbol) {
$symbol_hash = idx($symbol_map, $symbol);
if ($symbol_hash === null) {
throw new Exception(
pht(
'Package specification for "%s" includes "%s", but that symbol '.
'is not @provided by any resource.',
$package_name,
$symbol));
}
$resource_name = $reverse_map[$symbol_hash];
$resource_type = $resources->getResourceType($resource_name);
if ($type === null) {
$type = $resource_type;
} else if ($type !== $resource_type) {
throw new Exception(
pht(
'Package specification for "%s" includes resources of multiple '.
'types (%s, %s). Each package may only contain one type of '.
'resource.',
$package_name,
$type,
$resource_type));
}
$hashes[] = $symbol.':'.$symbol_hash;
}
$hash = $resources->getCelerityHash(implode("\n", $hashes));
$package_map[$package_name] = array(
'hash' => $hash,
'symbols' => $package_symbols,
);
}
return $package_map;
}
private function mergeNameMaps(array $maps) {
$result = array();
$origin = array();
foreach ($maps as $map) {
list($map_name, $data) = $map;
foreach ($data as $name => $hash) {
if (empty($result[$name])) {
$result[$name] = $hash;
$origin[$name] = $map_name;
} else {
$old = $origin[$name];
$new = $map_name;
throw new Exception(
pht(
'Resource source defines two resources with the same name, '.
'"%s". One is defined in the "%s" map; the other in the "%s" '.
'map. Each resource must have a unique name.',
$name,
$old,
$new));
}
}
}
return $result;
}
private function log($message) {
$console = PhutilConsole::getConsole();
$console->writeErr("%s\n", $message);
}
private function formatMapContent(array $data) {
$content = phutil_var_export($data);
$generated = '@'.'generated';
return <<<EOFILE
<?php
/**
* This file is automatically generated. Use 'bin/celerity map' to rebuild it.
*
* {$generated}
*/
return {$content};
EOFILE;
}
}
|
akkakks/phabricator
|
src/infrastructure/celerity/management/CelerityManagementMapWorkflow.php
|
PHP
|
apache-2.0
| 10,510
|
---
title: "Runs dashboard"
sub_link: "runs-dashboard"
is_index: true
meta_title: "Polyaxon management tools and UI - Runs dashboard"
meta_description: "Polyaxon runs dashboard for Machine learning experiment tracking and visualizations."
tags:
- concepts
- polyaxon
- management
sidebar: "management"
---
## Overview
The runs dashboard is a powerful tool with visualization capabilities, collaboration features, and extendable interface.
The runs dashboard is a free tool, it can run offline and within any network policies, and can be used by both paying customers and users of the community edition.
## Features
* Native visualizations.
* Custom visualizations with Plotly, Bokeh, Vega.
* Powerful rendering engine with automatic handling for code files, html, audio, video, ...
* Lineage overview.
* Flexible comparison table for hyperparameters and metrics with built-in search, query, sort, limit to navigate millions of runs.
* Native integration with the tracking API.
* Automatic your process from training to deriving insights and results.
* Collaborative by design.
|
polyaxon/polyaxon
|
site/docs/management/runs-dashboard/index.md
|
Markdown
|
apache-2.0
| 1,097
|
/*
*
* * Copyright 2015 Skymind,Inc.
* *
* * Licensed under the Apache License, Version 2.0 (the "License");
* * you may not use this file except in compliance with the License.
* * You may obtain a copy of the License at
* *
* * http://www.apache.org/licenses/LICENSE-2.0
* *
* * Unless required by applicable law or agreed to in writing, software
* * distributed under the License is distributed on an "AS IS" BASIS,
* * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* * See the License for the specific language governing permissions and
* * limitations under the License.
*
*
*/
package org.nd4j.linalg.api.ops.impl.transforms;
import org.nd4j.linalg.api.complex.IComplexNumber;
import org.nd4j.linalg.api.ndarray.INDArray;
import org.nd4j.linalg.api.ops.BaseTransformOp;
import org.nd4j.linalg.api.ops.Op;
import org.nd4j.linalg.factory.Nd4j;
/**Leaky ReLU derivative. Default alpha = 0.01. Cutoff = 0
*/
public class LeakyReLUDerivative extends BaseTransformOp {
private double alpha = 0.01;
private boolean alphaSpecified = false;
public LeakyReLUDerivative() { }
public LeakyReLUDerivative(INDArray x, INDArray z) {
super(x, z);
}
public LeakyReLUDerivative(INDArray x, INDArray z, long n) {
super(x, z, n);
}
public LeakyReLUDerivative(INDArray x, INDArray y, INDArray z, long n) {
super(x, y, z, n);
}
public LeakyReLUDerivative(INDArray x) {
super(x);
}
public LeakyReLUDerivative(INDArray x, INDArray z, double alpha) {
super(x, z);
this.alpha = alpha;
alphaSpecified = true;
}
public LeakyReLUDerivative(INDArray x, INDArray z, long n, double alpha) {
super(x, z, n);
this.alpha = alpha;
alphaSpecified = true;
}
public LeakyReLUDerivative(INDArray x, INDArray y, INDArray z, long n, double alpha) {
super(x, y, z, n);
this.alpha = alpha;
alphaSpecified = true;
}
public LeakyReLUDerivative(INDArray x, double alpha) {
super(x);
this.alpha = alpha;
}
@Override
public int opNum() {
return 32;
}
@Override
public String name() {
return "leakyreluderivative";
}
@Override
public IComplexNumber op(IComplexNumber origin, double other) {
return (origin.realComponent().doubleValue() >= 0.0 ? Nd4j.createDouble(1, 0) : Nd4j.createDouble(alpha, 0));
}
@Override
public IComplexNumber op(IComplexNumber origin, float other) {
return (origin.realComponent().doubleValue() >= 0.0 ? Nd4j.createDouble(1, 0) : Nd4j.createDouble(alpha, 0));
}
@Override
public IComplexNumber op(IComplexNumber origin, IComplexNumber other) {
return (origin.realComponent().doubleValue() >= 0.0 ? Nd4j.createDouble(1, 0) : Nd4j.createDouble(alpha, 0));
}
@Override
public float op(float origin, float other) {
return (origin >= 0f ? 1.0f : (float) alpha);
}
@Override
public double op(double origin, double other) {
return (origin >= 0 ? 1.0 : alpha);
}
@Override
public double op(double origin) {
return (origin >= 0 ? 1.0 : alpha);
}
@Override
public float op(float origin) {
return (origin >= 0f ? 1.0f : (float)alpha);
}
@Override
public IComplexNumber op(IComplexNumber origin) {
return (origin.realComponent().doubleValue() >= 0 ? Nd4j.createDouble(1, 0) : Nd4j.createDouble(alpha, 0));
}
@Override
public Op opForDimension(int index, int dimension) {
INDArray xAlongDimension = x.vectorAlongDimension(index, dimension);
if (y() != null)
return new LeakyReLUDerivative(x.vectorAlongDimension(index, dimension), y.vectorAlongDimension(index, dimension), z.vectorAlongDimension(index, dimension), xAlongDimension.length(),alpha);
else
return new LeakyReLUDerivative(x.vectorAlongDimension(index, dimension), z.vectorAlongDimension(index, dimension), xAlongDimension.length(),alpha);
}
@Override
public Op opForDimension(int index, int... dimension) {
INDArray xAlongDimension = x.tensorAlongDimension(index, dimension);
if (y() != null)
return new LeakyReLUDerivative(x.tensorAlongDimension(index, dimension), y.tensorAlongDimension(index, dimension), z.tensorAlongDimension(index, dimension), xAlongDimension.length(),alpha);
else
return new LeakyReLUDerivative(x.tensorAlongDimension(index, dimension), z.tensorAlongDimension(index, dimension), xAlongDimension.length(),alpha);
}
@Override
public void init(INDArray x, INDArray y, INDArray z, long n) {
super.init(x, y, z, n);
if(!alphaSpecified)
alpha = 0.01;
this.extraArgs = new Object[] {alpha};
}
}
|
drlebedev/nd4j
|
nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/ops/impl/transforms/LeakyReLUDerivative.java
|
Java
|
apache-2.0
| 4,906
|
/*
Copyright 2012 Software Freedom Conservancy
Copyright 2007-2012 Selenium committers
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package org.openqa.selenium;
import org.junit.After;
import org.junit.Test;
import org.openqa.selenium.testing.Ignore;
import org.openqa.selenium.testing.JUnit4TestBase;
import org.openqa.selenium.testing.JavascriptEnabled;
import java.io.PrintWriter;
import java.io.StringWriter;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.equalTo;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import static org.openqa.selenium.TestWaiter.waitFor;
import static org.openqa.selenium.WaitingConditions.elementToExist;
import static org.openqa.selenium.WaitingConditions.pageTitleToBe;
import static org.openqa.selenium.testing.Ignore.Driver.ANDROID;
import static org.openqa.selenium.testing.Ignore.Driver.CHROME;
import static org.openqa.selenium.testing.Ignore.Driver.IPHONE;
import static org.openqa.selenium.testing.Ignore.Driver.OPERA;
import static org.openqa.selenium.testing.Ignore.Driver.OPERA_MOBILE;
import static org.openqa.selenium.testing.Ignore.Driver.SELENESE;
public class FrameSwitchingTest extends JUnit4TestBase {
private static final int TIMEOUT = 4000;
@After
public void tearDown() throws Exception {
try {
driver.switchTo().defaultContent();
} catch (Exception e) {
// May happen if the driver went away.
}
}
// ----------------------------------------------------------------------------------------------
//
// Tests that WebDriver doesn't do anything fishy when it navigates to a page with frames.
//
// ----------------------------------------------------------------------------------------------
@Test
public void testShouldAlwaysFocusOnTheTopMostFrameAfterANavigationEvent() {
driver.get(pages.framesetPage);
driver.findElement(By.tagName("frameset")); // Test passes if this does not throw.
}
@Test
public void testShouldNotAutomaticallySwitchFocusToAnIFrameWhenAPageContainingThemIsLoaded() {
driver.get(pages.iframePage);
driver.findElement(By.id("iframe_page_heading"));
}
// ----------------------------------------------------------------------------------------------
//
// Tests that WebDriver can switch to frames as expected.
//
// ----------------------------------------------------------------------------------------------
@Test
public void testShouldBeAbleToSwitchToAFrameByItsIndex() {
driver.get(pages.framesetPage);
driver.switchTo().frame(1);
assertThat(driver.findElement(By.id("pageNumber")).getText(), equalTo("2"));
}
@Test
public void testShouldBeAbleToSwitchToAnIframeByItsIndex() {
driver.get(pages.iframePage);
driver.switchTo().frame(0);
assertThat(driver.findElement(By.name("id-name1")).getAttribute("value"), equalTo("name"));
}
@Test
public void testShouldBeAbleToSwitchToAFrameByItsName() {
driver.get(pages.framesetPage);
driver.switchTo().frame("fourth");
assertThat(driver.findElement(By.tagName("frame")).getAttribute("name"), equalTo("child1"));
}
@Test
public void testShouldBeAbleToSwitchToAnIframeByItsName() {
driver.get(pages.iframePage);
driver.switchTo().frame("iframe1-name");
assertThat(driver.findElement(By.name("id-name1")).getAttribute("value"), equalTo("name"));
}
@Test
public void testShouldBeAbleToSwitchToAFrameByItsID() {
driver.get(pages.framesetPage);
driver.switchTo().frame("fifth");
assertThat(driver.findElement(By.name("windowOne")).getText(), equalTo("Open new window"));
}
@Test
public void testShouldBeAbleToSwitchToAnIframeByItsID() {
driver.get(pages.iframePage);
driver.switchTo().frame("iframe1");
assertThat(driver.findElement(By.name("id-name1")).getAttribute("value"), equalTo("name"));
}
@Test
@Ignore({OPERA, OPERA_MOBILE})
public void testShouldBeAbleToSwitchToFrameWithNameContainingDot() {
driver.get(pages.framesetPage);
driver.switchTo().frame("sixth.iframe1");
assertThat(driver.findElement(By.tagName("body")).getText(), containsString("Page number 3"));
}
@Ignore(value = {SELENESE}, reason = "switchTo().frame(WebElement) not supported with Selenium")
@Test
public void testShouldBeAbleToSwitchToAFrameUsingAPreviouslyLocatedWebElement() {
driver.get(pages.framesetPage);
WebElement frame = driver.findElement(By.tagName("frame"));
driver.switchTo().frame(frame);
assertThat(driver.findElement(By.id("pageNumber")).getText(), equalTo("1"));
}
@Test
public void testShouldBeAbleToSwitchToAnIFrameUsingAPreviouslyLocatedWebElement() {
driver.get(pages.iframePage);
WebElement frame = driver.findElement(By.tagName("iframe"));
driver.switchTo().frame(frame);
WebElement element = driver.findElement(By.name("id-name1"));
assertThat(element.getAttribute("value"), equalTo("name"));
}
@Ignore(value = {SELENESE}, reason = "switchTo().frame(WebElement) not supported with Selenium")
@Test
public void testShouldEnsureElementIsAFrameBeforeSwitching() {
driver.get(pages.framesetPage);
WebElement frame = driver.findElement(By.tagName("frameset"));
try {
driver.switchTo().frame(frame);
fail();
} catch (NoSuchFrameException expected) {
// Do nothing.
}
}
@Ignore(ANDROID)
@Test
public void testFrameSearchesShouldBeRelativeToTheCurrentlySelectedFrame() {
driver.get(pages.framesetPage);
driver.switchTo().frame("second");
assertThat(driver.findElement(By.id("pageNumber")).getText(), equalTo("2"));
try {
driver.switchTo().frame("third");
fail();
} catch (NoSuchFrameException expected) {
// Do nothing
}
driver.switchTo().defaultContent();
driver.switchTo().frame("third");
try {
driver.switchTo().frame("second");
fail();
} catch (NoSuchFrameException expected) {
// Do nothing
}
driver.switchTo().defaultContent();
driver.switchTo().frame("second");
assertThat(driver.findElement(By.id("pageNumber")).getText(), equalTo("2"));
}
@Ignore({ANDROID, OPERA, OPERA_MOBILE})
@Test
public void testShouldSelectChildFramesByChainedCalls() {
driver.get(pages.framesetPage);
driver.switchTo().frame("fourth").switchTo().frame("child2");
assertThat(driver.findElement(By.id("pageNumber")).getText(), equalTo("11"));
}
@Ignore(ANDROID)
@Test
public void testShouldThrowFrameNotFoundExceptionLookingUpSubFramesWithSuperFrameNames() {
driver.get(pages.framesetPage);
driver.switchTo().frame("fourth");
try {
driver.switchTo().frame("second");
fail("Expected NoSuchFrameException");
} catch (NoSuchFrameException e) {
// Expected
}
}
@Test
public void testShouldThrowAnExceptionWhenAFrameCannotBeFound() {
driver.get(pages.xhtmlTestPage);
try {
driver.switchTo().frame("Nothing here");
fail("Should not have been able to switch");
} catch (NoSuchFrameException e) {
// This is expected
}
}
@Test
public void testShouldThrowAnExceptionWhenAFrameCannotBeFoundByIndex() {
driver.get(pages.xhtmlTestPage);
try {
driver.switchTo().frame(27);
fail("Should not have been able to switch");
} catch (NoSuchFrameException e) {
// This is expected
}
}
// ----------------------------------------------------------------------------------------------
//
// General frame handling behavior tests
//
// ----------------------------------------------------------------------------------------------
@Ignore(ANDROID)
@Test
public void testShouldContinueToReferToTheSameFrameOnceItHasBeenSelected() {
driver.get(pages.framesetPage);
driver.switchTo().frame(2);
WebElement checkbox = driver.findElement(By.xpath("//input[@name='checky']"));
checkbox.click();
checkbox.submit();
// TODO(simon): this should not be needed, and is only here because IE's submit returns too
// soon.
waitFor(WaitingConditions.elementTextToEqual(driver, By.xpath("//p"), "Success!"));
}
@Ignore(value = {ANDROID, OPERA, OPERA_MOBILE},
reason = "Android does not detect that the select frame has disappeared")
@Test
public void testShouldFocusOnTheReplacementWhenAFrameFollowsALinkToA_TopTargettedPage()
throws Exception {
driver.get(pages.framesetPage);
driver.switchTo().frame(0);
driver.findElement(By.linkText("top")).click();
String expectedTitle = "XHTML Test Page";
waitFor(pageTitleToBe(driver, expectedTitle));
waitFor(elementToExist(driver, "only-exists-on-xhtmltest"));
}
@Ignore(ANDROID)
@Test
public void testShouldAllowAUserToSwitchFromAnIframeBackToTheMainContentOfThePage() {
driver.get(pages.iframePage);
driver.switchTo().frame(0);
try {
driver.switchTo().defaultContent();
driver.findElement(By.id("iframe_page_heading"));
} catch (Exception e) {
fail("Should have switched back to main content");
}
}
@Ignore(ANDROID)
@Test
public void testShouldAllowTheUserToSwitchToAnIFrameAndRemainFocusedOnIt() {
driver.get(pages.iframePage);
driver.switchTo().frame(0);
driver.findElement(By.id("submitButton")).click();
assertThat(getTextOfGreetingElement(), equalTo("Success!"));
}
public String getTextOfGreetingElement() {
return waitFor(elementToExist(driver, "greeting")).getText();
}
@Ignore({OPERA, ANDROID, OPERA_MOBILE})
@Test
public void testShouldBeAbleToClickInAFrame() {
driver.get(pages.framesetPage);
driver.switchTo().frame("third");
// This should replace frame "third" ...
driver.findElement(By.id("submitButton")).click();
// driver should still be focused on frame "third" ...
assertThat(getTextOfGreetingElement(), equalTo("Success!"));
// Make sure it was really frame "third" which was replaced ...
driver.switchTo().defaultContent().switchTo().frame("third");
assertThat(getTextOfGreetingElement(), equalTo("Success!"));
}
@Ignore({OPERA, ANDROID, OPERA_MOBILE})
@Test
public void testShouldBeAbleToClickInASubFrame() {
driver.get(pages.framesetPage);
driver.switchTo().frame("sixth")
.switchTo().frame("iframe1");
// This should replace frame "iframe1" inside frame "sixth" ...
driver.findElement(By.id("submitButton")).click();
// driver should still be focused on frame "iframe1" inside frame "sixth" ...
assertThat(getTextOfGreetingElement(), equalTo("Success!"));
// Make sure it was really frame "iframe1" inside frame "sixth" which was replaced ...
driver.switchTo().defaultContent()
.switchTo().frame("sixth")
.switchTo().frame("iframe1");
assertThat(driver.findElement(By.id("greeting")).getText(), equalTo("Success!"));
}
@NoDriverAfterTest
@Ignore({IPHONE})
@Test
public void testClosingTheFinalBrowserWindowShouldNotCauseAnExceptionToBeThrown() {
driver.get(pages.simpleTestPage);
try {
driver.close();
} catch (Exception e) {
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw);
e.printStackTrace(pw);
pw.flush();
pw.close();
fail("This is not expected. " + sw);
}
}
@Ignore(ANDROID)
@Test
public void testShouldBeAbleToFindElementsInIframesByXPath() {
driver.get(pages.iframePage);
driver.switchTo().frame("iframe1");
WebElement element = driver.findElement(By.xpath("//*[@id = 'changeme']"));
assertNotNull(element);
}
@Ignore(ANDROID)
@Test
public void testGetCurrentUrl() {
driver.get(pages.framesetPage);
driver.switchTo().frame("second");
String url = appServer.whereIs("page/2");
assertThat(driver.getCurrentUrl(), equalTo(url + "?title=Fish"));
url = appServer.whereIs("iframes.html");
driver.get(pages.iframePage);
assertThat(driver.getCurrentUrl(), equalTo(url));
url = appServer.whereIs("formPage.html");
driver.switchTo().frame("iframe1");
assertThat(driver.getCurrentUrl(), equalTo(url));
}
@Ignore(value = {ANDROID, OPERA, OPERA_MOBILE})
@JavascriptEnabled
@Test
public void testShouldBeAbleToCarryOnWorkingIfTheFrameIsDeletedFromUnderUs() {
driver.get(pages.deletingFrame);
driver.switchTo().frame("iframe1");
WebElement killIframe = driver.findElement(By.id("killIframe"));
killIframe.click();
driver.switchTo().defaultContent();
assertFrameNotPresent(driver, "iframe1");
WebElement addIFrame = driver.findElement(By.id("addBackFrame"));
addIFrame.click();
waitFor(elementToExist(driver, "iframe1"));
driver.switchTo().frame("iframe1");
try {
waitFor(elementToExist(driver, "checkbox"));
} catch (WebDriverException web) {
fail("Could not find element after switching frame");
}
}
@Ignore(value = {CHROME, SELENESE}, reason = "These drivers still return frame title.")
@Test
public void testShouldReturnWindowTitleInAFrameset() {
driver.get(pages.framesetPage);
driver.switchTo().frame("third");
assertEquals("Unique title", driver.getTitle());
}
@JavascriptEnabled
@Test
public void testJavaScriptShouldExecuteInTheContextOfTheCurrentFrame() {
JavascriptExecutor executor = (JavascriptExecutor) driver;
driver.get(pages.framesetPage);
assertTrue((Boolean) executor.executeScript("return window == window.top"));
driver.switchTo().frame("third");
assertTrue((Boolean) executor.executeScript("return window != window.top"));
}
private void assertFrameNotPresent(WebDriver driver, String locator) {
long end = System.currentTimeMillis() + TIMEOUT;
while (System.currentTimeMillis() < end) {
try {
driver.switchTo().frame(locator);
} catch (NoSuchFrameException e) {
return;
} finally {
driver.switchTo().defaultContent();
}
}
fail("Frame did not disappear");
}
}
|
bwp/SeleniumWebDriver
|
java/client/test/org/openqa/selenium/FrameSwitchingTest.java
|
Java
|
apache-2.0
| 14,668
|
# Pygeum subcordatum (Koord. & Valeton) Koehne SPECIES
#### Status
HETEROTYPIC_SYNONYM
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null
|
mdoering/backbone
|
life/Plantae/Magnoliophyta/Magnoliopsida/Rosales/Rosaceae/Prunus/Prunus arborea/ Syn. Pygeum subcordatum/README.md
|
Markdown
|
apache-2.0
| 213
|
package com.bradchen.jwormhole.client;
import com.jcraft.jsch.JSch;
import com.jcraft.jsch.JSchException;
import com.jcraft.jsch.Session;
import com.jcraft.jsch.UserInfo;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.net.Socket;
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
import static com.bradchen.jwormhole.client.SettingsUtils.getFilePathRelativeToHome;
/**
* jWormhole client.
*/
public class Client {
private static final Logger LOGGER = LoggerFactory.getLogger(Client.class);
// relative to $HOME
private static final String PRIVATE_KEY_FILE = ".ssh/id_rsa";
private static final String KNOWN_HOSTS_FILE = ".ssh/known_hosts";
private static final Charset UTF8_CHARSET = Charset.forName("utf-8");
private static final String LOCALHOST = "127.0.0.1";
private static final int MAX_NUM_RETRIES = 3;
private static final int RETRY_WAIT_TIME = 3;
private static final String OK = "ok";
private final Settings settings;
private final JSch jsch;
private final UserInfo userInfo;
private final List<ConnectionLostHandler> connectionClosedHandlers;
private ScheduledExecutorService scheduler;
private Session session;
private Host host;
private int localPort;
private int localControllerPort;
private int numRetries;
private long proxyStartTime;
public Client(Settings settings, UserInfo userInfo) throws IOException {
this.settings = settings;
this.jsch = new JSch();
this.userInfo = userInfo;
this.connectionClosedHandlers = new ArrayList<>();
}
public Settings getSettings() {
return settings;
}
public int getLocalPort() {
return localPort;
}
public long getProxyStartTime() {
return proxyStartTime;
}
public String getProxiedDomainName() {
if (host == null) {
return null;
}
return host.getDomainName();
}
public void addConnectionClosedHandler(ConnectionLostHandler handler) {
connectionClosedHandlers.add(handler);
}
public void removeConnectionClosedHandler(ConnectionLostHandler handler) {
connectionClosedHandlers.remove(handler);
}
public void connect() throws IOException {
if ((session != null) && session.isConnected()) {
return;
}
try {
scheduler = Executors.newScheduledThreadPool(1);
String knownHostsFilePath = getKnownHostsFilePath();
if (knownHostsFilePath != null) {
jsch.setKnownHosts(knownHostsFilePath);
}
String privateKeyFilePath = getPrivateKeyFilePath();
if (privateKeyFilePath != null) {
jsch.addIdentity(privateKeyFilePath);
}
session = jsch.getSession(settings.getServerUsername(), settings.getServerSshHost(),
settings.getServerSshPort());
session.setUserInfo(userInfo);
enableSessionCompression();
session.connect();
// enable controller socket connection
localControllerPort = session.setPortForwardingL(0, LOCALHOST,
settings.getServerControllerPort());
} catch (JSchException exception) {
throw new IOException(exception);
}
}
private void enableSessionCompression() {
session.setConfig("compression.s2c", "zlib@openssh.com,zlib,none");
session.setConfig("compression.c2s", "zlib@openssh.com,zlib,none");
session.setConfig("compression_level", "9");
}
public String proxyLocalPort(int localPort, String name) throws IOException {
String result;
if (name == null) {
result = executeCommand("createHost");
} else {
result = executeCommand("createHost " + name);
}
if (StringUtils.isBlank(result)) {
throw new IOException("No response from jWormhole Server.");
}
if ("error".equals(result)) {
return null;
}
String[] tokens = result.trim().split(",");
if (tokens.length != 3) {
return null;
}
host = new Host(tokens[0], tokens[1], Integer.parseInt(tokens[2]));
this.localPort = localPort;
if (proxyStartTime == 0) {
proxyStartTime = System.currentTimeMillis();
}
establishLocalPortForwarding(localPort);
scheduleKeepaliveWorker();
return host.getDomainName();
}
private void scheduleKeepaliveWorker() {
scheduler.scheduleAtFixedRate(() -> {
if ((host == null) || (localPort <= 0)) {
return;
}
keepHostAlive();
}, settings.getKeepaliveInterval(), settings.getKeepaliveInterval(), TimeUnit.SECONDS);
}
private void keepHostAlive() {
if (sendKeepaliveMessage()) {
return;
}
// connection unavailable; attempt to recreate connection
numRetries = 0;
scheduler.schedule(new ReconnectWorker(), 0, TimeUnit.SECONDS);
}
private boolean sendKeepaliveMessage() {
try {
session.sendKeepAliveMsg();
return OK.equals(executeCommand("keepHostAlive " + host.getDomainName()));
} catch (Exception ignored) {
return false;
}
}
private void establishLocalPortForwarding(int localPort) throws IOException {
try {
session.setPortForwardingR(host.getPort(), LOCALHOST, localPort);
} catch (JSchException exception) {
throw new IOException(exception);
}
}
public void shutdown() {
if (session != null) {
removeHost();
session.disconnect();
}
if (scheduler != null) {
scheduler.shutdownNow();
}
}
private void removeHost() {
if (host == null) {
return;
}
try {
executeCommand("removeHost " + host.getDomainName());
} catch (IOException ignored) {
}
}
private String executeCommand(String command) throws IOException {
try (Socket socket = new Socket(LOCALHOST, localControllerPort)) {
PrintWriter writer = new PrintWriter(socket.getOutputStream(), true);
InputStream in = socket.getInputStream();
writer.println(command);
StringBuilder sb = new StringBuilder();
byte[] bytes = new byte[1024];
while (socket.isConnected()) {
int bytesRead = in.read(bytes);
if (bytesRead == -1) {
break;
}
if (bytesRead > 0) {
sb.append(new String(bytes, 0, bytesRead, UTF8_CHARSET));
}
try {
Thread.sleep(100);
} catch (InterruptedException ignored) {
}
}
return sb.toString().trim();
}
}
private static String getPrivateKeyFilePath() throws IOException {
return getFilePathRelativeToHome(PRIVATE_KEY_FILE);
}
private static String getKnownHostsFilePath() {
return getFilePathRelativeToHome(KNOWN_HOSTS_FILE);
}
private class ReconnectWorker implements Runnable {
@Override
public void run() {
try {
shutdown();
connect();
if ((proxyLocalPort(localPort, host.getName()) != null) || sendKeepaliveMessage()) {
return;
}
} catch (IOException exception) {
LOGGER.warn("Failed to connect to jWormhole server.", exception);
}
numRetries++;
if (numRetries < MAX_NUM_RETRIES) {
System.out.println("Will try again in " + RETRY_WAIT_TIME + " seconds...");
scheduler.schedule(new ReconnectWorker(), RETRY_WAIT_TIME, TimeUnit.SECONDS);
} else {
shutdown();
connectionClosedHandlers.parallelStream().forEach(handler ->
handler.connectionClosed(localPort, host.getDomainName()));
}
}
}
}
|
vvasabi/jwormhole-client
|
src/main/java/com/bradchen/jwormhole/client/Client.java
|
Java
|
apache-2.0
| 7,187
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.9.1"/>
<title>ovs all: _OVS_IP_HELPER_THREAD_CONTEXT Struct Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
$(document).ready(initResizable);
$(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">ovs all
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.9.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main Page</span></a></li>
<li><a href="pages.html"><span>Related Pages</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li class="current"><a href="annotated.html"><span>Data Structures</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="annotated.html"><span>Data Structures</span></a></li>
<li><a href="classes.html"><span>Data Structure Index</span></a></li>
<li><a href="inherits.html"><span>Class Hierarchy</span></a></li>
<li><a href="functions.html"><span>Data Fields</span></a></li>
</ul>
</div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('struct__OVS__IP__HELPER__THREAD__CONTEXT.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div class="header">
<div class="summary">
<a href="#pub-attribs">Data Fields</a> </div>
<div class="headertitle">
<div class="title">_OVS_IP_HELPER_THREAD_CONTEXT Struct Reference</div> </div>
</div><!--header-->
<div class="contents">
<p><code>#include <<a class="el" href="IpHelper_8h_source.html">IpHelper.h</a>></code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-attribs"></a>
Data Fields</h2></td></tr>
<tr class="memitem:a1a9124409cde2e76c53b8cb7f3520ecf"><td class="memItemLeft" align="right" valign="top">KEVENT </td><td class="memItemRight" valign="bottom"><a class="el" href="struct__OVS__IP__HELPER__THREAD__CONTEXT.html#a1a9124409cde2e76c53b8cb7f3520ecf">event</a></td></tr>
<tr class="separator:a1a9124409cde2e76c53b8cb7f3520ecf"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a357a0563815bc3bcfe10062ef8bbe99c"><td class="memItemLeft" align="right" valign="top">PVOID </td><td class="memItemRight" valign="bottom"><a class="el" href="struct__OVS__IP__HELPER__THREAD__CONTEXT.html#a357a0563815bc3bcfe10062ef8bbe99c">threadObject</a></td></tr>
<tr class="separator:a357a0563815bc3bcfe10062ef8bbe99c"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:adeaca99af5408f80d3e7376f292c25ba"><td class="memItemLeft" align="right" valign="top">UINT32 </td><td class="memItemRight" valign="bottom"><a class="el" href="struct__OVS__IP__HELPER__THREAD__CONTEXT.html#adeaca99af5408f80d3e7376f292c25ba">exit</a></td></tr>
<tr class="separator:adeaca99af5408f80d3e7376f292c25ba"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<h2 class="groupheader">Field Documentation</h2>
<a class="anchor" id="a1a9124409cde2e76c53b8cb7f3520ecf"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">KEVENT _OVS_IP_HELPER_THREAD_CONTEXT::event</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a class="anchor" id="adeaca99af5408f80d3e7376f292c25ba"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">UINT32 _OVS_IP_HELPER_THREAD_CONTEXT::exit</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a class="anchor" id="a357a0563815bc3bcfe10062ef8bbe99c"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">PVOID _OVS_IP_HELPER_THREAD_CONTEXT::threadObject</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<hr/>The documentation for this struct was generated from the following file:<ul>
<li>/home/vladn/git/ovs/datapath-windows/ovsext/<a class="el" href="IpHelper_8h_source.html">IpHelper.h</a></li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="struct__OVS__IP__HELPER__THREAD__CONTEXT.html">_OVS_IP_HELPER_THREAD_CONTEXT</a></li>
<li class="footer">Generated on Wed Sep 9 2015 19:08:08 for ovs all by
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.9.1 </li>
</ul>
</div>
</body>
</html>
|
vladn-ma/vladn-ovs-doc
|
doxygen/ovs_all/html/struct__OVS__IP__HELPER__THREAD__CONTEXT.html
|
HTML
|
apache-2.0
| 7,711
|
package net.wildbill22.draco.entities.dragons;
import net.minecraft.entity.EntityLiving;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
public abstract class EntityFlyingMob extends EntityLiving
{
public EntityFlyingMob(World p_i1587_1_)
{
super(p_i1587_1_);
}
public static boolean flying = true;
/**
* Called when the mob is falling. Calculates and applies fall damage.
*/
protected void fall(float p_70069_1_) {}
/**
* Takes in the distance the entity has fallen this tick and whether its on the ground to update the fall distance
* and deal fall damage if landing on the ground. Args: distanceFallenThisTick, onGround
*/
protected void updateFallState(double p_70064_1_, boolean p_70064_3_) {}
/**
* Moves the entity based on the specified heading. Args: strafe, forward
*/
public void moveEntityWithHeading(float p_70612_1_, float p_70612_2_)
{
if (this.isInWater())
{
this.moveFlying(p_70612_1_, p_70612_2_, 0.02F);
this.moveEntity(this.motionX, this.motionY, this.motionZ);
this.motionX *= 0.800000011920929D;
this.motionY *= 0.800000011920929D;
this.motionZ *= 0.800000011920929D;
}
else if (this.handleLavaMovement())
{
this.moveFlying(p_70612_1_, p_70612_2_, 0.02F);
this.moveEntity(this.motionX, this.motionY, this.motionZ);
this.motionX *= 0.5D;
this.motionY *= 0.5D;
this.motionZ *= 0.5D;
}
else
{
float f2 = 0.91F;
if (this.onGround)
{
f2 = this.worldObj.getBlock(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.boundingBox.minY) - 1, MathHelper.floor_double(this.posZ)).slipperiness * 0.91F;
}
float f3 = 0.16277136F / (f2 * f2 * f2);
this.moveFlying(p_70612_1_, p_70612_2_, this.onGround ? 0.1F * f3 : 0.02F);
f2 = 0.91F;
if (this.onGround)
{
f2 = this.worldObj.getBlock(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.boundingBox.minY) - 1, MathHelper.floor_double(this.posZ)).slipperiness * 0.91F;
}
this.moveEntity(this.motionX, this.motionY, this.motionZ);
this.motionX *= (double)f2;
this.motionY *= (double)f2;
this.motionZ *= (double)f2;
}
this.prevLimbSwingAmount = this.limbSwingAmount;
double d1 = this.posX - this.prevPosX;
double d0 = this.posZ - this.prevPosZ;
float f4 = MathHelper.sqrt_double(d1 * d1 + d0 * d0) * 4.0F;
if (f4 > 1.0F)
{
f4 = 1.0F;
}
this.limbSwingAmount += (f4 - this.limbSwingAmount) * 0.4F;
this.limbSwing += this.limbSwingAmount;
}
/**
* returns true if this entity is by a ladder, false otherwise
*/
public boolean isOnLadder()
{
return false;
}
}
|
DracoAnimus/Coding
|
src/main/java/net/wildbill22/draco/entities/dragons/EntityFlyingMob.java
|
Java
|
apache-2.0
| 3,079
|
# Silene verecunda S. Watson SPECIES
#### Status
ACCEPTED
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null
|
mdoering/backbone
|
life/Plantae/Magnoliophyta/Magnoliopsida/Caryophyllales/Caryophyllaceae/Silene/Silene verecunda/README.md
|
Markdown
|
apache-2.0
| 184
|
// ----------------------------------------------------------------------------------
//
// Copyright Microsoft 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.
// ----------------------------------------------------------------------------------
using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Microsoft Azure Powershell")]
[assembly: AssemblyCompany("Microsoft")]
[assembly: AssemblyProduct("Microsoft Azure Powershell")]
[assembly: AssemblyCopyright("Copyright © Microsoft")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("598976e5-f420-4b93-9373-8d2f1f7aa9a9")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.1.3")]
[assembly: AssemblyFileVersion("1.1.3")]
|
Matt-Westphal/azure-powershell
|
src/Storage/Commands.Storage.MsTest2/Properties/AssemblyInfo.cs
|
C#
|
apache-2.0
| 2,014
|
# Copyright 2014-2018 The PySCF Developers. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from __future__ import print_function
import numpy as np
from ctypes import POINTER, c_double, c_int64
from pyscf.nao.m_libnao import libnao
libnao.ao_eval.argtypes = (
POINTER(c_int64), # nmult
POINTER(c_double), # psi_log_rl
POINTER(c_int64), # nr
POINTER(c_double), # rhomin_jt
POINTER(c_double), # dr_jt
POINTER(c_int64), # mu2j
POINTER(c_int64), # mu2s
POINTER(c_double), # mu2rcut
POINTER(c_double), # rvec_atom_center
POINTER(c_int64), # ncoords
POINTER(c_double), # coords
POINTER(c_int64), # norbs
POINTER(c_double), # res[orb, icoord]
POINTER(c_int64)) # ldres leading dimension of res (ncoords)
#
#
#
def ao_eval_libnao_(ao, rat, isp, crds, res):
"""
Compute the values of atomic orbitals on given grid points
Args:
ao : instance of ao_log_c class
rat : vector where the atomic orbitals from "ao" are centered
isp : specie index for which we compute
crds: coordinates on which we compute
Returns:
res[norbs,ncoord] : array of atomic orbital values
"""
#print(res_copy.flags)
rat_copy = np.require(rat, dtype=c_double, requirements='C')
crd_copy = np.require(crds, dtype=c_double, requirements='C')
res_copy = np.require(res, dtype=c_double, requirements='CW')
mu2j = np.require(ao.sp_mu2j[isp], dtype=c_int64, requirements='C')
mu2s = np.require(ao.sp_mu2s[isp], dtype=c_int64, requirements='C')
mu2rcut = np.require(ao.sp_mu2rcut[isp], dtype=c_double, requirements='C')
ff = np.require(ao.psi_log_rl[isp], dtype=c_double, requirements='C')
libnao.ao_eval(
c_int64(ao.sp2nmult[isp]),
ff.ctypes.data_as(POINTER(c_double)),
c_int64(ao.nr),
c_double(ao.interp_rr.gammin_jt),
c_double(ao.interp_rr.dg_jt),
mu2j.ctypes.data_as(POINTER(c_int64)),
mu2s.ctypes.data_as(POINTER(c_int64)),
mu2rcut.ctypes.data_as(POINTER(c_double)),
rat_copy.ctypes.data_as(POINTER(c_double)),
c_int64(crd_copy.shape[0]),
crd_copy.ctypes.data_as(POINTER(c_double)),
c_int64(ao.sp2norbs[isp]),
res_copy.ctypes.data_as(POINTER(c_double)),
c_int64(res.shape[1]) )
res = res_copy
return 0
#
# See above
#
def ao_eval_libnao(ao, ra, isp, coords):
res = np.zeros((ao.sp2norbs[isp],coords.shape[0]), dtype='float64')
ao_eval_libnao_(ao, ra, isp, coords, res)
return res
if __name__ == '__main__':
from pyscf.nao.m_system_vars import system_vars_c
from pyscf.nao.m_ao_eval import ao_eval
from pyscf.nao.m_ao_eval_libnao import ao_eval_libnao
sv = system_vars_c()
ra = np.array([0.3, -0.5, 0.77], dtype='float64')
#coords = np.array([[0.07716887, 2.82933578, 3.73214881]])
coords = np.random.rand(35580,3)*5.0
print('ao_val2 (reference)')
ao_val1 = ao_eval(sv.ao_log, ra, 0, coords)
print('ao_val2_libnao')
ao_val2 = ao_eval_libnao(sv.ao_log, ra, 0, coords)
print(np.allclose(ao_val1,ao_val2))
for iorb,[oo1,oo2] in enumerate(zip(ao_val1,ao_val2)):
print(iorb, abs(oo1-oo2).argmax(), abs(oo1-oo2).max(), coords[abs(oo1-oo2).argmax(),:])
|
gkc1000/pyscf
|
pyscf/nao/m_ao_eval_libnao.py
|
Python
|
apache-2.0
| 3,652
|
/**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.camel.support;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ScheduledThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import org.apache.camel.TimeoutMap;
import org.junit.Assert;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import static org.awaitility.Awaitility.await;
public class DefaultTimeoutMapTest extends Assert {
private static final Logger LOG = LoggerFactory.getLogger(DefaultTimeoutMapTest.class);
private ScheduledExecutorService executor = new ScheduledThreadPoolExecutor(1);
@Test
public void testDefaultTimeoutMap() throws Exception {
DefaultTimeoutMap<?, ?> map = new DefaultTimeoutMap<>(executor);
map.start();
assertTrue(map.currentTime() > 0);
assertEquals(0, map.size());
map.stop();
}
@Test
public void testDefaultTimeoutMapPurge() throws Exception {
DefaultTimeoutMap<String, Integer> map = new DefaultTimeoutMap<>(executor, 100);
map.start();
assertTrue(map.currentTime() > 0);
assertEquals(0, map.size());
map.put("A", 123, 50);
assertEquals(1, map.size());
Thread.sleep(250);
if (map.size() > 0) {
LOG.warn("Waiting extra due slow CI box");
Thread.sleep(1000);
}
assertEquals(0, map.size());
map.stop();
}
@Test
public void testDefaultTimeoutMapForcePurge() throws Exception {
DefaultTimeoutMap<String, Integer> map = new DefaultTimeoutMap<>(executor, 100);
// map.start(); // Do not start background purge
assertTrue(map.currentTime() > 0);
assertEquals(0, map.size());
map.put("A", 123, 10);
assertEquals(1, map.size());
Thread.sleep(50);
// will purge and remove old entries
map.purge();
assertEquals(0, map.size());
}
@Test
public void testDefaultTimeoutMapGetRemove() throws Exception {
DefaultTimeoutMap<String, Integer> map = new DefaultTimeoutMap<>(executor, 100);
map.start();
assertTrue(map.currentTime() > 0);
assertEquals(0, map.size());
map.put("A", 123, 50);
assertEquals(1, map.size());
assertEquals(123, (int)map.get("A"));
Object old = map.remove("A");
assertEquals(123, old);
assertEquals(null, map.get("A"));
assertEquals(0, map.size());
map.stop();
}
@Test
public void testExecutor() throws Exception {
ScheduledExecutorService e = Executors.newScheduledThreadPool(2);
DefaultTimeoutMap<String, Integer> map = new DefaultTimeoutMap<>(e, 50);
map.start();
assertEquals(50, map.getPurgePollTime());
map.put("A", 123, 100);
assertEquals(1, map.size());
Thread.sleep(250);
if (map.size() > 0) {
LOG.warn("Waiting extra due slow CI box");
Thread.sleep(1000);
}
// should have been timed out now
assertEquals(0, map.size());
assertSame(e, map.getExecutor());
map.stop();
}
@Test
public void testExpiredInCorrectOrder() throws Exception {
final List<String> keys = new ArrayList<>();
final List<Integer> values = new ArrayList<>();
DefaultTimeoutMap<String, Integer> map = new DefaultTimeoutMap<>(executor, 100);
map.addListener((type, key, value) -> {
if (type == TimeoutMap.Listener.Type.Evict) {
keys.add(key);
values.add(value);
}
});
map.start();
assertEquals(0, map.size());
map.put("A", 1, 50);
map.put("B", 2, 30);
map.put("C", 3, 40);
map.put("D", 4, 20);
map.put("E", 5, 40);
// is not expired
map.put("F", 6, 800);
Thread.sleep(250);
assertEquals("D", keys.get(0));
assertEquals(4, values.get(0).intValue());
assertEquals("B", keys.get(1));
assertEquals(2, values.get(1).intValue());
assertEquals("C", keys.get(2));
assertEquals(3, values.get(2).intValue());
assertEquals("E", keys.get(3));
assertEquals(5, values.get(3).intValue());
assertEquals("A", keys.get(4));
assertEquals(1, values.get(4).intValue());
assertEquals(1, map.size());
map.stop();
}
@Test
public void testDefaultTimeoutMapStopStart() throws Exception {
DefaultTimeoutMap<String, Integer> map = new DefaultTimeoutMap<>(executor, 100);
map.start();
map.put("A", 1, 500);
assertEquals(1, map.size());
map.stop();
assertEquals(0, map.size());
map.put("A", 1, 50);
// should not timeout as the scheduler doesn't run
Thread.sleep(250);
assertEquals(1, map.size());
// start
map.start();
// start and wait for scheduler to purge
await().atMost(2, TimeUnit.SECONDS).untilAsserted(() ->
// now it should be gone
assertEquals(0, map.size()));
map.stop();
}
}
|
punkhorn/camel-upstream
|
core/camel-core/src/test/java/org/apache/camel/support/DefaultTimeoutMapTest.java
|
Java
|
apache-2.0
| 6,075
|
openstack development repo authored by Yu
|
OpenAcademy-OpenStack/YuSi
|
README.md
|
Markdown
|
apache-2.0
| 41
|
<?php
/**
* @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com)
*/
namespace Magento\Backend\Model\Config\Backend;
class EncryptedTest extends \PHPUnit_Framework_TestCase
{
/** @var \PHPUnit_Framework_MockObject_MockObject */
protected $_encryptorMock;
/** @var \PHPUnit_Framework_MockObject_MockObject */
protected $_configMock;
/** @var \PHPUnit_Framework_MockObject_MockObject */
protected $_resourceMock;
/** @var \Magento\Backend\Model\Config\Backend\Encrypted */
protected $_model;
protected function setUp()
{
$helper = new \Magento\TestFramework\Helper\ObjectManager($this);
$eventDispatcherMock = $this->getMock('Magento\Framework\Event\Manager', [], [], '', false);
$contextMock = $this->getMock('Magento\Framework\Model\Context', [], [], '', false);
$contextMock->expects(
$this->any()
)->method(
'getEventDispatcher'
)->will(
$this->returnValue($eventDispatcherMock)
);
$this->_resourceMock = $this->getMock(
'Magento\Framework\Model\Resource\AbstractResource',
[
'_construct',
'_getReadAdapter',
'_getWriteAdapter',
'getIdFieldName',
'beginTransaction',
'save',
'commit',
'addCommitCallback'
],
[],
'',
false
);
$this->_configMock = $this->getMock('Magento\Framework\App\Config\ScopeConfigInterface');
$this->_helperMock = $this->getMock('Magento\Core\Helper\Data', [], [], '', false);
$this->_encryptorMock = $this->getMock(
'Magento\Framework\Encryption\EncryptorInterface',
[],
[],
'',
false
);
$this->_model = $helper->getObject(
'Magento\Backend\Model\Config\Backend\Encrypted',
[
'config' => $this->_configMock,
'context' => $contextMock,
'resource' => $this->_resourceMock,
'encryptor' => $this->_encryptorMock
]
);
}
public function testProcessValue()
{
$value = 'someValue';
$result = 'some value from parent class';
$this->_encryptorMock->expects(
$this->once()
)->method(
'decrypt'
)->with(
$value
)->will(
$this->returnValue($result)
);
$this->assertEquals($result, $this->_model->processValue($value));
}
/**
* @covers \Magento\Backend\Model\Config\Backend\Encrypted::beforeSave
* @dataProvider beforeSaveDataProvider
*
* @param $value
* @param $valueToSave
*/
public function testBeforeSave($value, $valueToSave)
{
$this->_resourceMock->expects($this->any())->method('addCommitCallback')->will($this->returnSelf());
$this->_resourceMock->expects($this->any())->method('commit')->will($this->returnSelf());
$this->_configMock->expects(
$this->any()
)->method(
'getValue'
)->with(
'some/path'
)->will(
$this->returnValue('oldValue')
);
$this->_encryptorMock->expects(
$this->once()
)->method(
'encrypt'
)->with(
$valueToSave
)->will(
$this->returnValue('encrypted')
);
$this->_model->setValue($value);
$this->_model->setPath('some/path');
$this->_model->beforeSave();
$this->assertEquals($this->_model->getValue(), 'encrypted');
}
/**
* @return array
*/
public function beforeSaveDataProvider()
{
return [['****', 'oldValue'], ['newValue', 'newValue']];
}
}
|
webadvancedservicescom/magento
|
dev/tests/unit/testsuite/Magento/Backend/Model/Config/Backend/EncryptedTest.php
|
PHP
|
apache-2.0
| 3,912
|
/*
* 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.backupgateway.model.transform;
import javax.annotation.Generated;
import com.amazonaws.SdkClientException;
import com.amazonaws.services.backupgateway.model.*;
import com.amazonaws.protocol.*;
import com.amazonaws.annotation.SdkInternalApi;
/**
* DeleteHypervisorRequestMarshaller
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
@SdkInternalApi
public class DeleteHypervisorRequestMarshaller {
private static final MarshallingInfo<String> HYPERVISORARN_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
.marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("HypervisorArn").build();
private static final DeleteHypervisorRequestMarshaller instance = new DeleteHypervisorRequestMarshaller();
public static DeleteHypervisorRequestMarshaller getInstance() {
return instance;
}
/**
* Marshall the given parameter object.
*/
public void marshall(DeleteHypervisorRequest deleteHypervisorRequest, ProtocolMarshaller protocolMarshaller) {
if (deleteHypervisorRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(deleteHypervisorRequest.getHypervisorArn(), HYPERVISORARN_BINDING);
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
}
}
}
|
aws/aws-sdk-java
|
aws-java-sdk-backupgateway/src/main/java/com/amazonaws/services/backupgateway/model/transform/DeleteHypervisorRequestMarshaller.java
|
Java
|
apache-2.0
| 2,056
|
# Azure will execute first file.
# sys.path.append is required by Azure Web Jobs. It requires that all packages are provided to it in zip file.
# env\Lib\site-packages is virtual env path in Windows
import sys
sys.path.append("env\Lib\site-packages")
import logging
import logging.config
from datetime import datetime
import config
from database import DataStore
from ifttt import IFTTT
logging.config.fileConfig('log.config')
logger = logging.getLogger(config.logger_name)
def myExceptionHook(exctype, value, traceback):
logger.error(value)
sys.__excepthook__(exctype, value, traceback)
if __name__ == '__main__':
sys.excepthook = myExceptionHook
print("Running IFTTT checker at %s" % datetime.utcnow())
store = DataStore(config.db_server, config.db_name, config.db_user, config.db_password)
rows = store.getSensorBatteryStatuses()
current_hour = datetime.utcnow().hour
for row in rows:
sensor_id = row[0]
battery = row[1]
cable = row[2]
if battery <= 15 and cable == 0 and current_hour > 19:
logger.debug("Request charging %s (%s : %s)" % (sensor_id, battery, cable))
IFTTT.sendEvent(config.ifttt_api_key, sensor_id + config.ifttt_event_on)
# Stop charging when nearing 100
if cable == 1 and battery > 96:
logger.debug("Request unplug %s (%s : %s)" % (sensor_id, battery, cable))
IFTTT.sendEvent(config.ifttt_api_key, sensor_id + config.ifttt_event_off)
|
ttu/cubesensors-iot-azure
|
src/python_checker/checker.py
|
Python
|
apache-2.0
| 1,550
|
package org.xbib.content.rdf;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
/**
*
*/
public class RouteRdfXContent implements RdfContent<RouteRdfXContentParams> {
private static final RouteRdfXContent ROUTE_RDF_X_CONTENT = new RouteRdfXContent();
private RouteRdfXContent() {
}
public static RouteRdfXContent routeRdfXContent() {
return ROUTE_RDF_X_CONTENT;
}
public static RdfContentBuilder<RouteRdfXContentParams> contentBuilder(RouteRdfXContentParams params) throws IOException {
return new RdfContentBuilder<>(ROUTE_RDF_X_CONTENT, params);
}
@Override
public StandardRdfContentType type() {
return null;
}
@Override
public RdfContentGenerator<RouteRdfXContentParams> createGenerator(OutputStream out) throws IOException {
return new RouteRdfXContentGenerator<>(out);
}
@Override
public RdfContentParser<RouteRdfXContentParams> createParser(InputStream in) throws IOException {
throw new UnsupportedOperationException();
}
/**
*
*/
@FunctionalInterface
public interface RouteHandler {
void complete(String content, RouteRdfXContentParams params) throws IOException;
}
}
|
xbib/content
|
content-rdf/src/main/java/org/xbib/content/rdf/RouteRdfXContent.java
|
Java
|
apache-2.0
| 1,262
|
--------------------------------------------------------------------------------
## Treebank Statistics (UD_Chinese)
This feature is universal.
It occurs with 1 different values: `Plur`.
240 tokens (0%) have a non-empty value of `Number`.
7 types (0%) occur at least once with a non-empty value of `Number`.
7 lemmas (0%) occur at least once with a non-empty value of `Number`.
The feature is used with 3 part-of-speech tags: [zh-pos/PRON]() (193; 0% instances), [zh-pos/PART]() (30; 0% instances), [zh-pos/NOUN]() (17; 0% instances).
### `PRON`
193 [zh-pos/PRON]() tokens (12% of all `PRON` tokens) have a non-empty value of `Number`.
The most frequent other feature values with which `PRON` and `Number` co-occurred: <tt><a href="Person.html">Person</a>=3</tt> (164; 85%).
`PRON` tokens may have the following values of `Number`:
* `Plur` (193; 100% of non-empty `Number`): 他們、 它們、 我們、 牠們、 她們
* `EMPTY` (1415): 他、 其、 她、 此、 自己、 它、 這、 我、 之、 你
### `PART`
30 [zh-pos/PART]() tokens (0% of all `PART` tokens) have a non-empty value of `Number`.
The most frequent other feature values with which `PART` and `Number` co-occurred: <tt><a href="Case.html">Case</a>=EMPTY</tt> (30; 100%).
`PART` tokens may have the following values of `Number`:
* `Plur` (30; 100% of non-empty `Number`): 們
* `EMPTY` (11796): 的、 了、 之、 人、 大、 者、 區、 會、 市、 著
### `NOUN`
17 [zh-pos/NOUN]() tokens (0% of all `NOUN` tokens) have a non-empty value of `Number`.
`NOUN` tokens may have the following values of `Number`:
* `Plur` (17; 100% of non-empty `Number`): 人們
* `EMPTY` (30716): 年、 個、 月、 日、 人、 等、 種、 次、 人口、 國家
## Relations with Agreement in `Number`
The 10 most frequent relations where parent and child node agree in `Number`:
<tt>PART --[<a href="../dep/conj.html">conj</a>]--> PART</tt> (1; 100%).
|
PhyloStar/UDTelugu
|
_includes/stats/zh/feat/Number.md
|
Markdown
|
apache-2.0
| 1,950
|
/* ********************************************************************
Licensed to Jasig under one or more contributor license
agreements. See the NOTICE file distributed with this work
for additional information regarding copyright ownership.
Jasig 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.bedework.util.xml.tagdefs;
import javax.xml.namespace.QName;
/** Define tags for icalendar in XML.
*
* @author Mike Douglass douglm - rpi.edu
*/
public class XcalTags {
/** */
public static final String namespace = "urn:ietf:params:xml:ns:icalendar-2.0";
/** */
public static final String mimetype = "application/calendar+xml";
/* =====================================================================
Structural
===================================================================== */
/** */
public static final QName icalendar = new QName(namespace, "icalendar");
/** */
public static final QName components = new QName(namespace, "components");
/** */
public static final QName parameters = new QName(namespace, "parameters");
/** */
public static final QName properties = new QName(namespace, "properties");
/* =====================================================================
components
===================================================================== */
/** */
public static final QName valarm = new QName(namespace, "valarm");
/** */
public static final QName vavailability = new QName(namespace, "vavailability");
/** */
public static final QName available = new QName(namespace, "available");
/** */
public static final QName vcalendar = new QName(namespace, "vcalendar");
/** */
public static final QName vtodo = new QName(namespace, "vtodo");
/** */
public static final QName vjournal = new QName(namespace, "vjournal");
/** */
public static final QName vevent = new QName(namespace, "vevent");
/** */
public static final QName vfreebusy = new QName(namespace, "vfreebusy");
/** */
public static final QName standard = new QName(namespace, "standard");
/** */
public static final QName vtimezone = new QName(namespace, "vtimezone");
/** */
public static final QName daylight = new QName(namespace, "daylight");
/* =====================================================================
value types
===================================================================== */
/** */
public static final QName binaryVal = new QName(namespace, "binary");
/** */
public static final QName booleanVal = new QName(namespace, "boolean");
/** */
public static final QName calAddressVal = new QName(namespace, "cal-address");
/** */
public static final QName dateVal = new QName(namespace, "date");
/** */
public static final QName dateTimeVal = new QName(namespace, "date-time");
/** */
public static final QName durationVal = new QName(namespace, "duration");
/** */
public static final QName floatVal = new QName(namespace, "float");
/** */
public static final QName integerVal = new QName(namespace, "integer");
/** */
public static final QName periodVal = new QName(namespace, "period");
/** */
public static final QName textVal = new QName(namespace, "text");
/** */
public static final QName timeVal = new QName(namespace, "time");
/** */
public static final QName uriVal = new QName(namespace, "uri");
/** */
public static final QName utcDateTimeVal = new QName(namespace, "utc-date-time");
/** */
public static final QName utcOffsetVal = new QName(namespace, "utc-offset");
/* =====================================================================
parameters
===================================================================== */
/** */
public static final QName altrep = new QName(namespace, "altrep");
/** */
public static final QName cn = new QName(namespace, "cn");
/** */
public static final QName cutype = new QName(namespace, "cutype");
/** */
public static final QName delegatedFrom = new QName(namespace, "delegated-from");
/** */
public static final QName delegatedTo = new QName(namespace, "delegated-to");
/** */
public static final QName dir = new QName(namespace, "dir");
/** */
public static final QName encoding = new QName(namespace, "encoding");
/** */
public static final QName fmttype = new QName(namespace, "fmttype");
/** */
public static final QName fbtype = new QName(namespace, "fbtype");
/** */
public static final QName language = new QName(namespace, "language");
/** */
public static final QName member = new QName(namespace, "member");
/** */
public static final QName partstat = new QName(namespace, "partstat");
/** */
public static final QName range = new QName(namespace, "range");
/** */
public static final QName related = new QName(namespace, "related");
/** */
public static final QName reltype = new QName(namespace, "reltype");
/** */
public static final QName role = new QName(namespace, "role");
/** */
public static final QName rsvp = new QName(namespace, "rsvp");
/** */
public static final QName sentBy = new QName(namespace, "sent-by");
/** */
public static final QName tzidPar = new QName(namespace, "tzid");
/** */
public static final QName scheduleAgent = new QName(namespace, "schedule-agent");
/** */
public static final QName scheduleForceSend = new QName(namespace, "schedule-force-send");
/** */
public static final QName scheduleStatus = new QName(namespace, "schedule-status");
/** */
public static final QName xBedeworkUidParam = new QName(namespace, "x-bedework-uid");
/* =====================================================================
geo
===================================================================== */
/** */
public static final QName latitudeVal = new QName(namespace, "latitude");
/** */
public static final QName longitudeVal = new QName(namespace, "longitude");
/* =====================================================================
Request status value elements
===================================================================== */
/** */
public static final QName codeVal = new QName(namespace, "code");
/** */
public static final QName descriptionVal = new QName(namespace, "description");
/** */
public static final QName extdataVal = new QName(namespace, "extdata");
/* =====================================================================
recur
===================================================================== */
/** */
public static final QName recurVal = new QName(namespace, "recur");
/** */
public static final QName freq = new QName(namespace, "freq");
/** */
public static final QName until = new QName(namespace, "until");
/** */
public static final QName count = new QName(namespace, "count");
/** */
public static final QName interval = new QName(namespace, "interval");
/** */
public static final QName bysecond = new QName(namespace, "bysecond");
/** */
public static final QName byminute = new QName(namespace, "byminute");
/** */
public static final QName byhour = new QName(namespace, "byhour");
/** */
public static final QName byday = new QName(namespace, "byday");
/** */
public static final QName bymonthday = new QName(namespace, "bymonthday");
/** */
public static final QName byyearday = new QName(namespace, "byyearday");
/** */
public static final QName byweekno = new QName(namespace, "byweekno");
/** */
public static final QName bymonth = new QName(namespace, "bymonth");
/** */
public static final QName bysetpos = new QName(namespace, "bysetpos");
/** */
public static final QName wkst = new QName(namespace, "wkst");
/* =====================================================================
properties
===================================================================== */
/** VPOLL only */
public static final QName acceptResponse = new QName(namespace, "accept-response");
/** VPOLL only */
public static final QName voter = new QName(namespace, "voter");
/** * * * * * VALARM */
public static final QName action = new QName(namespace, "action");
/** VEVENT VTODO VJOURNAL * * VALARM */
public static final QName attach = new QName(namespace, "attach");
/** VEVENT VTODO VJOURNAL VFREEBUSY * VALARM */
public static final QName attendee = new QName(namespace, "attendee");
/** * * * * * * CALENDAR*/
public static final QName calscale = new QName(namespace, "calscale");
/** VEVENT VTODO VJOURNAL */
public static final QName categories = new QName(namespace, "categories");
/** VEVENT VTODO VJOURNAL */
public static final QName _class = new QName(namespace, "class");
/** VEVENT VTODO VJOURNAL VFREEBUSY VTIMEZONE */
public static final QName comment = new QName(namespace, "comment");
/** * VTODO */
public static final QName completed = new QName(namespace, "completed");
/** VEVENT VTODO VJOURNAL VFREEBUSY */
public static final QName contact = new QName(namespace, "contact");
/** VEVENT VTODO VJOURNAL */
public static final QName created = new QName(namespace, "created");
/** VEVENT VTODO VJOURNAL * * VALARM */
public static final QName description = new QName(namespace, "description");
/** VEVENT * * VFREEBUSY */
public static final QName dtend = new QName(namespace, "dtend");
/** VEVENT VTODO VJOURNAL VFREEBUSY */
public static final QName dtstamp = new QName(namespace, "dtstamp");
/** VEVENT VTODO * VFREEBUSY VTIMEZONE */
public static final QName dtstart = new QName(namespace, "dtstart");
/** * VTODO */
public static final QName due = new QName(namespace, "due");
/** VEVENT VTODO * VFREEBUSY * VALARM */
public static final QName duration = new QName(namespace, "duration");
/** VEVENT VTODO VJOURNAL * VTIMEZONE */
public static final QName exdate = new QName(namespace, "exdate");
/** VEVENT VTODO VJOURNAL */
public static final QName exrule = new QName(namespace, "exrule");
/** * * * VFREEBUSY */
public static final QName freebusy = new QName(namespace, "freebusy");
/** VEVENT VTODO */
public static final QName geo = new QName(namespace, "geo");
/** */
public static final QName hasAlarm = new QName(namespace, "has-alarm");
/** */
public static final QName hasAttachment = new QName(namespace,
"has-attachment");
/** */
public static final QName hasRecurrence = new QName(namespace,
"has-recurrence");
/** VEVENT VTODO VJOURNAL * VTIMEZONE */
public static final QName lastModified = new QName(namespace,
"last-modified");
/** VEVENT VTODO */
public static final QName location = new QName(namespace, "location");
/** * * * CALENDAR*/
public static final QName method = new QName(namespace, "method");
/** VEVENT VTODO VJOURNAL VFREEBUSY */
public static final QName organizer = new QName(namespace, "organizer");
/** * VTODO */
public static final QName percentComplete = new QName(namespace,
"percent-complete");
/** VEVENT VTODO VJOURNAL VFREEBUSY */
public static final QName pollItemId = new QName(namespace, "poll-item-id");
/** VPOLL only */
public static final QName pollMode = new QName(namespace, "poll-mode");
/** VPOLL only */
public static final QName pollProperties = new QName(namespace, "poll-properties");
/** VEVENT VTODO */
public static final QName priority = new QName(namespace, "priority");
/** * * * CALENDAR*/
public static final QName prodid = new QName(namespace, "prodid");
/** VEVENT VTODO VJOURNAL * VTIMEZONE */
public static final QName rdate = new QName(namespace, "rdate");
/** VEVENT VTODO VJOURNAL * VTIMEZONE */
public static final QName recurrenceId = new QName(namespace,
"recurrence-id");
/** VEVENT VTODO VJOURNAL */
public static final QName relatedTo = new QName(namespace,
"related-to");
/** * * * * * VALARM */
public static final QName repeat = new QName(namespace, "repeat");
/** VEVENT VTODO */
public static final QName resources = new QName(namespace, "resources");
/** VEVENT VTODO VJOURNAL VFREEBUSY */
public static final QName requestStatus = new QName(namespace,
"request-status");
/** VEVENT VTODO VJOURNAL * VTIMEZONE */
public static final QName rrule = new QName(namespace, "rrule");
/** VEVENT VTODO VJOURNAL */
public static final QName sequence = new QName(namespace, "sequence");
/** VEVENT VTODO VJOURNAL */
public static final QName status = new QName(namespace, "status");
/** VEVENT VTODO VJOURNAL * * VALARM */
public static final QName summary = new QName(namespace, "summary");
/** VEVENT */
public static final QName transp = new QName(namespace, "transp");
/** VEVENT VTODO * * * VALARM */
public static final QName trigger = new QName(namespace, "trigger");
/** * * * * VTIMEZONE */
public static final QName tzid = new QName(namespace, "tzid");
/** * * * VTIMEZONE */
public static final QName tzname = new QName(namespace, "tzname");
/** * * * * VTIMEZONE */
public static final QName tzoffsetfrom = new QName(namespace, "tzoffsetfrom");
/** * * * * VTIMEZONE */
public static final QName tzoffsetto = new QName(namespace, "tzoffsetto");
/** * * * * VTIMEZONE */
public static final QName tzurl = new QName(namespace, "tzurl");
/** VEVENT VTODO VJOURNAL VFREEBUSY */
public static final QName uid = new QName(namespace, "uid");
/** VEVENT VTODO VJOURNAL VFREEBUSY */
public static final QName url = new QName(namespace, "url");
/** * * * * * CALENDAR*/
public static final QName version = new QName(namespace, "version");
/** VAVAILABILITY only */
public static final QName busytype = new QName(namespace, "busytype");
/* =====================================================================
x-properties in the schema
===================================================================== */
/** */
public static final QName xBedeworkCategories =
new QName(namespace, "x-bedework-categories");
/** */
public static final QName xBedeworkCost = new QName(namespace, "x-bedework-cost");
/** */
public static final QName xBedeworkLocation = new QName(namespace, "x-bedework-location");
/** parameter */
public static final QName xBedeworkLocationKey =
new QName(namespace, "x-bedework-loc-key");
/** */
public static final QName xBedeworkContact = new QName(namespace, "x-bedework-contact");
}
|
Bedework/bw-util
|
bw-util-xml/src/main/java/org/bedework/util/xml/tagdefs/XcalTags.java
|
Java
|
apache-2.0
| 16,346
|
/*
* 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.flink.metrics.datadog;
import org.apache.flink.shaded.jackson2.com.fasterxml.jackson.core.JsonProcessingException;
import org.apache.flink.shaded.jackson2.com.fasterxml.jackson.databind.ObjectMapper;
import okhttp3.MediaType;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.RequestBody;
import okhttp3.Response;
import java.io.IOException;
import java.util.concurrent.TimeUnit;
/**
* Http client talking to Datadog.
*/
public class DatadogHttpClient{
private static final String SERIES_URL_FORMAT = "https://app.datadoghq.com/api/v1/series?api_key=%s";
private static final String VALIDATE_URL_FORMAT = "https://app.datadoghq.com/api/v1/validate?api_key=%s";
private static final MediaType MEDIA_TYPE = MediaType.parse("application/json; charset=utf-8");
private static final int TIMEOUT = 3;
private static final ObjectMapper MAPPER = new ObjectMapper();
private final String seriesUrl;
private final String validateUrl;
private final OkHttpClient client;
private final String apiKey;
public DatadogHttpClient(String dgApiKey) {
if (dgApiKey == null || dgApiKey.isEmpty()) {
throw new IllegalArgumentException("Invalid API key:" + dgApiKey);
}
apiKey = dgApiKey;
client = new OkHttpClient.Builder()
.connectTimeout(TIMEOUT, TimeUnit.SECONDS)
.writeTimeout(TIMEOUT, TimeUnit.SECONDS)
.readTimeout(TIMEOUT, TimeUnit.SECONDS)
.build();
seriesUrl = String.format(SERIES_URL_FORMAT, apiKey);
validateUrl = String.format(VALIDATE_URL_FORMAT, apiKey);
validateApiKey();
}
private void validateApiKey() {
Request r = new Request.Builder().url(validateUrl).get().build();
try (Response response = client.newCall(r).execute()) {
if (!response.isSuccessful()) {
throw new IllegalArgumentException(
String.format("API key: %s is invalid", apiKey));
}
} catch (IOException e) {
throw new IllegalStateException("Failed contacting Datadog to validate API key", e);
}
}
public void send(DatadogHttpReporter.DatadogHttpRequest request) throws Exception {
String postBody = serialize(request.getSeries());
Request r = new Request.Builder()
.url(seriesUrl)
.post(RequestBody.create(MEDIA_TYPE, postBody))
.build();
client.newCall(r).execute().close();
}
public static String serialize(Object obj) throws JsonProcessingException {
return MAPPER.writeValueAsString(obj);
}
public void close() {
client.dispatcher().executorService().shutdown();
client.connectionPool().evictAll();
}
}
|
zimmermatt/flink
|
flink-metrics/flink-metrics-datadog/src/main/java/org/apache/flink/metrics/datadog/DatadogHttpClient.java
|
Java
|
apache-2.0
| 3,323
|
npm install
git clone https://github.com/xiangming/landscape-plus.git themes/landscape-plus
|
PingHackers/blog
|
init.bat
|
Batchfile
|
apache-2.0
| 92
|
// Copyright (c) 2008-2018, Hazelcast, Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
using System;
using System.Text;
namespace Hazelcast.Security
{
/// <summary>
/// Simple implementation of
/// <see cref="ICredentials">ICredentials</see>
/// using
/// username and password as security attributes.
/// </summary>
[Serializable]
internal class UsernamePasswordCredentials : AbstractCredentials
{
private byte[] _password;
public UsernamePasswordCredentials()
{
}
public UsernamePasswordCredentials(string username, string password) : base(username)
{
_password = Encoding.UTF8.GetBytes(password);
}
public virtual string GetPassword()
{
return _password == null ? string.Empty : Encoding.UTF8.GetString(_password);
}
public virtual string GetUsername()
{
return GetPrincipal();
}
public virtual void SetPassword(string password)
{
_password = Encoding.UTF8.GetBytes(password);
}
public virtual void SetUsername(string username)
{
SetPrincipal(username);
}
public override string ToString()
{
return "UsernamePasswordCredentials [username=" + GetUsername() + "]";
}
}
}
|
asimarslan/hazelcast-csharp-client
|
Hazelcast.Net/Hazelcast.Security/UsernamePasswordCredentials.cs
|
C#
|
apache-2.0
| 1,919
|
#
# Author:: Daniel DeLeo (<dan@opscode.com>)
# Copyright:: Copyright (c) 2012 Opscode, Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
require 'spec_helper'
require "chef/node/immutable_collections"
describe Chef::Node::ImmutableMash do
before do
@data_in = {top: {second_level: "some value"},
"top_level_2" => %w[array of values],
top_level_3: [{hash_array: 1, hash_array_b: 2}],
top_level_4: {level2: {key: "value"}}
}
@immutable_mash = Chef::Node::ImmutableMash.new(@data_in)
end
it "element references like regular hash" do
expect(@immutable_mash[:top][:second_level]).to eq("some value")
end
it "element references like a regular Mash" do
expect(@immutable_mash[:top_level_2]).to eq(%w[array of values])
end
it "converts Hash-like inputs into ImmutableMash's" do
expect(@immutable_mash[:top]).to be_a(Chef::Node::ImmutableMash)
end
it "converts array inputs into ImmutableArray's" do
expect(@immutable_mash[:top_level_2]).to be_a(Chef::Node::ImmutableArray)
end
it "converts arrays of hashes to ImmutableArray's of ImmutableMashes" do
expect(@immutable_mash[:top_level_3].first).to be_a(Chef::Node::ImmutableMash)
end
it "converts nested hashes to ImmutableMashes" do
expect(@immutable_mash[:top_level_4]).to be_a(Chef::Node::ImmutableMash)
expect(@immutable_mash[:top_level_4][:level2]).to be_a(Chef::Node::ImmutableMash)
end
describe "to_hash" do
before do
@copy = @immutable_mash.to_hash
end
it "converts an immutable mash to a new mutable hash" do
expect(@copy).to be_instance_of(Hash)
end
it "converts an immutable nested mash to a new mutable hash" do
expect(@copy['top_level_4']['level2']).to be_instance_of(Hash)
end
it "converts an immutable nested array to a new mutable array" do
expect(@copy['top_level_2']).to be_instance_of(Array)
end
it "should create a mash with the same content" do
expect(@copy).to eq(@immutable_mash)
end
it 'should allow mutation' do
expect { @copy['m'] = 'm' }.not_to raise_error
end
end
[
:[]=,
:clear,
:default=,
:default_proc=,
:delete,
:delete_if,
:keep_if,
:merge!,
:update,
:reject!,
:replace,
:select!,
:shift
].each do |mutator|
it "doesn't allow mutation via `#{mutator}'" do
expect { @immutable_mash.send(mutator) }.to raise_error
end
end
it "returns a mutable version of itself when duped" do
mutable = @immutable_mash.dup
mutable[:new_key] = :value
expect(mutable[:new_key]).to eq(:value)
end
end
describe Chef::Node::ImmutableArray do
before do
@immutable_array = Chef::Node::ImmutableArray.new(%w[foo bar baz] + Array(1..3) + [nil, true, false, [ "el", 0, nil ] ])
immutable_mash = Chef::Node::ImmutableMash.new({m: 'm'})
@immutable_nested_array = Chef::Node::ImmutableArray.new(["level1",@immutable_array, immutable_mash])
end
##
# Note: other behaviors, such as immutibilizing input data, are tested along
# with ImmutableMash, above
###
[
:<<,
:[]=,
:clear,
:collect!,
:compact!,
:default=,
:default_proc=,
:delete,
:delete_at,
:delete_if,
:fill,
:flatten!,
:insert,
:keep_if,
:map!,
:merge!,
:pop,
:push,
:update,
:reject!,
:reverse!,
:replace,
:select!,
:shift,
:slice!,
:sort!,
:sort_by!,
:uniq!,
:unshift
].each do |mutator|
it "does not allow mutation via `#{mutator}" do
expect { @immutable_array.send(mutator)}.to raise_error
end
end
it "can be duped even if some elements can't" do
@immutable_array.dup
end
it "returns a mutable version of itself when duped" do
mutable = @immutable_array.dup
mutable[0] = :value
expect(mutable[0]).to eq(:value)
end
describe "to_a" do
before do
@copy = @immutable_nested_array.to_a
end
it "converts an immutable array to a new mutable array" do
expect(@copy).to be_instance_of(Array)
end
it "converts an immutable nested array to a new mutable array" do
expect(@copy[1]).to be_instance_of(Array)
end
it "converts an immutable nested mash to a new mutable hash" do
expect(@copy[2]).to be_instance_of(Hash)
end
it "should create an array with the same content" do
expect(@copy).to eq(@immutable_nested_array)
end
it 'should allow mutation' do
expect { @copy << 'm' }.not_to raise_error
end
end
end
|
askl56/chef
|
spec/unit/node/immutable_collections_spec.rb
|
Ruby
|
apache-2.0
| 5,140
|
using CodeGenerator.Metadata;
namespace CodeGenerator.CodeGen
{
public interface ICodeGenretorModule
{
void Generate(Domain domain, string outputCppDir, string outputCsDir);
}
}
|
mrkriv/UnrealDotNet
|
Plugins/UnrealDotNet/Source/CodeGenerator/CodeGen/ICodeGenretorModule.cs
|
C#
|
apache-2.0
| 201
|
.ff0{font-family:sans-serif;visibility:hidden;}
@font-face{font-family:ff1;src:url(f1.woff)format("woff");}.ff1{font-family:ff1;line-height:1.589369;font-style:normal;font-weight:normal;visibility:visible;}
@font-face{font-family:ff2;src:url(f2.woff)format("woff");}.ff2{font-family:ff2;line-height:1.695312;font-style:normal;font-weight:normal;visibility:visible;}
@font-face{font-family:ff3;src:url(f3.woff)format("woff");}.ff3{font-family:ff3;line-height:1.695312;font-style:normal;font-weight:normal;visibility:visible;}
.m0{transform:matrix(0.250000,0.000000,0.000000,0.250000,0,0);-ms-transform:matrix(0.250000,0.000000,0.000000,0.250000,0,0);-webkit-transform:matrix(0.250000,0.000000,0.000000,0.250000,0,0);}
.m1{transform:none;-ms-transform:none;-webkit-transform:none;}
.v0{vertical-align:0.000000px;}
.ls0{letter-spacing:0.000000px;}
.sc_{text-shadow:none;}
.sc0{text-shadow:-0.015em 0 transparent,0 0.015em transparent,0.015em 0 transparent,0 -0.015em transparent;}
@media screen and (-webkit-min-device-pixel-ratio:0){
.sc_{-webkit-text-stroke:0px transparent;}
.sc0{-webkit-text-stroke:0.015em transparent;text-shadow:none;}
}
.ws0{word-spacing:0.000000px;}
.fc2{color:rgb(33,78,123);}
.fc1{color:rgb(255,0,0);}
.fc0{color:rgb(0,0,0);}
.fs3{font-size:48.000000px;}
.fs2{font-size:56.000000px;}
.fs1{font-size:60.000000px;}
.fs0{font-size:80.000000px;}
.y6{bottom:17.000000px;}
.y34{bottom:22.000000px;}
.y7{bottom:35.500000px;}
.y32{bottom:54.000000px;}
.y52{bottom:54.830000px;}
.ye2{bottom:55.690000px;}
.ycd{bottom:58.090000px;}
.ya4{bottom:60.000000px;}
.y79{bottom:70.000000px;}
.y95{bottom:70.940000px;}
.y31{bottom:72.000000px;}
.y51{bottom:72.830000px;}
.ye1{bottom:73.690000px;}
.ya3{bottom:76.000000px;}
.ycc{bottom:76.090000px;}
.y78{bottom:88.000000px;}
.y94{bottom:88.940000px;}
.y50{bottom:90.830000px;}
.ye0{bottom:91.690000px;}
.y30{bottom:92.000000px;}
.ycb{bottom:94.090000px;}
.y77{bottom:106.000000px;}
.y93{bottom:106.940000px;}
.ya2{bottom:108.000000px;}
.y4f{bottom:108.830000px;}
.ydf{bottom:109.690000px;}
.y2f{bottom:110.000000px;}
.yca{bottom:112.090000px;}
.ya1{bottom:120.000000px;}
.yde{bottom:121.690000px;}
.y76{bottom:124.000000px;}
.y92{bottom:124.940000px;}
.y4e{bottom:126.830000px;}
.y2e{bottom:128.000000px;}
.yc9{bottom:130.090000px;}
.ya0{bottom:132.000000px;}
.ydd{bottom:137.690000px;}
.y75{bottom:142.000000px;}
.y91{bottom:142.940000px;}
.y4d{bottom:144.830000px;}
.y2d{bottom:146.000000px;}
.y9f{bottom:148.000000px;}
.yc8{bottom:148.090000px;}
.ydc{bottom:153.690000px;}
.y74{bottom:160.000000px;}
.y90{bottom:160.940000px;}
.y4c{bottom:162.830000px;}
.y2c{bottom:164.000000px;}
.yc7{bottom:166.090000px;}
.ydb{bottom:169.690000px;}
.y9e{bottom:176.000000px;}
.y73{bottom:178.000000px;}
.y8f{bottom:178.940000px;}
.y4b{bottom:180.830000px;}
.yb8{bottom:180.900000px;}
.y2b{bottom:182.000000px;}
.yc6{bottom:184.090000px;}
.yda{bottom:185.690000px;}
.y9d{bottom:188.000000px;}
.y72{bottom:196.000000px;}
.y8e{bottom:196.940000px;}
.yff{bottom:198.000000px;}
.y4a{bottom:198.830000px;}
.yb7{bottom:198.900000px;}
.y2a{bottom:200.000000px;}
.yd9{bottom:201.690000px;}
.yc5{bottom:202.090000px;}
.y9c{bottom:204.000000px;}
.yfe{bottom:210.000000px;}
.y71{bottom:214.000000px;}
.y8d{bottom:214.940000px;}
.y49{bottom:216.830000px;}
.yb6{bottom:216.900000px;}
.yd8{bottom:217.690000px;}
.y29{bottom:218.000000px;}
.y9b{bottom:220.000000px;}
.yc4{bottom:220.090000px;}
.yfd{bottom:222.000000px;}
.y8c{bottom:226.940000px;}
.y70{bottom:232.000000px;}
.yd7{bottom:233.690000px;}
.y48{bottom:234.830000px;}
.yb5{bottom:234.900000px;}
.y28{bottom:236.000000px;}
.yfc{bottom:238.000000px;}
.yc3{bottom:238.090000px;}
.y8b{bottom:242.940000px;}
.y47{bottom:246.830000px;}
.yd6{bottom:249.690000px;}
.y6f{bottom:250.000000px;}
.yb4{bottom:252.900000px;}
.y27{bottom:254.000000px;}
.yc2{bottom:256.090000px;}
.y8a{bottom:258.940000px;}
.yd5{bottom:261.690000px;}
.y46{bottom:262.830000px;}
.y6e{bottom:268.000000px;}
.y26{bottom:272.000000px;}
.yd4{bottom:273.690000px;}
.yc1{bottom:274.090000px;}
.y89{bottom:274.940000px;}
.y45{bottom:278.830000px;}
.y6d{bottom:286.000000px;}
.yfb{bottom:288.000000px;}
.yd3{bottom:289.690000px;}
.y25{bottom:290.000000px;}
.y88{bottom:290.940000px;}
.yc0{bottom:292.090000px;}
.y44{bottom:294.830000px;}
.yd2{bottom:301.690000px;}
.y6c{bottom:304.000000px;}
.yfa{bottom:306.000000px;}
.y87{bottom:306.940000px;}
.y24{bottom:308.000000px;}
.ybf{bottom:310.090000px;}
.y43{bottom:310.830000px;}
.yd1{bottom:317.690000px;}
.y86{bottom:318.940000px;}
.y6b{bottom:322.000000px;}
.yf9{bottom:324.000000px;}
.y23{bottom:326.000000px;}
.y42{bottom:326.830000px;}
.ybe{bottom:328.090000px;}
.yd0{bottom:329.690000px;}
.y85{bottom:330.940000px;}
.y5{bottom:338.500000px;}
.y41{bottom:338.830000px;}
.y6a{bottom:340.000000px;}
.yf8{bottom:342.000000px;}
.y22{bottom:344.000000px;}
.ycf{bottom:345.690000px;}
.ybd{bottom:346.090000px;}
.y84{bottom:346.940000px;}
.y40{bottom:350.830000px;}
.yce{bottom:357.690000px;}
.y69{bottom:358.000000px;}
.y83{bottom:358.940000px;}
.yf7{bottom:360.000000px;}
.y4{bottom:361.000000px;}
.y21{bottom:362.000000px;}
.ybc{bottom:364.090000px;}
.y3f{bottom:366.830000px;}
.y82{bottom:374.940000px;}
.y68{bottom:376.000000px;}
.yf6{bottom:378.000000px;}
.y20{bottom:380.000000px;}
.ybb{bottom:382.090000px;}
.y3e{bottom:382.830000px;}
.y81{bottom:386.940000px;}
.y67{bottom:388.000000px;}
.y3{bottom:391.000000px;}
.y3d{bottom:394.830000px;}
.yf5{bottom:396.000000px;}
.y1f{bottom:398.000000px;}
.yba{bottom:400.090000px;}
.y80{bottom:402.940000px;}
.y66{bottom:404.000000px;}
.y3c{bottom:410.830000px;}
.yf4{bottom:414.000000px;}
.y7f{bottom:414.940000px;}
.y1e{bottom:416.000000px;}
.yb9{bottom:418.090000px;}
.y65{bottom:420.000000px;}
.y3b{bottom:422.830000px;}
.yf3{bottom:432.000000px;}
.y1d{bottom:434.000000px;}
.y64{bottom:436.000000px;}
.y3a{bottom:438.830000px;}
.yf2{bottom:450.000000px;}
.y1c{bottom:452.000000px;}
.y39{bottom:454.830000px;}
.y38{bottom:466.830000px;}
.y63{bottom:468.000000px;}
.y1b{bottom:470.000000px;}
.y0{bottom:470.500000px;}
.y62{bottom:480.000000px;}
.yf1{bottom:486.000000px;}
.y1a{bottom:488.000000px;}
.y61{bottom:492.000000px;}
.yf0{bottom:498.000000px;}
.y19{bottom:506.000000px;}
.y60{bottom:508.000000px;}
.yb3{bottom:514.000000px;}
.y18{bottom:524.000000px;}
.yef{bottom:530.000000px;}
.yb2{bottom:532.000000px;}
.y5f{bottom:540.000000px;}
.y17{bottom:542.000000px;}
.yee{bottom:546.000000px;}
.yb1{bottom:550.000000px;}
.y5e{bottom:552.000000px;}
.y16{bottom:560.000000px;}
.yed{bottom:562.000000px;}
.yb0{bottom:568.000000px;}
.y5d{bottom:570.000000px;}
.y15{bottom:578.000000px;}
.yaf{bottom:586.000000px;}
.y5c{bottom:590.000000px;}
.y14{bottom:596.000000px;}
.yec{bottom:602.000000px;}
.yae{bottom:604.000000px;}
.y13{bottom:608.000000px;}
.yeb{bottom:618.000000px;}
.y7e{bottom:620.000000px;}
.yad{bottom:622.000000px;}
.y12{bottom:624.000000px;}
.y5b{bottom:626.000000px;}
.yea{bottom:630.000000px;}
.y7d{bottom:632.000000px;}
.y2{bottom:636.000000px;}
.y11{bottom:640.000000px;}
.y5a{bottom:644.000000px;}
.ye9{bottom:646.000000px;}
.y7c{bottom:648.000000px;}
.y10{bottom:656.000000px;}
.yac{bottom:658.000000px;}
.y7b{bottom:660.000000px;}
.y59{bottom:662.000000px;}
.yf{bottom:672.000000px;}
.y9a{bottom:674.000000px;}
.yab{bottom:676.000000px;}
.y7a{bottom:678.000000px;}
.y58{bottom:680.000000px;}
.y99{bottom:686.000000px;}
.ye{bottom:688.000000px;}
.ye8{bottom:690.000000px;}
.yaa{bottom:694.000000px;}
.y57{bottom:698.000000px;}
.y98{bottom:702.000000px;}
.yd{bottom:704.000000px;}
.ye7{bottom:706.000000px;}
.ya9{bottom:712.000000px;}
.y97{bottom:714.000000px;}
.y56{bottom:716.000000px;}
.yc{bottom:720.000000px;}
.ye6{bottom:722.000000px;}
.ya8{bottom:730.000000px;}
.y96{bottom:732.000000px;}
.y55{bottom:734.000000px;}
.yb{bottom:736.000000px;}
.ye5{bottom:738.000000px;}
.ya7{bottom:742.000000px;}
.ya{bottom:748.000000px;}
.ye4{bottom:750.000000px;}
.y54{bottom:752.000000px;}
.ya6{bottom:758.000000px;}
.y9{bottom:760.000000px;}
.y37{bottom:766.000000px;}
.ye3{bottom:768.000000px;}
.y53{bottom:770.000000px;}
.ya5{bottom:774.000000px;}
.y1{bottom:776.000000px;}
.y36{bottom:778.000000px;}
.y8{bottom:788.000000px;}
.y35{bottom:790.000000px;}
.y33{bottom:808.000000px;}
.h6{height:56.367840px;}
.h7{height:59.156250px;}
.h4{height:69.015625px;}
.h3{height:70.459800px;}
.h2{height:93.946400px;}
.h1{height:150.500000px;}
.h5{height:770.500000px;}
.h0{height:842.000000px;}
.w1{width:450.500000px;}
.w2{width:523.500000px;}
.w0{width:595.000000px;}
.x1{left:36.000000px;}
.x2{left:71.340000px;}
.x0{left:72.500000px;}
.x5{left:241.810000px;}
.x4{left:245.000000px;}
.x3{left:254.980000px;}
.x7{left:543.660000px;}
.x6{left:550.330000px;}
@media print{
.v0{vertical-align:0.000000pt;}
.ls0{letter-spacing:0.000000pt;}
.ws0{word-spacing:0.000000pt;}
.fs3{font-size:64.000000pt;}
.fs2{font-size:74.666667pt;}
.fs1{font-size:80.000000pt;}
.fs0{font-size:106.666667pt;}
.y6{bottom:22.666667pt;}
.y34{bottom:29.333333pt;}
.y7{bottom:47.333333pt;}
.y32{bottom:72.000000pt;}
.y52{bottom:73.106667pt;}
.ye2{bottom:74.253333pt;}
.ycd{bottom:77.453333pt;}
.ya4{bottom:80.000000pt;}
.y79{bottom:93.333333pt;}
.y95{bottom:94.586667pt;}
.y31{bottom:96.000000pt;}
.y51{bottom:97.106667pt;}
.ye1{bottom:98.253333pt;}
.ya3{bottom:101.333333pt;}
.ycc{bottom:101.453333pt;}
.y78{bottom:117.333333pt;}
.y94{bottom:118.586667pt;}
.y50{bottom:121.106667pt;}
.ye0{bottom:122.253333pt;}
.y30{bottom:122.666667pt;}
.ycb{bottom:125.453333pt;}
.y77{bottom:141.333333pt;}
.y93{bottom:142.586667pt;}
.ya2{bottom:144.000000pt;}
.y4f{bottom:145.106667pt;}
.ydf{bottom:146.253333pt;}
.y2f{bottom:146.666667pt;}
.yca{bottom:149.453333pt;}
.ya1{bottom:160.000000pt;}
.yde{bottom:162.253333pt;}
.y76{bottom:165.333333pt;}
.y92{bottom:166.586667pt;}
.y4e{bottom:169.106667pt;}
.y2e{bottom:170.666667pt;}
.yc9{bottom:173.453333pt;}
.ya0{bottom:176.000000pt;}
.ydd{bottom:183.586667pt;}
.y75{bottom:189.333333pt;}
.y91{bottom:190.586667pt;}
.y4d{bottom:193.106667pt;}
.y2d{bottom:194.666667pt;}
.y9f{bottom:197.333333pt;}
.yc8{bottom:197.453333pt;}
.ydc{bottom:204.920000pt;}
.y74{bottom:213.333333pt;}
.y90{bottom:214.586667pt;}
.y4c{bottom:217.106667pt;}
.y2c{bottom:218.666667pt;}
.yc7{bottom:221.453333pt;}
.ydb{bottom:226.253333pt;}
.y9e{bottom:234.666667pt;}
.y73{bottom:237.333333pt;}
.y8f{bottom:238.586667pt;}
.y4b{bottom:241.106667pt;}
.yb8{bottom:241.200000pt;}
.y2b{bottom:242.666667pt;}
.yc6{bottom:245.453333pt;}
.yda{bottom:247.586667pt;}
.y9d{bottom:250.666667pt;}
.y72{bottom:261.333333pt;}
.y8e{bottom:262.586667pt;}
.yff{bottom:264.000000pt;}
.y4a{bottom:265.106667pt;}
.yb7{bottom:265.200000pt;}
.y2a{bottom:266.666667pt;}
.yd9{bottom:268.920000pt;}
.yc5{bottom:269.453333pt;}
.y9c{bottom:272.000000pt;}
.yfe{bottom:280.000000pt;}
.y71{bottom:285.333333pt;}
.y8d{bottom:286.586667pt;}
.y49{bottom:289.106667pt;}
.yb6{bottom:289.200000pt;}
.yd8{bottom:290.253333pt;}
.y29{bottom:290.666667pt;}
.y9b{bottom:293.333333pt;}
.yc4{bottom:293.453333pt;}
.yfd{bottom:296.000000pt;}
.y8c{bottom:302.586667pt;}
.y70{bottom:309.333333pt;}
.yd7{bottom:311.586667pt;}
.y48{bottom:313.106667pt;}
.yb5{bottom:313.200000pt;}
.y28{bottom:314.666667pt;}
.yfc{bottom:317.333333pt;}
.yc3{bottom:317.453333pt;}
.y8b{bottom:323.920000pt;}
.y47{bottom:329.106667pt;}
.yd6{bottom:332.920000pt;}
.y6f{bottom:333.333333pt;}
.yb4{bottom:337.200000pt;}
.y27{bottom:338.666667pt;}
.yc2{bottom:341.453333pt;}
.y8a{bottom:345.253333pt;}
.yd5{bottom:348.920000pt;}
.y46{bottom:350.440000pt;}
.y6e{bottom:357.333333pt;}
.y26{bottom:362.666667pt;}
.yd4{bottom:364.920000pt;}
.yc1{bottom:365.453333pt;}
.y89{bottom:366.586667pt;}
.y45{bottom:371.773333pt;}
.y6d{bottom:381.333333pt;}
.yfb{bottom:384.000000pt;}
.yd3{bottom:386.253333pt;}
.y25{bottom:386.666667pt;}
.y88{bottom:387.920000pt;}
.yc0{bottom:389.453333pt;}
.y44{bottom:393.106667pt;}
.yd2{bottom:402.253333pt;}
.y6c{bottom:405.333333pt;}
.yfa{bottom:408.000000pt;}
.y87{bottom:409.253333pt;}
.y24{bottom:410.666667pt;}
.ybf{bottom:413.453333pt;}
.y43{bottom:414.440000pt;}
.yd1{bottom:423.586667pt;}
.y86{bottom:425.253333pt;}
.y6b{bottom:429.333333pt;}
.yf9{bottom:432.000000pt;}
.y23{bottom:434.666667pt;}
.y42{bottom:435.773333pt;}
.ybe{bottom:437.453333pt;}
.yd0{bottom:439.586667pt;}
.y85{bottom:441.253333pt;}
.y5{bottom:451.333333pt;}
.y41{bottom:451.773333pt;}
.y6a{bottom:453.333333pt;}
.yf8{bottom:456.000000pt;}
.y22{bottom:458.666667pt;}
.ycf{bottom:460.920000pt;}
.ybd{bottom:461.453333pt;}
.y84{bottom:462.586667pt;}
.y40{bottom:467.773333pt;}
.yce{bottom:476.920000pt;}
.y69{bottom:477.333333pt;}
.y83{bottom:478.586667pt;}
.yf7{bottom:480.000000pt;}
.y4{bottom:481.333333pt;}
.y21{bottom:482.666667pt;}
.ybc{bottom:485.453333pt;}
.y3f{bottom:489.106667pt;}
.y82{bottom:499.920000pt;}
.y68{bottom:501.333333pt;}
.yf6{bottom:504.000000pt;}
.y20{bottom:506.666667pt;}
.ybb{bottom:509.453333pt;}
.y3e{bottom:510.440000pt;}
.y81{bottom:515.920000pt;}
.y67{bottom:517.333333pt;}
.y3{bottom:521.333333pt;}
.y3d{bottom:526.440000pt;}
.yf5{bottom:528.000000pt;}
.y1f{bottom:530.666667pt;}
.yba{bottom:533.453333pt;}
.y80{bottom:537.253333pt;}
.y66{bottom:538.666667pt;}
.y3c{bottom:547.773333pt;}
.yf4{bottom:552.000000pt;}
.y7f{bottom:553.253333pt;}
.y1e{bottom:554.666667pt;}
.yb9{bottom:557.453333pt;}
.y65{bottom:560.000000pt;}
.y3b{bottom:563.773333pt;}
.yf3{bottom:576.000000pt;}
.y1d{bottom:578.666667pt;}
.y64{bottom:581.333333pt;}
.y3a{bottom:585.106667pt;}
.yf2{bottom:600.000000pt;}
.y1c{bottom:602.666667pt;}
.y39{bottom:606.440000pt;}
.y38{bottom:622.440000pt;}
.y63{bottom:624.000000pt;}
.y1b{bottom:626.666667pt;}
.y0{bottom:627.333333pt;}
.y62{bottom:640.000000pt;}
.yf1{bottom:648.000000pt;}
.y1a{bottom:650.666667pt;}
.y61{bottom:656.000000pt;}
.yf0{bottom:664.000000pt;}
.y19{bottom:674.666667pt;}
.y60{bottom:677.333333pt;}
.yb3{bottom:685.333333pt;}
.y18{bottom:698.666667pt;}
.yef{bottom:706.666667pt;}
.yb2{bottom:709.333333pt;}
.y5f{bottom:720.000000pt;}
.y17{bottom:722.666667pt;}
.yee{bottom:728.000000pt;}
.yb1{bottom:733.333333pt;}
.y5e{bottom:736.000000pt;}
.y16{bottom:746.666667pt;}
.yed{bottom:749.333333pt;}
.yb0{bottom:757.333333pt;}
.y5d{bottom:760.000000pt;}
.y15{bottom:770.666667pt;}
.yaf{bottom:781.333333pt;}
.y5c{bottom:786.666667pt;}
.y14{bottom:794.666667pt;}
.yec{bottom:802.666667pt;}
.yae{bottom:805.333333pt;}
.y13{bottom:810.666667pt;}
.yeb{bottom:824.000000pt;}
.y7e{bottom:826.666667pt;}
.yad{bottom:829.333333pt;}
.y12{bottom:832.000000pt;}
.y5b{bottom:834.666667pt;}
.yea{bottom:840.000000pt;}
.y7d{bottom:842.666667pt;}
.y2{bottom:848.000000pt;}
.y11{bottom:853.333333pt;}
.y5a{bottom:858.666667pt;}
.ye9{bottom:861.333333pt;}
.y7c{bottom:864.000000pt;}
.y10{bottom:874.666667pt;}
.yac{bottom:877.333333pt;}
.y7b{bottom:880.000000pt;}
.y59{bottom:882.666667pt;}
.yf{bottom:896.000000pt;}
.y9a{bottom:898.666667pt;}
.yab{bottom:901.333333pt;}
.y7a{bottom:904.000000pt;}
.y58{bottom:906.666667pt;}
.y99{bottom:914.666667pt;}
.ye{bottom:917.333333pt;}
.ye8{bottom:920.000000pt;}
.yaa{bottom:925.333333pt;}
.y57{bottom:930.666667pt;}
.y98{bottom:936.000000pt;}
.yd{bottom:938.666667pt;}
.ye7{bottom:941.333333pt;}
.ya9{bottom:949.333333pt;}
.y97{bottom:952.000000pt;}
.y56{bottom:954.666667pt;}
.yc{bottom:960.000000pt;}
.ye6{bottom:962.666667pt;}
.ya8{bottom:973.333333pt;}
.y96{bottom:976.000000pt;}
.y55{bottom:978.666667pt;}
.yb{bottom:981.333333pt;}
.ye5{bottom:984.000000pt;}
.ya7{bottom:989.333333pt;}
.ya{bottom:997.333333pt;}
.ye4{bottom:1000.000000pt;}
.y54{bottom:1002.666667pt;}
.ya6{bottom:1010.666667pt;}
.y9{bottom:1013.333333pt;}
.y37{bottom:1021.333333pt;}
.ye3{bottom:1024.000000pt;}
.y53{bottom:1026.666667pt;}
.ya5{bottom:1032.000000pt;}
.y1{bottom:1034.666667pt;}
.y36{bottom:1037.333333pt;}
.y8{bottom:1050.666667pt;}
.y35{bottom:1053.333333pt;}
.y33{bottom:1077.333333pt;}
.h6{height:75.157120pt;}
.h7{height:78.875000pt;}
.h4{height:92.020833pt;}
.h3{height:93.946400pt;}
.h2{height:125.261866pt;}
.h1{height:200.666667pt;}
.h5{height:1027.333333pt;}
.h0{height:1122.666667pt;}
.w1{width:600.666667pt;}
.w2{width:698.000000pt;}
.w0{width:793.333333pt;}
.x1{left:48.000000pt;}
.x2{left:95.120000pt;}
.x0{left:96.666667pt;}
.x5{left:322.413333pt;}
.x4{left:326.666667pt;}
.x3{left:339.973333pt;}
.x7{left:724.880000pt;}
.x6{left:733.773333pt;}
}
|
braindumps/all_braindumps
|
642-648.css
|
CSS
|
apache-2.0
| 16,304
|
FROM tailordev/pandas
ADD . /
RUN pip install -r requirements.txt
ENTRYPOINT ["/run.sh"]
|
Scaravex/clue-hackathon
|
Dockerfile
|
Dockerfile
|
apache-2.0
| 95
|
# Arabis nasturtium [C SPECIES
#### Status
ACCEPTED
#### According to
International Plant Names Index
#### Published in
null
#### Original name
null
### Remarks
null
|
mdoering/backbone
|
life/Plantae/Magnoliophyta/Magnoliopsida/Brassicales/Brassicaceae/Arabis/Arabis nasturtium/README.md
|
Markdown
|
apache-2.0
| 170
|
# Dicranum rhabdocarpum Sullivant, 1849 SPECIES
#### Status
ACCEPTED
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null
|
mdoering/backbone
|
life/Plantae/Bryophyta/Bryopsida/Dicranales/Dicranaceae/Dicranum/Dicranum rhabdocarpum/README.md
|
Markdown
|
apache-2.0
| 195
|
# Cassia wislizenii A.Gray 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/Fabales/Fabaceae/Senna/Senna wislizeni/ Syn. Cassia wislizenii/README.md
|
Markdown
|
apache-2.0
| 181
|
/*
* Copyright 2021 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.
*/
package com.google.cloud.solutions.transformation;
import com.google.api.services.bigquery.model.TableFieldSchema;
import com.google.api.services.bigquery.model.TableRow;
import com.google.cloud.solutions.common.TableRowWithMessageInfo;
import com.google.cloud.solutions.utils.TableSchemaLoader;
import java.util.Map;
import org.apache.beam.sdk.transforms.SerializableFunction;
import org.joda.time.DateTimeZone;
import org.joda.time.Instant;
import org.joda.time.format.DateTimeFormat;
import org.joda.time.format.DateTimeFormatter;
/**
* Transforms the row map in {@link TableRowWithMessageInfo} to BigQuery {@link TableRow} object The
* the BigQuery table schema is provided dynamically by {@link TableSchemaLoader} Following BigQuery
* data types are supported:
*
* <p>
*
* <ul>
* <li>STRING
* <li>INT64
* <li>FLOAT
* <li>TIMESTAMP
* </ul>
*
* <p>
*/
public class DynamicMessageTableRowMapper
implements SerializableFunction<TableRowWithMessageInfo, TableRow> {
private static final long serialVersionUID = 6891268007272455587L;
private static DateTimeFormatter TIME_STAMP_FORMAT =
DateTimeFormat.forPattern("yyyy-MM-dd HH:mm:ss.SSSSSS").withZone(DateTimeZone.forID("UTC"));
@Override
public TableRow apply(TableRowWithMessageInfo input) {
Map<String, TableFieldSchema> tableSchema =
TableSchemaLoader.getFieldMap(input.getMessageInfo());
return toTableRow(input.getTableRowMap(), tableSchema);
}
private TableRow toTableRow(Map<String, String> row, Map<String, TableFieldSchema> tableSchema) {
TableRow tableRow = new TableRow();
for (String key : row.keySet()) {
if (tableSchema.containsKey(key)) {
TableFieldSchema tableFieldSchema = tableSchema.get(key);
tableRow.put(key, createTableRowField(row.get(key), tableFieldSchema));
}
}
return tableRow;
}
private Object createTableRowField(String valueStr, TableFieldSchema tableFieldSchema) {
Object retObject = null;
switch (tableFieldSchema.getType().toLowerCase()) {
case "int64":
retObject = Long.parseLong(valueStr);
break;
case "timestamp":
retObject = parseTimeStamp(valueStr);
break;
case "float":
retObject = Double.parseDouble(valueStr);
break;
case "string":
default:
retObject = valueStr;
break;
}
return retObject;
}
private Object parseTimeStamp(String valueStr) {
try {
long epochMilli = Long.parseLong(valueStr);
if (valueStr.length() > 13) {
epochMilli = Long.parseLong(valueStr.substring(0, 13));
}
return Instant.ofEpochMilli(epochMilli).toString();
} catch (NumberFormatException nfe) {
}
try {
return Instant.parse(valueStr, TIME_STAMP_FORMAT).toString();
} catch (Exception e) {
}
return valueStr;
}
}
|
GoogleCloudPlatform/cloud-iot-stream-processing-dynamic-schema
|
src/main/java/com/google/cloud/solutions/transformation/DynamicMessageTableRowMapper.java
|
Java
|
apache-2.0
| 3,469
|
/*
* Copyright © 2009 Nokia Corporation
* Copyright © 2010 Movial Creative Technologies Oy
* Copyright © 2013 Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdint.h>
#include <stdbool.h>
#include <X11/X.h>
#include <X11/Xutil.h> /* for XDestroyImage */
#include <X11/Xlibint.h>
#include <X11/extensions/Xrender.h>
#if HAVE_MIT_SHM
#include <X11/extensions/XShm.h>
#if HAVE_X11_EXTENSIONS_SHMPROTO_H
#include <X11/extensions/shmproto.h>
#elif HAVE_X11_EXTENSIONS_SHMSTR_H
#include <X11/extensions/shmstr.h>
#else
#error Failed to find the right header for X11 MIT-SHM protocol definitions
#endif
#include <sys/ipc.h>
#include <sys/shm.h>
#endif
#include <pixman.h> /* for pixman blt functions */
#include "test.h"
static const struct format {
const char *name;
pixman_format_code_t pixman_format;
} formats[] = {
{ "a8r8g8b8", PIXMAN_a8r8g8b8 },
{ "x8r8g8b8", PIXMAN_x8r8g8b8 },
{ "a8", PIXMAN_a8 },
{ "a4", PIXMAN_a4 },
{ "a1", PIXMAN_a1 },
};
static const struct op {
int value;
const char *name;
} ops[] = {
{ PictOpClear, "Clear" },
{ PictOpSrc, "Src" },
{ PictOpDst, "Dst" },
{ PictOpOver, "Over" },
{ PictOpOverReverse, "OverReverse" },
{ PictOpIn, "In" },
{ PictOpInReverse, "InReverse" },
{ PictOpOut, "Out" },
{ PictOpOutReverse, "OutReverse" },
{ PictOpAtop, "Atop" },
{ PictOpAtopReverse, "AtopReverse" },
{ PictOpXor, "Xor" },
{ PictOpAdd, "Add" },
{ PictOpSaturate, "Saturate" },
{ PictOpMultiply, "Multiply" },
{ PictOpScreen, "Screen" },
{ PictOpOverlay, "Overlay" },
{ PictOpDarken, "Darken" },
{ PictOpLighten, "Lighten" },
{ PictOpColorDodge, "Dodge" },
{ PictOpColorBurn, "Burn" },
{ PictOpHardLight, "HardLight" },
{ PictOpSoftLight, "SoftLight" },
};
static Picture source_pixmap(struct test_display *t, struct test_target *target, int format)
{
XRenderColor render_color[2] = {
{ 0x8000, 0x8000, 0x8000, 0x8000 },
{ 0xffff, 0xffff, 0xffff, 0xffff },
};
Pixmap pixmap;
Picture picture;
pixmap = XCreatePixmap(t->dpy, t->root,
target->width, target->height,
PIXMAN_FORMAT_DEPTH(formats[format].pixman_format));
picture = XRenderCreatePicture(t->dpy, pixmap,
XRenderFindStandardFormat(t->dpy, format),
0, NULL);
XFreePixmap(t->dpy, pixmap);
XRenderFillRectangle(t->dpy, PictOpSrc, picture, &render_color[0],
0, 0, target->width, target->height/2);
XRenderFillRectangle(t->dpy, PictOpSrc, picture, &render_color[1],
0, target->height/2, target->width, target->height/2);
return picture;
}
static Picture source_a8r8g8b8(struct test_display *t, struct test_target *target)
{
return source_pixmap(t, target, 0);
}
static Picture source_x8r8g8b8(struct test_display *t, struct test_target *target)
{
return source_pixmap(t, target, 1);
}
static Picture source_a8(struct test_display *t, struct test_target *target)
{
return source_pixmap(t, target, 2);
}
static Picture source_a4(struct test_display *t, struct test_target *target)
{
return source_pixmap(t, target, 3);
}
static Picture source_a1(struct test_display *t, struct test_target *target)
{
return source_pixmap(t, target, 3);
}
static Picture source_1x1r(struct test_display *t, struct test_target *target)
{
XRenderColor render_color = { 0x8000, 0x8000, 0x8000, 0x8000 };
XRenderPictureAttributes pa;
Pixmap pixmap;
Picture picture;
pa.repeat = RepeatNormal;
pixmap = XCreatePixmap(t->dpy, t->root, 1, 1, 32);
picture = XRenderCreatePicture(t->dpy, pixmap,
XRenderFindStandardFormat(t->dpy, 0),
CPRepeat, &pa);
XFreePixmap(t->dpy, pixmap);
XRenderFillRectangle(t->dpy, PictOpSrc, picture, &render_color,
0, 0, 1, 1);
return picture;
}
static Picture source_solid(struct test_display *t, struct test_target *target)
{
XRenderColor render_color = { 0x8000, 0x8000, 0x8000, 0x8000 };
return XRenderCreateSolidFill(t->dpy, &render_color);
}
static Picture source_linear_horizontal(struct test_display *t, struct test_target *target)
{
XRenderColor colors[2] = {{0}, {0xffff, 0xffff, 0xffff, 0xffff}};
XFixed stops[2] = {0, 0xffff};
XLinearGradient gradient = { {0, 0}, {target->width << 16, 0}};
return XRenderCreateLinearGradient(t->dpy, &gradient, stops, colors, 2);
}
static Picture source_linear_vertical(struct test_display *t, struct test_target *target)
{
XRenderColor colors[2] = {{0}, {0xffff, 0xffff, 0xffff, 0xffff}};
XFixed stops[2] = {0, 0xffff};
XLinearGradient gradient = { {0, 0}, {0, target->height << 16}};
return XRenderCreateLinearGradient(t->dpy, &gradient, stops, colors, 2);
}
static Picture source_linear_diagonal(struct test_display *t, struct test_target *target)
{
XRenderColor colors[2] = {{0}, {0xffff, 0xffff, 0xffff, 0xffff}};
XFixed stops[2] = {0, 0xffff};
XLinearGradient gradient = { {0, 0}, {target->width << 16, target->height << 16}};
return XRenderCreateLinearGradient(t->dpy, &gradient, stops, colors, 2);
}
static Picture source_radial_concentric(struct test_display *t, struct test_target *target)
{
XRenderColor colors[2] = {{0}, {0xffff, 0xffff, 0xffff, 0xffff}};
XFixed stops[2] = {0, 0xffff};
XRadialGradient gradient = {
{
((target->width << 16) + 1) / 2,
((target->height << 16) + 1) / 2,
0,
},
{
((target->width << 16) + 1) / 2,
((target->height << 16) + 1) / 2,
target->width << 15,
}
};
return XRenderCreateRadialGradient(t->dpy, &gradient, stops, colors, 2);
}
static Picture source_radial_generic(struct test_display *t, struct test_target *target)
{
XRenderColor colors[2] = {{0}, {0xffff, 0xffff, 0xffff, 0xffff}};
XFixed stops[2] = {0, 0xffff};
XRadialGradient gradient = {
{ 0, 0, target->width << 14, },
{ target->width << 16, target->height << 16, target->width << 14, }
};
return XRenderCreateRadialGradient(t->dpy, &gradient, stops, colors, 2);
}
#if HAVE_MIT_SHM
static XShmSegmentInfo shmref, shmout;
static void setup_shm(struct test *t)
{
XShmSegmentInfo shm;
int size;
shm.shmid = -1;
if (!(t->ref.has_shm_pixmaps && t->out.has_shm_pixmaps))
return;
size = t->ref.width * t->ref.height * 4;
size = (size + 4095) & -4096;
shm.shmid = shmget(IPC_PRIVATE, size, IPC_CREAT | 0666);
if (shm.shmid == -1)
return;
shm.shmaddr = shmat(shm.shmid, 0, 0);
if (shm.shmaddr == (char *) -1) {
shmctl(shm.shmid, IPC_RMID, NULL);
shm.shmid = -1;
return;
}
shm.readOnly = False;
shmref = shm;
XShmAttach(t->ref.dpy, &shmref);
XSync(t->ref.dpy, True);
shmout = shm;
XShmAttach(t->out.dpy, &shmout);
XSync(t->out.dpy, True);
}
static Picture source_shm(struct test_display *t, struct test_target *target)
{
XShmSegmentInfo *shm = t->target == REF ? &shmref : &shmout;
Pixmap pixmap;
Picture picture;
int size;
if (shm->shmid == -1)
return 0;
pixmap = XShmCreatePixmap(t->dpy, t->root,
shm->shmaddr, shm,
target->width, target->height, 32);
picture = XRenderCreatePicture(t->dpy, pixmap,
XRenderFindStandardFormat(t->dpy, 0),
0, NULL);
XFreePixmap(t->dpy, pixmap);
size = target->width * target->height * 4;
memset(shm->shmaddr, 0x80, size/2);
memset(shm->shmaddr+size/2, 0xff, size/2);
return picture;
}
#else
static void setup_shm(struct test *t) { }
static Picture source_shm(struct test_display *t, struct test_target *target) { return 0; }
#endif
static const struct {
Picture (*create)(struct test_display *, struct test_target *);
const char *name;
} source[] = {
{ source_a8r8g8b8, "a8r8g8b8 pixmap" },
{ source_x8r8g8b8, "x8r8g8b8 pixmap" },
{ source_a8, "a8 pixmap" },
{ source_a4, "a4 pixmap" },
{ source_a1, "a1 pixmap" },
{ source_1x1r, "a8r8g8b8 1x1R pixmap" },
{ source_solid, "solid" },
{ source_shm, "a8r8g8b8 shm" },
{ source_linear_horizontal, "linear (horizontal gradient)" },
{ source_linear_vertical, "linear (vertical gradient)" },
{ source_linear_diagonal, "linear (diagonal gradient)" },
{ source_radial_concentric, "radial (concentric)" },
{ source_radial_generic, "radial (generic)" },
};
static double _bench_source(struct test_display *t, enum target target_type,
int op, int src, int loops)
{
XRenderColor render_color = { 0x8000, 0x8000, 0x8000, 0x8000 };
struct test_target target;
Picture picture;
struct timespec tv;
double elapsed;
test_target_create_render(t, target_type, &target);
XRenderFillRectangle(t->dpy, PictOpClear, target.picture, &render_color,
0, 0, target.width, target.height);
picture = source[src].create(t, &target);
if (picture) {
test_timer_start(t, &tv);
while (loops--)
XRenderComposite(t->dpy, op,
picture, 0, target.picture,
0, 0,
0, 0,
0, 0,
target.width, target.height);
elapsed = test_timer_stop(t, &tv);
XRenderFreePicture(t->dpy, picture);
} else
elapsed = -1;
test_target_destroy_render(t, &target);
return elapsed;
}
static void bench_source(struct test *t, enum target target, int op, int src)
{
double out, ref;
fprintf(stdout, "%28s with %s: ", source[src].name, ops[op].name);
fflush(stdout);
op = ops[op].value;
ref = _bench_source(&t->ref, target, op, src, 1000);
if (ref < 0) {
fprintf(stdout, "SKIP\n");
return;
}
fprintf(stdout, "ref=%f, ", ref);
fflush(stdout);
out = _bench_source(&t->out, target, op, src, 1000);
if (out < 0) {
fprintf(stdout, "SKIP\n");
return;
}
fprintf(stdout, "out=%f\n", out);
}
static double _bench_mask(struct test_display *t, enum target target_type,
int op, int src, int mask, int loops)
{
XRenderColor render_color = { 0x8000, 0x8000, 0x8000, 0x8000 };
struct test_target target;
Picture ps, pm;
struct timespec tv;
double elapsed;
test_target_create_render(t, target_type, &target);
XRenderFillRectangle(t->dpy, PictOpClear, target.picture, &render_color,
0, 0, target.width, target.height);
ps = source[src].create(t, &target);
pm = source[mask].create(t, &target);
if (ps && pm) {
test_timer_start(t, &tv);
while (loops--)
XRenderComposite(t->dpy, op,
ps, pm, target.picture,
0, 0,
0, 0,
0, 0,
target.width, target.height);
elapsed = test_timer_stop(t, &tv);
} else
elapsed = -1;
if (ps)
XRenderFreePicture(t->dpy, ps);
if (pm)
XRenderFreePicture(t->dpy, pm);
test_target_destroy_render(t, &target);
return elapsed;
}
static void bench_mask(struct test *t, enum target target, int op, int src, int mask)
{
double out, ref;
fprintf(stdout, "%28s In %28s with %s: ",
source[src].name, source[mask].name, ops[op].name);
fflush(stdout);
op = ops[op].value;
ref = _bench_mask(&t->ref, target, op, src, mask, 1000);
if (ref < 0) {
fprintf(stdout, "SKIP\n");
return;
}
fprintf(stdout, "ref=%f, ", ref);
fflush(stdout);
out = _bench_mask(&t->out, target, op, src, mask, 1000);
if (out < 0) {
fprintf(stdout, "SKIP\n");
return;
}
fprintf(stdout, "out=%f\n", out);
}
int main(int argc, char **argv)
{
struct test test;
unsigned op, src, mask;
test_init(&test, argc, argv);
setup_shm(&test);
for (op = 0; op < sizeof(ops)/sizeof(ops[0]); op++) {
for (src = 0; src < sizeof(source)/sizeof(source[0]); src++)
bench_source(&test, ROOT, op, src);
fprintf (stdout, "\n");
for (src = 0; src < sizeof(source)/sizeof(source[0]); src++)
for (mask = 0; mask < sizeof(source)/sizeof(source[0]); mask++)
bench_mask(&test, ROOT, op, src, mask);
fprintf (stdout, "\n");
}
return 0;
}
|
execunix/vinos
|
xsrc/external/mit/xf86-video-intel/dist/test/lowlevel-blt-bench.c
|
C
|
apache-2.0
| 12,579
|
<ActionBar title="Photos" class="action-bar"></ActionBar>
<StackLayout>
<GridLayout columns="*" rows="*, 280">
<ListView [items]="photos" row="0" col="0" class="list-group" (itemTap)="centerMap($event)">
<template let-item="item">
<GridLayout columns="auto, *" rows="auto" class="list-group-item">
<Image [src]="item.url_q" width="50" height="50" col="0" class="thumb img-rounded"></Image>
<StackLayout row="0" col="1">
<Label [text]="item.distance + ' away'" class="list-group-item-heading"></Label>
<Label [text]="item.title" class="list-group-item-text" textWrap="true"></Label>
</StackLayout>
</GridLayout>
</template>
</ListView>
<ContentView row="1" col="0">
<Mapbox
accessToken="{{ mapboxKey }}"
mapStyle="streets"
zoomLevel="17"
latitude="52.3702160"
longitude="4.8951680"
hideLogo="true"
showUserLocation="true"
(mapReady)="onMapReady($event)">
</Mapbox>
</ContentView>
</GridLayout>
</StackLayout>
|
burkeholland/nativescript-photos-near-me
|
app/components/imagesList-component/imagesList.component.html
|
HTML
|
apache-2.0
| 1,263
|
<!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_16.html">Class Test_AbaRouteValidator_16</a></li>
</ol></div>
<h1 class="aui-h2-clover">
Test testAbaNumberCheck_35787_good
</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_16.html?line=18952#src-18952" >testAbaNumberCheck_35787_good</a>
</td>
<td>
<span class="sortValue">1</span><span class="aui-lozenge aui-lozenge-success">PASS</span>
</td>
<td>
7 Aug 12:45:29
</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_35787_good</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<span class="sortValue">com.cardatechnologies.utils.validators.abaroutevalidator.AbaRouteValidator</span>
  <a href="../../../../../com/cardatechnologies/utils/validators/abaroutevalidator/AbaRouteValidator.html?id=33450#AbaRouteValidator" title="AbaRouteValidator" name="sl-47">com.cardatechnologies.utils.validators.abaroutevalidator.AbaRouteValidator</a>
</td>
<td>
<span class="sortValue">0.7352941</span>73.5%
</td>
<td class="align-middle" style="width: 100%" colspan="3">
<div>
<div title="73.5% Covered" style="min-width:40px;" class="barNegative contribBarNegative contribBarNegative"><div class="barPositive contribBarPositive contribBarPositive" style="width:73.5%"></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_16_testAbaNumberCheck_35787_good_pt6.html
|
HTML
|
apache-2.0
| 9,181
|
'use strict';
angular.module('gigsecApp')
.controller('GigResignupController', function($scope, $uibModalInstance, entity, GigSignup) {
$scope.gig = entity.gig;
$scope.gigSignup = entity.signup;
$scope.clear = function() {
$uibModalInstance.dismiss('cancel');
};
var onSaveSuccess = function (result) {
$scope.$emit('gigsecApp:gigUpdate', result);
$uibModalInstance.close(result);
$scope.isSaving = false;
};
var onSaveError = function (result) {
$scope.isSaving = false;
};
$scope.confirmUpdate = function (id) {
$scope.isSaving = true;
$scope.gigSignup.performing = true;
GigSignup.signup().update($scope.gigSignup, onSaveSuccess, onSaveError);
};
});
|
clamped/gigsec
|
src/main/webapp/scripts/app/entities/gigSignup/gigSignup-resignup-dialog.controller.js
|
JavaScript
|
apache-2.0
| 840
|
/*
Copyright 2016 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Docker integration using pkg/kubelet/api/v1alpha1/runtime/v1.pb.go.
package containerdshim
|
cri-containerd/kubernetes
|
pkg/kubelet/containerdshim/doc.go
|
GO
|
apache-2.0
| 665
|
# Miconia saxicola Brandegee SPECIES
#### Status
ACCEPTED
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null
|
mdoering/backbone
|
life/Plantae/Magnoliophyta/Magnoliopsida/Myrtales/Melastomataceae/Miconia/Miconia saxicola/README.md
|
Markdown
|
apache-2.0
| 184
|
# Abutilon pulverulentum Ulbr. 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/Abutilon/Abutilon pulverulentum/README.md
|
Markdown
|
apache-2.0
| 178
|
{% extends "base.html" %}
{% block content %}
<h2>Error: Application error</h2>
<p>This application encoutered an error.</p>
{% endblock %}
|
ttx/odsreg
|
cfp/templates/500.html
|
HTML
|
apache-2.0
| 140
|
#
# 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 urllib import request
from tests.integrated import base
class StatusTestCase(base.IntegrationTest):
def _get_config(self):
port = base.get_free_port()
self.url = "http://localhost:%s" % port
conf = {
"service": {
"name": "status",
"module": "rallyci.services.status",
"listen": ["localhost", port],
}
}
return [[conf], [port]]
def test_index(self):
r = request.urlopen(self.url)
self.assertIsNotNone(r)
|
redixin/rally-ci
|
tests/integrated/test_services_status.py
|
Python
|
apache-2.0
| 1,144
|
package org.wikipedia.feed.announcement;
import android.content.Context;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.annotation.VisibleForTesting;
import android.text.TextUtils;
import org.wikipedia.dataclient.WikiSite;
import org.wikipedia.dataclient.retrofit.RetrofitFactory;
import org.wikipedia.feed.dataclient.FeedClient;
import org.wikipedia.feed.model.Card;
import org.wikipedia.settings.Prefs;
import org.wikipedia.util.GeoUtil;
import org.wikipedia.util.log.L;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Locale;
import retrofit2.Call;
import retrofit2.Response;
import retrofit2.Retrofit;
import retrofit2.http.GET;
import retrofit2.http.Headers;
public class AnnouncementClient implements FeedClient {
private static final String PLATFORM_CODE = "AndroidApp";
@Nullable private Call<AnnouncementList> call;
@Override
public void request(@NonNull Context context, @NonNull WikiSite wiki, int age, @NonNull Callback cb) {
cancel();
String endpoint = String.format(Locale.ROOT, Prefs.getRestbaseUriFormat(), wiki.scheme(),
wiki.authority());
Retrofit retrofit = RetrofitFactory.newInstance(endpoint, wiki);
Service service = retrofit.create(Service.class);
call = request(service);
call.enqueue(new CallbackAdapter(cb));
}
@Override
public void cancel() {
if (call == null) {
return;
}
call.cancel();
call = null;
}
@VisibleForTesting
interface Service {
/**
* Gets a list of announcements that are currently in effect.
*/
@NonNull
@Headers("accept: application/json; charset=utf-8; profile=\"https://www.mediawiki.org/wiki/Specs/announcements/0.1.0\"")
@GET("feed/announcements")
Call<AnnouncementList> get();
}
@VisibleForTesting
@NonNull
Call<AnnouncementList> request(@NonNull Service service) {
return service.get();
}
@VisibleForTesting
static class CallbackAdapter implements retrofit2.Callback<AnnouncementList> {
@NonNull private final Callback cb;
CallbackAdapter(@NonNull Callback cb) {
this.cb = cb;
}
@Override public void onResponse(Call<AnnouncementList> call,
Response<AnnouncementList> response) {
List<Card> cards = new ArrayList<>();
AnnouncementList content = response.body();
if (content != null) {
cards.addAll(buildCards(content.items()));
}
cb.success(cards);
}
@Override public void onFailure(Call<AnnouncementList> call, Throwable caught) {
L.v(caught);
cb.error(caught);
}
}
@VisibleForTesting
static List<Card> buildCards(@NonNull List<Announcement> announcements) {
List<Card> cards = new ArrayList<>();
String country = GeoUtil.getGeoIPCountry();
Date now = new Date();
for (Announcement announcement : announcements) {
if (shouldShow(announcement, country, now)) {
switch (announcement.type()) {
case Announcement.SURVEY:
cards.add(new SurveyCard(announcement));
break;
case Announcement.FUNDRAISING:
cards.add(new FundraisingCard(announcement));
break;
default:
cards.add(new AnnouncementCard(announcement));
break;
}
}
}
return cards;
}
@VisibleForTesting
static boolean shouldShow(@Nullable Announcement announcement,
@Nullable String country,
@NonNull Date date) {
if (announcement == null
|| !announcement.platforms().contains(PLATFORM_CODE)
|| TextUtils.isEmpty(country)
|| !announcement.countries().contains(country)
|| (announcement.startTime() != null && announcement.startTime().after(date))
|| (announcement.endTime() != null && announcement.endTime().before(date))) {
return false;
}
return true;
}
}
|
SAGROUP2/apps-android-wikipedia
|
app/src/main/java/org/wikipedia/feed/announcement/AnnouncementClient.java
|
Java
|
apache-2.0
| 4,445
|
/**
* Copyright (c) 2009, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.wso2.carbon.mediation.initializer.services;
import org.apache.synapse.config.SynapseConfiguration;
import org.apache.axis2.context.ConfigurationContext;
public class SynapseConfigurationServiceImpl implements SynapseConfigurationService {
private SynapseConfiguration synapseConfiguration;
private ConfigurationContext configurationContext;
private int tenantId;
public SynapseConfigurationServiceImpl(SynapseConfiguration synapseConfiguration,
int tenantId,
ConfigurationContext configurationContext) {
this.synapseConfiguration = synapseConfiguration;
this.tenantId = tenantId;
this.configurationContext = configurationContext;
}
public SynapseConfiguration getSynapseConfiguration() {
return synapseConfiguration;
}
public void setSynapseConfiguration(SynapseConfiguration synapseConfiguration) {
this.synapseConfiguration = synapseConfiguration;
}
public ConfigurationContext getConfigurationContext() {
return configurationContext;
}
public int getTenantId() {
return tenantId;
}
}
|
maheshika/carbon-mediation
|
components/mediation-initializer/org.wso2.carbon.mediation.initializer/src/main/java/org/wso2/carbon/mediation/initializer/services/SynapseConfigurationServiceImpl.java
|
Java
|
apache-2.0
| 1,846
|
/*
*
* * Licensed to the Apache Software Foundation (ASF) under one or more
* * contributor license agreements. 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. For additional information regarding
* * copyright in this work, please see the NOTICE file in the top level
* * directory of this distribution.
*
*/
package org.apache.usergrid.services.queues;
import java.io.IOException;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import org.apache.usergrid.persistence.queue.LegacyQueueManager;
import org.apache.usergrid.persistence.queue.LegacyQueueMessage;
/**
* Manages the queueManager implementation for Import
*/
public class ImportQueueManager implements LegacyQueueManager {
@Override
public List<LegacyQueueMessage> getMessages(final int limit, final Class klass) {
return new ArrayList<>();
}
@Override
public long getQueueDepth() {
return 0;
}
@Override
public void commitMessage( final LegacyQueueMessage queueMessage ) {
}
@Override
public void commitMessages( final List<LegacyQueueMessage> queueMessages ) {
}
@Override
public void sendMessages( final List bodies ) throws IOException {
}
@Override
public List<LegacyQueueMessage> sendQueueMessages(final List<LegacyQueueMessage> queueMessages ) throws IOException {
return new ArrayList<>();
}
@Override
public <T extends Serializable> void sendMessageToLocalRegion(final T body ) throws IOException {
}
@Override
public <T extends Serializable> void sendMessageToAllRegions(final T body ) throws IOException {
}
@Override
public void deleteQueue() {
}
@Override
public void clearQueueNameCache(){
//no-op
}
}
|
mdunker/usergrid
|
stack/services/src/main/java/org/apache/usergrid/services/queues/ImportQueueManager.java
|
Java
|
apache-2.0
| 2,419
|
package http
import (
"net/http"
"time"
"crypto/tls"
"net"
"sync"
"github.com/Tecsisa/foulkon/api"
"github.com/Tecsisa/foulkon/foulkon"
"github.com/julienschmidt/httprouter"
"github.com/kylelemons/godebug/pretty"
)
type ReloadHandlerFunc func(watch *ProxyServer) bool
// ProxyServer struct with reload Handler extension
type ProxyServer struct {
certFile string
keyFile string
resourceLock sync.Mutex
reloadFunc ReloadHandlerFunc
refreshTime time.Duration
reloadServe chan struct{}
currentResources []api.ProxyResource
http.Server
}
// WorkerServer struct
type WorkerServer struct {
certFile string
keyFile string
http.Server
}
// Server interface that WorkerServer and ProxyServer have to implement
type Server interface {
Run() error
Configuration() error
}
// Run starts an HTTP WorkerServer
func (ws *WorkerServer) Run() error {
var err error
if ws.certFile != "" || ws.keyFile != "" {
err = ws.ListenAndServeTLS(ws.certFile, ws.keyFile)
} else {
err = ws.ListenAndServe()
}
return err
}
// Configuration an HTTP ProxyServer with a given address
func (ps *ProxyServer) Configuration() error {
if ps.certFile != "" || ps.keyFile != "" {
if ps.Addr == "" {
ps.Addr = ":https"
}
if !strSliceContains(ps.TLSConfig.NextProtos, "http/1.1") {
ps.TLSConfig.NextProtos = append(ps.TLSConfig.NextProtos, "http/1.1")
}
configHasCert := len(ps.TLSConfig.Certificates) > 0 || ps.TLSConfig.GetCertificate != nil
if !configHasCert || ps.certFile != "" || ps.keyFile != "" {
var err error
ps.TLSConfig.Certificates = make([]tls.Certificate, 1)
ps.TLSConfig.Certificates[0], err = tls.LoadX509KeyPair(ps.certFile, ps.keyFile)
if err != nil {
return err
}
}
}
if ps.Addr == "" {
ps.Addr = ":http"
}
return nil
}
// Configuration an HTTP WorkerServer
func (ws *WorkerServer) Configuration() error { return nil }
// Run starts an HTTP ProxyServer
func (ps *ProxyServer) Run() error {
// Call reloadFunc every refreshTime
timer := time.NewTicker(ps.refreshTime)
// now wait for the other times when we needed to
go func() {
for range timer.C {
// change the handler
if ps.reloadFunc(ps) {
ps.reloadServe <- struct{}{} // reset the listening binding
}
}
}()
var err error
ln, err := net.Listen("tcp", ps.Addr)
if err != nil {
return err
}
for {
l := ln.(*net.TCPListener)
defer l.Close()
go func(l net.Listener) {
err = ps.Serve(l)
}(l)
if err != nil {
return err
}
<-ps.reloadServe
}
}
// NewProxy returns a new ProxyServer
func NewProxy(proxy *foulkon.Proxy) Server {
// Initialization
ps := new(ProxyServer)
ps.reloadServe = make(chan struct{}, 1)
ps.TLSConfig = &tls.Config{}
// Set Proxy parameters
ps.certFile = proxy.CertFile
ps.keyFile = proxy.KeyFile
ps.Addr = proxy.Host + ":" + proxy.Port
ps.refreshTime = proxy.RefreshTime
ps.reloadFunc = ps.RefreshResources(proxy)
ps.reloadFunc(ps)
return ps
}
// NewWorker returns a new WorkerServer
func NewWorker(worker *foulkon.Worker, h http.Handler) Server {
ws := new(WorkerServer)
ws.certFile = worker.CertFile
ws.keyFile = worker.KeyFile
ws.Addr = worker.Host + ":" + worker.Port
ws.Handler = h
return ws
}
// RefreshResources implements reloadFunc
func (ps *ProxyServer) RefreshResources(proxy *foulkon.Proxy) func(s *ProxyServer) bool {
return func(srv *ProxyServer) bool {
proxyHandler := ProxyHandler{proxy: proxy, client: http.DefaultClient}
// Get proxy resources
newProxyResources, err := proxy.ProxyApi.GetProxyResources()
if err != nil {
api.Log.Errorf("Unexpected error reading proxy resources from database %v", err)
return false
}
if diff := pretty.Compare(srv.currentResources, newProxyResources); diff != "" {
router := httprouter.New()
defer srv.resourceLock.Unlock()
srv.resourceLock.Lock()
// writer lock
ps.currentResources = newProxyResources
api.Log.Info("Updating resources ...")
for _, pr := range newProxyResources {
// Clean path
pr.Resource.Path = httprouter.CleanPath(pr.Resource.Path)
// Attach resource
safeRouterAdderHandler(router, pr, &proxyHandler)
}
// TODO: test when resources are empty
// If we had resources and those were deleted then handler must be
// created with empty router.
ps.Server.Handler = router
return true
}
return false
}
}
// Method to control when router has a resource already defined that collides with another
func safeRouterAdderHandler(router *httprouter.Router, pr api.ProxyResource, ph *ProxyHandler) {
defer func() {
if r := recover(); r != nil {
api.Log.Errorf("There was a problem adding proxy resource with name %v and org %v: %v", pr.Name, pr.Org, r)
}
}()
router.Handle(pr.Resource.Method, pr.Resource.Path, ph.HandleRequest(pr))
}
func strSliceContains(ss []string, s string) bool {
for _, v := range ss {
if v == s {
return true
}
}
return false
}
|
Tecsisa/foulkon
|
http/server.go
|
GO
|
apache-2.0
| 4,951
|
This folder contains Java code for implementing the Hillview back-end services.
To build the project from the commandline:
> $: mvn install
Alternatively, you can just run `../bin/rebuild.sh`
|
uwieder/hiero
|
platform/README.md
|
Markdown
|
apache-2.0
| 196
|
# Release documentation
### Pre-requisites
In order to release a new version of the module, you will need the following:
1. Necessary permissions to the Github repository to create tags and releases.
2. All the required code is merged to target branch.
3. Ensure that the module's [CHANGELOG.md](CHANGELOG.md) file has been updated to contain details of the release you are planning to make.
4. Clone of the Github repository in a local computer (local repo).
You should then follow these steps:
## 1. Merge necessary Pull Requests
Before creating a release, check that all pull requests are merged into the agreed target branch, usually "master".
## 2. Draft a release in Github
Create a release by clicking on "Draft a new release".
Enter new release version number to "Choose a tag" box, the same number as in the project's **composer.json** file, for example "1.0.1".
For the Target, choose the "master" branch or a different branch if it was previously agreed.
For Release title, enter something more user friendly, for example "Version 1.0.1"
Leave release description blank for now.
Click on the "Publish release" button.
## 3. Create dist
In local repo, enter following commands to create a dist zip file, in the example 1.0.1 is used, make sure this is replaced by the correct tag name
```
git fetch --tags --all
git archive 1.0.1 -o module-dist.zip
```
Created file module-dist.zip contains the distributable code for this module.
## 4. Add assets and finalise the release
In the Github UI, switch to edit the release you created in step 2. The URL will contain something like /edit/1.0.1, for example.
Upload the module-dist.zip into the designated area in the release edit page.
Populate the release description with the information about the version that you can find in the [CHANGELOG.md](CHANGELOG.md) file.
Click on the "Update release" button, and inform the development team that the release has been published.
|
simplifycom/simplify-opencart-module
|
RELEASE.md
|
Markdown
|
apache-2.0
| 1,947
|
using System;
using SimpleHoneypot.Core;
using System.Web;
using SimpleHoneypot.Core.Common.Thermador.Core.Common;
namespace SimpleHoneypot.Extensions {
public static class HttpContextBaseExtensions {
public static bool ValidateHoneypot(this HttpRequestBase request) {
Check.Argument.IsNotNull(request, "context");
if (HttpContext.Current.Items[Honeypot.HttpContextKey] == null)
throw new NullReferenceException("HttpContext.Items must have entry for Honeypot.HttpContextKey. Ensure your action has HoneypotAttribute");
return (bool)HttpContext.Current.Items[Honeypot.HttpContextKey];
}
}
}
|
webadvanced/Honeypot-MVC
|
src/SimpleHoneypot/Extensions/HttpContextBaseExtensions.cs
|
C#
|
apache-2.0
| 702
|
#!/bin/sh
docker build -t wxmclub/solr:6-alpine .
|
wxmclub/docker-images
|
solr/6-alpine/build.sh
|
Shell
|
apache-2.0
| 51
|
using UnityEditor;
using UnityEngine;
namespace UIWidgets
{
[CustomPropertyDrawer (typeof(AccordionItem))]
public class AccordionItemDrawer : PropertyDrawer {
// Draw the property inside the given rect
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
{
// Using BeginProperty / EndProperty on the parent property means that
// prefab override logic works on the entire property.
EditorGUI.BeginProperty(position, label, property);
// Draw label
//position = EditorGUI.PrefixLabel(position, GUIUtility.GetControlID(FocusType.Passive), label);
// Calculate rects
var width = (position.width - 30) / 2;
var openRect = new Rect(position.x, position.y, 30, position.height);
var togglGORect = new Rect(position.x+31, position.y, width, position.height);
var contentGORect = new Rect(position.x+30+width, position.y, width, position.height);
// Draw fields - passs GUIContent.none to each so they are drawn without labels
EditorGUI.PropertyField(openRect, property.FindPropertyRelative("Open"), GUIContent.none);
EditorGUI.LabelField(openRect, new GUIContent("", "Is open on start?"));
EditorGUI.PropertyField(togglGORect, property.FindPropertyRelative("ToggleObject"), GUIContent.none);
EditorGUI.LabelField(togglGORect, new GUIContent("", "Toggle object. Click on this object show or hide Content object."));
EditorGUI.PropertyField(contentGORect, property.FindPropertyRelative("ContentObject"), GUIContent.none);
EditorGUI.LabelField(contentGORect, new GUIContent("", "Content object."));
EditorGUI.EndProperty();
}
}
}
|
carlosCn/Unity-EmojiText
|
TextInlineSpritePro/Assets/UIWidgets/Editor/AccordionItemDrawer.cs
|
C#
|
apache-2.0
| 1,640
|
<?php
namespace PiggyAuth\Commands;
use PiggyAuth\Main;
use pocketmine\command\CommandSender;
use pocketmine\Player;
/**
* Class ForgotPasswordCommand
* @package PiggyAuth\Commands
*/
class ForgotPasswordCommand extends PiggyAuthCommand
{
/**
* ForgotPasswordCommand constructor.
* @param string $name
* @param Main $plugin
*/
public function __construct($name, $plugin)
{
parent::__construct($name, $plugin);
$this->setDescription("Change your password if you forgot it");
$this->setUsage("/forgotpassword <pin> <new password>");
$this->setAliases(["forgetpassword", "forgotpw", "forgetpw", "forgotpwd", "forgetpwd", "fpw", "fpwd"]);
$this->setPermission("piggyauth.command.forgotpassword");
}
/**
* @param CommandSender $sender
* @param string $currentAlias
* @param array $args
* @return bool
*/
public function execute(CommandSender $sender, string $currentAlias, array $args)
{
if (!$this->testPermission($sender)) {
return true;
}
if (!$sender instanceof Player) {
$sender->sendMessage($this->getPlugin()->getLanguageManager()->getMessage($sender, "use-in-game"));
return false;
}
if (!isset($args[1])) {
$sender->sendMessage("/forgotpassword <pin> <new password>");
return false;
}
$this->getPlugin()->forgotpassword($sender, $args[0], $args[1]);
return true;
}
}
|
DaPigGuy/PiggyAuth
|
src/PiggyAuth/Commands/ForgotPasswordCommand.php
|
PHP
|
apache-2.0
| 1,519
|
{% extends 'base.html' %}
{% load i18n %}
{% load staticfiles %}
{% block head %}
{{wizard.form.media }}
{% endblock %}
{% block script %}
<script>
URL_KEY_MAP[104]="{% url "index" %}";
</script>
{% endblock %}
{% block content %}
{% if form.errors %}
<div id="msg" class="alert alert-danger">
<strong>Error!</strong> Account must be exactly 4 numbers
</div>
<br />
{% else %}
<h2> Enter your account number </h2>
<p>Push 'OK' after entering your account number</p>
{% endif %}
{% if messages %}
{% for message in messages %}
<div id="msg" class="alert alert-danger">
<strong>Error!</strong> {{ message }}
</div>
<br />
{% endfor %}
{% endif %}
<p>Step {{ wizard.steps.step1 }} of {{ wizard.steps.count }}</p>
<form action="" method="post">
{{ wizard.management_form }}
{{ form.as_p }}
{% csrf_token %}
</form>
{% endblock %}
{% block r-button4 %}
<a href="{% url "index" %}" class="btn btn-lg btn-primary btn">Cancel</a>
{% endblock %}
|
seriouscamp/frbb
|
web/frbb/templates/frbb/account.html
|
HTML
|
apache-2.0
| 1,094
|
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.cassandra.io.sstable;
import java.util.ArrayList;
import java.util.List;
import org.junit.Test;
import org.apache.cassandra.db.marshal.AbstractType;
import org.apache.cassandra.db.marshal.IntegerType;
import static org.apache.cassandra.io.sstable.IndexHelper.IndexInfo;
import static org.apache.cassandra.utils.ByteBufferUtil.bytes;
public class IndexHelperTest
{
@Test
public void testIndexHelper()
{
List<IndexInfo> indexes = new ArrayList<IndexInfo>();
indexes.add(new IndexInfo(bytes(0L), bytes(5L), 0, 0));
indexes.add(new IndexInfo(bytes(10L), bytes(15L), 0, 0));
indexes.add(new IndexInfo(bytes(20L), bytes(25L), 0, 0));
AbstractType comp = IntegerType.instance;
assert 0 == IndexHelper.indexFor(bytes(-1L), indexes, comp, false);
assert 0 == IndexHelper.indexFor(bytes(5L), indexes, comp, false);
assert 1 == IndexHelper.indexFor(bytes(12L), indexes, comp, false);
assert 2 == IndexHelper.indexFor(bytes(17L), indexes, comp, false);
assert 3 == IndexHelper.indexFor(bytes(100L), indexes, comp, false);
assert -1 == IndexHelper.indexFor(bytes(-1L), indexes, comp, true);
assert 0 == IndexHelper.indexFor(bytes(5L), indexes, comp, true);
assert 1 == IndexHelper.indexFor(bytes(12L), indexes, comp, true);
assert 1 == IndexHelper.indexFor(bytes(17L), indexes, comp, true);
assert 2 == IndexHelper.indexFor(bytes(100L), indexes, comp, true);
}
}
|
gmargari/apache-cassandra-1.1.0-src
|
test/unit/org/apache/cassandra/io/sstable/IndexHelperTest.java
|
Java
|
apache-2.0
| 2,303
|
# Liquidambar L. GENUS
#### Status
ACCEPTED
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null
|
mdoering/backbone
|
life/Plantae/Magnoliophyta/Magnoliopsida/Saxifragales/Altingiaceae/Liquidambar/README.md
|
Markdown
|
apache-2.0
| 170
|
# Trichomanes subtrifidum Matthew & Christ SPECIES
#### Status
ACCEPTED
#### According to
International Plant Names Index
#### Published in
null
#### Original name
null
### Remarks
null
|
mdoering/backbone
|
life/Plantae/Pteridophyta/Polypodiopsida/Hymenophyllales/Hymenophyllaceae/Trichomanes/Trichomanes subtrifidum/README.md
|
Markdown
|
apache-2.0
| 190
|
# Inonotus setulosocroceus (Cleland & Rodway) P.K. Buchanan & Ryvarden, 1993 SPECIES
#### Status
ACCEPTED
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
Aust. Syst. Bot. 6(3): 223 (1993)
#### Original name
Poria setulosocrocea Cleland & Rodway, 1928
### Remarks
null
|
mdoering/backbone
|
life/Fungi/Basidiomycota/Agaricomycetes/Hymenochaetales/Hymenochaetaceae/Inonotus/Inonotus setulosocroceus/README.md
|
Markdown
|
apache-2.0
| 300
|
/*
* ENSICAEN
* 6 Boulevard Maréchal Juin
* F-14050 Caen Cedex
*
* Unix System Programming Examples / Exemplier de programmation système Unix
* Chapter "Interprocess communication" / Chapitre "Communication interprocessus"
*
* Copyright (C) 1995-2016 Alain Lebret (alain.lebret@ensicaen.fr)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @author Alain Lebret (2011)
* @author Janet Davis (2006)
* @author Henry Walker (2004)
* @version 1.3
* @date 2011-12-01
*/
/**
* @file mmap_buffer_02.c
*
* Producer-consumer program using a shared memory that stores a buffer of
* integers. This code is based on the example presented by: Janet Davis (2006)
* and Henry Walker (2004).
*/
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h> /* wait() */
#include <sys/wait.h> /* wait() */
#include <sys/mman.h>
#define INTEGER_SIZE sizeof(int)
#define BUFFER_SIZE 5
#define MEMORY_SIZE (BUFFER_SIZE+2)*INTEGER_SIZE
#define ITERATIONS 10
/**
* Handles a fatal error. It displays a message, then exits.
*/
void handle_fatal_error(char *message)
{
fprintf(stderr, "%s", message);
exit(EXIT_FAILURE);
}
/**
* Writes the square of a serie of integers onto the shared memory.
*/
void write_memory(int *buffer, int *begin, int *end)
{
int i;
for (i = 0; i < ITERATIONS; i++) {
while ((*begin + 1) % BUFFER_SIZE == *end);
buffer[*begin] = i * i;
*begin = (*begin + 1) % BUFFER_SIZE;
printf("Parent: initial value %2d before writing in the buffer\n", i);
}
}
/**
* Manages the parent process. It writes data to the shared memory and waits
* for his child to finish.
*/
void manage_parent(int *buffer, int *begin, int *end)
{
pid_t child;
int status;
printf("Parent process (PID %d)\n", getpid());
write_memory(buffer, begin, end);
printf("Parent: end of production.\n");
child = wait(&status);
if (WIFEXITED(status)) {
printf("Parent: child %d has finished (code %d)\n", child,
WEXITSTATUS(status));
}
}
/**
* Reads a serie of integers from the shared memory and displays them.
*/
void read_memory(int *buffer, int *in, int *out)
{
int i;
int value;
for (i = 0; i < ITERATIONS; i++) {
sleep(1); /* waiting for the memory update (not as good as semaphore) */
while (*in == *out);
value = buffer[*out];
*out = (*out + 1) % BUFFER_SIZE;
printf("Child: element %2d == %2d read from the buffer.\n", i, value);
}
}
/**
* Manages the child process that reads all data from shared memory.
*/
void manage_child(int *buffer, int *in, int *out)
{
printf("Child process (PID %d)\n", getpid());
read_memory(buffer, in, out);
printf("Child: memory has been consumed.\n");
}
/**
* Creates and initializes a new shared memory using mmap.
* @return Pointer on the shared memory
*/
void *create_shared_memory()
{
/* initialize shared memory using mmap */
void *shared_memory = mmap(0, /* beginning (starting address is ignored) */
MEMORY_SIZE, /* size of the shared memory */
PROT_READ | PROT_WRITE, /* protection */
MAP_SHARED | MAP_ANONYMOUS,
-1, /* the shared memory do not use a file */
0); /* ignored: set when using a file */
if (shared_memory == (void *) -1) {
handle_fatal_error("Error allocating shared memory using mmap!\n");
}
return shared_memory;
}
int main(void)
{
pid_t pid;
void *shared_memory; /* shared memory base address */
int *buffer; /* logical base address for buffer */
int *in; /* pointer to logical 'in' address for producer */
int *out; /* pointer to logical 'out' address for consumer */
shared_memory = create_shared_memory();
/* The segment of shared memory is organised as:
* 0 n-1 n n+1
* ----------------------------------------------------------------
* | | | |
* ----------------------------------------------------------------
* ^ ^ ^
* buffer in out
*/
buffer = (int *) shared_memory;
in = (int *) shared_memory + BUFFER_SIZE * INTEGER_SIZE;
out = (int *) shared_memory + (BUFFER_SIZE + 1) * INTEGER_SIZE;
*in = *out = 0; /* starting index */
if (-1 == (pid = fork())) {
handle_fatal_error("Error using fork()\n");
}
if (0 == pid) {
manage_child(buffer, in, out);
} else {
manage_parent(buffer, in, out);
}
exit(EXIT_SUCCESS);
}
|
alainlebret/os
|
exemplier/6_interprocess/shared_memory/mmap_buffer_02.c
|
C
|
apache-2.0
| 4,964
|
#!/usr/bin/ruby
#
# Author:: api.sgomes@gmail.com (Sérgio Gomes)
#
# Copyright:: Copyright 2011, Google Inc. All Rights Reserved.
#
# 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.
#
# This example gets a bid landscape for an ad group and a criterion. To get ad
# groups, run get_all_ad_groups.rb. To get criteria, run
# get_all_ad_group_criteria.rb.
#
# Tags: BidLandscapeService.getBidLandscape
require 'rubygems'
gem 'google-adwords-api'
require 'adwords_api'
API_VERSION = :v201003
def get_criterion_bid_landscapes()
# AdwordsApi::Api will read a config file from ENV['HOME']/adwords_api.yml
# when called without parameters.
adwords = AdwordsApi::Api.new
# To enable logging of SOAP requests, set the log_level value to 'DEBUG' in
# the configuration file or provide your own logger:
# adwords.logger = Logger.new('adwords_xml.log')
bid_landscape_srv = adwords.service(:BidLandscapeService, API_VERSION)
ad_group_id = 'INSERT_ADGROUP_ID_HERE'.to_i
criterion_id = 'INSERT_CRITERION_ID_HERE'.to_i
# Get criterion bid landscape.
selector = {
# The 'xsi_type' field allows you to specify the xsi:type of the object
# being created. It's only necessary when you must provide an explicit
# type that the client library can't infer.
:xsi_type => 'CriterionBidLandscapeSelector',
:id_filters => [{
:ad_group_id => ad_group_id,
:criterion_id => criterion_id
}]
}
bid_landscapes = bid_landscape_srv.get_bid_landscape(selector)
if bid_landscapes
puts "#{bid_landscapes.length} bid landscape(s) retrieved."
bid_landscapes.each do |bid_landscape|
puts "Retrieved criterion bid landscape with ad group id " +
"'#{bid_landscape[:ad_group_id]}', criterion id " +
"'#{bid_landscape[:criterion_id]}', start date " +
"'#{bid_landscape[:start_date]}', end date "+
"'#{bid_landscape[:end_date]}', with landscape points:"
bid_landscape[:landscape_points].each do |point|
puts " #{point[:bid][:micro_amount]} => clicks: #{point.clicks}, " +
"cost: #{point[:cost][:micro_amount]}, marginalCpc: " +
"#{point[:marginal_cpc][:micro_amount]}, impressions: " +
"#{point[:impressions]}"
end
end
else
puts "No bid landscapes retrieved."
end
end
if __FILE__ == $0
begin
get_criterion_bid_landscapes()
# Connection error. Likely transitory.
rescue Errno::ECONNRESET, SOAP::HTTPStreamError, SocketError => e
puts 'Connection Error: %s' % e
puts 'Source: %s' % e.backtrace.first
# API Error.
rescue AdwordsApi::Errors::ApiException => e
puts 'API Exception caught.'
puts 'Message: %s' % e.message
puts 'Code: %d' % e.code if e.code
puts 'Trigger: %s' % e.trigger if e.trigger
puts 'Errors:'
if e.errors
e.errors.each_with_index do |error, index|
puts ' %d. Error type is %s. Fields:' % [index + 1, error[:xsi_type]]
error.each_pair do |field, value|
if field != :xsi_type
puts ' %s: %s' % [field, value]
end
end
end
end
end
end
|
chromeragnarok/adwords_api
|
examples/v201003/get_criterion_bid_landscape.rb
|
Ruby
|
apache-2.0
| 3,713
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="-//W3C//DTD XHTML 1.1//EN" xml:lang="en" xsi:schemaLocation="http://www.w3.org/1999/xhtml http://www.w3.org/MarkUp/SCHEMA/xhtml11.xsd">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"></meta>
<meta name="google-site-verification" content="_bMOCDpkx9ZAzBwb2kF3PRHbfUUdFj2uO8Jd1AXArz4"></meta>
<title>ImageMagick: MagickCore, C API for ImageMagick: Deprecated Methods</title>
<meta http-equiv="content-language" content="en-US"></meta>
<meta http-equiv="content-type" content="text/html; charset=utf-8"></meta>
<meta http-equiv="reply-to" content="magick-users@imagemagick.org"></meta>
<meta name="application-name" content="ImageMagick"></meta>
<meta name="description" content="Use ImageMagick to convert, edit, or compose bitmap images in a variety of formats. In addition, resize, rotate, shear, distort or transform images automagically."></meta>
<meta name="application-url" content="http://www.imagemagick.org"></meta>
<meta name="generator" content="PHP"></meta>
<meta name="keywords" content="magickcore, c, api, for, imagemagick:, deprecated, methods, ImageMagick, PerlMagick, image processing, OpenMP, software development library, image, photo, software, Magick++, MagickWand"></meta>
<meta name="rating" content="GENERAL"></meta>
<meta name="robots" content="INDEX, FOLLOW"></meta>
<meta name="generator" content="ImageMagick Studio LLC"></meta>
<meta name="author" content="ImageMagick Studio LLC"></meta>
<meta name="revisit-after" content="2 DAYS"></meta>
<meta name="resource-type" content="document"></meta>
<meta name="copyright" content="Copyright (c) 1999-2012 ImageMagick Studio LLC"></meta>
<meta name="distribution" content="Global"></meta>
<link rel="icon" href="../../images/wand.png"></link>
<link rel="shortcut icon" href="../../images/wand.ico" type="images/x-icon"></link>
<link rel="canonical" href="../../index.html"></link>
<link rel="meta" type="application/rdf+xml" title="ICI" href="http://imagemagick.org/ici.rdf"></link>
<!-- Add jQuery library -->
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js"></script>
<!-- Add mousewheel plugin (this is optional) -->
<script type="text/javascript" src="http://www.imagemagick.org/fancybox/lib/jquery.mousewheel-3.0.6.pack.js"></script>
<!-- Add fancyBox -->
<link rel="stylesheet" href="http://www.imagemagick.org/fancybox/source/jquery.fancybox.css?v=2.0.6" type="text/css" media="screen"></link>
<script type="text/javascript" src="http://www.imagemagick.org/fancybox/source/jquery.fancybox.pack.js?v=2.0.6"></script>
<!-- Optionally add helpers - button, thumbnail and/or media -->
<link rel="stylesheet" href="http://www.imagemagick.org/fancybox/source/helpers/jquery.fancybox-buttons.css?v=1.0.2" type="text/css" media="screen"></link>
<script type="text/javascript" src="http://www.imagemagick.org/fancybox/source/helpers/jquery.fancybox-buttons.js?v=1.0.2"></script>
<script type="text/javascript" src="http://www.imagemagick.org/fancybox/source/helpers/jquery.fancybox-media.js?v=1.0.0"></script>
<link rel="stylesheet" href="http://www.imagemagick.org/fancybox/source/helpers/jquery.fancybox-thumbs.css?v=2.0.6" type="text/css" media="screen"></link>
<script type="text/javascript" src="http://www.imagemagick.org/fancybox/source/helpers/jquery.fancybox-thumbs.js?v=2.0.6"></script>
<script type="text/javascript">
$(document).ready(function() {
$(".fancybox").fancybox();
});
</script>
<!-- ImageMagick style -->
<style type="text/css" media="all">
@import url("../../www/magick.css");
</style>
</head>
<body id="www-imagemagick-org">
<div class="titlebar">
<div style="margin: 17px auto; float: left;">
<script type="text/javascript">
<!--
google_ad_client = "pub-3129977114552745";
google_ad_slot = "5439289906";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
</div>
<a href="../../discourse-server">
<img src="../../images/logo.jpg" alt="ImageMagick Logo" style="width: 123px; height: 118px; border: 0px; float: right;"></img></a>
<a href="../../index.html">
<img src="../../images/sprite.jpg" alt="ImageMagick Sprite" style="width: 114px; height: 118px; border: 0px; float: right;"></img></a>
</div>
<div class="westbar">
<div class="menu">
<a title="About ImageMagick" href="../../index.html">About ImageMagick</a>
</div>
<div class="menu">
<a title="Binary Releases" href="../../www/binary-releases.html">Binary Releases</a>
</div>
<div class="sub">
<a title="Binary Release: Unix" href="../../www/binary-releases.html#unix">Unix</a>
</div>
<div class="sub">
<a title="Binary Release: MacOS X" href="../../www/binary-releases.html#macosx">Mac OS X</a>
</div>
<div class="sub">
<a title="Binary Release: iOS" href="../../www/binary-releases.html#iOS">iOS</a>
</div>
<div class="sub">
<a title="Binary Release: Windows" href="../../www/binary-releases.html#windows">Windows</a>
</div>
<div class="sep"></div>
<div class="menu">
<a title="Command-line Tools" href="../../www/command-line-tools.html">Command-line Tools</a>
</div>
<div class="sub">
<a title="Command-line Tools: Processing" href="../../www/command-line-processing.html">Processing</a>
</div>
<div class="sub">
<a title="Command-line Tools: Options" href="../../www/command-line-options.html">Options</a>
</div>
<div class="sub">
<a title="Command-line Tools: Usage" href="http://www.imagemagick.org/Usage/">Usage</a>
</div>
<div class="menu">
<a title="Program Interfaces" href="../../www/api.html">Program Interfaces</a>
</div>
<div class="sub">
<a title="Program Interface: MagickWand" href="../../www/magick-wand.html">MagickWand</a>
</div>
<div class="sub">
<a title="Program Interface: MagickCore" href="../../www/magick-core.html">MagickCore</a>
</div>
<div class="sub">
<a title="Program Interface: PerlMagick" href="../../www/perl-magick.html">PerlMagick</a>
</div>
<div class="sub">
<a title="Program Interface: Magick++" href="../../www/magick++.html">Magick++</a>
</div>
<div class="sep"></div>
<div class="menu">
<a title="Install from Source" href="../../www/install-source.html">Install from Source</a>
</div>
<div class="sub">
<a title="Install from Source: Unix" href="../../www/install-source.html#unix">Unix</a>
</div>
<div class="sub">
<a title="Install from Source: Windows" href="../../www/install-source.html#windows">Windows</a>
</div>
<div class="menu">
<a title="Resources" href="../../www/resources.html">Resources</a>
</div>
<div class="menu">
<a title="Architecture" href="../../www/architecture.html">Architecture</a>
</div>
<div class="menu">
<a title="Download" href="../../www/download.html">Download</a>
</div>
<div class="sep"></div>
<div class="menu">
<a title="Search" href="http://www.imagemagick.org/script/search.php">Search</a>
</div>
<div class="sep"></div>
<div class="menu">
<a title="Site Map" href="../../www/sitemap.html">Site Map</a>
</div>
<div class="sub">
<a title="Site Map: Links" href="../../www/links.html">Links</a>
</div>
<div class="sep"></div>
<div class="menu">
<a title="Support ImageMagick Development" href="../../www/support.html">Support ImageMagick Development</a>
</div>
</div>
<div class="eastbar">
<div> <a class="FlattrButton" style="display:none;" rev="flattr;button:compact;" href="../../index.html"></a></div>
<noscript>
<a href="http://flattr.com/thing/947300/Convert-Edit-And-Compose-Images" target="_blank">
<img src="http://api.flattr.com/button/flattr-badge-large.png" alt="Flattr this" title="Flattr this" width="93" height="20" border="0"></img></a>
</noscript>
</div>
<div class="main">
<h1>Module Methods</h1>
<p class="navigation-index">[<a href="deprecate.html#"></a>]</p>
</div>
<div id="linkbar">
<span id="linkbar-west"> </span>
<span id="linkbar-center">
<a href="../../discourse-server">Discourse Server</a> •
<a href="http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x89AB63D48277377A">Public Key</a> •
<a href="http://www.imagemagick.org/MagickStudio/scripts/MagickStudio.cgi">Studio</a> •
<a href="http://jqmagick.imagemagick.org/">JqMagick</a>
</span>
<span id="linkbar-east"> </span>
</div>
<div class="footer">
<span id="footer-west">© 1999-2013 ImageMagick Studio LLC</span>
<span id="footer-east"> <a href="../../www/contact.html">Contact the Wizards</a></span>
</div>
<div style="clear: both; margin: 0; width: 100%; "></div>
</body>
</html>
|
Distrotech/ImageMagick
|
www/api/deprecate.html
|
HTML
|
apache-2.0
| 8,838
|
package com.suzhou.carmanager.ui.activity;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.os.Environment;
import android.support.annotation.Nullable;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.util.TypedValue;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.Toast;
import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
import com.jph.takephoto.compress.CompressConfig;
import com.jph.takephoto.model.TImage;
import com.jph.takephoto.model.TResult;
import com.suzhou.carmanager.AppHelper;
import com.suzhou.carmanager.Constants;
import com.suzhou.carmanager.R;
import com.suzhou.carmanager.adapter.LogPhotoAdapter;
import com.suzhou.carmanager.adapter.OrderAdapter;
import com.suzhou.carmanager.base.BaseActivity;
import com.suzhou.carmanager.entity.AssignOrderLog;
import com.suzhou.carmanager.entity.FileInfo;
import com.suzhou.carmanager.entity.NetMessageVO;
import com.suzhou.carmanager.entity.OperateBtn;
import com.suzhou.carmanager.entity.Order;
import com.suzhou.carmanager.entity.Task;
import com.suzhou.carmanager.entity.UploadFile;
import com.suzhou.carmanager.location.BLocationManager;
import com.suzhou.carmanager.location.Location;
import com.suzhou.carmanager.manager.UploadManager;
import com.suzhou.carmanager.network.CarApiManager;
import com.suzhou.carmanager.network.HttpData;
import com.suzhou.carmanager.network.RxJava.MySubscriber;
import com.suzhou.carmanager.stepview.StepItemData;
import com.suzhou.carmanager.stepview.StepViewLayout;
import com.suzhou.carmanager.utils.IntentUtils;
import com.suzhou.carmanager.utils.JavaUtils;
import com.suzhou.carmanager.utils.ParseJsonUtils;
import com.suzhou.carmanager.utils.UIUtils;
import com.suzhou.carmanager.view.DividerItemDecoration;
import com.suzhou.carmanager.view.GridSpacingItemDecoration;
import com.suzhou.carmanager.view.NavigationTopBar;
import java.io.File;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.Timer;
import java.util.TimerTask;
import tv.xingtu.photopicker.intent.PhotoPreviewIntent;
/**
* Created by Administrator on 2016/12/25.
*/
public class TaskDetailActivity extends BaseActivity implements View.OnClickListener, SwipeRefreshLayout.OnRefreshListener{
private static final String TAG = TaskDetailActivity.class.getSimpleName();
private Context _context;
private NavigationTopBar _navigationTopBar;
private RecyclerView _recyclerView;
private OrderAdapter _orderAdapter;
private ArrayList<Order> _orders = new ArrayList<>();
private SwipeRefreshLayout _swipeRefreshLayout;
private RelativeLayout _assignActionLayout;
private TextView _assignAction; //运单操作
private TextView _assignCostPrice;
private Task _task = new Task();
private ASSIGN_STATUS _currentAssignStatus;
private ArrayList<TImage> _photosData = new ArrayList<>();
private UploadManager _uploadManager;
private ProgressDialog _progressDialog;
private Timer mCheckUploadProgressTimer;
private TimerTask mCheckUploadProgressTimerTask;
private Order _currentOrder = null;
private OperateBtn _currentOperateBtn = null;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_task_detail);
_context = TaskDetailActivity.this;
_uploadManager = new UploadManager();
_swipeRefreshLayout = (SwipeRefreshLayout) findViewById(R.id.swipe_refresh_layout);
_swipeRefreshLayout.setProgressViewOffset(false, 0, (int) TypedValue
.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 24, getResources().getDisplayMetrics()));
_swipeRefreshLayout.setOnRefreshListener(this);
_assignActionLayout = (RelativeLayout) findViewById(R.id.detail_assign_action_layout);
_assignAction = (TextView) findViewById(R.id.detail_assign_action);
_assignCostPrice = (TextView) findViewById(R.id.detail_price_cost);
_assignAction.setOnClickListener(this);
_navigationTopBar = (NavigationTopBar) getSupportFragmentManager().findFragmentByTag(NavigationTopBar.class.getSimpleName());
_navigationTopBar.setViewVisibility(NavigationTopBar.NAVIGATION_VIEWS.RIGHT, View.GONE);
_navigationTopBar.setViewVisibility(NavigationTopBar.NAVIGATION_VIEWS.RIGHT_BARGE_TEXT, View.GONE);
_navigationTopBar.setViewVisibility(NavigationTopBar.NAVIGATION_VIEWS.LEFT, View.VISIBLE);
_navigationTopBar.setText(NavigationTopBar.NAVIGATION_VIEWS.TITLE, R.string.activity_task_detail_title);
_navigationTopBar.setClickListener(NavigationTopBar.NAVIGATION_VIEWS.LEFT, new View.OnClickListener() {
@Override
public void onClick(View view) {
onBackPressed();
}
});
_recyclerView = (RecyclerView) findViewById(R.id.detail_order_recycle_view);
_recyclerView.setLayoutManager(new LinearLayoutManager(_context));
DividerItemDecoration itemDecoration = new DividerItemDecoration(_context, LinearLayoutManager.VERTICAL, R.drawable.recycle_item_divider_8);
_recyclerView.addItemDecoration(itemDecoration);
_orderAdapter = new OrderAdapter(_context, _orders);
_orderAdapter.setOrderActionClickListener(new OrderAdapter.OrderActionClickListener() {
@Override
public void onItemClick(Order order) {
Intent intent = new Intent(_context, OrderDetailActivity.class);
intent.putExtra(Constants.ASSIGN_ID, _task.getAssignId());
intent.putExtra(Constants.ORDER_NO, order.getOrderCode());
startActivity(intent);
}
// @Override
// public void onPostExceptionClick(Order order) {
// Intent intent = new Intent(TaskDetailActivity.this, PostExceptionActivity.class);
// intent.putExtra(Constants.EXCEPTION_ID, _task.getAssignId());
// intent.putExtra(Constants.EXCEPTION_NO, order.getOrderCode());
// intent.putExtra(Constants.EXCEPTION_TYPE, 2);
// startActivityForResult(intent, Constants.POST_EXCEPTION_CODE);
// }
//
// @Override
// public void onOrderStatusClick(final Order order, final OperateBtn operateBtn) {
// handlerOperateBtn(order, operateBtn);
// }
//
// @Override
// public void onCheckFileClick(Order order) {
// Intent intent = new Intent(TaskDetailActivity.this, FileListActivity.class);
// intent.putExtra(Constants.FILE_LIST, (Serializable) order.getFileList());
// startActivity(intent);
// }
//
// @Override
// public void onCallPhoneClick(final String phoneNumber) {
// UIUtils.showPromptDialog(_context, null, phoneNumber, "呼叫", "取消",
// null,
// new View.OnClickListener() {
// @Override
// public void onClick(View v) {
// IntentUtils.call(TaskDetailActivity.this, phoneNumber);
// }
// }, true);
// }
});
String assignId = getIntent().getStringExtra(Constants.ASSIGN_ID);
getOrderDetail(assignId);
}
private void setHeader(RecyclerView view, Task task, List<Order> orders) {
View header = LayoutInflater.from(this).inflate(R.layout.view_header_assign, view, false);
TextView assignIdText = (TextView) header.findViewById(R.id.detail_assign_id);
TextView orderCountsText = (TextView) header.findViewById(R.id.detail_order_counts);
TextView assignStatusText = (TextView) header.findViewById(R.id.detail_assign_status);
TextView assignTypeText = (TextView) header.findViewById(R.id.detail_assign_type_name);
TextView pickTimeText = (TextView) header.findViewById(R.id.detail_assign_pickup_time);
TextView deliverTimeText = (TextView) header.findViewById(R.id.detail_assign_delivery_time);
TextView totalNumText = (TextView) header.findViewById(R.id.detail_assign_total_num);
TextView totalWeightText = (TextView) header.findViewById(R.id.detail_assign_total_weight);
TextView exceptionMsgText = (TextView) header.findViewById(R.id.detail_assign_exception_msg);
TextView addressText = (TextView) header.findViewById(R.id.detail_address);
if (task.getHasException() == 1) { //有一场
if (task.getExceptionMsg() != null && !task.getExceptionMsg().isEmpty()) {
exceptionMsgText.setVisibility(View.VISIBLE);
exceptionMsgText.setText(task.getExceptionMsg());
}
}
orderCountsText.setText(String.format(getString(R.string.detail_text_order_number), orders.size()));
assignStatusText.setText(task.getTransStatusName());
assignIdText.setText(String.format(getString(R.string.detail_text_assign_code), task.getAssignCode()));
assignTypeText.setText(String.format(getString(R.string.detail_text_assign_type), task.getSupervisedStatusName()));
pickTimeText.setText(task.getPickupTimeStr());
deliverTimeText.setText(task.getDeliveryTimeStr());
_assignCostPrice.setText(JavaUtils.formatNumber(task.getDriverCostPrice()));
// pickTimeText.setText(String.format(getString(R.string.detail_text_pick_up_time), task.getPickupTimeStr()));
// deliverTimeText.setText(String.format(getString(R.string.detail_text_deliver_time), task.getDeliveryTimeStr()));
totalNumText.setText(String.format(getString(R.string.detail_text_total_number), task.getTotalNumber()));
totalWeightText.setText(String.format(getString(R.string.detail_text_total_weight), String.valueOf(task.getTotalWeight())));
addressText.setText(task.getTransCompanyName());
_orderAdapter.setHeaderView(header);
}
private void setFooter(RecyclerView view, List<AssignOrderLog> logs) {
View footer = LayoutInflater.from(this).inflate(R.layout.view_footer_logs, view, false);
final StepViewLayout logsStepView = (StepViewLayout) footer.findViewById(R.id.footer_logs_step_view);
initLogsStepView(logsStepView, logs);
LinearLayout expandAction = (LinearLayout) footer.findViewById(R.id.logs_expand_action);
// expandAction.setOnClickListener(new View.OnClickListener() {
// @Override
// public void onClick(View view) {
//
// int lastItem = ((LinearLayoutManager) _recyclerView.getLayoutManager()).findLastVisibleItemPosition();
//
// if (logsStepView.getVisibility() == View.GONE) {
// logsExpandImage.setImageResource(R.drawable.icon_top_arrow);
// logsStepView.setVisibility(View.VISIBLE);
//
// moveToPosition((LinearLayoutManager) _recyclerView.getLayoutManager(), lastItem);
// } else {
// logsExpandImage.setImageResource(R.drawable.icon_bottom_arrow);
// logsStepView.setVisibility(View.GONE);
//
// moveToPosition((LinearLayoutManager) _recyclerView.getLayoutManager(), lastItem - 1);
// }
// }
// });
_orderAdapter.setFooterView(footer);
}
public void moveToPosition(LinearLayoutManager manager, int n) {
// manager.scrollToPositionWithOffset(n, 0);
// manager.setStackFromEnd(true);
}
@Override
public void takeSuccess(TResult result) {
Log.i(TAG,"takeSuccess:" + result.getImage().getCompressPath());
_photosData.addAll(result.getImages()) ;
uploadImagesToServer(result.getImages());
}
private void initLogsStepView(StepViewLayout stepViewLayout, List<AssignOrderLog> logs) {
final List<StepItemData> log_datas = new ArrayList<>();
for (int i = logs.size() - 1; i >= 0; i --) {
StepItemData log_data = new StepItemData();
log_data.setMsg(logs.get(i).getContent());
log_data.setDate(logs.get(i).getLogTimeStr());
log_data.setLogType(logs.get(i).getLogType());
// List<FileInfo> fileInfos = new ArrayList<>();
// for (int j = 0; j < 10; j ++) {
// FileInfo fileInfo = new FileInfo();
// fileInfo.setFileUrl("https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1488690978374&di=81239c11bd0851379e9415d40ab55f6c&imgtype=0&src=http%3A%2F%2Fwww.sdshangcai.com%2Fuploads%2F1459575085.jpg");
// fileInfos.add(fileInfo);
// log_data.setFileList(fileInfos);
// }
log_data.setFileList(logs.get(i).getFileList());
log_datas.add(log_data);
}
stepViewLayout.setDataAndView(log_datas, R.layout.custom_logs_text_layout, new StepViewLayout.InflateContentListener() {
@Override
public void onContentInflate(int position, View contentView) {
StepItemData data = log_datas.get(position);
TextView topLogText = (TextView) contentView.findViewById(R.id.top_log_text);
topLogText.setText(data.getMsg());
TextView bottomLogText = (TextView) contentView.findViewById(R.id.bottom_log_text);
bottomLogText.setVisibility(View.VISIBLE);
bottomLogText.setText(data.getDate());
if (data.getFileList() != null && data.getFileList().size() > 0) {
RecyclerView recyclerView = (RecyclerView) contentView.findViewById(R.id.logs_photo_list);
GridLayoutManager gridLayoutManager = new GridLayoutManager(_context, 5);
recyclerView.setLayoutManager(gridLayoutManager);
recyclerView.addItemDecoration(new GridSpacingItemDecoration(5, 10, false));
LogPhotoAdapter logPhotoAdapter = new LogPhotoAdapter(_context, data.getFileList());
logPhotoAdapter.setLogPhotoItemClickListener(new LogPhotoAdapter.LogPhotoItemClickListener() {
@Override
public void onItemClick(List<FileInfo> fileInfos, int position) {
ArrayList<String> data = new ArrayList<>();
for (int i = 0; i < fileInfos.size(); i ++) {
data.add(fileInfos.get(i).getFileUrl());
}
PhotoPreviewIntent intent = new PhotoPreviewIntent(_context);
intent.setCurrentItem(position);
intent.setPhotoPaths(data);
startActivity(intent);
}
});
recyclerView.setAdapter(logPhotoAdapter);
}
if (data.getLogType() == 2) {
topLogText.setTextColor(getResources().getColor(R.color.colorAccent));
bottomLogText.setTextColor(getResources().getColor(R.color.colorAccent));
}
}
});
}
@Override
public void takeFail(TResult result, String msg) {
Log.i(TAG, "takeFail:" + msg);
}
@Override
public void takeCancel() {
Log.i(TAG, getResources().getString(com.jph.takephoto.R.string.msg_operation_canceled));
}
private ArrayList<Order> generateData() {
ArrayList<Order> orders = new ArrayList<>();
for (int i = 0; i < 10; i ++) {
Order order = new Order();
order.setOrderCode("FX-1021321312");
orders.add(order);
}
return orders;
}
public void setAssignView(final Task task, final List<AssignOrderLog> logs, final List<Order> orders) {
runOnUiThread(new Runnable() {
@Override
public void run() {
setHeader(_recyclerView, task, orders);
setFooter(_recyclerView, logs);
_recyclerView.setAdapter(_orderAdapter);
}
});
}
@Override
protected int getContentViewId() {
return 0;
}
@Override
protected int getFragmentContentId() {
return 0;
}
@Override
public void onClick(View view) {
switch (view.getId()) {
case R.id.detail_assign_action: //确认运单、发布异常
UIUtils.showPromptDialog(_context, "提示", "是否确认运单", "确定", "取消",
null,
new View.OnClickListener() {
@Override
public void onClick(View v) {
Location location = BLocationManager.getInstance().getLatestLocation();
confirmOrder(_task, String.valueOf(location.getLatitude()), String.valueOf(location.getLongitude()));
}
}, true);
// if (_assignAction.getText().toString().equals("确认运单")) {
// UIUtils.showPromptDialog(_context, "提示", "是否确认运单", "确定", "取消",
// null,
// new View.OnClickListener() {
// @Override
// public void onClick(View v) {
// Location location = BLocationManager.getInstance().getLatestLocation();
// confirmOrder(_task, String.valueOf(location.getLatitude()), String.valueOf(location.getLongitude()));
//
// }
// }, true);
// } else if (_assignAction.getText().toString().equals("发布异常")) {
// Intent intent = new Intent(TaskDetailActivity.this, PostExceptionActivity.class);
// intent.putExtra(Constants.EXCEPTION_ID, _task.getAssignId());
// intent.putExtra(Constants.EXCEPTION_NO, _task.getAssignCode());
// intent.putExtra(Constants.EXCEPTION_TYPE, 1);
// startActivityForResult(intent, Constants.POST_EXCEPTION_CODE);
// }
break;
}
}
@Override
public void onRefresh() {
getOrderDetail(_task.getAssignId());
}
//运单状态枚举
public enum ASSIGN_STATUS {
UN_CONFIRM, CONFIRMED, PICKING, RUNNING, COMPLETED, EXCEPTION, ACTIONS
}
public enum ORDER_STATUS {
}
//运单状态改变逻辑
private void changeAssignStatus(ASSIGN_STATUS assign_status) {
_currentAssignStatus = assign_status;
switch (assign_status) {
case UN_CONFIRM:
_assignActionLayout.setVisibility(View.VISIBLE);
// _assignAction.setText("确认运单");
break;
case CONFIRMED:
_assignActionLayout.setVisibility(View.GONE);
// _assignAction.setText("发布异常");
break;
case COMPLETED:
_assignActionLayout.setVisibility(View.GONE);
// _assignAction.setText("订单完成");
break;
case ACTIONS:
_assignActionLayout.setVisibility(View.GONE);
// _assignAction.setText("发布异常");
break;
}
}
public ASSIGN_STATUS getCurrentAssignStatus() {
return _currentAssignStatus;
}
private List<Order> handlerExpand(List<Order> orders) {
for (int i = 0; i < _orderAdapter.getData().size(); i ++) {
for (int j = 0; j < orders.size(); j ++) {
if (_orderAdapter.getData().get(i).getOrderCode().equals(orders.get(j).getOrderCode())) {
orders.get(j).setIsExpand(_orderAdapter.getData().get(i).getIsExpand());
}
}
}
return orders;
}
private void handlerOperateBtn(final Order order, final OperateBtn operateBtn) {
final Location location = BLocationManager.getInstance().getLatestLocation();
_currentOrder = order;
_currentOperateBtn = operateBtn;
switch (operateBtn.getBtnType()) {
case Constants.HAS_PICK_FILE://已取文件
UIUtils.showPromptDialog(_context, "提示", "确定已取文件?", "是", "否", null,
new View.OnClickListener() {
@Override
public void onClick(View v) {
operateOrder(_task.getAssignId(), order.getOrderCode(), location.getLatitude(), location.getLongitude(),
operateBtn.getBtnType(), -1, new JsonArray());
}
}, true);
break;
case Constants.HAS_REACH_PICK://到达提货地
UIUtils.showPromptDialog(_context, "提示", "确定到达提货地?", "是", "否", null,
new View.OnClickListener() {
@Override
public void onClick(View v) {
operateOrder(_task.getAssignId(), order.getOrderCode(), location.getLatitude(), location.getLongitude(),
operateBtn.getBtnType(), -1, new JsonArray());
}
}, true);
break;
case Constants.FINISH_PICKUP_GOODS://完成提货
UIUtils.showPromptDialog(_context, "提示", "确定完成提货?", "是", "否",
new View.OnClickListener() {
@Override
public void onClick(View v) {
}
},
new View.OnClickListener() {
@Override
public void onClick(View view) {
operateOrder(_task.getAssignId(), order.getOrderCode(), location.getLatitude(), location.getLongitude(),
operateBtn.getBtnType(), -1, new JsonArray());
}
}, true);
break;
case Constants.FINISH_PICKUP_GOODS_OK://完成提货
UIUtils.showPromptDialog(_context, "货物破损?", "上传破损图片", "无破损", "上传",
new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(TaskDetailActivity.this, PostExceptionActivity.class);
intent.putExtra(Constants.EXCEPTION_ID, _task.getAssignId());
intent.putExtra(Constants.EXCEPTION_NO, order.getOrderCode());
intent.putExtra(Constants.EXCEPTION_DETAIL, "CARGO_BROKEN");
intent.putExtra(Constants.EXCEPTION_TYPE, 2);
intent.putExtra(Constants.EXCEPTION_OPERATE_TYPE, operateBtn.getBtnType());
startActivityForResult(intent, Constants.POST_EXCEPTION_CODE);
}
},
new View.OnClickListener() {
@Override
public void onClick(View view) {
operateOrder(_task.getAssignId(), order.getOrderCode(), location.getLatitude(), location.getLongitude(),
operateBtn.getBtnType(), 1, new JsonArray());
}
}, true);
break;
case Constants.REACH_TERMINAL://到达场站
UIUtils.showPromptDialog(_context, "提示", "确定到达场站?", "是", "否",
new View.OnClickListener() {
@Override
public void onClick(View v) {
}
},
new View.OnClickListener() {
@Override
public void onClick(View view) {
operateOrder(_task.getAssignId(), order.getOrderCode(), location.getLatitude(), location.getLongitude(),
operateBtn.getBtnType(), -1, new JsonArray());
}
}, true);
break;
case Constants.FOR_INSPECTION://入查验库
UIUtils.showPromptDialog(_context, "提示", "确定入查验库?", "是", "否", null,
new View.OnClickListener() {
@Override
public void onClick(View v) {
operateOrder(_task.getAssignId(), order.getOrderCode(), location.getLatitude(), location.getLongitude(),
operateBtn.getBtnType(), -1, new JsonArray());
}
}, true);
break;
case Constants.HAS_DELIVERED://到达送货地
UIUtils.showPromptDialog(_context, "提示", "确定到达送货地?", "是", "否", null,
new View.OnClickListener() {
@Override
public void onClick(View v) {
operateOrder(_task.getAssignId(), order.getOrderCode(), location.getLatitude(), location.getLongitude(),
operateBtn.getBtnType(), -1, new JsonArray());
}
}, true);
break;
case Constants.HAS_COMPLETED://完成送货,上传单证
UIUtils.showPromptDialog(_context, "提示", "请上传客户签收单?", "是", "否",
null,
new View.OnClickListener() {
@Override
public void onClick(View view) {
File file = new File(Environment.getExternalStorageDirectory(), "/temp/" + System.currentTimeMillis() + ".jpg");
if (!file.getParentFile().exists()) file.getParentFile().mkdirs();
Uri imageUri = Uri.fromFile(file);
CompressConfig compressConfig = new CompressConfig.Builder().setMaxSize(50 * 1024).setMaxPixel(800).create();
getTakePhoto().onEnableCompress(compressConfig, true);
getTakePhoto().onPickFromCapture(imageUri);
}
}, true);
break;
case Constants.HAS_COMPLETED_GOODS_OK://完成送货,货物是否完损
UIUtils.showPromptDialog(_context, "货物破损?", "上传破损图片", "无破损", "上传",
new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent(TaskDetailActivity.this, PostExceptionActivity.class);
intent.putExtra(Constants.EXCEPTION_ID, _task.getAssignId());
intent.putExtra(Constants.EXCEPTION_NO, order.getOrderCode());
intent.putExtra(Constants.EXCEPTION_DETAIL, "CARGO_BROKEN");
intent.putExtra(Constants.EXCEPTION_TYPE, 2);
intent.putExtra(Constants.EXCEPTION_OPERATE_TYPE, operateBtn.getBtnType());
startActivityForResult(intent, Constants.POST_EXCEPTION_CODE);
}
},
new View.OnClickListener() {
@Override
public void onClick(View view) {
final Location location = BLocationManager.getInstance().getLatestLocation();
operateOrder(_task.getAssignId(), order.getOrderCode(), location.getLatitude(), location.getLongitude(),
operateBtn.getBtnType(), 1, new JsonArray());
}
}, false);
break;
}
}
@Override
protected void onDestroy() {
super.onDestroy();
cancelCheckUploadProgressTimeTask();
}
private void getOrderDetail(String assignId) {
MySubscriber<NetMessageVO> ss = new MySubscriber<NetMessageVO>() {
@Override
public void onNext(NetMessageVO o) {
Task task = ParseJsonUtils.getObjectFromJson(o.data.getAsJsonObject(), Task.class);
List<AssignOrderLog> logs = task.getAssignOrderLogs();
List<Order> orders = task.getOrdersList();
handlerExpand(orders);
_orderAdapter.setData(orders);
setAssignView(task, logs, orders);
_task = task;
if (task.getTransStatus().equals(Constants.TRANS_TYPE_DQR)) {
changeAssignStatus(ASSIGN_STATUS.UN_CONFIRM);
}else if (task.getTransStatus().equals(Constants.TRANS_TYPE_YQR)) {
changeAssignStatus(ASSIGN_STATUS.CONFIRMED);
} else if (task.getTransStatus().equals(Constants.TRANS_TYPE_YWC)) {
changeAssignStatus(ASSIGN_STATUS.COMPLETED);
} else {
changeAssignStatus(ASSIGN_STATUS.ACTIONS);
}
if (AppHelper.isApkDebugable(_context))
UIUtils.showToastMessage(_context, "获取详情成功!");
_swipeRefreshLayout.setRefreshing(false);
}
@Override
public void onError(Throwable e) {
super.onError(e);
// if (e.toString().contains("3002")) {
// AppHelper.restartApplication(_context);
// }
_swipeRefreshLayout.setRefreshing(false);
if (AppHelper.isApkDebugable(_context))
UIUtils.showToastMessage(_context, "获取详情失败!");
}
};
CarApiManager.getInstance().sendRequest(HttpData.InterfacesURL.ASSIGN_ORDER_DETAIL, ss,
HttpData.getAssignDetailData(assignId));
}
private void operateOrder(String assignId, String orderCode, double lat, double lng,
String operateType, Integer isGoodsFine, JsonArray fileList) {
MySubscriber<NetMessageVO> ss = new MySubscriber<NetMessageVO>() {
@Override
public void onNext(NetMessageVO o) {
_uploadManager.clearUploadData();
getOrderDetail(_task.getAssignId());
UIUtils.showToastMessage(_context, "操作成功!");
}
@Override
public void onError(Throwable e) {
super.onError(e);
_uploadManager.clearUploadData();
// if (e.toString().contains("3002")) {
// AppHelper.restartApplication(_context);
// }
UIUtils.showToastMessage(_context, "操作失败!");
}
};
CarApiManager.getInstance().sendRequest(HttpData.InterfacesURL.ASSIGN_ORDER_OPERATE, ss,
HttpData.getOperateOrdersData(assignId, orderCode, lat, lng, operateType, isGoodsFine, fileList));
}
private void confirmOrder(final Task task, String lat, String lng) {
MySubscriber<NetMessageVO> ss = new MySubscriber<NetMessageVO>() {
@Override
public void onNext(NetMessageVO o) {
UIUtils.showToastMessageShortly(_context, "确认运单成功");
getOrderDetail(task.getAssignId());
}
@Override
public void onError(Throwable e) {
super.onError(e);
// if (e.toString().contains("3002")) {
// AppHelper.restartApplication(_context);
// }
UIUtils.showToastMessage(_context, "确认运单失败!");
}
};
CarApiManager.getInstance().sendRequest(HttpData.InterfacesURL.ASSIGN_ORDER_CONFIRM, ss,
HttpData.getConfirmOrderData(task.getAssignId(), lat, lng));
}
private void uploadImagesToServer(final ArrayList<TImage> list) {
if (list != null && list.size() > 0) {
if (list.size() == 1) {
_uploadManager.sendRequestForUpload(new File(list.get(0).getCompressPath()), new UploadManager.UploadCallBack() {
@Override
public void onSuccess(String fileId) {
_uploadManager.putSuccessUploadImage(list.get(0).getCompressPath(), fileId);
handlerCompleteLogic();
}
@Override
public void onError() {
UIUtils.showToastMessageShortly(_context, "上传失败!");
}
});
_uploadManager.addImage(list.get(0).getCompressPath());
}
}
// startCheckUploadProgressTimerTask();
showProgressDialog();
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == Constants.POST_EXCEPTION_CODE) {
getOrderDetail(_task.getAssignId());
}
}
private void handlerCompleteLogic() {
runOnUiThread(new Runnable() {
@Override
public void run() {
dismissProgressDialog();
final Location location = BLocationManager.getInstance().getLatestLocation();
operateOrder(_task.getAssignId(), _currentOrder.getOrderCode(), location.getLatitude(), location.getLongitude(),
_currentOperateBtn.getBtnType(), 1, getPhotoNameFromData());
_photosData.clear();
}
});
// runOnUiThread(new Runnable() {
// @Override
// public void run() {
// UIUtils.showPromptDialog(_context, "提示", "是否继续上传签收单?", "是", "否",
// new View.OnClickListener() {
// @Override
// public void onClick(View view) {
// UIUtils.showPromptDialog(_context, "提示", "货物是否完好无损?", "是", "否",
// new View.OnClickListener() {
// @Override
// public void onClick(View view) {
//
// Intent intent = new Intent(TaskDetailActivity.this, PostExceptionActivity.class);
// intent.putExtra(Constants.EXCEPTION_ID, _task.getAssignId());
// intent.putExtra(Constants.EXCEPTION_NO, _currentOrder.getOrderCode());
// intent.putExtra(Constants.EXCEPTION_DETAIL, "CARGO_BROKEN");
// intent.putExtra(Constants.EXCEPTION_TYPE, 2);
// startActivity(intent);
// _photosData.clear();
//
// }
// },
// new View.OnClickListener() {
// @Override
// public void onClick(View view) {
//
//// Log.d(TAG, "handlerCompleteLogic getBtnType --> " + _currentOperateBtn.getBtnType());
//// Log.d(TAG, "handlerCompleteLogic getPhotoNameFromData --> " + getPhotoNameFromData());
// final Location location = BLocationManager.getInstance().getLatestLocation();
// operateOrder(_task.getAssignId(), _currentOrder.getOrderCode(), location.getLatitude(), location.getLongitude(),
// _currentOperateBtn.getBtnType(), 1, getPhotoNameFromData());
//
// _photosData.clear();
//
// }
// }, false);
// }
// },
// new View.OnClickListener() {
// @Override
// public void onClick(View view) {
// File file = new File(Environment.getExternalStorageDirectory(), "/temp/" + System.currentTimeMillis() + ".jpg");
// if (!file.getParentFile().exists()) file.getParentFile().mkdirs();
// Uri imageUri = Uri.fromFile(file);
// CompressConfig compressConfig = new CompressConfig.Builder().setMaxSize(50 * 1024).setMaxPixel(800).create();
// getTakePhoto().onEnableCompress(compressConfig, true);
// getTakePhoto().onPickFromCapture(imageUri);
//
//
// }
// }, false);
// }
// });
}
private JsonArray getPhotoNameFromData() {
ArrayList<String> data = new ArrayList<>();
for (int i = 0; i < _photosData.size(); i ++) {
data.add(_photosData.get(i).getCompressPath());
}
ArrayList<UploadFile> uploadFiles = _uploadManager.getFinalUploadedImages(data);
JsonArray photos = new JsonArray();
for (int i = 0; i < uploadFiles.size(); i++) {
JsonObject jsonObject = new JsonObject();
jsonObject.addProperty("fileId", uploadFiles.get(i).getFileId().toString());
photos.add(jsonObject);
}
return photos;
}
private void startCheckUploadProgressTimerTask() {
if (mCheckUploadProgressTimerTask == null) {
mCheckUploadProgressTimerTask = new TimerTask() {
@Override
public void run() {
Log.d(TAG, "startCheckUploadProgressTimerTask");
if (_uploadManager.isUpLoadEnd()) {
final Location location = BLocationManager.getInstance().getLatestLocation();
switch (_currentOperateBtn.getBtnType()) {
case Constants.FINISH_PICKUP_GOODS:
operateOrder(_task.getAssignId(), _currentOrder.getOrderCode(), location.getLatitude(),
location.getLongitude(), _currentOperateBtn.getBtnType(), 0, getPhotoNameFromData());
break;
case Constants.HAS_COMPLETED:
UIUtils.showPromptDialog(_context, "货物破损?", "上传破损图片", "无破损", "上传",
new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent(TaskDetailActivity.this, PostExceptionActivity.class);
intent.putExtra(Constants.EXCEPTION_ID, _task.getAssignId());
intent.putExtra(Constants.EXCEPTION_NO, _currentOrder.getOrderCode());
intent.putExtra(Constants.EXCEPTION_DETAIL, "CARGO_BROKEN");
intent.putExtra(Constants.EXCEPTION_TYPE, 2);
startActivityForResult(intent, Constants.POST_EXCEPTION_CODE);
}
},
new View.OnClickListener() {
@Override
public void onClick(View view) {
operateOrder(_task.getAssignId(), _currentOrder.getOrderCode(), location.getLatitude(), location.getLongitude(),
_currentOperateBtn.getBtnType(), 1, getPhotoNameFromData());
}
}, true);
break;
}
dismissProgressDialog();
cancelCheckUploadProgressTimeTask();
}
}
};
mCheckUploadProgressTimer = new Timer();
mCheckUploadProgressTimer.schedule(mCheckUploadProgressTimerTask, 0, 1000);
}
}
public void cancelCheckUploadProgressTimeTask() {
Log.d(TAG, "cancelCheckUploadProgressTimeTask");
if (mCheckUploadProgressTimerTask != null) {
mCheckUploadProgressTimerTask.cancel();
}
if (mCheckUploadProgressTimer != null) {
mCheckUploadProgressTimer.cancel();
mCheckUploadProgressTimer.purge();
}
mCheckUploadProgressTimerTask = null;
mCheckUploadProgressTimer = null;
}
private void showProgressDialog() {
_progressDialog = ProgressDialog.show(_context, "提示", "正在上传照片", false, false);
}
private void dismissProgressDialog() {
_progressDialog.dismiss();
}
}
|
v-jibfen/CarManager
|
CarManager/CarManager/app/src/main/java/com/suzhou/carmanager/ui/activity/TaskDetailActivity.java
|
Java
|
apache-2.0
| 43,003
|
/*
*
* TagsBar
*
*/
import { FC } from 'react'
import { keys, reverse } from 'ramda'
import { pluggedIn } from '@/utils/mobx'
import { buildLog } from '@/utils/logger'
import type { TProps as TTagProps } from '../index'
import GobackTag from './GobackTag'
import Folder from './Folder'
import { Wrapper } from '../styles/desktop_view'
import { useInit, onTagSelect } from '../logic'
/* eslint-disable-next-line */
const log = buildLog('C:TagsBar')
type TProps = Omit<TTagProps, 'view'>
const TagsBarContainer: FC<TProps> = ({ tagsBar: store, onSelect }) => {
useInit(store)
const {
groupedTags,
tagsData,
activeTagData,
maxDisplayCount,
totalCountThrold,
} = store
const groupsKeys = reverse(keys(groupedTags)) as string[]
return (
<Wrapper>
{activeTagData.title && (
<GobackTag
onSelect={(tag) => {
onTagSelect(tag)
onSelect?.()
}}
/>
)}
{groupsKeys.map((groupKey) => (
<Folder
key={groupKey}
title={groupKey}
groupTags={groupedTags[groupKey]}
allTags={tagsData}
activeTag={activeTagData}
maxDisplayCount={maxDisplayCount}
totalCountThrold={totalCountThrold}
onSelect={(tag) => {
onTagSelect(tag)
onSelect?.()
}}
/>
))}
</Wrapper>
)
}
export default pluggedIn(TagsBarContainer) as FC<TProps>
|
mydearxym/mastani
|
src/containers/unit/TagsBar/DesktopView/index.tsx
|
TypeScript
|
apache-2.0
| 1,462
|
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8"/>
<link href="default.css" rel="stylesheet" type="text/css" />
</head>
<body>
<p class="ja">ゲート
か
… めずらしい
ねぇ
。
</p>
<p class="translation">I already have it. Youhou! </p>
</body></html>
|
riccardove/easyjasub
|
easyjasub-lib/samples/html/onlyfurigana/sample1/line0049.html
|
HTML
|
apache-2.0
| 305
|
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.544
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace pjank.BossaAPI.DemoApp.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default {
get {
return defaultInstance;
}
}
}
}
|
rafalkrupinski/bossa-api.net
|
Examples/DemoApp/Properties/Settings.Designer.cs
|
C#
|
apache-2.0
| 1,103
|
package com.jukusoft.libgdx.rpg.game.screen;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.assets.AssetManager;
import com.badlogic.gdx.audio.Music;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.BitmapFont;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.graphics.glutils.ShapeRenderer;
import com.badlogic.gdx.scenes.scene2d.Stage;
import com.badlogic.gdx.scenes.scene2d.ui.ScrollPane;
import com.badlogic.gdx.scenes.scene2d.ui.Skin;
import com.badlogic.gdx.scenes.scene2d.ui.VerticalGroup;
import com.jukusoft.libgdx.rpg.engine.font.BitmapFontFactory;
import com.jukusoft.libgdx.rpg.engine.game.ScreenBasedGame;
import com.jukusoft.libgdx.rpg.engine.save.BrokenSavedGameInfo;
import com.jukusoft.libgdx.rpg.engine.save.IBrokenSavedGameInfo;
import com.jukusoft.libgdx.rpg.engine.save.SavedGameInfo;
import com.jukusoft.libgdx.rpg.engine.save.SavedGameInstance;
import com.jukusoft.libgdx.rpg.engine.screen.impl.BaseScreen;
import com.jukusoft.libgdx.rpg.engine.skin.SkinFactory;
import com.jukusoft.libgdx.rpg.engine.time.GameTime;
import com.jukusoft.libgdx.rpg.game.shared.SharedDataConst;
import com.jukusoft.libgdx.rpg.game.ui.ImageButton;
import com.jukusoft.libgdx.rpg.game.ui.LoadButton;
import com.jukusoft.libgdx.rpg.game.ui.LoadEntityButton;
import com.jukusoft.libgdx.rpg.game.utils.AssetPathUtils;
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* Created by Justin on 08.02.2017.
*/
public class LoadGameScreen extends BaseScreen {
protected final String BG_IMAGE_PATH = AssetPathUtils.getWallpaperPath("ocean_sunset/ocean.png");
protected final String MUSIC_PATH = AssetPathUtils.getMusicPath("EssentialGameAudiopack/Loops/Drum_Only_Loops/Ove_Melaa-DrumLoop_1_64BPM.mp3");
protected final String BUTTON_BG_PATH = AssetPathUtils.getUIWidgetPath("loadbutton", "loadbutton.png");
protected final String BUTTON_HOVER_PATH = AssetPathUtils.getUIWidgetPath("loadbutton", "loadbutton_clicked.png");
protected final String BUTTON_BACK_BG_PATH = AssetPathUtils.getUIWidgetPath("backbutton", "backbutton.png");
protected final String BUTTON_BACK_HOVER_PATH = AssetPathUtils.getUIWidgetPath("backbutton", "backbutton_hovered.png");
protected final String ICON_BACK_PATH = AssetPathUtils.getImagePath("icons/back/back_64.png");
//assets
protected Texture backgroundTexture = null;
protected Music backgroundMusic = null;
protected Texture buttonTexture = null;
protected Texture hoveredTexture = null;
protected Texture backButtonTexture = null;
protected Texture backButtonHoveredTexture = null;
protected float mouseX = 0;
protected float mouseY = 0;
protected Stage stage = null;
protected BitmapFont arialFont = null;
protected Map<String,Texture> iconTextureMap = new HashMap<>();
protected List<LoadButton> loadButtonList = new ArrayList<>();
protected ImageButton backButton = null;
protected Texture iconBackTexture = null;
@Override protected void onInit(ScreenBasedGame game, AssetManager assetManager) {
//
}
@Override
public void onResume () {
this.stage = new Stage();
Gdx.input.setInputProcessor(this.stage);
//load assets
this.assetManager.load(BG_IMAGE_PATH, Texture.class);
this.assetManager.load(MUSIC_PATH, Music.class);
this.assetManager.load(BUTTON_BG_PATH, Texture.class);
this.assetManager.load(BUTTON_HOVER_PATH, Texture.class);
this.assetManager.load(BUTTON_BACK_BG_PATH, Texture.class);
this.assetManager.load(BUTTON_BACK_HOVER_PATH, Texture.class);
this.assetManager.load(ICON_BACK_PATH, Texture.class);
this.arialFont = BitmapFontFactory
.createFont(AssetPathUtils.getFontPath("arial/arial.ttf"), 26, Color.WHITE);
//wait while all assets was loaded
game.getAssetManager().finishLoading();
this.assetManager.finishLoadingAsset(BG_IMAGE_PATH);
//get assets
this.backgroundTexture = this.assetManager.get(BG_IMAGE_PATH, Texture.class);
this.backgroundMusic = this.assetManager.get(MUSIC_PATH, Music.class);
this.buttonTexture = this.assetManager.get(BUTTON_BG_PATH, Texture.class);
this.hoveredTexture = this.assetManager.get(BUTTON_HOVER_PATH, Texture.class);
this.backButtonTexture = this.assetManager.get(BUTTON_BACK_BG_PATH, Texture.class);
this.backButtonHoveredTexture = this.assetManager.get(BUTTON_BACK_HOVER_PATH, Texture.class);
this.iconBackTexture = this.assetManager.get(ICON_BACK_PATH, Texture.class);
this.assetManager.finishLoading();
//play background music
this.backgroundMusic.setVolume(game.getVolume());
this.backgroundMusic.setLooping(true);
this.backgroundMusic.play();
List<SavedGameInfo> savedGameInfoList = game.getSavedGameManager().listSavedGames(SavedGameInfo.class,
BrokenSavedGameInfo.class);
int i = 0;
float startX = (game.getViewportWidth() / 2) - 200;
float startY = 500;
for (SavedGameInfo gameInfo : savedGameInfoList) {
//only 5 entries can be shown without scrollbar
if (i >= 5) {
break;
}
/*LoadEntityButton button = new LoadEntityButton(this.backgroundTexture, gameInfo, this.uiSkin);
this.verticalGroup.addActor(button);*/
//create new load button
LoadButton<SavedGameInfo> button = new LoadButton<>(this.buttonTexture, this.hoveredTexture, this.arialFont, gameInfo);
button.setPosition(startX, startY);
if (!gameInfo.getGameIcon().isEmpty()) {
String iconPath = AssetPathUtils.getImagePath(gameInfo.getGameIcon());
Texture iconTexture = getIcon(iconPath);
if (iconTexture != null) {
button.setIcon(iconTexture);
}
} else {
if (gameInfo instanceof IBrokenSavedGameInfo) {
String iconPath = AssetPathUtils.getImagePath("icons/cancel/cancel_64.png");
Texture iconTexture = getIcon(iconPath);
if (iconTexture != null) {
button.setIcon(iconTexture);
}
button.setIcon(iconTexture);
}
}
if (!(gameInfo instanceof IBrokenSavedGameInfo)) {
button.setClickListener(() -> {
//save character name
game.getSharedData().put(SharedDataConst.CHARACTER_NAME, gameInfo.getCharacterName());
game.getSharedData().put(SharedDataConst.SAVE_PATH, gameInfo.getSaveDir());
//next screen
game.getScreenManager().leaveAllAndEnter("game");
});
}
this.loadButtonList.add(button);
startY = startY - 120;
//this.savedGameInfos[i] = gameInfo;
i++;
}
this.backButton = new ImageButton(this.backButtonTexture, this.backButtonHoveredTexture, this.arialFont, "BACK");
this.backButton.setPosition(50, 50);
this.backButton.setIcon(this.iconBackTexture);
this.backButton.setClickListener(() -> {
//leave and enter new game state
game.getScreenManager().leaveAllAndEnter("menu");
});
}
@Override
public void onPause () {
//stop background music
this.backgroundMusic.stop();
//free memory for assets
//this.backgroundTexture.dispose();
//this.backgroundTexture = null;
this.backgroundMusic.dispose();
this.backgroundMusic = null;
/*this.backButtonTexture.dispose();
this.backButtonTexture = null;
this.backButtonHoveredTexture.dispose();
this.backButtonHoveredTexture = null;
this.iconBackTexture.dispose();
this.iconBackTexture = null;*/
//dispose all icon textures
for (Map.Entry<String,Texture> entry : this.iconTextureMap.entrySet()) {
Texture texture = entry.getValue();
this.iconTextureMap.remove(entry.getKey());
texture.dispose();
texture = null;
}
}
protected Texture getIcon (String iconPath) {
if (!this.iconTextureMap.containsKey(iconPath)) {
//check, if icon exists
if (new File(iconPath).exists()) {
assetManager.load(iconPath, Texture.class);
assetManager.finishLoading();
Texture iconTexture = assetManager.get(iconPath, Texture.class);
this.iconTextureMap.put(iconPath, iconTexture);
} else {
System.out.println("icon doesnt exists: " + iconPath);
return null;
}
}
Texture iconTexture = this.iconTextureMap.get(iconPath);
return iconTexture;
}
@Override public void update(ScreenBasedGame game, GameTime time) {
//get mouse coordinates
this.mouseX = Gdx.input.getX();
this.mouseY = game.getViewportHeight() - Gdx.input.getY();
//update buttons
for (LoadButton<SavedGameInfo> button : this.loadButtonList) {
button.update(game, time);
}
this.backButton.update(game, time);
}
@Override public void draw(GameTime time, SpriteBatch batch) {
if (backgroundTexture == null) {
throw new NullPointerException("background texture is null.");
}
if (!backgroundTexture.isManaged()) {
throw new IllegalStateException("background texture isnt managed.");
}
batch.setProjectionMatrix(game.getUICamera().combined);
//draw background image
batch.draw(this.backgroundTexture, 0, 0);
//draw buttons
for (LoadButton<SavedGameInfo> button : this.loadButtonList) {
button.draw(time, batch);
}
//draw back button
this.backButton.draw(time, batch);
//draw user interface
//this.stage.draw();
}
@Override public void destroy() {
}
}
|
JuKu/libgdx-test-rpg
|
core/src/main/java/com/jukusoft/libgdx/rpg/game/screen/LoadGameScreen.java
|
Java
|
apache-2.0
| 10,377
|
/* Copyright 2016 Google Inc. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/
#include "tensorflow/core/distributed_runtime/simple_graph_execution_state.h"
#include <memory>
#include <string>
#include <unordered_set>
#include <vector>
#include "tensorflow/core/common_runtime/device.h"
#include "tensorflow/core/common_runtime/simple_placer.h"
#include "tensorflow/core/distributed_runtime/process_util.h"
#include "tensorflow/core/framework/graph_def_util.h"
#include "tensorflow/core/graph/costmodel.h"
#include "tensorflow/core/graph/dot.h"
#include "tensorflow/core/graph/graph.h"
#include "tensorflow/core/graph/graph_constructor.h"
#include "tensorflow/core/graph/subgraph.h"
#include "tensorflow/core/lib/core/errors.h"
#include "tensorflow/core/lib/core/status.h"
#include "tensorflow/core/lib/strings/stringprintf.h"
#include "tensorflow/core/platform/logging.h"
#include "tensorflow/core/platform/mutex.h"
#include "tensorflow/core/platform/types.h"
#include "tensorflow/core/protobuf/worker.pb.h"
#include "tensorflow/core/util/util.h"
namespace tensorflow {
string BuildGraphOptions::DebugString() const {
string rv = "Feed endpoints: ";
for (auto& s : feed_endpoints) {
strings::StrAppend(&rv, s, ", ");
}
strings::StrAppend(&rv, "\nFetch endpoints: ");
for (auto& s : fetch_endpoints) {
strings::StrAppend(&rv, s, ", ");
}
strings::StrAppend(&rv, "\nTarget nodes: ");
for (auto& s : target_nodes) {
strings::StrAppend(&rv, s, ", ");
}
return rv;
}
SimpleGraphExecutionState::SimpleGraphExecutionState(
const OpRegistryInterface* ops,
const SimpleGraphExecutionStateOptions& options)
: ops_(ops),
device_set_(options.device_set),
session_options_(options.session_options),
base_(nullptr),
placed_(nullptr) {
// TODO(mrry): Publish placement visualizations or handle the log
// placement option.
}
SimpleGraphExecutionState::~SimpleGraphExecutionState() {
mutex_lock l(mu_);
delete base_;
delete placed_;
}
Status SimpleGraphExecutionState::Create(GraphDef* graph_def) {
if (original_graph_def_.node_size() > 0) {
return errors::InvalidArgument(
"Cannot call Create on SimpleGraphExecutionState twice");
}
original_graph_def_.Swap(graph_def);
VLOG(2) << "Incoming def: " << original_graph_def_.DebugString();
return AddDefaultAttrsToGraphDef(&original_graph_def_, *ops_, 0);
}
Status SimpleGraphExecutionState::Extend(
const GraphDef& extension_def, SimpleGraphExecutionState** out) const {
std::unordered_set<string> new_names;
// 1. Build an index of the new node names.
for (const NodeDef& node : extension_def.node()) {
new_names.insert(node.name());
}
// 2. Add the non-duplicates from the old graph to the new graph.
// Return an error if the same node name appears in both the
// old graph and the extension.
GraphDef gdef;
for (const NodeDef& node : original_graph_def_.node()) {
if (new_names.count(node.name()) == 0) {
*gdef.add_node() = node;
} else {
return errors::InvalidArgument(tensorflow::strings::Printf(
"GraphDef argument to Extend includes node '%s', which was created "
"by a previous call to Create or Extend in this session.",
node.name().c_str()));
}
}
int old_node_size = gdef.node_size();
gdef.mutable_node()->MergeFrom(extension_def.node());
TF_RETURN_IF_ERROR(AddDefaultAttrsToGraphDef(&gdef, *ops_, old_node_size));
// 3. Add the extension.
SimpleGraphExecutionStateOptions combined_options;
combined_options.device_set = device_set_;
SimpleGraphExecutionState* new_execution_state =
new SimpleGraphExecutionState(ops_, combined_options);
Status new_execution_state_status = new_execution_state->Create(&gdef);
if (!new_execution_state_status.ok()) {
delete new_execution_state;
return new_execution_state_status;
}
*out = new_execution_state;
// Ensure that any state created in the precursor is accessible in the
// new graph.
{
mutex_lock l(mu_);
for (const auto& placement : stateful_placements_) {
(*out)->stateful_placements_.insert(placement);
}
}
// TODO(mrry): This is likely to be used for non-throughput-sensitive
// interactive workloads, but in future we may want to transfer other
// parts of the placement and/or cost model.
return Status::OK();
}
Status SimpleGraphExecutionState::InitBaseGraph() {
std::unique_ptr<Graph> new_base(new Graph(ops_));
GraphConstructorOptions opts;
TF_RETURN_IF_ERROR(
ConvertGraphDefToGraph(opts, original_graph_def_, new_base.get()));
for (const Node* n : new_base->nodes()) {
VLOG(2) << "Mapping " << n->name() << " to " << n->cost_id();
node_name_to_cost_id_map_[n->name()] = n->cost_id();
}
Status status = PreliminaryPlace(*new_base);
if (!status.ok()) {
node_name_to_cost_id_map_.clear();
return status;
}
base_ = new_base.release();
return Status::OK();
}
Status SimpleGraphExecutionState::GlobalNodeDefByName(const string& name,
NodeDef* out) {
NodeNameToCostIdMap::const_iterator iter =
node_name_to_cost_id_map_.find(name);
if (iter != node_name_to_cost_id_map_.end()) {
mutex_lock l(mu_); // could use reader lock
const Node* node = placed_->FindNodeId(iter->second);
if (node) {
*out = node->def();
return Status::OK();
}
}
return errors::NotFound("Node name: ", name);
}
Status SimpleGraphExecutionState::PreliminaryPlace(const Graph& base) {
VLOG(1) << "PreliminaryPlace";
Graph* ng = new Graph(ops_);
CopyGraph(base, ng);
Status status = DoPlace(ng);
if (!status.ok()) {
delete ng;
} else {
delete placed_;
placed_ = ng;
FreezeStatefulNodes(true /*is_prelim*/);
}
return status;
}
void SimpleGraphExecutionState::FreezeStatefulNodes(bool is_prelim) {
if (is_prelim) {
// During the preliminary placement every stateful Node got placed
// somewhere, and we need to remember where, so it doesn't move.
for (Node* n : placed_->nodes()) {
if (n->op_def().is_stateful()) {
stateful_placements_[n->name()] = n->assigned_device_name();
}
}
} else {
// During later placements it's possible for new stateful nodes to
// appear. They are noticed while we're pinning the pre-existing
// stateful nodes to their prior positions, and after they've been
// placed this function is entered to record their placements.
for (Node* n : missing_stateful_placements_) {
CHECK(n->op_def().is_stateful());
stateful_placements_[n->name()] = n->assigned_device_name();
}
missing_stateful_placements_.clear();
}
}
void SimpleGraphExecutionState::PlaceStatefulNodes(Graph* graph) {
for (Node* n : graph->nodes()) {
if (n->op_def().is_stateful()) {
PlaceMap::const_iterator iter = stateful_placements_.find(n->name());
if (iter == stateful_placements_.end()) {
// NOTE(tucker): I don't understand why this can occur. So far,
// I've only seen it in eval instances, started from a checkpoint.
missing_stateful_placements_.push_back(n);
} else {
n->set_assigned_device_name(iter->second);
}
}
}
}
Status SimpleGraphExecutionState::DoPlace(Graph* graph) {
Status status;
// TODO(mrry): Port other placement algorithms from whitepaper.
return SimplePlacement(graph);
}
Status SimpleGraphExecutionState::BuildGraph(const BuildGraphOptions& options,
ClientGraph** out) {
VLOG(1) << "BuildGraph";
mutex_lock l(mu_);
// Lazily initialize the base graph.
if (base_ == nullptr) {
TF_RETURN_IF_ERROR(InitBaseGraph());
}
if (!base_ || !placed_) {
return ::tensorflow::errors::Internal(
"There was a problem building the graph.");
}
std::unique_ptr<ClientGraph> cgraph(new ClientGraph(ops_));
CopyGraph(*placed_, &cgraph->graph);
// Extract the subset of the graph that needs to be run, adding feed/fetch
// ops as needed.
TF_RETURN_IF_ERROR(subgraph::RewriteGraphForExecution(
&cgraph->graph, options.feed_endpoints, options.fetch_endpoints,
options.target_nodes, device_set_->client_device()->attributes()));
// Copy the extracted graph in order to make its node ids dense,
// since the local CostModel used to record its stats is sized by
// the largest node id.
{
std::unique_ptr<ClientGraph> dense_copy(new ClientGraph(ops_));
CopyGraph(cgraph->graph, &dense_copy->graph);
cgraph = std::move(dense_copy);
}
// TODO(vrv): We should check invariants of the graph here.
*out = cgraph.release();
return Status::OK();
}
Status SimpleGraphExecutionState::DeviceIsCompatible(
Node* n, const Device* device) const {
if (!n->def().device().empty()) {
DeviceNameUtils::ParsedName pname;
if (!DeviceNameUtils::ParseFullName(n->def().device(), &pname)) {
return AttachDef(
errors::InvalidArgument("Malformed device specification '",
n->def().device(), "'"),
n->def());
}
std::vector<Device*> devices;
device_set_->FindMatchingDevices(pname, &devices);
for (auto d : devices) {
if (d == device) {
return Status::OK();
}
}
return AttachDef(
errors::InvalidArgument(
"Specified device '", n->def().device(),
"' not compatible with device of ref connection: ", device->name()),
n->def());
}
return Status::OK();
}
Status SimpleGraphExecutionState::SimplePlacement(Graph* graph) {
SimplePlacer placer(graph, device_set_, &node_name_to_cost_id_map_,
session_options_);
// TODO(mrry): Consider making the SimplePlacer cancelable.
return placer.Run();
}
} // namespace tensorflow
|
RyanYoung25/tensorflow
|
tensorflow/core/distributed_runtime/simple_graph_execution_state.cc
|
C++
|
apache-2.0
| 10,447
|
package org.piphonom.arepa.service;
/**
* Created by piphonom
*/
public final class DBUnitConstants {
public static final String CUSTOMER_EMAIL = "test@me.com";
public static final String DEVICE_NAME = "deviceName";
public static final String DEVICE_PUBLIC_ID = "2f4f";
}
|
piphonom/arepa
|
src/test/java/org/piphonom/arepa/service/DBUnitConstants.java
|
Java
|
apache-2.0
| 287
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.