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 |
|---|---|---|---|---|---|
/*
UnOp.cc An unary operator in the expression calculator.
Copyright (C) 2008-14 Sakis Kasampalis <s.kasampalis@zoho.com>
(this file is part of the expression calculator).
The expression calculator is free software: you can redistribute it
and/or modify it under the terms of the GNU General Public License
as published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
The expression calculator 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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with the expression calculator. If not, see
<http://www.gnu.org/licenses/>.
*/
#include <string>
#include <sstream>
#include "UnOp.h"
using std::string;
using std::stringstream;
/**
* Initialisation of an unary operator.
*
* @param e a pointer to the expression
* of the operator
*/
UnOp::UnOp(Expr* e): u_exp(e) {}
/**
* A string representation
* of the unary operator.
*
* @return a <i>string</i>
* instance of the unary
* operator.
*/
string UnOp::toString() const
{
stringstream str;
str << strOperator() << "(" << u_exp->toString() << ")";
return str.str();
}
| faif/expr-calc | UnOp.cc | C++ | gpl-3.0 | 1,374 |
class Follower < ActiveRecord::Base
validates :following_id, uniqueness: { scope: :follower_id }
end
| ieglonew01f/firefly-rails | app/models/follower.rb | Ruby | gpl-3.0 | 103 |
#ifndef OI_H
#define OI_H
#include "WPILib.h"
#include "Robotmagic.h"
class OI
{
private:
public:
OI();
#define JOYSTICK_main_TYPE xbox
SENSOR_OI_H(joystick,main);
SENSOR_OI_H(gyro,gyro);
SENSOR_OI_H(digitalin,compressor);
SENSOR_OI_H(digitalin,arm_top);
SENSOR_OI_H(digitalin,arm_bot);
SENSOR_OI_H(digitalin,catapult);
SENSOR_OI_H(encoder,drive_left);
SENSOR_OI_H(encoder,drive_right);
};
#endif
| Retro3223/2014-aerial-assist | OI.h | C | gpl-3.0 | 438 |
/*
* ------------------------------------------------------------------------ Copyright 2016 by Aaron
* Hart Email: Aaron.Hart@gmail.com
*
* This program is free software; you can redistribute it and/or modify it under the terms of the
* GNU General Public License, Version 3, as published by the Free Software Foundation.
*
* 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
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with this program; if
* not, see <http://www.gnu.org/licenses>.
* ---------------------------------------------------------------------
*/
package fleur.knime.nodes.compensation.extract.fjmtx;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import org.knime.core.node.CanceledExecutionException;
import org.knime.core.node.ExecutionContext;
import org.knime.core.node.ExecutionMonitor;
import org.knime.core.node.InvalidSettingsException;
import org.knime.core.node.NodeLogger;
import org.knime.core.node.NodeModel;
import org.knime.core.node.NodeSettingsRO;
import org.knime.core.node.NodeSettingsWO;
import org.knime.core.node.port.PortObject;
import org.knime.core.node.port.PortObjectSpec;
import org.knime.core.node.port.PortType;
import org.knime.core.node.port.PortTypeRegistry;
import fleur.core.compensation.SpilloverCompensator;
import fleur.knime.ports.compensation.CompMatrixPortObject;
import fleur.knime.ports.compensation.CompMatrixPortSpec;
/**
* This is the model implementation of ExtractCompJO. Extract a compenation matrix from a text file
* generated with FlowJo for Mac. This has only been tested with exports from version 9 of FlowJo.
*
* @author Aaron Hart
*/
public class ExtractCompJONodeModel extends NodeModel {
// the logger instance
private static final NodeLogger logger = NodeLogger.getLogger(ExtractCompJONodeModel.class);
private static final String EMPTY_MATRIX_WARNING =
"This compensation matrix has only spillover values of zero. Compensation will not modify the input data.";
private ExtractCompJoSettings modelSettings = new ExtractCompJoSettings();
private SpilloverCompensator viewCompensator;
private boolean isExecuted = false;
/**
* Constructor for the node model.
*/
protected ExtractCompJONodeModel() {
super(new PortType[0],
new PortType[] {PortTypeRegistry.getInstance().getPortType(CompMatrixPortObject.class)});
}
/**
* {@inheritDoc}
*
* @throws CanceledExecutionException
*/
@Override
protected PortObject[] execute(final PortObject[] inObjects, final ExecutionContext exec)
throws CanceledExecutionException {
logger.info("Starting Execution");
try {
SpilloverCompensator compr = readCompensationFromMTXFile(modelSettings.getFilePath());
viewCompensator = compr;
CompMatrixPortSpec spec = createPortSpec(compr);
if (compr.isEmpty()) {
logger.warn(EMPTY_MATRIX_WARNING);
}
CompMatrixPortObject portObject = new CompMatrixPortObject(spec, compr.getSpilloverValues());
isExecuted = true;
return new PortObject[] {portObject};
} catch (final Exception e) {
logger.error("Execution Failed. See debug console for details.", e);
throw new CanceledExecutionException("Execution Failed. See debug console for details.");
}
}
/**
* @param filePath - Path to an mtx file as generated from V9.x of FlowJo.
* @return a new SpilloverCompensator generated from the specified file or null if something goes
* wrong.
* @throws Exception
*/
private SpilloverCompensator readCompensationFromMTXFile(String filePath)
throws CanceledExecutionException {
try (FileReader freader = new FileReader(filePath);
BufferedReader reader = new BufferedReader(freader)) {
ArrayList<String> lines = new ArrayList<>();
String line = reader.readLine();
while (line != null) {
lines.add(line);
line = reader.readLine();
}
String headerLine = lines.get(2);
String[] dimensionList = headerLine.split("\t");
ArrayList<Double> spilloverList = new ArrayList<>();
Double[] spilloverValues = new Double[dimensionList.length * dimensionList.length];
for (int i = 3; i < lines.size(); i++) {
String[] valueLine = lines.get(i).split("\t");
for (String s : valueLine) {
Double dValue = Double.parseDouble(s);
spilloverList.add(dValue);
}
}
if (spilloverList.size() == spilloverValues.length) {
spilloverValues = spilloverList.toArray(spilloverValues);
} else {
CanceledExecutionException re = new CanceledExecutionException(
"failed to parse compensation matrix. Input file invalid or in unexpected format.");
logger.error(
"failed to parse compensation matrix. Input file invalid or in unexpected format.",
re);
throw re;
}
String[] outDimensionList = new String[dimensionList.length];
for (int i = 0; i < outDimensionList.length; i++) {
outDimensionList[i] = "[" + dimensionList[i] + "]";
}
return new SpilloverCompensator(dimensionList, outDimensionList, spilloverValues);
} catch (Exception e) {
logger.error("failed to parse compensation matrix. File may be missing, or corrupted", e);
throw new CanceledExecutionException("File not read.");
}
}
private CompMatrixPortSpec createPortSpec(SpilloverCompensator compr) {
return new CompMatrixPortSpec(compr.getInputDimensions(), compr.getOutputDimensions());
}
/**
* {@inheritDoc}
*/
@Override
protected void reset() {
viewCompensator = null;
isExecuted = false;
}
/**
* {@inheritDoc}
*/
@Override
protected CompMatrixPortSpec[] configure(final PortObjectSpec[] inSpecs)
throws InvalidSettingsException {
CompMatrixPortSpec spec = null;
try {
SpilloverCompensator compr = readCompensationFromMTXFile(modelSettings.getFilePath());
spec = createPortSpec(compr);
} catch (final Exception e) {
logger.error("Error while checking file. Check that it exists and is valid.", e);
throw new InvalidSettingsException(
"Error while checking file. Check that it exists and is valid.");
}
return new CompMatrixPortSpec[] {spec};
}
/**
* {@inheritDoc}
*/
@Override
protected void saveSettingsTo(final NodeSettingsWO settings) {
modelSettings.save(settings);
}
/**
* {@inheritDoc}
*/
@Override
protected void loadValidatedSettingsFrom(final NodeSettingsRO settings)
throws InvalidSettingsException {
modelSettings.load(settings);
}
/**
* {@inheritDoc}
*/
@Override
protected void validateSettings(final NodeSettingsRO settings) throws InvalidSettingsException {
modelSettings.validate();
}
/**
* {@inheritDoc}
*/
@Override
protected void loadInternals(final File internDir, final ExecutionMonitor exec)
throws IOException, CanceledExecutionException {
// TODO load internal data.
// Everything handed to output ports is loaded automatically (data
// returned by the execute method, models loaded in loadModelContent,
// and user settings set through loadSettingsFrom - is all taken care
// of). Load here only the other internals that need to be restored
// (e.g. data used by the views).
}
/**
* {@inheritDoc}
*/
@Override
protected void saveInternals(final File internDir, final ExecutionMonitor exec)
throws IOException, CanceledExecutionException {
// TODO save internal models.
// Everything written to output ports is saved automatically (data
// returned by the execute method, models saved in the saveModelContent,
// and user settings saved through saveSettingsTo - is all taken care
// of). Save here only the other internals that need to be preserved
// (e.g. data used by the views).
}
public SpilloverCompensator getCompensator() {
return viewCompensator;
}
public boolean isExecuted() {
return isExecuted;
}
}
| AaronNHart/Inflor | io.landysh.fleur.plugin/src/main/java/fleur/knime/nodes/compensation/extract/fjmtx/ExtractCompJONodeModel.java | Java | gpl-3.0 | 8,379 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_102) on Fri Nov 25 00:19:09 BRST 2016 -->
<title>PostAResumeMB</title>
<meta content="2016-11-25" name="date">
<link href="../../../../../stylesheet.css" rel="stylesheet"
title="Style" type="text/css">
<script src="../../../../../script.js" type="text/javascript"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title = "PostAResumeMB";
}
} catch (err) {
}
//-->
var methods = {"i0": 10, "i1": 10, "i2": 10, "i3": 10};
var tabs = {65535: ["t0", "All Methods"], 2: ["t2", "Instance Methods"], 8: ["t4", "Concrete Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav">
<a name="navbar.top"> <!-- -->
</a>
<div class="skipNav">
<a href="#skip.navbar.top" title="Skip navigation links">Skip
navigation links</a>
</div>
<a name="navbar.top.firstrow"> <!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/PostAResumeMB.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-files/index-1.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a
href="../../../../../br/com/codecode/workix/bean/PostAJobMB.html"
title="class in br.com.codecode.workix.bean"><span
class="typeNameLink">Prev Class</span></a></li>
<li><a
href="../../../../../br/com/codecode/workix/bean/RegisterMB.html"
title="class in br.com.codecode.workix.bean"><span
class="typeNameLink">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a
href="../../../../../index.html?br/com/codecode/workix/bean/PostAResumeMB.html"
target="_top">Frames</a></li>
<li><a href="PostAResumeMB.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if (window == top) {
allClassesLink.style.display = "block";
} else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary: </li>
<li>Nested | </li>
<li>Field | </li>
<li><a href="#constructor.summary">Constr</a> | </li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li>Field | </li>
<li><a href="#constructor.detail">Constr</a> | </li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.top"> <!-- -->
</a>
</div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">br.com.codecode.workix.bean</div>
<h2 class="title" title="Class PostAResumeMB">Class PostAResumeMB</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object</li>
<li>
<ul class="inheritance">
<li><a
href="../../../../../br/com/codecode/workix/bean/BaseMB.html"
title="class in br.com.codecode.workix.bean">br.com.codecode.workix.bean.BaseMB</a></li>
<li>
<ul class="inheritance">
<li>br.com.codecode.workix.bean.PostAResumeMB</li>
</ul>
</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Implemented Interfaces:</dt>
<dd>java.io.Serializable</dd>
</dl>
<hr>
<br>
<pre>@Model
public class <span class="typeNameLabel">PostAResumeMB</span>
extends <a href="../../../../../br/com/codecode/workix/bean/BaseMB.html"
title="class in br.com.codecode.workix.bean">BaseMB</a>
</pre>
<div class="block">This ManagedBean controls
post-a-resume.xhtml
</div>
<dl>
<dt>
<span class="simpleTagLabel">Author:</span>
</dt>
<dd>felipe</dd>
<dt>
<span class="seeLabel">See Also:</span>
</dt>
<dd>
<a
href="../../../../../serialized-form.html#br.com.codecode.workix.bean.PostAResumeMB">Serialized
Form</a>
</dd>
</dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.summary"> <!-- -->
</a>
<h3>Constructor Summary</h3>
<table border="0" cellpadding="3" cellspacing="0"
class="memberSummary"
summary="Constructor Summary table, listing constructors, and an explanation">
<caption>
<span>Constructors</span><span class="tabEnd"> </span>
</caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code>
<span class="memberNameLink"><a
href="../../../../../br/com/codecode/workix/bean/PostAResumeMB.html#PostAResumeMB--">PostAResumeMB</a></span>()
</code>
</td>
</tr>
</table>
</li>
</ul> <!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method.summary"> <!-- -->
</a>
<h3>Method Summary</h3>
<table border="0" cellpadding="3" cellspacing="0"
class="memberSummary"
summary="Method Summary table, listing methods, and an explanation">
<caption>
<span class="activeTableTab" id="t0"><span>All
Methods</span><span class="tabEnd"> </span></span><span class="tableTab"
id="t2"><span><a
href="javascript:show(2);">Instance Methods</a></span><span
class="tabEnd"> </span></span><span class="tableTab" id="t4"><span><a
href="javascript:show(8);">Concrete Methods</a></span><span
class="tabEnd"> </span></span>
</caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr class="altColor" id="i0">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code>
<span class="memberNameLink"><a
href="../../../../../br/com/codecode/workix/bean/PostAResumeMB.html#commit--">commit</a></span>()
</code>
</td>
</tr>
<tr class="rowColor" id="i1">
<td class="colFirst"><code>
java.util.List<<a
href="../../../../../br/com/codecode/workix/model/jpa/Candidate.html"
title="class in br.com.codecode.workix.model.jpa">Candidate</a>>
</code></td>
<td class="colLast"><code>
<span class="memberNameLink"><a
href="../../../../../br/com/codecode/workix/bean/PostAResumeMB.html#getCandidates--">getCandidates</a></span>()
</code>
</td>
</tr>
<tr class="altColor" id="i2">
<td class="colFirst"><code>
<a
href="../../../../../br/com/codecode/workix/model/jpa/Resume.html"
title="class in br.com.codecode.workix.model.jpa">Resume</a>
</code></td>
<td class="colLast"><code>
<span class="memberNameLink"><a
href="../../../../../br/com/codecode/workix/bean/PostAResumeMB.html#getCurrentResume--">getCurrentResume</a></span>()
</code>
</td>
</tr>
<tr class="rowColor" id="i3">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code>
<span class="memberNameLink"><a
href="../../../../../br/com/codecode/workix/bean/PostAResumeMB.html#setCurrentResume-br.com.codecode.workix.model.jpa.Resume-">setCurrentResume</a></span>(<a
href="../../../../../br/com/codecode/workix/model/jpa/Resume.html"
title="class in br.com.codecode.workix.model.jpa">Resume</a> currentResume)
</code>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a
name="methods.inherited.from.class.java.lang.Object"> <!-- -->
</a>
<h3>Methods inherited from class java.lang.Object</h3> <code>equals,
getClass, hashCode, notify, notifyAll, toString, wait, wait,
wait</code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.detail"> <!-- -->
</a>
<h3>Constructor Detail</h3> <a name="PostAResumeMB--"> <!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>PostAResumeMB</h4>
<pre>public PostAResumeMB()</pre>
</li>
</ul>
</li>
</ul> <!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail"> <!-- -->
</a>
<h3>Method Detail</h3> <a name="getCurrentResume--"> <!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getCurrentResume</h4>
<pre>public <a
href="../../../../../br/com/codecode/workix/model/jpa/Resume.html"
title="class in br.com.codecode.workix.model.jpa">Resume</a> getCurrentResume()</pre>
</li>
</ul>
<a
name="setCurrentResume-br.com.codecode.workix.model.jpa.Resume-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setCurrentResume</h4>
<pre>public void setCurrentResume(<a
href="../../../../../br/com/codecode/workix/model/jpa/Resume.html"
title="class in br.com.codecode.workix.model.jpa">Resume</a> currentResume)</pre>
</li>
</ul>
<a name="getCandidates--"> <!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getCandidates</h4>
<pre>public java.util.List<<a
href="../../../../../br/com/codecode/workix/model/jpa/Candidate.html"
title="class in br.com.codecode.workix.model.jpa">Candidate</a>> getCandidates()</pre>
</li>
</ul>
<a name="commit--"> <!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>commit</h4>
<pre>public void commit()</pre>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav">
<a name="navbar.bottom"> <!-- -->
</a>
<div class="skipNav">
<a href="#skip.navbar.bottom" title="Skip navigation links">Skip
navigation links</a>
</div>
<a name="navbar.bottom.firstrow"> <!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/PostAResumeMB.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-files/index-1.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a
href="../../../../../br/com/codecode/workix/bean/PostAJobMB.html"
title="class in br.com.codecode.workix.bean"><span
class="typeNameLink">Prev Class</span></a></li>
<li><a
href="../../../../../br/com/codecode/workix/bean/RegisterMB.html"
title="class in br.com.codecode.workix.bean"><span
class="typeNameLink">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a
href="../../../../../index.html?br/com/codecode/workix/bean/PostAResumeMB.html"
target="_top">Frames</a></li>
<li><a href="PostAResumeMB.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if (window == top) {
allClassesLink.style.display = "block";
} else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary: </li>
<li>Nested | </li>
<li>Field | </li>
<li><a href="#constructor.summary">Constr</a> | </li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li>Field | </li>
<li><a href="#constructor.detail">Constr</a> | </li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.bottom"> <!-- -->
</a>
</div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>
| frmichetti/workix | src/main/webapp/static/workix-static-demo/docs/java-docs/br/com/codecode/workix/bean/PostAResumeMB.html | HTML | gpl-3.0 | 18,705 |
/*
* Copyright (C) 2012 Timo Vesalainen
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.vesalainen.util;
import java.util.Calendar;
import java.util.GregorianCalendar;
import java.util.Locale;
import java.util.TimeZone;
public class EasterCalendar extends GregorianCalendar
{
private Locale locale;
private boolean finnish;
public EasterCalendar(int i, int i1, int i2, int i3, int i4, int i5)
{
super(i, i1, i2, i3, i4, i5);
locale = Locale.getDefault();
finnish = "FIN".equals(locale.getISO3Country());
}
public EasterCalendar(int i, int i1, int i2, int i3, int i4)
{
super(i, i1, i2, i3, i4);
locale = Locale.getDefault();
finnish = "FIN".equals(locale.getISO3Country());
}
public EasterCalendar(int i, int i1, int i2)
{
super(i, i1, i2);
locale = Locale.getDefault();
finnish = "FIN".equals(locale.getISO3Country());
}
public EasterCalendar(TimeZone tz, Locale locale)
{
super(tz, locale);
this.locale = locale;
finnish = "FIN".equals(locale.getISO3Country());
}
public EasterCalendar(Locale locale)
{
this(TimeZone.getDefault(), locale);
}
public EasterCalendar(TimeZone tz)
{
this(tz, Locale.getDefault());
}
public EasterCalendar()
{
this(TimeZone.getDefault(), Locale.getDefault());
}
public boolean isHolyday()
{
//System.out.print(getTime().toString());
if (get(DAY_OF_WEEK) == SUNDAY)
{
//System.out.println("=Sunday" );
return true;
}
if (get(MONTH) == JANUARY && get(DATE) == 1)
{
//System.out.println("=Uudenvuoden paiva" );
return true;
}
if (get(MONTH) == JANUARY && get(DATE) == 6)
{
//System.out.println("=loppiainen" );
return true;
}
if (get(MONTH) == MAY && get(DATE) == 1)
{
//System.out.println("=wappu" );
return true;
}
if (get(MONTH) == JUNE && get(DAY_OF_WEEK) == FRIDAY)
{
if (get(DATE) <= 25 && get(DATE) > 18)
{
//System.out.println("=juhannus" );
return finnish && true;
}
}
if (get(MONTH) == DECEMBER && get(DATE) == 6)
{
//System.out.println("=itsenaisyyspaiva" );
return finnish && true;
}
if (get(MONTH) == DECEMBER && get(DATE) == 24)
{
//System.out.println("=joulu" );
return true;
}
if (get(MONTH) == DECEMBER && get(DATE) == 25)
{
//System.out.println("=joulu" );
return true;
}
if (get(MONTH) == DECEMBER && get(DATE) == 26)
{
//System.out.println("=joulu" );
return true;
}
if (isEaster(this))
{
//System.out.println("=Easter" );
return true;
}
add(DATE, 2);
if (isEaster(this))
{
//System.out.println("=Good friday" );
add(DATE, -2);
return true;
}
add(DATE, -2);
add(DATE, -1);
if (isEaster(this))
{
//System.out.println("=Easter2" );
add(DATE, 1);
return true;
}
add(DATE, 1);
add(DATE, -39);
if (isEaster(this))
{
//System.out.println("=helatorstai" );
add(DATE, 39);
return finnish && true;
}
add(DATE, 39);
//System.out.println("=Work Day" );
return false;
}
public boolean isEaster(Calendar cal)
{
int C;
int N;
int K;
int I;
int J;
int L;
int M;
int D;
int Y;
Y = cal.get(Calendar.YEAR);
C = Y / 100;
N = Y - 19 * (Y / 19);
K = (C - 17) / 25;
I = C - C / 4 - (C - K) / 3 + 19 * N + 15;
I = I - 30 * (I / 30);
I = I - (I / 28) * (1 - (I / 28) * (29 / (I + 1)) * ((21 - N) / 11));
J = Y + Y / 4 + I + 2 - C + C / 4;
J = J - 7 * (J / 7);
L = I - J;
M = 3 + (L + 40) / 44;
D = L + 28 - 31 * (M / 4);
return (M == cal.get(Calendar.MONTH) + 1 && D == cal.get(Calendar.DATE));
}
}
| tvesalainen/util | util/src/main/java/org/vesalainen/util/EasterCalendar.java | Java | gpl-3.0 | 5,083 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<title>SlideAtom.SSlideLayoutAtom (POI API Documentation)</title>
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="SlideAtom.SSlideLayoutAtom (POI API Documentation)";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!-- -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/SlideAtom.SSlideLayoutAtom.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../org/apache/poi/hslf/record/SlideAtom.html" title="class in org.apache.poi.hslf.record"><span class="strong">PREV CLASS</span></a></li>
<li><a href="../../../../../org/apache/poi/hslf/record/SlideListWithText.html" title="class in org.apache.poi.hslf.record"><span class="strong">NEXT CLASS</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/poi/hslf/record/SlideAtom.SSlideLayoutAtom.html" target="_top">FRAMES</a></li>
<li><a href="SlideAtom.SSlideLayoutAtom.html" target="_top">NO FRAMES</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>SUMMARY: </li>
<li>NESTED | </li>
<li><a href="#field_summary">FIELD</a> | </li>
<li><a href="#constructor_summary">CONSTR</a> | </li>
<li><a href="#method_summary">METHOD</a></li>
</ul>
<ul class="subNavList">
<li>DETAIL: </li>
<li><a href="#field_detail">FIELD</a> | </li>
<li><a href="#constructor_detail">CONSTR</a> | </li>
<li><a href="#method_detail">METHOD</a></li>
</ul>
</div>
<a name="skip-navbar_top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<p class="subTitle">org.apache.poi.hslf.record</p>
<h2 title="Class SlideAtom.SSlideLayoutAtom" class="title">Class SlideAtom.SSlideLayoutAtom</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object</li>
<li>
<ul class="inheritance">
<li>org.apache.poi.hslf.record.SlideAtom.SSlideLayoutAtom</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>Enclosing class:</dt>
<dd><a href="../../../../../org/apache/poi/hslf/record/SlideAtom.html" title="class in org.apache.poi.hslf.record">SlideAtom</a></dd>
</dl>
<hr>
<br>
<pre>public static class <strong>SlideAtom.SSlideLayoutAtom</strong>
extends java.lang.Object</pre>
<div class="block">Holds the geometry of the Slide, and the ID of the placeholders
on the slide.
(Embeded inside SlideAtom is a SSlideLayoutAtom, without the
usual record header. Since it's a fixed size and tied to
the SlideAtom, we'll hold it here.)</div>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- =========== FIELD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="field_summary">
<!-- -->
</a>
<h3>Field Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation">
<caption><span>Fields</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Field and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static int</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/poi/hslf/record/SlideAtom.SSlideLayoutAtom.html#BIG_OBJECT">BIG_OBJECT</a></strong></code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static int</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/poi/hslf/record/SlideAtom.SSlideLayoutAtom.html#BLANK_SLIDE">BLANK_SLIDE</a></strong></code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static int</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/poi/hslf/record/SlideAtom.SSlideLayoutAtom.html#FOUR_OBJECTS">FOUR_OBJECTS</a></strong></code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static int</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/poi/hslf/record/SlideAtom.SSlideLayoutAtom.html#HANDOUT">HANDOUT</a></strong></code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static int</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/poi/hslf/record/SlideAtom.SSlideLayoutAtom.html#MASTER_NOTES">MASTER_NOTES</a></strong></code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static int</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/poi/hslf/record/SlideAtom.SSlideLayoutAtom.html#MASTER_SLIDE">MASTER_SLIDE</a></strong></code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static int</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/poi/hslf/record/SlideAtom.SSlideLayoutAtom.html#NOTES_TITLE_BODY">NOTES_TITLE_BODY</a></strong></code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static int</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/poi/hslf/record/SlideAtom.SSlideLayoutAtom.html#TITLE_2_COLUMN_BODY">TITLE_2_COLUMN_BODY</a></strong></code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static int</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/poi/hslf/record/SlideAtom.SSlideLayoutAtom.html#TITLE_2_COLUNM_LEFT_2_ROW_BODY">TITLE_2_COLUNM_LEFT_2_ROW_BODY</a></strong></code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static int</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/poi/hslf/record/SlideAtom.SSlideLayoutAtom.html#TITLE_2_COLUNM_RIGHT_2_ROW_BODY">TITLE_2_COLUNM_RIGHT_2_ROW_BODY</a></strong></code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static int</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/poi/hslf/record/SlideAtom.SSlideLayoutAtom.html#TITLE_2_ROW_BODY">TITLE_2_ROW_BODY</a></strong></code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static int</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/poi/hslf/record/SlideAtom.SSlideLayoutAtom.html#TITLE_2_ROW_BOTTOM_2_COLUMN_BODY">TITLE_2_ROW_BOTTOM_2_COLUMN_BODY</a></strong></code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static int</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/poi/hslf/record/SlideAtom.SSlideLayoutAtom.html#TITLE_2_ROW_TOP_2_COLUMN_BODY">TITLE_2_ROW_TOP_2_COLUMN_BODY</a></strong></code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static int</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/poi/hslf/record/SlideAtom.SSlideLayoutAtom.html#TITLE_BODY_SLIDE">TITLE_BODY_SLIDE</a></strong></code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static int</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/poi/hslf/record/SlideAtom.SSlideLayoutAtom.html#TITLE_MASTER_SLIDE">TITLE_MASTER_SLIDE</a></strong></code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static int</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/poi/hslf/record/SlideAtom.SSlideLayoutAtom.html#TITLE_ONLY">TITLE_ONLY</a></strong></code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static int</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/poi/hslf/record/SlideAtom.SSlideLayoutAtom.html#TITLE_SLIDE">TITLE_SLIDE</a></strong></code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static int</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/poi/hslf/record/SlideAtom.SSlideLayoutAtom.html#VERTICAL_TITLE_2_ROW_BODY_LEFT">VERTICAL_TITLE_2_ROW_BODY_LEFT</a></strong></code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static int</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/poi/hslf/record/SlideAtom.SSlideLayoutAtom.html#VERTICAL_TITLE_BODY_LEFT">VERTICAL_TITLE_BODY_LEFT</a></strong></code> </td>
</tr>
</table>
</li>
</ul>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_summary">
<!-- -->
</a>
<h3>Constructor Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><strong><a href="../../../../../org/apache/poi/hslf/record/SlideAtom.SSlideLayoutAtom.html#SlideAtom.SSlideLayoutAtom(byte[])">SlideAtom.SSlideLayoutAtom</a></strong>(byte[] data)</code>
<div class="block">Create a new Embeded SSlideLayoutAtom, from 12 bytes of data</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method_summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span>Methods</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/poi/hslf/record/SlideAtom.SSlideLayoutAtom.html#getGeometryType()">getGeometryType</a></strong>()</code>
<div class="block">Retrieve the geometry type</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/poi/hslf/record/SlideAtom.SSlideLayoutAtom.html#setGeometryType(int)">setGeometryType</a></strong>(int geom)</code>
<div class="block">Set the geometry type</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/poi/hslf/record/SlideAtom.SSlideLayoutAtom.html#writeOut(java.io.OutputStream)">writeOut</a></strong>(java.io.OutputStream out)</code>
<div class="block">Write the contents of the record back, so it can be written
to disk.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_java.lang.Object">
<!-- -->
</a>
<h3>Methods inherited from class java.lang.Object</h3>
<code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ FIELD DETAIL =========== -->
<ul class="blockList">
<li class="blockList"><a name="field_detail">
<!-- -->
</a>
<h3>Field Detail</h3>
<a name="TITLE_SLIDE">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>TITLE_SLIDE</h4>
<pre>public static final int TITLE_SLIDE</pre>
<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../constant-values.html#org.apache.poi.hslf.record.SlideAtom.SSlideLayoutAtom.TITLE_SLIDE">Constant Field Values</a></dd></dl>
</li>
</ul>
<a name="TITLE_BODY_SLIDE">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>TITLE_BODY_SLIDE</h4>
<pre>public static final int TITLE_BODY_SLIDE</pre>
<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../constant-values.html#org.apache.poi.hslf.record.SlideAtom.SSlideLayoutAtom.TITLE_BODY_SLIDE">Constant Field Values</a></dd></dl>
</li>
</ul>
<a name="TITLE_MASTER_SLIDE">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>TITLE_MASTER_SLIDE</h4>
<pre>public static final int TITLE_MASTER_SLIDE</pre>
<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../constant-values.html#org.apache.poi.hslf.record.SlideAtom.SSlideLayoutAtom.TITLE_MASTER_SLIDE">Constant Field Values</a></dd></dl>
</li>
</ul>
<a name="MASTER_SLIDE">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>MASTER_SLIDE</h4>
<pre>public static final int MASTER_SLIDE</pre>
<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../constant-values.html#org.apache.poi.hslf.record.SlideAtom.SSlideLayoutAtom.MASTER_SLIDE">Constant Field Values</a></dd></dl>
</li>
</ul>
<a name="MASTER_NOTES">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>MASTER_NOTES</h4>
<pre>public static final int MASTER_NOTES</pre>
<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../constant-values.html#org.apache.poi.hslf.record.SlideAtom.SSlideLayoutAtom.MASTER_NOTES">Constant Field Values</a></dd></dl>
</li>
</ul>
<a name="NOTES_TITLE_BODY">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>NOTES_TITLE_BODY</h4>
<pre>public static final int NOTES_TITLE_BODY</pre>
<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../constant-values.html#org.apache.poi.hslf.record.SlideAtom.SSlideLayoutAtom.NOTES_TITLE_BODY">Constant Field Values</a></dd></dl>
</li>
</ul>
<a name="HANDOUT">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>HANDOUT</h4>
<pre>public static final int HANDOUT</pre>
<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../constant-values.html#org.apache.poi.hslf.record.SlideAtom.SSlideLayoutAtom.HANDOUT">Constant Field Values</a></dd></dl>
</li>
</ul>
<a name="TITLE_ONLY">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>TITLE_ONLY</h4>
<pre>public static final int TITLE_ONLY</pre>
<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../constant-values.html#org.apache.poi.hslf.record.SlideAtom.SSlideLayoutAtom.TITLE_ONLY">Constant Field Values</a></dd></dl>
</li>
</ul>
<a name="TITLE_2_COLUMN_BODY">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>TITLE_2_COLUMN_BODY</h4>
<pre>public static final int TITLE_2_COLUMN_BODY</pre>
<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../constant-values.html#org.apache.poi.hslf.record.SlideAtom.SSlideLayoutAtom.TITLE_2_COLUMN_BODY">Constant Field Values</a></dd></dl>
</li>
</ul>
<a name="TITLE_2_ROW_BODY">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>TITLE_2_ROW_BODY</h4>
<pre>public static final int TITLE_2_ROW_BODY</pre>
<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../constant-values.html#org.apache.poi.hslf.record.SlideAtom.SSlideLayoutAtom.TITLE_2_ROW_BODY">Constant Field Values</a></dd></dl>
</li>
</ul>
<a name="TITLE_2_COLUNM_RIGHT_2_ROW_BODY">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>TITLE_2_COLUNM_RIGHT_2_ROW_BODY</h4>
<pre>public static final int TITLE_2_COLUNM_RIGHT_2_ROW_BODY</pre>
<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../constant-values.html#org.apache.poi.hslf.record.SlideAtom.SSlideLayoutAtom.TITLE_2_COLUNM_RIGHT_2_ROW_BODY">Constant Field Values</a></dd></dl>
</li>
</ul>
<a name="TITLE_2_COLUNM_LEFT_2_ROW_BODY">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>TITLE_2_COLUNM_LEFT_2_ROW_BODY</h4>
<pre>public static final int TITLE_2_COLUNM_LEFT_2_ROW_BODY</pre>
<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../constant-values.html#org.apache.poi.hslf.record.SlideAtom.SSlideLayoutAtom.TITLE_2_COLUNM_LEFT_2_ROW_BODY">Constant Field Values</a></dd></dl>
</li>
</ul>
<a name="TITLE_2_ROW_BOTTOM_2_COLUMN_BODY">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>TITLE_2_ROW_BOTTOM_2_COLUMN_BODY</h4>
<pre>public static final int TITLE_2_ROW_BOTTOM_2_COLUMN_BODY</pre>
<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../constant-values.html#org.apache.poi.hslf.record.SlideAtom.SSlideLayoutAtom.TITLE_2_ROW_BOTTOM_2_COLUMN_BODY">Constant Field Values</a></dd></dl>
</li>
</ul>
<a name="TITLE_2_ROW_TOP_2_COLUMN_BODY">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>TITLE_2_ROW_TOP_2_COLUMN_BODY</h4>
<pre>public static final int TITLE_2_ROW_TOP_2_COLUMN_BODY</pre>
<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../constant-values.html#org.apache.poi.hslf.record.SlideAtom.SSlideLayoutAtom.TITLE_2_ROW_TOP_2_COLUMN_BODY">Constant Field Values</a></dd></dl>
</li>
</ul>
<a name="FOUR_OBJECTS">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>FOUR_OBJECTS</h4>
<pre>public static final int FOUR_OBJECTS</pre>
<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../constant-values.html#org.apache.poi.hslf.record.SlideAtom.SSlideLayoutAtom.FOUR_OBJECTS">Constant Field Values</a></dd></dl>
</li>
</ul>
<a name="BIG_OBJECT">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>BIG_OBJECT</h4>
<pre>public static final int BIG_OBJECT</pre>
<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../constant-values.html#org.apache.poi.hslf.record.SlideAtom.SSlideLayoutAtom.BIG_OBJECT">Constant Field Values</a></dd></dl>
</li>
</ul>
<a name="BLANK_SLIDE">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>BLANK_SLIDE</h4>
<pre>public static final int BLANK_SLIDE</pre>
<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../constant-values.html#org.apache.poi.hslf.record.SlideAtom.SSlideLayoutAtom.BLANK_SLIDE">Constant Field Values</a></dd></dl>
</li>
</ul>
<a name="VERTICAL_TITLE_BODY_LEFT">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>VERTICAL_TITLE_BODY_LEFT</h4>
<pre>public static final int VERTICAL_TITLE_BODY_LEFT</pre>
<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../constant-values.html#org.apache.poi.hslf.record.SlideAtom.SSlideLayoutAtom.VERTICAL_TITLE_BODY_LEFT">Constant Field Values</a></dd></dl>
</li>
</ul>
<a name="VERTICAL_TITLE_2_ROW_BODY_LEFT">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>VERTICAL_TITLE_2_ROW_BODY_LEFT</h4>
<pre>public static final int VERTICAL_TITLE_2_ROW_BODY_LEFT</pre>
<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../constant-values.html#org.apache.poi.hslf.record.SlideAtom.SSlideLayoutAtom.VERTICAL_TITLE_2_ROW_BODY_LEFT">Constant Field Values</a></dd></dl>
</li>
</ul>
</li>
</ul>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_detail">
<!-- -->
</a>
<h3>Constructor Detail</h3>
<a name="SlideAtom.SSlideLayoutAtom(byte[])">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>SlideAtom.SSlideLayoutAtom</h4>
<pre>public SlideAtom.SSlideLayoutAtom(byte[] data)</pre>
<div class="block">Create a new Embeded SSlideLayoutAtom, from 12 bytes of data</div>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method_detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="getGeometryType()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getGeometryType</h4>
<pre>public int getGeometryType()</pre>
<div class="block">Retrieve the geometry type</div>
</li>
</ul>
<a name="setGeometryType(int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setGeometryType</h4>
<pre>public void setGeometryType(int geom)</pre>
<div class="block">Set the geometry type</div>
</li>
</ul>
<a name="writeOut(java.io.OutputStream)">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>writeOut</h4>
<pre>public void writeOut(java.io.OutputStream out)
throws java.io.IOException</pre>
<div class="block">Write the contents of the record back, so it can be written
to disk. Skips the record header</div>
<dl><dt><span class="strong">Throws:</span></dt>
<dd><code>java.io.IOException</code></dd></dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!-- -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/SlideAtom.SSlideLayoutAtom.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../org/apache/poi/hslf/record/SlideAtom.html" title="class in org.apache.poi.hslf.record"><span class="strong">PREV CLASS</span></a></li>
<li><a href="../../../../../org/apache/poi/hslf/record/SlideListWithText.html" title="class in org.apache.poi.hslf.record"><span class="strong">NEXT CLASS</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/poi/hslf/record/SlideAtom.SSlideLayoutAtom.html" target="_top">FRAMES</a></li>
<li><a href="SlideAtom.SSlideLayoutAtom.html" target="_top">NO FRAMES</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>SUMMARY: </li>
<li>NESTED | </li>
<li><a href="#field_summary">FIELD</a> | </li>
<li><a href="#constructor_summary">CONSTR</a> | </li>
<li><a href="#method_summary">METHOD</a></li>
</ul>
<ul class="subNavList">
<li>DETAIL: </li>
<li><a href="#field_detail">FIELD</a> | </li>
<li><a href="#constructor_detail">CONSTR</a> | </li>
<li><a href="#method_detail">METHOD</a></li>
</ul>
</div>
<a name="skip-navbar_bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>
<i>Copyright 2017 The Apache Software Foundation or
its licensors, as applicable.</i>
</small></p>
</body>
</html>
| doughtnerd/POD | resources/Apache/Apache-POI-3.16-beta2/poi-bin-3.16-beta2-20170202/poi-3.16-beta2/docs/apidocs/org/apache/poi/hslf/record/SlideAtom.SSlideLayoutAtom.html | HTML | gpl-3.0 | 24,280 |
from nose.tools import *
from DeckMaker.notetranslator import NoteTranslator
def setup():
print "SETUP!"
def teardown():
print "TEAR DOWN!"
def test_basic():
t = NoteTranslator()
assert_equal(t.GetMidiCodeForHumans("E5"),64)
assert_equal(t.GetMidiCodeForHumans("C1"),12)
assert_equal(t.GetMidiCodeForHumans("Ab6"),80)
assert_equal(t.GetMidiCodeForHumans("Gb7"),90)
assert_equal(t.GetMidiCodeForHumans("D#2"),27)
pass
def test_hex():
t = NoteTranslator()
assert_equal(t.GetHexString(t.GetMidiCodeForHumans("E5")),"40")
assert_equal(t.GetHexString(t.GetMidiCodeForHumans("C1")),"c")
assert_equal(t.GetHexString(t.GetMidiCodeForHumans("Ab6")),"50")
assert_equal(t.GetHexString(t.GetMidiCodeForHumans("Gb7")),"5a")
assert_equal(t.GetHexString(t.GetMidiCodeForHumans("D#2")),"1b")
pass
def test_GetTriadCodes():
t = NoteTranslator()
assert_equal(t.GetTriadCodes( t.GetMidiCodeForHumans("C4"), "minor", 3),[48, 53, 56])
assert_equal(t.GetTriadCodes( t.GetMidiCodeForHumans("Ab2"), "major", 2),[32, 40, 35])
assert_equal(t.GetTriadCodes( t.GetMidiCodeForHumans("G#6"), "minor", 1),[80, 83, 87])
def test_GetTriadHexCodeStrings():
t = NoteTranslator()
assert_equal(t.GetTriadHexCodeStrings( t.GetMidiCodeForHumans("C4"), "major", 1),['30', '34', '37'])
assert_equal(t.GetTriadHexCodeStrings( t.GetMidiCodeForHumans("Ab2"), "major", 2),['20', '28', '23'])
assert_equal(t.GetTriadHexCodeStrings( t.GetMidiCodeForHumans("G#6"), "minor", 1),['50', '53', '57']) | bradrowesf/AnkiDeckMaker | tests/notetranslator_tests.py | Python | gpl-3.0 | 1,526 |
using System;
using System.Collections;
namespace databaseImportExport
{
//Represents a database connection, with its Oracle connection string
//Contains a list of which tables / entailing columns are required to export
public class DBConnection
{
private String dbName;
private String dbConn;
private ArrayList dbTables;
public DBConnection(String dbName, String dbConn)
{
this.dbName = dbName;
this.dbConn = dbConn;
}
public DBConnection(String dbName, String dbConn, ArrayList dbTables)
{
this.dbName = dbName;
this.dbConn = dbConn;
this.dbTables = dbTables;
}
public void setTables(ArrayList dbTables)
{
this.dbTables = dbTables;
}
public String getName()
{
return this.dbName;
}
public String getConnectionString ()
{
return this.dbConn;
}
public ArrayList getTables ()
{
return this.dbTables;
}
}
}
| johnpeterharvey/databaseImportExport | databaseImportExport/DBConnection.cs | C# | gpl-3.0 | 889 |
package mswift42.com.github.sunshine.app;
import android.content.Intent;
import android.support.v4.app.Fragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
/**
* A placeholder fragment containing a simple view.
*/
public class DetailActivityFragment extends Fragment {
public DetailActivityFragment() {
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_detail, container, false);
Intent intent = getActivity().getIntent();
if (intent != null && intent.hasExtra(Intent.EXTRA_TEXT)) {
String forecastDetail = intent.getStringExtra(Intent.EXTRA_TEXT);
((TextView) rootView.findViewById(R.id.forecast_detail)).setText(forecastDetail);
}
return rootView;
}
}
| mswift42/apg | Sunshine/app/src/main/java/mswift42/com/github/sunshine/app/DetailActivityFragment.java | Java | gpl-3.0 | 1,115 |
<head><title>Popular Baby Names</title>
<meta name="dc.language" scheme="ISO639-2" content="eng">
<meta name="dc.creator" content="OACT">
<meta name="lead_content_manager" content="JeffK">
<meta name="coder" content="JeffK">
<meta name="dc.date.reviewed" scheme="ISO8601" content="2005-12-30">
<link rel="stylesheet" href="../OACT/templatefiles/master.css" type="text/css" media="screen">
<link rel="stylesheet" href="../OACT/templatefiles/custom.css" type="text/css" media="screen">
<link rel="stylesheet" href="../OACT/templatefiles/print.css" type="text/css" media="print">
</head>
<body bgcolor="#ffffff" text="#000000" topmargin="1" leftmargin="0">
<table width="100%" border="0" cellspacing="0" cellpadding="4">
<tbody>
<tr>
<td class="sstop" valign="bottom" align="left" width="25%">
Social Security Online
</td>
<td valign="bottom" class="titletext">
<!-- sitetitle -->Popular Baby Names
</td>
</tr>
<tr bgcolor="#333366"><td colspan="2" height="2"></td></tr>
<tr>
<td class="graystars" width="25%" valign="top"> </td>
<td valign="top">
<a href="http://www.ssa.gov/"><img src="/templateimages/tinylogo.gif"
width="52" height="47" align="left"
alt="SSA logo: link to Social Security home page" border="0"></a><a name="content"></a>
<h1>Popular Names by State</h1>August 31, 2007</td>
</tr>
<tr bgcolor="#333366"><td colspan="2" height="1"></td></tr>
</tbody></table>
<table width="100%" border="0" cellspacing="0" cellpadding="4" summary="formatting">
<tbody>
<tr align="left" valign="top">
<td width="25%" class="whiteruled2-td">
<table width="92%" border="0" cellpadding="4" class="ninetypercent">
<tr>
<td class="whiteruled-td"><a href="../OACT/babynames/index.html">Popular
Baby Names</a></td>
</tr>
<tr>
<td class="whiteruled-td"><a href="../OACT/babynames/background.html">
Background information</a></td>
</tr>
<tr>
<td class="whiteruled2-td"><a href="../OACT/babynames/USbirthsNumident.html">Number
of U. S. births</a> based on Social Security card applications</td>
</tr>
</table>
<p>
Make another selection?<br />
<form method="post" action="/cgi-bin/namesbystate.cgi">
<label for="state">Select State</label><br />
<select name="state" size="1" id="state">
<option value="AK">Alaska</option>
<option value="AL">Alabama</option>
<option value="AR">Arkansas</option>
<option value="AZ">Arizona</option>
<option value="CA">California</option>
<option value="CO">Colorado</option>
<option value="CT">Connecticut</option>
<option value="DC">District of Columbia</option>
<option value="DE">Delaware</option>
<option value="FL">Florida</option>
<option value="GA">Georgia</option>
<option value="HI">Hawaii</option>
<option value="IA">Iowa</option>
<option value="ID">Idaho</option>
<option value="IL">Illinois</option>
<option value="IN">Indiana</option>
<option value="KS">Kansas</option>
<option value="KY">Kentucky</option>
<option value="LA">Louisiana</option>
<option value="MA">Massachusetts</option>
<option value="MD">Maryland</option>
<option value="ME">Maine</option>
<option value="MI">Michigan</option>
<option value="MN">Minnesota</option>
<option value="MO">Missouri</option>
<option value="MS">Mississippi</option>
<option value="MT">Montana</option>
<option value="NC">North Carolina</option>
<option value="ND">North Dakota</option>
<option value="NE">Nebraska</option>
<option value="NH" selected>New Hampshire</option>
<option value="NJ">New Jersey</option>
<option value="NM">New Mexico</option>
<option value="NV">Nevada</option>
<option value="NY">New York</option>
<option value="OH">Ohio</option>
<option value="OK">Oklahoma</option>
<option value="OR">Oregon</option>
<option value="PA">Pennsylvania</option>
<option value="RI">Rhode Island</option>
<option value="SC">South Carolina</option>
<option value="SD">South Dakota</option>
<option value="TN">Tennessee</option>
<option value="TX">Texas</option>
<option value="UT">Utah</option>
<option value="VA">Virginia</option>
<option value="VT">Vermont</option>
<option value="WA">Washington</option>
<option value="WI">Wisconsin</option>
<option value="WV">West Virginia</option>
<option value="WY">Wyoming</option>
</select><p>
<label for="year">Enter a year between<br /> 1960-2004:</label>
<input type="text" name="year" size="4" maxlength="4" id="year" value="1997">
<p> <input type="submit" value=" Go ">
</form>
</p>
</td>
<td class="greyruled-td">
<p>
The following table shows the 100 most frequent given names for
male and female births in 1997 in New Hampshire. The number to
the right of each name is the number of occurrences in the data.
The source is a 100% sample based on Social Security card application data.
See the <a href="../OACT/babynames/background.html">limitations</a> of this data source.
<p align="center">
<table width="72%" border="1" bordercolor="#aaabbb"
cellpadding="1" cellspacing="0">
<caption><b>Popularity for top 100 names in New Hampshire for births in 1997</b>
</caption>
<tr align="center" valign="bottom">
<th scope="col" width="12%" bgcolor="#efefef">Rank</th>
<th scope="col" width="22%" bgcolor="#99ccff">Male name</th>
<th scope="col" width="22%" bgcolor="#99ccff">Number of<br /> males</th>
<th scope="col" width="22%" bgcolor="pink">Female name</th>
<th scope="col" width="22%" bgcolor="pink">Number of<br /> females</th></tr>
<tr align="right"><td>1</td>
<td align="center">Nicholas</td>
<td>174</td>
<td align="center">Emily</td>
<td>162</td></tr>
<tr align="right"><td>2</td>
<td align="center">Tyler</td>
<td>172</td>
<td align="center">Hannah</td>
<td>129</td></tr>
<tr align="right"><td>3</td>
<td align="center">Jacob</td>
<td>165</td>
<td align="center">Sarah</td>
<td>128</td></tr>
<tr align="right"><td>4</td>
<td align="center">Matthew</td>
<td>156</td>
<td align="center">Samantha</td>
<td>109</td></tr>
<tr align="right"><td>5</td>
<td align="center">Michael</td>
<td>148</td>
<td align="center">Ashley</td>
<td>100</td></tr>
<tr align="right"><td>6</td>
<td align="center">Ryan</td>
<td>146</td>
<td align="center">Jessica</td>
<td>98</td></tr>
<tr align="right"><td>7</td>
<td align="center">Zachary</td>
<td>127</td>
<td align="center">Elizabeth</td>
<td>84</td></tr>
<tr align="right"><td>8</td>
<td align="center">Andrew</td>
<td>122</td>
<td align="center">Olivia</td>
<td>82</td></tr>
<tr align="right"><td>9</td>
<td align="center">Christopher</td>
<td>120</td>
<td align="center">Abigail</td>
<td>75</td></tr>
<tr align="right"><td>10</td>
<td align="center">Kyle</td>
<td>119</td>
<td align="center">Madison</td>
<td>74</td></tr>
<tr align="right"><td>11</td>
<td align="center">Joshua</td>
<td>118</td>
<td align="center">Megan</td>
<td>68</td></tr>
<tr align="right"><td>12</td>
<td align="center">Joseph</td>
<td>112</td>
<td align="center">Taylor</td>
<td>67</td></tr>
<tr align="right"><td>13</td>
<td align="center">Brandon</td>
<td>101</td>
<td align="center">Kayla</td>
<td>65</td></tr>
<tr align="right"><td>14</td>
<td align="center">Alexander</td>
<td>92</td>
<td align="center">Rachel</td>
<td>65</td></tr>
<tr align="right"><td>15</td>
<td align="center">Benjamin</td>
<td>92</td>
<td align="center">Morgan</td>
<td>63</td></tr>
<tr align="right"><td>16</td>
<td align="center">John</td>
<td>87</td>
<td align="center">Rebecca</td>
<td>63</td></tr>
<tr align="right"><td>17</td>
<td align="center">Daniel</td>
<td>86</td>
<td align="center">Emma</td>
<td>62</td></tr>
<tr align="right"><td>18</td>
<td align="center">Cameron</td>
<td>85</td>
<td align="center">Alexis</td>
<td>61</td></tr>
<tr align="right"><td>19</td>
<td align="center">James</td>
<td>83</td>
<td align="center">Brianna</td>
<td>61</td></tr>
<tr align="right"><td>20</td>
<td align="center">William</td>
<td>83</td>
<td align="center">Amanda</td>
<td>60</td></tr>
<tr align="right"><td>21</td>
<td align="center">Dylan</td>
<td>81</td>
<td align="center">Nicole</td>
<td>60</td></tr>
<tr align="right"><td>22</td>
<td align="center">Robert</td>
<td>80</td>
<td align="center">Alyssa</td>
<td>59</td></tr>
<tr align="right"><td>23</td>
<td align="center">Thomas</td>
<td>80</td>
<td align="center">Alexandra</td>
<td>57</td></tr>
<tr align="right"><td>24</td>
<td align="center">Samuel</td>
<td>72</td>
<td align="center">Lauren</td>
<td>53</td></tr>
<tr align="right"><td>25</td>
<td align="center">David</td>
<td>71</td>
<td align="center">Katherine</td>
<td>49</td></tr>
<tr align="right"><td>26</td>
<td align="center">Austin</td>
<td>68</td>
<td align="center">Haley</td>
<td>46</td></tr>
<tr align="right"><td>27</td>
<td align="center">Jonathan</td>
<td>67</td>
<td align="center">Courtney</td>
<td>45</td></tr>
<tr align="right"><td>28</td>
<td align="center">Justin</td>
<td>64</td>
<td align="center">Victoria</td>
<td>45</td></tr>
<tr align="right"><td>29</td>
<td align="center">Cody</td>
<td>63</td>
<td align="center">Brittany</td>
<td>41</td></tr>
<tr align="right"><td>30</td>
<td align="center">Connor</td>
<td>63</td>
<td align="center">Molly</td>
<td>41</td></tr>
<tr align="right"><td>31</td>
<td align="center">Anthony</td>
<td>60</td>
<td align="center">Sydney</td>
<td>40</td></tr>
<tr align="right"><td>32</td>
<td align="center">Nathan</td>
<td>59</td>
<td align="center">Erin</td>
<td>39</td></tr>
<tr align="right"><td>33</td>
<td align="center">Timothy</td>
<td>55</td>
<td align="center">Anna</td>
<td>38</td></tr>
<tr align="right"><td>34</td>
<td align="center">Noah</td>
<td>53</td>
<td align="center">Jordan</td>
<td>38</td></tr>
<tr align="right"><td>35</td>
<td align="center">Brian</td>
<td>51</td>
<td align="center">Julia</td>
<td>37</td></tr>
<tr align="right"><td>36</td>
<td align="center">Jason</td>
<td>47</td>
<td align="center">Meghan</td>
<td>37</td></tr>
<tr align="right"><td>37</td>
<td align="center">Hunter</td>
<td>44</td>
<td align="center">Shannon</td>
<td>37</td></tr>
<tr align="right"><td>38</td>
<td align="center">Ian</td>
<td>44</td>
<td align="center">Danielle</td>
<td>36</td></tr>
<tr align="right"><td>39</td>
<td align="center">Evan</td>
<td>43</td>
<td align="center">Mackenzie</td>
<td>34</td></tr>
<tr align="right"><td>40</td>
<td align="center">Patrick</td>
<td>43</td>
<td align="center">Stephanie</td>
<td>34</td></tr>
<tr align="right"><td>41</td>
<td align="center">Eric</td>
<td>40</td>
<td align="center">Allison</td>
<td>32</td></tr>
<tr align="right"><td>42</td>
<td align="center">Jordan</td>
<td>40</td>
<td align="center">Kelsey</td>
<td>32</td></tr>
<tr align="right"><td>43</td>
<td align="center">Kevin</td>
<td>39</td>
<td align="center">Margaret</td>
<td>32</td></tr>
<tr align="right"><td>44</td>
<td align="center">Adam</td>
<td>37</td>
<td align="center">Brooke</td>
<td>31</td></tr>
<tr align="right"><td>45</td>
<td align="center">Ethan</td>
<td>37</td>
<td align="center">Gabrielle</td>
<td>30</td></tr>
<tr align="right"><td>46</td>
<td align="center">Logan</td>
<td>37</td>
<td align="center">Jennifer</td>
<td>30</td></tr>
<tr align="right"><td>47</td>
<td align="center">Caleb</td>
<td>36</td>
<td align="center">Jillian</td>
<td>30</td></tr>
<tr align="right"><td>48</td>
<td align="center">Colin</td>
<td>36</td>
<td align="center">Caitlin</td>
<td>28</td></tr>
<tr align="right"><td>49</td>
<td align="center">Aaron</td>
<td>35</td>
<td align="center">Paige</td>
<td>28</td></tr>
<tr align="right"><td>50</td>
<td align="center">Alex</td>
<td>34</td>
<td align="center">Cassandra</td>
<td>27</td></tr>
<tr align="right"><td>51</td>
<td align="center">Trevor</td>
<td>34</td>
<td align="center">Michaela</td>
<td>27</td></tr>
<tr align="right"><td>52</td>
<td align="center">Lucas</td>
<td>33</td>
<td align="center">Laura</td>
<td>26</td></tr>
<tr align="right"><td>53</td>
<td align="center">Steven</td>
<td>33</td>
<td align="center">Amber</td>
<td>25</td></tr>
<tr align="right"><td>54</td>
<td align="center">Jack</td>
<td>31</td>
<td align="center">Mariah</td>
<td>25</td></tr>
<tr align="right"><td>55</td>
<td align="center">Jeremy</td>
<td>29</td>
<td align="center">Mary</td>
<td>25</td></tr>
<tr align="right"><td>56</td>
<td align="center">Peter</td>
<td>29</td>
<td align="center">Alexandria</td>
<td>24</td></tr>
<tr align="right"><td>57</td>
<td align="center">Sean</td>
<td>29</td>
<td align="center">Catherine</td>
<td>24</td></tr>
<tr align="right"><td>58</td>
<td align="center">Brendan</td>
<td>28</td>
<td align="center">Heather</td>
<td>24</td></tr>
<tr align="right"><td>59</td>
<td align="center">Devin</td>
<td>28</td>
<td align="center">Kathryn</td>
<td>24</td></tr>
<tr align="right"><td>60</td>
<td align="center">Jared</td>
<td>28</td>
<td align="center">Tiffany</td>
<td>23</td></tr>
<tr align="right"><td>61</td>
<td align="center">Luke</td>
<td>28</td>
<td align="center">Grace</td>
<td>22</td></tr>
<tr align="right"><td>62</td>
<td align="center">Travis</td>
<td>28</td>
<td align="center">Marissa</td>
<td>22</td></tr>
<tr align="right"><td>63</td>
<td align="center">Liam</td>
<td>27</td>
<td align="center">Casey</td>
<td>21</td></tr>
<tr align="right"><td>64</td>
<td align="center">Stephen</td>
<td>27</td>
<td align="center">Jenna</td>
<td>21</td></tr>
<tr align="right"><td>65</td>
<td align="center">Christian</td>
<td>25</td>
<td align="center">Natalie</td>
<td>21</td></tr>
<tr align="right"><td>66</td>
<td align="center">Colby</td>
<td>25</td>
<td align="center">Shelby</td>
<td>21</td></tr>
<tr align="right"><td>67</td>
<td align="center">Devon</td>
<td>25</td>
<td align="center">Christina</td>
<td>20</td></tr>
<tr align="right"><td>68</td>
<td align="center">Dakota</td>
<td>24</td>
<td align="center">Jasmine</td>
<td>20</td></tr>
<tr align="right"><td>69</td>
<td align="center">Paul</td>
<td>24</td>
<td align="center">Kaitlyn</td>
<td>20</td></tr>
<tr align="right"><td>70</td>
<td align="center">Nathaniel</td>
<td>23</td>
<td align="center">Kristen</td>
<td>20</td></tr>
<tr align="right"><td>71</td>
<td align="center">Charles</td>
<td>22</td>
<td align="center">Madeline</td>
<td>20</td></tr>
<tr align="right"><td>72</td>
<td align="center">Derek</td>
<td>22</td>
<td align="center">Kelly</td>
<td>19</td></tr>
<tr align="right"><td>73</td>
<td align="center">Griffin</td>
<td>22</td>
<td align="center">Lindsey</td>
<td>19</td></tr>
<tr align="right"><td>74</td>
<td align="center">Mitchell</td>
<td>22</td>
<td align="center">Autumn</td>
<td>18</td></tr>
<tr align="right"><td>75</td>
<td align="center">Richard</td>
<td>22</td>
<td align="center">Chelsea</td>
<td>18</td></tr>
<tr align="right"><td>76</td>
<td align="center">Cole</td>
<td>21</td>
<td align="center">Erica</td>
<td>18</td></tr>
<tr align="right"><td>77</td>
<td align="center">Isaac</td>
<td>21</td>
<td align="center">Hailey</td>
<td>18</td></tr>
<tr align="right"><td>78</td>
<td align="center">Isaiah</td>
<td>21</td>
<td align="center">Katelyn</td>
<td>18</td></tr>
<tr align="right"><td>79</td>
<td align="center">Jeffrey</td>
<td>21</td>
<td align="center">Miranda</td>
<td>18</td></tr>
<tr align="right"><td>80</td>
<td align="center">Jesse</td>
<td>21</td>
<td align="center">Sierra</td>
<td>18</td></tr>
<tr align="right"><td>81</td>
<td align="center">Mark</td>
<td>21</td>
<td align="center">Sophia</td>
<td>18</td></tr>
<tr align="right"><td>82</td>
<td align="center">Seth</td>
<td>21</td>
<td align="center">Lillian</td>
<td>17</td></tr>
<tr align="right"><td>83</td>
<td align="center">Taylor</td>
<td>21</td>
<td align="center">Melissa</td>
<td>17</td></tr>
<tr align="right"><td>84</td>
<td align="center">Bradley</td>
<td>20</td>
<td align="center">Natasha</td>
<td>17</td></tr>
<tr align="right"><td>85</td>
<td align="center">Dominic</td>
<td>20</td>
<td align="center">Sabrina</td>
<td>17</td></tr>
<tr align="right"><td>86</td>
<td align="center">Spencer</td>
<td>20</td>
<td align="center">Sara</td>
<td>17</td></tr>
<tr align="right"><td>87</td>
<td align="center">Tristan</td>
<td>20</td>
<td align="center">Baby</td>
<td>16</td></tr>
<tr align="right"><td>88</td>
<td align="center">Bryan</td>
<td>19</td>
<td align="center">Caroline</td>
<td>16</td></tr>
<tr align="right"><td>89</td>
<td align="center">Bryce</td>
<td>19</td>
<td align="center">Mikayla</td>
<td>16</td></tr>
<tr align="right"><td>90</td>
<td align="center">Alec</td>
<td>18</td>
<td align="center">Jamie</td>
<td>15</td></tr>
<tr align="right"><td>91</td>
<td align="center">Brett</td>
<td>18</td>
<td align="center">Maria</td>
<td>15</td></tr>
<tr align="right"><td>92</td>
<td align="center">Riley</td>
<td>18</td>
<td align="center">Michelle</td>
<td>15</td></tr>
<tr align="right"><td>93</td>
<td align="center">Bailey</td>
<td>17</td>
<td align="center">Alicia</td>
<td>14</td></tr>
<tr align="right"><td>94</td>
<td align="center">Corey</td>
<td>17</td>
<td align="center">Angela</td>
<td>14</td></tr>
<tr align="right"><td>95</td>
<td align="center">Garrett</td>
<td>17</td>
<td align="center">Isabella</td>
<td>14</td></tr>
<tr align="right"><td>96</td>
<td align="center">Keith</td>
<td>17</td>
<td align="center">Jacqueline</td>
<td>14</td></tr>
<tr align="right"><td>97</td>
<td align="center">Maxwell</td>
<td>17</td>
<td align="center">Kimberly</td>
<td>14</td></tr>
<tr align="right"><td>98</td>
<td align="center">Scott</td>
<td>17</td>
<td align="center">Leah</td>
<td>14</td></tr>
<tr align="right"><td>99</td>
<td align="center">Shane</td>
<td>17</td>
<td align="center">Lindsay</td>
<td>14</td></tr>
<tr align="right"><td>100</td>
<td align="center">Tucker</td>
<td>17</td>
<td align="center">Lydia</td>
<td>14</td></tr>
</table></td></tr></table>
<table class="printhide" width="100%" border="0" cellpadding="1" cellspacing="0">
<tr bgcolor="#333366"><td height="1" valign="top" height="1" colspan="3"></td></tr>
<tr>
<td width="26%" valign="middle"> <a href="http://www.firstgov.gov"><img
src="/templateimages/firstgov3.gif" width="72" height="15"
alt="Link to FirstGov.gov: U.S. Government portal" border="0"></a></td>
<td valign="top" class="seventypercent">
<a href="http://www.ssa.gov/privacy.html">Privacy Policy</a>
| <a href="http://www.ssa.gov/websitepolicies.htm">Website Policies
& Other Important Information</a>
| <a href="http://www.ssa.gov/sitemap.htm">Site Map</a></td>
</tr>
</table>
</body></html>
| guydavis/babynamemap | stats/usa/NH/1997.html | HTML | gpl-3.0 | 20,463 |
# Be sure to restart your server when you modify this file.
EdbookfestMobile::Application.config.session_store :cookie_store, key: '_edbookfest-mobile_session'
# Use the database for sessions instead of the cookie-based default,
# which shouldn't be used to store highly confidential information
# (create the session table with "rails generate session_migration")
# EdbookfestMobile::Application.config.session_store :active_record_store
| festivalslab/edbookfest-mobile | config/initializers/session_store.rb | Ruby | gpl-3.0 | 441 |
<!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_27) on Sat Oct 06 02:59:45 EDT 2012 -->
<META http-equiv="Content-Type" content="text/html; charset=utf-8">
<TITLE>
Uses of Class org.apache.lucene.queries.function.ValueSource (Lucene 4.0.0 API)
</TITLE>
<META NAME="date" CONTENT="2012-10-06">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Uses of Class org.apache.lucene.queries.function.ValueSource (Lucene 4.0.0 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="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../org/apache/lucene/queries/function/ValueSource.html" title="class in org.apache.lucene.queries.function"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT> </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">
PREV
NEXT</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../../index.html?org/apache/lucene/queries/function//class-useValueSource.html" target="_top"><B>FRAMES</B></A>
<A HREF="ValueSource.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>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<CENTER>
<H2>
<B>Uses of Class<br>org.apache.lucene.queries.function.ValueSource</B></H2>
</CENTER>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
Packages that use <A HREF="../../../../../../org/apache/lucene/queries/function/ValueSource.html" title="class in org.apache.lucene.queries.function">ValueSource</A></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><A HREF="#org.apache.lucene.queries.function"><B>org.apache.lucene.queries.function</B></A></TD>
<TD>Queries that compute score based upon a function </TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><A HREF="#org.apache.lucene.queries.function.docvalues"><B>org.apache.lucene.queries.function.docvalues</B></A></TD>
<TD>FunctionValues for different data types. </TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><A HREF="#org.apache.lucene.queries.function.valuesource"><B>org.apache.lucene.queries.function.valuesource</B></A></TD>
<TD>A variety of functions to use with FunctionQuery. </TD>
</TR>
</TABLE>
<P>
<A NAME="org.apache.lucene.queries.function"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
Uses of <A HREF="../../../../../../org/apache/lucene/queries/function/ValueSource.html" title="class in org.apache.lucene.queries.function">ValueSource</A> in <A HREF="../../../../../../org/apache/lucene/queries/function/package-summary.html">org.apache.lucene.queries.function</A></FONT></TH>
</TR>
</TABLE>
<P>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left" COLSPAN="2">Methods in <A HREF="../../../../../../org/apache/lucene/queries/function/package-summary.html">org.apache.lucene.queries.function</A> that return <A HREF="../../../../../../org/apache/lucene/queries/function/ValueSource.html" title="class in org.apache.lucene.queries.function">ValueSource</A></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../../../org/apache/lucene/queries/function/ValueSource.html" title="class in org.apache.lucene.queries.function">ValueSource</A></CODE></FONT></TD>
<TD><CODE><B>BoostedQuery.</B><B><A HREF="../../../../../../org/apache/lucene/queries/function/BoostedQuery.html#getValueSource()">getValueSource</A></B>()</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../../../org/apache/lucene/queries/function/ValueSource.html" title="class in org.apache.lucene.queries.function">ValueSource</A></CODE></FONT></TD>
<TD><CODE><B>FunctionQuery.</B><B><A HREF="../../../../../../org/apache/lucene/queries/function/FunctionQuery.html#getValueSource()">getValueSource</A></B>()</CODE>
<BR>
</TD>
</TR>
</TABLE>
<P>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left" COLSPAN="2">Constructors in <A HREF="../../../../../../org/apache/lucene/queries/function/package-summary.html">org.apache.lucene.queries.function</A> with parameters of type <A HREF="../../../../../../org/apache/lucene/queries/function/ValueSource.html" title="class in org.apache.lucene.queries.function">ValueSource</A></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../../../org/apache/lucene/queries/function/BoostedQuery.html#BoostedQuery(org.apache.lucene.search.Query, org.apache.lucene.queries.function.ValueSource)">BoostedQuery</A></B>(<A HREF="../../../../../../../core/org/apache/lucene/search/Query.html?is-external=true" title="class or interface in org.apache.lucene.search">Query</A> subQuery,
<A HREF="../../../../../../org/apache/lucene/queries/function/ValueSource.html" title="class in org.apache.lucene.queries.function">ValueSource</A> boostVal)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../../../org/apache/lucene/queries/function/FunctionQuery.html#FunctionQuery(org.apache.lucene.queries.function.ValueSource)">FunctionQuery</A></B>(<A HREF="../../../../../../org/apache/lucene/queries/function/ValueSource.html" title="class in org.apache.lucene.queries.function">ValueSource</A> func)</CODE>
<BR>
</TD>
</TR>
</TABLE>
<P>
<A NAME="org.apache.lucene.queries.function.docvalues"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
Uses of <A HREF="../../../../../../org/apache/lucene/queries/function/ValueSource.html" title="class in org.apache.lucene.queries.function">ValueSource</A> in <A HREF="../../../../../../org/apache/lucene/queries/function/docvalues/package-summary.html">org.apache.lucene.queries.function.docvalues</A></FONT></TH>
</TR>
</TABLE>
<P>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left" COLSPAN="2">Fields in <A HREF="../../../../../../org/apache/lucene/queries/function/docvalues/package-summary.html">org.apache.lucene.queries.function.docvalues</A> declared as <A HREF="../../../../../../org/apache/lucene/queries/function/ValueSource.html" title="class in org.apache.lucene.queries.function">ValueSource</A></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected <A HREF="../../../../../../org/apache/lucene/queries/function/ValueSource.html" title="class in org.apache.lucene.queries.function">ValueSource</A></CODE></FONT></TD>
<TD><CODE><B>DocTermsIndexDocValues.</B><B><A HREF="../../../../../../org/apache/lucene/queries/function/docvalues/DocTermsIndexDocValues.html#vs">vs</A></B></CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected <A HREF="../../../../../../org/apache/lucene/queries/function/ValueSource.html" title="class in org.apache.lucene.queries.function">ValueSource</A></CODE></FONT></TD>
<TD><CODE><B>IntDocValues.</B><B><A HREF="../../../../../../org/apache/lucene/queries/function/docvalues/IntDocValues.html#vs">vs</A></B></CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected <A HREF="../../../../../../org/apache/lucene/queries/function/ValueSource.html" title="class in org.apache.lucene.queries.function">ValueSource</A></CODE></FONT></TD>
<TD><CODE><B>LongDocValues.</B><B><A HREF="../../../../../../org/apache/lucene/queries/function/docvalues/LongDocValues.html#vs">vs</A></B></CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected <A HREF="../../../../../../org/apache/lucene/queries/function/ValueSource.html" title="class in org.apache.lucene.queries.function">ValueSource</A></CODE></FONT></TD>
<TD><CODE><B>BoolDocValues.</B><B><A HREF="../../../../../../org/apache/lucene/queries/function/docvalues/BoolDocValues.html#vs">vs</A></B></CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected <A HREF="../../../../../../org/apache/lucene/queries/function/ValueSource.html" title="class in org.apache.lucene.queries.function">ValueSource</A></CODE></FONT></TD>
<TD><CODE><B>StrDocValues.</B><B><A HREF="../../../../../../org/apache/lucene/queries/function/docvalues/StrDocValues.html#vs">vs</A></B></CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected <A HREF="../../../../../../org/apache/lucene/queries/function/ValueSource.html" title="class in org.apache.lucene.queries.function">ValueSource</A></CODE></FONT></TD>
<TD><CODE><B>FloatDocValues.</B><B><A HREF="../../../../../../org/apache/lucene/queries/function/docvalues/FloatDocValues.html#vs">vs</A></B></CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected <A HREF="../../../../../../org/apache/lucene/queries/function/ValueSource.html" title="class in org.apache.lucene.queries.function">ValueSource</A></CODE></FONT></TD>
<TD><CODE><B>DoubleDocValues.</B><B><A HREF="../../../../../../org/apache/lucene/queries/function/docvalues/DoubleDocValues.html#vs">vs</A></B></CODE>
<BR>
</TD>
</TR>
</TABLE>
<P>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left" COLSPAN="2">Constructors in <A HREF="../../../../../../org/apache/lucene/queries/function/docvalues/package-summary.html">org.apache.lucene.queries.function.docvalues</A> with parameters of type <A HREF="../../../../../../org/apache/lucene/queries/function/ValueSource.html" title="class in org.apache.lucene.queries.function">ValueSource</A></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../../../org/apache/lucene/queries/function/docvalues/BoolDocValues.html#BoolDocValues(org.apache.lucene.queries.function.ValueSource)">BoolDocValues</A></B>(<A HREF="../../../../../../org/apache/lucene/queries/function/ValueSource.html" title="class in org.apache.lucene.queries.function">ValueSource</A> vs)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../../../org/apache/lucene/queries/function/docvalues/DocTermsIndexDocValues.html#DocTermsIndexDocValues(org.apache.lucene.queries.function.ValueSource, org.apache.lucene.index.AtomicReaderContext, java.lang.String)">DocTermsIndexDocValues</A></B>(<A HREF="../../../../../../org/apache/lucene/queries/function/ValueSource.html" title="class in org.apache.lucene.queries.function">ValueSource</A> vs,
<A HREF="../../../../../../../core/org/apache/lucene/index/AtomicReaderContext.html?is-external=true" title="class or interface in org.apache.lucene.index">AtomicReaderContext</A> context,
<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> field)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../../../org/apache/lucene/queries/function/docvalues/DoubleDocValues.html#DoubleDocValues(org.apache.lucene.queries.function.ValueSource)">DoubleDocValues</A></B>(<A HREF="../../../../../../org/apache/lucene/queries/function/ValueSource.html" title="class in org.apache.lucene.queries.function">ValueSource</A> vs)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../../../org/apache/lucene/queries/function/docvalues/FloatDocValues.html#FloatDocValues(org.apache.lucene.queries.function.ValueSource)">FloatDocValues</A></B>(<A HREF="../../../../../../org/apache/lucene/queries/function/ValueSource.html" title="class in org.apache.lucene.queries.function">ValueSource</A> vs)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../../../org/apache/lucene/queries/function/docvalues/IntDocValues.html#IntDocValues(org.apache.lucene.queries.function.ValueSource)">IntDocValues</A></B>(<A HREF="../../../../../../org/apache/lucene/queries/function/ValueSource.html" title="class in org.apache.lucene.queries.function">ValueSource</A> vs)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../../../org/apache/lucene/queries/function/docvalues/LongDocValues.html#LongDocValues(org.apache.lucene.queries.function.ValueSource)">LongDocValues</A></B>(<A HREF="../../../../../../org/apache/lucene/queries/function/ValueSource.html" title="class in org.apache.lucene.queries.function">ValueSource</A> vs)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../../../org/apache/lucene/queries/function/docvalues/StrDocValues.html#StrDocValues(org.apache.lucene.queries.function.ValueSource)">StrDocValues</A></B>(<A HREF="../../../../../../org/apache/lucene/queries/function/ValueSource.html" title="class in org.apache.lucene.queries.function">ValueSource</A> vs)</CODE>
<BR>
</TD>
</TR>
</TABLE>
<P>
<A NAME="org.apache.lucene.queries.function.valuesource"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
Uses of <A HREF="../../../../../../org/apache/lucene/queries/function/ValueSource.html" title="class in org.apache.lucene.queries.function">ValueSource</A> in <A HREF="../../../../../../org/apache/lucene/queries/function/valuesource/package-summary.html">org.apache.lucene.queries.function.valuesource</A></FONT></TH>
</TR>
</TABLE>
<P>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left" COLSPAN="2">Subclasses of <A HREF="../../../../../../org/apache/lucene/queries/function/ValueSource.html" title="class in org.apache.lucene.queries.function">ValueSource</A> in <A HREF="../../../../../../org/apache/lucene/queries/function/valuesource/package-summary.html">org.apache.lucene.queries.function.valuesource</A></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> class</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../org/apache/lucene/queries/function/valuesource/BoolFunction.html" title="class in org.apache.lucene.queries.function.valuesource">BoolFunction</A></B></CODE>
<BR>
Abstract parent class for those <A HREF="../../../../../../org/apache/lucene/queries/function/ValueSource.html" title="class in org.apache.lucene.queries.function"><CODE>ValueSource</CODE></A> implementations which
apply boolean logic to their values</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> class</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../org/apache/lucene/queries/function/valuesource/ByteFieldSource.html" title="class in org.apache.lucene.queries.function.valuesource">ByteFieldSource</A></B></CODE>
<BR>
Obtains int field values from the <A HREF="../../../../../../../core/org/apache/lucene/search/FieldCache.html?is-external=true" title="class or interface in org.apache.lucene.search"><CODE>FieldCache</CODE></A>
using <code>getInts()</code>
and makes those values available as other numeric types, casting as needed.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> class</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../org/apache/lucene/queries/function/valuesource/BytesRefFieldSource.html" title="class in org.apache.lucene.queries.function.valuesource">BytesRefFieldSource</A></B></CODE>
<BR>
An implementation for retrieving <A HREF="../../../../../../org/apache/lucene/queries/function/FunctionValues.html" title="class in org.apache.lucene.queries.function"><CODE>FunctionValues</CODE></A> instances for string based fields.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> class</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../org/apache/lucene/queries/function/valuesource/ConstNumberSource.html" title="class in org.apache.lucene.queries.function.valuesource">ConstNumberSource</A></B></CODE>
<BR>
<code>ConstNumberSource</code> is the base class for all constant numbers</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> class</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../org/apache/lucene/queries/function/valuesource/ConstValueSource.html" title="class in org.apache.lucene.queries.function.valuesource">ConstValueSource</A></B></CODE>
<BR>
<code>ConstValueSource</code> returns a constant for all documents</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> class</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../org/apache/lucene/queries/function/valuesource/DefFunction.html" title="class in org.apache.lucene.queries.function.valuesource">DefFunction</A></B></CODE>
<BR>
<A HREF="../../../../../../org/apache/lucene/queries/function/ValueSource.html" title="class in org.apache.lucene.queries.function"><CODE>ValueSource</CODE></A> implementation which only returns the values from the provided
ValueSources which are available for a particular docId.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> class</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../org/apache/lucene/queries/function/valuesource/DivFloatFunction.html" title="class in org.apache.lucene.queries.function.valuesource">DivFloatFunction</A></B></CODE>
<BR>
Function to divide "a" by "b"</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> class</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../org/apache/lucene/queries/function/valuesource/DocFreqValueSource.html" title="class in org.apache.lucene.queries.function.valuesource">DocFreqValueSource</A></B></CODE>
<BR>
<code>DocFreqValueSource</code> returns the number of documents containing the term.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> class</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../org/apache/lucene/queries/function/valuesource/DoubleConstValueSource.html" title="class in org.apache.lucene.queries.function.valuesource">DoubleConstValueSource</A></B></CODE>
<BR>
Function that returns a constant double value for every document.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> class</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../org/apache/lucene/queries/function/valuesource/DoubleFieldSource.html" title="class in org.apache.lucene.queries.function.valuesource">DoubleFieldSource</A></B></CODE>
<BR>
Obtains float field values from the <A HREF="../../../../../../../core/org/apache/lucene/search/FieldCache.html?is-external=true" title="class or interface in org.apache.lucene.search"><CODE>FieldCache</CODE></A>
using <code>getFloats()</code>
and makes those values available as other numeric types, casting as needed.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> class</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../org/apache/lucene/queries/function/valuesource/DualFloatFunction.html" title="class in org.apache.lucene.queries.function.valuesource">DualFloatFunction</A></B></CODE>
<BR>
Abstract <A HREF="../../../../../../org/apache/lucene/queries/function/ValueSource.html" title="class in org.apache.lucene.queries.function"><CODE>ValueSource</CODE></A> implementation which wraps two ValueSources
and applies an extendible float function to their values.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> class</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../org/apache/lucene/queries/function/valuesource/FieldCacheSource.html" title="class in org.apache.lucene.queries.function.valuesource">FieldCacheSource</A></B></CODE>
<BR>
A base class for ValueSource implementations that retrieve values for
a single field from the <A HREF="../../../../../../../core/org/apache/lucene/search/FieldCache.html?is-external=true" title="class or interface in org.apache.lucene.search"><CODE>FieldCache</CODE></A>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> class</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../org/apache/lucene/queries/function/valuesource/FloatFieldSource.html" title="class in org.apache.lucene.queries.function.valuesource">FloatFieldSource</A></B></CODE>
<BR>
Obtains float field values from the <A HREF="../../../../../../../core/org/apache/lucene/search/FieldCache.html?is-external=true" title="class or interface in org.apache.lucene.search"><CODE>FieldCache</CODE></A>
using <code>getFloats()</code>
and makes those values available as other numeric types, casting as needed.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> class</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../org/apache/lucene/queries/function/valuesource/IDFValueSource.html" title="class in org.apache.lucene.queries.function.valuesource">IDFValueSource</A></B></CODE>
<BR>
Function that returns <A HREF="../../../../../../../core/org/apache/lucene/search/similarities/TFIDFSimilarity.html?is-external=true" title="class or interface in org.apache.lucene.search.similarities"><CODE>#idf(long, long)</CODE></A>
for every document.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> class</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../org/apache/lucene/queries/function/valuesource/IfFunction.html" title="class in org.apache.lucene.queries.function.valuesource">IfFunction</A></B></CODE>
<BR>
Depending on the boolean value of the <code>ifSource</code> function,
returns the value of the <code>trueSource</code> or <code>falseSource</code> function.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> class</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../org/apache/lucene/queries/function/valuesource/IntFieldSource.html" title="class in org.apache.lucene.queries.function.valuesource">IntFieldSource</A></B></CODE>
<BR>
Obtains int field values from the <A HREF="../../../../../../../core/org/apache/lucene/search/FieldCache.html?is-external=true" title="class or interface in org.apache.lucene.search"><CODE>FieldCache</CODE></A>
using <code>getInts()</code>
and makes those values available as other numeric types, casting as needed.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> class</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../org/apache/lucene/queries/function/valuesource/JoinDocFreqValueSource.html" title="class in org.apache.lucene.queries.function.valuesource">JoinDocFreqValueSource</A></B></CODE>
<BR>
Use a field value and find the Document Frequency within another field.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> class</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../org/apache/lucene/queries/function/valuesource/LinearFloatFunction.html" title="class in org.apache.lucene.queries.function.valuesource">LinearFloatFunction</A></B></CODE>
<BR>
<code>LinearFloatFunction</code> implements a linear function over
another <A HREF="../../../../../../org/apache/lucene/queries/function/ValueSource.html" title="class in org.apache.lucene.queries.function"><CODE>ValueSource</CODE></A>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> class</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../org/apache/lucene/queries/function/valuesource/LiteralValueSource.html" title="class in org.apache.lucene.queries.function.valuesource">LiteralValueSource</A></B></CODE>
<BR>
Pass a the field value through as a String, no matter the type // Q: doesn't this mean it's a "string"?</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> class</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../org/apache/lucene/queries/function/valuesource/LongFieldSource.html" title="class in org.apache.lucene.queries.function.valuesource">LongFieldSource</A></B></CODE>
<BR>
Obtains float field values from the <A HREF="../../../../../../../core/org/apache/lucene/search/FieldCache.html?is-external=true" title="class or interface in org.apache.lucene.search"><CODE>FieldCache</CODE></A>
using <code>getFloats()</code>
and makes those values available as other numeric types, casting as needed.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> class</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../org/apache/lucene/queries/function/valuesource/MaxDocValueSource.html" title="class in org.apache.lucene.queries.function.valuesource">MaxDocValueSource</A></B></CODE>
<BR>
Returns the value of <A HREF="../../../../../../../core/org/apache/lucene/index/IndexReader.html?is-external=true#maxDoc()" title="class or interface in org.apache.lucene.index"><CODE>IndexReader.maxDoc()</CODE></A>
for every document.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> class</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../org/apache/lucene/queries/function/valuesource/MaxFloatFunction.html" title="class in org.apache.lucene.queries.function.valuesource">MaxFloatFunction</A></B></CODE>
<BR>
<code>MaxFloatFunction</code> returns the max of it's components.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> class</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../org/apache/lucene/queries/function/valuesource/MinFloatFunction.html" title="class in org.apache.lucene.queries.function.valuesource">MinFloatFunction</A></B></CODE>
<BR>
<code>MinFloatFunction</code> returns the min of it's components.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> class</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../org/apache/lucene/queries/function/valuesource/MultiBoolFunction.html" title="class in org.apache.lucene.queries.function.valuesource">MultiBoolFunction</A></B></CODE>
<BR>
Abstract <A HREF="../../../../../../org/apache/lucene/queries/function/ValueSource.html" title="class in org.apache.lucene.queries.function"><CODE>ValueSource</CODE></A> implementation which wraps multiple ValueSources
and applies an extendible boolean function to their values.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> class</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../org/apache/lucene/queries/function/valuesource/MultiFloatFunction.html" title="class in org.apache.lucene.queries.function.valuesource">MultiFloatFunction</A></B></CODE>
<BR>
Abstract <A HREF="../../../../../../org/apache/lucene/queries/function/ValueSource.html" title="class in org.apache.lucene.queries.function"><CODE>ValueSource</CODE></A> implementation which wraps multiple ValueSources
and applies an extendible float function to their values.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> class</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../org/apache/lucene/queries/function/valuesource/MultiFunction.html" title="class in org.apache.lucene.queries.function.valuesource">MultiFunction</A></B></CODE>
<BR>
Abstract parent class for <A HREF="../../../../../../org/apache/lucene/queries/function/ValueSource.html" title="class in org.apache.lucene.queries.function"><CODE>ValueSource</CODE></A> implementations that wrap multiple
ValueSources and apply their own logic.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> class</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../org/apache/lucene/queries/function/valuesource/MultiValueSource.html" title="class in org.apache.lucene.queries.function.valuesource">MultiValueSource</A></B></CODE>
<BR>
A <A HREF="../../../../../../org/apache/lucene/queries/function/ValueSource.html" title="class in org.apache.lucene.queries.function"><CODE>ValueSource</CODE></A> that abstractly represents <A HREF="../../../../../../org/apache/lucene/queries/function/ValueSource.html" title="class in org.apache.lucene.queries.function"><CODE>ValueSource</CODE></A>s for
poly fields, and other things.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> class</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../org/apache/lucene/queries/function/valuesource/NormValueSource.html" title="class in org.apache.lucene.queries.function.valuesource">NormValueSource</A></B></CODE>
<BR>
Function that returns <A HREF="../../../../../../../core/org/apache/lucene/search/similarities/TFIDFSimilarity.html?is-external=true#decodeNormValue(byte)" title="class or interface in org.apache.lucene.search.similarities"><CODE>TFIDFSimilarity.decodeNormValue(byte)</CODE></A>
for every document.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> class</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../org/apache/lucene/queries/function/valuesource/NumDocsValueSource.html" title="class in org.apache.lucene.queries.function.valuesource">NumDocsValueSource</A></B></CODE>
<BR>
Returns the value of <A HREF="../../../../../../../core/org/apache/lucene/index/IndexReader.html?is-external=true#numDocs()" title="class or interface in org.apache.lucene.index"><CODE>IndexReader.numDocs()</CODE></A>
for every document.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> class</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../org/apache/lucene/queries/function/valuesource/NumericIndexDocValueSource.html" title="class in org.apache.lucene.queries.function.valuesource">NumericIndexDocValueSource</A></B></CODE>
<BR>
Expert: obtains numeric field values from a <A HREF="../../../../../../org/apache/lucene/queries/function/FunctionValues.html" title="class in org.apache.lucene.queries.function"><CODE>FunctionValues</CODE></A> field.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> class</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../org/apache/lucene/queries/function/valuesource/OrdFieldSource.html" title="class in org.apache.lucene.queries.function.valuesource">OrdFieldSource</A></B></CODE>
<BR>
Obtains the ordinal of the field value from the default Lucene <A HREF="../../../../../../../core/org/apache/lucene/search/FieldCache.html?is-external=true" title="class or interface in org.apache.lucene.search"><CODE>FieldCache</CODE></A> using getStringIndex().</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> class</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../org/apache/lucene/queries/function/valuesource/PowFloatFunction.html" title="class in org.apache.lucene.queries.function.valuesource">PowFloatFunction</A></B></CODE>
<BR>
Function to raise the base "a" to the power "b"</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> class</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../org/apache/lucene/queries/function/valuesource/ProductFloatFunction.html" title="class in org.apache.lucene.queries.function.valuesource">ProductFloatFunction</A></B></CODE>
<BR>
<code>ProductFloatFunction</code> returns the product of it's components.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> class</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../org/apache/lucene/queries/function/valuesource/QueryValueSource.html" title="class in org.apache.lucene.queries.function.valuesource">QueryValueSource</A></B></CODE>
<BR>
<code>QueryValueSource</code> returns the relevance score of the query</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> class</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../org/apache/lucene/queries/function/valuesource/RangeMapFloatFunction.html" title="class in org.apache.lucene.queries.function.valuesource">RangeMapFloatFunction</A></B></CODE>
<BR>
<code>LinearFloatFunction</code> implements a linear function over
another <A HREF="../../../../../../org/apache/lucene/queries/function/ValueSource.html" title="class in org.apache.lucene.queries.function"><CODE>ValueSource</CODE></A>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> class</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../org/apache/lucene/queries/function/valuesource/ReciprocalFloatFunction.html" title="class in org.apache.lucene.queries.function.valuesource">ReciprocalFloatFunction</A></B></CODE>
<BR>
<code>ReciprocalFloatFunction</code> implements a reciprocal function f(x) = a/(mx+b), based on
the float value of a field or function as exported by <A HREF="../../../../../../org/apache/lucene/queries/function/ValueSource.html" title="class in org.apache.lucene.queries.function"><CODE>ValueSource</CODE></A>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> class</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../org/apache/lucene/queries/function/valuesource/ReverseOrdFieldSource.html" title="class in org.apache.lucene.queries.function.valuesource">ReverseOrdFieldSource</A></B></CODE>
<BR>
Obtains the ordinal of the field value from the default Lucene <A HREF="../../../../../../../core/org/apache/lucene/search/FieldCache.html?is-external=true" title="class or interface in org.apache.lucene.search"><CODE>FieldCache</CODE></A> using getTermsIndex()
and reverses the order.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> class</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../org/apache/lucene/queries/function/valuesource/ScaleFloatFunction.html" title="class in org.apache.lucene.queries.function.valuesource">ScaleFloatFunction</A></B></CODE>
<BR>
Scales values to be between min and max.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> class</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../org/apache/lucene/queries/function/valuesource/ShortFieldSource.html" title="class in org.apache.lucene.queries.function.valuesource">ShortFieldSource</A></B></CODE>
<BR>
Obtains short field values from the <A HREF="../../../../../../../core/org/apache/lucene/search/FieldCache.html?is-external=true" title="class or interface in org.apache.lucene.search"><CODE>FieldCache</CODE></A>
using <code>getShorts()</code>
and makes those values available as other numeric types, casting as needed.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> class</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../org/apache/lucene/queries/function/valuesource/SimpleBoolFunction.html" title="class in org.apache.lucene.queries.function.valuesource">SimpleBoolFunction</A></B></CODE>
<BR>
<A HREF="../../../../../../org/apache/lucene/queries/function/valuesource/BoolFunction.html" title="class in org.apache.lucene.queries.function.valuesource"><CODE>BoolFunction</CODE></A> implementation which applies an extendible boolean
function to the values of a single wrapped <A HREF="../../../../../../org/apache/lucene/queries/function/ValueSource.html" title="class in org.apache.lucene.queries.function"><CODE>ValueSource</CODE></A>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> class</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../org/apache/lucene/queries/function/valuesource/SimpleFloatFunction.html" title="class in org.apache.lucene.queries.function.valuesource">SimpleFloatFunction</A></B></CODE>
<BR>
A simple float function with a single argument</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> class</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../org/apache/lucene/queries/function/valuesource/SingleFunction.html" title="class in org.apache.lucene.queries.function.valuesource">SingleFunction</A></B></CODE>
<BR>
A function with a single argument</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> class</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../org/apache/lucene/queries/function/valuesource/SumFloatFunction.html" title="class in org.apache.lucene.queries.function.valuesource">SumFloatFunction</A></B></CODE>
<BR>
<code>SumFloatFunction</code> returns the sum of it's components.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> class</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../org/apache/lucene/queries/function/valuesource/SumTotalTermFreqValueSource.html" title="class in org.apache.lucene.queries.function.valuesource">SumTotalTermFreqValueSource</A></B></CODE>
<BR>
<code>SumTotalTermFreqValueSource</code> returns the number of tokens.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> class</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../org/apache/lucene/queries/function/valuesource/TermFreqValueSource.html" title="class in org.apache.lucene.queries.function.valuesource">TermFreqValueSource</A></B></CODE>
<BR>
Function that returns <A HREF="../../../../../../../core/org/apache/lucene/index/DocsEnum.html?is-external=true#freq()" title="class or interface in org.apache.lucene.index"><CODE>DocsEnum.freq()</CODE></A> for the
supplied term in every document.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> class</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../org/apache/lucene/queries/function/valuesource/TFValueSource.html" title="class in org.apache.lucene.queries.function.valuesource">TFValueSource</A></B></CODE>
<BR>
Function that returns <A HREF="../../../../../../../core/org/apache/lucene/search/similarities/TFIDFSimilarity.html?is-external=true#tf(int)" title="class or interface in org.apache.lucene.search.similarities"><CODE>TFIDFSimilarity.tf(int)</CODE></A>
for every document.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> class</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../org/apache/lucene/queries/function/valuesource/TotalTermFreqValueSource.html" title="class in org.apache.lucene.queries.function.valuesource">TotalTermFreqValueSource</A></B></CODE>
<BR>
<code>TotalTermFreqValueSource</code> returns the total term freq
(sum of term freqs across all documents).</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> class</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../org/apache/lucene/queries/function/valuesource/VectorValueSource.html" title="class in org.apache.lucene.queries.function.valuesource">VectorValueSource</A></B></CODE>
<BR>
Converts individual ValueSource instances to leverage the FunctionValues *Val functions that work with multiple values,
i.e.</TD>
</TR>
</TABLE>
<P>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left" COLSPAN="2">Fields in <A HREF="../../../../../../org/apache/lucene/queries/function/valuesource/package-summary.html">org.apache.lucene.queries.function.valuesource</A> declared as <A HREF="../../../../../../org/apache/lucene/queries/function/ValueSource.html" title="class in org.apache.lucene.queries.function">ValueSource</A></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected <A HREF="../../../../../../org/apache/lucene/queries/function/ValueSource.html" title="class in org.apache.lucene.queries.function">ValueSource</A></CODE></FONT></TD>
<TD><CODE><B>DualFloatFunction.</B><B><A HREF="../../../../../../org/apache/lucene/queries/function/valuesource/DualFloatFunction.html#a">a</A></B></CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected <A HREF="../../../../../../org/apache/lucene/queries/function/ValueSource.html" title="class in org.apache.lucene.queries.function">ValueSource</A></CODE></FONT></TD>
<TD><CODE><B>DualFloatFunction.</B><B><A HREF="../../../../../../org/apache/lucene/queries/function/valuesource/DualFloatFunction.html#b">b</A></B></CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected <A HREF="../../../../../../org/apache/lucene/queries/function/ValueSource.html" title="class in org.apache.lucene.queries.function">ValueSource</A></CODE></FONT></TD>
<TD><CODE><B>SimpleBoolFunction.</B><B><A HREF="../../../../../../org/apache/lucene/queries/function/valuesource/SimpleBoolFunction.html#source">source</A></B></CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected <A HREF="../../../../../../org/apache/lucene/queries/function/ValueSource.html" title="class in org.apache.lucene.queries.function">ValueSource</A></CODE></FONT></TD>
<TD><CODE><B>LinearFloatFunction.</B><B><A HREF="../../../../../../org/apache/lucene/queries/function/valuesource/LinearFloatFunction.html#source">source</A></B></CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected <A HREF="../../../../../../org/apache/lucene/queries/function/ValueSource.html" title="class in org.apache.lucene.queries.function">ValueSource</A></CODE></FONT></TD>
<TD><CODE><B>RangeMapFloatFunction.</B><B><A HREF="../../../../../../org/apache/lucene/queries/function/valuesource/RangeMapFloatFunction.html#source">source</A></B></CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected <A HREF="../../../../../../org/apache/lucene/queries/function/ValueSource.html" title="class in org.apache.lucene.queries.function">ValueSource</A></CODE></FONT></TD>
<TD><CODE><B>SingleFunction.</B><B><A HREF="../../../../../../org/apache/lucene/queries/function/valuesource/SingleFunction.html#source">source</A></B></CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected <A HREF="../../../../../../org/apache/lucene/queries/function/ValueSource.html" title="class in org.apache.lucene.queries.function">ValueSource</A></CODE></FONT></TD>
<TD><CODE><B>ScaleFloatFunction.</B><B><A HREF="../../../../../../org/apache/lucene/queries/function/valuesource/ScaleFloatFunction.html#source">source</A></B></CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected <A HREF="../../../../../../org/apache/lucene/queries/function/ValueSource.html" title="class in org.apache.lucene.queries.function">ValueSource</A></CODE></FONT></TD>
<TD><CODE><B>ReciprocalFloatFunction.</B><B><A HREF="../../../../../../org/apache/lucene/queries/function/valuesource/ReciprocalFloatFunction.html#source">source</A></B></CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected <A HREF="../../../../../../org/apache/lucene/queries/function/ValueSource.html" title="class in org.apache.lucene.queries.function">ValueSource</A>[]</CODE></FONT></TD>
<TD><CODE><B>MultiFloatFunction.</B><B><A HREF="../../../../../../org/apache/lucene/queries/function/valuesource/MultiFloatFunction.html#sources">sources</A></B></CODE>
<BR>
</TD>
</TR>
</TABLE>
<P>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left" COLSPAN="2">Fields in <A HREF="../../../../../../org/apache/lucene/queries/function/valuesource/package-summary.html">org.apache.lucene.queries.function.valuesource</A> with type parameters of type <A HREF="../../../../../../org/apache/lucene/queries/function/ValueSource.html" title="class in org.apache.lucene.queries.function">ValueSource</A></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</A><<A HREF="../../../../../../org/apache/lucene/queries/function/ValueSource.html" title="class in org.apache.lucene.queries.function">ValueSource</A>></CODE></FONT></TD>
<TD><CODE><B>MultiFunction.</B><B><A HREF="../../../../../../org/apache/lucene/queries/function/valuesource/MultiFunction.html#sources">sources</A></B></CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</A><<A HREF="../../../../../../org/apache/lucene/queries/function/ValueSource.html" title="class in org.apache.lucene.queries.function">ValueSource</A>></CODE></FONT></TD>
<TD><CODE><B>MultiBoolFunction.</B><B><A HREF="../../../../../../org/apache/lucene/queries/function/valuesource/MultiBoolFunction.html#sources">sources</A></B></CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</A><<A HREF="../../../../../../org/apache/lucene/queries/function/ValueSource.html" title="class in org.apache.lucene.queries.function">ValueSource</A>></CODE></FONT></TD>
<TD><CODE><B>VectorValueSource.</B><B><A HREF="../../../../../../org/apache/lucene/queries/function/valuesource/VectorValueSource.html#sources">sources</A></B></CODE>
<BR>
</TD>
</TR>
</TABLE>
<P>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left" COLSPAN="2">Methods in <A HREF="../../../../../../org/apache/lucene/queries/function/valuesource/package-summary.html">org.apache.lucene.queries.function.valuesource</A> that return types with arguments of type <A HREF="../../../../../../org/apache/lucene/queries/function/ValueSource.html" title="class in org.apache.lucene.queries.function">ValueSource</A></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</A><<A HREF="../../../../../../org/apache/lucene/queries/function/ValueSource.html" title="class in org.apache.lucene.queries.function">ValueSource</A>></CODE></FONT></TD>
<TD><CODE><B>VectorValueSource.</B><B><A HREF="../../../../../../org/apache/lucene/queries/function/valuesource/VectorValueSource.html#getSources()">getSources</A></B>()</CODE>
<BR>
</TD>
</TR>
</TABLE>
<P>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left" COLSPAN="2">Method parameters in <A HREF="../../../../../../org/apache/lucene/queries/function/valuesource/package-summary.html">org.apache.lucene.queries.function.valuesource</A> with type arguments of type <A HREF="../../../../../../org/apache/lucene/queries/function/ValueSource.html" title="class in org.apache.lucene.queries.function">ValueSource</A></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>MultiFunction.</B><B><A HREF="../../../../../../org/apache/lucene/queries/function/valuesource/MultiFunction.html#description(java.lang.String, java.util.List)">description</A></B>(<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> name,
<A HREF="http://download.oracle.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</A><<A HREF="../../../../../../org/apache/lucene/queries/function/ValueSource.html" title="class in org.apache.lucene.queries.function">ValueSource</A>> sources)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static <A HREF="../../../../../../org/apache/lucene/queries/function/FunctionValues.html" title="class in org.apache.lucene.queries.function">FunctionValues</A>[]</CODE></FONT></TD>
<TD><CODE><B>MultiFunction.</B><B><A HREF="../../../../../../org/apache/lucene/queries/function/valuesource/MultiFunction.html#valsArr(java.util.List, java.util.Map, org.apache.lucene.index.AtomicReaderContext)">valsArr</A></B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</A><<A HREF="../../../../../../org/apache/lucene/queries/function/ValueSource.html" title="class in org.apache.lucene.queries.function">ValueSource</A>> sources,
<A HREF="http://download.oracle.com/javase/6/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</A> fcontext,
<A HREF="../../../../../../../core/org/apache/lucene/index/AtomicReaderContext.html?is-external=true" title="class or interface in org.apache.lucene.index">AtomicReaderContext</A> readerContext)</CODE>
<BR>
</TD>
</TR>
</TABLE>
<P>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left" COLSPAN="2">Constructors in <A HREF="../../../../../../org/apache/lucene/queries/function/valuesource/package-summary.html">org.apache.lucene.queries.function.valuesource</A> with parameters of type <A HREF="../../../../../../org/apache/lucene/queries/function/ValueSource.html" title="class in org.apache.lucene.queries.function">ValueSource</A></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../../../org/apache/lucene/queries/function/valuesource/DivFloatFunction.html#DivFloatFunction(org.apache.lucene.queries.function.ValueSource, org.apache.lucene.queries.function.ValueSource)">DivFloatFunction</A></B>(<A HREF="../../../../../../org/apache/lucene/queries/function/ValueSource.html" title="class in org.apache.lucene.queries.function">ValueSource</A> a,
<A HREF="../../../../../../org/apache/lucene/queries/function/ValueSource.html" title="class in org.apache.lucene.queries.function">ValueSource</A> b)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../../../org/apache/lucene/queries/function/valuesource/DualFloatFunction.html#DualFloatFunction(org.apache.lucene.queries.function.ValueSource, org.apache.lucene.queries.function.ValueSource)">DualFloatFunction</A></B>(<A HREF="../../../../../../org/apache/lucene/queries/function/ValueSource.html" title="class in org.apache.lucene.queries.function">ValueSource</A> a,
<A HREF="../../../../../../org/apache/lucene/queries/function/ValueSource.html" title="class in org.apache.lucene.queries.function">ValueSource</A> b)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../../../org/apache/lucene/queries/function/valuesource/IfFunction.html#IfFunction(org.apache.lucene.queries.function.ValueSource, org.apache.lucene.queries.function.ValueSource, org.apache.lucene.queries.function.ValueSource)">IfFunction</A></B>(<A HREF="../../../../../../org/apache/lucene/queries/function/ValueSource.html" title="class in org.apache.lucene.queries.function">ValueSource</A> ifSource,
<A HREF="../../../../../../org/apache/lucene/queries/function/ValueSource.html" title="class in org.apache.lucene.queries.function">ValueSource</A> trueSource,
<A HREF="../../../../../../org/apache/lucene/queries/function/ValueSource.html" title="class in org.apache.lucene.queries.function">ValueSource</A> falseSource)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../../../org/apache/lucene/queries/function/valuesource/LinearFloatFunction.html#LinearFloatFunction(org.apache.lucene.queries.function.ValueSource, float, float)">LinearFloatFunction</A></B>(<A HREF="../../../../../../org/apache/lucene/queries/function/ValueSource.html" title="class in org.apache.lucene.queries.function">ValueSource</A> source,
float slope,
float intercept)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../../../org/apache/lucene/queries/function/valuesource/MaxFloatFunction.html#MaxFloatFunction(org.apache.lucene.queries.function.ValueSource[])">MaxFloatFunction</A></B>(<A HREF="../../../../../../org/apache/lucene/queries/function/ValueSource.html" title="class in org.apache.lucene.queries.function">ValueSource</A>[] sources)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../../../org/apache/lucene/queries/function/valuesource/MinFloatFunction.html#MinFloatFunction(org.apache.lucene.queries.function.ValueSource[])">MinFloatFunction</A></B>(<A HREF="../../../../../../org/apache/lucene/queries/function/ValueSource.html" title="class in org.apache.lucene.queries.function">ValueSource</A>[] sources)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../../../org/apache/lucene/queries/function/valuesource/MultiFloatFunction.html#MultiFloatFunction(org.apache.lucene.queries.function.ValueSource[])">MultiFloatFunction</A></B>(<A HREF="../../../../../../org/apache/lucene/queries/function/ValueSource.html" title="class in org.apache.lucene.queries.function">ValueSource</A>[] sources)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../../../org/apache/lucene/queries/function/valuesource/PowFloatFunction.html#PowFloatFunction(org.apache.lucene.queries.function.ValueSource, org.apache.lucene.queries.function.ValueSource)">PowFloatFunction</A></B>(<A HREF="../../../../../../org/apache/lucene/queries/function/ValueSource.html" title="class in org.apache.lucene.queries.function">ValueSource</A> a,
<A HREF="../../../../../../org/apache/lucene/queries/function/ValueSource.html" title="class in org.apache.lucene.queries.function">ValueSource</A> b)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../../../org/apache/lucene/queries/function/valuesource/ProductFloatFunction.html#ProductFloatFunction(org.apache.lucene.queries.function.ValueSource[])">ProductFloatFunction</A></B>(<A HREF="../../../../../../org/apache/lucene/queries/function/ValueSource.html" title="class in org.apache.lucene.queries.function">ValueSource</A>[] sources)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../../../org/apache/lucene/queries/function/valuesource/RangeMapFloatFunction.html#RangeMapFloatFunction(org.apache.lucene.queries.function.ValueSource, float, float, float, java.lang.Float)">RangeMapFloatFunction</A></B>(<A HREF="../../../../../../org/apache/lucene/queries/function/ValueSource.html" title="class in org.apache.lucene.queries.function">ValueSource</A> source,
float min,
float max,
float target,
<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Float.html?is-external=true" title="class or interface in java.lang">Float</A> def)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../../../org/apache/lucene/queries/function/valuesource/ReciprocalFloatFunction.html#ReciprocalFloatFunction(org.apache.lucene.queries.function.ValueSource, float, float, float)">ReciprocalFloatFunction</A></B>(<A HREF="../../../../../../org/apache/lucene/queries/function/ValueSource.html" title="class in org.apache.lucene.queries.function">ValueSource</A> source,
float m,
float a,
float b)</CODE>
<BR>
f(source) = a/(m*float(source)+b)</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../../../org/apache/lucene/queries/function/valuesource/ScaleFloatFunction.html#ScaleFloatFunction(org.apache.lucene.queries.function.ValueSource, float, float)">ScaleFloatFunction</A></B>(<A HREF="../../../../../../org/apache/lucene/queries/function/ValueSource.html" title="class in org.apache.lucene.queries.function">ValueSource</A> source,
float min,
float max)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../../../org/apache/lucene/queries/function/valuesource/SimpleBoolFunction.html#SimpleBoolFunction(org.apache.lucene.queries.function.ValueSource)">SimpleBoolFunction</A></B>(<A HREF="../../../../../../org/apache/lucene/queries/function/ValueSource.html" title="class in org.apache.lucene.queries.function">ValueSource</A> source)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../../../org/apache/lucene/queries/function/valuesource/SimpleFloatFunction.html#SimpleFloatFunction(org.apache.lucene.queries.function.ValueSource)">SimpleFloatFunction</A></B>(<A HREF="../../../../../../org/apache/lucene/queries/function/ValueSource.html" title="class in org.apache.lucene.queries.function">ValueSource</A> source)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../../../org/apache/lucene/queries/function/valuesource/SingleFunction.html#SingleFunction(org.apache.lucene.queries.function.ValueSource)">SingleFunction</A></B>(<A HREF="../../../../../../org/apache/lucene/queries/function/ValueSource.html" title="class in org.apache.lucene.queries.function">ValueSource</A> source)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../../../org/apache/lucene/queries/function/valuesource/SumFloatFunction.html#SumFloatFunction(org.apache.lucene.queries.function.ValueSource[])">SumFloatFunction</A></B>(<A HREF="../../../../../../org/apache/lucene/queries/function/ValueSource.html" title="class in org.apache.lucene.queries.function">ValueSource</A>[] sources)</CODE>
<BR>
</TD>
</TR>
</TABLE>
<P>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left" COLSPAN="2">Constructor parameters in <A HREF="../../../../../../org/apache/lucene/queries/function/valuesource/package-summary.html">org.apache.lucene.queries.function.valuesource</A> with type arguments of type <A HREF="../../../../../../org/apache/lucene/queries/function/ValueSource.html" title="class in org.apache.lucene.queries.function">ValueSource</A></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../../../org/apache/lucene/queries/function/valuesource/DefFunction.html#DefFunction(java.util.List)">DefFunction</A></B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</A><<A HREF="../../../../../../org/apache/lucene/queries/function/ValueSource.html" title="class in org.apache.lucene.queries.function">ValueSource</A>> sources)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../../../org/apache/lucene/queries/function/valuesource/MultiBoolFunction.html#MultiBoolFunction(java.util.List)">MultiBoolFunction</A></B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</A><<A HREF="../../../../../../org/apache/lucene/queries/function/ValueSource.html" title="class in org.apache.lucene.queries.function">ValueSource</A>> sources)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../../../org/apache/lucene/queries/function/valuesource/MultiFunction.html#MultiFunction(java.util.List)">MultiFunction</A></B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</A><<A HREF="../../../../../../org/apache/lucene/queries/function/ValueSource.html" title="class in org.apache.lucene.queries.function">ValueSource</A>> sources)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../../../org/apache/lucene/queries/function/valuesource/VectorValueSource.html#VectorValueSource(java.util.List)">VectorValueSource</A></B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</A><<A HREF="../../../../../../org/apache/lucene/queries/function/ValueSource.html" title="class in org.apache.lucene.queries.function">ValueSource</A>> sources)</CODE>
<BR>
</TD>
</TR>
</TABLE>
<P>
<HR>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../org/apache/lucene/queries/function/ValueSource.html" title="class in org.apache.lucene.queries.function"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT> </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">
PREV
NEXT</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../../index.html?org/apache/lucene/queries/function//class-useValueSource.html" target="_top"><B>FRAMES</B></A>
<A HREF="ValueSource.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>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
<address>Copyright © 2000-2012 Apache Software Foundation. All Rights Reserved.</address>
<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>
| dburgmann/fbRecommender | lib/lucene-4.0.0/docs/queries/org/apache/lucene/queries/function/class-use/ValueSource.html | HTML | gpl-3.0 | 76,651 |
# -*- coding: utf-8 -*-
import sys
import os
import logging
import random
import PyQt4
from PyQt4.QtCore import *
#from PyQt4.QtCore import QAbstractTableModel
import constants
class Model(QAbstractTableModel):
keys = list()
modelType = None
def __init__(self, parent = None):
''' '''
self.log = logging.getLogger('Model')
#self.log.debug('__init__ start')
super(QAbstractTableModel, self).__init__(parent)
def rowCount(self, parent = None):
''' '''
#self.log.debug('rowCount start')
#self.log.debug('rowCount end')
if hasattr(self, 'album') and self.album:
if hasattr(self.album, 'rows'):
return len(self.album.rows)
return 0
def columnCount(self, parent = None):
''' '''
#self.log.debug('columnCount start')
#self.log.debug('columnCount end')
return len(self.keys)
def data(self, index, role = None):
''' '''
#self.log.debug('data start')
if index.isValid():
if index.row() >= 0 or index.row() < len(self.rows):
if role == Qt.DisplayRole or role == Qt.ToolTipRole or role == Qt.EditRole:
return self.album.rows[index.row()][self.keys[index.column()]]
#self.log.debug('data end')
return QVariant()
def setData(self, index, value, role):
''' '''
#self.log.debug('setData start')
if index.isValid() and role == Qt.EditRole:
key = self.keys[index.column()]
row = index.row()
value = unicode(value.toString())
self.album.rows[index.row()][key] = value
self.emit(SIGNAL('dataChanged'), index, index)
#self.log.debug('setData end')
return True
def headerData(self, section, orientation, role):
''' '''
#self.log.debug('headerData start' + str(section))
if section >= 0 and section < len(self.keys):
if orientation == Qt.Horizontal and role == Qt.DisplayRole:
return self.keys[section]
#self.log.debug('headerData end ')
return QVariant()
def flags(self, index):
''' '''
#self.log.debug('flags start')
if self.modelType == constants.ModelType.ModelTypeFinal:
return super(QAbstractTableModel, self).flags(index) | Qt.ItemIsEditable
#self.log.debug('flags end')
return super(QAbstractTableModel, self).flags(index)
def getModelType(self):
''' '''
#self.log.debug('getModelType start')
#self.log.debug('getModelType end')
return self.modelType
#def getState(self):
#''' '''
##self.log.debug('getState start')
##self.log.debug('getState end')
#return None
| CaesarTjalbo/musictagger | mp3names/model_classes.py | Python | gpl-3.0 | 3,029 |
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* Nab Config Class
*
* @package Nab
* @subpackage Core Library
* @category Config
* @author Misael Zapata
* @link http://misaelzapata.com
*/
class MY_Config Extends CI_Config {
var $config_path = ''; // Set in the constructor below
var $database_path = ''; // Set in the constructor below
var $index_path = ''; // Set in the constructor below
var $autoload_path = ''; // Set in the constructor below
/**
* Constructor
*
* @access public
* @return void
*/
function __construct()
{
parent::__construct();
$define_path = "";
if (defined('ENVIRONMENT')) {
switch (ENVIRONMENT)
{
case 'development':
$this->define_path = APPPATH.'config/development/database'.EXT;
break;
case 'testing':
case 'production':
$this->define_path = APPPATH.'config/production/database'.EXT;
break;
default:
exit('The application environment is not set correctly.');
}
}
$this->config_path = APPPATH.'config/config'.EXT;
$this->database_path = $this->define_path;
$this->autoload_path = APPPATH.'config/autoload'.EXT;
$tem_index = getcwd();
$this->index_path = $tem_index."/index.php";
}
// --------------------------------------------------------------------
/**
* Update the config file
*
* Reads the existing config file as a string and swaps out
* any values passed to the function. Will alternately remove values
*
*
* @access public
* @param array
* @param array
* @return bool
*/
function config_update($config_array = array())
{
if ( ! is_array($config_array) && count($config_array) == 0)
{
return FALSE;
}
@chmod($this->config_path, FILE_WRITE_MODE);
// Is the config file writable?
if ( ! is_really_writable($this->config_path))
{
show_error($this->config_path.' does not appear to have the proper file permissions. Please make the file writeable.');
}
// Read the config file as PHP
require $this->config_path;
// load the file helper
$this->CI =& get_instance();
$this->CI->load->helper('file');
// Read the config data as a string
$config_file = read_file($this->config_path);
// Trim it
$config_file = trim($config_file);
// Do we need to add totally new items to the config file?
if (is_array($config_array))
{
foreach ($config_array as $key => $val)
{
$pattern = '/\$config\[\\\''.$key.'\\\'\]\s+=\s+[^\;]+/';
$replace = "\$config['$key'] = '$val'";
$config_file = preg_replace($pattern, $replace, $config_file);
}
}
if ( ! $fp = fopen($this->config_path, FOPEN_WRITE_CREATE_DESTRUCTIVE))
{
return FALSE;
}
flock($fp, LOCK_EX);
fwrite($fp, $config_file, strlen($config_file));
flock($fp, LOCK_UN);
fclose($fp);
@chmod($this->config_path, FILE_READ_MODE);
return TRUE;
}
// --------------------------------------------------------------------
/**
* Update Database Config File
*
* Reads the existing DB config file as a string and swaps out
* any values passed to the function.
*
* @access public
* @param array
* @param array
* @return bool
*/
function db_config_update($dbconfig = array(), $remove_values = array())
{
@chmod($this->database_path, FILE_WRITE_MODE);
// Is the database file writable?
if ( ! is_really_writable($this->database_path))
{
show_error($this->database_path.' does not appear to have the proper file permissions. Please make the file writeable.');
}
// load the file helper
$this->CI =& get_instance();
$this->CI->load->helper('file');
// Read the config file as PHP
require $this->database_path;
// Now we read the file data as a string
$config_file = read_file($this->database_path);
if (count($dbconfig) > 0)
{
foreach ($dbconfig as $key => $val)
{
$pattern = '/\$db\[\\\''.$active_group.'\\\'\]\[\\\''.$key.'\\\'\]\s+=\s+[^\;]+/';
$replace = "\$db['$active_group']['$key'] = '$val'";
$config_file = preg_replace($pattern, $replace, $config_file);
}
}
$config_file = trim($config_file);
// Write the file
if ( ! $fp = fopen($this->database_path, FOPEN_WRITE_CREATE_DESTRUCTIVE))
{
return FALSE;
}
flock($fp, LOCK_EX);
fwrite($fp, $config_file, strlen($config_file));
flock($fp, LOCK_UN);
fclose($fp);
@chmod($this->database_path, FILE_READ_MODE);
return TRUE;
}
// --------------------------------------------------------------------
/**
* Config status
*
* Checks the status of the config files and database connection
*
* @access public
* @return array
*/
function config_status()
{
$data['install_warnings'] = array();
// is PHP version ok?
if (!is_php('5.1.6'))
{
$data['install_warnings'][] = 'php version is too old';
}
// is config file writable?
if (is_really_writable($this->config_path) && ! @chmod($this->config_path, FILE_WRITE_MODE))
{
$data['install_warnings'][] = 'config.php file is not writable';
}
// Is there a database.php file?
if (@include($this->database_path))
{
if ($this->test_mysql_connection($db[$active_group]))
{
$this->session->set_userdata('user_database_file', TRUE);
}
else
{
// Ensure the session isn't remembered from a previous test
$this->session->set_userdata('user_database_file', FALSE);
@chmod($this->config->database_path, FILE_WRITE_MODE);
if (is_really_writable($this->config->database_path) === FALSE)
{
$vars['install_warnings'][] = 'database file is not writable';
}
}
}
else
{
$data['install_warnings'][] = 'database config file was not found';
}
return $data;
}
}
/* End of file MY_Config.php */
/* Location: application/core/MY_Config.php */ | inilabsn/iTeam | mvc/core/MY_Config.php | PHP | gpl-3.0 | 5,844 |
(function () {
'use strict';
angular.module('app.admin.survey', [
'app.core',
'app.widgets'
]);
})();
| EnterpriseWide/rnoz-1505 | data/rightNow/src/client/app/admin/survey/admin.survey.module.js | JavaScript | gpl-3.0 | 134 |
<!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_34) on Tue May 26 09:04:14 BST 2015 -->
<TITLE>
FilteringFontFamilyResolver (Apache FOP 2.0 API)
</TITLE>
<META NAME="date" CONTENT="2015-05-26">
<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="FilteringFontFamilyResolver (Apache FOP 2.0 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/FilteringFontFamilyResolver.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="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</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>
fop 2.0</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../org/apache/fop/svg/font/AggregatingFontFamilyResolver.html" title="class in org.apache.fop.svg.font"><B>PREV CLASS</B></A>
<A HREF="../../../../../org/apache/fop/svg/font/FOPFontFamilyResolver.html" title="interface in org.apache.fop.svg.font"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../index.html?org/apache/fop/svg/font/FilteringFontFamilyResolver.html" target="_top"><B>FRAMES</B></A>
<A HREF="FilteringFontFamilyResolver.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 | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></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.fop.svg.font</FONT>
<BR>
Class FilteringFontFamilyResolver</H2>
<PRE>
java.lang.Object
<IMG SRC="../../../../../resources/inherit.gif" ALT="extended by "><B>org.apache.fop.svg.font.FilteringFontFamilyResolver</B>
</PRE>
<DL>
<DT><B>All Implemented Interfaces:</B> <DD>org.apache.batik.bridge.FontFamilyResolver, <A HREF="../../../../../org/apache/fop/svg/font/FOPFontFamilyResolver.html" title="interface in org.apache.fop.svg.font">FOPFontFamilyResolver</A></DD>
</DL>
<DL>
<DT><B>Direct Known Subclasses:</B> <DD><A HREF="../../../../../org/apache/fop/afp/svg/AFPFontFamilyResolver.html" title="class in org.apache.fop.afp.svg">AFPFontFamilyResolver</A></DD>
</DL>
<HR>
<DL>
<DT><PRE>public class <B>FilteringFontFamilyResolver</B><DT>extends java.lang.Object<DT>implements <A HREF="../../../../../org/apache/fop/svg/font/FOPFontFamilyResolver.html" title="interface in org.apache.fop.svg.font">FOPFontFamilyResolver</A></DL>
</PRE>
<P>
<HR>
<P>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<A NAME="constructor_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>Constructor Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../../org/apache/fop/svg/font/FilteringFontFamilyResolver.html#FilteringFontFamilyResolver(org.apache.fop.svg.font.FOPFontFamilyResolver)">FilteringFontFamilyResolver</A></B>(<A HREF="../../../../../org/apache/fop/svg/font/FOPFontFamilyResolver.html" title="interface in org.apache.fop.svg.font">FOPFontFamilyResolver</A> delegate)</CODE>
<BR>
</TD>
</TR>
</TABLE>
<!-- ========== METHOD SUMMARY =========== -->
<A NAME="method_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>Method Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../../org/apache/fop/svg/font/FOPGVTFontFamily.html" title="class in org.apache.fop.svg.font">FOPGVTFontFamily</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/fop/svg/font/FilteringFontFamilyResolver.html#getDefault()">getDefault</A></B>()</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../../org/apache/fop/svg/font/FOPGVTFontFamily.html" title="class in org.apache.fop.svg.font">FOPGVTFontFamily</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/fop/svg/font/FilteringFontFamilyResolver.html#getFamilyThatCanDisplay(char)">getFamilyThatCanDisplay</A></B>(char c)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> org.apache.batik.gvt.font.GVTFontFamily</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/fop/svg/font/FilteringFontFamilyResolver.html#loadFont(java.io.InputStream, org.apache.batik.bridge.FontFace)">loadFont</A></B>(java.io.InputStream in,
org.apache.batik.bridge.FontFace fontFace)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../../org/apache/fop/svg/font/FOPGVTFontFamily.html" title="class in org.apache.fop.svg.font">FOPGVTFontFamily</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/fop/svg/font/FilteringFontFamilyResolver.html#resolve(java.lang.String)">resolve</A></B>(java.lang.String familyName)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> org.apache.batik.gvt.font.GVTFontFamily</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/fop/svg/font/FilteringFontFamilyResolver.html#resolve(java.lang.String, org.apache.batik.bridge.FontFace)">resolve</A></B>(java.lang.String familyName,
org.apache.batik.bridge.FontFace fontFace)</CODE>
<BR>
</TD>
</TR>
</TABLE>
<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD>
</TR>
</TABLE>
<P>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<A NAME="constructor_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>Constructor Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="FilteringFontFamilyResolver(org.apache.fop.svg.font.FOPFontFamilyResolver)"><!-- --></A><H3>
FilteringFontFamilyResolver</H3>
<PRE>
public <B>FilteringFontFamilyResolver</B>(<A HREF="../../../../../org/apache/fop/svg/font/FOPFontFamilyResolver.html" title="interface in org.apache.fop.svg.font">FOPFontFamilyResolver</A> delegate)</PRE>
<DL>
</DL>
<!-- ============ METHOD DETAIL ========== -->
<A NAME="method_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>Method Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="resolve(java.lang.String)"><!-- --></A><H3>
resolve</H3>
<PRE>
public <A HREF="../../../../../org/apache/fop/svg/font/FOPGVTFontFamily.html" title="class in org.apache.fop.svg.font">FOPGVTFontFamily</A> <B>resolve</B>(java.lang.String familyName)</PRE>
<DL>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE>resolve</CODE> in interface <CODE>org.apache.batik.bridge.FontFamilyResolver</CODE><DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../org/apache/fop/svg/font/FOPFontFamilyResolver.html#resolve(java.lang.String)">resolve</A></CODE> in interface <CODE><A HREF="../../../../../org/apache/fop/svg/font/FOPFontFamilyResolver.html" title="interface in org.apache.fop.svg.font">FOPFontFamilyResolver</A></CODE></DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="resolve(java.lang.String, org.apache.batik.bridge.FontFace)"><!-- --></A><H3>
resolve</H3>
<PRE>
public org.apache.batik.gvt.font.GVTFontFamily <B>resolve</B>(java.lang.String familyName,
org.apache.batik.bridge.FontFace fontFace)</PRE>
<DL>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE>resolve</CODE> in interface <CODE>org.apache.batik.bridge.FontFamilyResolver</CODE></DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="loadFont(java.io.InputStream, org.apache.batik.bridge.FontFace)"><!-- --></A><H3>
loadFont</H3>
<PRE>
public org.apache.batik.gvt.font.GVTFontFamily <B>loadFont</B>(java.io.InputStream in,
org.apache.batik.bridge.FontFace fontFace)
throws java.lang.Exception</PRE>
<DL>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE>loadFont</CODE> in interface <CODE>org.apache.batik.bridge.FontFamilyResolver</CODE></DL>
</DD>
<DD><DL>
<DT><B>Throws:</B>
<DD><CODE>java.lang.Exception</CODE></DL>
</DD>
</DL>
<HR>
<A NAME="getDefault()"><!-- --></A><H3>
getDefault</H3>
<PRE>
public <A HREF="../../../../../org/apache/fop/svg/font/FOPGVTFontFamily.html" title="class in org.apache.fop.svg.font">FOPGVTFontFamily</A> <B>getDefault</B>()</PRE>
<DL>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE>getDefault</CODE> in interface <CODE>org.apache.batik.bridge.FontFamilyResolver</CODE><DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../org/apache/fop/svg/font/FOPFontFamilyResolver.html#getDefault()">getDefault</A></CODE> in interface <CODE><A HREF="../../../../../org/apache/fop/svg/font/FOPFontFamilyResolver.html" title="interface in org.apache.fop.svg.font">FOPFontFamilyResolver</A></CODE></DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="getFamilyThatCanDisplay(char)"><!-- --></A><H3>
getFamilyThatCanDisplay</H3>
<PRE>
public <A HREF="../../../../../org/apache/fop/svg/font/FOPGVTFontFamily.html" title="class in org.apache.fop.svg.font">FOPGVTFontFamily</A> <B>getFamilyThatCanDisplay</B>(char c)</PRE>
<DL>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE>getFamilyThatCanDisplay</CODE> in interface <CODE>org.apache.batik.bridge.FontFamilyResolver</CODE><DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../org/apache/fop/svg/font/FOPFontFamilyResolver.html#getFamilyThatCanDisplay(char)">getFamilyThatCanDisplay</A></CODE> in interface <CODE><A HREF="../../../../../org/apache/fop/svg/font/FOPFontFamilyResolver.html" title="interface in org.apache.fop.svg.font">FOPFontFamilyResolver</A></CODE></DL>
</DD>
<DD><DL>
</DL>
</DD>
</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/FilteringFontFamilyResolver.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="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</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>
fop 2.0</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../org/apache/fop/svg/font/AggregatingFontFamilyResolver.html" title="class in org.apache.fop.svg.font"><B>PREV CLASS</B></A>
<A HREF="../../../../../org/apache/fop/svg/font/FOPFontFamilyResolver.html" title="interface in org.apache.fop.svg.font"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../index.html?org/apache/fop/svg/font/FilteringFontFamilyResolver.html" target="_top"><B>FRAMES</B></A>
<A HREF="FilteringFontFamilyResolver.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 | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
Copyright 1999-2015 The Apache Software Foundation. All Rights Reserved.
</BODY>
</HTML>
| jbampton/eclipse-cheatsheets-to-dita-to-pdf | src/libs/fop-2.0/javadocs/org/apache/fop/svg/font/FilteringFontFamilyResolver.html | HTML | gpl-3.0 | 16,781 |
(function() {
'use strict';
angular
.module('gatewayApp')
.factory('LoginService', LoginService);
LoginService.$inject = ['$uibModal'];
function LoginService ($uibModal) {
var service = {
open: open
};
var modalInstance = null;
var resetModal = function () {
modalInstance = null;
};
return service;
function open () {
if (modalInstance !== null) return;
modalInstance = $uibModal.open({
animation: true,
templateUrl: 'app/components/login/login.html',
controller: 'LoginController',
controllerAs: 'vm'
});
modalInstance.result.then(
resetModal,
resetModal
);
}
}
})();
| Niky4000/UsefulUtils | projects/tutorials-master/tutorials-master/jhipster/jhipster-microservice/gateway-app/src/main/webapp/app/components/login/login.service.js | JavaScript | gpl-3.0 | 856 |
// Reaktoro is a unified framework for modeling chemically reactive systems.
//
// Copyright (C) 2014-2018 Allan Leal
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library 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
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with this library. If not, see <http://www.gnu.org/licenses/>.
#include <Reaktoro/Reaktoro.hpp>
using namespace Reaktoro;
//TODO - fix convergence error
int main()
{
DebyeHuckelParams db;
db.setPHREEQC();
ChemicalEditor editor;
editor.addAqueousPhaseWithElementsOf("H2O NaCl CaCl2 CO2")
.setChemicalModelDebyeHuckel(db);
ChemicalSystem system(editor);
EquilibriumProblem problem1(system);
problem1.add("H2O", 1, "kg");
EquilibriumProblem problem2(system);
problem2.add("H2O", 1, "kg");
problem2.add("NaCl", 0.1, "mol");
problem2.add("CaCl2", 0.5, "mol");
problem2.add("CO2", 0.2, "mol");
ChemicalState state1 = equilibrate(problem1);
ChemicalState state2 = equilibrate(problem2);
EquilibriumPath path(system);
ChemicalPlot plot = path.plot();
plot.x("ionicStrength");
plot.y("activityCoefficient(Na+)", "Na+");
plot.y("activityCoefficient(Cl-)", "Cl-");
plot.y("activityCoefficient(Ca++)", "Ca++");
plot.ylabel("Activity Coefficient");
plot.xlabel("I [molal]");
path.solve(state1, state2);
}
| Reaktoro/Reaktoro | demos/cpp/demo-activity-debye-huckel.cpp | C++ | gpl-3.0 | 1,826 |
require 'active_support/core_ext/object/blank'
require_relative 'abstract_command'
class Subscribe < AbstractCommand
def initialize(command_context, options = {})
super command_context
@subscriberRepository = options[:subscriberRepository] || Subscriber
@subscriptionRepository = options[:subscriptionRepository] || Subscription
@arguments = command_context.arguments
end
def execute
return already_subscribed if sender_subscribed?
return relay_closed if relay.closed
subscribe_sender
end
private
def sender_subscribed?
relay.subscribed?(sender)
end
def already_subscribed
AlreadySubscribedBounceResponse.new(context).deliver(sender)
end
def relay_closed
ClosedResponse.new(context).deliver(sender)
ClosedBounceNotification.new(context).deliver(relay.admins)
end
def subscribe_sender
persist_subscriber
@subscriptionRepository.create(relay: relay, subscriber: @subscriber)
ChangesNames.change_name(@subscriber, arguments) if arguments
send_welcome_messages
notify_admins
end
def persist_subscriber
if sender.persisted?
@subscriber = sender
@subscriber.locale = context.locale
@subscriber.save
else
@subscriber = @subscriberRepository.create(number: sender.number, locale: context.locale)
end
end
def send_welcome_messages
WelcomeResponse.new(context).deliver(sender)
DisclaimerResponse.new(context).deliver(sender)
end
def notify_admins
SubscriptionNotification.new(context).deliver(relay.admins)
end
end
| backspace/retxt | app/commands/subscribe.rb | Ruby | gpl-3.0 | 1,569 |
#include "CREvent.h"
CREvent::CREvent(unsigned int newNChannels, float *newAmplitudes, unsigned int newNBins) {
nChannels = newNChannels;
for(unsigned int i=0; i<newNBins; i++) {
amplitudes.push_back(newAmplitudes[i]);
}
}
CREvent::CREvent(unsigned int newNChannels, std::vector<float> newAmplitudes) {
nChannels = newNChannels;
for(unsigned int i=0; i<newAmplitudes.size(); i++) {
amplitudes.push_back(newAmplitudes.at(i));
}
}
void CREvent::addCREntry(CREntry newCREntry) {
CREntries.push_back(newCREntry);
}
unsigned int CREvent::getNumberOfCREntries() const {
return CREntries.size();
}
CREntry CREvent::getMostSignCREntry() const {
float sign_max = -1e4;
CREntry mostSignCREntry;
for(unsigned int i=0; i<CREntries.size(); i++) {
if(CREntries.at(i).getSignificanceOfCluster() > sign_max) {
sign_max = CREntries.at(i).getSignificanceOfCluster();
mostSignCREntry = CREntries.at(i);
}
}
return mostSignCREntry;
}
CREntry CREvent::getLeastSignCREntry() const {
float sign_min = +1e4;
CREntry leastSignCREntry;
for(unsigned int i=0; i<CREntries.size(); i++) {
if(CREntries.at(i).getSignificanceOfCluster() < sign_min) {
sign_min = CREntries.at(i).getSignificanceOfCluster();
leastSignCREntry = CREntries.at(i);
}
}
return leastSignCREntry;
}
float CREvent::getMostSignAmp_forCS(unsigned int clusterSize) const {
float sign_max = -1e4;
float mostSignificantAmplitude;
for(unsigned int i=0; i<CREntries.size(); i++) {
if((CREntries.at(i).getClusterSize() == clusterSize) && (CREntries.at(i).getSignificanceOfCluster() > sign_max)) {
sign_max = CREntries.at(i).getSignificanceOfCluster();
mostSignificantAmplitude = CREntries.at(i).getAmplitudeOfCluster();
}
}
return mostSignificantAmplitude;
}
float CREvent::getLeastSignAmp_forCS(unsigned int clusterSize) const {
float sign_min = +1e4;
float leastSignificantAmplitude;
for(unsigned int i=0; i<CREntries.size(); i++) {
if((CREntries.at(i).getClusterSize() == clusterSize) && (CREntries.at(i).getSignificanceOfCluster() < sign_min)) {
sign_min = CREntries.at(i).getSignificanceOfCluster();
leastSignificantAmplitude = CREntries.at(i).getAmplitudeOfCluster();
}
}
return leastSignificantAmplitude;
}
CREntry CREvent::getCREntry(unsigned int i) const {
return CREntries.at(i);
}
CREvent CREvent::getCREvent_forMaxCS(unsigned int maxClusterSize) {
CREvent *temp_CREvent = new CREvent(nChannels, amplitudes);
for(unsigned int i=0; i<CREntries.size(); i++) {
if(CREntries.at(i).getClusterSize() <= maxClusterSize) {
temp_CREvent->addCREntry(CREntries.at(i));
}
}
return *temp_CREvent;
}
CREvent CREvent::getCREvent_forCS(unsigned int clusterSize) {
CREvent *temp_CREvent = new CREvent(nChannels, amplitudes);
for(unsigned int i=0; i<CREntries.size(); i++) {
if(CREntries.at(i).getClusterSize() == clusterSize) {
temp_CREvent->addCREntry(CREntries.at(i));
}
}
return *temp_CREvent;
}
unsigned int CREvent::getAmplitudes_size() {
return (unsigned int)amplitudes.size();
}
float CREvent::getAmplitude_at(unsigned int i) {
return amplitudes.at(i);
}
void CREvent::printAmplitudes() {
for(std::vector<float>::iterator it=amplitudes.begin(); it!=amplitudes.end(); it++) {
std::cout << *it << std::endl;
}
}
| tempse/clusterReconstr_CBM-STS | CREvent.cpp | C++ | gpl-3.0 | 3,360 |
/* -> formatio/c
* Title: Produce formatted listings
* Original author: J.G.Thackray (Acorn)
* Latest author: JGSmith (Active Book Company)
* Copyright (C) 1989 Acorn Computers Limited
* Copyright (C) 1990 Active Book Company Limited
*/
/*---------------------------------------------------------------------------*/
#include "formatio.h"
#include "osdepend.h"
#include "constant.h"
#include "getline.h"
#include "nametype.h"
#include <ctype.h>
#include <string.h>
/*---------------------------------------------------------------------------*/
#define DefaultCols 131
#define DefaultRows 60
char *currentLinePointer ;
CARDINAL maxCols = DefaultCols ;
CARDINAL maxRows = DefaultRows ;
CARDINAL currCols ;
CARDINAL currRows ;
CARDINAL page ;
BOOLEAN paging ;
char title[MaxLineLength + 1] = "" ;
char subtitle[MaxLineLength + 1] = "" ;
/*---------------------------------------------------------------------------*/
static BOOLEAN GetValue(char *line,CARDINAL *value)
{
CARDINAL index;
if (!isdigit(*line))
{
WriteChs("Bad value\\N") ;
return(FALSE) ;
}
*value = *line - '0' ;
index = 1 ;
while (isdigit(line[index]))
{
*value = *value*10 + line[index++] - '0' ;
if (*value >= MaxVal)
{
WriteChs("Value too large\\N") ;
return(FALSE) ;
}
}
return(TRUE) ;
} /* End GetValue */
/*---------------------------------------------------------------------------*/
/* Set formatted output width */
void SetWidth(char *line)
{
CARDINAL value ;
if (GetValue(line,&value))
maxCols = value ;
} /* End SetWidth */
/*---------------------------------------------------------------------------*/
/* Set formatted output length */
void SetLength(char *line)
{
CARDINAL value ;
if (GetValue(line,&value))
maxRows = value ;
} /* End SetLength */
/*---------------------------------------------------------------------------*/
/* Initialise the output stream */
void PageModeOn(void)
{
page = 0 ; /* Ready to increment */
PageThrow() ;
paging = TRUE ;
} /* End PageModeOn */
/*---------------------------------------------------------------------------*/
void PageModeOff(void)
{
paging = FALSE ;
} /* End PageModeOff */
/*---------------------------------------------------------------------------*/
static void NewPage(void)
{
printf("%c",FF) ;
PageThrow() ;
} /* End NewPage */
/*---------------------------------------------------------------------------*/
void PageThrow(void)
{
currRows = maxRows ; /* New page required */
} /* End PageThrow */
/*---------------------------------------------------------------------------*/
/* Write a character to the printed output stream */
void WriteCh(char ch)
{
CARDINAL index ;
if ((currRows == maxRows) && paging)
{
page++ ;
NewPage() ;
printf("\n\n\nARM Macro Assembler Page %u\n",page) ;
/* Now output the title */
index = 0 ;
while ((index <= MaxLineLength) && (title[index] != '\0'))
printf("%c",title[index++]) ;
printf("\n") ;
index = 0 ;
while ((index <= MaxLineLength) && (subtitle[index] != '\0'))
printf("%c",subtitle[index++]) ;
printf("\n\n") ;
currRows = 7 ;
currCols = 0 ;
}
if ((ch == CR) || (ch == LF))
{
printf("\n") ;
if (paging)
{
currRows++ ;
currCols = 0 ;
}
}
else
{
if (paging)
{
if (currCols < maxCols)
{
printf("%c",ch) ;
currCols++ ;
}
else
{
WriteCh(CR) ; /* Wrap */
WriteCh(ch) ;
}
}
else
printf("%c",ch) ;
}
} /* End WriteCh */
/*---------------------------------------------------------------------------*/
/* See if character is decimal/hexadecimal */
static BOOLEAN CharIsDigit(char ch,BOOLEAN Hex,CARDINAL *n)
{
if (isdigit(ch))
{
*n = *n * 16 + ch - '0' ;
return(TRUE) ;
}
if (Hex && isxdigit(ch))
{
*n = *n*16 + 10 + ch - 'A' ;
return(TRUE) ;
}
return(FALSE) ;
} /* End CharIsDigit */
/*---------------------------------------------------------------------------*/
char TransEscape(char *chs,CARDINAL *index)
{
CARDINAL n ;
if (*index < strlen(chs))
{
(*index)++ ;
switch (chs[*index])
{
case 'N' :
case 'n' :
return(CR) ;
case 'P' :
case 'p' :
return(FF) ;
case 'S' :
case 's' :
return(Space) ;
case 'T' :
case 't' :
return(TabCh) ;
case 'C' :
case 'c' :
return(LF) ;
case 'X' :
case 'x' :
if (*index < strlen(chs))
{
n = 0 ;
if (CharIsDigit(chs[*index + 1],TRUE,&n))
{
(*index)++ ;
if (*index < strlen(chs))
{
if (CharIsDigit(chs[*index + 1],TRUE,&n))
(*index)++ ;
}
return(n) ;
}
}
(*index)-- ;
return(chs[*index - 1]) ;
default : /* no translation */
return(chs[*index]) ;
}
}
else
return(EscapeCh) ;
} /* End TransEscape */
/*---------------------------------------------------------------------------*/
/* Write a string of characters to the terminal stream */
void WriteChs(char *chs)
{
CARDINAL index ;
index = 0 ;
while (index < strlen(chs))
{
WriteCh((chs[index] != EscapeCh) ? chs[index] : TransEscape(chs,&index)) ;
index++ ;
}
} /* End WriteChs */
/*---------------------------------------------------------------------------*/
void WriteInteger(int i)
{
char digits[12] ;
sprintf(digits,"%i",i) ;
WriteChs(digits) ;
} /* End WriteInteger */
/*---------------------------------------------------------------------------*/
void WriteCardinal(CARDINAL c)
{
char digits[12] ;
sprintf(digits,"%u",c) ;
WriteChs(digits) ;
} /* End WriteCardinal */
/*---------------------------------------------------------------------------*/
void WriteHexCardinal(CARDINAL c)
{
char digits[12] ;
int index ;
int digit ;
for (index = 7; index >= 0; index--)
{
digit = c % 16 ;
digits[index] = (digit < 10) ? digit + '0' : digit - 10 + 'A' ;
c = c >> 4 ;
}
digits[8] = '\0' ;
WriteChs(digits) ;
} /* End WriteHexCardinal */
/*---------------------------------------------------------------------------*/
void SetTitle(Name t)
{
CARDINAL index = 0 ;
while (index < t.length)
{
title[index] = t.key[index] ;
index++ ;
}
if (index <= MaxLineLength)
title[index] = '\0' ;
} /* End SetTitle */
/*---------------------------------------------------------------------------*/
void SetSubtitle(Name t)
{
CARDINAL index = 0 ;
while (index < t.length)
{
subtitle[index] = t.key[index] ;
index++ ;
}
if (index <= MaxLineLength)
subtitle[index] = '\0' ;
} /* End SetSubtitle */
/*---------------------------------------------------------------------------*/
/* EOF formatio/c */
| axelmuhr/Helios-NG | cmds/hobjasm/formatio.c | C | gpl-3.0 | 7,053 |
#!/bin/bash
clear;
printf 'Type client abbreviation, followed by [ENTER]: '; read CLIENT
printf 'Type target domain, followed by [ENTER]: '; read DOMAIN
mkdir ~/$CLIENT/;
echo '# Enter the target IPs or Subnets, one line at a time. Use CTRL+X to exit and save.' > ~/$CLIENT/targets
nano ~/$CLIENT/targets
sed -ie 's/^#.*//g;:a;N;$!ba;s/^\n//g;' ~/$CLIENT/targets
PROMPT="$(date +\"$USER@$(hostname):$PWD:%Y-%m-%d-%T~$\")"
echo "$PROMPT bash run-masscan.sh $CLIENT ~/$CLIENT/targets 4000 | tee ~/$CLIENT/all.masscan"
bash run-masscan.sh $CLIENT ~/$CLIENT/targets 4000 | tee ~/$CLIENT/all.masscan
sort -k6 ~/$CLIENT/masscan-output.txt
echo "$PROMPT bash masscan-stdout-to-nmap.sh ~/$CLIENT/masscan-output.txt $CLIENT | tee ~/$CLIENT/all.nmap.tcp"
bash masscan-stdout-to-nmap.sh ~/$CLIENT/masscan-output.txt $CLIENT | tee ~/$CLIENT/all.nmap.tcp
echo "$PROMPT bash masscan-stdout-to-nikto.sh ~/$CLIENT/masscan-output.txt $CLIENT | tee ~/$CLIENT/all.nikto"
bash masscan-stdout-to-nikto.sh ~/$CLIENT/masscan-output.txt $CLIENT | tee ~/$CLIENT/all.nikto
echo "$PROMPT bash masscan-stdout-to-sslyze.sh ~/$CLIENT/masscan-output.txt $CLIENT | tee ~/$CLIENT/all.sslyze"
bash masscan-stdout-to-sslyze.sh ~/$CLIENT/masscan-output.txt $CLIENT | tee ~/$CLIENT/all.sslyze
echo "$PROMPT bash nikto-txt-to-whatweb.sh $CLIENT | tee ~/$CLIENT/all.whatweb"
bash nikto-txt-to-whatweb.sh $CLIENT | tee ~/$CLIENT/all.whatweb
echo "$PROMPT bash nikto-txt-to-dirb.sh $CLIENT | tee ~/$CLIENT/all.dirb"
bash nikto-txt-to-dirb.sh $CLIENT | tee ~/$CLIENT/all.dirb
echo "$PROMPT bash whatweb-txt-to-dirb.sh $CLIENT | tee ~/$CLIENT/all.dirb.ww"
bash whatweb-txt-to-dirb.sh $CLIENT | tee ~/$CLIENT/all.dirb.ww
echo "$PROMPT bash whatweb-txt-to-dirb.sh $CLIENT | tee ~/$CLIENT/all.dirb.ww"
bash whatweb-txt-to-dirb.sh $CLIENT | tee ~/$CLIENT/all.dirb.ww
#echo "$PROMPT bash nikto-txt-to-wpscan.sh $CLIENT | tee ~/$CLIENT/all.wpscan"
#bash nikto-txt-to-wpscan.sh $CLIENT | tee ~/$CLIENT/all.wpscan
echo "$PROMPT bash nikto-txt-to-sqlmap.sh $CLIENT | tee ~/$CLIENT/all.sqlmap"
bash nikto-txt-to-sqlmap.sh $CLIENT | tee ~/$CLIENT/all.sqlmap
echo "$PROMPT bash nikto-txt-to-w3af.sh $CLIENT $(OLDPWD)audit-high-risk.w3af | tee ~/$CLIENT/all.w3af"
bash nikto-txt-to-w3af.sh $CLIENT $(OLDPWD)audit-high-risk.w3af | tee ~/$CLIENT/all.w3af
echo "$PROMPT perl ../fierce.pl -dns $DOMAIN -wordlist ../fierce-master-wordlist.txt"
perl ../fierce.pl -dns $DOMAIN -wordlist ../fierce-master-wordlist.txt
echo "$PROMPT bash nmap-known-udp-ports.sh $CLIENT ~/$CLIENT/targets | tee ~/$CLIENT/all.nmap.udp"
bash nmap-known-udp-ports.sh $CLIENT ~/$CLIENT/targets | tee ~/$CLIENT/all.nmap.udp
echo "$PROMPT sudo ike-scan -f ~/$CLIENT/targets | tee ~/$CLIENT/ikescan-output-all.txt"
sudo ike-scan -f ~/$CLIENT/targets | tee ~/$CLIENT/ikescan-output-all.txt
cd ~/ikeforce/
for ip in $(awk '{print $1}' ~/$CLIENT/ikescan-output-all.txt|egrep '^[0-9]{1,3}'); do
echo "$PROMPT sudo python ikeforce.py $ip -a | tee ~/$CLIENT/ikeforce-output-$ip-useable-transforms.txt"
sudo python ikeforce.py $ip -a | tee ~/$CLIENT/ikeforce-output-$ip-useable-transforms.txt;
done
cd -
### Use ikescan to get transforms
for IP in $(awk '{print $1}' ~/$CLIENT/ikescan-output-all.txt|egrep '^[0-9]{1,3}'); do
echo "$PROMPT bash run-ikescan.sh $CLIENT $IP -a;"
bash run-ikescan.sh $CLIENT $IP -a;
echo "$PROMPT sudo python ~/iker.py $IP | tee ~/$CLIENT/iker-output-$IP.txt"
sudo python ~/iker.py $IP | tee ~/$CLIENT/iker-output-$IP.txt
done
### Use ikeforce to perform groupname guessing.
IFS=$'\n';
for line in $(grep -H 'Auth=PSK' ~/$CLIENT/ikescan-output-*aggressive-mode.txt); do
IP=$(echo $line|egrep -o '([0-9]{1,3}\.){3}([0-9]{1,3})');
ENC=$(echo $line|egrep -o 'Enc=[^ ]+');
HASH=$(echo $line|egrep -o 'Hash=[^ ]+');
GROUP=$(echo $line|egrep -o 'Group=[0-9]');
if [ $ENC == 'Enc=3DES' ];then CRYPTO='5';
elif [ $ENC == 'Enc=AES' ];then CRYPTO='7';
elif [ $ENC == 'Enc=DES' ];then CRYPTO='1';
else
printf '\nDammit Bobby. Wrong crypto.\n'
exit 0
fi
if [ $HASH == 'Hash=MD5' ];then HMAC='1';
elif [ $HASH == 'Hash=SHA1' ];then HMAC='2';
elif [ $HASH == 'Hash=SHA2-256' ];then HMAC='4';
elif [ $HASH == 'Hash=SHA2-384' ];then HMAC='5';
elif [ $HASH == 'Hash=SHA2-512' ];then HMAC='6';
else
printf '\nDammit Bobby. Wrong hmac.\n';
exit 0;
fi
if [ $GROUP == 'Group=1' ];then DH='1';
elif [ $GROUP == 'Group=2' ];then DH='2';
elif [ $GROUP == 'Group=5' ];then DH='5';
else
printf '\nDammit Bobby. Wrong group.\n';
exit 0;
fi
if [ -z $CRYPTO ];then
printf '\nDammit Bobby. Empty crypto\n';
exit 0;
else
if [ -z $HASH ];then
printf '\nDammit Bobby. Empty hash\n';
exit 0;
else
if [ -z $DH ];then
printf '\nDammit Bobby. Empty dh\n';
exit 0
else
#echo "$PROMPT bash run-ikeforce.sh $CLIENT $IP $CRYPTO $HMAC 1 $DH | tee ~/$CLIENT/ikeforce-output-$2_$CRYPTO-$HASH-1-$DH.txt;"
#bash run-ikeforce.sh $CLIENT $IP $CRYPTO $HMAC 1 $DH | tee ~/$CLIENT/ikeforce-output-$2_$CRYPTO-$HASH-1-$DH.txt;
echo "$PROMPT bash run-ikeforce.sh $CLIENT $IP $CRYPTO $HMAC 1 $DH;"
bash run-ikeforce.sh $CLIENT $IP $CRYPTO $HMAC 1 $DH;
fi
fi
fi
done
| jnqpblc/Randomness | 3.mapping/automated-va/run-the-gambit.sh | Shell | gpl-3.0 | 5,564 |
using System;
using System.Drawing.Imaging;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using P3D.Legacy.Core.Entities.Other;
using P3D.Legacy.Core.Input;
using P3D.Legacy.Core.Resources;
using P3D.Legacy.Core.Resources.Managers;
using P3D.Legacy.Core.Resources.Managers.Music;
using P3D.Legacy.Core.Resources.Managers.Sound;
using P3D.Legacy.Core.Settings;
using P3D.Legacy.Core.Storage.Folders;
using PCLExt.FileStorage;
namespace P3D.Legacy.Core
{
public static class MainGameFunctions
{
public static void FunctionKeys()
{
if (KeyBoardHandler.KeyPressed(Core.KeyBindings.ScreenShot) && Core.CurrentScreen.CanTakeScreenshot )
CaptureScreen();
if (KeyBoardHandler.KeyPressed(Core.KeyBindings.FullScreen) && Core.CurrentScreen.CanGoFullscreen)
ToggleFullScreen();
if (KeyBoardHandler.KeyPressed(Core.KeyBindings.DebugControl))
{
Core.GameOptions.ShowDebug = !Core.GameOptions.ShowDebug;
Options.SaveOptions(Core.GameOptions);
}
if (KeyBoardHandler.KeyPressed(Core.KeyBindings.GUIControl))
{
Core.GameOptions.ShowGUI = !Core.GameOptions.ShowGUI;
Options.SaveOptions(Core.GameOptions);
}
if (KeyBoardHandler.KeyPressed(Core.KeyBindings.MuteMusic) && Core.CurrentScreen.CanMuteMusic)
{
Core.GameOptions.Muted = !Core.GameOptions.Muted;
MusicManager.Mute(Core.GameOptions.Muted);
SoundEffectManager.Mute(Core.GameOptions.Muted);
Options.SaveOptions(Core.GameOptions);
Core.CurrentScreen.ToggledMute();
}
if (KeyBoardHandler.KeyPressed(Core.KeyBindings.LightKey))
Core.GameOptions.LightingEnabled = !Core.GameOptions.LightingEnabled;
if (KeyBoardHandler.KeyDown(Core.KeyBindings.DebugControl))
{
if (KeyBoardHandler.KeyPressed(Keys.F))
TextureManager.TextureList.Clear();
if (KeyBoardHandler.KeyPressed(Keys.S))
Core.SetWindowSize(new Vector2(1200, 680));
if (KeyBoardHandler.KeyPressed(Keys.L))
Logger.DisplayLog = !Logger.DisplayLog;
}
if (ControllerHandler.ButtonPressed(Buttons.Back, true))
{
Core.GameOptions.GamePadEnabled = !Core.GameOptions.GamePadEnabled;
Core.GameMessage.ShowMessage(Core.GameOptions.GamePadEnabled ? "Enabled XBOX 360 GamePad support." : "Disabled XBOX 360 GamePad support.", 12, FontManager.MainFont, Color.White);
Options.SaveOptions(Core.GameOptions);
}
if (KeyBoardHandler.KeyPressed(Keys.B) && KeyBoardHandler.KeyDown(Core.KeyBindings.DebugControl))
Core.GameOptions.DrawViewBox = !Core.GameOptions.DrawViewBox;
}
private static void CaptureScreen()
{
try
{
Core.GameMessage.HideMessage();
var fileName = $"{DateTime.Now:yyyy-MM-dd_HH.mm.ss}.png";
var file = new ScreenshotsFolder().CreateFile(fileName, CreationCollisionOption.ReplaceExisting);
if (!Core.GraphicsManager.IsFullScreen)
{
using (var b = new System.Drawing.Bitmap(Core.WindowSize.Width, Core.WindowSize.Height))
using (var g = System.Drawing.Graphics.FromImage(b))
using (var fileStream = file.Open(FileAccess.ReadAndWrite))
{
g.CopyFromScreen(Core.Window.ClientBounds.X, Core.Window.ClientBounds.Y, 0, 0, new System.Drawing.Size(b.Width, b.Height));
b.Save(fileStream, ImageFormat.Png);
}
}
else
{
using (var screenshot = new RenderTarget2D(Core.GraphicsDevice, Core.WindowSize.Width, Core.WindowSize.Height, false, SurfaceFormat.Color, DepthFormat.Depth24Stencil8))
using (var fileStream = file.Open(FileAccess.ReadAndWrite))
{
Core.GraphicsDevice.SetRenderTarget(screenshot);
Core.Draw();
Core.GraphicsDevice.SetRenderTarget(null);
screenshot.SaveAsPng(fileStream, Core.WindowSize.Width, Core.WindowSize.Height);
}
}
Core.GameMessage.SetupText($"{Localization.GetString("game_message_screenshot")}{fileName}", FontManager.MainFont, Color.White);
Core.GameMessage.ShowMessage(12, Core.GraphicsDevice);
}
catch (Exception ex) { Logger.Log(Logger.LogTypes.ErrorMessage, $"Basic.vb: {Localization.GetString("game_message_screenshot_failed")}. More information: {ex.Message}"); }
}
private static void ToggleFullScreen()
{
if (Core.GraphicsManager.IsFullScreen == false)
{
if (GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Width != System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width ||
GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Height != System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height)
{
Core.GraphicsManager.PreferredBackBufferWidth = System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width;
Core.GraphicsManager.PreferredBackBufferHeight = System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height;
Core.WindowSize = new Rectangle(0, 0, System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width, System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height);
}
else
{
Core.GraphicsManager.PreferredBackBufferWidth = GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Width;
Core.GraphicsManager.PreferredBackBufferHeight = GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Height;
Core.WindowSize = new Rectangle(0, 0, GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Width, GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Height);
}
//System.Windows.Forms.Application.VisualStyleState = Windows.Forms.VisualStyles.VisualStyleState.ClientAndNonClientAreasEnabled;
Core.GraphicsManager.ToggleFullScreen();
Core.GameMessage.ShowMessage(Localization.GetString("game_message_fullscreen_on"), 12, FontManager.MainFont, Color.White);
}
else
{
Core.GraphicsManager.PreferredBackBufferWidth = 1200;
Core.GraphicsManager.PreferredBackBufferHeight = 680;
Core.WindowSize = new Rectangle(0, 0, 1200, 680);
//System.Windows.Forms.Application.VisualStyleState = Windows.Forms.VisualStyles.VisualStyleState.ClientAndNonClientAreasEnabled;
Core.GraphicsManager.ToggleFullScreen();
Core.GameMessage.ShowMessage(Localization.GetString("game_message_fullscreen_off"), 12, FontManager.MainFont, Color.White);
}
Core.GraphicsManager.ApplyChanges();
BaseNetworkPlayer.ScreenRegionChanged();
}
}
}
| P3D-Legacy/P3D-Legacy-CSharp | P3D-Legacy Core/MainGameFunctions.cs | C# | gpl-3.0 | 7,474 |
<?php
global $unexpect_list_sections_array;
global $unexpect_menu_sections_array;
$unexpect_list_sections_array = array("linkurl","linkurl_newopen","aboutus","friendlink","public_notice");
$unexpect_menu_sections_array = array("friendlink","public_notice");
function mytpl_recur_show_secs($article = null,$id = '',$count='',$idname = '',$classname = '')
{
global $zengl_cms_rootdir;
global $adminHtml_genhtml;
global $unexpect_menu_sections_array;
if($count == 1)
echo "<ul id='$idname' class='$classname'>";
else
echo "<ul>";
if($count == 1)
{
if($article->all == null)
$article->getall();
if($adminHtml_genhtml == 'yes')
echo "<li><a href='{$zengl_cms_rootdir}index.html'>主页</a></li>";
else
echo "<li><a href='{$zengl_cms_rootdir}index.php'>主页</a></li>";
if($article->all[$id]['type']=='linkurl') //外链则显示外链地址
echo "<li><a href='{$article->all[$id]['linkurl']}'>{$article->all[$id]['sec_name']}</a></li>";
else if($article->all[$id]['type']=='linkurl_newopen')
echo "<li><a href='{$article->all[$id]['linkurl']}' target='_blank'>{$article->all[$id]['sec_name']}</a></li>";
else if(!in_array($article->all[$id]['type'], $unexpect_menu_sections_array)) //根据栏目类型判断是否可以显示在菜单中
{
if($adminHtml_genhtml == 'yes') //普通栏目静态路径
{
echo "<li><a href='{$zengl_cms_rootdir}html/";
if($article->all[$id]['sec_dirpath'] != '')
echo "{$article->all[$id]['sec_dirpath']}/{$article->all[$id]['sec_dirname']}";
else
echo "{$article->all[$id]['sec_dirname']}";
echo "'>{$article->all[$id]['sec_name']}</a></li>";
}
else //普通栏目动态路径
echo "<li><a href='{$zengl_cms_rootdir}add_edit_del_show_list_article.php?hidden=list&sec_ID=".$id.
"&is_recur=yes'>{$article->all[$id]['sec_name']}</a></li>";
}
}
if($article->all[$id]['sec_content']!='')
{
$content = explode(',', $article->all[$id]['sec_content']);
foreach ($content as $next)
{
if($article->all[$next]['type'] == 'linkurl') //外链则显示外链地址
echo "<li><a href='{$article->all[$next]['linkurl']}'>{$article->all[$next]['sec_name']}</a>";
else if($article->all[$next]['type'] == 'linkurl_newopen') //外链则显示外链地址
echo "<li><a href='{$article->all[$next]['linkurl']}' target='_blank'>{$article->all[$next]['sec_name']}</a>";
else if(!in_array($article->all[$next]['type'], $unexpect_menu_sections_array)) //根据栏目类型判断是否可以显示在菜单中
{
if($adminHtml_genhtml == 'yes') //普通栏目静态路径
{
echo "<li><a href='{$zengl_cms_rootdir}html/";
if($article->all[$next]['sec_dirpath'] != '')
echo "{$article->all[$next]['sec_dirpath']}/{$article->all[$next]['sec_dirname']}";
else
echo "{$article->all[$next]['sec_dirname']}";
echo "'>{$article->all[$next]['sec_name']}</a>";
}
else //普通栏目动态路径
echo "<li><a href='{$zengl_cms_rootdir}add_edit_del_show_list_article.php?hidden=list&sec_ID=".$next.
"&is_recur=yes'>{$article->all[$next]['sec_name']}</a>";
}
if($article->all[$next]['sec_content']!='')
$article->mytpl_recur_show_secs(&$article,$next, $count+1);
echo "</li>";
}
}
echo "</ul>";
}
function mytpl_index_articles_divs($article = null)
{
global $adminHtml_genhtml;
global $zengl_cms_rootdir;
global $unexpect_list_sections_array;
$sql = &$article->sql;
$i = '0';
$count = 0;
$sec_count = 0;
if($adminHtml_genhtml == 'yes')
$flaghtml = true;
else
$flaghtml = false;
while ($sql->parse_results())
{
if(in_array($article->all[$sql->row['sec_ID']]['type'],$unexpect_list_sections_array)) //判断是否可以显示在列表中
continue;
if($sql->row['sec_ID'] != $i)
{
if(++$sec_count > $article->index_sec_count)
break;
if(!$flaghtml)
$loc_more = "{$zengl_cms_rootdir}add_edit_del_show_list_article.php?hidden=list&sec_ID={$sql->row['sec_ID']}" .
"&is_recur=yes";
else
{
$secId = $sql->row['sec_ID'];
if($article->all[$secId]['sec_dirpath'] != '')
$sec_dirpath = 'html/' . $article->all[$secId]['sec_dirpath'] . '/' .
$article->all[$secId]['sec_dirname'];
else
$sec_dirpath = 'html/' . $article->all[$secId]['sec_dirname'];
$loc_more = "{$zengl_cms_rootdir}{$sec_dirpath}" . '/';
}
if($i != '0')
echo "</div></div><div class='article_img_footer'></div></div>";
$i = $sql->row['sec_ID'];
echo "<div class='wrap_div'>
<div class='article_img_header'>
</div>
<div class='article_img_middle'>
<div class='wrap_header'>
<span>
{$article->all[$sql->row["sec_ID"]]["sec_name"]}
<a href='$loc_more' title='查看<{$article->all[$sql->row["sec_ID"]]["sec_name"]}>更多的文章信息'>
more...</a>
</span>
</div>
<div class='wrap_content'>";
$count = 0;
}
if(!$flaghtml)
$loc_article = "{$zengl_cms_rootdir}add_edit_del_show_list_article.php?hidden=show&articleID={$sql->row['articleID']}";
else
{
$loc_article = "{$zengl_cms_rootdir}{$sec_dirpath}" . '/' . 'article-' .
$sql->row['articleID'] . '.html';
}
if(++$count <= $article->index_count)
{
$title = subUTF8($sql->row['title'],30);
echo "<span><a href = '$loc_article' title= '{$sql->row['title']}'>$title</a></span>";
}
}
if($i!=0)
echo "</div></div><div class='article_img_footer'></div></div>";
}
function mytpl_unexpect_sec_sqlstr($article = null,$colname = 'sec_ID')
{
global $unexpect_list_sections_array;
$sec_sqlstr = '';
foreach ($article->all as $k => $v)
{
if(in_array($v['type'],$unexpect_list_sections_array))
{
$sec_sqlstr .= "{$colname} != {$v['sec_ID']} and ";
}
}
return $sec_sqlstr;
}
?> | zenglong/zenglcms | tpl/mydefined/class/mytpl_help_func.php | PHP | gpl-3.0 | 5,975 |
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using MonogameLevel.Helpers;
namespace MonogameLevel
{
public class LevelManager
{
private Texture2D levelSprite;
public LevelManager(Texture2D levelSprite)
{
this.levelSprite = levelSprite;
}
public Dictionary<Vector2, Tile> LoadLevel(string levelFilePath)
{
Dictionary<Vector2, Tile> level = new Dictionary<Vector2, Tile>();
TileManager manager = new TileManager(levelSprite);
string[] lines = System.IO.File.ReadAllLines(levelFilePath);
foreach (var line in lines)
{
if (!string.IsNullOrWhiteSpace(line))
{
string[] tileInfo = line.Split(',');
var position = new Vector2(float.Parse(tileInfo[0]) * Values.TileWidth, float.Parse(tileInfo[1]) * Values.TileHeight);
level.Add(position, manager.GenerateTile(position, GetTileType(tileInfo[2])));
}
}
return level;
}
private TileTypes GetTileType(string type)
{
switch (type)
{
case "single":
return TileTypes.Single;
case "left":
return TileTypes.LeftEnd;
case "middle":
return TileTypes.Middle;
case "right":
return TileTypes.RightEnd;
default:
return TileTypes.None;
}
}
}
}
| Yodilicious/AdventureGame | AdventureGame.Main/GameManagers/LevelManager.cs | C# | gpl-3.0 | 1,653 |
# -*- coding: utf-8 -*-
class System(object):
""" This is the father class for all different systems. """
def __init__(self, *args, **kwargs):
pass
def update(self, dt):
raise NotImplementedError
| eeneku/baller | src/engine/system.py | Python | gpl-3.0 | 235 |
// artist.h
//
// Project: Ampache Browser
// License: GNU GPLv3
//
// Copyright (C) 2015 - 2016 Róbert Čerňanský
#ifndef ARTIST_H
#define ARTIST_H
#include <string>
namespace domain {
/**
* @brief Represents the artist domain object.
*/
class Artist {
public:
/**
* @brief Constructor.
*
* @param id Identifier.
* @param name Artist's name.
*/
Artist(const std::string& id, const std::string& name);
Artist(const Artist& other) = delete;
Artist& operator=(const Artist& other) = delete;
/**
* @brief Gets the identifier.
*/
const std::string getId() const;
/**
* @brief Gets artist's name.
*/
const std::string getName() const;
private:
// arguments from the constructor
const std::string myId;
const std::string myName;
};
bool operator==(const Artist& lhs, const Artist& rhs);
bool operator!=(const Artist& lhs, const Artist& rhs);
bool operator<(const Artist& lhs, const Artist& rhs);
bool operator>(const Artist& lhs, const Artist& rhs);
bool operator<=(const Artist& lhs, const Artist& rhs);
bool operator>=(const Artist& lhs, const Artist& rhs);
}
namespace std {
template<>
class hash<domain::Artist> {
public:
size_t operator()(const domain::Artist& artist) const;
};
}
#endif // ARTIST_H
| ampache-browser/ampache_browser | include/internal/domain/artist.h | C | gpl-3.0 | 1,329 |
<?php
namespace Conekta;
use \Conekta\Lang;
use \Conekta\Conekta;
use \Exception;
class Error extends Exception
{
public function __get($property)
{
if (property_exists($this, $property)) {
return $this->$property;
}
}
public function __isset($property)
{
return isset($this->$property);
}
public static function build($resp, $http_code)
{
$message = isset($resp['message']) ? $resp['message'] : null;
$message_to_purchaser = isset($resp['message_to_purchaser']) ? $resp['message_to_purchaser'] : null;
$type = isset($resp['type']) ? $resp['type'] : null;
$params = isset($resp['param']) ? $resp['param'] : null;
$debug_message = isset($resp['debug_message']) ? $resp['debug_message'] : null;
$code = isset($resp['code']) ? $resp['code'] : null;
if (isset($http_code) != true || $http_code == 0) {
return new NoConnectionError(
Lang::translate('error.requestor.connection', Lang::EN, array('BASE' => Conekta::$apiBase)),
Lang::translate('error.requestor.connection_purchaser', Conekta::$locale),
$type, $http_code, $params);
}
switch ($http_code) {
case 400:
return new MalformedRequestError($message, $message_to_purchaser, $type, $code, $params);
case 401:
return new AuthenticationError($message, $message_to_purchaser, $type, $code, $params);
case 402:
return new ProcessingError($message, $message_to_purchaser, $type, $code, $params);
case 404:
return new ResourceNotFoundError($message, $message_to_purchaser, $type, $code, $params);
case 422:
return new ParameterValidationError($message, $message_to_purchaser, $type, $code, $params);
case 500:
return new ApiError($message, $message_to_purchaser, $type, $code, $params);
default:
return new self($message, $message_to_purchaser, $type, $code, $params);
}
}
public function __construct($message = null, $message_to_purchaser = null, $type = null, $code = null, $params = null)
{
parent::__construct($message);
$this->message = $message;
$this->message_to_purchaser = $message_to_purchaser;
$this->type = $type;
$this->code = $code;
$this->params = $params;
}
public static function errorHandler($resp, $http_code)
{
throw self::build($resp, $http_code);
}
}
class ApiError extends Error
{
}
class NoConnectionError extends Error
{
}
class AuthenticationError extends Error
{
}
class ParameterValidationError extends Error
{
}
class ProcessingError extends Error
{
}
class ResourceNotFoundError extends Error
{
}
class MalformedRequestError extends Error
{
}
| benzzdan/greeenpeach4 | conekta/conekta_php/lib/Conekta/Error.php | PHP | gpl-3.0 | 2,932 |
/*
Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/
CKEDITOR.plugins.setLang( 'maximize', 'lv', {
maximize: 'Maksimizēt',
minimize: 'Minimizēt'
} );
| ernestbuffington/PHP-Nuke-Titanium | includes/wysiwyg/ckeditor/plugins/maximize/lang/lv.js | JavaScript | gpl-3.0 | 264 |
package xingu.type.transformer;
public class ReplaceTransformer
implements Transformer
{
private String regexp;
private String replacement;
@Override
public String transform(String value)
{
if(value == null)
{
return null;
}
return value.replaceAll(regexp, replacement);
}
public void setRegexp(String regexp){this.regexp = regexp;}
public void setReplacement(String replacement){this.replacement = replacement;}
}
| leandrocruz/xingu | type-handler/src/main/java/xingu/type/transformer/ReplaceTransformer.java | Java | gpl-3.0 | 440 |
---
title: "दीन और देश के लिए पटना में उमड़ा मुस्लिम समुदाय का हूजुम"
layout: item
category: ["india"]
date: 2018-04-15T07:51:24.509Z
image: 1523798484508deen.jpg
---
<p>पटना: बिहार की राजधानी पटना के गांधी मैदान में 'दीन बचाओ, देश बचाओ' रैली का आज रविवार को आयोजन किया गया है। इमारत शरिया और ऑल इंडिया मुस्लिम पर्सनल लॉ बोर्ड (एआईएमपीएलबी) ने संयुक्त रूप से इस्लाम और राष्ट्र को खतरे में बताते हुए सड़क पर उतरने का ऐलान किया था। गांधी मैदान में इस रैली में लाखों मुसलमानों के पहुंचने की उम्मीद जताई जा रही है। </p>
<p>तीन तलाक से लेकर कानून व्यवस्था की स्थिति, संविधान और इस्लाम पर खतरे के मुद्दों पर एआईएमपीएलबी और इमारत शरिया आक्रामक हैं और इन्हीं मुद्दों के विरोध में इस रेली का ऐलान किया गया है।</p>
<p>कार्यक्रम का उद्घाटन अमीर-ए- शरीयत मौलाना मोहम्मद वली रहमानी ने किया। कार्यक्रम का उद्देश्य हिन्दू-मुस्लिम सौहार्द और भाईचारे के खिलाफ खड़ी ताकतों के खिलाफ लोगों को सचेत करना है। </p>
<p>अमारत शरिया के नाजिम अनीसुर रहमान कासमी ने कहा कि यह एक गैर राजनीतिक कार्यक्रम है और आग्रह किया कि इसे राजनीति से जोड़कर न देखा जाए।</p>
<p>मौलाना उमरेन महफूज रहमानी ने कहा कि अररिया, फूलपुर और गोरखपुर में जनता ने केंद्र को तीन तलाक दे दिया है। उन्होंने कहा कि कौम कमजोरों की हिफाजत के लिए आगे आये। इस मौके पर अबू तालिब रहमानी ने कहा कि जिस का पिता मजबूत होता है उसके वंशज भी मजबूत होते है। उन्होंने आगे कहा कि 5 लाख मुस्लिम महिलाओं ने हस्ताक्षर कर केंद्र को सौंपा फिर भी तीन तलाक बिल को लाकर सारी मसाइल के हल निकालने का दावा किया जा रहा। हमे दीन और देश दोनों को बचाना है।</p>
<p>बोर्ड के महासचिव मौलाना वली रहमानी ने कहा कि 'हमने चार साल इंतजार किया और सोचा कि बीजेपी संविधान के तहत देश चलाना सीख लेगी। उन्होंने आगे कहा कि मुसलमानों के पर्सनल लॉ पर हमला किया जा रहा है। हमें अपने लोगों और देशवासियों को बताना पड़ रहा है कि देश के साथ-साथ इस्लाम पर भी खतरा है।'</p> | InstantKhabar/_source | _source/news/2018-04-15-deen.html | HTML | gpl-3.0 | 4,327 |
using System.Collections.Generic;
using System.Linq;
namespace Gammtek.Conduit.Paths
{
partial class PathHelpers
{
private sealed class VariableDirectoryPath : VariablePathBase, IVariableDirectoryPath
{
internal VariableDirectoryPath(string path)
: base(path)
{
//Debug.Assert(path.IsValidVariableDirectoryPath());
}
public string DirectoryName => MiscHelpers.GetLastName(CurrentPath);
public override bool IsDirectoryPath => true;
public override bool IsFilePath => false;
public IVariableDirectoryPath GetChildDirectoryPath(string directoryName)
{
Argument.IsNotNullOrEmpty(nameof(directoryName), directoryName);
var pathString = PathBrowsingHelpers.GetChildDirectoryPath(this, directoryName);
//Debug.Assert(pathString.IsValidVariableDirectoryPath());
return new VariableDirectoryPath(pathString);
}
public IVariableFilePath GetChildFilePath(string fileName)
{
Argument.IsNotNullOrEmpty(nameof(fileName), fileName);
var pathString = PathBrowsingHelpers.GetChildFilePath(this, fileName);
//Debug.Assert(pathString.IsValidVariableFilePath());
return new VariableFilePath(pathString);
}
public IVariableDirectoryPath GetSisterDirectoryPath(string directoryName)
{
Argument.IsNotNullOrEmpty(nameof(directoryName), directoryName);
var path = PathBrowsingHelpers.GetSisterDirectoryPath(this, directoryName);
return path as IVariableDirectoryPath;
}
public IVariableFilePath GetSisterFilePath(string fileName)
{
Argument.IsNotNullOrEmpty(nameof(fileName), fileName);
var path = PathBrowsingHelpers.GetSisterFilePath(this, fileName);
return path as IVariableFilePath;
}
public VariablePathResolvingStatus TryResolve(IEnumerable<KeyValuePair<string, string>> variables,
out IAbsoluteDirectoryPath resolvedPath)
{
Argument.IsNotNull(nameof(variables), variables);
IReadOnlyList<string> unresolvedVariables;
return TryResolve(variables, out resolvedPath, out unresolvedVariables);
}
public VariablePathResolvingStatus TryResolve(IEnumerable<KeyValuePair<string, string>> variables,
out IAbsoluteDirectoryPath resolvedPath, out IReadOnlyList<string> unresolvedVariables)
{
Argument.IsNotNull(nameof(variables), variables);
string path;
if (!TryResolve(variables, out path, out unresolvedVariables))
{
resolvedPath = null;
return VariablePathResolvingStatus.UnresolvedVariable;
}
if (!path.IsValidAbsoluteDirectoryPath())
{
resolvedPath = null;
return VariablePathResolvingStatus.CannotConvertToAbsolutePath;
}
resolvedPath = path.ToAbsoluteDirectoryPath();
return VariablePathResolvingStatus.Success;
}
public bool TryResolve(IEnumerable<KeyValuePair<string, string>> variables, out IAbsoluteDirectoryPath resolvedPath,
out string failureMessage)
{
Argument.IsNotNull(nameof(variables), variables);
IReadOnlyList<string> unresolvedVariables;
var variablesList = variables as IList<KeyValuePair<string, string>> ?? variables.ToList();
var status = TryResolve(variablesList, out resolvedPath, out unresolvedVariables);
switch (status)
{
default:
//Debug.Assert(status == VariablePathResolvingStatus.Success);
failureMessage = null;
return true;
case VariablePathResolvingStatus.UnresolvedVariable:
//Debug.Assert(unresolvedVariables != null);
//Debug.Assert(unresolvedVariables.Count > 0);
failureMessage = VariablePathHelpers.GetUnresolvedVariableFailureReason(unresolvedVariables);
return false;
case VariablePathResolvingStatus.CannotConvertToAbsolutePath:
failureMessage = GetVariableResolvedButCannotConvertToAbsolutePathFailureReason(variablesList, "directory");
return false;
}
}
public override VariablePathResolvingStatus TryResolve(IEnumerable<KeyValuePair<string, string>> variables, out IAbsolutePath resolvedPath)
{
IAbsoluteDirectoryPath directoryPath;
var resolvingStatus = TryResolve(variables, out directoryPath);
resolvedPath = directoryPath;
return resolvingStatus;
}
public override VariablePathResolvingStatus TryResolve(IEnumerable<KeyValuePair<string, string>> variables, out IAbsolutePath resolvedPath,
out IReadOnlyList<string> unresolvedVariables)
{
IAbsoluteDirectoryPath directoryPath;
var resolvingStatus = TryResolve(variables, out directoryPath, out unresolvedVariables);
resolvedPath = directoryPath;
return resolvingStatus;
}
public override bool TryResolve(IEnumerable<KeyValuePair<string, string>> variables, out IAbsolutePath resolvedPath, out string failureMessage)
{
IAbsoluteDirectoryPath directoryPath
;
var b = TryResolve(variables, out directoryPath, out failureMessage);
resolvedPath = directoryPath;
return b;
}
IDirectoryPath IDirectoryPath.GetChildDirectoryPath(string directoryName)
{
return GetChildDirectoryPath(directoryName);
}
IFilePath IDirectoryPath.GetChildFilePath(string fileName)
{
return GetChildFilePath(fileName);
}
IDirectoryPath IDirectoryPath.GetSisterDirectoryPath(string directoryName)
{
return GetSisterDirectoryPath(directoryName);
}
IFilePath IDirectoryPath.GetSisterFilePath(string fileName)
{
return GetSisterFilePath(fileName);
}
}
}
}
| ME3Explorer/ME3Explorer | Gammtek.Conduit.Core/_Paths/PathHelpers.VariableDirectoryPath.cs | C# | gpl-3.0 | 5,436 |
@echo off
set PWD=%~dp0
java -cp "%PWD%bin;%PWD%lib\jewelcli-0.6.jar" arden.MainClass %*
pause
| luiswolff/arden2bytecode | run.bat | Batchfile | gpl-3.0 | 95 |
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2015.11.24 at 09:50:34 AM AEDT
//
package org.isotc211._2005.gmd;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlSchemaType;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for CI_Contact_PropertyType complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="CI_Contact_PropertyType">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence minOccurs="0">
* <element ref="{http://www.isotc211.org/2005/gmd}CI_Contact"/>
* </sequence>
* <attGroup ref="{http://www.isotc211.org/2005/gco}ObjectReference"/>
* <attribute ref="{http://www.isotc211.org/2005/gco}nilReason"/>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "CI_Contact_PropertyType", propOrder = {
"ciContact"
})
public class CIContactPropertyType {
@XmlElement(name = "CI_Contact")
protected CIContactType ciContact;
@XmlAttribute(name = "nilReason", namespace = "http://www.isotc211.org/2005/gco")
protected List<String> nilReason;
@XmlAttribute(name = "uuidref")
protected String uuidref;
@XmlAttribute(name = "type", namespace = "http://www.w3.org/1999/xlink")
protected String type;
@XmlAttribute(name = "href", namespace = "http://www.w3.org/1999/xlink")
@XmlSchemaType(name = "anyURI")
protected String href;
@XmlAttribute(name = "role", namespace = "http://www.w3.org/1999/xlink")
@XmlSchemaType(name = "anyURI")
protected String role;
@XmlAttribute(name = "arcrole", namespace = "http://www.w3.org/1999/xlink")
@XmlSchemaType(name = "anyURI")
protected String arcrole;
@XmlAttribute(name = "title", namespace = "http://www.w3.org/1999/xlink")
protected String title;
@XmlAttribute(name = "show", namespace = "http://www.w3.org/1999/xlink")
protected String show;
@XmlAttribute(name = "actuate", namespace = "http://www.w3.org/1999/xlink")
protected String actuate;
/**
* Gets the value of the ciContact property.
*
* @return
* possible object is
* {@link CIContactType }
*
*/
public CIContactType getCIContact() {
return ciContact;
}
/**
* Sets the value of the ciContact property.
*
* @param value
* allowed object is
* {@link CIContactType }
*
*/
public void setCIContact(CIContactType value) {
this.ciContact = value;
}
/**
* Gets the value of the nilReason property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the nilReason property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getNilReason().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link String }
*
*
*/
public List<String> getNilReason() {
if (nilReason == null) {
nilReason = new ArrayList<String>();
}
return this.nilReason;
}
/**
* Gets the value of the uuidref property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getUuidref() {
return uuidref;
}
/**
* Sets the value of the uuidref property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setUuidref(String value) {
this.uuidref = value;
}
/**
* Gets the value of the type property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getType() {
if (type == null) {
return "simple";
} else {
return type;
}
}
/**
* Sets the value of the type property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setType(String value) {
this.type = value;
}
/**
* Gets the value of the href property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getHref() {
return href;
}
/**
* Sets the value of the href property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setHref(String value) {
this.href = value;
}
/**
* Gets the value of the role property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getRole() {
return role;
}
/**
* Sets the value of the role property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setRole(String value) {
this.role = value;
}
/**
* Gets the value of the arcrole property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getArcrole() {
return arcrole;
}
/**
* Sets the value of the arcrole property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setArcrole(String value) {
this.arcrole = value;
}
/**
* Gets the value of the title property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getTitle() {
return title;
}
/**
* Sets the value of the title property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setTitle(String value) {
this.title = value;
}
/**
* Gets the value of the show property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getShow() {
return show;
}
/**
* Sets the value of the show property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setShow(String value) {
this.show = value;
}
/**
* Gets the value of the actuate property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getActuate() {
return actuate;
}
/**
* Sets the value of the actuate property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setActuate(String value) {
this.actuate = value;
}
}
| anu-doi/anudc | DataCommons/src/main/java/org/isotc211/_2005/gmd/CIContactPropertyType.java | Java | gpl-3.0 | 7,666 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en_US" lang="en_US">
<head><meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<title>SellModel xref</title>
<link type="text/css" rel="stylesheet" href="../../../../stylesheet.css" />
</head>
<body>
<div id="overview"><a href="../../../../../apidocs/com/jlranta/pholiotracker/gui/SellModel.html">View Javadoc</a></div><pre>
<a class="jxr_linenumber" name="L1" href="#L1">1</a> <strong class="jxr_keyword">package</strong> com.jlranta.pholiotracker.gui;
<a class="jxr_linenumber" name="L2" href="#L2">2</a>
<a class="jxr_linenumber" name="L3" href="#L3">3</a> <strong class="jxr_keyword">import</strong> com.jlranta.pholiotracker.portfolio.Portfolio;
<a class="jxr_linenumber" name="L4" href="#L4">4</a> <strong class="jxr_keyword">import</strong> com.jlranta.pholiotracker.portfolio.Security;
<a class="jxr_linenumber" name="L5" href="#L5">5</a>
<a class="jxr_linenumber" name="L6" href="#L6">6</a> <strong class="jxr_keyword">import</strong> javax.swing.DefaultListModel;
<a class="jxr_linenumber" name="L7" href="#L7">7</a> <strong class="jxr_keyword">import</strong> java.util.Map;
<a class="jxr_linenumber" name="L8" href="#L8">8</a>
<a class="jxr_linenumber" name="L9" href="#L9">9</a> <em class="jxr_javadoccomment">/**</em>
<a class="jxr_linenumber" name="L10" href="#L10">10</a> <em class="jxr_javadoccomment"> *</em>
<a class="jxr_linenumber" name="L11" href="#L11">11</a> <em class="jxr_javadoccomment"> * @author Jarkko Lehtoranta</em>
<a class="jxr_linenumber" name="L12" href="#L12">12</a> <em class="jxr_javadoccomment"> */</em>
<a class="jxr_linenumber" name="L13" href="#L13">13</a> <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">class</strong> <a href="../../../../com/jlranta/pholiotracker/gui/SellModel.html">SellModel</a> <strong class="jxr_keyword">extends</strong> DefaultListModel {
<a class="jxr_linenumber" name="L14" href="#L14">14</a> <strong class="jxr_keyword">private</strong> <a href="../../../../com/jlranta/pholiotracker/portfolio/Portfolio.html">Portfolio</a> portfolio;
<a class="jxr_linenumber" name="L15" href="#L15">15</a>
<a class="jxr_linenumber" name="L16" href="#L16">16</a> <strong class="jxr_keyword">public</strong> <a href="../../../../com/jlranta/pholiotracker/gui/SellModel.html">SellModel</a>(<a href="../../../../com/jlranta/pholiotracker/portfolio/Portfolio.html">Portfolio</a> p) {
<a class="jxr_linenumber" name="L17" href="#L17">17</a> <strong class="jxr_keyword">this</strong>.portfolio = p;
<a class="jxr_linenumber" name="L18" href="#L18">18</a> <strong class="jxr_keyword">this</strong>.updateData();
<a class="jxr_linenumber" name="L19" href="#L19">19</a> }
<a class="jxr_linenumber" name="L20" href="#L20">20</a>
<a class="jxr_linenumber" name="L21" href="#L21">21</a> <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> updateData() {
<a class="jxr_linenumber" name="L22" href="#L22">22</a> <strong class="jxr_keyword">this</strong>.clear();
<a class="jxr_linenumber" name="L23" href="#L23">23</a> <strong class="jxr_keyword">for</strong> (Map.Entry<String, Security> sec : <strong class="jxr_keyword">this</strong>.portfolio.getSecurities().entrySet()) {
<a class="jxr_linenumber" name="L24" href="#L24">24</a> <strong class="jxr_keyword">this</strong>.addElement(sec.getValue());
<a class="jxr_linenumber" name="L25" href="#L25">25</a> }
<a class="jxr_linenumber" name="L26" href="#L26">26</a> }
<a class="jxr_linenumber" name="L27" href="#L27">27</a> }
</pre>
<hr/>
<div id="footer">Copyright © 2017. All rights reserved.</div>
</body>
</html>
| jlehtoranta/pholiotracker | dokumentaatio/checkstyle/xref/com/jlranta/pholiotracker/gui/SellModel.html | HTML | gpl-3.0 | 3,893 |
/*
* Copyright 2013-2016 Erwin Müller <erwin.mueller@deventm.org>
*
* This file is part of prefdialog-misc-swing.
*
* prefdialog-misc-swing is free software: you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by the
* Free Software Foundation, either version 3 of the License, or (at your
* option) any later version.
*
* prefdialog-misc-swing 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 General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with prefdialog-misc-swing. If not, see <http://www.gnu.org/licenses/>.
*/
package com.anrisoftware.prefdialog.miscswing.toolbarmenu;
import javax.inject.Inject;
import javax.swing.JButton;
import javax.swing.JToolBar;
/**
* Dummy toolbar.
*
* @author Erwin Mueller, erwin.mueller@deventm.org
* @since 3.0
*/
@SuppressWarnings("serial")
class ToolBar extends JToolBar {
private final JButton button;
private ButtonAction buttonAction;
ToolBar() {
button = new JButton("Button");
add(button);
}
@Inject
void setButtonAction(ButtonAction action) {
this.buttonAction = action;
button.setAction(action);
}
public JButton getButton() {
return button;
}
public ButtonAction getButtonAction() {
return buttonAction;
}
}
| devent/prefdialog | prefdialog-misc-swing/src/test/groovy/com/anrisoftware/prefdialog/miscswing/toolbarmenu/ToolBar.java | Java | gpl-3.0 | 1,485 |
/*
* anim.h
*
* Animation application
*
* Copyright 2011 - Benjamin Bonny <benjamin.bonny@gmail.com>,
* Cédric Le Ninivin <cedriclen@gmail.com>,
* Guillaume Normand <guillaume.normand.gn@gmail.com>
*
* All rights reserved.
* MB Led
* Telecom ParisTech - ELECINF344/ELECINF381
*
* This file is part of MB Led Project.
*
* MB Led Project is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* MB Led Project 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with MB Led Project. If not, see <http://www.gnu.org/licenses/>.
*
*
*/
#ifndef H_ANIM
#define H_ANIM
void anim_task();
#endif
| bbonny/MBLed | applications/anim.h | C | gpl-3.0 | 1,100 |
import socket
import argparse
import sys
import magic_ping
import os
import settings
import signal
import logging
import struct
logging.basicConfig(format=u'%(levelname)-8s [%(asctime)s] %(message)s', level=logging.DEBUG, filename=u'client.log')
# Обработка CTRL+C
def signal_handler(signal, frame):
print("\nSTOP CLIENT.")
logging.info("STOP CLIENT.")
exit(0)
# Парсер аргументов командной строки
def create_cmd_parser():
parser = argparse.ArgumentParser()
parser.add_argument('-f', '--file', required=True, type=argparse.FileType(mode='rb'))
parser.add_argument('-a', '--address', required=True)
parser.add_argument('-c', '--cypher', action='store_const', const=True)
return parser
signal.signal(signal.SIGINT, signal_handler)
if __name__ == '__main__':
p = create_cmd_parser()
arguments = p.parse_args(sys.argv[1:])
file = arguments.file
file_name = file.name
file_size = os.stat(file_name).st_size
address = arguments.address
ID = 1
s = socket.socket(socket.AF_INET, socket.SOCK_RAW, socket.IPPROTO_ICMP)
packet_number = 1
data = file_name.encode()
if arguments.cypher:
data = struct.pack('b', 1) + data
else:
data = struct.pack('b', 0) + data
logging.debug("Start sending file to %s" % address)
magic_ping.send_ping(s, address, ID, data, packet_number)
print('start sending')
already_sent = 0 # размер уже отправленной части
while True:
data = file.read(settings.DATA_SIZE)
if arguments.cypher:
data = [a ^ b for (a, b) in zip(data, settings.KEY)] # шифруем XORом с ключом
data = bytes(data)
if not data:
break
already_sent += len(data)
packet_number += 1
magic_ping.send_ping(s, address, ID, data, packet_number)
logging.info('Отправлено: %.2f %%' % (already_sent / file_size * 100))
print('Отправлено: %.2f %%' % (already_sent / file_size * 100))
magic_ping.send_ping(s, address, ID, bytes(0), packet_number=0)
logging.debug("Packets sent: %d" % packet_number)
print("send:", packet_number)
file.close()
client_address, packet_number, checksum = magic_ping.receive_ping(s, ID, {}) # проверяем корректность передачи
if checksum and settings.md5_checksum(file_name) != checksum.decode():
logging.warning("Файл передался с ошибками!!!")
print("Файл передался с ошибками!!!")
s.close()
| byDimasik/Magic_Ping | client.py | Python | gpl-3.0 | 2,642 |
// DisplacementMapFilterMode_as.h: ActionScript 3 "DisplacementMapFilterMode" class, for Gnash.
//
// Copyright (C) 2009, 2010 Free Software Foundation, Inc.
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
//
#ifndef GNASH_ASOBJ3_DISPLACEMENTMAPFILTERMODE_H
#define GNASH_ASOBJ3_DISPLACEMENTMAPFILTERMODE_H
namespace gnash {
// Forward declarations
class as_object;
class ObjectURI;
/// Initialize the global DisplacementMapFilterMode class
void displacementmapfiltermode_class_init(as_object& where, const ObjectURI& uri);
} // gnash namespace
// GNASH_ASOBJ3_DISPLACEMENTMAPFILTERMODE_H
#endif
// local Variables:
// mode: C++
// indent-tabs-mode: t
// End:
| atheerabed/gnash-fork | libcore/asobj/flash/filters/DisplacementMapFilterMode_as.h | C | gpl-3.0 | 1,342 |
/*
* Copyright (c) 2006-2016 Marvisan Pty. Ltd. All rights reserved.
* Use is subject to license terms.
*/
/*
* OrderStatusRequestMsg.java
*
* $Id: OrderStatusRequestMsg.java,v 1.4 2011-04-28 10:07:41 vrotaru Exp $
*/
package net.hades.fix.message;
import net.hades.fix.message.anno.FIXVersion;
import net.hades.fix.message.comp.FinancingDetails;
import net.hades.fix.message.comp.Instrument;
import net.hades.fix.message.comp.Parties;
import net.hades.fix.message.exception.InvalidMsgException;
import net.hades.fix.message.struct.Tag;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;
import java.util.logging.Level;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import net.hades.fix.message.anno.TagNumRef;
import net.hades.fix.message.comp.UnderlyingInstrument;
import net.hades.fix.message.exception.BadFormatMsgException;
import net.hades.fix.message.exception.TagNotPresentException;
import net.hades.fix.message.type.AcctIDSource;
import net.hades.fix.message.type.ApplVerID;
import net.hades.fix.message.type.BeginString;
import net.hades.fix.message.type.MsgType;
import net.hades.fix.message.type.PutOrCall;
import net.hades.fix.message.type.SessionRejectReason;
import net.hades.fix.message.type.Side;
import net.hades.fix.message.type.TagNum;
import net.hades.fix.message.util.TagEncoder;
/**
* <p>Extracted from FIX protocol documentation <a href="http://www.fixprotocol.org/">FIX Protocol</a></p>
* The order status request message is used by the institution to generate an order status message back from the
* broker.
*
* @author <a href="mailto:support@marvisan.com">Support Team</a>
* @version $Revision: 1.4 $
* @created 16/01/2011, 9:25:04 AM
*/
@XmlAccessorType(XmlAccessType.NONE)
public abstract class OrderStatusRequestMsg extends FIXMsg {
// <editor-fold defaultstate="collapsed" desc="Constants">
private static final long serialVersionUID = 1L;
protected static final Set<Integer> TAGS = new HashSet<Integer>(Arrays.asList(new Integer[] {
TagNum.OrderID.getValue(),
TagNum.ClOrdID.getValue(),
TagNum.SecondaryClOrdID.getValue(),
TagNum.ClOrdLinkID.getValue(),
TagNum.OrdStatusReqID.getValue(),
TagNum.ClientID.getValue(),
TagNum.ExecBroker.getValue(),
TagNum.Account.getValue(),
TagNum.AcctIDSource.getValue(),
TagNum.NoUnderlyings.getValue(),
TagNum.Side.getValue(),
}));
protected static final Set<Integer> START_DATA_TAGS = null;
protected static final Set<Integer> REQUIRED_TAGS = new HashSet<Integer>(Arrays.asList(new Integer[] {
}));
// </editor-fold>
// <editor-fold defaultstate="collapsed" desc="Static Block">
// </editor-fold>
// <editor-fold defaultstate="collapsed" desc="Attributes">
/**
* TagNum = 37. Starting with 4.0 version.
*/
protected String orderID;
/**
* TagNum = 11 REQUIRED. Starting with 4.0 version.
*/
protected String clOrdID;
/**
* TagNum = 526. Starting with 4.3 version.
*/
protected String secondaryClOrdID;
/**
* TagNum = 583. Starting with 4.3 version.
*/
protected String clOrdLinkID;
/**
* Starting with 4.3 version.
*/
protected Parties parties;
/**
* TagNum = 790. Starting with 4.4 version.
*/
protected String ordStatusReqID;
/**
* TagNum = 109. Starting with 4.0 version.
*/
protected String clientID;
/**
* TagNum = 76. Starting with 4.0 version.
*/
protected String execBroker;
/**
* TagNum = 1. Starting with 4.2 version.
*/
protected String account;
/**
* TagNum = 660. Starting with 4.4 version.
*/
protected AcctIDSource acctIDSource;
/**
* Starting with 4.3 version.
*/
protected Instrument instrument;
/**
* Starting with 4.4 version.
*/
protected FinancingDetails financingDetails;
/**
* TagNum = 711. Starting with 4.4 version.
*/
protected Integer noUnderlyings;
/**
* Starting with 4.4 version.
*/
protected UnderlyingInstrument[] underlyingInstruments;
/**
* TagNum = 55. Starting with 4.0 version.
*/
protected String symbol;
/**
* TagNum = 65. Starting with 4.0 version.
*/
protected String symbolSfx;
/**
* TagNum = 48. Starting with 4.0 version.
*/
protected String securityID;
/**
* TagNum = 22. Starting with 4.0 version.
*/
protected String securityIDSource;
/**
* TagNum = 167. Starting with 4.1 version.
*/
protected String securityType;
/**
* TagNum = 200. Starting with 4.1 version.
*/
protected String maturityMonthYear;
/**
* TagNum = 205. Starting with 4.1 version.
*/
protected Integer maturityDay;
/**
* TagNum = 201. Starting with 4.1 version.
*/
protected PutOrCall putOrCall;
/**
* TagNum = 202. Starting with 4.1 version.
*/
protected Double strikePrice;
/**
* TagNum = 206. Starting with 4.1 version.
*/
protected Character optAttribute;
/**
* TagNum = 231. Starting with 4.2 version.
*/
protected Double contractMultiplier;
/**
* TagNum = 223. Starting with 4.2 version.
*/
protected Double couponRate;
/**
* TagNum = 207. Starting with 4.1 version.
*/
protected String securityExchange;
/**
* TagNum = 106. Starting with 4.0 version.
*/
protected String issuer;
/**
* TagNum = 348. Starting with 4.2 version.
*/
protected Integer encodedIssuerLen;
/**
* TagNum = 349. Starting with 4.2 version.
*/
protected byte[] encodedIssuer;
/**
* TagNum = 107. Starting with 4.0 version.
*/
protected String securityDesc;
/**
* TagNum = 350. Starting with 4.2 version.
*/
protected Integer encodedSecurityDescLen;
/**
* TagNum = 351. Starting with 4.2 version.
*/
protected byte[] encodedSecurityDesc;
/**
* TagNum = 54 REQUIRED. Starting with 4.0 version.
*/
protected Side side;
// </editor-fold>
// <editor-fold defaultstate="collapsed" desc="Constructors">
public OrderStatusRequestMsg() {
super();
}
public OrderStatusRequestMsg(Header header, ByteBuffer rawMsg)
throws InvalidMsgException, TagNotPresentException, BadFormatMsgException {
super(header, rawMsg);
}
public OrderStatusRequestMsg(BeginString beginString) throws InvalidMsgException {
super(MsgType.OrderStatusRequest.getValue(), beginString);
}
public OrderStatusRequestMsg(BeginString beginString, ApplVerID applVerID) throws InvalidMsgException {
super(MsgType.OrderStatusRequest.getValue(), beginString, applVerID);
}
// </editor-fold>
// <editor-fold defaultstate="collapsed" desc="Public Methods">
@Override
public Set<Integer> getFragmentTags() {
return TAGS;
}
// ACCESSOR METHODS
//////////////////////////////////////////
/**
* Message field getter.
* @return field value
*/
@FIXVersion(introduced="4.0")
@TagNumRef(tagNum=TagNum.OrderID)
public String getOrderID() {
return orderID;
}
/**
* Message field setter.
* @param orderID field value
*/
@FIXVersion(introduced="4.0")
@TagNumRef(tagNum=TagNum.OrderID)
public void setOrderID(String orderID) {
this.orderID = orderID;
}
/**
* Message field getter.
* @return field value
*/
@FIXVersion(introduced="4.0")
@TagNumRef(tagNum=TagNum.ClOrdID, required = true)
public String getClOrdID() {
return clOrdID;
}
/**
* Message field setter.
* @param clOrdID field value
*/
@FIXVersion(introduced="4.0")
@TagNumRef(tagNum=TagNum.ClOrdID, required = true)
public void setClOrdID(String clOrdID) {
this.clOrdID = clOrdID;
}
/**
* Message field getter.
* @return field value
*/
@FIXVersion(introduced="4.3")
@TagNumRef(tagNum=TagNum.SecondaryClOrdID)
public String getSecondaryClOrdID() {
return secondaryClOrdID;
}
/**
* Message field setter.
* @param secondaryClOrdID field value
*/
@FIXVersion(introduced="4.3")
@TagNumRef(tagNum=TagNum.SecondaryClOrdID)
public void setSecondaryClOrdID(String secondaryClOrdID) {
this.secondaryClOrdID = secondaryClOrdID;
}
/**
* Message field getter.
* @return field value
*/
@FIXVersion(introduced="4.3")
@TagNumRef(tagNum=TagNum.ClOrdLinkID)
public String getClOrdLinkID() {
return clOrdLinkID;
}
/**
* Message field setter.
* @param clOrdLinkID field value
*/
@FIXVersion(introduced="4.3")
@TagNumRef(tagNum=TagNum.ClOrdLinkID)
public void setClOrdLinkID(String clOrdLinkID) {
this.clOrdLinkID = clOrdLinkID;
}
/**
* Message field getter.
* @return field value
*/
@FIXVersion(introduced="4.3")
public Parties getParties() {
throw new UnsupportedOperationException(getUnsupportedTagMessage());
}
/**
* Sets the Parties component if used in this message to the proper implementation
* class.
*/
@FIXVersion(introduced="4.3")
public void setParties() {
throw new UnsupportedOperationException(getUnsupportedTagMessage());
}
/**
* Sets the Parties component to null.
*/
@FIXVersion(introduced="4.3")
public void clearParties() {
throw new UnsupportedOperationException(getUnsupportedTagMessage());
}
/**
* Message field getter.
* @return field value
*/
@FIXVersion(introduced="4.4")
@TagNumRef(tagNum=TagNum.OrdStatusReqID)
public String getOrdStatusReqID() {
return ordStatusReqID;
}
/**
* Message field setter.
* @param ordStatusReqID field value
*/
@FIXVersion(introduced="4.4")
@TagNumRef(tagNum=TagNum.OrdStatusReqID)
public void setOrdStatusReqID(String ordStatusReqID) {
this.ordStatusReqID = ordStatusReqID;
}
/**
* Message field getter.
* @return field value
*/
@FIXVersion(introduced="4.0", retired="4.3")
@TagNumRef(tagNum=TagNum.ClientID)
public String getClientID() {
return clientID;
}
/**
* Message field setter.
* @param clientID field value
*/
@FIXVersion(introduced="4.0", retired="4.3")
@TagNumRef(tagNum=TagNum.ClientID)
public void setClientID(String clientID) {
this.clientID = clientID;
}
/**
* Message field getter.
* @return field value
*/
@FIXVersion(introduced="4.0", retired="4.3")
@TagNumRef(tagNum=TagNum.ExecBroker)
public String getExecBroker() {
return execBroker;
}
/**
* Message field setter.
* @param execBroker field value
*/
@FIXVersion(introduced="4.0", retired="4.3")
@TagNumRef(tagNum=TagNum.ExecBroker)
public void setExecBroker(String execBroker) {
this.execBroker = execBroker;
}
/**
* Message field getter.
* @return field value
*/
@FIXVersion(introduced = "4.2")
@TagNumRef(tagNum = TagNum.Account)
public String getAccount() {
return account;
}
/**
* Message field setter.
* @param account field value
*/
@FIXVersion(introduced = "4.2")
@TagNumRef(tagNum = TagNum.Account)
public void setAccount(String account) {
this.account = account;
}
/**
* Message field getter.
* @return field value
*/
@FIXVersion(introduced = "4.4")
@TagNumRef(tagNum = TagNum.AcctIDSource)
public AcctIDSource getAcctIDSource() {
return acctIDSource;
}
/**
* Message field setter.
* @param acctIDSource field value
*/
@FIXVersion(introduced = "4.4")
@TagNumRef(tagNum = TagNum.AcctIDSource)
public void setAcctIDSource(AcctIDSource acctIDSource) {
this.acctIDSource = acctIDSource;
}
/**
* Message field getter.
* @return field value
*/
@FIXVersion(introduced = "4.3")
public Instrument getInstrument() {
throw new UnsupportedOperationException(getUnsupportedTagMessage());
}
/**
* Message field setter.
*/
@FIXVersion(introduced="4.3")
public void setInstrument() {
throw new UnsupportedOperationException(getUnsupportedTagMessage());
}
/**
* Message field setter.
*/
@FIXVersion(introduced="4.3")
public void clearInstrument() {
throw new UnsupportedOperationException(getUnsupportedTagMessage());
}
/**
* Message field getter.
* @return field value
*/
@FIXVersion(introduced = "4.4")
public FinancingDetails getFinancingDetails() {
throw new UnsupportedOperationException(getUnsupportedTagMessage());
}
/**
* Sets the FinancingDetails component class to the proper implementation.
*/
@FIXVersion(introduced = "4.4")
public void setFinancingDetails() {
throw new UnsupportedOperationException(getUnsupportedTagMessage());
}
/**
* Sets the FinancingDetails component to null.
*/
@FIXVersion(introduced = "4.4")
public void clearFinancingDetails() {
throw new UnsupportedOperationException(getUnsupportedTagMessage());
}
/**
* Message field getter.
* @return field value
*/
@FIXVersion(introduced="4.4")
@TagNumRef(tagNum=TagNum.NoUnderlyings)
public Integer getNoUnderlyings() {
throw new UnsupportedOperationException(getUnsupportedTagMessage());
}
/**
* This method sets the number of {@link UnderlyingInstrument} components. It will also create an array
* of {@link UnderlyingInstrument} objects and set the <code>underlyingInstruments</code>
* field with this array.
* The created objects inside the array need to be populated with data for encoding.<br/>
* If there where already objects in <code>underlyingInstruments</code> array they will be discarded.<br/>
* @param noUnderlyings number of MsgTypeGroup objects
*/
@FIXVersion(introduced="4.4")
@TagNumRef(tagNum=TagNum.NoUnderlyings)
public void setNoUnderlyings(Integer noUnderlyings) {
throw new UnsupportedOperationException(getUnsupportedTagMessage());
}
/**
* Message field getter for {@link UnderlyingInstrument} array of groups.
* @return field array value
*/
@FIXVersion(introduced = "4.4")
public UnderlyingInstrument[] getUnderlyingInstruments() {
throw new UnsupportedOperationException(getUnsupportedTagMessage());
}
/**
* This method adds a {@link UnderlyingInstrument} object to the existing array of <code>underlyingInstruments</code>
* and expands the static array with 1 place.<br/>
* This method will also update <code>noUnderlyings</code> field to the proper value.<br/>
* Note: If the <code>setNoUnderlyings</code> method has been called there will already be a number of objects in the
* <code>underlyingInstruments</code> array created.<br/>
* @return newly created block and added to the array group object
*/
@FIXVersion(introduced = "4.4")
public UnderlyingInstrument addUnderlyingInstrument() {
throw new UnsupportedOperationException(getUnsupportedTagMessage());
}
/**
* This method deletes a {@link UnderlyingInstrument} object from the existing array of <code>underlyingInstruments</code>
* and shrink the static array with 1 place.<br/>
* If the array does not have the index position then a null object will be returned.)<br/>
* This method will also update <code>noUnderlyings</code> field to the proper value.<br/>
* @param index position in array to be deleted starting at 0
* @return deleted block object
*/
@FIXVersion(introduced = "4.4")
public UnderlyingInstrument deleteUnderlyingInstrument(int index) {
throw new UnsupportedOperationException(getUnsupportedTagMessage());
}
/**
* Deletes all the {@link UnderlyingInstrument} objects from the <code>underlyingInstruments</code> array
* (sets the array to 0 length)<br/>
* This method will also update <code>noUnderlyings</code> field and set it to null.<br/>
* @return number of elements in array cleared
*/
@FIXVersion(introduced = "4.4")
public int clearUnderlyingInstruments() {
throw new UnsupportedOperationException(getUnsupportedTagMessage());
}
/**
* Message field getter.
* @return field value
*/
@FIXVersion(introduced = "4.0", retired = "4.3")
@TagNumRef(tagNum = TagNum.Symbol, required=true)
public String getSymbol() {
return getSafeInstrument().getSymbol();
}
/**
* Message field setter.
* @param symbol field value
*/
@FIXVersion(introduced = "4.0", retired = "4.3")
@TagNumRef(tagNum = TagNum.Symbol, required=true)
public void setSymbol(String symbol) {
getSafeInstrument().setSymbol(symbol);
}
/**
* Message field getter.
* @return field value
*/
@FIXVersion(introduced = "4.0", retired = "4.3")
@TagNumRef(tagNum = TagNum.SymbolSfx)
public String getSymbolSfx() {
return getSafeInstrument().getSymbolSfx();
}
/**
* Message field setter.
* @param symbolSfx field value
*/
@FIXVersion(introduced = "4.0", retired = "4.3")
@TagNumRef(tagNum = TagNum.SymbolSfx)
public void setSymbolSfx(String symbolSfx) {
getSafeInstrument().setSymbolSfx(symbolSfx);
}
/**
* Message field getter.
* @return field value
*/
@FIXVersion(introduced = "4.0", retired = "4.3")
@TagNumRef(tagNum = TagNum.SecurityID)
public String getSecurityID() {
return getSafeInstrument().getSecurityID();
}
/**
* Message field setter.
* @param securityID field value
*/
@FIXVersion(introduced = "4.0", retired = "4.3")
@TagNumRef(tagNum = TagNum.SecurityID)
public void setSecurityID(String securityID) {
getSafeInstrument().setSecurityID(securityID);
}
/**
* Message field getter.
* @return field value
*/
@FIXVersion(introduced = "4.0", retired = "4.3")
@TagNumRef(tagNum = TagNum.SecurityIDSource)
public String getSecurityIDSource() {
return getSafeInstrument().getSecurityIDSource();
}
/**
* Message field setter.
* @param securityIDSource field value
*/
@FIXVersion(introduced = "4.0", retired = "4.3")
@TagNumRef(tagNum = TagNum.SecurityIDSource)
public void setSecurityIDSource(String securityIDSource) {
getSafeInstrument().setSecurityIDSource(securityIDSource);
}
/**
* Message field getter.
* @return field value
*/
@FIXVersion(introduced = "4.1", retired = "4.3")
@TagNumRef(tagNum = TagNum.SecurityType)
public String getSecurityType() {
return getSafeInstrument().getSecurityType();
}
/**
* Message field setter.
* @param securityType field value
*/
@FIXVersion(introduced = "4.1", retired = "4.3")
@TagNumRef(tagNum = TagNum.SecurityType)
public void setSecurityType(String securityType) {
getSafeInstrument().setSecurityType(securityType);
}
/**
* Message field getter.
* @return field value
*/
@FIXVersion(introduced = "4.1", retired = "4.3")
@TagNumRef(tagNum = TagNum.MaturityMonthYear)
public String getMaturityMonthYear() {
return getSafeInstrument().getMaturityMonthYear();
}
/**
* Message field setter.
* @param maturityMonthYear field value
*/
@FIXVersion(introduced = "4.1", retired = "4.3")
@TagNumRef(tagNum = TagNum.MaturityMonthYear)
public void setMaturityMonthYear(String maturityMonthYear) {
getSafeInstrument().setMaturityMonthYear(maturityMonthYear);
}
/**
* Message field getter.
* @return field value
*/
@FIXVersion(introduced = "4.1", retired = "4.3")
@TagNumRef(tagNum = TagNum.MaturityDay)
public Integer getMaturityDay() {
throw new UnsupportedOperationException(getUnsupportedTagMessage());
}
/**
* Message field setter.
* @param maturityDay field value
*/
@FIXVersion(introduced = "4.1", retired = "4.3")
@TagNumRef(tagNum = TagNum.MaturityDay)
public void setMaturityDay(Integer maturityDay) {
throw new UnsupportedOperationException(getUnsupportedTagMessage());
}
/**
* Message field getter.
* @return field value
*/
@FIXVersion(introduced = "4.1", retired = "4.3")
@TagNumRef(tagNum = TagNum.PutOrCall)
public PutOrCall getPutOrCall() {
return getSafeInstrument().getPutOrCall();
}
/**
* Message field setter.
* @param putOrCall field value
*/
@FIXVersion(introduced = "4.1", retired = "4.3")
@TagNumRef(tagNum = TagNum.PutOrCall)
public void setPutOrCall(PutOrCall putOrCall) {
getSafeInstrument().setPutOrCall(putOrCall);
}
/**
* Message field getter.
* @return field value
*/
@FIXVersion(introduced = "4.1", retired = "4.3")
@TagNumRef(tagNum = TagNum.StrikePrice)
public Double getStrikePrice() {
return getSafeInstrument().getStrikePrice();
}
/**
* Message field setter.
* @param strikePrice field value
*/
@FIXVersion(introduced = "4.1", retired = "4.3")
@TagNumRef(tagNum = TagNum.StrikePrice)
public void setStrikePrice(Double strikePrice) {
getSafeInstrument().setStrikePrice(strikePrice);
}
/**
* Message field getter.
* @return field value
*/
@FIXVersion(introduced = "4.2", retired = "4.3")
@TagNumRef(tagNum = TagNum.ContractMultiplier)
public Double getContractMultiplier() {
return getSafeInstrument().getContractMultiplier();
}
/**
* Message field setter.
* @param contractMultiplier field value
*/
@FIXVersion(introduced = "4.2", retired = "4.3")
@TagNumRef(tagNum = TagNum.ContractMultiplier)
public void setContractMultiplier(Double contractMultiplier) {
getSafeInstrument().setContractMultiplier(contractMultiplier);
}
/**
* Message field getter.
* @return field value
*/
@FIXVersion(introduced = "4.2", retired = "4.3")
@TagNumRef(tagNum = TagNum.CouponRate)
public Double getCouponRate() {
return getSafeInstrument().getCouponRate();
}
/**
* Message field setter.
* @param couponRate field value
*/
@FIXVersion(introduced = "4.2", retired = "4.3")
@TagNumRef(tagNum = TagNum.CouponRate)
public void setCouponRate(Double couponRate) {
getSafeInstrument().setCouponRate(couponRate);
}
/**
* Message field getter.
* @return field value
*/
@FIXVersion(introduced = "4.1", retired = "4.3")
@TagNumRef(tagNum = TagNum.OptAttribute)
public Character getOptAttribute() {
return getSafeInstrument().getOptAttribute();
}
/**
* Message field setter.
* @param optAttribute field value
*/
@FIXVersion(introduced = "4.1", retired = "4.3")
@TagNumRef(tagNum = TagNum.OptAttribute)
public void setOptAttribute(Character optAttribute) {
getSafeInstrument().setOptAttribute(optAttribute);
}
/**
* Message field getter.
* @return field value
*/
@FIXVersion(introduced = "4.1", retired = "4.3")
@TagNumRef(tagNum = TagNum.SecurityExchange)
public String getSecurityExchange() {
return getSafeInstrument().getSecurityExchange();
}
/**
* Message field setter.
* @param securityExchange field value
*/
@FIXVersion(introduced = "4.1", retired = "4.3")
@TagNumRef(tagNum = TagNum.SecurityExchange)
public void setSecurityExchange(String securityExchange) {
getSafeInstrument().setSecurityExchange(securityExchange);
}
/**
* Message field getter.
* @return field value
*/
@FIXVersion(introduced = "4.0", retired = "4.3")
@TagNumRef(tagNum = TagNum.Issuer)
public String getIssuer() {
return getSafeInstrument().getIssuer();
}
/**
* Message field setter.
* @param issuer field value
*/
@FIXVersion(introduced = "4.0", retired = "4.3")
@TagNumRef(tagNum = TagNum.Issuer)
public void setIssuer(String issuer) {
getSafeInstrument().setIssuer(issuer);
}
/**
* Message field getter.
* @return field value
*/
@FIXVersion(introduced = "4.2", retired = "4.3")
@TagNumRef(tagNum = TagNum.EncodedIssuerLen)
public Integer getEncodedIssuerLen() {
return getSafeInstrument().getEncodedIssuerLen();
}
/**
* Message field setter.
* @param encodedIssuerLen field value
*/
@FIXVersion(introduced = "4.2", retired = "4.3")
@TagNumRef(tagNum = TagNum.EncodedIssuerLen)
public void setEncodedIssuerLen(Integer encodedIssuerLen) {
getSafeInstrument().setEncodedIssuerLen(encodedIssuerLen);
}
/**
* Message field getter.
* @return field value
*/
@FIXVersion(introduced = "4.2", retired = "4.3")
@TagNumRef(tagNum = TagNum.EncodedIssuer)
public byte[] getEncodedIssuer() {
return getSafeInstrument().getEncodedIssuer();
}
/**
* Message field setter.
* @param encodedIssuer field value
*/
@FIXVersion(introduced = "4.2", retired = "4.3")
@TagNumRef(tagNum = TagNum.EncodedIssuer)
public void setEncodedIssuer(byte[] encodedIssuer) {
getSafeInstrument().setEncodedIssuer(encodedIssuer);
}
/**
* Message field getter.
* @return field value
*/
@FIXVersion(introduced = "4.0", retired = "4.3")
@TagNumRef(tagNum = TagNum.SecurityDesc)
public String getSecurityDesc() {
return getSafeInstrument().getSecurityDesc();
}
/**
* Message field setter.
* @param securityDesc field value
*/
@FIXVersion(introduced = "4.0", retired = "4.3")
@TagNumRef(tagNum = TagNum.SecurityDesc)
public void setSecurityDesc(String securityDesc) {
getSafeInstrument().setSecurityDesc(securityDesc);
}
/**
* Message field getter.
* @return field value
*/
@FIXVersion(introduced = "4.2", retired = "4.3")
@TagNumRef(tagNum = TagNum.EncodedSecurityDescLen)
public Integer getEncodedSecurityDescLen() {
return getSafeInstrument().getEncodedSecurityDescLen();
}
/**
* Message field setter.
* @param encodedSecurityDescLen field value
*/
@FIXVersion(introduced = "4.2", retired = "4.3")
@TagNumRef(tagNum = TagNum.EncodedSecurityDescLen)
public void setEncodedSecurityDescLen(Integer encodedSecurityDescLen) {
getSafeInstrument().setEncodedSecurityDescLen(encodedSecurityDescLen);
}
/**
* Message field getter.
* @return field value
*/
@FIXVersion(introduced = "4.2", retired = "4.3")
@TagNumRef(tagNum = TagNum.EncodedSecurityDesc)
public byte[] getEncodedSecurityDesc() {
return getSafeInstrument().getEncodedSecurityDesc();
}
/**
* Message field setter.
* @param encodedSecurityDesc field value
*/
@FIXVersion(introduced = "4.2", retired = "4.3")
@TagNumRef(tagNum = TagNum.EncodedSecurityDesc)
public void setEncodedSecurityDesc(byte[] encodedSecurityDesc) {
getSafeInstrument().setEncodedSecurityDesc(encodedSecurityDesc);
}
/**
* Message field getter.
* @return field value
*/
@FIXVersion(introduced="4.0")
@TagNumRef(tagNum=TagNum.Side, required = true)
public Side getSide() {
return side;
}
/**
* Message field setter.
* @param side field value
*/
@FIXVersion(introduced="4.0")
@TagNumRef(tagNum=TagNum.Side, required = true)
public void setSide(Side side) {
this.side = side;
}
// </editor-fold>
// <editor-fold defaultstate="collapsed" desc="Protected Methods">
@Override
protected void validateRequiredTags() throws TagNotPresentException {
StringBuilder errorMsg = new StringBuilder("Tag value(s) for");
boolean hasMissingTag = false;
if (clOrdID == null || clOrdID.trim().isEmpty()) {
errorMsg.append(" [ClOrdID]");
hasMissingTag = true;
}
if (instrument == null || instrument.getSymbol() == null || instrument.getSymbol().trim().isEmpty()) {
errorMsg.append(" [Symbol]");
hasMissingTag = true;
}
if (side == null) {
errorMsg.append(" [Side]");
hasMissingTag = true;
}
errorMsg.append(" is missing.");
if (hasMissingTag) {
throw new TagNotPresentException(errorMsg.toString());
}
}
@Override
protected byte[] encodeFragmentAll() throws TagNotPresentException, BadFormatMsgException {
if (validateRequired) {
validateRequiredTags();
}
byte[] result = new byte[0];
ByteArrayOutputStream bao = new ByteArrayOutputStream();
try {
TagEncoder.encode(bao, TagNum.OrderID, orderID);
TagEncoder.encode(bao, TagNum.ClOrdID, clOrdID);
TagEncoder.encode(bao, TagNum.SecondaryClOrdID, secondaryClOrdID);
TagEncoder.encode(bao, TagNum.ClOrdLinkID, clOrdLinkID);
if (parties != null) {
bao.write(parties.encode(MsgSecureType.ALL_FIELDS));
}
TagEncoder.encode(bao, TagNum.OrdStatusReqID, ordStatusReqID);
TagEncoder.encode(bao, TagNum.ClientID, clientID);
TagEncoder.encode(bao, TagNum.ExecBroker, execBroker);
TagEncoder.encode(bao, TagNum.Account, account);
if (acctIDSource != null) {
TagEncoder.encode(bao, TagNum.AcctIDSource, acctIDSource.getValue());
}
if (instrument != null) {
bao.write(instrument.encode(MsgSecureType.ALL_FIELDS));
}
if (financingDetails != null) {
bao.write(financingDetails.encode(MsgSecureType.ALL_FIELDS));
}
if (noUnderlyings != null) {
TagEncoder.encode(bao, TagNum.NoUnderlyings, noUnderlyings);
if (underlyingInstruments != null && underlyingInstruments.length == noUnderlyings.intValue()) {
for (int i = 0; i < noUnderlyings.intValue(); i++) {
if (underlyingInstruments[i] != null) {
bao.write(underlyingInstruments[i].encode(MsgSecureType.ALL_FIELDS));
}
}
} else {
String error = "UnderlyingInstrument field has been set but there is no data or the number of groups does not match.";
LOGGER.severe(error);
throw new BadFormatMsgException(SessionRejectReason.IncorrectCountForGroups, getHeader().getMsgType(),
TagNum.NoUnderlyings.getValue(), error);
}
}
TagEncoder.encode(bao, TagNum.Symbol, symbol);
TagEncoder.encode(bao, TagNum.SymbolSfx, symbolSfx);
TagEncoder.encode(bao, TagNum.SecurityID, securityID);
TagEncoder.encode(bao, TagNum.SecurityIDSource, securityIDSource);
TagEncoder.encode(bao, TagNum.SecurityType, securityType);
TagEncoder.encode(bao, TagNum.MaturityMonthYear, maturityMonthYear);
TagEncoder.encode(bao, TagNum.MaturityDay, maturityDay);
if (putOrCall != null) {
TagEncoder.encode(bao, TagNum.PutOrCall, putOrCall.getValue());
}
TagEncoder.encode(bao, TagNum.StrikePrice, strikePrice);
TagEncoder.encode(bao, TagNum.OptAttribute, optAttribute);
TagEncoder.encode(bao, TagNum.ContractMultiplier, contractMultiplier);
TagEncoder.encode(bao, TagNum.CouponRate, couponRate);
TagEncoder.encode(bao, TagNum.SecurityExchange, securityExchange);
TagEncoder.encode(bao, TagNum.Issuer, issuer);
if (encodedIssuerLen != null && encodedIssuerLen.intValue() > 0) {
if (encodedIssuer != null && encodedIssuer.length > 0) {
encodedIssuerLen = new Integer(encodedIssuer.length);
TagEncoder.encode(bao, TagNum.EncodedIssuerLen, encodedIssuerLen);
TagEncoder.encode(bao, TagNum.EncodedIssuer, encodedIssuer);
}
}
TagEncoder.encode(bao, TagNum.SecurityDesc, securityDesc, sessionCharset);
if (encodedSecurityDescLen != null && encodedSecurityDescLen.intValue() > 0) {
if (encodedSecurityDesc != null && encodedSecurityDesc.length > 0) {
encodedSecurityDescLen = new Integer(encodedSecurityDesc.length);
TagEncoder.encode(bao, TagNum.EncodedSecurityDescLen, encodedSecurityDescLen);
TagEncoder.encode(bao, TagNum.EncodedSecurityDesc, encodedSecurityDesc);
}
}
if (side != null) {
TagEncoder.encode(bao, TagNum.Side, side.getValue());
}
result = bao.toByteArray();
} catch (IOException ex) {
String error = "Error writing to the byte array.";
LOGGER.log(Level.SEVERE, "{0} Error was : {1}", new Object[] { error, ex.toString() });
throw new BadFormatMsgException(error, ex);
}
return result;
}
@Override
protected byte[] encodeFragmentSecured(boolean secured) throws TagNotPresentException, BadFormatMsgException {
if (secured) {
return new byte[0];
} else {
return encodeFragmentAll();
}
}
@Override
protected void setFragmentTagValue(Tag tag) throws BadFormatMsgException {
TagNum tagNum = TagNum.fromString(tag.tagNum);
switch (tagNum) {
case OrderID:
orderID = new String(tag.value, sessionCharset);
break;
case ClOrdID:
clOrdID = new String(tag.value, sessionCharset);
break;
case SecondaryClOrdID:
secondaryClOrdID = new String(tag.value, sessionCharset);
break;
case ClOrdLinkID:
clOrdLinkID = new String(tag.value, sessionCharset);
break;
case OrdStatusReqID:
ordStatusReqID = new String(tag.value, sessionCharset);
break;
case Account:
account = new String(tag.value, sessionCharset);
break;
case ClientID:
clientID = new String(tag.value, sessionCharset);
break;
case ExecBroker:
execBroker = new String(tag.value, sessionCharset);
break;
case AcctIDSource:
acctIDSource = AcctIDSource.valueFor(Integer.valueOf(new String(tag.value, sessionCharset)));
break;
case NoUnderlyings:
noUnderlyings = new Integer(new String(tag.value, sessionCharset));
break;
case Symbol:
symbol = new String(tag.value, sessionCharset);
break;
case SymbolSfx:
symbolSfx = new String(tag.value, sessionCharset);
break;
case SecurityID:
securityID = new String(tag.value, sessionCharset);
break;
case SecurityIDSource:
securityIDSource = new String(tag.value, sessionCharset);
break;
case SecurityType:
securityType = new String(tag.value, sessionCharset);
break;
case MaturityMonthYear:
maturityMonthYear = new String(tag.value, sessionCharset);
break;
case MaturityDay:
maturityDay = new Integer(new String(tag.value, sessionCharset));
break;
case PutOrCall:
putOrCall = PutOrCall.valueFor(Integer.valueOf(new String(tag.value, sessionCharset)));
break;
case StrikePrice:
strikePrice = new Double(new String(tag.value, sessionCharset));
break;
case OptAttribute:
optAttribute = new Character(new String(tag.value, sessionCharset).charAt(0));
break;
case ContractMultiplier:
contractMultiplier = new Double(new String(tag.value, sessionCharset));
break;
case CouponRate:
couponRate = new Double(new String(tag.value, sessionCharset));
break;
case SecurityExchange:
securityExchange = new String(tag.value, sessionCharset);
break;
case Issuer:
issuer = new String(tag.value, sessionCharset);
break;
case EncodedIssuerLen:
encodedIssuerLen = new Integer(new String(tag.value, sessionCharset));
break;
case SecurityDesc:
securityDesc = new String(tag.value, sessionCharset);
break;
case EncodedSecurityDescLen:
encodedSecurityDescLen = new Integer(new String(tag.value, sessionCharset));
break;
case Side:
side = Side.valueFor((new String(tag.value, sessionCharset).charAt(0)));
break;
default:
String error = "Tag value [" + tag.tagNum + "] not present in [OrderStatusRequestMsg] fields.";
LOGGER.severe(error);
throw new BadFormatMsgException(SessionRejectReason.InvalidTagNumber, getHeader().getMsgType(),
tag.tagNum, error);
}
}
@Override
protected ByteBuffer setFragmentDataTagValue(Tag tag, ByteBuffer message) throws BadFormatMsgException {
return message;
}
@Override
protected Set<Integer> getFragmentDataTags() {
return START_DATA_TAGS;
}
// </editor-fold>
// <editor-fold defaultstate="collapsed" desc="Package Methods">
// </editor-fold>
// <editor-fold defaultstate="collapsed" desc="Private Methods">
private Instrument getSafeInstrument() {
if (getInstrument() == null) {
setInstrument();
}
return getInstrument();
}
// </editor-fold>
// <editor-fold defaultstate="collapsed" desc="Inner Classes">
// </editor-fold>
// <editor-fold defaultstate="collapsed" desc="toString()">
@Override
public String toString() {
StringBuilder b = new StringBuilder("{OrderStatusRequestMsg=");
b.append(header != null ? header.toString() : "");
b.append(System.getProperty("line.separator")).append("{Body=");
printTagValue(b, TagNum.OrderID, orderID);
printTagValue(b, TagNum.ClOrdID, clOrdID);
printTagValue(b, TagNum.SecondaryClOrdID, secondaryClOrdID);
printTagValue(b, TagNum.ClOrdLinkID, clOrdLinkID);
printTagValue(b, parties);
printTagValue(b, TagNum.OrdStatusReqID, ordStatusReqID);
printTagValue(b, TagNum.ClientID, clientID);
printTagValue(b, TagNum.ExecBroker, execBroker);
printTagValue(b, TagNum.Account, account);
printTagValue(b, TagNum.AcctIDSource, acctIDSource);
printTagValue(b, instrument);
printTagValue(b, financingDetails);
printTagValue(b, TagNum.NoUnderlyings, noUnderlyings);
printTagValue(b, underlyingInstruments);
printTagValue(b, TagNum.Symbol, symbol);
printTagValue(b, TagNum.SymbolSfx, symbolSfx);
printTagValue(b, TagNum.SecurityID, securityID);
printTagValue(b, TagNum.SecurityIDSource, securityIDSource);
printTagValue(b, TagNum.SecurityType, securityType);
printTagValue(b, TagNum.MaturityMonthYear, maturityMonthYear);
printTagValue(b, TagNum.MaturityDay, maturityDay);
printTagValue(b, TagNum.PutOrCall, putOrCall);
printTagValue(b, TagNum.StrikePrice, strikePrice);
printTagValue(b, TagNum.ContractMultiplier, contractMultiplier);
printTagValue(b, TagNum.CouponRate, couponRate);
printTagValue(b, TagNum.OptAttribute, optAttribute);
printTagValue(b, TagNum.SecurityExchange, securityExchange);
printTagValue(b, TagNum.Issuer, issuer);
printTagValue(b, TagNum.EncodedIssuerLen, encodedIssuerLen);
printTagValue(b, TagNum.EncodedIssuer, encodedIssuer);
printTagValue(b, TagNum.SecurityDesc, securityDesc);
printTagValue(b, TagNum.EncodedSecurityDescLen, encodedSecurityDescLen);
printTagValue(b, TagNum.EncodedSecurityDesc, encodedSecurityDesc);
printTagValue(b, TagNum.Side, side);
b.append("}");
b.append(trailer != null ? trailer.toString() : "").append("}");
return b.toString();
}
// </editor-fold>
}
| marvisan/HadesFIX | Model/src/main/java/net/hades/fix/message/OrderStatusRequestMsg.java | Java | gpl-3.0 | 41,851 |
/******************************************************************************
*******************************************************************************
*******************************************************************************
libferris
Copyright (C) 2001 Ben Martin
libferris is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
libferris 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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with libferris. If not, see <http://www.gnu.org/licenses/>.
For more details see the COPYING file in the root directory of this
distribution.
$Id: FilteredContext_private.hh,v 1.7 2010/09/24 21:30:50 ben Exp $
*******************************************************************************
*******************************************************************************
******************************************************************************/
#ifndef _ALREADY_INCLUDED_FILTERED_CONTEXT_PRIVATE_HH_
#define _ALREADY_INCLUDED_FILTERED_CONTEXT_PRIVATE_HH_
#include <Ferris/HiddenSymbolSupport.hh>
#include <Ferris/Ferris.hh>
#include <Ferris/FilteredContext.hh>
#include <Ferris/ChainedViewContext.hh>
namespace Ferris
{
FERRISEXP_API std::string guessComparisonOperatorFromData( const std::string& val );
/*
* A context view that applies a matcher object to all items in the view.
* Items must pass the matcher to be presented via this view.
*/
class FERRISEXP_API FilteredContext
:
public ChainedViewContext
{
typedef FilteredContext _Self;
typedef ChainedViewContext _Base;
fh_matcher Matcher;
struct filteringInsertContextCreator
{
fh_context m_ctx;
fh_matcher m_matcher;
filteringInsertContextCreator( const fh_context& ctx, fh_matcher matcher );
FilteredContext* create( Context* parent, const std::string& rdn ) const;
void setupExisting( FilteredContext* fc ) const;
void setupNew( FilteredContext* fc ) const;
};
void setupState( const fh_context& ctx, fh_matcher m );
FilteredContext( Context* theParent, const fh_context& ctx, fh_matcher matcher );
virtual void UnPageSubContextsIfNeeded();
public:
FilteredContext( const fh_context& ctx, fh_matcher matcher );
virtual ~FilteredContext();
virtual void OnDeleted( NamingEvent_Deleted* ev, std::string olddn, std::string newdn );
virtual void OnExists ( NamingEvent_Exists* ev,
const fh_context& subc,
std::string olddn, std::string newdn );
virtual void OnCreated( NamingEvent_Created* ev,
const fh_context& subc,
std::string olddn, std::string newdn );
void filteringInsertContext( const fh_context& c, bool created = false );
virtual void read( bool force = 0 );
void populateFromDelegate();
// Setup is only to be called from the below function!
void setup();
protected:
virtual Context* priv_CreateContext( Context* parent, std::string rdn );
/********************************************************************************/
/********************************************************************************/
/********************************************************************************/
/*** Handle ability to have local attributes aswell as those of delegate ********/
/********************************************************************************/
int getNumberOfLocalAttributes();
std::list< std::string >& getLocalAttributeNames();
virtual std::string private_getStrAttr( const std::string& rdn,
const std::string& def = "",
bool getAllLines = false ,
bool throwEx = false );
public:
virtual fh_attribute getAttribute( const std::string& rdn ) throw( NoSuchAttribute );
virtual AttributeNames_t& getAttributeNames( AttributeNames_t& ret );
virtual int getAttributeCount();
virtual bool isAttributeBound( const std::string& rdn,
bool createIfNotThere = true
) throw( NoSuchAttribute );
};
namespace FilteredContextNameSpace
{
extern const std::string EqualsToken;
extern const std::string TypeSafeEqualsToken;
extern const std::string ReEqualsToken;
extern const std::string GrEqualsToken;
extern const std::string TypeSafeGrEqualsToken;
extern const std::string LtEqualsToken;
extern const std::string TypeSafeLtEqualsToken;
extern const std::string GrEqualsTokenFloatingPoint;
extern const std::string LtEqualsTokenFloatingPoint;
extern const std::string EndsWithToken;
extern const std::string NotToken;
extern const std::string AndToken;
extern const std::string OrToken;
};
};
#endif
| monkeyiq/ferris | Ferris/FilteredContext_private.hh | C++ | gpl-3.0 | 5,700 |
// modified by Luigi Auriemma
//
// HSTEST.C
// this is a little demo & test programm for the kombination
// sliding directory & huffman compression
// the real kompression is done using a sliding directory mechanism pack(),
// which will eventually be farther compressed using a modified huffman
// method which takes some time as well, is currently not very efficient
// implemented, but may be used if space is really important,
// the first method should be chosen if the unpack time is of importance
// unpack(), written in assembler for speed reasons roughly decompresses
// some 25 KByte / Landmark or 1 MB on a 25 MHz 386 maschine
//
// warning : the code is not yet clean for byte ordering, it will work
// only on one type of maschine, the compressed files are probable not
// (yet) portable
//
/*
program name : HSTEST
program author : tom ehlert
post address : SIG m.b.H
tom ehlert
bachstrasse 22
D-5100 aachen / germany
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define ONLY_ON_80x86
#define far
#define _loadds
#ifndef _fastcall
#define _fastcall
#endif
#define STATIC
#define MIN_LENGTH 3 /* minimum to be compressed */
#define MAXCODELENGTH 0x0f
#define SENDLEN 0xfff /* MUST BE 00001111111 */
typedef unsigned char uchar;
void *ck_alloc(unsigned int len)
{
void *calloc(),*s;
if ((s = calloc(len,1)) == NULL)
//panic("can't allocate memory");
return(NULL);
return(s);
}
typedef struct huff_tab {
int count;
int bitcnt;
struct huff_tab *lpt,*rpt;
} huff_tab;
typedef struct huff_code {
unsigned bitcode;
uchar bitcnt;
} huff_code;
typedef struct huff_icode {
uchar bitcode;
uchar bitcnt;
} huff_icode;
STATIC void _fastcall addbit(huff_tab *cpt);
STATIC void _fastcall bit_write(register unsigned value,register int length);
STATIC unsigned short _fastcall bit_read(register int length);
STATIC unsigned short _fastcall huff_read(huff_icode *icode,int maxbit);
/**
*** generate Huffman codes for every character
**/
//**********************************************************************
// generate from huff_tab a field bitlength which holds the best bitlength
// for each character. allthough it would be possible to generate codes
// at the same time this has been avoided to make it easier usable when
// the data are read back
//**********************************************************************
STATIC void gen_code(huff_code *hufftab,uchar *bitlength,int charset)
{
register int loop,bitmask,first,lastcode,length;
for (loop = 0; loop < charset;loop++)
{
hufftab[loop].bitcnt = bitlength[loop];
hufftab[loop].bitcode = 0xffff;
}
lastcode = 0;
bitmask = 1;
first = 1;
for (length = 16; length >= 1; length--,bitmask <<= 1)
for (loop = 0; loop < charset;loop++)
{
if (hufftab[loop].bitcnt == length)
{
if (!first)
{
lastcode += bitmask;
}
first = 0;
hufftab[loop].bitcode = lastcode & ~(0xffff >> length);
}
}
}
STATIC void gen_invtab(huff_icode *inv,huff_code *tab,int charset,int max_bit)
{
register int loop,ival,ianz,bitcnt;
for (loop = 0; loop < charset; loop++)
{
ival = tab[loop].bitcode >> (16-max_bit);
if ((bitcnt = tab[loop].bitcnt) == 0)
continue;
ianz = 1 << (max_bit-tab[loop].bitcnt);
for ( ; --ianz >= 0;ival++)
{
inv[ival].bitcode = loop;
inv[ival].bitcnt = bitcnt;
}
}
}
#define HIGH_BIT 16
unsigned short bit_value = 0;
unsigned short far *bit_ptr = NULL;
unsigned int bit_drin= 0;
#define dbrange(x) 0 // ((x) >= 0x1b0 && (x) <= 0x1d0)
STATIC void bit_flush(void)
{
if (bit_drin)
*bit_ptr++ = bit_value;
}
STATIC void bit_init(void far *ptr)
{
bit_ptr = ptr;
bit_drin = 0;
bit_value = 0;
}
STATIC void _fastcall bit_write(register unsigned value,register int length)
{
int fits = HIGH_BIT - bit_drin;
if (length <= fits)
{
*bit_ptr |= value >> bit_drin;
if (length == fits)
{
*bit_ptr++ = bit_value | (value >> bit_drin);
bit_drin = 0;
bit_value = 0;
}
else
{
bit_value |= value >> bit_drin;
bit_drin+=length;
}
}
else
{
*bit_ptr++ = bit_value | (value >> (HIGH_BIT-fits));
bit_value = value <<= fits;
bit_drin = length-fits;
}
}
STATIC unsigned short _fastcall bit_read(register int maxbit)
{
register unsigned value;
if (maxbit <= HIGH_BIT-bit_drin)
{
value = (*bit_ptr << bit_drin) >> (HIGH_BIT-maxbit);
}
else {
value = ((bit_ptr[0] << bit_drin) | (bit_ptr[1] >> (HIGH_BIT-bit_drin)))
>> (HIGH_BIT-maxbit);
}
if ((bit_drin += maxbit) >= HIGH_BIT)
bit_drin -= HIGH_BIT,bit_ptr++;
return value;
}
STATIC unsigned short _fastcall huff_read(huff_icode *icode,int maxbit)
{
//register int loop,value;unsigned int lmask,*lptr;
register int value;
if (maxbit <= HIGH_BIT-bit_drin)
{
value = (*bit_ptr << bit_drin) >> (HIGH_BIT-maxbit);
}
else {
value = ((bit_ptr[0] << bit_drin) | (bit_ptr[1] >> (HIGH_BIT-bit_drin)))
>> (HIGH_BIT-maxbit);
}
if ((bit_drin += icode[value].bitcnt) >= HIGH_BIT)
bit_drin -= HIGH_BIT,bit_ptr++;
return icode[value].bitcode;
}
//****************************************************************************
// reading / writing characterset bitcounts
// 0) write no characterset at all
// 1) write number of characters (4 Bits) with number of bits (4 Bits) PKZIP
// 2) write for each character number of bits (4 Bits)
// 3) set bitval to 0;
// while (bitval < bitcnt) write (0x10,2)
// while (bitval > bitcnt) write (0x11,2)
// write (0,1)
// 4) if (bitval OK) write (0,1)
// else write (1,1),write (number of Bits,4)
//****************************************************************************
unsigned bit_write_method = 0;
int write_cnt0(register uchar *bitlength,int charset,unsigned short test)
{
return 0;
}
void read_cnt0(register uchar *bitlength,int charset)
{
int mask,bits;
for (bits = 0,mask = 1;mask < charset ; mask <<= 1)
bits++;
memset(bitlength,bits,charset);
}
//****************************************************************************
int write_cnt1(register uchar *bitlength,int charset,unsigned short test)
{
register int needed,loop,id;
for (id = 0,loop=0,needed=0; loop < charset;loop++,bitlength++)
{
if (bitlength[0] == bitlength[1] && id < 15 && loop < charset-1)
id++;
else
{
if (test) bit_write(((bitlength[0] << 4) | id) << 8,8);
id = 0;
needed++;
}
}
return needed;
}
void read_cnt1(uchar *bitlength,int charset)
{
register int id,val;
do {
id = bit_read(8);
val = id >> 4;
id &= 0x0f;
do {
*bitlength++ = val;
charset--;
} while (--id >= 0);
} while (charset > 0);
}
//****************************************************************************
int write_cnt2(register uchar *bitlength,int charset,unsigned short test)
{
if (!test)
return charset/2;
do {
bit_write(*bitlength<<(HIGH_BIT-4),4); // 4 Bit
bitlength++;
} while (--charset);
return(1); //???
}
void read_cnt2(register uchar *bitlength,int charset)
{
do {
*bitlength++ = bit_read(4); // 4 Bit
} while (--charset);
}
//****************************************************************************
int write_cnt3(register uchar *bitlength,int charset,unsigned short test)
{
register int needed,loop,bitval;
for (bitval = 0,loop=0,needed=0; loop < charset;loop++,bitlength++)
{
while (bitval > bitlength[0])
{
bitval--,needed+=2;
if (test)
bit_write(0x01 << (HIGH_BIT-2),2);
}
while (bitval < bitlength[0])
{
bitval++,needed+=2;
if (test)
bit_write(0x00 << (HIGH_BIT-2),2);
}
if (test)
bit_write(0x1 << (HIGH_BIT-1),1);
needed++;
}
return (needed+7)/8;
}
void read_cnt3(register uchar *bitlength,int charset)
{
register int bitval;
for (bitval = 0; --charset >= 0;)
{
while (bit_read(1) == 0)
if (bit_read(1))
bitval--;
else
bitval++;
*bitlength++ = bitval;
}
}
//****************************************************************************
int write_cnt4(register uchar *bitlength,int charset,unsigned short test)
{
register int needed,bitval;
for (bitval = 0,needed=0; --charset >= 0;bitlength++)
{
if (bitval != bitlength[0])
{
bitval = bitlength[0],needed+=5;
if (test)
{
bit_write(1 << (HIGH_BIT-1),1);
bit_write( bitlength[0] << (HIGH_BIT-4),4);
}
}
else
{
if (test)
bit_write(0 << (HIGH_BIT-1),1);
needed++;
}
}
return (needed+7)/8;
}
void read_cnt4(register uchar *bitlength,int charset)
{
register int bitval;
for (bitval = 0; --charset >= 0;bitlength++)
{
if (bit_read(1))
bitval = bit_read(4);
*bitlength = bitval;
}
}
//****************************************************************************
typedef int (*wrf)(register uchar *,int,unsigned short);
typedef void (*rdf)(register uchar *,int);
wrf write_fun[] = { write_cnt0,write_cnt1,write_cnt2,write_cnt3,write_cnt4};
rdf read_fun[] = { read_cnt0, read_cnt1, read_cnt2, read_cnt3, read_cnt4};
#define LITLEN 256 // characterset for literal characters
#define LENLEN 16 // characterset for length 0..15
#define INDLEN (4096 >> INDSHIFT) // characterset for index = (0..4096) >> 4
#define MASLEN 256 // characterset for packmask
#define EXTLEN 256 // characterset for extended length
#define INDSHIFT 4
#define INDMASK 0x0f
#define LIT_MAX 12 // MAXIMUM needed bits for each charset
#define IND_MAX 11
#define LEN_MAX 7
#define MAS_MAX 11
#define EXT_MAX 11
#define LIT_FLAG 0
#define IND_FLAG 3
#define LEN_FLAG 6
#define MAS_FLAG 9
#define EXT_FLAG 12
unsigned short do_huff = 0;
huff_icode *hs_rd_code(int charset,int maxbit,unsigned short flatlen,int do_flag)
{
uchar *bitlength;
huff_code *code;
huff_icode *icode;
//register int loop;
bitlength = ck_alloc(charset);
if(!bitlength) return(NULL);
(*read_fun[(do_huff >> do_flag) & 0x07])(bitlength,charset);
code = ck_alloc(charset*sizeof(huff_code));
if(!code) return(NULL);
gen_code(code,bitlength,charset);
free(bitlength);
icode = ck_alloc((1<<maxbit)*sizeof(huff_icode));
if(!icode) return(NULL);
gen_invtab(icode,code,charset,maxbit);
free(code);
return icode;
}
int hstest_hs_unpack(uchar far *ubuffer,uchar far *hbuffer,unsigned short packlen)
{
huff_icode *lit_icode,*len_icode,*ind_icode,*mas_icode,*ext_icode;
register int uloop;
register uchar packmask=0;
int length;unsigned index;
uchar far *sbuffer = ubuffer;
do_huff = ((short far *)hbuffer)[0];
packlen = ((short far *)hbuffer)[1];
bit_init(hbuffer+4);
lit_icode = hs_rd_code(LITLEN,LIT_MAX,8,LIT_FLAG);
if(!lit_icode) return(-1);
ind_icode = hs_rd_code(INDLEN,IND_MAX,8,IND_FLAG);
if(!ind_icode) return(-1);
len_icode = hs_rd_code(LENLEN,LEN_MAX,4,LEN_FLAG);
if(!len_icode) return(-1);
mas_icode = hs_rd_code(MASLEN,MAS_MAX,8,MAS_FLAG);
if(!mas_icode) return(-1);
ext_icode = hs_rd_code(EXTLEN,EXT_MAX,8,EXT_FLAG);
if(!ext_icode) return(-1);
for (uloop = 1;packlen > 0;packmask <<= 1)
{
if (--uloop == 0)
{
packmask = huff_read(mas_icode,MAS_MAX),packlen--;
uloop = 8;
}
if ((packmask & 0x80) == 0) /* this byte is literally */
{
*ubuffer++ = huff_read(lit_icode,LIT_MAX),packlen--;
}
else
{ /* next 2 bytes icoded */
length = huff_read(len_icode,LEN_MAX)+MIN_LENGTH;
index = huff_read(ind_icode,IND_MAX) << INDSHIFT;
index += bit_read(INDSHIFT);
if (length == MAXCODELENGTH+MIN_LENGTH) /* length > 18 */
{ /* use next byte for length*/
length = huff_read(ext_icode,EXT_MAX); /* icode is 3 bytes */
packlen -= 3;
}
else {
packlen -= 2;
}
/* copy BYTEWISE with OVERWRITE */
if (index == 1) // memcpy will not work as it copies WORDS
memset(ubuffer,*(ubuffer-1),length);
else
memcpy(ubuffer,ubuffer-index,length);
ubuffer += length;
}
}
free(lit_icode);
free(ind_icode);
free(len_icode);
free(mas_icode);
free(ext_icode);
return ubuffer-sbuffer;
}
int far _loadds hstest_unpackc(outbuffer,pbuffer,packlen)
uchar far *outbuffer;
uchar far *pbuffer;register int packlen;
{
register int uloop;
register uchar packmask=0;
int length;unsigned index;
uchar far *sbuffer = outbuffer;
for (uloop = 1;packlen > 0;packmask <<= 1)
{
if (--uloop == 0)
{
packmask = *pbuffer++,packlen--;
uloop = 8;
}
if ((packmask & 0x80) == 0) /* this byte is literally */
*outbuffer++ = *pbuffer++,packlen--;
else
{ /* next 2 bytes coded */
ONLY_ON_80x86;
index = *(int far *)pbuffer; /* 4 bit length */
length = (index >> 12) + MIN_LENGTH;/* 12 bit offset */
index &= SENDLEN;
if (length == MAXCODELENGTH+MIN_LENGTH) /* length > 18 */
{ /* use next byte for length*/
length = pbuffer[2]; /* code is 3 bytes */
pbuffer += 3;
packlen -= 3;
}
else {
packlen -= 2;
pbuffer += 2;
}
/* copy BYTEWISE with OVERWRITE */
if (index == 1) // memcpy will not work as it copies WORDS
memset(outbuffer,*(outbuffer-1),length);
else
memcpy(outbuffer,outbuffer-index,length);
outbuffer += length;
}
}
return outbuffer-sbuffer;
}
| Grumbel/rfactortools | other/quickbms/src/compression/hstest.c | C | gpl-3.0 | 13,347 |
// Copyright (c) 2015-2015 The swp Authors. All rights reserved.
// Created on: 2016年12月30日 Author: kerry
#include "trades/trades_logic.h"
#include "trades/schduler_engine.h"
#include "trades/trades_proto_buf.h"
#include "trades/trades_info.h"
#include "trades/errno.h"
#include "basic/native_library.h"
#include "trades/operator_code.h"
#include "config/config.h"
#include "core/common.h"
#include "logic/logic_comm.h"
#include "logic/logic_unit.h"
#include "net/errno.h"
#include <string>
#define DEFAULT_CONFIG_PATH "./plugins/trades/trades_config.xml"
#define TIME_DISTRIBUTION_TASK 10000
namespace trades_logic
{
Tradeslogic *Tradeslogic::instance_ = NULL;
Tradeslogic::Tradeslogic()
{
if (!Init())
assert(0);
}
Tradeslogic::~Tradeslogic()
{
if (trades_db_)
{
delete trades_db_;
trades_db_ = NULL;
}
if (trades_kafka_){
delete trades_kafka_;
trades_kafka_ = NULL;
}
trades_logic::TradesEngine::FreeSchdulerManager();
trades_logic::TradesEngine::FreeTradesEngine();
}
bool Tradeslogic::Init()
{
bool r = false;
manager_schduler::SchdulerEngine* (*schduler_engine)(void);
std::string path = DEFAULT_CONFIG_PATH;
config::FileConfig *config = config::FileConfig::GetFileConfig();
if (config == NULL)
return false;
r = config->LoadConfig(path);
LOG_MSG2("path : %s", path.c_str());
trades_logic::TradesEngine::GetSchdulerManager();
trades_db_ = new trades_logic::TradesDB(config);
trades_kafka_ = new trades_logic::TradesKafka(config);
trades_logic::TradesEngine::GetSchdulerManager()->InitDB(trades_db_);
trades_logic::TradesEngine::GetSchdulerManager()->InitKafka(trades_kafka_);
trades_logic::TradesEngine::GetSchdulerManager()->InitData();
base::SysRadom::GetInstance();
std::string schduler_library = "./data_share.so";
std::string schduler_func = "GetManagerSchdulerEngine";
schduler_engine = (manager_schduler::SchdulerEngine* (*)(void))
logic::SomeUtils::GetLibraryFunction(schduler_library,
schduler_func);
schduler_engine_= (*schduler_engine)();
if (schduler_engine_ == NULL)
assert(0);
trades_logic::TradesEngine::GetSchdulerManager()->InitManagerSchduler(schduler_engine_);
return true;
}
Tradeslogic *Tradeslogic::GetInstance()
{
if (instance_ == NULL)
instance_ = new Tradeslogic();
return instance_;
}
void Tradeslogic::FreeInstance()
{
delete instance_;
instance_ = NULL;
}
bool Tradeslogic::OnTradesConnect(struct server *srv, const int socket)
{
std::string ip;
int port;
logic::SomeUtils::GetIPAddress(socket, ip, port);
LOG_MSG2("ip {%s} prot {%d}", ip.c_str(), port);
return true;
}
bool Tradeslogic::OnTradesMessage(struct server *srv, const int socket,
const void *msg, const int len)
{
bool r = false;
struct PacketHead *packet = NULL;
if (srv == NULL || socket < 0 || msg == NULL || len < PACKET_HEAD_LENGTH)
return false;
if (!net::PacketProsess::UnpackStream(msg, len, &packet))
{
LOG_ERROR2("UnpackStream Error socket %d", socket);
return false;
}
switch (packet->operate_code)
{
case R_TRADES_OPEN_POSITION:
{
OnOpenPosition(srv,socket, packet);
break;
}
case R_TRADES_SYMBOL_STATUS:{
OnTradesSymbolInfo(srv, socket, packet);
break;
}
case R_CONFIRM_ORDER:{
//OnConfirmOrder(srv, socket, packet);
break;
}
case R_CANCEL_ORDER:{
OnCancelOrder(srv,socket, packet);
break;
}
default:
break;
}
if(packet){
delete packet;
packet = NULL;
}
return true;
}
bool Tradeslogic::OnTradesClose(struct server *srv, const int socket)
{
return true;
}
bool Tradeslogic::OnBroadcastConnect(struct server *srv, const int socket,
const void *msg, const int len)
{
return true;
}
bool Tradeslogic::OnBroadcastMessage(struct server *srv, const int socket,
const void *msg, const int len)
{
bool r = false;
struct PacketHead *packet = NULL;
if (srv == NULL || socket < 0 || msg == NULL || len < PACKET_HEAD_LENGTH)
return false;
if (!net::PacketProsess::UnpackStream(msg, len, &packet))
{
LOG_ERROR2("UnpackStream Error socket %d", socket);
return false;
}
return true;
}
bool Tradeslogic::OnBroadcastClose(struct server *srv, const int socket)
{
return true;
}
bool Tradeslogic::OnIniTimer(struct server *srv)
{
if (srv->add_time_task != NULL)
{
srv->add_time_task(srv, "trades", TIME_DISTRIBUTION_TASK, 10, -1);
}
return true;
}
bool Tradeslogic::OnTimeout(struct server *srv, char *id, int opcode,
int time)
{
switch (opcode)
{
case TIME_DISTRIBUTION_TASK:
{
trades_logic::TradesEngine::GetSchdulerManager()->TimeStarEvent();
}
default:
break;
}
return true;
}
bool Tradeslogic::OnCancelOrder(struct server* srv, int socket, struct PacketHead* packet) {
trades_logic::net_request::CancelOrder cancel_order;
if (packet->packet_length <= PACKET_HEAD_LENGTH) {
send_error(socket, ERROR_TYPE, ERROR_TYPE, FORMAT_ERRNO);
return false;
}
struct PacketControl* packet_control = (struct PacketControl*) (packet);
bool r = cancel_order.set_http_packet(packet_control->body_);
if (!r){
send_error(socket, ERROR_TYPE, ERROR_TYPE, FORMAT_ERRNO);
return false;
}
trades_logic::TradesEngine::GetSchdulerManager()->CancelOrder(socket,packet->session_id,
packet->reserved,cancel_order.id(),cancel_order.order_id());
}
bool Tradeslogic::OnTradesSymbolInfo(struct server* srv, int socket, struct PacketHead* packet) {
trades_logic::net_request::TradesSymbol trades_symbol;
if (packet->packet_length <= PACKET_HEAD_LENGTH) {
send_error(socket, ERROR_TYPE, ERROR_TYPE, FORMAT_ERRNO);
return false;
}
struct PacketControl* packet_control = (struct PacketControl*) (packet);
bool r = trades_symbol.set_http_packet(packet_control->body_);
if (!r){
send_error(socket, ERROR_TYPE, ERROR_TYPE, FORMAT_ERRNO);
return false;
}
trades_logic::TradesEngine::GetSchdulerManager()->TradesSymbolInfo(socket,
packet->session_id,packet->reserved,trades_symbol.symbol());
return true;
}
bool Tradeslogic::OnConfirmOrder(struct server* srv, int socket, struct PacketHead* packet) {
trades_logic::net_request::ConfirmOrder confirm_order;
if (packet->packet_length <= PACKET_HEAD_LENGTH)
{
send_error(socket, ERROR_TYPE, ERROR_TYPE, FORMAT_ERRNO);
return false;
}
struct PacketControl* packet_control = (struct PacketControl*) (packet);
bool r = confirm_order.set_http_packet(packet_control->body_);
if (!r)
{
send_error(socket, ERROR_TYPE, ERROR_TYPE, FORMAT_ERRNO);
return false;
}
// trades_logic::TradesEngine::GetSchdulerManager()->ConfirmOrder(socket,
// packet->session_id, packet->reserved,confirm_order.id(),
// confirm_order.order_id(),confirm_order.position_id());
return true;
}
bool Tradeslogic::OnGetStarTrading(struct server* srv, int socket, struct PacketHead* packet)
{
trades_logic::net_request::CurrentPosition current_position;
if (packet->packet_length <= PACKET_HEAD_LENGTH)
{
send_error(socket, ERROR_TYPE, ERROR_TYPE, FORMAT_ERRNO);
return false;
}
struct PacketControl* packet_control = (struct PacketControl*) (packet);
bool r = current_position.set_http_packet(packet_control->body_);
if (!r)
{
send_error(socket, ERROR_TYPE, ERROR_TYPE, FORMAT_ERRNO);
return false;
}
return true;
}
bool Tradeslogic::OnOpenPosition(struct server* srv, int socket, struct PacketHead* packet)
{
trades_logic::net_request::OpenPosition open_position;
if (packet->packet_length <= PACKET_HEAD_LENGTH)
{
send_error(socket, ERROR_TYPE, ERROR_TYPE, FORMAT_ERRNO);
return false;
}
struct PacketControl* packet_control = (struct PacketControl*) (packet);
bool r = open_position.set_http_packet(packet_control->body_);
if (!r)
{
send_error(socket, ERROR_TYPE, ERROR_TYPE, FORMAT_ERRNO);
return false;
}
trades_logic::TradesEngine::GetSchdulerManager()->CreateTradesPosition(socket,
packet->session_id,packet->reserved,open_position.id(),
open_position.symbol(),open_position.wid(), open_position.buy_sell(),
open_position.amount(),open_position.price());
return true;
}
} // namespace trades_logic
| flaght/starsvc | plugins/trades/trades_logic.cc | C++ | gpl-3.0 | 8,890 |
#ifndef RGBLIGHT_H
#define RGBLIGHT_H
#ifdef RGBLIGHT_ANIMATIONS
#define RGBLIGHT_MODES 34
#else
#define RGBLIGHT_MODES 1
#endif
#ifndef RGBLIGHT_EFFECT_SNAKE_LENGTH
#define RGBLIGHT_EFFECT_SNAKE_LENGTH 7
#endif
#ifndef RGBLIGHT_EFFECT_KNIGHT_LENGTH
#define RGBLIGHT_EFFECT_KNIGHT_LENGTH 7
#endif
#ifndef RGBLIGHT_EFFECT_KNIGHT_OFFSET
#define RGBLIGHT_EFFECT_KNIGHT_OFFSET 9
#endif
#ifndef RGBLIGHT_EFFECT_DUALKNIGHT_LENGTH
#define RGBLIGHT_EFFECT_DUALKNIGHT_LENGTH 4
#endif
#ifndef RGBLIGHT_EFFECT_CHRISTMAS_INTERVAL
#define RGBLIGHT_EFFECT_CHRISTMAS_INTERVAL 1000
#endif
#ifndef RGBLIGHT_EFFECT_CHRISTMAS_STEP
#define RGBLIGHT_EFFECT_CHRISTMAS_STEP 2
#endif
#ifndef RGBLIGHT_HUE_STEP
#define RGBLIGHT_HUE_STEP 10
#endif
#ifndef RGBLIGHT_SAT_STEP
#define RGBLIGHT_SAT_STEP 17
#endif
#ifndef RGBLIGHT_VAL_STEP
#define RGBLIGHT_VAL_STEP 17
#endif
#define RGBLED_TIMER_TOP F_CPU/(256*64)
// #define RGBLED_TIMER_TOP 0xFF10
#include <stdint.h>
#include <stdbool.h>
#include "eeconfig.h"
#include "light_ws2812.h"
extern LED_TYPE led[RGBLED_NUM];
extern const uint8_t RGBLED_BREATHING_INTERVALS[4] PROGMEM;
extern const uint8_t RGBLED_RAINBOW_MOOD_INTERVALS[3] PROGMEM;
extern const uint8_t RGBLED_RAINBOW_SWIRL_INTERVALS[3] PROGMEM;
extern const uint8_t RGBLED_SNAKE_INTERVALS[3] PROGMEM;
extern const uint8_t RGBLED_KNIGHT_INTERVALS[3] PROGMEM;
typedef union {
uint32_t raw;
struct {
bool enable :1;
uint8_t mode :6;
uint16_t hue :9;
uint8_t sat :8;
uint8_t val :8;
};
} rgblight_config_t;
void rgblight_init(void);
void rgblight_increase(void);
void rgblight_decrease(void);
void rgblight_toggle(void);
void rgblight_enable(void);
void rgblight_step(void);
void rgblight_step_reverse(void);
void rgblight_mode(uint8_t mode);
void rgblight_set(void);
void rgblight_update_dword(uint32_t dword);
void rgblight_increase_hue(void);
void rgblight_decrease_hue(void);
void rgblight_increase_sat(void);
void rgblight_decrease_sat(void);
void rgblight_increase_val(void);
void rgblight_decrease_val(void);
void rgblight_sethsv(uint16_t hue, uint8_t sat, uint8_t val);
void rgblight_setrgb(uint8_t r, uint8_t g, uint8_t b);
uint32_t eeconfig_read_rgblight(void);
void eeconfig_update_rgblight(uint32_t val);
void eeconfig_update_rgblight_default(void);
void eeconfig_debug_rgblight(void);
void sethsv(uint16_t hue, uint8_t sat, uint8_t val, LED_TYPE *led1);
void setrgb(uint8_t r, uint8_t g, uint8_t b, LED_TYPE *led1);
void rgblight_sethsv_noeeprom(uint16_t hue, uint8_t sat, uint8_t val);
#define EZ_RGB(val) rgblight_show_solid_color((val >> 16) & 0xFF, (val >> 8) & 0xFF, val & 0xFF)
void rgblight_show_solid_color(uint8_t r, uint8_t g, uint8_t b);
void rgblight_task(void);
void rgblight_timer_init(void);
void rgblight_timer_enable(void);
void rgblight_timer_disable(void);
void rgblight_timer_toggle(void);
void rgblight_effect_breathing(uint8_t interval);
void rgblight_effect_rainbow_mood(uint8_t interval);
void rgblight_effect_rainbow_swirl(uint8_t interval);
void rgblight_effect_snake(uint8_t interval);
void rgblight_effect_knight(uint8_t interval);
void rgblight_effect_christmas(void);
#endif
| galengold/split70 | qmk_firmware/quantum/rgblight.h | C | gpl-3.0 | 3,169 |
"use strict";
tutao.provide('tutao.entity.tutanota.FileDataDataGet');
/**
* @constructor
* @param {Object=} data The json data to store in this entity.
*/
tutao.entity.tutanota.FileDataDataGet = function(data) {
if (data) {
this.updateData(data);
} else {
this.__format = "0";
this._base64 = null;
this._file = null;
}
this._entityHelper = new tutao.entity.EntityHelper(this);
this.prototype = tutao.entity.tutanota.FileDataDataGet.prototype;
};
/**
* Updates the data of this entity.
* @param {Object=} data The json data to store in this entity.
*/
tutao.entity.tutanota.FileDataDataGet.prototype.updateData = function(data) {
this.__format = data._format;
this._base64 = data.base64;
this._file = data.file;
};
/**
* The version of the model this type belongs to.
* @const
*/
tutao.entity.tutanota.FileDataDataGet.MODEL_VERSION = '8';
/**
* The encrypted flag.
* @const
*/
tutao.entity.tutanota.FileDataDataGet.prototype.ENCRYPTED = true;
/**
* Provides the data of this instances as an object that can be converted to json.
* @return {Object} The json object.
*/
tutao.entity.tutanota.FileDataDataGet.prototype.toJsonData = function() {
return {
_format: this.__format,
base64: this._base64,
file: this._file
};
};
/**
* The id of the FileDataDataGet type.
*/
tutao.entity.tutanota.FileDataDataGet.prototype.TYPE_ID = 331;
/**
* The id of the base64 attribute.
*/
tutao.entity.tutanota.FileDataDataGet.prototype.BASE64_ATTRIBUTE_ID = 333;
/**
* The id of the file attribute.
*/
tutao.entity.tutanota.FileDataDataGet.prototype.FILE_ATTRIBUTE_ID = 334;
/**
* Sets the format of this FileDataDataGet.
* @param {string} format The format of this FileDataDataGet.
*/
tutao.entity.tutanota.FileDataDataGet.prototype.setFormat = function(format) {
this.__format = format;
return this;
};
/**
* Provides the format of this FileDataDataGet.
* @return {string} The format of this FileDataDataGet.
*/
tutao.entity.tutanota.FileDataDataGet.prototype.getFormat = function() {
return this.__format;
};
/**
* Sets the base64 of this FileDataDataGet.
* @param {boolean} base64 The base64 of this FileDataDataGet.
*/
tutao.entity.tutanota.FileDataDataGet.prototype.setBase64 = function(base64) {
this._base64 = base64 ? '1' : '0';
return this;
};
/**
* Provides the base64 of this FileDataDataGet.
* @return {boolean} The base64 of this FileDataDataGet.
*/
tutao.entity.tutanota.FileDataDataGet.prototype.getBase64 = function() {
return this._base64 != '0';
};
/**
* Sets the file of this FileDataDataGet.
* @param {Array.<string>} file The file of this FileDataDataGet.
*/
tutao.entity.tutanota.FileDataDataGet.prototype.setFile = function(file) {
this._file = file;
return this;
};
/**
* Provides the file of this FileDataDataGet.
* @return {Array.<string>} The file of this FileDataDataGet.
*/
tutao.entity.tutanota.FileDataDataGet.prototype.getFile = function() {
return this._file;
};
/**
* Loads the file of this FileDataDataGet.
* @return {Promise.<tutao.entity.tutanota.File>} Resolves to the loaded file of this FileDataDataGet or an exception if the loading failed.
*/
tutao.entity.tutanota.FileDataDataGet.prototype.loadFile = function() {
return tutao.entity.tutanota.File.load(this._file);
};
/**
* Provides the entity helper of this entity.
* @return {tutao.entity.EntityHelper} The entity helper.
*/
tutao.entity.tutanota.FileDataDataGet.prototype.getEntityHelper = function() {
return this._entityHelper;
};
| bartuspan/tutanota | web/js/generated/entity/tutanota/FileDataDataGet.js | JavaScript | gpl-3.0 | 3,544 |
/*
* CddaDriveListConnection.java
*
* This file is part of Tritonus: http://www.tritonus.org/
*/
/*
* Copyright (c) 2001 - 2002 by Matthias Pfisterer
*
* 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 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU 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., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/*
|<--- this code is formatted to fit into 80 columns --->|
*/
package org.tritonus.sampled.cdda;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.InputStream;
import java.io.IOException;
import java.io.PrintStream;
import java.net.URL;
import java.net.URLConnection;
import java.util.Iterator;
import org.tritonus.lowlevel.cdda.CddaMidLevel;
import org.tritonus.lowlevel.cdda.CddaUtils;
import org.tritonus.share.TDebug;
public class CddaDriveListConnection
extends URLConnection
{
private CddaMidLevel m_cddaMidLevel;
// TODO: m_cdda.close();
public CddaDriveListConnection(URL url)
{
super(url);
if (TDebug.TraceCdda) { TDebug.out("CddaDriveListConnection.<init>(): begin"); }
if (TDebug.TraceCdda) { TDebug.out("CddaDriveListConnection.<init>(): end"); }
}
public void connect()
{
if (TDebug.TraceCdda) { TDebug.out("CddaDriveListConnection.connect(): begin"); }
if (! connected)
{
m_cddaMidLevel = CddaUtils.getCddaMidLevel();
connected = true;
}
if (TDebug.TraceCdda) { TDebug.out("CddaDriveListConnection.connect(): end"); }
}
public InputStream getInputStream()
throws IOException
{
if (TDebug.TraceCdda) { TDebug.out("CddaDriveListConnection.getInputStream(): begin"); }
connect();
Iterator drivesIterator = m_cddaMidLevel.getDevices();
ByteArrayOutputStream baos = new ByteArrayOutputStream();
PrintStream out = new PrintStream(baos);
while (drivesIterator.hasNext())
{
String strDrive = (String) drivesIterator.next();
out.print(strDrive + "\n");
}
byte[] abData = baos.toByteArray();
baos.close();
ByteArrayInputStream bais = new ByteArrayInputStream(abData);
if (TDebug.TraceCdda) { TDebug.out("CddaDriveListConnection.getInputStream(): end"); }
return bais;
}
}
/*** CddaDriveListConnection.java ****/
| srnsw/xena | plugins/audio/ext/src/tritonus/src/org/tritonus/sampled/cdda/CddaDriveListConnection.java | Java | gpl-3.0 | 2,778 |
<?php
/**
* Implements Special:Unusedimages
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* http://www.gnu.org/copyleft/gpl.html
*
* @file
* @ingroup SpecialPage
*/
/**
* A special page that lists unused images
*
* @ingroup SpecialPage
*/
class UnusedimagesPage extends ImageQueryPage {
function __construct( $name = 'Unusedimages' ) {
parent::__construct( $name );
}
function isExpensive() {
return true;
}
function sortDescending() {
return false;
}
function isSyndicated() {
return false;
}
function getQueryInfo() {
$retval = [
'tables' => [ 'image', 'imagelinks' ],
'fields' => [
'namespace' => NS_FILE,
'title' => 'img_name',
'value' => 'img_timestamp',
],
'conds' => [ 'il_to IS NULL' ],
'join_conds' => [ 'imagelinks' => [ 'LEFT JOIN', 'il_to = img_name' ] ]
];
if ( $this->getConfig()->get( 'CountCategorizedImagesAsUsed' ) ) {
// Order is significant
$retval['tables'] = [ 'image', 'page', 'categorylinks',
'imagelinks' ];
$retval['conds']['page_namespace'] = NS_FILE;
$retval['conds'][] = 'cl_from IS NULL';
$retval['conds'][] = 'img_name = page_title';
$retval['join_conds']['categorylinks'] = [
'LEFT JOIN', 'cl_from = page_id' ];
$retval['join_conds']['imagelinks'] = [
'LEFT JOIN', 'il_to = page_title' ];
}
return $retval;
}
function usesTimestamps() {
return true;
}
function getPageHeader() {
if ( $this->getConfig()->get( 'CountCategorizedImagesAsUsed' ) ) {
return $this->msg(
'unusedimagestext-categorizedimgisused'
)->parseAsBlock();
}
return $this->msg( 'unusedimagestext' )->parseAsBlock();
}
protected function getGroupName() {
return 'maintenance';
}
}
| kylethayer/bioladder | wiki/includes/specials/SpecialUnusedimages.php | PHP | gpl-3.0 | 2,387 |
//
// Created by Poter Hsu on 2015/12/23.
//
#ifndef BUILD_RELU_H
#define BUILD_RELU_H
#include "Module.hpp"
template <typename T>
class ReLU : public Module<T> {
public:
using Module<T>::name;
using Module<T>::type;
using Module<T>::next;
shared_ptr<Tensor<T>> output;
ReLU() {
name = "ReLU";
type = Type::RELU;
output = nullptr;
}
shared_ptr<Tensor<T>> forward(const shared_ptr<Tensor<T>> input) override {
assert(input->nDim > 0);
assert(input->nElem > 0);
if (output == nullptr)
output = make_shared<Tensor<T>>(input->sizes);
T* pInput = input->data;
T* pOutput = output->data;
for (long i = 0; i < output->nElem; ++i) {
*pOutput = *pInput < 0.0 ? 0.0 : *pInput;
++pInput;
++pOutput;
}
return next != nullptr ? next->forward(output) : output;
}
};
#endif //BUILD_RELU_H
| potterhsu/TorchPredictor | CPP/lib/nn/ReLU.hpp | C++ | gpl-3.0 | 952 |
/*
* EZLinkTransitData.java
*
* Copyright (C) 2011 Eric Butler
*
* Authors:
* Sean Cross <sean@chumby.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.codebutler.farebot.transit.ezlink;
import android.os.Parcel;
import com.codebutler.farebot.card.Card;
import com.codebutler.farebot.card.cepas.CEPASCard;
import com.codebutler.farebot.card.cepas.CEPASTransaction;
import com.codebutler.farebot.transit.Refill;
import com.codebutler.farebot.transit.Subscription;
import com.codebutler.farebot.transit.TransitData;
import com.codebutler.farebot.transit.TransitIdentity;
import com.codebutler.farebot.transit.Trip;
import com.codebutler.farebot.ui.ListItem;
import com.codebutler.farebot.util.Utils;
import java.text.NumberFormat;
import java.util.Currency;
import java.util.HashSet;
import java.util.List;
import java.util.TreeMap;
public class EZLinkTransitData extends TransitData {
private String mSerialNumber;
private double mBalance;
private EZLinkTrip[] mTrips;
static HashSet<String> sbsBuses = new HashSet<String> () {
private static final long serialVersionUID = 1L; {
add("CT18");
add("CT8");
add("CT18");
add("CT8");
add("1N");
add("2");
add("2N");
add("3");
add("3N");
add("4N");
add("5");
add("5N");
add("6");
add("6N");
add("7");
add("8");
add("9");
add("10");
add("10e");
add("11");
add("12");
add("13");
add("14");
add("14e");
add("15");
add("16");
add("17");
add("18");
add("19");
add("21");
add("22");
add("23");
add("24");
add("25");
add("26");
add("27");
add("28");
add("29");
add("30");
add("30e");
add("31");
add("32");
add("33");
add("34");
add("35");
add("36");
add("37");
add("38");
add("39");
add("40");
add("42");
add("43");
add("45");
add("48");
add("51");
add("52");
add("53");
add("54");
add("55");
add("56");
add("57");
add("58");
add("59");
add("60");
add("62");
add("63");
add("64");
add("65");
add("66");
add("69");
add("70");
add("70M");
add("72");
add("73");
add("74");
add("74e");
add("76");
add("78");
add("79");
add("80");
add("81");
add("82");
add("83");
add("85");
add("86");
add("87");
add("88");
add("89");
add("89e");
add("90");
add("91");
add("92");
add("93");
add("94");
add("95");
add("96");
add("97");
add("97e");
add("98");
add("98M");
add("99");
add("100");
add("101");
add("103");
add("105");
add("107");
add("107M");
add("109");
add("111");
add("112");
add("113");
add("115");
add("119");
add("123");
add("123M");
add("124");
add("125");
add("128");
add("130");
add("131");
add("132");
add("133");
add("133M");
add("135");
add("136");
add("138");
add("139");
add("142");
add("143");
add("145");
add("147");
add("151");
add("151e");
add("153");
add("154");
add("155");
add("156");
add("157");
add("158");
add("159");
add("160");
add("161");
add("162");
add("162M");
add("163");
add("163M");
add("165");
add("166");
add("168");
add("170");
add("170X");
add("174");
add("174e");
add("175");
add("179");
add("179A");
add("181");
add("182");
add("182M");
add("183");
add("185");
add("186");
add("191");
add("192");
add("193");
add("194");
add("195");
add("196");
add("196e");
add("197");
add("198");
add("199");
add("200");
add("222");
add("225");
add("228");
add("229");
add("231");
add("232");
add("235");
add("238");
add("240");
add("241");
add("242");
add("243");
add("246");
add("249");
add("251");
add("252");
add("254");
add("255");
add("257");
add("261");
add("262");
add("265");
add("268");
add("269");
add("272");
add("273");
add("275");
add("282");
add("284");
add("284M");
add("285");
add("291");
add("292");
add("293");
add("315");
add("317");
add("325");
add("333");
add("334");
add("335");
add("354");
add("358");
add("359");
add("372");
add("400");
add("401");
add("402");
add("403");
add("405");
add("408");
add("409");
add("410");
add("502");
add("502A");
add("506");
add("518");
add("518A");
add("532");
add("533");
add("534");
add("535");
add("536");
add("538");
add("539");
add("542");
add("543");
add("544");
add("545");
add("548");
add("549");
add("550");
add("552");
add("553");
add("554");
add("555");
add("556");
add("557");
add("558");
add("559");
add("560");
add("561");
add("563");
add("564");
add("565");
add("566");
add("569");
add("585");
add("761");
}
};
// Data snagged from http://www.sgwiki.com/wiki/North_East_Line
// Coordinates taken from respective Wikipedia MRT pages
private static TreeMap<String, MRTStation> mrtStations = new TreeMap<String, MRTStation> () {
private static final long serialVersionUID = 1L; {
// Transaction Codes
put("GTM", new MRTStation("GTM Manual Top-up", "GTM", "GTM", null, null));
// North-East Line (NEL)
put("HBF", new MRTStation("HarbourFront", "NE1 / CC29", "HBF", "1.265297", "103.82225"));
put("HBC", new MRTStation("HarbourFront", "NE1 / CC29", "HBC", "1.265297", "103.82225"));
put("OTP", new MRTStation("Outram Park", "NE3 / EW16", "OTP", "1.280225", "103.839486"));
put("CNT", new MRTStation("Chinatown", "NE4 / DT19", "CNT", "1.28485", "103.844006"));
put("CQY", new MRTStation("Clarke Quay", "NE5", "CQY", "1.288708", "103.846606"));
put("DBG", new MRTStation("Dhoby Ghaut", "NE6 / NS24 / CC1", "DBG", "1.299156", "103.845736"));
put("LTI", new MRTStation("Little India", "NE7 / DT12", "LTI", "1.306725", "103.849175"));
put("FRP", new MRTStation("Farrer Park", "NE8", "FRP", "1.312314", "103.854028"));
put("BNK", new MRTStation("Boon Keng", "NE9", "BNK", "1.319483", "103.861722"));
put("PTP", new MRTStation("Potong Pasir", "NE10", "PTP", "1.331161", "103.869058"));
put("WLH", new MRTStation("Woodleigh", "NE11", "WLH", "1.339181", "103.870744"));
put("SER", new MRTStation("Serangoon", "NE12 / CC13", "SER", "1.349944", "103.873092"));
put("KVN", new MRTStation("Kovan", "NE13", "KVN", "1.360214", "103.884864"));
put("HGN", new MRTStation("Hougang", "NE14", "HGN", "1.371292", "103.892161"));
put("BGK", new MRTStation("Buangkok", "NE15", "BGK", "1.382728", "103.892789"));
put("SKG", new MRTStation("Sengkang", "NE16 / STC", "SKG", "1.391653", "103.895133"));
put("PGL", new MRTStation("Punggol", "NE17 / PTC", "PGL", "1.405264", "103.902097"));
// Circle Line (CCL)
put("DBG", new MRTStation("Dhoby Ghaut", "CC1 / NS24 / NE6", "DBG", "1.299156", "103.845736"));
put("DBN", new MRTStation("Dhoby Ghaut", "CC1 / NS24 / NE6", "DBN", "1.299156", "103.845736")); // Alternate name (Northeast line entrance)
put("BBS", new MRTStation("Bras Basah", "CC2", "BBS", "1.296931", "103.850631"));
put("EPN", new MRTStation("Esplanade", "CC3", "EPN", "1.293436", "103.855381"));
put("PMD", new MRTStation("Promenade", "CC4 / DT15", "PMD", "1.293131", "103.861064"));
put("NCH", new MRTStation("Nicoll Highway", "CC5", "NCH", "1.299697", "103.863611"));
put("SDM", new MRTStation("Stadium", "CC6", "SDM", "1.302856", "1.302856"));
put("MBT", new MRTStation("Mountbatten", "CC7", "MBT", "1.306306", "103.882531"));
put("DKT", new MRTStation("Dakota", "CC8", "DKT", "1.308289", "103.888253"));
put("PYL", new MRTStation("Paya Lebar", "CC9 / EW8", "PYL", "1.317767", "103.892381"));
put("MPS", new MRTStation("MacPherson", "CC10 / DT?", "MPS", "1.32665", "103.890019"));
put("TAS", new MRTStation("Tai Seng", "CC11", "TAS", "1.335833", "103.887942"));
put("BLY", new MRTStation("Bartley", "CC12", "BLY", "1.342756", "103.879697"));
put("SER", new MRTStation("Serangoon", "CC13 / NE12", "SER", "1.349944", "103.873092"));
put("SRC", new MRTStation("Serangoon", "CC13 / NE12", "SER", "1.349944", "103.873092"));
put("LRC", new MRTStation("Lorong Chuan", "CC14", "LRC", "1.351636", "103.864064"));
put("BSH", new MRTStation("Bishan", "CC15 / NS17", "BSH", "1.351236", "103.848456"));
put("BSC", new MRTStation("Bishan", "CC15 / NS17", "BSC", "1.351236", "103.848456")); // Alternate name (Circle line entrance)
put("MRM", new MRTStation("Marymount", "CC16", "MRM", "1.349078", "103.839492"));
put("CDT", new MRTStation("Caldecott", "CC17", "CDT", "1.337761", "103.839447"));
put("BTN", new MRTStation("Botanic Gardens", "CC19 / DT9", "BTN", "1.322519", "103.815406"));
put("FRR", new MRTStation("Farrer Road", "CC20", "FRR", "1.317319", "103.807431"));
put("HLV", new MRTStation("Holland Village", "CC21", "HLV", "1.312078", "103.796208"));
//put("", new MRTStation("Buona Vista", "EW21 / CC22", "", "1.17", "103.5")); // Reserved for Alternate name (Circle line entrance)
put("ONH", new MRTStation("one-north", "CC23", "ONH", "1.299331", "103.787067"));
put("KRG", new MRTStation("Kent Ridge", "CC24", "KRG", "1.293383", "103.784394"));
put("HPV", new MRTStation("Haw Par Villa", "CC25", "HPV", "1.282386", "103.781867"));
put("PPJ", new MRTStation("Pasir Panjang", "CC26", "PPJ", "1.276167", "103.791358"));
put("LBD", new MRTStation("Labrador Park", "CC27", "LBD", "1.272267", "103.802908"));
put("TLB", new MRTStation("Telok Blangah", "CC28", "TLB", "1.270572", "103.809678"));
//put("", new MRTStation("HarbourFront", "CC20", "", "1.265297", "103.82225")); // Reserved for Alternate name (Circle line entrance)
// Marina Bay Extension (CCL)
put("BFT", new MRTStation("Bayfront", "CE1 / DT16", "BFT", "1.282347", "103.859317"));
// Changi Airport Extension (EWL)
put("TNM", new MRTStation("Tanah Merah", "EW4", "TNM", "1.327358", "103.946344"));
put("XPO", new MRTStation("Expo", "CG1 / DT35", "XPO", "1.335469", "103.961767"));
put("CGA", new MRTStation("Changi Airport", "CG2", "CGA", "1.357372", "103.988836"));
// East-West Line (EWL)
put("PSR", new MRTStation("Pasir Ris", "EW1", "PSR", "1.372411", "103.949369"));
put("TAM", new MRTStation("Tampines", "EW2 / DT32", "TAM", "1.352528", "103.945322"));
put("SIM", new MRTStation("Simei", "EW3", "SIM", "1.343444", "103.953172"));
put("TNM", new MRTStation("Tanah Merah", "EW4", "TNM", "1.327358", "103.946344"));
put("BDK", new MRTStation("Bedok", "EW5", "BDK", "1.324039", "103.930036"));
put("KEM", new MRTStation("Kembangan", "EW6", "KEM", "1.320983", "103.912842"));
put("EUN", new MRTStation("Eunos", "EW7", "EUN", "1.319725", "103.903108"));
put("PYL", new MRTStation("Paya Lebar", "EW8 / CC9", "PYL", "1.317767", "103.892381"));
put("ALJ", new MRTStation("Aljunied", "EW9", "ALJ", "1.316442", "103.882981"));
put("KAL", new MRTStation("Kallang", "EW10", "KAL", "1.311469", "103.8714"));
put("LVR", new MRTStation("Lavender", "EW11", "LVR", "1.307167", "103.863008"));
put("BGS", new MRTStation("Bugis", "EW12 / DT14", "BGS", "1.300194", "103.85615"));
put("CTH", new MRTStation("City Hall", "EW13 / NS25", "CTH", "1.293239", "103.852219"));
put("RFP", new MRTStation("Raffles Place", "EW14 / NS26", "RFP", "1.283881", "103.851533"));
put("TPG", new MRTStation("Tanjong Pagar", "EW15", "TPG", "1.276439", "103.845711"));
put("OTP", new MRTStation("Outram Park", "EW16 / NE3", "OTP", "1.280225", "103.839486"));
put("OTN", new MRTStation("Outram Park", "EW16 / NE3", "OTN", "1.280225", "103.839486")); // Alternate name (Northeast line entrance)
put("TIB", new MRTStation("Tiong Bahru", "EW17", "TIB", "1.286081", "103.826958"));
put("RDH", new MRTStation("Redhill", "EW18", "RDH", "1.289733", "103.81675"));
put("QUE", new MRTStation("Queenstown", "EW19", "QUE", "1.294442", "103.806114"));
put("COM", new MRTStation("Commonwealth", "EW20", "COM", "1.302558", "103.798225"));
put("BNV", new MRTStation("Buona Vista", "EW21 / CC22", "BNV", "1.306817", "103.790428"));
put("DVR", new MRTStation("Dover", "EW22", "DVR", "1.311314", "103.778658"));
put("CLE", new MRTStation("Clementi", "EW23", "CLE", "1.315303", "103.765244"));
put("JUR", new MRTStation("Jurong East", "EW24 / NS1", "JUR", "1.333415", "103.742119"));
put("CNG", new MRTStation("Chinese Garden", "EW25", "CNG", "1.342711", "103.732467"));
put("LKS", new MRTStation("Lakeside", "EW26", "LKS", "1.344589", "103.721139"));
put("BNL", new MRTStation("Boon Lay", "EW27", "BNL", "1.338883", "103.706208"));
put("PNR", new MRTStation("Pioneer", "EW28", "PNR", "1.337578", "103.697217"));
put("JKN", new MRTStation("Joo Koon", "EW29", "JKN", "1.327739", "103.678486"));
// North-South Line (NSL)
put("JUR", new MRTStation("Jurong East", "NS1 / EW24", "JUR", "1.333415", "103.742119"));
put("BBT", new MRTStation("Bukit Batok", "NS2", "BBT", "1.349073", "103.749664"));
put("BGB", new MRTStation("Bukit Gombak", "NS3", "BGB", "1.358702", "103.751787"));
put("CCK", new MRTStation("Choa Chu Kang", "NS4 / BP1", "CCK", "1.385092", "103.744322"));
put("YWT", new MRTStation("Yew Tee", "NS5", "YWT", "1.396986", "103.747239"));
put("KRJ", new MRTStation("Kranji", "NS7", "KRJ", "1.425047", "103.761853"));
put("MSL", new MRTStation("Marsiling", "NS8", "MSL", "1.432636", "103.774283"));
put("WDL", new MRTStation("Woodlands", "NS9", "WDL", "1.437094", "103.786483"));
put("ADM", new MRTStation("Admiralty", "NS10", "ADM", "1.440689", "103.800933"));
put("SBW", new MRTStation("Sembawang", "NS11", "SBW", "1.449025", "103.820153"));
put("YIS", new MRTStation("Yishun", "NS13", "YIS", "1.429464", "103.835239"));
put("KTB", new MRTStation("Khatib", "NS14", "KTB", "1.417167", "103.8329"));
put("YCK", new MRTStation("Yio Chu Kang", "NS15", "YCK", "1.381906", "103.844817"));
put("AMK", new MRTStation("Ang Mo Kio", "NS16", "AMK", "1.370017", "103.84945"));
put("BSH", new MRTStation("Bishan", "NS17 / CC15", "BSH", "1.351236", "103.848456"));
put("BDL", new MRTStation("Braddell", "NS18", "BDL", "1.340339", "103.846725"));
put("TAP", new MRTStation("Toa Payoh", "NS19", "TAP", "1.332703", "103.847808"));
put("NOV", new MRTStation("Novena", "NS20", "NOV", "1.320394", "103.843689"));
put("NEW", new MRTStation("Newton", "NS21 / DT11", "NEW", "1.312956", "103.838442"));
put("ORC", new MRTStation("Orchard", "NS22", "ORC", "1.304314", "103.831939"));
put("SOM", new MRTStation("Somerset", "NS23", "SOM", "1.300514", "103.839028"));
put("DBG", new MRTStation("Dhoby Ghaut", "NS24 / NE6 / CC1", "DBG", "1.299156", "103.845736"));
put("CTH", new MRTStation("City Hall", "NS25 / EW13", "CTH", "1.293239", "103.852219"));
put("RFP", new MRTStation("Raffles Place", "NS26 / EW14", "RFP", "1.283881", "103.851533"));
put("MRB", new MRTStation("Marina Bay", "NS27 / CE2", "MRB", "1.276097", "103.854675"));
}
};
private static String getCardIssuer(String canNo) {
int issuerId = Integer.parseInt(canNo.substring(0,3));
switch (issuerId) {
case 100: return "EZ-Link";
case 111: return "NETS";
default: return "CEPAS";
}
}
public static MRTStation getStation (String code) {
return mrtStations.get(code);
}
public static boolean check (Card card) {
if (card instanceof CEPASCard) {
CEPASCard cepasCard = (CEPASCard) card;
return cepasCard.getHistory(3) != null &&
cepasCard.getHistory(3).isValid() &&
cepasCard.getPurse(3) != null &&
cepasCard.getPurse(3).isValid();
}
return false;
}
public static TransitIdentity parseTransitIdentity(Card card) {
String canNo = Utils.getHexString(((CEPASCard) card).getPurse(3).getCAN(), "<Error>");
return new TransitIdentity(getCardIssuer(canNo), canNo);
}
public Creator<EZLinkTransitData> CREATOR = new Creator<EZLinkTransitData>() {
public EZLinkTransitData createFromParcel(Parcel parcel) {
return new EZLinkTransitData(parcel);
}
public EZLinkTransitData[] newArray(int size) {
return new EZLinkTransitData[size];
}
};
public EZLinkTransitData(Parcel parcel) {
mSerialNumber = parcel.readString();
mBalance = parcel.readDouble();
mTrips = new EZLinkTrip[parcel.readInt()];
parcel.readTypedArray(mTrips, EZLinkTrip.CREATOR);
}
public EZLinkTransitData (Card card) {
CEPASCard cepasCard = (CEPASCard) card;
mSerialNumber = Utils.getHexString(cepasCard.getPurse(3).getCAN(), "<Error>");
mBalance = cepasCard.getPurse(3).getPurseBalance();
mTrips = parseTrips(cepasCard);
}
@Override public String getCardName () {
return getCardIssuer(mSerialNumber);
}
@Override public String getBalanceString () {
NumberFormat numberFormat = NumberFormat.getCurrencyInstance();
numberFormat.setCurrency(Currency.getInstance("SGD"));
return numberFormat.format(mBalance / 100);
}
@Override public String getSerialNumber () {
return mSerialNumber;
}
@Override public Trip[] getTrips () {
return mTrips;
}
@Override public Refill[] getRefills () {
return null;
}
@Override public Subscription[] getSubscriptions() {
return null;
}
@Override public List<ListItem> getInfo() {
return null;
}
private EZLinkTrip[] parseTrips (CEPASCard card) {
List<CEPASTransaction> transactions = card.getHistory(3).getTransactions();
if (transactions != null) {
EZLinkTrip[] trips = new EZLinkTrip[transactions.size()];
for (int i = 0; i < trips.length; i++)
trips[i] = new EZLinkTrip(transactions.get(i), getCardName());
return trips;
}
return new EZLinkTrip[0];
}
public void writeToParcel(Parcel parcel, int flags) {
parcel.writeString(mSerialNumber);
parcel.writeDouble(mBalance);
parcel.writeInt(mTrips.length);
parcel.writeTypedArray(mTrips, flags);
}
}
| hgl888/farebot | src/main/java/com/codebutler/farebot/transit/ezlink/EZLinkTransitData.java | Java | gpl-3.0 | 23,694 |
<?php
// Text
$_['text_footer'] = '<a href="http://www.opencart.com">OpenCart</a> © 2009-' . date('Y') . ' All Rights Reserved.';
$_['text_version'] = 'Version %s'; | opencart-rewrite/opencart-rewrite | upload/admin/language/english/common/footer.php | PHP | gpl-3.0 | 177 |
/****************************************************************************
**
** Copyright (C) 2014 Dinu SV.
** (contact: mail@dinusv.com)
** This file is part of Live CV application.
**
** GNU General Public License Usage
**
** This file may be used under the terms of the GNU General Public License
** version 3.0 as published by the Free Software Foundation and appearing
** in the file LICENSE.GPL included in the packaging of this file. Please
** review the following information to ensure the GNU General Public License
** version 3.0 requirements will be met: http://www.gnu.org/copyleft/gpl.html.
**
****************************************************************************/
#ifndef QVideoCaptureTHREAD_HPP
#define QVideoCaptureTHREAD_HPP
#include <QThread>
#include "QLCVGlobal.hpp"
class QMat;
class QTimer;
class QVideoCaptureThreadPrivate;
class QVideoCaptureThread: public QThread{
Q_OBJECT
public:
QVideoCaptureThread(const QString& file, QObject* parent = 0);
~QVideoCaptureThread();
QMat* output();
QTimer* timer();
const QString& file() const;
int captureWidth() const;
int captureHeight() const;
double captureFps() const;
bool paused() const;
void setPaused(bool paused);
bool isSeeking() const;
void setForceSeek(bool forceSeek);
int currentFrame() const;
int totalFrames() const;
bool isCaptureOpened();
void processNextFrame();
void setLoop(bool loop);
signals:
void inactiveMatChanged();
void isSeekingChanged();
public slots:
void tick();
void seekTo(int frame);
protected:
void run();
private:
void initializeMatSize();
void beginSeek();
void endSeek();
QVideoCaptureThread(const QVideoCaptureThread& other);
QVideoCaptureThread& operator= (const QVideoCaptureThread& other);
QString m_file;
bool m_paused;
int m_framePos;
int m_totalFrames;
bool m_isSeeking;
bool m_forceSeek;
bool m_loop;
QMat* m_activeMat;
QTimer* m_timer;
QVideoCaptureThreadPrivate* const d_ptr;
Q_DECLARE_PRIVATE(QVideoCaptureThread)
};
inline QTimer *QVideoCaptureThread::timer(){
return m_timer;
}
inline const QString& QVideoCaptureThread::file() const{
return m_file;
}
inline bool QVideoCaptureThread::paused() const{
return m_paused;
}
inline void QVideoCaptureThread::setPaused(bool paused){
m_paused = paused;
}
inline bool QVideoCaptureThread::isSeeking() const{
return m_isSeeking;
}
inline int QVideoCaptureThread::currentFrame() const{
return m_framePos;
}
inline int QVideoCaptureThread::totalFrames() const{
return m_totalFrames;
}
inline void QVideoCaptureThread::setForceSeek(bool forceSeek){
m_forceSeek = forceSeek;
}
inline QMat *QVideoCaptureThread::output(){
return m_activeMat;
}
#endif // QVideoCaptureTHREAD_HPP
| mhgreen/livecv | modules/lcvcore/src/QVideoCaptureThread.hpp | C++ | gpl-3.0 | 2,931 |
package com.epam.jdi.httptests;
import com.epam.http.performance.PerformanceResult;
import org.testng.Assert;
import org.testng.annotations.Test;
import static com.epam.http.performance.RestLoad.loadService;
import static com.epam.http.requests.ServiceInit.init;
import static com.epam.jdi.httptests.ServiceExample.getInfo;
public class PerformanceTests {
@Test
public void isAliveTest() {
init(ServiceExample.class);
Assert.assertTrue(getInfo.isAlive());
}
@Test
public void printTest() {
init(ServiceExample.class);
PerformanceResult pr = loadService(5, getInfo);
Assert.assertTrue(pr.NoFails(), "Number of fails: " + pr.NumberOfFails);
System.out.println("Average time: " + pr.AverageResponseTime + "ms");
System.out.println("Requests amount: " + pr.NumberOfRequests);
}
}
| epam/JDI | Java/Tests/jdi-httpTests/src/test/java/com/epam/jdi/httptests/PerformanceTests.java | Java | gpl-3.0 | 861 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML
><HEAD
><TITLE
>Chapter 8</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK
REL="HOME"
TITLE="The Scriptures"
HREF="index.html"><LINK
REL="UP"
TITLE="The Second Book of Moses called Exodus"
HREF="c1641.html"><LINK
REL="PREVIOUS"
TITLE="Chapter 7"
HREF="x1808.html"><LINK
REL="NEXT"
TITLE="Chapter 9"
HREF="x1869.html"></HEAD
><BODY
CLASS="section"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>The Scriptures: The Old Testament</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="x1808.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
>Chapter 2. The Second Book of Moses called Exodus</TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="x1869.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="section"
><H1
CLASS="section"
><A
NAME="AEN1835"
></A
>2.8. Chapter 8</H1
><P
>1. AND the LORD spake unto Moses, Go unto Pharaoh, and say unto him, Thus saith the LORD, Let my people go, that they may serve me.</P
><P
>2. And if thou refuse to let them go, behold, I will smite all thy borders with frogs:</P
><P
>3. And the river shall bring forth frogs abundantly, which shall go up and come into thine house, and into thy bedchamber, and upon thy bed, and into the house of thy servants, and upon thy people, and into thine ovens, and into thy kneadingtroughs:</P
><P
>4. And the frogs shall come up both on thee, and upon thy people, and upon all thy servants.</P
><P
>5. ¶ And the LORD spake unto Moses, Say unto Aaron, Stretch forth thine hand with thy rod over the streams, over the rivers, and over the ponds, and cause frogs to come up upon the land of Egypt.</P
><P
>6. And Aaron stretched out his hand over the waters of Egypt; and the frogs came up, and covered the land of Egypt.</P
><P
>7. And the magicians did so with their enchantments, and brought up frogs upon the land of Egypt.</P
><P
>8. ¶ Then Pharaoh called for Moses and Aaron, and said, Intreat the LORD, that he may take away the frogs from me, and from my people; and I will let the people go, that they may do sacrifice unto the LORD.</P
><P
>9. And Moses said unto Pharaoh, Glory over me: when shall I intreat for thee, and for thy servants, and for thy people, to destroy the frogs from thee and thy houses, that they may remain in the river only?</P
><P
>10. And he said, To morrow. And he said, Be it according to thy word: that thou mayest know that there is none like unto the LORD our God.</P
><P
>11. And the frogs shall depart from thee, and from thy houses, and from thy servants, and from thy people; they shall remain in the river only.</P
><P
>12. And Moses and Aaron went out from Pharaoh: and Moses cried unto the LORD because of the frogs which he had brought against Pharaoh.</P
><P
>13. And the LORD did according to the word of Moses; and the frogs died out of the houses, out of the villages, and out of the fields.</P
><P
>14. And they gathered them together upon heaps: and the land stank.</P
><P
>15. But when Pharaoh saw that there was respite, he hardened his heart, and hearkened not unto them; as the LORD had said.</P
><P
>16. ¶ And the LORD said unto Moses, Say unto Aaron, Stretch out thy rod, and smite the dust of the land, that it may become lice throughout all the land of Egypt.</P
><P
>17. And they did so; for Aaron stretched out his hand with his rod, and smote the dust of the earth, and it became lice in man, and in beast; all the dust of the land became lice throughout all the land of Egypt.</P
><P
>18. And the magicians did so with their enchantments to bring forth lice, but they could not: so there were lice upon man, and upon beast.</P
><P
>19. Then the magicians said unto Pharaoh, This is the finger of God: and Pharaoh's heart was hardened, and he hearkened not unto them; as the LORD had said.</P
><P
>20. ¶ And the LORD said unto Moses, Rise up early in the morning, and stand before Pharaoh; lo, he cometh forth to the water; and say unto him, Thus saith the LORD, Let my people go, that they may serve me.</P
><P
>21. Else, if thou wilt not let my people go, behold, I will send swarms of flies upon thee, and upon thy servants, and upon thy people, and into thy houses: and the houses of the Egyptians shall be full of swarms of flies, and also the ground whereon they are.</P
><P
>22. And I will sever in that day the land of Goshen, in which my people dwell, that no swarms of flies shall be there; to the end thou mayest know that I am the LORD in the midst of the earth.</P
><P
>23. And I will put a division between my people and thy people: to morrow shall this sign be.</P
><P
>24. And the LORD did so; and there came a grievous swarm of flies into the house of Pharaoh, and into his servants' houses, and into all the land of Egypt: the land was corrupted by reason of the swarm of flies.</P
><P
>25. ¶ And Pharaoh called for Moses and for Aaron, and said, Go ye, sacrifice to your God in the land.</P
><P
>26. And Moses said, It is not meet so to do; for we shall sacrifice the abomination of the Egyptians to the LORD our God: lo, shall we sacrifice the abomination of the Egyptians before their eyes, and will they not stone us?</P
><P
>27. We will go three days' journey into the wilderness, and sacrifice to the LORD our God, as he shall command us.</P
><P
>28. And Pharaoh said, I will let you go, that ye may sacrifice to the LORD your God in the wilderness; only ye shall not go very far away: intreat for me.</P
><P
>29. And Moses said, Behold, I go out from thee, and I will intreat the LORD that the swarms of flies may depart from Pharaoh, from his servants, and from his people, to morrow: but let not Pharaoh deal deceitfully any more in not letting the people go to sacrifice to the LORD.</P
><P
>30. And Moses went out from Pharaoh, and intreated the LORD.</P
><P
>31. And the LORD did according to the word of Moses; and he removed the swarms of flies from Pharaoh, from his servants, and from his people; there remained not one.</P
><P
>32. And Pharaoh hardened his heart at this time also, neither would he let the people go.</P
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="x1808.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="x1869.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>Chapter 7</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="c1641.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>Chapter 9</TD
></TR
></TABLE
></DIV
></BODY
></HTML
> | hyperdriveguy/OpenGospel | scriptures.nephi.org/docbook/ot/x1835.html | HTML | gpl-3.0 | 7,114 |
package com.alejandros.gesturephoto;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.hardware.Camera;
import android.net.Uri;
import android.os.Bundle;
import android.os.Environment;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.widget.FrameLayout;
import android.widget.Toast;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Date;
import android.os.Handler;
public class CameraActivity extends AppCompatActivity {
private static final String TAG = "CameraActivity";
private Camera mCamera;
private CameraPreview mPreview;
private Camera.PictureCallback mPicture;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_camera);
// Create an instance of Camera
mCamera = getCameraInstance();
// Create our Preview view and set it as the content of our activity.
mPreview = new CameraPreview(this, mCamera);
FrameLayout preview = (FrameLayout) findViewById(R.id.camera_preview);
preview.addView(mPreview);
// Execute some code after 2 seconds have passed
Handler handler = new Handler();
handler.postDelayed(new Runnable() {
public void run() {
mCamera.takePicture(null, null, mPicture);
String path = Environment.getExternalStoragePublicDirectory(
Environment.DIRECTORY_PICTURES) + "/" + getString(R.string.app_name);;
Toast.makeText(CameraActivity.this, getString(R.string.camera_savedTo) + path, Toast.LENGTH_LONG).show();
}
}, 3000);
mPicture = new Camera.PictureCallback() {
@Override
public void onPictureTaken(byte[] data, Camera camera) {
File pictureFile = getOutputMediaFile(MEDIA_TYPE_IMAGE);
if (pictureFile == null){
Log.d(TAG, getString(R.string.camera_permissionError));
return;
}
try {
FileOutputStream fos = new FileOutputStream(pictureFile);
fos.write(data);
fos.close();
} catch (FileNotFoundException e) {
Log.d(TAG, getString(R.string.camera_fileError) + e.getMessage());
} catch (IOException e) {
Log.d(TAG, getString(R.string.camera_accesingError) + e.getMessage());
}
Intent intent = new Intent(CameraActivity.this, GesturePhoto.class);
startActivity(intent);
}
};
}
// Back button disabled
@Override
public void onBackPressed() {
}
@Override
protected void onPause() {
super.onPause();
releaseCamera(); // release the camera immediately on pause event
}
private void releaseCamera(){
if (mCamera != null){
mCamera.release(); // release the camera for other applications
mCamera = null;
}
}
/** Check if this device has a camera */
private boolean checkCameraHardware(Context context){
if (context.getPackageManager().hasSystemFeature(PackageManager.FEATURE_CAMERA)){
// this device has a camera
return true;
} else {
// no camera on this device
return false;
}
}
/** A safe way to get an instance of the Camera object. */
public static Camera getCameraInstance(){
Camera c = null;
try {
c = Camera.open(); // attempt to get a Camera instance
c.setDisplayOrientation(90);
}
catch (Exception e){
// Camera is not available (in use or does not exist)
}
return c; // returns null if camera is unavailable
}
public static final int MEDIA_TYPE_IMAGE = 1;
public static final int MEDIA_TYPE_VIDEO = 2;
/** Create a file Uri for saving an image or video */
private static Uri getOutputMediaFileUri(int type){
return Uri.fromFile(getOutputMediaFile(type));
}
/** Create a File for saving an image or video */
private static File getOutputMediaFile(int type){
// To be safe, you should check that the SDCard is mounted
// using Environment.getExternalStorageState() before doing this.
File mediaStorageDir = new File(Environment.getExternalStoragePublicDirectory(
Environment.DIRECTORY_PICTURES), "MyCameraApp");
// This location works best if you want the created images to be shared
// between applications and persist after your app has been uninstalled.
// Create the storage directory if it does not exist
if (! mediaStorageDir.exists()){
if (! mediaStorageDir.mkdirs()){
Log.d("MyCameraApp", "failed to create directory");
return null;
}
}
// Create a media file name
String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmss").format(new Date());
File mediaFile;
if (type == MEDIA_TYPE_IMAGE){
mediaFile = new File(mediaStorageDir.getPath() + File.separator +
"IMG_" + timeStamp + ".jpg");
} else if(type == MEDIA_TYPE_VIDEO) {
mediaFile = new File(mediaStorageDir.getPath() + File.separator +
"VID_"+ timeStamp + ".mp4");
} else {
return null;
}
return mediaFile;
}
}
| Darth-ATA/npi-android-project | GesturePhoto/app/src/main/java/com/alejandros/gesturephoto/CameraActivity.java | Java | gpl-3.0 | 5,795 |
/****************************************************************************
**
** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the Qt3D module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** GNU Lesser General Public License Usage
** This file may be used under the terms of the GNU Lesser General Public
** License version 2.1 as published by the Free Software Foundation and
** appearing in the file LICENSE.LGPL included in the packaging of this
** file. Please review the following information to ensure the GNU Lesser
** General Public License version 2.1 requirements will be met:
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU General
** Public License version 3.0 as published by the Free Software Foundation
** and appearing in the file LICENSE.GPL included in the packaging of this
** file. Please review the following information to ensure the GNU General
** Public License version 3.0 requirements will be met:
** http://www.gnu.org/copyleft/gpl.html.
**
** Other Usage
** Alternatively, this file may be used in accordance with the terms and
** conditions contained in a signed written agreement between you and Nokia.
**
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef QGRAPHICSBILLBOARDTRANSFORM_H
#define QGRAPHICSBILLBOARDTRANSFORM_H
#include "qgraphicstransform3d.h"
#include <QtCore/qscopedpointer.h>
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
class QGraphicsBillboardTransformPrivate;
class Q_QT3D_EXPORT QGraphicsBillboardTransform : public QGraphicsTransform3D
{
Q_OBJECT
Q_PROPERTY(bool preserveUpVector READ preserveUpVector WRITE setPreserveUpVector NOTIFY preserveUpVectorChanged)
public:
QGraphicsBillboardTransform(QObject *parent = 0);
~QGraphicsBillboardTransform();
bool preserveUpVector() const;
void setPreserveUpVector(bool value);
void applyTo(QMatrix4x4 *matrix) const;
QGraphicsTransform3D *clone(QObject *parent) const;
Q_SIGNALS:
void preserveUpVectorChanged();
private:
QScopedPointer<QGraphicsBillboardTransformPrivate> d_ptr;
Q_DISABLE_COPY(QGraphicsBillboardTransform)
Q_DECLARE_PRIVATE(QGraphicsBillboardTransform)
};
QT_END_NAMESPACE
QT_END_HEADER
#endif
| lssfau/walberla | src/gui/extern/Qt3D/graphicsview/qgraphicsbillboardtransform.h | C | gpl-3.0 | 2,693 |
#ifndef PM_SYSTEM_H_INCLUDED
#define PM_SYSTEM_H_INCLUDED
#ifdef __cplusplus
extern "C" {
#endif
#if 0
} /* to fake out automatic code indenters */
#endif
void
pm_system2_vp(const char * const progName,
const char ** const argArray,
void stdinFeeder(int, void *),
void * const feederParm,
void stdoutAccepter(int, void *),
void * const accepterParm,
int * const termStatusP);
void
pm_system2_lp(const char * const progName,
void stdinFeeder(int, void *),
void * const feederParm,
void stdoutAccepter(int, void *),
void * const accepterParm,
int * const termStatusP,
...);
void
pm_system2(void stdinFeeder(int, void *),
void * const feederParm,
void stdoutAccepter(int, void *),
void * const accepterParm,
const char * const shellCommand,
int * const termStatusP);
void
pm_system_vp(const char * const progName,
const char ** const argArray,
void stdinFeeder(int, void *),
void * const feederParm,
void stdoutAccepter(int, void *),
void * const accepterParm);
void
pm_system_lp(const char * const progName,
void stdinFeeder(int, void *),
void * const feederParm,
void stdoutAccepter(int, void *),
void * const accepterParm,
...);
void
pm_system(void stdinFeeder(int, void *),
void * const feederParm,
void stdoutAccepter(int, void *),
void * const accepterParm,
const char * const shellCommand);
const char *
pm_termStatusDesc(int const termStatus);
/* The following are Standard Input feeders and Standard Output accepters
for pm_system() etc.
*/
void
pm_feed_null(int const pipeToFeedFd,
void * const feederParm);
void
pm_accept_null(int const pipetosuckFd,
void * const accepterParm);
struct bufferDesc {
/* This is just a parameter for the routines below */
unsigned int size;
unsigned char * buffer;
unsigned int * bytesTransferredP;
};
/* The struct name "bufferDesc", without the "pm" namespace, is an unfortunate
historical accident.
*/
typedef struct bufferDesc pm_bufferDesc;
void
pm_feed_from_memory(int const pipeToFeedFd,
void * const feederParm);
void
pm_accept_to_memory(int const pipetosuckFd,
void * const accepterParm);
#ifdef __cplusplus
}
#endif
#endif
| fritsche/curso-cuda | labs/netpbm/lib/pm_system.h | C | gpl-3.0 | 2,818 |
# Makefile.in generated by automake 1.10.1 from Makefile.am.
# hw/xgl/egl/Makefile. Generated from Makefile.in by configure.
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
pkgdatadir = $(datadir)/xorg-server
pkglibdir = $(libdir)/xorg-server
pkgincludedir = $(includedir)/xorg-server
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = arm-apple-darwin10.4.0
host_triplet = arm-apple-darwin10.4.0
bin_PROGRAMS = Xegl$(EXEEXT)
subdir = hw/xgl/egl
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \
$(top_builddir)/include/xorg-server.h \
$(top_builddir)/include/dix-config.h \
$(top_builddir)/include/xgl-config.h \
$(top_builddir)/include/xorg-config.h \
$(top_builddir)/include/xkb-config.h \
$(top_builddir)/include/xwin-config.h \
$(top_builddir)/include/kdrive-config.h
CONFIG_CLEAN_FILES =
LTLIBRARIES = $(noinst_LTLIBRARIES)
libxegl_la_LIBADD =
am_libxegl_la_OBJECTS = xegl.lo xeglinput.lo kinput.lo evdev.lo
libxegl_la_OBJECTS = $(am_libxegl_la_OBJECTS)
am__installdirs = "$(DESTDIR)$(bindir)"
binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
PROGRAMS = $(bin_PROGRAMS)
am_Xegl_OBJECTS = xeglinit.$(OBJEXT) miinitext.$(OBJEXT) \
dpmsstubs.$(OBJEXT) stubs.$(OBJEXT) fbcmap.$(OBJEXT)
Xegl_OBJECTS = $(am_Xegl_OBJECTS)
am__DEPENDENCIES_1 = libxegl.la ../libxgl.a $XSERVER_LIBS
am__DEPENDENCIES_2 =
Xegl_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(Xegl_LDFLAGS) \
$(LDFLAGS) -o $@
DEFAULT_INCLUDES = -I. -I$(top_builddir)/include
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
$(LDFLAGS) -o $@
SOURCES = $(libxegl_la_SOURCES) $(Xegl_SOURCES)
DIST_SOURCES = $(libxegl_la_SOURCES) $(Xegl_SOURCES)
RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
html-recursive info-recursive install-data-recursive \
install-dvi-recursive install-exec-recursive \
install-html-recursive install-info-recursive \
install-pdf-recursive install-ps-recursive install-recursive \
installcheck-recursive installdirs-recursive pdf-recursive \
ps-recursive uninstall-recursive
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
distclean-recursive maintainer-clean-recursive
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = ${SHELL} /home/chris/xorg/xorg-server-1.5.1/missing --run aclocal-1.10
ADMIN_MAN_DIR = $(mandir)/man$(ADMIN_MAN_SUFFIX)
ADMIN_MAN_SUFFIX = 8
ALLOCA =
AMTAR = ${SHELL} /home/chris/xorg/xorg-server-1.5.1/missing --run tar
APPDEFAULTDIR =
APPLE_APPLICATIONS_DIR = /Applications/Utilities
APP_MAN_DIR = $(mandir)/man$(APP_MAN_SUFFIX)
APP_MAN_SUFFIX = 1
AR = ar
AS = as
AUTOCONF = ${SHELL} /home/chris/xorg/xorg-server-1.5.1/missing --run autoconf
AUTOHEADER = ${SHELL} /home/chris/xorg/xorg-server-1.5.1/missing --run autoheader
AUTOMAKE = ${SHELL} /home/chris/xorg/xorg-server-1.5.1/missing --run automake-1.10
AWK = gawk
BASE_FONT_PATH = /usr/local/lib/X11/fonts
BUILD_DATE = 20111129
BUILD_TIME = 1070619
CC = /usr/bin/gcc
CCAS = /usr/bin/gcc
CCASDEPMODE = depmode=gcc3
CCASFLAGS = -g -O2
CCDEPMODE = depmode=gcc3
CFLAGS = -g -O2
COMPILEDDEFAULTFONTPATH = /usr/local/lib/X11/fonts/misc/,/usr/local/lib/X11/fonts/TTF/,/usr/local/lib/X11/fonts/OTF,/usr/local/lib/X11/fonts/Type1/,/usr/local/lib/X11/fonts/100dpi/,/usr/local/lib/X11/fonts/75dpi/,/Library/Fonts,/System/Library/Fonts
CPP = /usr/bin/gcc -E
CPPFLAGS =
CXX = g++
CXXCPP = g++ -E
CXXDEPMODE = depmode=gcc3
CXXFLAGS = -g -O2
CYGPATH_W = echo
DARWIN_LIBS =
DBUS_CFLAGS = -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include
DBUS_LIBS = -ldbus-1 -lpthread
DEFAULT_LIBRARY_PATH =
DEFAULT_LOGPREFIX =
DEFAULT_MODULE_PATH =
DEFS = -DHAVE_CONFIG_H
DEPDIR = .deps
DGA_CFLAGS =
DGA_LIBS =
DIX_CFLAGS = -DHAVE_DIX_CONFIG_H -Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -fno-strict-aliasing -D_BSD_SOURCE -DHAS_FCHOWN -DHAS_STICKY_DIR_BIT -I/usr/local/include/freetype2 -I/usr/local/include/pixman-1 -I$(top_srcdir)/include -I$(top_builddir)/include -I$(top_srcdir)/Xext -I$(top_srcdir)/composite -I$(top_srcdir)/damageext -I$(top_srcdir)/xfixes -I$(top_srcdir)/Xi -I$(top_srcdir)/mi -I$(top_srcdir)/miext/shadow -I$(top_srcdir)/miext/damage -I$(top_srcdir)/render -I$(top_srcdir)/randr -I$(top_srcdir)/fb
DLLTOOL = dlltool
DMXEXAMPLES_DEP_CFLAGS =
DMXEXAMPLES_DEP_LIBS =
DMXMODULES_CFLAGS = -I/usr/local/include/freetype2
DMXMODULES_LIBS = -L/usr/local/lib -lXmuu -lXext -lXrender -lX11 -lXfixes -lXfont -lXi -lXau -lXdmcp
DMXXIEXAMPLES_DEP_CFLAGS =
DMXXIEXAMPLES_DEP_LIBS =
DMXXMUEXAMPLES_DEP_CFLAGS =
DMXXMUEXAMPLES_DEP_LIBS =
DRI2PROTO_CFLAGS =
DRI2PROTO_LIBS =
DRIPROTO_CFLAGS =
DRIPROTO_LIBS =
DRIVER_MAN_DIR = $(mandir)/man$(DRIVER_MAN_SUFFIX)
DRIVER_MAN_SUFFIX = 4
DRI_DRIVER_PATH = /usr/local/lib/dri
DSYMUTIL = :
DTRACE =
ECHO = echo
ECHO_C =
ECHO_N = -n
ECHO_T =
EGREP = /bin/grep -E
EXEEXT =
F77 =
FFLAGS =
FILE_MAN_DIR = $(mandir)/man$(FILE_MAN_SUFFIX)
FILE_MAN_SUFFIX = 5
FREETYPE_CFLAGS =
FREETYPE_LIBS =
GLX_ARCH_DEFINES =
GLX_DEFINES =
GL_CFLAGS =
GL_LIBS =
GREP = /bin/grep
HAL_CFLAGS =
HAL_LIBS =
INSTALL = /usr/bin/install -c
INSTALL_DATA = ${INSTALL} -m 644
INSTALL_PROGRAM = ${INSTALL}
INSTALL_SCRIPT = ${INSTALL}
INSTALL_STRIP_PROGRAM = $(install_sh) -c -s
KDRIVE_CFLAGS =
KDRIVE_INCS =
KDRIVE_LIBS =
KDRIVE_LOCAL_LIBS =
KDRIVE_PURE_INCS =
KDRIVE_PURE_LIBS =
LAUNCHD = yes
LDFLAGS =
LD_EXPORT_SYMBOLS_FLAG = -rdynamic
LEX = flex
LEXLIB = -lfl
LEX_OUTPUT_ROOT = lex.yy
LIBDRM_CFLAGS =
LIBDRM_LIBS =
LIBOBJS =
LIBS = -lm
LIBTOOL = $(SHELL) $(top_builddir)/libtool
LIB_MAN_DIR = $(mandir)/man$(LIB_MAN_SUFFIX)
LIB_MAN_SUFFIX = 3
LINUXDOC =
LN_S = ln -s
LTLIBOBJS =
MAINT = #
MAKEINFO = ${SHELL} /home/chris/xorg/xorg-server-1.5.1/missing --run makeinfo
MAKE_HTML = SGML_SEARCH_PATH=NONE/share/sgml -B html --split=0
MAKE_PDF =
MAKE_PS = SGML_SEARCH_PATH=NONE/share/sgml -B latex --papersize=letter --output=ps
MAKE_TEXT = SGML_SEARCH_PATH=NONE/share/sgml GROFF_NO_SGR=y -B txt
MESA_SOURCE =
MISC_MAN_DIR = $(mandir)/man$(MISC_MAN_SUFFIX)
MISC_MAN_SUFFIX = 7
MKDIR_P = /bin/mkdir -p
MKFONTDIR =
MKFONTSCALE =
NMEDIT = nmedit
OBJC = $(CC)
OBJCCLD =
OBJCDEPMODE = depmode=none
OBJCFLAGS = $(CFLAGS)
OBJCLINK = $(LINK)
OBJDUMP = objdump
OBJEXT = o
OPENSSL_CFLAGS =
OPENSSL_LIBS = -lssl -lcrypto
PACKAGE = xorg-server
PACKAGE_BUGREPORT = https://bugs.freedesktop.org/enter_bug.cgi?product=xorg
PACKAGE_NAME = xorg-server
PACKAGE_STRING = xorg-server 1.5.1
PACKAGE_TARNAME = xorg-server
PACKAGE_VERSION = 1.5.1
PATH_SEPARATOR = :
PCIACCESS_CFLAGS =
PCIACCESS_LIBS =
PCI_TXT_IDS_PATH =
PERL =
PKG_CONFIG = /usr/bin/pkg-config
PROJECTROOT = /usr/local
PS2PDF =
RANLIB = ranlib
RAWCPP = /usr/bin/cpp
RAWCPPFLAGS = -traditional
SED = /bin/sed
SERVER_MISC_CONFIG_PATH = /usr/local/lib/xorg
SET_MAKE =
SHELL = /bin/sh
SOLARIS_ASM_CFLAGS =
SOLARIS_INOUT_ARCH =
STRIP = strip
TSLIB_CFLAGS =
TSLIB_LIBS =
UTILS_SYS_LIBS =
VENDOR_MAN_VERSION = Version 1.5.1
VENDOR_NAME = The X.Org Foundation
VENDOR_NAME_SHORT = X.Org
VENDOR_RELEASE = (((1) * 10000000) + ((5) * 100000) + ((1) * 1000) + 0)
VERSION = 1.5.1
X11APP_ARCHS = ppc i386
X11EXAMPLES_DEP_CFLAGS =
X11EXAMPLES_DEP_LIBS =
XDMCP_CFLAGS =
XDMCP_LIBS = -L/usr/local/lib -lXdmcp
XDMXCONFIG_DEP_CFLAGS =
XDMXCONFIG_DEP_LIBS =
XDMX_CFLAGS =
XDMX_LIBS =
XDMX_SYS_LIBS =
XEGLMODULES_CFLAGS =
XEGL_LIBS = \
\
libxegl.la \
../libxgl.a \
$XSERVER_LIBS
XEGL_SYS_LIBS =
XEPHYR_CFLAGS =
XEPHYR_DRI_LIBS =
XEPHYR_INCS =
XEPHYR_LIBS =
XF86CONFIGFILE =
XF86MISC_CFLAGS =
XF86MISC_LIBS =
XF86VIDMODE_CFLAGS =
XF86VIDMODE_LIBS =
XGLMODULES_CFLAGS =
XGLMODULES_LIBS =
XGLXMODULES_CFLAGS =
XGLXMODULES_LIBS =
XGLX_LIBS =
XGLX_SYS_LIBS =
XGL_LIBS =
XGL_MODULE_PATH =
XGL_SYS_LIBS =
XKB_BASE_DIRECTORY = /usr/local/share/X11/xkb
XKB_BIN_DIRECTORY = /usr/local/bin
XKB_COMPILED_DIR = /usr/local/share/X11/xkb/compiled
XKM_OUTPUT_DIR = /usr/local/share/X11/xkb/compiled/
XLIB_CFLAGS =
XLIB_LIBS =
XNESTMODULES_CFLAGS = -I/usr/local/include/freetype2
XNESTMODULES_LIBS = -L/usr/local/lib -lXfont -lXext -lX11 -lXau -lXdmcp
XNEST_LIBS = $(top_builddir)/fb/libfb.la $(top_builddir)/xfixes/libxfixes.la $(top_builddir)/mi/libmi.la $(top_builddir)/Xext/libXext.la $(top_builddir)/dbe/libdbe.la $(top_builddir)/render/librender.la $(top_builddir)/randr/librandr.la $(top_builddir)/damageext/libdamageext.la $(top_builddir)/miext/damage/libdamage.la $(top_builddir)/miext/shadow/libshadow.la $(top_builddir)/Xi/libXi.la $(top_builddir)/xkb/libxkb.la $(top_builddir)/xkb/libxkbstubs.la $(top_builddir)/composite/libcomposite.la $(top_builddir)/dix/libxpstubs.la $(top_builddir)/dix/libdix.la $(top_builddir)/os/libos.la $(top_builddir)/config/libconfig.a
XNEST_SYS_LIBS = -L/usr/local/lib -lXfont -lXext -lX11 -lXau -lXdmcp
XORGCFG_DEP_CFLAGS =
XORGCFG_DEP_LIBS =
XORGCONFIG_DEP_CFLAGS =
XORGCONFIG_DEP_LIBS =
XORG_CFLAGS =
XORG_INCS =
XORG_LIBS =
XORG_MODULES_CFLAGS =
XORG_MODULES_LIBS =
XORG_OS =
XORG_OS_SUBDIR =
XORG_SYS_LIBS =
XPRINTMODULES_CFLAGS =
XPRINTMODULES_LIBS =
XPRINTPROTO_CFLAGS =
XPRINTPROTO_LIBS =
XPRINT_CFLAGS =
XPRINT_LIBS =
XPRINT_SYS_LIBS =
XRESEXAMPLES_DEP_CFLAGS =
XRESEXAMPLES_DEP_LIBS =
XSDL_INCS =
XSDL_LIBS =
XSERVERCFLAGS_CFLAGS = -D_BSD_SOURCE -DHAS_FCHOWN -DHAS_STICKY_DIR_BIT -I/usr/local/include/freetype2 -I/usr/local/include/pixman-1
XSERVERCFLAGS_LIBS = -L/usr/local/lib -lxkbfile -lXfont -lXau -lfontenc -lpixman-1 -lXdmcp
XSERVERLIBS_CFLAGS = -I/usr/local/include/freetype2 -I/usr/local/include/pixman-1
XSERVERLIBS_LIBS = -L/usr/local/lib -lXfont -lXau -lfontenc -lpixman-1 -lXdmcp
XSERVER_LIBS = $(top_builddir)/dix/libdix.la $(top_builddir)/config/libconfig.a $(top_builddir)/mi/libmi.la $(top_builddir)/os/libos.la
XSERVER_SYS_LIBS = -L/usr/local/lib -lXfont -lXau -lfontenc -lpixman-1 -lXdmcp -lm -lcrypto
XTSTEXAMPLES_DEP_CFLAGS =
XTSTEXAMPLES_DEP_LIBS =
XVFB_LIBS = $(top_builddir)/fb/libfb.la $(top_builddir)/xfixes/libxfixes.la $(top_builddir)/Xext/libXext.la $(top_builddir)/config/libconfig.a $(top_builddir)/dbe/libdbe.la $(top_builddir)/render/librender.la $(top_builddir)/randr/librandr.la $(top_builddir)/damageext/libdamageext.la $(top_builddir)/miext/damage/libdamage.la $(top_builddir)/miext/shadow/libshadow.la $(top_builddir)/Xi/libXi.la $(top_builddir)/xkb/libxkb.la $(top_builddir)/xkb/libxkbstubs.la $(top_builddir)/composite/libcomposite.la $(top_builddir)/dix/libxpstubs.la
XVFB_SYS_LIBS =
XWINMODULES_CFLAGS =
XWINMODULES_LIBS =
XWIN_LIBS = $(top_builddir)/fb/libfb.la $(top_builddir)/Xext/libXext.la $(top_builddir)/config/libconfig.a $(top_builddir)/Xi/libXi.la $(top_builddir)/xkb/libxkb.la $(top_builddir)/xkb/libxkbstubs.la $(top_builddir)/composite/libcomposite.la $(top_builddir)/damageext/libdamageext.la $(top_builddir)/dix/libxpstubs.la
XWIN_SERVER_NAME =
XWIN_SYS_LIBS =
YACC = bison -y
YFLAGS =
__XCONFIGFILE__ =
abi_ansic =
abi_extension =
abi_font =
abi_videodrv =
abi_xinput =
abs_builddir = /home/chris/xorg/xorg-server-1.5.1/hw/xgl/egl
abs_srcdir = /home/chris/xorg/xorg-server-1.5.1/hw/xgl/egl
abs_top_builddir = /home/chris/xorg/xorg-server-1.5.1
abs_top_srcdir = /home/chris/xorg/xorg-server-1.5.1
ac_ct_CC = /usr/bin/gcc
ac_ct_CXX = g++
ac_ct_F77 =
am__include = include
am__leading_dot = .
am__quote =
am__tar = ${AMTAR} chof - "$$tardir"
am__untar = ${AMTAR} xf -
bindir = ${exec_prefix}/bin
build = arm-apple-darwin10.4.0
build_alias =
build_cpu = arm
build_os = darwin10.4.0
build_vendor = apple
builddir = .
datadir = ${datarootdir}
datarootdir = ${prefix}/share
docdir = ${datarootdir}/doc/${PACKAGE_TARNAME}
driverdir =
dvidir = ${docdir}
exec_prefix = ${prefix}
extdir =
ft_config =
host = arm-apple-darwin10.4.0
host_alias =
host_cpu = arm
host_os = darwin10.4.0
host_vendor = apple
htmldir = ${docdir}
includedir = ${prefix}/include
infodir = ${datarootdir}/info
install_sh = $(SHELL) /home/chris/xorg/xorg-server-1.5.1/install-sh
launchagentsdir = /Library/LaunchAgents
libdir = ${exec_prefix}/lib
libexecdir = ${exec_prefix}/libexec
localedir = ${datarootdir}/locale
localstatedir = ${prefix}/var
logdir = ${prefix}/var/log
mandir = ${datarootdir}/man
mkdir_p = /bin/mkdir -p
moduledir = ${exec_prefix}/lib/xorg/modules
oldincludedir = /usr/include
pdfdir = ${docdir}
prefix = /usr/local
program_transform_name = s,x,x,
psdir = ${docdir}
sbindir = ${exec_prefix}/sbin
sdkdir =
sharedstatedir = ${prefix}/com
srcdir = .
sysconfdir = ${prefix}/etc
target_alias =
top_build_prefix = ../../../
top_builddir = ../../..
top_srcdir = ../../..
xglmoduledir =
xpconfigdir =
#XGL_MODULE_DIRS = module
DIST_SUBDIRS = module
SUBDIRS = \
. \
$(XGL_MODULE_DIRS)
AM_CFLAGS = \
$(DIX_CFLAGS) \
-DHAVE_XGL_CONFIG_H \
-DHAVE_DIX_CONFIG_H \
$(XEGLMODULES_CFLAGS)
noinst_LTLIBRARIES = libxegl.la
libxegl_la_SOURCES = \
xegl.h \
xegl.c \
xeglinput.c \
kkeymap.h \
kinput.c \
evdev.c
Xegl_LDFLAGS = -export-dynamic
Xegl_SOURCES = \
xeglinit.c \
$(top_srcdir)/mi/miinitext.c \
$(top_srcdir)/Xext/dpmsstubs.c \
$(top_srcdir)/Xi/stubs.c \
$(top_srcdir)/fb/fbcmap.c
Xegl_DEPENDENCIES = $(XEGL_LIBS)
Xegl_LDADD = $(XEGL_LIBS) $(XSERVER_SYS_LIBS) $(XEGL_SYS_LIBS)
all: all-recursive
.SUFFIXES:
.SUFFIXES: .c .lo .o .obj
$(srcdir)/Makefile.in: # $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
&& exit 0; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign hw/xgl/egl/Makefile'; \
cd $(top_srcdir) && \
$(AUTOMAKE) --foreign hw/xgl/egl/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: # $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): # $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
clean-noinstLTLIBRARIES:
-test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
@list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
test "$$dir" != "$$p" || dir=.; \
echo "rm -f \"$${dir}/so_locations\""; \
rm -f "$${dir}/so_locations"; \
done
libxegl.la: $(libxegl_la_OBJECTS) $(libxegl_la_DEPENDENCIES)
$(LINK) $(libxegl_la_OBJECTS) $(libxegl_la_LIBADD) $(LIBS)
install-binPROGRAMS: $(bin_PROGRAMS)
@$(NORMAL_INSTALL)
test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
@list='$(bin_PROGRAMS)'; for p in $$list; do \
p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
if test -f $$p \
|| test -f $$p1 \
; then \
f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \
$(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \
else :; fi; \
done
uninstall-binPROGRAMS:
@$(NORMAL_UNINSTALL)
@list='$(bin_PROGRAMS)'; for p in $$list; do \
f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
rm -f "$(DESTDIR)$(bindir)/$$f"; \
done
clean-binPROGRAMS:
@list='$(bin_PROGRAMS)'; for p in $$list; do \
f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
echo " rm -f $$p $$f"; \
rm -f $$p $$f ; \
done
Xegl$(EXEEXT): $(Xegl_OBJECTS) $(Xegl_DEPENDENCIES)
@rm -f Xegl$(EXEEXT)
$(Xegl_LINK) $(Xegl_OBJECTS) $(Xegl_LDADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
include ./$(DEPDIR)/dpmsstubs.Po
include ./$(DEPDIR)/evdev.Plo
include ./$(DEPDIR)/fbcmap.Po
include ./$(DEPDIR)/kinput.Plo
include ./$(DEPDIR)/miinitext.Po
include ./$(DEPDIR)/stubs.Po
include ./$(DEPDIR)/xegl.Plo
include ./$(DEPDIR)/xeglinit.Po
include ./$(DEPDIR)/xeglinput.Plo
.c.o:
$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
# source='$<' object='$@' libtool=no \
# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
# $(COMPILE) -c $<
.c.obj:
$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
# source='$<' object='$@' libtool=no \
# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
# $(COMPILE) -c `$(CYGPATH_W) '$<'`
.c.lo:
$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
# source='$<' object='$@' libtool=yes \
# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
# $(LTCOMPILE) -c -o $@ $<
miinitext.o: $(top_srcdir)/mi/miinitext.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT miinitext.o -MD -MP -MF $(DEPDIR)/miinitext.Tpo -c -o miinitext.o `test -f '$(top_srcdir)/mi/miinitext.c' || echo '$(srcdir)/'`$(top_srcdir)/mi/miinitext.c
mv -f $(DEPDIR)/miinitext.Tpo $(DEPDIR)/miinitext.Po
# source='$(top_srcdir)/mi/miinitext.c' object='miinitext.o' libtool=no \
# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o miinitext.o `test -f '$(top_srcdir)/mi/miinitext.c' || echo '$(srcdir)/'`$(top_srcdir)/mi/miinitext.c
miinitext.obj: $(top_srcdir)/mi/miinitext.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT miinitext.obj -MD -MP -MF $(DEPDIR)/miinitext.Tpo -c -o miinitext.obj `if test -f '$(top_srcdir)/mi/miinitext.c'; then $(CYGPATH_W) '$(top_srcdir)/mi/miinitext.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/mi/miinitext.c'; fi`
mv -f $(DEPDIR)/miinitext.Tpo $(DEPDIR)/miinitext.Po
# source='$(top_srcdir)/mi/miinitext.c' object='miinitext.obj' libtool=no \
# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o miinitext.obj `if test -f '$(top_srcdir)/mi/miinitext.c'; then $(CYGPATH_W) '$(top_srcdir)/mi/miinitext.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/mi/miinitext.c'; fi`
dpmsstubs.o: $(top_srcdir)/Xext/dpmsstubs.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dpmsstubs.o -MD -MP -MF $(DEPDIR)/dpmsstubs.Tpo -c -o dpmsstubs.o `test -f '$(top_srcdir)/Xext/dpmsstubs.c' || echo '$(srcdir)/'`$(top_srcdir)/Xext/dpmsstubs.c
mv -f $(DEPDIR)/dpmsstubs.Tpo $(DEPDIR)/dpmsstubs.Po
# source='$(top_srcdir)/Xext/dpmsstubs.c' object='dpmsstubs.o' libtool=no \
# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dpmsstubs.o `test -f '$(top_srcdir)/Xext/dpmsstubs.c' || echo '$(srcdir)/'`$(top_srcdir)/Xext/dpmsstubs.c
dpmsstubs.obj: $(top_srcdir)/Xext/dpmsstubs.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dpmsstubs.obj -MD -MP -MF $(DEPDIR)/dpmsstubs.Tpo -c -o dpmsstubs.obj `if test -f '$(top_srcdir)/Xext/dpmsstubs.c'; then $(CYGPATH_W) '$(top_srcdir)/Xext/dpmsstubs.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/Xext/dpmsstubs.c'; fi`
mv -f $(DEPDIR)/dpmsstubs.Tpo $(DEPDIR)/dpmsstubs.Po
# source='$(top_srcdir)/Xext/dpmsstubs.c' object='dpmsstubs.obj' libtool=no \
# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dpmsstubs.obj `if test -f '$(top_srcdir)/Xext/dpmsstubs.c'; then $(CYGPATH_W) '$(top_srcdir)/Xext/dpmsstubs.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/Xext/dpmsstubs.c'; fi`
stubs.o: $(top_srcdir)/Xi/stubs.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT stubs.o -MD -MP -MF $(DEPDIR)/stubs.Tpo -c -o stubs.o `test -f '$(top_srcdir)/Xi/stubs.c' || echo '$(srcdir)/'`$(top_srcdir)/Xi/stubs.c
mv -f $(DEPDIR)/stubs.Tpo $(DEPDIR)/stubs.Po
# source='$(top_srcdir)/Xi/stubs.c' object='stubs.o' libtool=no \
# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o stubs.o `test -f '$(top_srcdir)/Xi/stubs.c' || echo '$(srcdir)/'`$(top_srcdir)/Xi/stubs.c
stubs.obj: $(top_srcdir)/Xi/stubs.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT stubs.obj -MD -MP -MF $(DEPDIR)/stubs.Tpo -c -o stubs.obj `if test -f '$(top_srcdir)/Xi/stubs.c'; then $(CYGPATH_W) '$(top_srcdir)/Xi/stubs.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/Xi/stubs.c'; fi`
mv -f $(DEPDIR)/stubs.Tpo $(DEPDIR)/stubs.Po
# source='$(top_srcdir)/Xi/stubs.c' object='stubs.obj' libtool=no \
# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o stubs.obj `if test -f '$(top_srcdir)/Xi/stubs.c'; then $(CYGPATH_W) '$(top_srcdir)/Xi/stubs.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/Xi/stubs.c'; fi`
fbcmap.o: $(top_srcdir)/fb/fbcmap.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT fbcmap.o -MD -MP -MF $(DEPDIR)/fbcmap.Tpo -c -o fbcmap.o `test -f '$(top_srcdir)/fb/fbcmap.c' || echo '$(srcdir)/'`$(top_srcdir)/fb/fbcmap.c
mv -f $(DEPDIR)/fbcmap.Tpo $(DEPDIR)/fbcmap.Po
# source='$(top_srcdir)/fb/fbcmap.c' object='fbcmap.o' libtool=no \
# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o fbcmap.o `test -f '$(top_srcdir)/fb/fbcmap.c' || echo '$(srcdir)/'`$(top_srcdir)/fb/fbcmap.c
fbcmap.obj: $(top_srcdir)/fb/fbcmap.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT fbcmap.obj -MD -MP -MF $(DEPDIR)/fbcmap.Tpo -c -o fbcmap.obj `if test -f '$(top_srcdir)/fb/fbcmap.c'; then $(CYGPATH_W) '$(top_srcdir)/fb/fbcmap.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/fb/fbcmap.c'; fi`
mv -f $(DEPDIR)/fbcmap.Tpo $(DEPDIR)/fbcmap.Po
# source='$(top_srcdir)/fb/fbcmap.c' object='fbcmap.obj' libtool=no \
# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o fbcmap.obj `if test -f '$(top_srcdir)/fb/fbcmap.c'; then $(CYGPATH_W) '$(top_srcdir)/fb/fbcmap.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/fb/fbcmap.c'; fi`
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
# This directory's subdirectories are mostly independent; you can cd
# into them and run `make' without going through this Makefile.
# To change the values of `make' variables: instead of editing Makefiles,
# (1) if the variable is set in `config.status', edit `config.status'
# (which will cause the Makefiles to be regenerated when you run `make');
# (2) otherwise, pass the desired values on the `make' command line.
$(RECURSIVE_TARGETS):
@failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
*k*) failcom='fail=yes';; \
esac; \
done; \
dot_seen=no; \
target=`echo $@ | sed s/-recursive//`; \
list='$(SUBDIRS)'; for subdir in $$list; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
dot_seen=yes; \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| eval $$failcom; \
done; \
if test "$$dot_seen" = "no"; then \
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
fi; test -z "$$fail"
$(RECURSIVE_CLEAN_TARGETS):
@failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
*k*) failcom='fail=yes';; \
esac; \
done; \
dot_seen=no; \
case "$@" in \
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
*) list='$(SUBDIRS)' ;; \
esac; \
rev=''; for subdir in $$list; do \
if test "$$subdir" = "."; then :; else \
rev="$$subdir $$rev"; \
fi; \
done; \
rev="$$rev ."; \
target=`echo $@ | sed s/-recursive//`; \
for subdir in $$rev; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| eval $$failcom; \
done && test -z "$$fail"
tags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
done
ctags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
done
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
mkid -fID $$unique
tags: TAGS
TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
include_option=--etags-include; \
empty_fix=.; \
else \
include_option=--include; \
empty_fix=; \
fi; \
list='$(SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test ! -f $$subdir/TAGS || \
tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
fi; \
done; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$tags $$unique; \
fi
ctags: CTAGS
CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$tags $$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& cd $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) $$here
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \
test -f $(distdir)/$$file \
|| cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test -d "$(distdir)/$$subdir" \
|| $(MKDIR_P) "$(distdir)/$$subdir" \
|| exit 1; \
distdir=`$(am__cd) $(distdir) && pwd`; \
top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
(cd $$subdir && \
$(MAKE) $(AM_MAKEFLAGS) \
top_distdir="$$top_distdir" \
distdir="$$distdir/$$subdir" \
am__remove_distdir=: \
am__skip_length_check=: \
distdir) \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-recursive
all-am: Makefile $(LTLIBRARIES) $(PROGRAMS)
installdirs: installdirs-recursive
installdirs-am:
for dir in "$(DESTDIR)$(bindir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-recursive
install-exec: install-exec-recursive
install-data: install-data-recursive
uninstall: uninstall-recursive
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-recursive
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-recursive
clean-am: clean-binPROGRAMS clean-generic clean-libtool \
clean-noinstLTLIBRARIES mostlyclean-am
distclean: distclean-recursive
-rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
dvi: dvi-recursive
dvi-am:
html: html-recursive
info: info-recursive
info-am:
install-data-am:
install-dvi: install-dvi-recursive
install-exec-am: install-binPROGRAMS
install-html: install-html-recursive
install-info: install-info-recursive
install-man:
install-pdf: install-pdf-recursive
install-ps: install-ps-recursive
installcheck-am:
maintainer-clean: maintainer-clean-recursive
-rm -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-recursive
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
mostlyclean-libtool
pdf: pdf-recursive
pdf-am:
ps: ps-recursive
ps-am:
uninstall-am: uninstall-binPROGRAMS
.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \
install-strip
.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
all all-am check check-am clean clean-binPROGRAMS \
clean-generic clean-libtool clean-noinstLTLIBRARIES ctags \
ctags-recursive distclean distclean-compile distclean-generic \
distclean-libtool distclean-tags distdir dvi dvi-am html \
html-am info info-am install install-am install-binPROGRAMS \
install-data install-data-am install-dvi install-dvi-am \
install-exec install-exec-am install-html install-html-am \
install-info install-info-am install-man install-pdf \
install-pdf-am install-ps install-ps-am install-strip \
installcheck installcheck-am installdirs installdirs-am \
maintainer-clean maintainer-clean-generic mostlyclean \
mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
pdf pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \
uninstall-binPROGRAMS
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
| chriskmanx/qmole | QMOLEDEV/xorg-ignore/xorg-server-1.5.1/hw/xgl/egl/Makefile | Makefile | gpl-3.0 | 33,488 |
/*
* Vlakno1.java
*
* Created on Nedeľa, 2007, júl 15, 18:03
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/
package org.archive.test;
/**
*
* @author praso
*/
public class Vlakno1 {
/** Creates a new instance of Vlakno1 */
public Vlakno1() {
}
}
| WebArchivCZ/webanalyzer | src/org/archive/test/Vlakno1.java | Java | gpl-3.0 | 338 |
-- --------------------------------------------------------
-- Host: localhost
-- Server version: 5.6.20-log - MySQL Community Server (GPL)
-- Server OS: Win32
-- HeidiSQL Version: 9.4.0.5125
-- --------------------------------------------------------
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET NAMES utf8 */;
/*!50503 SET NAMES utf8mb4 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
-- Dumping database structure for arubait
CREATE DATABASE IF NOT EXISTS `arubait` /*!40100 DEFAULT CHARACTER SET latin1 */;
USE `arubait`;
-- Dumping structure for table arubait.book
CREATE TABLE IF NOT EXISTS `book` (
`job_id` int(11) NOT NULL,
`user_email` varchar(100) NOT NULL,
`book_status` int(11) DEFAULT '0',
UNIQUE KEY `job_id_user_id` (`job_id`,`user_email`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- Dumping data for table arubait.book: ~2 rows (approximately)
/*!40000 ALTER TABLE `book` DISABLE KEYS */;
INSERT INTO `book` (`job_id`, `user_email`, `book_status`) VALUES
(1, 'syafiqahaqilahmh@gmail.com', 1),
(2, 'sofea5488@gmail.com', 0),
(6, 'syafiqahaqilahmh@gmail.com', 1);
/*!40000 ALTER TABLE `book` ENABLE KEYS */;
-- Dumping structure for table arubait.follow
CREATE TABLE IF NOT EXISTS `follow` (
`user_email` varchar(100) NOT NULL,
`employer_email` varchar(100) NOT NULL,
`follow_status` int(1) NOT NULL DEFAULT '0',
UNIQUE KEY `user_email_employer_email` (`user_email`,`employer_email`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- Dumping data for table arubait.follow: ~10 rows (approximately)
/*!40000 ALTER TABLE `follow` DISABLE KEYS */;
INSERT INTO `follow` (`user_email`, `employer_email`, `follow_status`) VALUES
('sofea5488@gmail.com', 'amirul.ghanie@gmail.com', 0),
('sofea5488@gmail.com', 'sofea5488@gmail.com', 1),
('sofea5488@gmail.com', 'syafiqahaqilahmh@gmail.com', 1),
('sofea5488@gmail.com', 'syirah.suhaimi@gmail.com', 1),
('sofea5488@gmail.com', 'zulfikrizulkiflee@gmail.com', 1),
('syafiqahaqilahmh@gmail.com', 'sofea5488@gmail.com', 1),
('syafiqahaqilahmh@gmail.com', 'zulfikrizulkiflee@gmail.com', 1),
('syirah.suhaimi@gmail.com', 'sofea5488@gmail.com', 1),
('syirah.suhaimi@gmail.com', 'zulfikrizulkiflee@gmail.com', 0),
('zulfikrizulkiflee@gmail.com', 'sofea5488@gmail.com', 1);
/*!40000 ALTER TABLE `follow` ENABLE KEYS */;
-- Dumping structure for table arubait.job_applied
CREATE TABLE IF NOT EXISTS `job_applied` (
`status` varchar(50) NOT NULL COMMENT 'new,applied,accept,reject,confirm,start,close,reopen,cancel',
`job_id` int(11) DEFAULT NULL,
`user_email` varchar(100) DEFAULT NULL,
UNIQUE KEY `job_id_user_email` (`job_id`,`user_email`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- Dumping data for table arubait.job_applied: ~10 rows (approximately)
/*!40000 ALTER TABLE `job_applied` DISABLE KEYS */;
INSERT INTO `job_applied` (`status`, `job_id`, `user_email`) VALUES
('applied', 1, 'sofea5488@gmail.com'),
('confirmed', 30, 'sofea5488@gmail.com'),
('confirmed', 30, 'syirah.suhaimi@gmail.com'),
('confirmed', 1, 'syirah.suhaimi@gmail.com'),
('applied', 31, 'syafiqahaqilahmh@gmail.com'),
('applied', 52, 'syafiqahaqilahmh@gmail.com'),
('accepted', 52, 'sofea5488@gmail.com'),
('accepted', 2, 'syafiqahaqilahmh@gmail.com'),
('accepted', 2, 'syirah.suhaimi@gmail.com'),
('applied', 0, 'sofea5488@gmail.com'),
('applied', 57, 'syafiqahaqilahmh@gmail.com'),
('accepted', 2, 'sofea5488@gmail.com');
/*!40000 ALTER TABLE `job_applied` ENABLE KEYS */;
-- Dumping structure for table arubait.job_category
CREATE TABLE IF NOT EXISTS `job_category` (
`category_id` int(11) NOT NULL AUTO_INCREMENT,
`category_desc` varchar(100) DEFAULT NULL,
`category_picture` varchar(100) DEFAULT NULL,
PRIMARY KEY (`category_id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=latin1;
-- Dumping data for table arubait.job_category: ~5 rows (approximately)
/*!40000 ALTER TABLE `job_category` DISABLE KEYS */;
INSERT INTO `job_category` (`category_id`, `category_desc`, `category_picture`) VALUES
(1, 'Food & Beverage', 'http://www.langtonsmithhealth.com/wp-content/uploads/food-sugars.jpg'),
(2, 'Cleaning', 'http://www.bondcleanaustralia.com.au/media/779607/Home-Cleaning-Gold-Coast.jpg'),
(3, 'Laundry', 'https://s-media-cache-ak0.pinimg.com/736x/03/01/53/03015393688bb9681ca7c5abd071374a.jpg'),
(4, 'Nursing', 'http://ncssu.com/wp-content/uploads/2016/02/nurse-preceptor-02.jpg'),
(5, 'Tourism', 'https://s-media-cache-ak0.pinimg.com/736x/0a/d9/1c/0ad91c71604576cf1a101f9881bc6562.jpg');
/*!40000 ALTER TABLE `job_category` ENABLE KEYS */;
-- Dumping structure for table arubait.job_offered
CREATE TABLE IF NOT EXISTS `job_offered` (
`job_id` int(11) NOT NULL AUTO_INCREMENT,
`user_email` varchar(100) NOT NULL,
`category_id` varchar(50) NOT NULL DEFAULT '0',
`job_desc` varchar(500) NOT NULL DEFAULT '0',
`job_date_post` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
`job_date_work` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`job_status` varchar(10) NOT NULL DEFAULT 'new' COMMENT 'NEW,APPLIED,ACCEPTED,REJECTED,COMPLETED,CANCELED',
`job_poskod` int(11) NOT NULL DEFAULT '0',
`job_address` varchar(500) NOT NULL DEFAULT '0',
`job_salary` varchar(50) NOT NULL DEFAULT '0',
`employer_rating` int(11) NOT NULL DEFAULT '0',
`employer_review` varchar(500) NOT NULL DEFAULT '0',
`employee_rating` int(11) NOT NULL DEFAULT '0',
`employee_review` varchar(500) NOT NULL DEFAULT '0',
`job_details` varchar(50) DEFAULT NULL,
`job_pic1` varchar(100) DEFAULT NULL,
`job_pic2` varchar(100) DEFAULT NULL,
`job_pic3` varchar(100) DEFAULT NULL,
PRIMARY KEY (`job_id`)
) ENGINE=InnoDB AUTO_INCREMENT=59 DEFAULT CHARSET=latin1;
-- Dumping data for table arubait.job_offered: ~12 rows (approximately)
/*!40000 ALTER TABLE `job_offered` DISABLE KEYS */;
INSERT INTO `job_offered` (`job_id`, `user_email`, `category_id`, `job_desc`, `job_date_post`, `job_date_work`, `job_status`, `job_poskod`, `job_address`, `job_salary`, `employer_rating`, `employer_review`, `employee_rating`, `employee_review`, `job_details`, `job_pic1`, `job_pic2`, `job_pic3`) VALUES
(1, 'zulfikrizulkiflee@gmail.com', '1', 'Tukang Masak', '0000-00-00 00:00:00', '2017-10-10 02:10:10', 'new', 27000, 'Greenwood', '500', 3, 'good', 3, 'good', NULL, 'https://d3tv8y14ogpztx.cloudfront.net/pulses/images/000/027/045/show_box/chef_demo-celeb_chef.jpg', NULL, NULL),
(2, 'sofea5488@gmail.com', '1', 'Tukang Buat Air', '0000-00-00 00:00:00', '2016-12-25 05:00:00', 'new', 27000, 'Kampung Inderapura', '100', 3, 'good', 3, 'good', NULL, 'http://3.bp.blogspot.com/-o_p43VuoTqg/Vdpz8vZXrCI/AAAAAAAAADQ/yRyrYKHc8Ec/s400/B8v8C1rCEAEBtL8.jpg', NULL, NULL),
(3, 'zulfikrizulkiflee@gmail.com', '2', 'Kemas Rumah', '0000-00-00 00:00:00', '0000-00-00 00:00:00', 'reopen', 27000, 'Taman Inderapura', '100', 3, 'good', 3, 'good', 'Seluruh kawasan rumah', 'http://www.brightdayeveryday.net/clean.jpg', NULL, NULL),
(6, 'zulfikrizulkiflee@gmail.com', '3', 'Gosok Baju', '0000-00-00 00:00:00', '0000-00-00 00:00:00', 'new', 0, 'Taman Pedah', '0', 0, '0', 0, '0', NULL, 'http://media.istockphoto.com/photos/woman-ironing-shirt-next-to-pile-of-laundry-picture-id175484884?', NULL, NULL),
(30, 'amirul.ghanie@gmail.com', '4', 'Pengasuh Budak', '0000-00-00 00:00:00', '2017-01-28 00:00:00', 'new', 0, 'Taman Scientex', '50', 0, '0', 0, '0', 'Jaga Budak iitu', 'http://3.bp.blogspot.com/-o_p43VuoTqg/Vdpz8vZXrCI/AAAAAAAAADQ/yRyrYKHc8Ec/s400/B8v8C1rCEAEBtL8.jpg', NULL, NULL),
(31, 'amirul.ghanie@gmail.com', '5', 'Pemandu Pelancong', '0000-00-00 00:00:00', '2017-01-31 00:00:00', 'completed', 0, 'Taman Negara', '150', 0, '0', 0, '0', 'MEmandu Pelancong', 'http://timesofindia.indiatimes.com/thumb/msid-47736051,width-400,resizemode-4/47736051.jpg', NULL, NULL),
(32, 'sofea5488@gmail.com', '2', 'Cleaner', '0000-00-00 00:00:00', '2017-01-28 00:00:00', 'new', 0, 'Taman', '200', 0, '0', 0, '0', 'sasasas', 'http://blog.chefsteps.com/wp-content/uploads/2012/12/ChefSteps-French-Press-Coffee-Grounds.jpg', NULL, NULL),
(51, 'sofea5488@gmail.com', '2', 'tebang pokok', '0000-00-00 00:00:00', '0000-00-00 00:00:00', 'reopen', 0, '', '', 0, '0', 0, '0', '', 'http://3.bp.blogspot.com/-o_p43VuoTqg/Vdpz8vZXrCI/AAAAAAAAADQ/yRyrYKHc8Ec/s400/B8v8C1rCEAEBtL8.jpg', NULL, NULL),
(52, 'syafiqahaqilahmh@gmail.com', '4', 'penjaga kjucing', '0000-00-00 00:00:00', '0000-00-00 00:00:00', 'new', 0, '', '', 0, '0', 0, '0', '', 'http://3.bp.blogspot.com/-o_p43VuoTqg/Vdpz8vZXrCI/AAAAAAAAADQ/yRyrYKHc8Ec/s400/B8v8C1rCEAEBtL8.jpg', NULL, NULL),
(54, 'syafiqahaqilahmh@gmail.com', '2', 'cuci tandas', '0000-00-00 00:00:00', '0000-00-00 00:00:00', 'new', 0, '', '234', 0, '0', 0, '0', '', 'http://3.bp.blogspot.com/-o_p43VuoTqg/Vdpz8vZXrCI/AAAAAAAAADQ/yRyrYKHc8Ec/s400/B8v8C1rCEAEBtL8.jpg', NULL, NULL),
(57, 'syafiqahaqilahmh@gmail.com', '3', 'cuci karpet', '2017-01-18 15:29:35', '0000-00-00 00:00:00', 'new', 0, '', '', 0, '0', 0, '0', '', 'http://3.bp.blogspot.com/-o_p43VuoTqg/Vdpz8vZXrCI/AAAAAAAAADQ/yRyrYKHc8Ec/s400/B8v8C1rCEAEBtL8.jpg', NULL, NULL),
(58, 'syirah.suhaimi@gmail.com', '1', 'buat kuih', '2017-01-19 12:20:09', '0000-00-00 00:00:00', 'new', 0, '', '', 0, '0', 0, '0', '', NULL, NULL, NULL);
/*!40000 ALTER TABLE `job_offered` ENABLE KEYS */;
-- Dumping structure for table arubait.notification
CREATE TABLE IF NOT EXISTS `notification` (
`noti_id` int(11) NOT NULL AUTO_INCREMENT,
`noti_desc` varchar(500) DEFAULT NULL,
`job_id` int(11) DEFAULT NULL,
`noti_target` varchar(100) DEFAULT NULL COMMENT 'job_offered,job_applied',
`user_email` varchar(100) DEFAULT NULL,
`noti_status` varchar(10) DEFAULT 'UNREAD',
PRIMARY KEY (`noti_id`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=latin1;
-- Dumping data for table arubait.notification: ~6 rows (approximately)
/*!40000 ALTER TABLE `notification` DISABLE KEYS */;
INSERT INTO `notification` (`noti_id`, `noti_desc`, `job_id`, `noti_target`, `user_email`, `noti_status`) VALUES
(1, 'Amirul has left a feedback on cuci', 4, NULL, 'sofea5488@gmail.com', 'UNREAD'),
(2, 'Kemas rumah has been applied', 3, NULL, 'sofea5488@gmail.com', 'UNREAD'),
(3, 'Aizal has left a feedback on potong rumput', 5, NULL, 'sofea5488@gmail.com', 'READ'),
(4, 'Your application for the job has been accepted. Click to confirm.', 2, 'no', 'syirah.suhaimi@gmail.com', 'UNREAD'),
(5, 'Your application for the job has been accepted. Click to confirm.', 2, 'no', 'syafiqahaqilahmh@gmail.com', 'UNREAD'),
(6, 'Your application for the job has been accepted. Click to confirm.', 52, 'no', 'sofea5488@gmail.com', 'UNREAD'),
(7, 'Your application for the job has been accepted. Click to confirm.', 2, 'no', 'sofea5488@gmail.com', 'UNREAD'),
(8, 'Your application for the job has been accepted. Click to confirm.', 52, 'no', 'syirah.suhaimi@gmail.com', 'UNREAD');
/*!40000 ALTER TABLE `notification` ENABLE KEYS */;
-- Dumping structure for table arubait.user_profile
CREATE TABLE IF NOT EXISTS `user_profile` (
`user_email` varchar(100) NOT NULL,
`user_fullname` varchar(100) DEFAULT NULL,
`user_poskod` int(10) DEFAULT NULL,
`user_address` varchar(500) DEFAULT NULL,
`user_pic` varchar(100) DEFAULT NULL,
`oauth_provider` varchar(255) NOT NULL,
`oauth_uid` varchar(255) NOT NULL,
PRIMARY KEY (`user_email`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- Dumping data for table arubait.user_profile: ~5 rows (approximately)
/*!40000 ALTER TABLE `user_profile` DISABLE KEYS */;
INSERT INTO `user_profile` (`user_email`, `user_fullname`, `user_poskod`, `user_address`, `user_pic`, `oauth_provider`, `oauth_uid`) VALUES
('amirul.ghanie@gmail.com', 'Iam Tsg', NULL, NULL, 'img/gambar1.png', '', ''),
('sofea5488@gmail.com', 'Sharifah Edruce', NULL, NULL, 'img/sofea5488@gmail.com.jpg', '', ''),
('syafiqahaqilahmh@gmail.com', 'Syafiqah Aqilah', NULL, NULL, 'img/syafiqahaqilahmh@gmail.com.jpg', '', ''),
('syirah.suhaimi@gmail.com', 'Syirah Suhaimi', NULL, NULL, 'img/syirah.suhaimi@gmail.com.jpg', '', ''),
('zulfikrizulkiflee@gmail.com', 'Zulfikri Zulkiflee', NULL, NULL, 'img/gambar3.png', '', '');
/*!40000 ALTER TABLE `user_profile` ENABLE KEYS */;
/*!40101 SET SQL_MODE=IFNULL(@OLD_SQL_MODE, '') */;
/*!40014 SET FOREIGN_KEY_CHECKS=IF(@OLD_FOREIGN_KEY_CHECKS IS NULL, 1, @OLD_FOREIGN_KEY_CHECKS) */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
| sofeaedruce/arubait | backup/arubait_20170207.sql | SQL | gpl-3.0 | 12,537 |
// This file is part of Eigen, a lightweight C++ template library
// for linear algebra.
//
// Copyright (C) 2008 Gael Guennebaud <gael.guennebaud@inria.fr>
//
// This Source Code Form is subject to the terms of the Mozilla
// Public License v. 2.0. If a copy of the MPL was not distributed
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
#ifndef STORMEIGEN_LLT_H
#define STORMEIGEN_LLT_H
namespace StormEigen {
namespace internal{
template<typename MatrixType, int UpLo> struct LLT_Traits;
}
/** \ingroup Cholesky_Module
*
* \class LLT
*
* \brief Standard Cholesky decomposition (LL^T) of a matrix and associated features
*
* \param MatrixType the type of the matrix of which we are computing the LL^T Cholesky decomposition
* \param UpLo the triangular part that will be used for the decompositon: Lower (default) or Upper.
* The other triangular part won't be read.
*
* This class performs a LL^T Cholesky decomposition of a symmetric, positive definite
* matrix A such that A = LL^* = U^*U, where L is lower triangular.
*
* While the Cholesky decomposition is particularly useful to solve selfadjoint problems like D^*D x = b,
* for that purpose, we recommend the Cholesky decomposition without square root which is more stable
* and even faster. Nevertheless, this standard Cholesky decomposition remains useful in many other
* situations like generalised eigen problems with hermitian matrices.
*
* Remember that Cholesky decompositions are not rank-revealing. This LLT decomposition is only stable on positive definite matrices,
* use LDLT instead for the semidefinite case. Also, do not use a Cholesky decomposition to determine whether a system of equations
* has a solution.
*
* Example: \include LLT_example.cpp
* Output: \verbinclude LLT_example.out
*
* \sa MatrixBase::llt(), SelfAdjointView::llt(), class LDLT
*/
/* HEY THIS DOX IS DISABLED BECAUSE THERE's A BUG EITHER HERE OR IN LDLT ABOUT THAT (OR BOTH)
* Note that during the decomposition, only the upper triangular part of A is considered. Therefore,
* the strict lower part does not have to store correct values.
*/
template<typename _MatrixType, int _UpLo> class LLT
{
public:
typedef _MatrixType MatrixType;
enum {
RowsAtCompileTime = MatrixType::RowsAtCompileTime,
ColsAtCompileTime = MatrixType::ColsAtCompileTime,
Options = MatrixType::Options,
MaxColsAtCompileTime = MatrixType::MaxColsAtCompileTime
};
typedef typename MatrixType::Scalar Scalar;
typedef typename NumTraits<typename MatrixType::Scalar>::Real RealScalar;
typedef StormEigen::Index Index; ///< \deprecated since Eigen 3.3
typedef typename MatrixType::StorageIndex StorageIndex;
enum {
PacketSize = internal::packet_traits<Scalar>::size,
AlignmentMask = int(PacketSize)-1,
UpLo = _UpLo
};
typedef internal::LLT_Traits<MatrixType,UpLo> Traits;
/**
* \brief Default Constructor.
*
* The default constructor is useful in cases in which the user intends to
* perform decompositions via LLT::compute(const MatrixType&).
*/
LLT() : m_matrix(), m_isInitialized(false) {}
/** \brief Default Constructor with memory preallocation
*
* Like the default constructor but with preallocation of the internal data
* according to the specified problem \a size.
* \sa LLT()
*/
explicit LLT(Index size) : m_matrix(size, size),
m_isInitialized(false) {}
template<typename InputType>
explicit LLT(const EigenBase<InputType>& matrix)
: m_matrix(matrix.rows(), matrix.cols()),
m_isInitialized(false)
{
compute(matrix.derived());
}
/** \returns a view of the upper triangular matrix U */
inline typename Traits::MatrixU matrixU() const
{
eigen_assert(m_isInitialized && "LLT is not initialized.");
return Traits::getU(m_matrix);
}
/** \returns a view of the lower triangular matrix L */
inline typename Traits::MatrixL matrixL() const
{
eigen_assert(m_isInitialized && "LLT is not initialized.");
return Traits::getL(m_matrix);
}
/** \returns the solution x of \f$ A x = b \f$ using the current decomposition of A.
*
* Since this LLT class assumes anyway that the matrix A is invertible, the solution
* theoretically exists and is unique regardless of b.
*
* Example: \include LLT_solve.cpp
* Output: \verbinclude LLT_solve.out
*
* \sa solveInPlace(), MatrixBase::llt(), SelfAdjointView::llt()
*/
template<typename Rhs>
inline const Solve<LLT, Rhs>
solve(const MatrixBase<Rhs>& b) const
{
eigen_assert(m_isInitialized && "LLT is not initialized.");
eigen_assert(m_matrix.rows()==b.rows()
&& "LLT::solve(): invalid number of rows of the right hand side matrix b");
return Solve<LLT, Rhs>(*this, b.derived());
}
template<typename Derived>
void solveInPlace(MatrixBase<Derived> &bAndX) const;
template<typename InputType>
LLT& compute(const EigenBase<InputType>& matrix);
/** \returns the LLT decomposition matrix
*
* TODO: document the storage layout
*/
inline const MatrixType& matrixLLT() const
{
eigen_assert(m_isInitialized && "LLT is not initialized.");
return m_matrix;
}
MatrixType reconstructedMatrix() const;
/** \brief Reports whether previous computation was successful.
*
* \returns \c Success if computation was succesful,
* \c NumericalIssue if the matrix.appears to be negative.
*/
ComputationInfo info() const
{
eigen_assert(m_isInitialized && "LLT is not initialized.");
return m_info;
}
inline Index rows() const { return m_matrix.rows(); }
inline Index cols() const { return m_matrix.cols(); }
template<typename VectorType>
LLT rankUpdate(const VectorType& vec, const RealScalar& sigma = 1);
#ifndef STORMEIGEN_PARSED_BY_DOXYGEN
template<typename RhsType, typename DstType>
STORMEIGEN_DEVICE_FUNC
void _solve_impl(const RhsType &rhs, DstType &dst) const;
#endif
protected:
static void check_template_parameters()
{
STORMEIGEN_STATIC_ASSERT_NON_INTEGER(Scalar);
}
/** \internal
* Used to compute and store L
* The strict upper part is not used and even not initialized.
*/
MatrixType m_matrix;
bool m_isInitialized;
ComputationInfo m_info;
};
namespace internal {
template<typename Scalar, int UpLo> struct llt_inplace;
template<typename MatrixType, typename VectorType>
static Index llt_rank_update_lower(MatrixType& mat, const VectorType& vec, const typename MatrixType::RealScalar& sigma)
{
using std::sqrt;
typedef typename MatrixType::Scalar Scalar;
typedef typename MatrixType::RealScalar RealScalar;
typedef typename MatrixType::ColXpr ColXpr;
typedef typename internal::remove_all<ColXpr>::type ColXprCleaned;
typedef typename ColXprCleaned::SegmentReturnType ColXprSegment;
typedef Matrix<Scalar,Dynamic,1> TempVectorType;
typedef typename TempVectorType::SegmentReturnType TempVecSegment;
Index n = mat.cols();
eigen_assert(mat.rows()==n && vec.size()==n);
TempVectorType temp;
if(sigma>0)
{
// This version is based on Givens rotations.
// It is faster than the other one below, but only works for updates,
// i.e., for sigma > 0
temp = sqrt(sigma) * vec;
for(Index i=0; i<n; ++i)
{
JacobiRotation<Scalar> g;
g.makeGivens(mat(i,i), -temp(i), &mat(i,i));
Index rs = n-i-1;
if(rs>0)
{
ColXprSegment x(mat.col(i).tail(rs));
TempVecSegment y(temp.tail(rs));
apply_rotation_in_the_plane(x, y, g);
}
}
}
else
{
temp = vec;
RealScalar beta = 1;
for(Index j=0; j<n; ++j)
{
RealScalar Ljj = numext::real(mat.coeff(j,j));
RealScalar dj = numext::abs2(Ljj);
Scalar wj = temp.coeff(j);
RealScalar swj2 = sigma*numext::abs2(wj);
RealScalar gamma = dj*beta + swj2;
RealScalar x = dj + swj2/beta;
if (x<=RealScalar(0))
return j;
RealScalar nLjj = sqrt(x);
mat.coeffRef(j,j) = nLjj;
beta += swj2/dj;
// Update the terms of L
Index rs = n-j-1;
if(rs)
{
temp.tail(rs) -= (wj/Ljj) * mat.col(j).tail(rs);
if(gamma != 0)
mat.col(j).tail(rs) = (nLjj/Ljj) * mat.col(j).tail(rs) + (nLjj * sigma*numext::conj(wj)/gamma)*temp.tail(rs);
}
}
}
return -1;
}
template<typename Scalar> struct llt_inplace<Scalar, Lower>
{
typedef typename NumTraits<Scalar>::Real RealScalar;
template<typename MatrixType>
static Index unblocked(MatrixType& mat)
{
using std::sqrt;
eigen_assert(mat.rows()==mat.cols());
const Index size = mat.rows();
for(Index k = 0; k < size; ++k)
{
Index rs = size-k-1; // remaining size
Block<MatrixType,Dynamic,1> A21(mat,k+1,k,rs,1);
Block<MatrixType,1,Dynamic> A10(mat,k,0,1,k);
Block<MatrixType,Dynamic,Dynamic> A20(mat,k+1,0,rs,k);
RealScalar x = numext::real(mat.coeff(k,k));
if (k>0) x -= A10.squaredNorm();
if (x<=RealScalar(0))
return k;
mat.coeffRef(k,k) = x = sqrt(x);
if (k>0 && rs>0) A21.noalias() -= A20 * A10.adjoint();
if (rs>0) A21 /= x;
}
return -1;
}
template<typename MatrixType>
static Index blocked(MatrixType& m)
{
eigen_assert(m.rows()==m.cols());
Index size = m.rows();
if(size<32)
return unblocked(m);
Index blockSize = size/8;
blockSize = (blockSize/16)*16;
blockSize = (std::min)((std::max)(blockSize,Index(8)), Index(128));
for (Index k=0; k<size; k+=blockSize)
{
// partition the matrix:
// A00 | - | -
// lu = A10 | A11 | -
// A20 | A21 | A22
Index bs = (std::min)(blockSize, size-k);
Index rs = size - k - bs;
Block<MatrixType,Dynamic,Dynamic> A11(m,k, k, bs,bs);
Block<MatrixType,Dynamic,Dynamic> A21(m,k+bs,k, rs,bs);
Block<MatrixType,Dynamic,Dynamic> A22(m,k+bs,k+bs,rs,rs);
Index ret;
if((ret=unblocked(A11))>=0) return k+ret;
if(rs>0) A11.adjoint().template triangularView<Upper>().template solveInPlace<OnTheRight>(A21);
if(rs>0) A22.template selfadjointView<Lower>().rankUpdate(A21,-1); // bottleneck
}
return -1;
}
template<typename MatrixType, typename VectorType>
static Index rankUpdate(MatrixType& mat, const VectorType& vec, const RealScalar& sigma)
{
return StormEigen::internal::llt_rank_update_lower(mat, vec, sigma);
}
};
template<typename Scalar> struct llt_inplace<Scalar, Upper>
{
typedef typename NumTraits<Scalar>::Real RealScalar;
template<typename MatrixType>
static STORMEIGEN_STRONG_INLINE Index unblocked(MatrixType& mat)
{
Transpose<MatrixType> matt(mat);
return llt_inplace<Scalar, Lower>::unblocked(matt);
}
template<typename MatrixType>
static STORMEIGEN_STRONG_INLINE Index blocked(MatrixType& mat)
{
Transpose<MatrixType> matt(mat);
return llt_inplace<Scalar, Lower>::blocked(matt);
}
template<typename MatrixType, typename VectorType>
static Index rankUpdate(MatrixType& mat, const VectorType& vec, const RealScalar& sigma)
{
Transpose<MatrixType> matt(mat);
return llt_inplace<Scalar, Lower>::rankUpdate(matt, vec.conjugate(), sigma);
}
};
template<typename MatrixType> struct LLT_Traits<MatrixType,Lower>
{
typedef const TriangularView<const MatrixType, Lower> MatrixL;
typedef const TriangularView<const typename MatrixType::AdjointReturnType, Upper> MatrixU;
static inline MatrixL getL(const MatrixType& m) { return MatrixL(m); }
static inline MatrixU getU(const MatrixType& m) { return MatrixU(m.adjoint()); }
static bool inplace_decomposition(MatrixType& m)
{ return llt_inplace<typename MatrixType::Scalar, Lower>::blocked(m)==-1; }
};
template<typename MatrixType> struct LLT_Traits<MatrixType,Upper>
{
typedef const TriangularView<const typename MatrixType::AdjointReturnType, Lower> MatrixL;
typedef const TriangularView<const MatrixType, Upper> MatrixU;
static inline MatrixL getL(const MatrixType& m) { return MatrixL(m.adjoint()); }
static inline MatrixU getU(const MatrixType& m) { return MatrixU(m); }
static bool inplace_decomposition(MatrixType& m)
{ return llt_inplace<typename MatrixType::Scalar, Upper>::blocked(m)==-1; }
};
} // end namespace internal
/** Computes / recomputes the Cholesky decomposition A = LL^* = U^*U of \a matrix
*
* \returns a reference to *this
*
* Example: \include TutorialLinAlgComputeTwice.cpp
* Output: \verbinclude TutorialLinAlgComputeTwice.out
*/
template<typename MatrixType, int _UpLo>
template<typename InputType>
LLT<MatrixType,_UpLo>& LLT<MatrixType,_UpLo>::compute(const EigenBase<InputType>& a)
{
check_template_parameters();
eigen_assert(a.rows()==a.cols());
const Index size = a.rows();
m_matrix.resize(size, size);
m_matrix = a.derived();
m_isInitialized = true;
bool ok = Traits::inplace_decomposition(m_matrix);
m_info = ok ? Success : NumericalIssue;
return *this;
}
/** Performs a rank one update (or dowdate) of the current decomposition.
* If A = LL^* before the rank one update,
* then after it we have LL^* = A + sigma * v v^* where \a v must be a vector
* of same dimension.
*/
template<typename _MatrixType, int _UpLo>
template<typename VectorType>
LLT<_MatrixType,_UpLo> LLT<_MatrixType,_UpLo>::rankUpdate(const VectorType& v, const RealScalar& sigma)
{
STORMEIGEN_STATIC_ASSERT_VECTOR_ONLY(VectorType);
eigen_assert(v.size()==m_matrix.cols());
eigen_assert(m_isInitialized);
if(internal::llt_inplace<typename MatrixType::Scalar, UpLo>::rankUpdate(m_matrix,v,sigma)>=0)
m_info = NumericalIssue;
else
m_info = Success;
return *this;
}
#ifndef STORMEIGEN_PARSED_BY_DOXYGEN
template<typename _MatrixType,int _UpLo>
template<typename RhsType, typename DstType>
void LLT<_MatrixType,_UpLo>::_solve_impl(const RhsType &rhs, DstType &dst) const
{
dst = rhs;
solveInPlace(dst);
}
#endif
/** \internal use x = llt_object.solve(x);
*
* This is the \em in-place version of solve().
*
* \param bAndX represents both the right-hand side matrix b and result x.
*
* \returns true always! If you need to check for existence of solutions, use another decomposition like LU, QR, or SVD.
*
* This version avoids a copy when the right hand side matrix b is not
* needed anymore.
*
* \sa LLT::solve(), MatrixBase::llt()
*/
template<typename MatrixType, int _UpLo>
template<typename Derived>
void LLT<MatrixType,_UpLo>::solveInPlace(MatrixBase<Derived> &bAndX) const
{
eigen_assert(m_isInitialized && "LLT is not initialized.");
eigen_assert(m_matrix.rows()==bAndX.rows());
matrixL().solveInPlace(bAndX);
matrixU().solveInPlace(bAndX);
}
/** \returns the matrix represented by the decomposition,
* i.e., it returns the product: L L^*.
* This function is provided for debug purpose. */
template<typename MatrixType, int _UpLo>
MatrixType LLT<MatrixType,_UpLo>::reconstructedMatrix() const
{
eigen_assert(m_isInitialized && "LLT is not initialized.");
return matrixL() * matrixL().adjoint().toDenseMatrix();
}
#ifndef __CUDACC__
/** \cholesky_module
* \returns the LLT decomposition of \c *this
* \sa SelfAdjointView::llt()
*/
template<typename Derived>
inline const LLT<typename MatrixBase<Derived>::PlainObject>
MatrixBase<Derived>::llt() const
{
return LLT<PlainObject>(derived());
}
/** \cholesky_module
* \returns the LLT decomposition of \c *this
* \sa SelfAdjointView::llt()
*/
template<typename MatrixType, unsigned int UpLo>
inline const LLT<typename SelfAdjointView<MatrixType, UpLo>::PlainObject, UpLo>
SelfAdjointView<MatrixType, UpLo>::llt() const
{
return LLT<PlainObject,UpLo>(m_matrix);
}
#endif // __CUDACC__
} // end namespace StormEigen
#endif // STORMEIGEN_LLT_H
| MazZzinatus/storm | resources/3rdparty/eigen-3.3-beta1/StormEigen/src/Cholesky/LLT.h | C | gpl-3.0 | 16,146 |
# Основная цель - имя верхнего модуля.
TARGET = test
# Файлы модулей.
SOURCES = test.v main.v
# Макросы.
DEFINES +=
# Путь к собственным библиотекам в исходниках.
SRC_LIBS_PATH = ../lib
# Пути ко всем собственным библиотекам в исходниках.
SRC_LIBS_ALL_PATH = $(wildcard $(addsuffix /*, $(SRC_LIBS_PATH)))
# Пути с исходниками.
VPATH += .
VPATH += $(SRC_LIBS_ALL_PATH)
# Цель компиляции.
# null, vvp, fpga, vhdl.
IVTARGET = vvp
# Флаги компилятора.
# Цель.
IVFLAGS += -t$(IVTARGET)
# Корневой модуль.
IVFLAGS += -s $(TARGET)
# Макросы.
IVFLAGS += $(addprefix -D, $(DEFINES))
# Папка с библиотеками
IVFLAGS += -I $(SRC_LIBS_PATH)
# Тулкит.
VERILOG_PREFIX=
IV = $(TOOLKIT_PREFIX)iverilog
VVP = $(TOOLKIT_PREFIX)vvp
# GTKWave
GTKWAVE = gtkwave
# Прочие утилиты.
RM = rm -f
# Побочные цели.
# Файл для симуляции.
TARGET_VVP = $(TARGET).vvp
# Файл осциллограмм.
TARGET_VCD = $(TARGET).vcd
all: $(TARGET_VCD)
$(TARGET_VCD): $(TARGET_VVP)
$(VVP) $^
$(TARGET_VVP): $(SOURCES)
$(IV) -o $@ $(IVFLAGS) $^
clean:
$(RM) $(TARGET_VCD)
$(RM) $(TARGET_VVP)
clean_all: clean
view: $(TARGET_VCD)
$(GTKWAVE) $^ 2>/dev/null 1>/dev/null &
| catompiler/fpgalibs | template/Makefile | Makefile | gpl-3.0 | 1,458 |
// Copyright © 2008-2016 Pioneer Developers. See AUTHORS.txt for details
// Licensed under the terms of the GPL v3. See licenses/GPL-3.txt
#ifndef _POLIT_H
#define _POLIT_H
#include "galaxy/Economy.h"
class Galaxy;
class StarSystem;
class SysPolit;
class Ship;
namespace Polit {
enum PolitEcon { // <enum scope='Polit' name=PolitEcon prefix=ECON_ public>
ECON_NONE,
ECON_VERY_CAPITALIST,
ECON_CAPITALIST,
ECON_MIXED,
ECON_PLANNED,
ECON_MAX // <enum skip>
};
enum GovType { // <enum scope='Polit' name=PolitGovType prefix=GOV_ public>
GOV_INVALID, // <enum skip>
GOV_NONE,
GOV_EARTHCOLONIAL,
GOV_EARTHDEMOC,
GOV_EMPIRERULE,
GOV_CISLIBDEM,
GOV_CISSOCDEM,
GOV_LIBDEM,
GOV_CORPORATE,
GOV_SOCDEM,
GOV_EARTHMILDICT,
GOV_MILDICT1,
GOV_MILDICT2,
GOV_EMPIREMILDICT,
GOV_COMMUNIST,
GOV_PLUTOCRATIC,
GOV_DISORDER,
GOV_MAX, // <enum skip>
GOV_RAND_MIN = GOV_NONE+1, // <enum skip>
GOV_RAND_MAX = GOV_MAX-1, // <enum skip>
};
fixed GetBaseLawlessness(GovType gov);
}
class SysPolit {
public:
SysPolit() : govType(Polit::GOV_INVALID) { }
const char *GetGovernmentDesc() const;
const char *GetEconomicDesc() const;
Polit::GovType govType;
fixed lawlessness;
};
#endif /* _POLIT_H */
| tomm/pioneer | src/Polit.h | C | gpl-3.0 | 1,241 |
# =============================================================================
# Copyright [2013] [Kevin Carter]
# License Information :
# This software has no warranty, it is provided 'as is'. It is your
# responsibility to validate the behavior of the routines and its accuracy
# using the code provided. Consult the GNU General Public license for further
# details (see GNU General Public License).
# http://www.gnu.org/licenses/gpl.html
# =============================================================================
import logging
import traceback
import flask
from tribble.api import application
from tribble.api import utils
from tribble.common.db import db_proc
from tribble.common.db import zone_status
from tribble.common import rpc
from tribble.common import system_config
mod = flask.Blueprint('zones', __name__)
LOG = logging.getLogger('tribble-api')
CONFIG = system_config.ConfigurationSetup()
DEFAULT = CONFIG.config_args()
DB = application.DB
@mod.route('/v1/schematics/<sid>/zones', methods=['GET'])
def zones_get(sid):
"""Return a list of zones.
Method is accessible with GET /v1/schematics/<sid>/zones
:param sid: ``str`` # schematic ID
:return json, status: ``tuple``
"""
parsed_data = utils.zone_basic_handler(sid=sid)
if parsed_data[0] is False:
return utils.return_msg(msg=parsed_data[1], status=parsed_data[2])
else:
_success, schematic, zones, user_id = parsed_data
LOG.debug('%s %s %s %s', _success, schematic, zones, user_id)
try:
return_zones = []
for zone in zones:
dzone = utils.pop_ts(zone.__dict__)
instances = db_proc.get_instances(zon=zone)
if instances:
dzone['instance_quantity'] = len(instances)
return_zones.append(dzone)
except Exception:
LOG.error(traceback.format_exc())
return utils.return_msg(msg='Unexpected Error', status=500)
else:
return utils.return_msg(msg=return_zones, status=200)
@mod.route('/v1/schematics/<sid>/zones/<zid>', methods=['GET'])
def zone_get(sid, zid):
"""Return a zone.
Method is accessible with GET /v1/schematics/<sid>/zones/<zid>
:param sid: ``str`` # schematic ID
:param zid: ``str`` # Zone ID
:return json, status: ``tuple``
"""
parsed_data = utils.zone_basic_handler(sid=sid, zid=zid)
if parsed_data[0] is False:
return utils.return_msg(msg=parsed_data[1], status=parsed_data[2])
else:
_success, schematic, zone, user_id = parsed_data
_zone = utils.pop_ts(temp=zone.__dict__)
instances = db_proc.get_instances(zon=zone)
if instances:
_zone['instances'] = [
utils.pop_ts(temp=instance.__dict__) for instance in instances
]
LOG.debug('%s %s %s %s', _success, schematic, zone, user_id)
return utils.return_msg(msg=_zone, status=200)
@mod.route('/v1/schematics/<sid>/zones/<zid>', methods=['DELETE'])
def zone_delete(sid=None, zid=None):
"""Delete a Zone.
Method is accessible with DELETE /v1/schematics/<sid>/zones/<zid>
:param sid: ``str`` # schematic ID
:param zid: ``str`` # Zone ID
:return json, status: ``tuple``
"""
parsed_data = utils.zone_basic_handler(sid=sid, zid=zid)
if parsed_data[0] is False:
return utils.return_msg(msg=parsed_data[1], status=parsed_data[2])
else:
_success, schematic, zone, user_id = parsed_data
if zone.zone_state == 'BUILDING':
build_response = (
'Zone Delete can not be performed because Zone "%s" has a'
' Pending Status' % zone.id
)
return utils.return_msg(msg=build_response, status=200)
LOG.debug('%s %s %s %s', _success, schematic, zone, user_id)
try:
config = db_proc.get_configmanager(skm=schematic)
instances = db_proc.get_instances(zon=zone)
packet = utils.build_cell(
job='zone_delete',
schematic=schematic,
zone=zone,
config=config
)
packet['uuids'] = [instance.instance_id for instance in instances]
rpc.default_publisher(message=packet)
sess = DB.session
zone_status.ZoneState(cell=packet).delete()
except Exception:
LOG.error(traceback.format_exc())
return utils.return_msg(msg='unexpected error', status=500)
else:
db_proc.commit_session(session=sess)
return utils.return_msg(msg='deletes received', status=203)
@mod.route('/v1/schematics/<sid>/zones/<zid>/purge', methods=['DELETE'])
def zone_purge(sid=None, zid=None):
"""purge a Zone.
This is used to remove all indication of a zone without attempting to
disconnect or otherwise clean up the zone or any of its may be attached
instances.
Method is accessible with DELETE /v1/schematics/<sid>/zones/<zid>/purge
:param sid: ``str`` # schematic ID
:param zid: ``str`` # Zone ID
:return json, status: ``tuple``
"""
parsed_data = utils.zone_basic_handler(sid=sid, zid=zid)
if parsed_data[0] is False:
return utils.return_msg(msg=parsed_data[1], status=parsed_data[2])
else:
_success, schematic, zone, user_id = parsed_data
LOG.debug('%s %s %s %s', _success, schematic, zone, user_id)
try:
sess = DB.session
db_proc.delete_item(session=sess, item=zone)
except Exception:
LOG.error(traceback.format_exc())
return utils.return_msg(msg='unexpected error', status=500)
else:
db_proc.commit_session(session=sess)
return utils.return_msg(
msg='zone %s was purged' % zone.id, status=203
)
@mod.route('/v1/schematics/<sid>/zones/<zid>', methods=['PUT'])
def zone_put(sid=None, zid=None):
"""Update a Zone.
Method is accessible with PUT /v1/schematics/<sid>/zones/<zid>
:param sid: ``str`` # schematic ID
:param zid: ``str`` # Zone ID
:return json, status: ``tuple``
"""
parsed_data = utils.zone_data_handler(sid=sid)
if parsed_data[0] is False:
return utils.return_msg(msg=parsed_data[1], status=parsed_data[2])
else:
_success, schematic, payload, user_id = parsed_data
LOG.debug('%s %s %s %s', _success, schematic, payload, user_id)
zone = db_proc.get_zones_by_id(skm=schematic, zid=zid)
if not zone:
return utils.return_msg(msg='no zones found', status=404)
try:
sess = DB.session
sess = db_proc.put_zone(
session=sess,
zon=zone,
put=payload
)
except Exception:
LOG.error(traceback.format_exc())
return utils.return_msg(msg='unexpected error', status=500)
else:
db_proc.commit_session(session=sess)
return utils.return_msg(msg='updates received', status=201)
@mod.route('/v1/schematics/<sid>/zones', methods=['POST'])
def zone_post(sid=None):
"""Post a Zone.
Method is accessible with POST /v1/schematics/<sid>/zones
:param sid: ``str`` # schematic ID
:return json, status: ``tuple``
"""
parsed_data = utils.zone_data_handler(sid=sid, check_for_zone=True)
if parsed_data[0] is False:
return utils.return_msg(msg=parsed_data[1], status=parsed_data[2])
else:
_success, schematic, payload, user_id = parsed_data
LOG.debug('%s %s %s %s', _success, schematic, payload, user_id)
config = db_proc.get_configmanager(skm=schematic)
try:
sess = DB.session
for _zn in payload['zones']:
ssh_user = _zn.get('ssh_user')
pub = _zn.get('ssh_key_pub')
pri = _zn.get('ssh_key_pri')
key_name = _zn.get('key_name')
ssh_key = db_proc.post_instanceskeys(
pub=pub,
pri=pri,
sshu=ssh_user,
key_name=key_name
)
db_proc.add_item(session=sess, item=ssh_key)
zone = db_proc.post_zones(
skm=schematic,
zon=_zn,
ssh=ssh_key
)
db_proc.add_item(session=sess, item=zone)
packet = utils.build_cell(
job='build',
schematic=schematic,
zone=zone,
sshkey=ssh_key,
config=config
)
rpc.default_publisher(message=packet)
except Exception:
LOG.error(traceback.format_exc())
return utils.return_msg(msg='Unexpected Error', status=500)
else:
db_proc.commit_session(session=sess)
msg = 'Application requests have been recieved for Schematic %s' % sid
return utils.return_msg(msg=msg, status=200)
@mod.route('/v1/schematics/<sid>/zones/<zid>/redeploy', methods=['POST'])
def redeploy_zone(sid=None, zid=None):
"""Redploy a zone.
This method will interate over an existing zone and ensure that all things
known in the zone are built and in an active state.
Method is accessible with POST /v1/schematics/<sid>/zones
:param sid: ``str`` # schematic ID
:param zid: ``str`` # Zone ID
:return json, status: ``tuple``
"""
parsed_data = utils.zone_basic_handler(sid=sid, zid=zid)
if parsed_data[0] is False:
return utils.return_msg(msg=parsed_data[1], status=parsed_data[2])
else:
_success, schematic, zone, user_id = parsed_data
LOG.debug('%s %s %s %s', _success, schematic, zone, user_id)
config = db_proc.get_configmanager(skm=schematic)
key = db_proc.get_instanceskeys(zon=zone)
ints = db_proc.get_instances(zon=zone)
base_qty = int(zone.quantity)
numr_qty = len(ints)
if base_qty > numr_qty:
difference = base_qty - numr_qty
packet = utils.build_cell(
job='redeploy_build',
schematic=schematic,
zone=zone,
sshkey=key,
config=config
)
packet['quantity'] = difference
LOG.debug(packet)
rpc.default_publisher(message=packet)
msg = 'Building %s Instances for Zone %s' % (difference, zone.id)
return utils.return_msg(msg=msg, status=200)
elif base_qty < numr_qty:
difference = numr_qty - base_qty
packet = utils.build_cell(
job='redeploy_delete',
schematic=schematic,
zone=zone,
sshkey=key,
config=config
)
instances = [ins.instance_id for ins in ints]
remove_instances = instances[:difference]
packet['uuids'] = remove_instances
LOG.debug(packet)
remove_ids = [
ins for ins in ints
if ins.instance_id in remove_instances
]
try:
sess = DB.session
for instance_id in remove_ids:
db_proc.delete_item(session=sess, item=instance_id)
except Exception:
LOG.error(traceback.format_exc())
return utils.return_msg(msg='Unexpected Error', status=500)
else:
rpc.default_publisher(message=packet)
db_proc.commit_session(session=sess)
msg = 'Removing %s Instances for Zone %s' % (difference, zone.id)
return utils.return_msg(msg=msg, status=200)
else:
return utils.return_msg(msg='nothing to do', status=200)
@mod.route('/v1/schematics/<sid>/zones/<zid>/resetstate', methods=['POST'])
def reset_zone_state(sid=None, zid=None):
r"""Reset the state of a zone to active.
This method will reset the state of an existing zone no matter the current
state. The new state after invoking this method will be set to
"ACTIVE RESET"
Method is accessible with POST /v1/schematics/<sid>/zones
:param sid: ``str`` # schematic ID
:param zid: ``str`` # Zone ID
:return json, status: ``tuple``
"""
parsed_data = utils.zone_basic_handler(sid=sid, zid=zid)
if parsed_data[0] is False:
return utils.return_msg(msg=parsed_data[1], status=parsed_data[2])
else:
_success, schematic, zone, user_id = parsed_data
LOG.debug('%s %s %s %s', _success, schematic, zone, user_id)
cell = {'zone_state': 'ACTIVE RESET'}
try:
sess = DB.session
db_proc.put_zone(session=sess, zon=zone, put=cell)
except Exception:
LOG.error(traceback.format_exc())
return utils.return_msg(msg='unexpected error', status=500)
else:
db_proc.commit_session(session=sess)
return utils.return_msg(
msg='Zone State for %s has been Reset' % zid, status=200
)
| cloudnull/tribble-api | tribble/api/views/zones_rest.py | Python | gpl-3.0 | 12,756 |
package com.blocktyper.yearmarked.days.listeners.wortag;
import java.util.Random;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.NetherWartsState;
import org.bukkit.block.Block;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.block.BlockBreakEvent;
import org.bukkit.inventory.ItemStack;
import org.bukkit.material.NetherWarts;
import com.blocktyper.yearmarked.ConfigKey;
import com.blocktyper.yearmarked.LocalizedMessage;
import com.blocktyper.yearmarked.YearmarkedListenerBase;
import com.blocktyper.yearmarked.YearmarkedPlugin;
import com.blocktyper.yearmarked.days.DayOfWeek;
import com.blocktyper.yearmarked.days.YearmarkedCalendar;
import com.blocktyper.yearmarked.items.YMRecipe;
public class WortagListener extends YearmarkedListenerBase {
private Random random = new Random();
public WortagListener(YearmarkedPlugin plugin) {
super(plugin);
new NetherstalkListener(plugin);
}
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void onCropsBreak(BlockBreakEvent event) {
final Block block = event.getBlock();
YearmarkedCalendar cal = new YearmarkedCalendar(block.getWorld());
if (!cal.getDayOfWeekEnum().equals(DayOfWeek.WORTAG)) {
return;
}
if (block.getType() != Material.NETHER_WARTS) {
return;
}
if (!(block.getState().getData() instanceof NetherWarts)) {
warning("Nethwart block did not have NetherWarts state data");
return;
}
NetherWarts netherWarts = (NetherWarts) block.getState().getData();
if (netherWarts.getState() != NetherWartsState.RIPE) {
debugInfo("Nethwarts were not ripe");
return;
} else {
debugInfo("Nethwarts were ripe");
}
if (!worldEnabled(event.getPlayer().getWorld().getName(), DayOfWeek.WORTAG.getDisplayKey())) {
return;
}
int high = getConfig().getInt(ConfigKey.WORTAG_BONUS_CROPS_RANGE_HIGH.getKey(), 3);
int low = getConfig().getInt(ConfigKey.WORTAG_BONUS_CROPS_RANGE_LOW.getKey(), 1);
int rewardCount = random.nextInt(high + 1);
if (rewardCount < low) {
rewardCount = low;
}
if (rewardCount > 0) {
ItemStack reward = getItemFromRecipe(YMRecipe.WORTAG_NETHERWORT, event.getPlayer(), null, null);
String displayName = reward.getItemMeta() != null && reward.getItemMeta().getDisplayName() != null ? reward.getItemMeta().getDisplayName() : "";
String bonus = getLocalizedMessage(LocalizedMessage.BONUS.getKey(), event.getPlayer());
event.getPlayer().sendMessage(
ChatColor.DARK_PURPLE + bonus + "[x" + rewardCount + "] " + displayName);
dropItemsInStacks(block.getLocation(), rewardCount, reward);
} else {
debugInfo("No luck on Wortag");
event.getPlayer().sendMessage(ChatColor.RED + ":(");
}
}
}
| spaarkimus/yearmarked | src/main/java/com/blocktyper/yearmarked/days/listeners/wortag/WortagListener.java | Java | gpl-3.0 | 2,866 |
package com.github.thrimbor.fifoBukkit;
import org.bukkit.plugin.java.JavaPlugin;
/*
* Copyright (C) 2013 Stefan Schmidt
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
public class FifoBukkit extends JavaPlugin {
Reader reader = null;
static boolean enabled = false;
public void onEnable() {
if (!enabled) {
reader = new Reader(this);
reader.start();
enabled = true;
}
}
public void onDisable() {
}
}
| thrimbor/fifoBukkit | src/com/github/thrimbor/fifoBukkit/FifoBukkit.java | Java | gpl-3.0 | 1,079 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_73) on Tue May 17 19:49:20 CEST 2016 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Uses of Package gui (ShopManager by Hariton Andrei Marius)</title>
<meta name="date" content="2016-05-17">
<link rel="stylesheet" type="text/css" href="../stylesheet.css" title="Style">
<script type="text/javascript" src="../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Uses of Package gui (ShopManager by Hariton Andrei Marius)";
}
}
catch(err) {
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li>Class</li>
<li class="navBarCell1Rev">Use</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../deprecated-list.html">Deprecated</a></li>
<li><a href="../index-files/index-1.html">Index</a></li>
<li><a href="../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../index.html?gui/package-use.html" target="_top">Frames</a></li>
<li><a href="package-use.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<div class="header">
<h1 title="Uses of Package gui" class="title">Uses of Package<br>gui</h1>
</div>
<div class="contentContainer">
<ul class="blockList">
<li class="blockList">
<table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing packages, and an explanation">
<caption><span>Packages that use <a href="../gui/package-summary.html">gui</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Package</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><a href="#gui">gui</a></td>
<td class="colLast"> </td>
</tr>
</tbody>
</table>
</li>
<li class="blockList"><a name="gui">
<!-- -->
</a>
<table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing classes, and an explanation">
<caption><span>Classes in <a href="../gui/package-summary.html">gui</a> used by <a href="../gui/package-summary.html">gui</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colOne" scope="col">Class and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colOne"><a href="../gui/class-use/Manager.html#gui">Manager</a>
<div class="block">Window frame for the manager</div>
</td>
</tr>
</tbody>
</table>
</li>
</ul>
</div>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li>Class</li>
<li class="navBarCell1Rev">Use</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../deprecated-list.html">Deprecated</a></li>
<li><a href="../index-files/index-1.html">Index</a></li>
<li><a href="../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../index.html?gui/package-use.html" target="_top">Frames</a></li>
<li><a href="package-use.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>
| haritonandrei/ShopManager | dist/javadoc/gui/package-use.html | HTML | gpl-3.0 | 5,221 |
// RHGenericDriver.h
// Author: Mike McCauley (mikem@airspayce.com)
// Copyright (C) 2014 Mike McCauley
// $Id: RHGenericDriver.h,v 1.8 2014/04/28 23:07:14 mikem Exp $
#ifndef RHGenericDriver_h
#define RHGenericDriver_h
#include <RadioHead.h>
/////////////////////////////////////////////////////////////////////
/// \class RHGenericDriver RHGenericDriver.h <RHGenericDriver.h>
/// \brief Abstract base class for a RadioHead driver.
///
/// This class defines the functions that must be provided by any RadioHead driver.
/// Different types of driver will implement all the abstract functions, and will perhaps override
/// other functions in this subclass, or perhaps add new functions specifically required by that driver.
/// Do not directly instantiate this class: it is only to be subclassed by driver classes.
///
/// Subclasses are expected to implement a half-duplex, unreliable, error checked, unaddressed packet transport.
/// They are expected to carry a message payload with an appropriate maximum length for the transport hardware
/// and to also carry unaltered 4 message headers: TO, FROM, ID, FLAGS
///
/// \par Headers
///
/// Each message sent and received by a RadioHead driver includes 4 headers:
/// -TO The node address that the message is being sent to (broadcast RH_BROADCAST_ADDRESS (255) is permitted)
/// -FROM The node address of the sending node
/// -ID A message ID, distinct (over short time scales) for each message sent by a particilar node
/// -FLAGS A bitmask of flags. The most significant 4 bits are reserved for use by RadioHead. The least
/// significant 4 bits are reserved for applications.
class RHGenericDriver
{
public:
/// \brief Defines different operating modes for the transport hardware
///
/// These are the different values that can be adopted by the _mode variable and
/// returned by the mode() member function,
typedef enum
{
RHModeInitialising = 0, ///< Transport is initialising. Initial default value until init() is called..
RHModeIdle, ///< Transport is idle.
RHModeTx, ///< Transport is in the process of transmitting a message.
RHModeRx ///< Transport is in the process of receiving a message.
} RHMode;
/// Constructor
RHGenericDriver();
/// Initialise the Driver transport hardware and software.
/// Make sure the Driver is properly configured before calling init().
/// \return true if initialisation succeeded.
virtual bool init();
/// Tests whether a new message is available
/// from the Driver.
/// On most drivers, this will also put the Driver into RHModeRx mode until
/// a message is actually received bythe transport, when it wil be returned to RHModeIdle.
/// This can be called multiple times in a timeout loop
/// \return true if a new, complete, error-free uncollected message is available to be retreived by recv()
virtual bool available() = 0;
/// Turns the receiver on if it not already on.
/// If there is a valid message available, copy it to buf and return true
/// else return false.
/// If a message is copied, *len is set to the length (Caution, 0 length messages are permitted).
/// You should be sure to call this function frequently enough to not miss any messages
/// It is recommended that you call it in your main loop.
/// \param[in] buf Location to copy the received message
/// \param[in,out] len Pointer to available space in buf. Set to the actual number of octets copied.
/// \return true if a valid message was copied to buf
virtual bool recv(uint8_t* buf, uint8_t* len) = 0;
/// Waits until any previous transmit packet is finished being transmitted with waitPacketSent().
/// Then loads a message into the transmitter and starts the transmitter. Note that a message length
/// of 0 is NOT permitted. If the message is too long for the underlying radio technology, send() will
/// return false and will not send the message.
/// \param[in] data Array of data to be sent
/// \param[in] len Number of bytes of data to send (> 0)
/// \return true if the message length was valid and it was correctly queued for transmit
virtual bool send(const uint8_t* data, uint8_t len) = 0;
/// Returns the maximum message length
/// available in this Driver.
/// \return The maximum legal message length
virtual uint8_t maxMessageLength() = 0;
/// Starts the receiver and blocks until a valid received
/// message is available.
virtual void waitAvailable();
/// Blocks until the transmitter
/// is no longer transmitting.
virtual bool waitPacketSent();
/// Blocks until the transmitter is no longer transmitting.
/// or until the timeout occuers, whichever happens first
/// \param[in] timeout Maximum time to wait in milliseconds.
/// \return true if the RF22 completed transmission within the timeout period. False if it timed out.
virtual bool waitPacketSent(uint16_t timeout);
/// Starts the receiver and blocks until a received message is available or a timeout
/// \param[in] timeout Maximum time to wait in milliseconds.
/// \return true if a message is available
virtual bool waitAvailableTimeout(uint16_t timeout);
/// Sets the address of this node. Defaults to 0xFF. Subclasses or the user may want to change this.
/// This will be used to test the adddress in incoming messages. In non-promiscuous mode,
/// only messages with a TO header the same as thisAddress or the broadcast addess (0xFF) will be accepted.
/// In promiscuous mode, all messages will be accepted regardless of the TO header.
/// In a conventional multinode system, all nodes will have a unique address
/// (which you could store in EEPROM).
/// You would normally set the header FROM address to be the same as thisAddress (though you dont have to,
/// allowing the possibilty of address spoofing).
/// \param[in] thisAddress The address of this node.
virtual void setThisAddress(uint8_t thisAddress);
/// Sets the TO header to be sent in all subsequent messages
/// \param[in] to The new TO header value
virtual void setHeaderTo(uint8_t to);
/// Sets the FROM header to be sent in all subsequent messages
/// \param[in] from The new FROM header value
virtual void setHeaderFrom(uint8_t from);
/// Sets the ID header to be sent in all subsequent messages
/// \param[in] id The new ID header value
virtual void setHeaderId(uint8_t id);
/// Sets the FLAGS header to be sent in all subsequent messages
/// \param[in] flags The new FLAGS header value
virtual void setHeaderFlags(uint8_t flags);
/// Tells the receiver to accept messages with any TO address, not just messages
/// addressed to thisAddress or the broadcast address
/// \param[in] promiscuous true if you wish to receive messages with any TO address
virtual void setPromiscuous(bool promiscuous);
/// Returns the TO header of the last received message
/// \return The TO header
virtual uint8_t headerTo();
/// Returns the FROM header of the last received message
/// \return The FROM header
virtual uint8_t headerFrom();
/// Returns the ID header of the last received message
/// \return The ID header
virtual uint8_t headerId();
/// Returns the FLAGS header of the last received message
/// \return The FLAGS header
virtual uint8_t headerFlags();
/// Returns the most recent RSSI (Receiver Signal Strength Indicator).
/// Usually it is the RSSI of the last received message, which is measured when the preamble is received.
/// If you called readRssi() more recently, it will return that more recent value.
/// \return The most recent RSSI measurement in dBm.
int8_t lastRssi();
/// Returns the operating mode of the library.
/// \return the current mode, one of RF69_MODE_*
RHMode mode();
/// Sets the operating mode of the transport.
void setMode(RHMode mode);
/// Prints a data buffer in HEX.
/// For diagnostic use
/// \param[in] prompt string to preface the print
/// \param[in] buf Location of the buffer to print
/// \param[in] len Length of the buffer in octets.
static void printBuffer(const char* prompt, const uint8_t* buf, uint8_t len);
protected:
/// The current transport operating mode
volatile RHMode _mode;
/// This node id
uint8_t _thisAddress;
/// Whether the transport is in promiscuous mode
bool _promiscuous;
/// TO header in the last received mesasge
volatile uint8_t _rxHeaderTo;
/// FROM header in the last received mesasge
volatile uint8_t _rxHeaderFrom;
/// ID header in the last received mesasge
volatile uint8_t _rxHeaderId;
/// FLAGS header in the last received mesasge
volatile uint8_t _rxHeaderFlags;
/// TO header to send in all messages
uint8_t _txHeaderTo;
/// FROM header to send in all messages
uint8_t _txHeaderFrom;
/// ID header to send in all messages
uint8_t _txHeaderId;
/// FLAGS header to send in all messages
uint8_t _txHeaderFlags;
/// The value of the last received RSSI value, in some transport specific units
volatile int8_t _lastRssi;
/// Count of the number of bad messages (eg bad checksum etc) received
volatile uint16_t _rxBad;
/// Count of the number of successfully transmitted messaged
volatile uint16_t _rxGood;
/// Count of the number of bad messages (correct checksum etc) received
volatile uint16_t _txGood;
private:
};
#endif
| Sensorino/Sensorino | libraries/RadioHead/RHGenericDriver.h | C | gpl-3.0 | 9,943 |
Grindvakt
=========
Auth Experiments
| yuripourre/grindvakt | README.md | Markdown | gpl-3.0 | 38 |
/*
Multi-agent Image Segmentation (MAgIS)
Copyright (C) 2013 Nguyen Hoang Thao (hoangthao.ng@gmail.com)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see http://www.gnu.org/licenses/.
*/
#include "SpiderSegmentationGPU.h"
void SpiderSegmentationGPU::initAgents() {
cout << "init agent gpu" << endl;
data->info->numberAgentPerColony = atoi(
conf->infos["spider_agent_per_colony"].c_str());
sp = (spider*) malloc(
data->info->numberAgentPerColony * data->info->numberColony
* sizeof(spider));
int idx = 0;
for (int i = 0; i < data->info->numberColony; i++) {
for (int j = 0; j < data->info->numberAgentPerColony; j++) {
sp[idx].colony = i;
sp[idx].posision = env->getIdx(rand() % env->x, rand() % env->y,
rand() % env->z);
sp[idx].lastposision = sp[idx].posision;
idx++;
}
}
}
void SpiderSegmentationGPU::runNStep() {
cout << "simulate gpu" << endl;
SpiderInfo *si = (SpiderInfo*) data->info;
int size = data->info->numberColony * data->info->numberAgentPerColony;
byte *rands = (byte*) malloc(size * sizeof(byte));
cl_int err = CL_SUCCESS;
try {
std::vector<cl::Platform> platforms;
cl::Platform::get(&platforms);
cl_context_properties properties[] = { CL_CONTEXT_PLATFORM,
(cl_context_properties) (platforms[0])(), 0 };
cl::Context context(CL_DEVICE_TYPE_GPU, properties);
std::vector<cl::Device> devices = context.getInfo<CL_CONTEXT_DEVICES>();
std::ifstream sourceFile("./magent/kernel_spider.cl");
std::string sourceCode(std::istreambuf_iterator<char>(sourceFile),
(std::istreambuf_iterator<char>()));
cl::Program::Sources source(1,
std::make_pair(sourceCode.c_str(), sourceCode.length() + 1));
cl::Program program_ = cl::Program(context, source);
program_.build(devices);
cl::Kernel kernel(program_, "run2", &err);
size_t nbRandomSize = size * sizeof(byte);
size_t nbSpiderSize = size * sizeof(spider);
size_t nbDraglineSize = env->x * env->y * env->z * si->nbDl
* sizeof(int);
// size_t nbDraglineSilkSize = env->x*env->y*env->z *si->nbDl* sizeof(ushort);
size_t nbDraglineSilkColonySize = env->x * env->y * env->z * si->nbDl
* data->info->numberColony * sizeof(byte);
size_t nbMeansSize = data->info->numberColony * sizeof(float);
size_t nbSelectSize = data->info->numberColony * sizeof(float);
size_t nbVoxelsSize = env->x * env->y * env->z * sizeof(byte);
cl::Buffer bufferA = cl::Buffer(context, CL_MEM_READ_ONLY,
nbRandomSize);
cl::Buffer bufferB = cl::Buffer(context, CL_MEM_READ_WRITE,
nbSpiderSize);
cl::Buffer bufferC = cl::Buffer(context, CL_MEM_READ_WRITE,
nbDraglineSize);
// cl::Buffer bufferD = cl::Buffer(context, CL_MEM_READ_WRITE, nbDraglineSilkSize);
cl::Buffer bufferE = cl::Buffer(context, CL_MEM_READ_WRITE,
nbDraglineSilkColonySize);
cl::Buffer bufferX = cl::Buffer(context, CL_MEM_READ_ONLY, nbMeansSize);
cl::Buffer bufferY = cl::Buffer(context, CL_MEM_READ_ONLY,
nbSelectSize);
cl::Buffer bufferZ = cl::Buffer(context, CL_MEM_READ_ONLY,
nbVoxelsSize);
cl::CommandQueue queue(context, devices[0], 0, &err);
queue.enqueueWriteBuffer(bufferB, CL_TRUE, 0, nbSpiderSize, sp);
queue.enqueueWriteBuffer(bufferC, CL_TRUE, 0, nbDraglineSize, si->dls);
// queue.enqueueWriteBuffer(bufferD, CL_TRUE, 0, nbDraglineSilkSize, si->nbSilk);
queue.enqueueWriteBuffer(bufferE, CL_TRUE, 0, nbDraglineSilkColonySize,
si->nbSilkColony);
queue.enqueueWriteBuffer(bufferX, CL_TRUE, 0, nbMeansSize, si->mean);
queue.enqueueWriteBuffer(bufferY, CL_TRUE, 0, nbSelectSize,
si->selectivity);
queue.enqueueWriteBuffer(bufferZ, CL_TRUE, 0, nbVoxelsSize,
env->voxels);
kernel.setArg(0, bufferB);
kernel.setArg(1, bufferC);
// kernel.setArg(2, bufferD);
kernel.setArg(2, bufferE);
kernel.setArg(3, size);
kernel.setArg(4, si->nbDl);
spiderinfo infogpu;
copy(si, &infogpu);
kernel.setArg(5, infogpu);
kernel.setArg(6, env->x);
kernel.setArg(7, env->y);
kernel.setArg(8, env->z);
kernel.setArg(10, bufferX);
kernel.setArg(11, bufferY);
kernel.setArg(12, bufferZ);
cl::NDRange local(64);
cl::NDRange global(ceil(size / (float) local[0]) * local[0]);
clock_t t = clock();
cl::Event event;
int numberIterator = atoi(conf->infos["spider_iterator"].c_str());
for (int i = 0; i < numberIterator; i++) {
if (i % 100 == 0)
cout << "time spider gpu: " << i << endl;
generateRandomByte(rands, size);
queue.enqueueWriteBuffer(bufferA, CL_TRUE, 0, nbRandomSize, rands);
kernel.setArg(9, bufferA);
queue.enqueueNDRangeKernel(kernel, cl::NullRange, global, local,
NULL, &event);
event.wait();
}
queue.enqueueReadBuffer(bufferB, CL_TRUE, 0, nbSpiderSize, sp);
queue.enqueueReadBuffer(bufferC, CL_TRUE, 0, nbDraglineSize, si->dls);
// queue.enqueueReadBuffer(bufferD, CL_TRUE, 0, nbDraglineSilkSize, si->nbSilk);
queue.enqueueReadBuffer(bufferE, CL_TRUE, 0, nbDraglineSilkColonySize,
si->nbSilkColony);
cout << "Time consuming for computing kernel spider is "
<< (float) (clock() - t) / CLOCKS_PER_SEC << endl;
} catch (cl::Error &err) {
cout << err.what() << "(" << getCLresultMsg(err.err()) << ")" << endl;
}
free(rands);
}
| hoangthao/MAS4IS | magent/SpiderSegmentationGPU.cpp | C++ | gpl-3.0 | 5,727 |
#!/home/pi/Documents/php -q
<?php
echo("From crontab");
$tempfile = fopen("/var/www/html/tempLogFahr.txt", "a");
$temp = shell_exec('sudo temperv14 -f');
fwrite($tempfile, $temp);
fclose($tempfile);
?> | oaksd/Fangs-Disciples | GetTempFahr.php | PHP | gpl-3.0 | 214 |
package util.drawing;
import org.newdawn.slick.Color;
import org.newdawn.slick.Graphics;
public abstract class FreePacWallDrawer
{
protected CustomGraphics g;
public Color wallColor, borderColor;
@Deprecated
public FreePacWallDrawer(Graphics g) {
this(g, Color.gray, Color.darkGray);
}
public FreePacWallDrawer(Graphics g, Color wallColor, Color borderColor) {
super();
this.g = new CustomGraphics(g);
this.wallColor = new Color(wallColor);
this.borderColor = new Color(borderColor);
}
public abstract void drawFirstQuadrant(float x, float y);
public abstract void drawSecondQuadrant(float x, float y);
public abstract void drawThirdQuadrant(float x, float y);
public abstract void drawFourthQuadrant(float x, float y);
public abstract void drawUpperHalf(float x, float y);
public abstract void drawBottomHalf(float x, float y);
public abstract void drawLeftHalf(float x, float y);
public abstract void drawRightHalf(float x, float y);
public abstract void drawExceptFirstQuadrant(float x, float y, boolean fillOutward);
public abstract void drawExceptSecondQuadrant(float x, float y, boolean fillOutward);
public abstract void drawExceptThirdQuadrant(float x, float y, boolean fillOutward);
public abstract void drawExceptFourthQuadrant(float x, float y, boolean fillOutward);
public abstract void drawFull(float x, float y);
public void setGraphics(CustomGraphics g)
{
this.g = g;
}
public CustomGraphics getGraphics()
{
return g;
}
}
| hydren/freepac | src/util/drawing/FreePacWallDrawer.java | Java | gpl-3.0 | 1,513 |
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>GSimplePermission</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
<link rel="home" href="index.html" title="GIO Reference Manual">
<link rel="up" href="permissions.html" title="Permissions">
<link rel="prev" href="GPermission.html" title="GPermission">
<link rel="next" href="application.html" title="Application support">
<meta name="generator" content="GTK-Doc V1.17 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="GPermission.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="permissions.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">GIO Reference Manual</th>
<td><a accesskey="n" href="application.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts">
<a href="#GSimplePermission.synopsis" class="shortcut">Top</a>
|
<a href="#GSimplePermission.description" class="shortcut">Description</a>
|
<a href="#GSimplePermission.object-hierarchy" class="shortcut">Object Hierarchy</a>
</td></tr>
</table>
<div class="refentry">
<a name="GSimplePermission"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="GSimplePermission.top_of_page"></a>GSimplePermission</span></h2>
<p>GSimplePermission — A GPermission that doesn't change value</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<a name="GSimplePermission.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis"> <a class="link" href="GSimplePermission.html#GSimplePermission-struct" title="GSimplePermission">GSimplePermission</a>;
<a class="link" href="GPermission.html" title="GPermission"><span class="returnvalue">GPermission</span></a> * <a class="link" href="GSimplePermission.html#g-simple-permission-new" title="g_simple_permission_new ()">g_simple_permission_new</a> (<em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> allowed</code></em>);
</pre>
</div>
<div class="refsect1">
<a name="GSimplePermission.object-hierarchy"></a><h2>Object Hierarchy</h2>
<pre class="synopsis">
<a href="./../gobject/gobject/gobject-The-Base-Object-Type.html#GObject">GObject</a>
+----<a class="link" href="GPermission.html" title="GPermission">GPermission</a>
+----GSimplePermission
</pre>
</div>
<div class="refsect1">
<a name="GSimplePermission.description"></a><h2>Description</h2>
<p>
<a class="link" href="GSimplePermission.html" title="GSimplePermission"><span class="type">GSimplePermission</span></a> is a trivial implementation of <a class="link" href="GPermission.html" title="GPermission"><span class="type">GPermission</span></a> that
represents a permission that is either always or never allowed. The
value is given at constuction and doesn't change.
</p>
<p>
Calling request or release will result in errors.
</p>
</div>
<div class="refsect1">
<a name="GSimplePermission.details"></a><h2>Details</h2>
<div class="refsect2">
<a name="GSimplePermission-struct"></a><h3>GSimplePermission</h3>
<pre class="programlisting">typedef struct _GSimplePermission GSimplePermission;</pre>
<p>
<a class="link" href="GSimplePermission.html" title="GSimplePermission"><span class="type">GSimplePermission</span></a> is an opaque data structure. There are no methods
except for those defined by <a class="link" href="GPermission.html" title="GPermission"><span class="type">GPermission</span></a>.
</p>
</div>
<hr>
<div class="refsect2">
<a name="g-simple-permission-new"></a><h3>g_simple_permission_new ()</h3>
<pre class="programlisting"><a class="link" href="GPermission.html" title="GPermission"><span class="returnvalue">GPermission</span></a> * g_simple_permission_new (<em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> allowed</code></em>);</pre>
<p>
Creates a new <a class="link" href="GPermission.html" title="GPermission"><span class="type">GPermission</span></a> instance that represents an action that is
either always or never allowed.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>allowed</code></em> :</span></p></td>
<td>
<a href="./../glib/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the action is allowed</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the <a class="link" href="GSimplePermission.html" title="GSimplePermission"><span class="type">GSimplePermission</span></a>, as a <a class="link" href="GPermission.html" title="GPermission"><span class="type">GPermission</span></a>
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.26</p>
</div>
</div>
</div>
<div class="footer">
<hr>
Generated by GTK-Doc V1.17</div>
</body>
</html> | chriskmanx/qmole | QMOLEDEV/glib-2.29.14/docs/reference/gio/html/GSimplePermission.html | HTML | gpl-3.0 | 5,716 |
---
layout: home
title: Home
<!-- description: >
The official Hydejack blog. Version updates, example content and how-to guides on how to blog with Jekyll.
Open `index.html` to edit this text. -->
cover: true
--- | vvrs/vvrs.github.io | index.html | HTML | gpl-3.0 | 216 |
namespace("automata.games.robot", function (exports) {
"use strict";
exports.RightAndAhead = {
key: "automata.games.robot.RightAndAhead",
view: exports.WorldView,
world: exports.World.create({
width: 600,
height: 400,
walls: [],
startX: 300,
startY: 50,
goalX: 300,
goalY: 350,
goalRadius: 15
})
};
});
| senshu/Automata | games/robot/RightAndAhead/game.js | JavaScript | gpl-3.0 | 449 |
using System;
namespace ProjectJKL.UI.Pages.Admin.ShoppingCart
{
public partial class ColorsList : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Page_PreInit(object sender, EventArgs e)
{
MasterPageFile = OWDARO.UserRoles.MasterPage;
this.Master.MasterPageFile = OWDARO.Util.Utilities.GetZiceThemeFile();
}
}
} | owdaro/OFrameCMS-WebForms | UI/Pages/Admin/ShoppingCart/ColorsList.aspx.cs | C# | gpl-3.0 | 446 |
/* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* java mavlink generator tool. It should not be modified by hand.
*/
package com.MAVLink.enums;
/**
*
*/
public class MAV_MODE_GIMBAL {
public static final int MAV_MODE_GIMBAL_UNINITIALIZED = 0; /* Gimbal is powered on but has not started initializing yet | */
public static final int MAV_MODE_GIMBAL_CALIBRATING_PITCH = 1; /* Gimbal is currently running calibration on the pitch axis | */
public static final int MAV_MODE_GIMBAL_CALIBRATING_ROLL = 2; /* Gimbal is currently running calibration on the roll axis | */
public static final int MAV_MODE_GIMBAL_CALIBRATING_YAW = 3; /* Gimbal is currently running calibration on the yaw axis | */
public static final int MAV_MODE_GIMBAL_INITIALIZED = 4; /* Gimbal has finished calibrating and initializing, but is relaxed pending reception of first rate command from copter | */
public static final int MAV_MODE_GIMBAL_ACTIVE = 5; /* Gimbal is actively stabilizing | */
public static final int MAV_MODE_GIMBAL_RATE_CMD_TIMEOUT = 6; /* Gimbal is relaxed because it missed more than 10 expected rate command messages in a row. Gimbal will move back to active mode when it receives a new rate command | */
public static final int MAV_MODE_GIMBAL_ENUM_END = 7; /* | */
}
| forgodsake/TowerPlus | dependencyLibs/Mavlink/src/com/MAVLink/enums/MAV_MODE_GIMBAL.java | Java | gpl-3.0 | 1,348 |
package tmp.generated_csharp;
import java.util.*;
import cide.gast.*;
import java.io.PrintStream;
import cide.languages.*;
import de.ovgu.cide.fstgen.ast.*;
public class SimplePrintVisitor extends AbstractFSTPrintVisitor {
public SimplePrintVisitor(PrintStream out) {
super(out); generateSpaces=true;
}
public SimplePrintVisitor() {
super(); generateSpaces=true;
}
public boolean visit(FSTNonTerminal nonTerminal) {
if (nonTerminal.getType().equals("compilation_unit")) {
for (FSTNode v : getChildren(nonTerminal,"using_directive")) {
v.accept(this);
}
{
FSTNode v=getChild(nonTerminal, "attributes_either");
if (v!=null) {
v.accept(this);
}
}
{
FSTNode v=getChild(nonTerminal, "compilation_unitEnd");
if (v!=null) {
v.accept(this);
}
}
return false;
}
if (nonTerminal.getType().equals("compilation_unitEnd")) {
{
FSTNode v=getChild(nonTerminal, "namespace_member_declaration_no_attr");
if (v!=null) {
v.accept(this);
}
}
for (FSTNode v : getChildren(nonTerminal,"namespace_member_declaration")) {
v.accept(this);
}
return false;
}
if (nonTerminal.getType().equals("namespace_declaration")) {
printToken("namespace");
{
FSTNode v=getChild(nonTerminal, "type_name");
if (v!=null) {
v.accept(this);
}
}
{
FSTNode v=getChild(nonTerminal, "namespace_body");
if (v!=null) {
v.accept(this);
}
}
return false;
}
if (nonTerminal.getType().equals("namespace_body")) {
printToken("{");
hintIncIndent();
hintNewLine();
for (FSTNode v : getChildren(nonTerminal,"using_directive")) {
v.accept(this);
}
for (FSTNode v : getChildren(nonTerminal,"namespace_member_declaration")) {
v.accept(this);
}
hintDecIndent();
hintNewLine();
printToken("}");
hintNewLine();
return false;
}
if (nonTerminal.getType().equals("namespace_member_declaration_no_attr1")) {
{
FSTNode v=getChild(nonTerminal, "namespace_declaration");
if (v!=null) {
v.accept(this);
}
}
return false;
}
if (nonTerminal.getType().equals("namespace_member_declaration_no_attr2")) {
{
FSTNode v=getChild(nonTerminal, "type_modifiers");
if (v!=null) {
v.accept(this);
}
}
{
FSTNode v=getChild(nonTerminal, "type_declaration");
if (v!=null) {
v.accept(this);
}
}
return false;
}
if (nonTerminal.getType().equals("namespace_member_declaration1")) {
{
FSTNode v=getChild(nonTerminal, "namespace_declaration");
if (v!=null) {
v.accept(this);
}
}
return false;
}
if (nonTerminal.getType().equals("namespace_member_declaration2")) {
{
FSTNode v=getChild(nonTerminal, "attributes");
if (v!=null) {
v.accept(this);
}
}
{
FSTNode v=getChild(nonTerminal, "type_modifiers");
if (v!=null) {
v.accept(this);
}
}
{
FSTNode v=getChild(nonTerminal, "type_declaration");
if (v!=null) {
v.accept(this);
}
}
return false;
}
if (nonTerminal.getType().equals("type_declaration1")) {
{
FSTNode v=getChild(nonTerminal, "class_declaration");
if (v!=null) {
v.accept(this);
}
}
return false;
}
if (nonTerminal.getType().equals("type_declaration2")) {
{
FSTNode v=getChild(nonTerminal, "struct_declaration");
if (v!=null) {
v.accept(this);
}
}
return false;
}
if (nonTerminal.getType().equals("type_declaration3")) {
{
FSTNode v=getChild(nonTerminal, "interface_declaration");
if (v!=null) {
v.accept(this);
}
}
return false;
}
if (nonTerminal.getType().equals("type_declaration4")) {
{
FSTNode v=getChild(nonTerminal, "enum_declaration");
if (v!=null) {
v.accept(this);
}
}
return false;
}
if (nonTerminal.getType().equals("type_declaration5")) {
{
FSTNode v=getChild(nonTerminal, "delegate_declaration");
if (v!=null) {
v.accept(this);
}
}
return false;
}
if (nonTerminal.getType().equals("class_declaration")) {
printToken("class");
{
FSTNode v=getChild(nonTerminal, "identifier");
if (v!=null) {
v.accept(this);
}
}
{
FSTNode v=getChild(nonTerminal, "type_parameter_list");
if (v!=null) {
v.accept(this);
}
}
{
FSTNode v=getChild(nonTerminal, "class_base");
if (v!=null) {
v.accept(this);
}
}
{
FSTNode v=getChild(nonTerminal, "type_parameter_constraint_clauses");
if (v!=null) {
v.accept(this);
}
}
{
FSTNode v=getChild(nonTerminal, "class_body");
if (v!=null) {
v.accept(this);
}
}
return false;
}
if (nonTerminal.getType().equals("class_body")) {
printToken("{");
hintIncIndent();
hintNewLine();
for (FSTNode v : getChildren(nonTerminal,"class_member_declaration")) {
v.accept(this);
}
hintDecIndent();
hintNewLine();
printToken("}");
hintNewLine();
return false;
}
if (nonTerminal.getType().equals("class_member_declaration")) {
{
FSTNode v=getChild(nonTerminal, "attributes");
if (v!=null) {
v.accept(this);
}
}
{
FSTNode v=getChild(nonTerminal, "member_modifiers");
if (v!=null) {
v.accept(this);
}
}
{
FSTNode v=getChild(nonTerminal, "class_member_declarationEnd");
if (v!=null) {
v.accept(this);
}
}
return false;
}
if (nonTerminal.getType().equals("class_member_declarationEnd1")) {
{
FSTNode v=getChild(nonTerminal, "constant_declaration");
if (v!=null) {
v.accept(this);
}
}
return false;
}
if (nonTerminal.getType().equals("class_member_declarationEnd2")) {
{
FSTNode v=getChild(nonTerminal, "event_declaration");
if (v!=null) {
v.accept(this);
}
}
return false;
}
if (nonTerminal.getType().equals("class_member_declarationEnd3")) {
{
FSTNode v=getChild(nonTerminal, "destructor_declaration");
if (v!=null) {
v.accept(this);
}
}
return false;
}
if (nonTerminal.getType().equals("class_member_declarationEnd4")) {
{
FSTNode v=getChild(nonTerminal, "conversion_operator_declaration");
if (v!=null) {
v.accept(this);
}
}
return false;
}
if (nonTerminal.getType().equals("class_member_declarationEnd5")) {
{
FSTNode v=getChild(nonTerminal, "type_declaration");
if (v!=null) {
v.accept(this);
}
}
return false;
}
if (nonTerminal.getType().equals("class_member_declarationEnd6")) {
{
FSTNode v=getChild(nonTerminal, "type");
if (v!=null) {
v.accept(this);
}
}
{
FSTNode v=getChild(nonTerminal, "typeEnd");
if (v!=null) {
v.accept(this);
}
}
return false;
}
if (nonTerminal.getType().equals("struct_declaration")) {
printToken("struct");
{
FSTNode v=getChild(nonTerminal, "identifier");
if (v!=null) {
v.accept(this);
}
}
{
FSTNode v=getChild(nonTerminal, "type_parameter_list");
if (v!=null) {
v.accept(this);
}
}
{
FSTNode v=getChild(nonTerminal, "base_interfaces");
if (v!=null) {
v.accept(this);
}
}
{
FSTNode v=getChild(nonTerminal, "type_parameter_constraint_clauses");
if (v!=null) {
v.accept(this);
}
}
{
FSTNode v=getChild(nonTerminal, "class_body");
if (v!=null) {
v.accept(this);
}
}
return false;
}
if (nonTerminal.getType().equals("interface_declaration")) {
printToken("interface");
{
FSTNode v=getChild(nonTerminal, "identifier");
if (v!=null) {
v.accept(this);
}
}
{
FSTNode v=getChild(nonTerminal, "type_parameter_list");
if (v!=null) {
v.accept(this);
}
}
{
FSTNode v=getChild(nonTerminal, "base_interfaces");
if (v!=null) {
v.accept(this);
}
}
{
FSTNode v=getChild(nonTerminal, "type_parameter_constraint_clauses");
if (v!=null) {
v.accept(this);
}
}
{
FSTNode v=getChild(nonTerminal, "interface_body");
if (v!=null) {
v.accept(this);
}
}
return false;
}
if (nonTerminal.getType().equals("enum_declaration")) {
printToken("enum");
{
FSTNode v=getChild(nonTerminal, "identifier");
if (v!=null) {
v.accept(this);
}
}
{
FSTNode v=getChild(nonTerminal, "enum_base");
if (v!=null) {
v.accept(this);
}
}
{
FSTNode v=getChild(nonTerminal, "enum_body");
if (v!=null) {
v.accept(this);
}
}
return false;
}
if (nonTerminal.getType().equals("delegate_declaration")) {
printToken("delegate");
{
FSTNode v=getChild(nonTerminal, "type");
if (v!=null) {
v.accept(this);
}
}
{
FSTNode v=getChild(nonTerminal, "identifier");
if (v!=null) {
v.accept(this);
}
}
{
FSTNode v=getChild(nonTerminal, "type_parameter_list");
if (v!=null) {
v.accept(this);
}
}
printToken("(");
{
FSTNode v=getChild(nonTerminal, "formal_parameter_list");
if (v!=null) {
v.accept(this);
}
}
{
FSTNode v=getChild(nonTerminal, "type_parameter_constraint_clauses");
if (v!=null) {
v.accept(this);
}
}
printToken(")");
printToken(";");
hintNewLine();
return false;
}
throw new RuntimeException("Unknown Non Terminal in FST "+nonTerminal);
}
protected boolean isSubtype(String type, String expectedType) {
if (type.equals(expectedType)) return true;
if (type.equals("type_declaration2") && expectedType.equals("type_declaration")) return true;
if (type.equals("integral_type1") && expectedType.equals("integral_type")) return true;
if (type.equals("embedded_statement12") && expectedType.equals("embedded_statement")) return true;
if (type.equals("predefined_type2") && expectedType.equals("predefined_type")) return true;
if (type.equals("unary_operator6") && expectedType.equals("unary_operator")) return true;
if (type.equals("primary_expression2") && expectedType.equals("primary_expression")) return true;
if (type.equals("primary_constraint1") && expectedType.equals("primary_constraint")) return true;
if (type.equals("primary_expression_start1") && expectedType.equals("primary_expression_start")) return true;
if (type.equals("numeric_type3") && expectedType.equals("numeric_type")) return true;
if (type.equals("assignment_operator2") && expectedType.equals("assignment_operator")) return true;
if (type.equals("using_directiveEnd2") && expectedType.equals("using_directiveEnd")) return true;
if (type.equals("type_modifier8") && expectedType.equals("type_modifier")) return true;
if (type.equals("type_declaration3") && expectedType.equals("type_declaration")) return true;
if (type.equals("integral_type2") && expectedType.equals("integral_type")) return true;
if (type.equals("try_statement_clauses1") && expectedType.equals("try_statement_clauses")) return true;
if (type.equals("local_variable_initializer2") && expectedType.equals("local_variable_initializer")) return true;
if (type.equals("member_modifier13") && expectedType.equals("member_modifier")) return true;
if (type.equals("predefined_type1") && expectedType.equals("predefined_type")) return true;
if (type.equals("embedded_statement13") && expectedType.equals("embedded_statement")) return true;
if (type.equals("primary_expression_start11") && expectedType.equals("primary_expression_start")) return true;
if (type.equals("unary_operator7") && expectedType.equals("unary_operator")) return true;
if (type.equals("primary_expression_start2") && expectedType.equals("primary_expression_start")) return true;
if (type.equals("creation_expressionPostFix1") && expectedType.equals("creation_expressionPostFix")) return true;
if (type.equals("assignment_operator1") && expectedType.equals("assignment_operator")) return true;
if (type.equals("using_directiveEnd1") && expectedType.equals("using_directiveEnd")) return true;
if (type.equals("creation_expressionPostFix2") && expectedType.equals("creation_expressionPostFix")) return true;
if (type.equals("assignment_operator11") && expectedType.equals("assignment_operator")) return true;
if (type.equals("try_statement_clauses2") && expectedType.equals("try_statement_clauses")) return true;
if (type.equals("type_declaration4") && expectedType.equals("type_declaration")) return true;
if (type.equals("conversion_operator2") && expectedType.equals("conversion_operator")) return true;
if (type.equals("member_modifier9") && expectedType.equals("member_modifier")) return true;
if (type.equals("catch_clauseEnd2") && expectedType.equals("catch_clauseEnd")) return true;
if (type.equals("attribute_target3") && expectedType.equals("attribute_target")) return true;
if (type.equals("namespace_member_declaration_no_attr2") && expectedType.equals("namespace_member_declaration_no_attr")) return true;
if (type.equals("type_name_or_paramenter2") && expectedType.equals("type_name_or_paramenter")) return true;
if (type.equals("type_modifier6") && expectedType.equals("type_modifier")) return true;
if (type.equals("assignment_operator4") && expectedType.equals("assignment_operator")) return true;
if (type.equals("assignment_operator12") && expectedType.equals("assignment_operator")) return true;
if (type.equals("unary_expression3") && expectedType.equals("unary_expression")) return true;
if (type.equals("creation_expressionPostFix3") && expectedType.equals("creation_expressionPostFix")) return true;
if (type.equals("type_declaration5") && expectedType.equals("type_declaration")) return true;
if (type.equals("conversion_operator1") && expectedType.equals("conversion_operator")) return true;
if (type.equals("catch_clauseEnd1") && expectedType.equals("catch_clauseEnd")) return true;
if (type.equals("namespace_member_declaration_no_attr1") && expectedType.equals("namespace_member_declaration_no_attr")) return true;
if (type.equals("assignment_operator3") && expectedType.equals("assignment_operator")) return true;
if (type.equals("type_modifier7") && expectedType.equals("type_modifier")) return true;
if (type.equals("goto_statementEnd3") && expectedType.equals("goto_statementEnd")) return true;
if (type.equals("body2") && expectedType.equals("body")) return true;
if (type.equals("integral_type5") && expectedType.equals("integral_type")) return true;
if (type.equals("member_modifier10") && expectedType.equals("member_modifier")) return true;
if (type.equals("unary_expression2") && expectedType.equals("unary_expression")) return true;
if (type.equals("primary_expression_start5") && expectedType.equals("primary_expression_start")) return true;
if (type.equals("event_declarationInt1") && expectedType.equals("event_declarationInt")) return true;
if (type.equals("overloadable_unary_operator1") && expectedType.equals("overloadable_unary_operator")) return true;
if (type.equals("global_attribute_target2") && expectedType.equals("global_attribute_target")) return true;
if (type.equals("type_modifier4") && expectedType.equals("type_modifier")) return true;
if (type.equals("interface_member_declarationEnd2") && expectedType.equals("interface_member_declarationEnd")) return true;
if (type.equals("type_nameEnd2") && expectedType.equals("type_nameEnd")) return true;
if (type.equals("attribute_target1") && expectedType.equals("attribute_target")) return true;
if (type.equals("unary_operator2") && expectedType.equals("unary_operator")) return true;
if (type.equals("integral_type6") && expectedType.equals("integral_type")) return true;
if (type.equals("goto_statementEnd2") && expectedType.equals("goto_statementEnd")) return true;
if (type.equals("overloadable_binary_operator1") && expectedType.equals("overloadable_binary_operator")) return true;
if (type.equals("embedded_statement1") && expectedType.equals("embedded_statement")) return true;
if (type.equals("selection_statement1") && expectedType.equals("selection_statement")) return true;
if (type.equals("body1") && expectedType.equals("body")) return true;
if (type.equals("relational_operator1") && expectedType.equals("relational_operator")) return true;
if (type.equals("unary_expression1") && expectedType.equals("unary_expression")) return true;
if (type.equals("primary_expression_start6") && expectedType.equals("primary_expression_start")) return true;
if (type.equals("formal_parameter_listEndInt1") && expectedType.equals("formal_parameter_listEndInt")) return true;
if (type.equals("identifier3") && expectedType.equals("identifier")) return true;
if (type.equals("event_declarationInt2") && expectedType.equals("event_declarationInt")) return true;
if (type.equals("type_modifier5") && expectedType.equals("type_modifier")) return true;
if (type.equals("type_nameEnd3") && expectedType.equals("type_nameEnd")) return true;
if (type.equals("global_attribute_target1") && expectedType.equals("global_attribute_target")) return true;
if (type.equals("attribute_target2") && expectedType.equals("attribute_target")) return true;
if (type.equals("rest_of_array_initializerEnd2") && expectedType.equals("rest_of_array_initializerEnd")) return true;
if (type.equals("unary_operator3") && expectedType.equals("unary_operator")) return true;
if (type.equals("selection_statement2") && expectedType.equals("selection_statement")) return true;
if (type.equals("embedded_statement2") && expectedType.equals("embedded_statement")) return true;
if (type.equals("member_modifier12") && expectedType.equals("member_modifier")) return true;
if (type.equals("boolean_literal2") && expectedType.equals("boolean_literal")) return true;
if (type.equals("integral_type3") && expectedType.equals("integral_type")) return true;
if (type.equals("local_variable_initializer1") && expectedType.equals("local_variable_initializer")) return true;
if (type.equals("operator_declaration1") && expectedType.equals("operator_declaration")) return true;
if (type.equals("identifier2") && expectedType.equals("identifier")) return true;
if (type.equals("rest_of_array_initializer1") && expectedType.equals("rest_of_array_initializer")) return true;
if (type.equals("overloadable_unary_operator3") && expectedType.equals("overloadable_unary_operator")) return true;
if (type.equals("formal_parameter_listEndInt2") && expectedType.equals("formal_parameter_listEndInt")) return true;
if (type.equals("floating_point_type2") && expectedType.equals("floating_point_type")) return true;
if (type.equals("indexer_baseInt1") && expectedType.equals("indexer_baseInt")) return true;
if (type.equals("primary_expression_start3") && expectedType.equals("primary_expression_start")) return true;
if (type.equals("unary_operator4") && expectedType.equals("unary_operator")) return true;
if (type.equals("type_modifier2") && expectedType.equals("type_modifier")) return true;
if (type.equals("type_declaration1") && expectedType.equals("type_declaration")) return true;
if (type.equals("predefined_type3") && expectedType.equals("predefined_type")) return true;
if (type.equals("boolean_literal1") && expectedType.equals("boolean_literal")) return true;
if (type.equals("embedded_statement3") && expectedType.equals("embedded_statement")) return true;
if (type.equals("member_modifier11") && expectedType.equals("member_modifier")) return true;
if (type.equals("integral_type4") && expectedType.equals("integral_type")) return true;
if (type.equals("overloadable_unary_operator2") && expectedType.equals("overloadable_unary_operator")) return true;
if (type.equals("operator_declaration2") && expectedType.equals("operator_declaration")) return true;
if (type.equals("rest_of_array_initializer2") && expectedType.equals("rest_of_array_initializer")) return true;
if (type.equals("identifier1") && expectedType.equals("identifier")) return true;
if (type.equals("floating_point_type1") && expectedType.equals("floating_point_type")) return true;
if (type.equals("indexer_baseInt2") && expectedType.equals("indexer_baseInt")) return true;
if (type.equals("primary_expression_start4") && expectedType.equals("primary_expression_start")) return true;
if (type.equals("predefined_type4") && expectedType.equals("predefined_type")) return true;
if (type.equals("unary_operator5") && expectedType.equals("unary_operator")) return true;
if (type.equals("type_modifier3") && expectedType.equals("type_modifier")) return true;
if (type.equals("type_nameEnd1") && expectedType.equals("type_nameEnd")) return true;
if (type.equals("overloadable_binary_operator12") && expectedType.equals("overloadable_binary_operator")) return true;
if (type.equals("interface_member_modifier1") && expectedType.equals("interface_member_modifier")) return true;
if (type.equals("iteration_statement4") && expectedType.equals("iteration_statement")) return true;
if (type.equals("literal6") && expectedType.equals("literal")) return true;
if (type.equals("overloadable_unary_operator5") && expectedType.equals("overloadable_unary_operator")) return true;
if (type.equals("simple_type1") && expectedType.equals("simple_type")) return true;
if (type.equals("class_member_declarationEnd3") && expectedType.equals("class_member_declarationEnd")) return true;
if (type.equals("primary_expression_start9") && expectedType.equals("primary_expression_start")) return true;
if (type.equals("overloadable_binary_operator5") && expectedType.equals("overloadable_binary_operator")) return true;
if (type.equals("relational_operator4") && expectedType.equals("relational_operator")) return true;
if (type.equals("base_access1") && expectedType.equals("base_access")) return true;
if (type.equals("member_modifier3") && expectedType.equals("member_modifier")) return true;
if (type.equals("embedded_statement4") && expectedType.equals("embedded_statement")) return true;
if (type.equals("for_initializer1") && expectedType.equals("for_initializer")) return true;
if (type.equals("integral_type9") && expectedType.equals("integral_type")) return true;
if (type.equals("namespace_member_declaration2") && expectedType.equals("namespace_member_declaration")) return true;
if (type.equals("shift_operator1") && expectedType.equals("shift_operator")) return true;
if (type.equals("type_modifier1") && expectedType.equals("type_modifier")) return true;
if (type.equals("overloadable_binary_operator11") && expectedType.equals("overloadable_binary_operator")) return true;
if (type.equals("rest_of_enum_body1") && expectedType.equals("rest_of_enum_body")) return true;
if (type.equals("interface_member_modifier2") && expectedType.equals("interface_member_modifier")) return true;
if (type.equals("literal5") && expectedType.equals("literal")) return true;
if (type.equals("overloadable_unary_operator4") && expectedType.equals("overloadable_unary_operator")) return true;
if (type.equals("array_creation_postfix_expressionInternal1") && expectedType.equals("array_creation_postfix_expressionInternal")) return true;
if (type.equals("simple_type2") && expectedType.equals("simple_type")) return true;
if (type.equals("class_member_declarationEnd2") && expectedType.equals("class_member_declarationEnd")) return true;
if (type.equals("typeEnd1") && expectedType.equals("typeEnd")) return true;
if (type.equals("base_access2") && expectedType.equals("base_access")) return true;
if (type.equals("overloadable_binary_operator4") && expectedType.equals("overloadable_binary_operator")) return true;
if (type.equals("member_modifier4") && expectedType.equals("member_modifier")) return true;
if (type.equals("for_initializer2") && expectedType.equals("for_initializer")) return true;
if (type.equals("embedded_statement5") && expectedType.equals("embedded_statement")) return true;
if (type.equals("primary_expression_postfixInternal1") && expectedType.equals("primary_expression_postfixInternal")) return true;
if (type.equals("rest_of_array_initializerEnd1") && expectedType.equals("rest_of_array_initializerEnd")) return true;
if (type.equals("iteration_statement2") && expectedType.equals("iteration_statement")) return true;
if (type.equals("overloadable_binary_operator10") && expectedType.equals("overloadable_binary_operator")) return true;
if (type.equals("statement1") && expectedType.equals("statement")) return true;
if (type.equals("rest_of_enum_body2") && expectedType.equals("rest_of_enum_body")) return true;
if (type.equals("typeEnd2") && expectedType.equals("typeEnd")) return true;
if (type.equals("class_member_declarationEnd1") && expectedType.equals("class_member_declarationEnd")) return true;
if (type.equals("overloadable_unary_operator7") && expectedType.equals("overloadable_unary_operator")) return true;
if (type.equals("primary_expression_start7") && expectedType.equals("primary_expression_start")) return true;
if (type.equals("member_modifier1") && expectedType.equals("member_modifier")) return true;
if (type.equals("multiplicative_operator3") && expectedType.equals("multiplicative_operator")) return true;
if (type.equals("relational_operator2") && expectedType.equals("relational_operator")) return true;
if (type.equals("jump_statement2") && expectedType.equals("jump_statement")) return true;
if (type.equals("overloadable_binary_operator3") && expectedType.equals("overloadable_binary_operator")) return true;
if (type.equals("formal_parameter_listEnd2") && expectedType.equals("formal_parameter_listEnd")) return true;
if (type.equals("primary_expression_postfixInternal2") && expectedType.equals("primary_expression_postfixInternal")) return true;
if (type.equals("embedded_statement6") && expectedType.equals("embedded_statement")) return true;
if (type.equals("integral_type7") && expectedType.equals("integral_type")) return true;
if (type.equals("goto_statementEnd1") && expectedType.equals("goto_statementEnd")) return true;
if (type.equals("resource_acquisition1") && expectedType.equals("resource_acquisition")) return true;
if (type.equals("iteration_statement3") && expectedType.equals("iteration_statement")) return true;
if (type.equals("literal7") && expectedType.equals("literal")) return true;
if (type.equals("unary_operator1") && expectedType.equals("unary_operator")) return true;
if (type.equals("statement2") && expectedType.equals("statement")) return true;
if (type.equals("interface_member_declarationEnd1") && expectedType.equals("interface_member_declarationEnd")) return true;
if (type.equals("typeEnd3") && expectedType.equals("typeEnd")) return true;
if (type.equals("primary_expression_start8") && expectedType.equals("primary_expression_start")) return true;
if (type.equals("overloadable_unary_operator6") && expectedType.equals("overloadable_unary_operator")) return true;
if (type.equals("embedded_statement7") && expectedType.equals("embedded_statement")) return true;
if (type.equals("member_modifier2") && expectedType.equals("member_modifier")) return true;
if (type.equals("relational_operator3") && expectedType.equals("relational_operator")) return true;
if (type.equals("overloadable_binary_operator2") && expectedType.equals("overloadable_binary_operator")) return true;
if (type.equals("primary_expression_postfixInternal3") && expectedType.equals("primary_expression_postfixInternal")) return true;
if (type.equals("jump_statement1") && expectedType.equals("jump_statement")) return true;
if (type.equals("integral_type8") && expectedType.equals("integral_type")) return true;
if (type.equals("namespace_member_declaration1") && expectedType.equals("namespace_member_declaration")) return true;
if (type.equals("resource_acquisition2") && expectedType.equals("resource_acquisition")) return true;
if (type.equals("shift_operator2") && expectedType.equals("shift_operator")) return true;
if (type.equals("type_parameter_constraints3") && expectedType.equals("type_parameter_constraints")) return true;
if (type.equals("interface_member_declarationEndTypeIdentifier2") && expectedType.equals("interface_member_declarationEndTypeIdentifier")) return true;
if (type.equals("relational_expressionInternal1") && expectedType.equals("relational_expressionInternal")) return true;
if (type.equals("overloadable_binary_operator16") && expectedType.equals("overloadable_binary_operator")) return true;
if (type.equals("typeEnd4") && expectedType.equals("typeEnd")) return true;
if (type.equals("class_type1") && expectedType.equals("class_type")) return true;
if (type.equals("statement3") && expectedType.equals("statement")) return true;
if (type.equals("jump_statement4") && expectedType.equals("jump_statement")) return true;
if (type.equals("literal2") && expectedType.equals("literal")) return true;
if (type.equals("array_creation_postfix_expressionInternal4") && expectedType.equals("array_creation_postfix_expressionInternal")) return true;
if (type.equals("variable_initializer2") && expectedType.equals("variable_initializer")) return true;
if (type.equals("member_modifier7") && expectedType.equals("member_modifier")) return true;
if (type.equals("assignment_operator8") && expectedType.equals("assignment_operator")) return true;
if (type.equals("primary_expression_postfixInternal4") && expectedType.equals("primary_expression_postfixInternal")) return true;
if (type.equals("equality_operator1") && expectedType.equals("equality_operator")) return true;
if (type.equals("attribute_sectionEnd3") && expectedType.equals("attribute_sectionEnd")) return true;
if (type.equals("type_parameter_constraints2") && expectedType.equals("type_parameter_constraints")) return true;
if (type.equals("rest_of_enum_bodyEnd1") && expectedType.equals("rest_of_enum_bodyEnd")) return true;
if (type.equals("overloadable_binary_operator9") && expectedType.equals("overloadable_binary_operator")) return true;
if (type.equals("multiplicative_operator1") && expectedType.equals("multiplicative_operator")) return true;
if (type.equals("embedded_statement8") && expectedType.equals("embedded_statement")) return true;
if (type.equals("interface_member_declarationEndTypeIdentifier1") && expectedType.equals("interface_member_declarationEndTypeIdentifier")) return true;
if (type.equals("class_member_declarationEnd6") && expectedType.equals("class_member_declarationEnd")) return true;
if (type.equals("overloadable_binary_operator15") && expectedType.equals("overloadable_binary_operator")) return true;
if (type.equals("type_name_or_paramenter1") && expectedType.equals("type_name_or_paramenter")) return true;
if (type.equals("typeEnd5") && expectedType.equals("typeEnd")) return true;
if (type.equals("relational_expressionInternal2") && expectedType.equals("relational_expressionInternal")) return true;
if (type.equals("jump_statement3") && expectedType.equals("jump_statement")) return true;
if (type.equals("literal1") && expectedType.equals("literal")) return true;
if (type.equals("iteration_statement1") && expectedType.equals("iteration_statement")) return true;
if (type.equals("overloadable_unary_operator8") && expectedType.equals("overloadable_unary_operator")) return true;
if (type.equals("class_type2") && expectedType.equals("class_type")) return true;
if (type.equals("array_creation_postfix_expressionInternal5") && expectedType.equals("array_creation_postfix_expressionInternal")) return true;
if (type.equals("parameter_modifier2") && expectedType.equals("parameter_modifier")) return true;
if (type.equals("statement4") && expectedType.equals("statement")) return true;
if (type.equals("parameter_modifier1") && expectedType.equals("parameter_modifier")) return true;
if (type.equals("variable_initializer1") && expectedType.equals("variable_initializer")) return true;
if (type.equals("member_modifier8") && expectedType.equals("member_modifier")) return true;
if (type.equals("assignment_operator9") && expectedType.equals("assignment_operator")) return true;
if (type.equals("attribute_sectionEnd2") && expectedType.equals("attribute_sectionEnd")) return true;
if (type.equals("formal_parameter_listEnd1") && expectedType.equals("formal_parameter_listEnd")) return true;
if (type.equals("rest_of_enum_bodyEnd2") && expectedType.equals("rest_of_enum_bodyEnd")) return true;
if (type.equals("argumentPrefix1") && expectedType.equals("argumentPrefix")) return true;
if (type.equals("primary_expression_postfixInternal5") && expectedType.equals("primary_expression_postfixInternal")) return true;
if (type.equals("type_parameter_constraints1") && expectedType.equals("type_parameter_constraints")) return true;
if (type.equals("multiplicative_operator2") && expectedType.equals("multiplicative_operator")) return true;
if (type.equals("additive_operator1") && expectedType.equals("additive_operator")) return true;
if (type.equals("assignment_operator10") && expectedType.equals("assignment_operator")) return true;
if (type.equals("overloadable_binary_operator8") && expectedType.equals("overloadable_binary_operator")) return true;
if (type.equals("embedded_statement9") && expectedType.equals("embedded_statement")) return true;
if (type.equals("overloadable_binary_operator14") && expectedType.equals("overloadable_binary_operator")) return true;
if (type.equals("attribute_section_start1") && expectedType.equals("attribute_section_start")) return true;
if (type.equals("constructor_initializerInt1") && expectedType.equals("constructor_initializerInt")) return true;
if (type.equals("numeric_type1") && expectedType.equals("numeric_type")) return true;
if (type.equals("non_array_type1") && expectedType.equals("non_array_type")) return true;
if (type.equals("class_member_declarationEnd5") && expectedType.equals("class_member_declarationEnd")) return true;
if (type.equals("array_creation_postfix_expressionInternal2") && expectedType.equals("array_creation_postfix_expressionInternal")) return true;
if (type.equals("literal4") && expectedType.equals("literal")) return true;
if (type.equals("assignment_operator5") && expectedType.equals("assignment_operator")) return true;
if (type.equals("relational_operator2I1") && expectedType.equals("relational_operator2I")) return true;
if (type.equals("class_type3") && expectedType.equals("class_type")) return true;
if (type.equals("primary_constraint3") && expectedType.equals("primary_constraint")) return true;
if (type.equals("primary_expression_start10") && expectedType.equals("primary_expression_start")) return true;
if (type.equals("attribute_sectionEnd1") && expectedType.equals("attribute_sectionEnd")) return true;
if (type.equals("embedded_statement10") && expectedType.equals("embedded_statement")) return true;
if (type.equals("member_modifier5") && expectedType.equals("member_modifier")) return true;
if (type.equals("additive_operator2") && expectedType.equals("additive_operator")) return true;
if (type.equals("interface_member_declarationEndType1") && expectedType.equals("interface_member_declarationEndType")) return true;
if (type.equals("switch_label1") && expectedType.equals("switch_label")) return true;
if (type.equals("argumentPrefix2") && expectedType.equals("argumentPrefix")) return true;
if (type.equals("primary_expression_postfixInternal6") && expectedType.equals("primary_expression_postfixInternal")) return true;
if (type.equals("overloadable_binary_operator7") && expectedType.equals("overloadable_binary_operator")) return true;
if (type.equals("overloadable_binary_operator13") && expectedType.equals("overloadable_binary_operator")) return true;
if (type.equals("class_member_declarationEnd4") && expectedType.equals("class_member_declarationEnd")) return true;
if (type.equals("primary_expression1") && expectedType.equals("primary_expression")) return true;
if (type.equals("numeric_type2") && expectedType.equals("numeric_type")) return true;
if (type.equals("non_array_type2") && expectedType.equals("non_array_type")) return true;
if (type.equals("attribute_section_start2") && expectedType.equals("attribute_section_start")) return true;
if (type.equals("constructor_initializerInt2") && expectedType.equals("constructor_initializerInt")) return true;
if (type.equals("primary_constraint2") && expectedType.equals("primary_constraint")) return true;
if (type.equals("relational_operator2I2") && expectedType.equals("relational_operator2I")) return true;
if (type.equals("assignment_operator6") && expectedType.equals("assignment_operator")) return true;
if (type.equals("array_creation_postfix_expressionInternal3") && expectedType.equals("array_creation_postfix_expressionInternal")) return true;
if (type.equals("literal3") && expectedType.equals("literal")) return true;
if (type.equals("jump_statement5") && expectedType.equals("jump_statement")) return true;
if (type.equals("member_modifier6") && expectedType.equals("member_modifier")) return true;
if (type.equals("assignment_operator7") && expectedType.equals("assignment_operator")) return true;
if (type.equals("variable_initializer3") && expectedType.equals("variable_initializer")) return true;
if (type.equals("embedded_statement11") && expectedType.equals("embedded_statement")) return true;
if (type.equals("interface_member_declarationEndType2") && expectedType.equals("interface_member_declarationEndType")) return true;
if (type.equals("overloadable_binary_operator6") && expectedType.equals("overloadable_binary_operator")) return true;
if (type.equals("switch_label2") && expectedType.equals("switch_label")) return true;
if (type.equals("equality_operator2") && expectedType.equals("equality_operator")) return true;
return false;
}
}
| ckaestne/CIDE | other/fstgen/test/tmp/generated_csharp/SimplePrintVisitor.java | Java | gpl-3.0 | 38,659 |
{% extends 'base/base.html' %}
{% import 'base/header.html' as header with context %}
{% import 'base/footer.html' as footer with context %}
{% block title %} PyCon Pune 2017 {% endblock %}
{% block body %}
{{ header.render_header() }}
<div class="third-fold">
<div class="fold-1">
<div class="white-fold">
<div class="responsive-container">
<div class="content" style="background-color: #bfbcbc;width:20%;min-height:50vh;margin:auto;">
Content
</div>
</div>
</div>
{{ footer.render_footer() }}
</div>
</div><!-- third-fold -->
{% endblock %}
| aditya-konarde/pune.pycon.org | templates/other.html | HTML | gpl-3.0 | 620 |
# Copyright (c) 2016-2022 Crave.io Inc. All rights reserved
IMGTAG?=accupara/tak-civ-android
IMGVER?=latest
include $(shell git rev-parse --show-toplevel)/Makefile.build
| accupara/docker-images | tak/Makefile | Makefile | gpl-3.0 | 171 |
/**
* Created on Oct 6, 2005
*
* Copyright 2005 by Arysys Technologies (P) Ltd.,
* #29,784/785 Hendre Castle,
* D.S.Babrekar Marg,
* Gokhale Road(North),
* Dadar,Mumbai 400 028
* India
*
* All rights reserved.
*
* This software is the confidential and proprietary information
* of Arysys Technologies (P) Ltd. ("Confidential Information").
* You shall not disclose such Confidential Information and shall use
* it only in accordance with the terms of the license agreement
* you entered into with Arysys Technologies (P) Ltd.
*/
package kreidos.diamond.model.vo;
import java.io.File;
import java.util.Hashtable;
/**
* Document contains revisions. These revisions are accessed using this value object
* @author Rahul Kubadia
* @since 2.0
* @see kreidos.diamond.model.vo.Document
*/
public class DocumentRevision {
private int documentId;
private String revisionId;
private int offset;
private int length;
private int classId;
private File documentFile = null;
private String userName="";
private Hashtable<String,String> indexRecord = null;
private String comments = "";
/**
* Default constructor
*/
public DocumentRevision() {
super();
}
public int getDocumentId() {
return documentId;
}
public void setDocumentId(int documentId) {
this.documentId = documentId;
}
public int getLength() {
return length;
}
public void setLength(int length) {
this.length = length;
}
public int getOffset() {
return offset;
}
public void setOffset(int offset) {
this.offset = offset;
}
public String getRevisionId() {
return revisionId;
}
public void setRevisionId(String revisionId) {
this.revisionId = revisionId;
}
public int getClassId() {
return classId;
}
public void setClassId(int classId) {
this.classId = classId;
}
public File getDocumentFile() {
return documentFile;
}
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public void setDocumentFile(File documentFile) {
this.documentFile = documentFile;
}
public Hashtable<String, String> getIndexRecord() {
return indexRecord;
}
public void setIndexRecord(Hashtable<String, String> indexRecord) {
this.indexRecord = indexRecord;
}
public String getComments() {
return comments;
}
public void setComments(String comments) {
this.comments = comments;
}
}
| Kreidos/diamond | src/kreidos/diamond/model/vo/DocumentRevision.java | Java | gpl-3.0 | 2,492 |
/*
Copyright (C) 2010,2011,2012 The ESPResSo project
Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009,2010
Max-Planck-Institute for Polymer Research, Theory Group
This file is part of ESPResSo.
ESPResSo is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
ESPResSo 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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef ANGLEDIST_TCL_H
#define ANGLEDIST_TCL_H
/** \file angledist_tcl.h
* Tcl interface for \ref angledist.h
*/
#include "parser.h"
#include "interaction_data.h"
#ifdef BOND_ANGLEDIST
/// parse parameters for the angle potential
int tclcommand_inter_parse_angledist(Tcl_Interp *interp,
int bond_type, int argc, char **argv);
///
int tclprint_to_result_angledistIA(Tcl_Interp *interp,
Bonded_ia_parameters *params);
#endif
#endif
| icimrak/espresso | src/tcl/angledist_tcl.h | C | gpl-3.0 | 1,304 |
/**
* mapDraw2.js
*
*
* @package Heurist academic knowledge management system
* @link http://HeuristNetwork.org
* @copyright (C) 2005-2020 University of Sydney
* @author Artem Osmakov <artem.osmakov@sydney.edu.au>
* @license http://www.gnu.org/licenses/gpl-3.0.txt GNU License 3.0
* @version 4.0
*/
/*
* Licensed under the GNU License, Version 3.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.gnu.org/licenses/gpl-3.0.txt
* 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.
*/
function hMappingDraw(_mapdiv_id, _initial_wkt) {
var _className = "MappingDraw",
_version = "0.4";
var mapdiv_id = null;
var drawingManager;
var selectedShape;
var colors = ['#1E90FF', '#FF1493', '#32CD32', '#FF8C00', '#4B0082'];
var selectedColor;
var colorButtons = {};
var gmap;
var initial_wkt = null;
var deleteMenu;
var overlays = []; //all objects on map
var geocoder = null;
var map_viewpoints = []; //saved in user preferences (session) map viewpoints (bounds)
var map_overlays = []; //array of kml, tiled and images layers (from db)
var _current_overlay = null;
function clearSelection() {
if (selectedShape) {
if(selectedShape.type != google.maps.drawing.OverlayType.MARKER) selectedShape.setEditable(false);
selectedShape = null;
}
$('#coords1').val('');
}
function showCoordsHint(){
var type = drawingManager.getDrawingMode();
if (selectedShape!=null) {
type = selectedShape.type;
}
var sPrompt = '';
if(type==google.maps.drawing.OverlayType.MARKER){
sPrompt = 'Marker: enter coordinates as: lat long';
}else if(type==google.maps.drawing.OverlayType.CIRCLE){
sPrompt = 'Circle: enter coordinates as: lat-center long-center radius-km';
}else if(type==google.maps.drawing.OverlayType.RECTANGLE){
sPrompt = 'Rectangle: enter coordinates as: lat-min long-min lat-max long-max';
}else if(type==google.maps.drawing.OverlayType.POLYLINE || type==google.maps.drawing.OverlayType.POLYGON){
sPrompt = (type==google.maps.drawing.OverlayType.POLYGON?'Polygon':'Polyline')
+': enter coordinates as sequence of lat long separated by space';
}
//if(sPrompt) sPrompt += '(for UTM first easting then northing)';
$('#coords_hint').html(sPrompt);
}
function setSelection(shape) {
clearSelection();
selectedShape = shape;
if(shape.type != google.maps.drawing.OverlayType.MARKER) shape.setEditable(true);
selectColor(shape.get('fillColor') || shape.get('strokeColor'));
_fillCoordinates(shape);
}
function _deleteSelectedShape() {
if (selectedShape) {
for(i in overlays){
if(overlays[i]==selectedShape){
overlays.splice(i,1);
break;
}
}
selectedShape.setMap(null);
clearSelection();
}
}
function _deleteAllShapes( leaveOne ) {
clearSelection();
while(overlays[0]){
if(leaveOne===true && overlays.length==1){
break;
}
overlays.pop().setMap(null);
}
}
//
// start color methods ------------------------------------------------------
//
function selectColor(color) {
selectedColor = color;
for (var i = 0; i < colors.length; ++i) {
var currColor = colors[i];
colorButtons[currColor].style.border = currColor == color ? '2px solid #789' : '2px solid #fff';
}
// Retrieves the current options from the drawing manager and replaces the
// stroke or fill color as appropriate.
var polylineOptions = drawingManager.get('polylineOptions');
polylineOptions.strokeColor = color;
drawingManager.set('polylineOptions', polylineOptions);
var rectangleOptions = drawingManager.get('rectangleOptions');
rectangleOptions.fillColor = color;
drawingManager.set('rectangleOptions', rectangleOptions);
var circleOptions = drawingManager.get('circleOptions');
circleOptions.fillColor = color;
drawingManager.set('circleOptions', circleOptions);
var polygonOptions = drawingManager.get('polygonOptions');
polygonOptions.fillColor = color;
drawingManager.set('polygonOptions', polygonOptions);
}
//start color functions
function setSelectedShapeColor(color) {
if (selectedShape) {
if (selectedShape.type == google.maps.drawing.OverlayType.POLYLINE) {
selectedShape.set('strokeColor', color);
} else {
selectedShape.set('fillColor', color);
}
}
}
function makeColorButton(color) {
var button = document.createElement('span');
button.className = 'color-button';
button.style.backgroundColor = color;
google.maps.event.addDomListener(button, 'click', function() {
selectColor(color);
setSelectedShapeColor(color);
});
return button;
}
function buildColorPalette() {
var colorPalette = document.getElementById('color-palette');
for (var i = 0; i < colors.length; ++i) {
var currColor = colors[i];
var colorButton = makeColorButton(currColor);
colorPalette.appendChild(colorButton);
colorButtons[currColor] = colorButton;
}
selectColor(colors[0]);
}
//
// END color methods ------------------------------------------------------
//
//
// fill list of coordinates
//
function _fillCoordinates(shape){
if(shape!=null){
sCoords = '';
if(shape.type==google.maps.drawing.OverlayType.POLYGON ||
shape.type==google.maps.drawing.OverlayType.POLYLINE) {
processPoints(shape.getPath(), function(latLng){
sCoords = sCoords+formatPnt(latLng)+'\n';
}, shape);
}else if(shape.type==google.maps.drawing.OverlayType.RECTANGLE){
var bnd = shape.getBounds();
sCoords = formatPnt(bnd.getSouthWest()) + '\n' + formatPnt(bnd.getNorthEast());
}else if(shape.type==google.maps.drawing.OverlayType.CIRCLE){
var radius = shape.getRadius();
if(radius>0)
sCoords = formatPnt(shape.getCenter())+'\nr='+radius.toFixed(2);
}else if(shape.type==google.maps.drawing.OverlayType.MARKER){
sCoords = formatPnt(shape.getPosition());
}
$('#coords1').val(sCoords);
}
}
//
// get wkt for current shape
//
function _getWKT(shape){
var res = {type:null, wkt:null};
if(shape!=null){
if(shape.type==google.maps.drawing.OverlayType.POLYGON) {
var aCoords = [];
processPoints(shape.getPath(), function(latLng){
aCoords.push(formatPntWKT(latLng));
}, shape);
aCoords.push(aCoords[0]); //add lst point otherwise WKT fails
res.type = 'pl';
res.wkt = "POLYGON ((" + aCoords.join(",") + "))";
}else if(shape.type==google.maps.drawing.OverlayType.POLYLINE){
var aCoords = [];
processPoints(shape.getPath(), function(latLng){
aCoords.push(formatPntWKT(latLng));
}, shape);
res.type = 'l';
res.wkt = "LINESTRING (" + aCoords.join(",") + ")";
}else if(shape.type==google.maps.drawing.OverlayType.RECTANGLE){
var bnd = shape.getBounds();
var aCoords = [];
var sw = bnd.getSouthWest();
var nw = bnd.getNorthEast();
aCoords.push(formatPntWKT(sw));
aCoords.push(formatPntWKT( new google.maps.LatLng(nw.lat(), sw.lng()) ));
aCoords.push(formatPntWKT(nw));
aCoords.push(formatPntWKT( new google.maps.LatLng(sw.lat(), nw.lng()) ));
aCoords.push(formatPntWKT(sw));
res.type = "r";
res.wkt = "POLYGON ((" + aCoords.join(",") + "))";
}else if(shape.type==google.maps.drawing.OverlayType.CIRCLE){
/*
value = "LINESTRING ("+lng+" "+lat+","+r(bounds.getNorthEast().lng())+" "+lat+","+
r(bounds.getSouthWest().lng())+" "+r(bounds.getSouthWest().lat())+","+
r(bounds.getSouthWest().lng())+" "+r(bounds.getNorthEast().lat())+
")";*/
var bnd = shape.getBounds();
// Actualy we need ony 2 points to detect center and radius - however we add 2 more points for correct bounds
var aCoords = [];
aCoords.push(formatPntWKT(shape.getCenter()));
aCoords.push(formatPntWKT( new google.maps.LatLng( shape.getCenter().lat(), bnd.getNorthEast().lng() ) ));
aCoords.push(formatPntWKT( bnd.getSouthWest() ));
aCoords.push(formatPntWKT( bnd.getNorthEast() ));
res.type = 'c';
res.wkt = "LINESTRING (" + aCoords.join(",") + ")";
}else if(shape.type==google.maps.drawing.OverlayType.MARKER){
res.type = 'p';
res.wkt = "POINT ("+formatPntWKT(shape.getPosition())+")";
}
}
return res;
}
function processPoints(geometry, callback, thisArg) {
if (geometry instanceof google.maps.LatLng) {
callback.call(thisArg, geometry);
} else if (geometry instanceof google.maps.Data.Point) {
callback.call(thisArg, geometry.get());
} else {
geometry.getArray().forEach(function(g) {
processPoints(g, callback, thisArg);
});
}
}
//
// on vertex edit
//
function _onPathComplete(shape) {
// complete functions
var thePath = shape.getPath();
google.maps.event.addListener(shape, 'rightclick', function(e) {
// Check if click was on a vertex control point
if (e.vertex == undefined) {
return;
}
deleteMenu.open(gmap, shape.getPath(), e.vertex);
});
//fill coordinates on vertex edit
function __fillCoordinates() {
_fillCoordinates(shape);
}
google.maps.event.addListener(thePath, 'set_at', __fillCoordinates);
google.maps.event.addListener(thePath, 'insert_at', __fillCoordinates);
google.maps.event.addListener(thePath, 'remove_at', __fillCoordinates);
_fillCoordinates(shape);
}
//
// on circle complete
//
function _onCircleComplete(shape) {
google.maps.event.addListener(shape, 'radius_changed', function(){ _fillCoordinates(shape); });
google.maps.event.addListener(shape, 'center_changed', function(){ _fillCoordinates(shape); });
_fillCoordinates(shape);
}
//
//
//
function _onRectangleComplete(shape) {
google.maps.event.addListener(shape, 'bounds_changed', function(){ _fillCoordinates(shape); });
//google.maps.event.addListener(rectangle, 'dragend', __fillCoordinates);
_fillCoordinates(shape);
}
//
//
//
function _onMarkerAdded(newShape){
if(!$('#cbAllowMulti').is(':checked')) _deleteAllShapes();
overlays.push(newShape);
google.maps.event.addListener(newShape, 'rightclick', function(e) {
deleteMenu.open(gmap, newShape, newShape.getPosition());
});
google.maps.event.addListener(newShape, 'click', function() {
setSelection(newShape);
});
google.maps.event.addListener(newShape, 'dragend', function(event) {
setSelection(newShape);
});
}
//
//
//
function _onNonMarkerAdded(newShape){
if(!$('#cbAllowMulti').is(':checked')) _deleteAllShapes();
overlays.push(newShape);
drawingManager.setDrawingMode(null);
setSelection(newShape);
// Add an event listener that selects the newly-drawn shape when the user
// mouses down on it.
google.maps.event.addListener(newShape, 'click', function() {
setSelection(newShape);
});
}
//
// init map
//
function _init(_mapdiv_id, _initial_wkt) {
_initUIcontrols();
mapdiv_id = _mapdiv_id;
initial_wkt = _initial_wkt;
_init_DeleteMenu();
var map = new google.maps.Map(document.getElementById(mapdiv_id), {
zoom: 2,
center: new google.maps.LatLng(31.2890625, 5), //22.344, 114.048),
disableDefaultUI: true,
zoomControl: true,
zoomControlOptions: {
position: google.maps.ControlPosition.RIGHT_TOP
},
mapTypeId: google.maps.MapTypeId.TERRAIN,
mapTypeControl: true,
mapTypeControlOptions: {
//style: google.maps.MapTypeControlStyle.DROPDOWN_MENU,
mapTypeIds: ['terrain', 'roadmap','satellite','hybrid'],
position: google.maps.ControlPosition.LEFT_TOP
}
});
// deal with initial tile loading
var loadListener = google.maps.event.addListener(map, 'tilesloaded', function(){
google.maps.event.removeListener( loadListener );
_onMapInited();
});
gmap = map;
}
//
//
//
function formatPnt(pnt, d){
if(isNaN(d)) d = 7;
var lat = pnt.lat();
lat = lat.toFixed(d);
var lng = pnt.lng();
lng = lng.toFixed(d);
return lat + ' ' + lng;
}
function formatPntWKT(pnt, d){
if(isNaN(d)) d = 7;
var lat = pnt.lat();
lat = lat.toFixed(d);
var lng = pnt.lng();
lng = lng.toFixed(d);
return lng + ' ' + lat;
}
//
//
//
function _startGeocodingSearch(){
if(geocoder==null){
geocoder = new google.maps.Geocoder();
}
var address = document.getElementById("input_search").value;
geocoder.geocode( { 'address': address}, function(results, status) {
if (status == google.maps.GeocoderStatus.OK) {
if(results[0].geometry.viewport){
gmap.fitBounds(results[0].geometry.viewport);
}else{
gmap.setCenter(results[0].geometry.location);
}
/*var marker = new google.maps.Marker({
map: map,
position: results[0].geometry.location
});*/
} else {
alert(window.hWin.HR("Sorry, Google Maps reports " + status
+ ". Could not find the specified place name. <br/><br/>Please check spelling."));
}
});
}
//
//
//
function _zoomToSelection() {
var bounds = null;
var shape = selectedShape;
if(shape!=null){
if(shape.type==google.maps.drawing.OverlayType.POLYGON ||
shape.type==google.maps.drawing.OverlayType.POLYLINE) {
bounds = new google.maps.LatLngBounds();
//map.data.forEach(function(feature) {
// processPoints(feature.getGeometry(), bounds.extend, bounds);
//});
processPoints(shape.getPath(), bounds.extend, bounds);
}else if(shape.type==google.maps.drawing.OverlayType.RECTANGLE ||
shape.type==google.maps.drawing.OverlayType.CIRCLE)
{
bounds = shape.getBounds();
}else if(shape.type==google.maps.drawing.OverlayType.MARKER){
gmap.setCenter(shape.getPosition());
gmap.setZoom(14);
}
}
if(bounds!=null){
gmap.fitBounds(bounds);
}
}
//
//
//
function _applyCoordsForSelectedShape(){
var type = drawingManager.getDrawingMode();
if (selectedShape!=null) {
type = selectedShape.type;
}
if(type==null){
alert(window.hWin.HR('Select shape on map first or define drawing mode'));
return;
}
var sCoords = $("#coords1").val();
_parseManualEntry(sCoords, type);
}
Number.prototype.toRad = function() {
return this * Math.PI / 180;
}
Number.prototype.toDeg = function() {
return this * 180 / Math.PI;
}
//
// get point within given radius
//
function _destinationPoint(latLong, brng, dist) {
dist = dist / 6371000;
brng = brng.toRad();
var lat1 = latLong.lat.toRad();
var lon1 = latLong.lng.toRad();
var lat2 = Math.asin(Math.sin(lat1) * Math.cos(dist) +
Math.cos(lat1) * Math.sin(dist) * Math.cos(brng));
var lon2 = lon1 + Math.atan2(Math.sin(brng) * Math.sin(dist) *
Math.cos(lat1),
Math.cos(dist) - Math.sin(lat1) *
Math.sin(lat2));
if (isNaN(lat2) || isNaN(lon2)) return null;
return {lat:lat2.toDeg(), lng:lon2.toDeg()};
}
//
//
//
function _getDistance(latLong1, latLong2) {
var R = 6371000; // earth's radius in meters
var dLat = (latLong2.lat-latLong1.lat).toRad(); //* Math.PI / 180;
var dLon = (latLong2.lng-latLong1.lng).toRad(); //* Math.PI / 180;
var a = Math.sin(dLat/2) * Math.sin(dLat/2) +
Math.cos(latLong1.lat.toRad() ) * Math.cos(latLong2.lat.toRad() ) *
Math.sin(dLon/2) * Math.sin(dLon/2);
var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a));
var d = R * c;
return d;
}
//
//
//
function _parseManualEntry(sCoords, type, UTMzone){
var s = sCoords.replace(/[\b\t\n\v\f\r]/g, ' '); //remove invisible service chars
s = s.replace(" "," ").trim();
var arc = s.split(" ");
var coords = []; //Array of LatLngLiteral
var islat = false, k;
var hemisphere = 'N';
if(window.hWin.HEURIST4.util.isnull(UTMzone)){
var allInteger = true, allOutWGS = true;
//check for UTM - assume they are integer and at least several are more than 180
for (k=0; k<arc.length; k++){
if(k==2 && type==google.maps.drawing.OverlayType.CIRCLE) continue;
var crd = Number(arc[k]);
if(isNaN(crd)){
alert(arc[k]+" is not number value");
return null;
}
allInteger = allInteger && (crd==parseInt(arc[k]));
allOutWGS = allOutWGS && ((islat && Math.abs(crd)>90) || Math.abs(crd)>180);
if (!(allOutWGS && allInteger)) break;
islat = !islat;
}
if(allInteger || allOutWGS){ //offer to convert UTM to LatLong
var $ddlg, buttons = {};
buttons['Yes, UTM'] = function(){
var UTMzone = $ddlg.find('#dlg-prompt-value').val();
if(!window.hWin.HEURIST4.util.isempty(UTMzone)){
var re = /s|n/gi;
var zone = parseInt(UTMzone.replace(re,''));
if(isNaN(zone) || zone<1 || zone>60){
setTimeout('alert("UTM zone must be within range 1-60");',500);
return false;
//38N 572978.70 5709317.22
//east 572980.08 5709317.24
//574976.85 5706301.55
}
}else{
UTMzone = 0;
}
setTimeout(function(){_parseManualEntry(sCoords, type, UTMzone);},500);
$ddlg.dialog('close');
};
buttons['No'] = function(){ $ddlg.dialog('close');
setTimeout(function(){_parseManualEntry(sCoords, type, 0);},500);
};
$ddlg = window.hWin.HEURIST4.msg.showMsgDlg(
'<p>We have detected coordinate values in the import '
+'which we assume to be UTM coordinates/grid references.</p><br>'
+'<p>Heurist will only import coordinates from one UTM zone at a time. Please '
+'split into separate files if you have more than one UTM zone in your data.</p><br>'
+'<p>UTM zone (1-60) and Hemisphere (N or S) for these data: <input id="dlg-prompt-value"></p>',
buttons, 'UTM coordinates?');
return;
}
UTMzone = 0;
}else if(UTMzone!=0) {
//parse UTMzone must be 1-60 N or S
if(UTMzone.toLowerCase().indexOf('s')>=0){
hemisphere = 'S';
}
var re = /s|n/gi;
UTMzone = parseInt(UTMzone.replace(re,''));
if(isNaN(UTMzone) || UTMzone<1 || UTMzone>60){
setTimeout("alert('UTM zone must be within range 1-60')",500);
return;
//38N 572978.70 5709317.22
}
}
//verify and gather coordintes
islat = true;
for (k=0; k<arc.length; k++){
//special case for circle
if(k==2 && type==google.maps.drawing.OverlayType.CIRCLE && arc[k].indexOf("r=")==0){
var d = Number(arc[k].substr(2));
if(isNaN(d)){
alert(arc[k]+" is wrong radius value");
return null;
}
var resc = _destinationPoint(coords[0], 90, d);
if(resc!=null){
coords.push({radius:d});
}else{
alert("Cannot create circle");
return null;
}
break;
}
var crd = Number(arc[k]);
if(isNaN(crd)){
alert(arc[k]+" is not number value");
return null;
}else if(UTMzone==0 && !islat && Math.abs(crd)>180){
alert(arc[k]+" is an invalid longitude value");
return null;
}else if(UTMzone==0 && islat && Math.abs(crd)>90){
alert(arc[k]+" is an invalid latitude value");
return null;
}
islat = !islat;
if(islat){
if(UTMzone>0){
easting = Number(arc[k-1]);
northing = crd;
var utm = new Utm( UTMzone, hemisphere, easting, northing );
var latlon = utm.toLatLonE();
coords.push({lat:latlon.lat, lng:latlon.lon});
}else{
coords.push({lat:Number(arc[k-1]), lng:crd});
}
}
}//for
var res = _loadShape(coords, type);
if(res && selectedShape!=null){
_zoomToSelection();
}
return coords;
}
//coords Array of LatLngLiteral
function _loadShape(coords, type){
var res = false;
if (coords && coords.length>0){
if(type==google.maps.drawing.OverlayType.POLYGON){
if(coords.length<3){
alert("Not enough coordinates for rectangle. Need at least 3 pairs");
}else{
if (selectedShape) {
selectedShape.setPath(coords);
}else{
var opts = drawingManager.get('polygonOptions');
opts.paths = coords;
var newShape = new google.maps.Polygon(opts);
newShape.setMap(gmap);
newShape.type = google.maps.drawing.OverlayType.POLYGON;
_onNonMarkerAdded(newShape);
}
_onPathComplete(selectedShape);
res = true;
}
}else if(type==google.maps.drawing.OverlayType.POLYLINE){
if(coords.length<2){
alert("Not enough coordinates for path. Need at least 2 pairs");
}else{
if (selectedShape) {
selectedShape.setPath(coords);
}else{
var opts = drawingManager.get('polylineOptions');
opts.path = coords;
var newShape = new google.maps.Polyline(opts);
newShape.setMap(gmap);
newShape.type = google.maps.drawing.OverlayType.POLYLINE;
_onNonMarkerAdded(newShape);
}
_onPathComplete(selectedShape);
res = true;
}
}else if (type==google.maps.drawing.OverlayType.MARKER){
if (selectedShape) {
selectedShape.setPosition(coords[0]);
}else{
var k, newShape;
for(k=0; k<coords.length; k++){
var opts = drawingManager.get('markerOptions');
opts.position = coords[k];
newShape = new google.maps.Marker(opts);
newShape.setMap(gmap);
newShape.type = google.maps.drawing.OverlayType.MARKER;
_onMarkerAdded(newShape);
}
setSelection(newShape);
}
res = true;
}else if (type==google.maps.drawing.OverlayType.RECTANGLE){
if(coords.length<2){
alert("Not enough coordinates for rectangle. Need at least 2 pairs");
}else{
var bounds = {south:coords[0].lat, west:coords[0].lng, north:coords[1].lat, east:coords[1].lng };
if (selectedShape) {
selectedShape.setBounds( bounds );
}else{
var opts = drawingManager.get('rectangleOptions');
opts.bounds = bounds;
var newShape = new google.maps.Rectangle(opts);
newShape.setMap(gmap);
newShape.type = google.maps.drawing.OverlayType.RECTANGLE;
_onNonMarkerAdded(newShape);
_onRectangleComplete(newShape);
}
res = true;
}
}else if (type==google.maps.drawing.OverlayType.CIRCLE){
if(coords.length<2){
alert("Not enough coordinates for circle. Need at least 2 pairs or center and radius");
}else{
var radius = (coords[1].radius>0)
?coords[1].radius
:_getDistance(coords[0], coords[1]) ;
if (selectedShape) {
selectedShape.setCenter( coords[0] );
selectedShape.setRadius( radius );
}else{
var opts = drawingManager.get('circleOptions');
opts.center = coords[0];
opts.radius = radius;
var newShape = new google.maps.Circle(opts);
newShape.setMap(gmap);
newShape.type = google.maps.drawing.OverlayType.CIRCLE;
_onNonMarkerAdded(newShape);
_onCircleComplete(newShape);
}
res = true;
}
}
}
return res;
}
//
// show GeoJSON as a set of separate overlays - replace with window.hWin.HEURIST4.geo.prepareGeoJSON
//
function _loadGeoJSON(mdata){
if (typeof(mdata) === "string" && !window.hWin.HEURIST4.util.isempty(mdata)){
try{
mdata = $.parseJSON(mdata);
//mdata = JSON.parse( mdata );
}catch(e){
mdata = null;
console.log('Not well formed JSON provided. Property names be quoted with double-quote characters');
}
}
if(window.hWin.HEURIST4.util.isnull(mdata) || $.isEmptyObject(mdata)){
alert('Incorrect GeoJSON provided');
return;
}
//FeatureCollection.features[feature]
//feature.geometry.type , coordinates
//GeometryCollection.geometries[{type: ,coordinates: },...]
var ftypes = ['Point','MultiPoint','LineString','MultiLineString','Polygon','MultiPolygon'];
if(mdata.type == 'FeatureCollection'){
var k = 0;
for (k=0; k<mdata.features.length; k++){
_loadGeoJSON(mdata.features[k]); //another collection or feature
}
}else{
function __loadGeoJSON_primitive(geometry){
if($.isEmptyObject(geometry)){
}else if(geometry.type=="GeometryCollection"){
var l;
for (l=0; l<geometry.geometries.length; l++){
_loadGeoJSON_primitive(geometry.geometries[l]); //another collection or feature
}
}else{
function _extractCoords(shapes, coords){
function _isvalid_pnt(pnt){
return ($.isArray(pnt) && pnt.length==2 &&
$.isNumeric(pnt[0]) && $.isNumeric(pnt[1]) &&
Math.abs(pnt[0])<=180.0 && Math.abs(pnt[1])<=90.0);
}
if(_isvalid_pnt(coords)){ //Marker
shapes.push([{lat:coords[1], lng:coords[0]}]);
}else if(_isvalid_pnt(coords[0])){
// !isNaN(Number(coords[0])) && !isNaN(Number(coords[1])) ){ //this is point
var shape = [], m;
for (m=0; m<coords.length; m++){
pnt = coords[m];
if(_isvalid_pnt(pnt)){
shape.push({lat:pnt[1], lng:pnt[0]});
}
}
shapes.push(shape);
}else{
var n;
for (n=0; n<coords.length; n++){
if($.isArray(coords[n]))
_extractCoords(shapes, coords[n]);
}
}
}
var shapes = [];
_extractCoords(shapes, geometry.coordinates);
if(shapes.length>0){
var type = null;
if( geometry.type=="Point" ||
geometry.type=="MultiPoint"){
type = google.maps.drawing.OverlayType.MARKER;
}else if(geometry.type=="LineString" ||
geometry.type=="MultiLineString"){
type = google.maps.drawing.OverlayType.POLYLINE;
}else if(geometry.type=="Polygon"||
geometry.type=="MultiPolygon"){
type = google.maps.drawing.OverlayType.POLYGON;
}
if(type!=null){
var i;
for (i=0; i<shapes.length; i++){
clearSelection();
_loadShape(shapes[i], type);
}
}
}
}
}
if(mdata.type == 'Feature' && !$.isEmptyObject(mdata.geometry)){
__loadGeoJSON_primitive(mdata.geometry)
}else if (mdata.type && ftypes.indexOf(mdata.type)>=0){
__loadGeoJSON_primitive(mdata)
}
}
}
//
// construct geojson object from all overlays
//
function _getGeoJSON(){
var k, points=[], polylines=[], polygones=[];
for (k=0; k<overlays.length; k++){
var shape = overlays[k];
if(shape!=null){
coords = [];
if(shape.type==google.maps.drawing.OverlayType.POLYGON){
processPoints(shape.getPath(), function(latLng){
coords.push([latLng.lng(), latLng.lat()]);
}, shape);
if(coords[coords.length-1][0]!=coords[0][0] && coords[coords.length-1][1]!=coords[0][1]) {
coords.push(coords[0]); //add lst point otherwise WKT fails
}
polygones.push(coords);
}else if (shape.type==google.maps.drawing.OverlayType.POLYLINE) {
processPoints(shape.getPath(), function(latLng){
coords.push([latLng.lng(), latLng.lat()]);
}, shape);
polylines.push(coords);
}else if(shape.type==google.maps.drawing.OverlayType.RECTANGLE){
var bnd = shape.getBounds();
var pnt1 = bnd.getSouthWest(),
pnt2 = bnd.getNorthEast();
coords = [[pnt1.lng(), pnt1.lat()],[pnt1.lng(), pnt2.lat()],
[pnt2.lng(), pnt2.lat()],[pnt2.lng(), pnt1.lat()], [pnt1.lng(), pnt1.lat()]];
polygones.push(coords);
}else if(shape.type==google.maps.drawing.OverlayType.CIRCLE){
var latLng = shape.getCenter()
var radius = shape.getRadius();
var degreeStep = 360 / 40;
for(var i = 0; i < 40; i++){
var gpos = google.maps.geometry.spherical.computeOffset(latLng, radius, degreeStep * i);
coords.push([gpos.lng(), gpos.lat()]);
};
coords.push(coords[0])
/*
for (var i=0; i <= 40; ++i) {
var x = latLng.lng() + radius * Math.cos(i * 2*Math.PI / 40);
var y = latLng.lat() + radius * Math.sin(i * 2*Math.PI / 40);
coords.push([x, y]);
}
*/
polygones.push(coords);
}else if(shape.type==google.maps.drawing.OverlayType.MARKER){
var latLng = shape.getPosition();
coords.push([latLng.lng(), latLng.lat()]);
points.push(coords);
}
}
}//for overlays
var geometries = [];
if(points.length==1){
geometries.push({type: "Point", coordinates: points[0]});
}else if(points.length>1){
geometries.push({type: "MultiPoint", coordinates: points});
}
if(polylines.length==1){
geometries.push({type: "LineString", coordinates: polylines[0]});
}else if(polylines.length>1){
geometries.push({type: "MultiLineString", coordinates: polylines});
}
if(polygones.length==1){
geometries.push({type: "Polygon", coordinates: polygones });
}else if(polygones.length>1){
geometries.push({type: "MultiPolygon", coordinates: polygones});
}
var res = {};
if(geometries.length>0){
//avoid FeatureCollection - stringifyWKT does not support it
/*
res = { type: "FeatureCollection", features: [{ type: "Feature", geometry: {},
"properties": {}
}]};
*/
res = { type: "Feature", geometry: {},
"properties": {}
};
if(geometries.length==1){
//res.features[0].geometry = geometries[0];
res = geometries[0];
}else{
//features[0].
res.geometry = { type: "GeometryCollection", geometries:geometries };
}
}
return res;
}
//
// init UI controls
//
function _initUIcontrols(){
//geocoding ------------------------------------------------------
$('#btn_search_start')
.button({label: window.hWin.HR("Start search"), text:false, icons: {
secondary: "ui-icon-search"
}})
.click(_startGeocodingSearch);
$('#input_search')
.on('keypress',
function(e){
var code = (e.keyCode ? e.keyCode : e.which);
if (code == 13) {
window.hWin.HEURIST4.util.stopEvent(e);
e.preventDefault();
_startGeocodingSearch();
}
});
//clear/delete buttons --------------------------------------------
$('#delete-button').button().click(_deleteSelectedShape);
$('#delete-all-button').button().click(_deleteAllShapes);
//get overlay layers (image,tiled,kml) ------------------------------------
var $sel_overlays = $('#sel_overlays');
$sel_overlays.change(function(){
var rec_ID = $sel_overlays.val();
_addOverlay(rec_ID);
window.hWin.HAPI4.save_pref('map_overlay_sel', rec_ID);
});
//get save bounds (viewpoints) ------------------------------------
var $sel_viepoints = $('#sel_viewpoints');
map_viewpoints = window.hWin.HAPI4.get_prefs('map_viewpoints');
//fill sel_viewpoints with bounds
if($.isEmptyObject(map_viewpoints) || map_viewpoints.length<1){
map_viewpoints = [];
map_viewpoints.push({key:'', title:window.hWin.HR("none defined")});
}else{
//add to begin
map_viewpoints.unshift({key:'', title:window.hWin.HR("select...")});
}
$sel_viepoints.empty();
window.hWin.HEURIST4.ui.createSelector( $sel_viepoints.get(0), map_viewpoints);
$sel_viepoints.click(function(){
var bounds = $(this).val();
if(bounds!=''){
//get LatLngBounds from urlvalue lat_lo,lng_lo,lat_hi,lng_hi
bounds = bounds.split(',');
gmap.fitBounds({south:Number(bounds[0]), west:Number(bounds[1]),
north:Number(bounds[2]), east:Number(bounds[3]) }, -1);
//now we always keep last extent window.hWin.HAPI4.save_pref('map_viewpoints_sel', $(this).find('option:selected').text());
//gmap.fitBounds(new LatLngBounds(new LatLng(Number(bounds[1]), Number(bounds[2]))
// , new LatLng(Number(bounds[3]), Number(bounds[0])) );
}
});
$('#btn_viewpoint_delete')
.button({label: window.hWin.HR("Delete selected extent"), showLabel:false, icon:"ui-icon-close"})
.css({'font-size':'0.9em'})
.click(function(){
var selval = $sel_viepoints.val();
if(selval!=''){
// remove from preferences
$.each(map_viewpoints, function(index, item){
if(item['key']==selval){
map_viewpoints.splice(index,1);
return false;
}
});
window.hWin.HAPI4.save_pref('map_viewpoints', map_viewpoints.slice(1));
// remove from selector
$sel_viepoints.find('option:selected').remove();
if(map_viewpoints.length==1){
$sel_viepoints.empty();
window.hWin.HEURIST4.ui.addoption( $sel_viepoints.get(0),
'', window.hWin.HR('none defined'));
}
}
});
$('#btn_viewpoint_save')
.button({label: window.hWin.HR("Save extent")})
.click(function(){
window.hWin.HEURIST4.msg.showPrompt('Name for extent', function(location_name){
if(!window.hWin.HEURIST4.util.isempty(location_name) && location_name!='none defined'){
//save into preferences
if($.isEmptyObject(map_viewpoints) || map_viewpoints.length<2){
map_viewpoints = [{key:'',title:'select...'}];
}
var not_found = true;
$.each(map_viewpoints, function(idx, item){
if(item.title == location_name){ //we already have such name
map_viewpoints[idx].key = gmap.getBounds().toUrlValue();
not_found = false;
return false;
}
});
if(not_found){
map_viewpoints.push({key:gmap.getBounds().toUrlValue(), title:location_name});
window.hWin.HAPI4.save_pref('map_viewpoints', map_viewpoints.slice(1));
}
//now we always keep last extent window.hWin.HAPI4.save_pref('map_viewpoints_sel', location_name);
// and add to selector
$sel_viepoints.empty();
window.hWin.HEURIST4.ui.createSelector( $sel_viepoints.get(0), map_viewpoints);
//window.hWin.HEURIST4.ui.addoption( $sel_viepoints.get(0), gmap.getBounds().toUrlValue(), location_name);
}
}, {title:'Save map extent',yes:'Save',no:"Cancel"});
});
// apply coordinates
$('#apply-coords-button').button().click(_applyCoordsForSelectedShape);
$('#load-geometry-button').button().click(function(){
var titleYes = window.hWin.HR('Yes'),
titleNo = window.hWin.HR('No'),
buttons = {};
var $dlg;
buttons[titleYes] = function() {
_loadGeoJSON( $dlg.find('#geodata_textarea').val() );
$dlg.dialog( "close" );
};
buttons[titleNo] = function() {
$dlg.dialog( "close" );
};
$dlg = window.hWin.HEURIST4.msg.showElementAsDialog({window:top,
element: document.getElementById( "get-set-coordinates" ),
resizable:false,
width:690, height:400,
title:window.hWin.HR('Paste or upload geo data'),
buttons:buttons
});
});
$('#get-geometry-button').button().click(function(){
$('#geodata_textarea').val(JSON.stringify(_getGeoJSON()));
var $dlg = window.hWin.HEURIST4.msg.showElementAsDialog({window:top,
element: document.getElementById( "get-set-coordinates" ),
resizable: false,
width:690, height:400,
title:window.hWin.HR('Copy the result')
});
});
/*
window.onbeforeunload = function(){
concole.log('ave extent');
_saveExtentOnExit();
}
*/
$('#save-button').button().click(function(){
if(!$('#cbAllowMulti').is(':checked') && overlays.length>1){
var $ddlg, buttons = {};
buttons['Continue'] = function(){
_deleteAllShapes( true );
$ddlg.dialog('close');
$('#save-button').click();
};
buttons['Cancel'] = function(){ $ddlg.dialog('close'); };
$ddlg = window.hWin.HEURIST4.msg.showMsgDlg(
'There are '+overlays.length+' objects on map. Either check "Allow multiple objects" or only one shape will be saved',
buttons, 'Notice');
return;
}
var gjson = _getGeoJSON();
if($.isEmptyObject(gjson)){
window.hWin.HEURIST4.msg.showMsgDlg('You have to draw a shape');
}else{
var res = stringifyWKT(gjson);
_saveExtentOnExit();
//type code is not required for new code. this is for backward capability
var typeCode = 'm';
if(res.indexOf('GEOMETRYCOLLECTION')<0 && res.indexOf('MULTI')<0){
if(res.indexOf('LINESTRING')>=0){
typeCode = 'l';
}else if(res.indexOf('POLYGON')>=0){
typeCode = 'pl';
}else {
typeCode = 'p';
}
}
window.close({type:typeCode, wkt:res});
}
/*OLD WAY
if(selectedShape==null){
window.hWin.HEURIST4.msg.showMsgDlg('You have to select a shape');
}else{
var res = _getWKT(selectedShape);
_saveExtentOnExit();
window.close(res);
}
*/
});
$('#cancel-button').button().click(function(){
_saveExtentOnExit();
window.close();
});
}
//
//
//
function _loadSavedExtentOnInit(){
var bounds = window.hWin.HAPI4.get_prefs('map_viewpoint_last');
if(!window.hWin.HEURIST4.util.isempty(bounds)){
bounds = bounds.split(',');
gmap.fitBounds({south:Number(bounds[0]), west:Number(bounds[1]),
north:Number(bounds[2]), east:Number(bounds[3]) }, -1);
}
}
//
//
//
function _saveExtentOnExit(){
window.hWin.HAPI4.save_pref('map_viewpoint_last', gmap.getBounds().toUrlValue());
}
function _onMapInited(){
var polyOptions = {
strokeWeight: 0,
fillOpacity: 0.45,
editable: true
};
// Creates a drawing manager attached to the map that allows the user to draw
// markers, lines, and shapes.
drawingManager = new google.maps.drawing.DrawingManager({
drawingMode: google.maps.drawing.OverlayType.MARKER, //google.maps.drawing.OverlayType.POLYGON,
drawingControlOptions: {
position: google.maps.ControlPosition.TOP_RIGHT //TOP_CENTER
//drawingModes: ['marker', 'circle', 'polygon', 'polyline', 'rectangle']
},
markerOptions: {
draggable: true
},
polylineOptions: {
editable: true
},
rectangleOptions: polyOptions,
circleOptions: polyOptions,
polygonOptions: polyOptions,
map: gmap
});
deleteMenu = new DeleteMenu();
google.maps.event.addListener(drawingManager, 'polygoncomplete',_onPathComplete);
google.maps.event.addListener(drawingManager, 'polylinecomplete',_onPathComplete);
google.maps.event.addListener(drawingManager, 'circlecomplete', _onCircleComplete);
google.maps.event.addListener(drawingManager, 'rectanglecomplete', _onRectangleComplete);
google.maps.event.addListener(drawingManager, 'overlaycomplete', function(e) {
var newShape = e.overlay;
newShape.type = e.type;
if (e.type != google.maps.drawing.OverlayType.MARKER) {
// Switch back to non-drawing mode after drawing a shape.
_onNonMarkerAdded(newShape);
}else{
_onMarkerAdded(newShape);
setSelection(newShape);
}
//google.maps.drawing.OverlayType.MARKER
});
// Clear the current selection when the drawing mode is changed, or when the
// map is clicked.
google.maps.event.addListener(drawingManager, 'drawingmode_changed', function(){
clearSelection();
showCoordsHint();
});
google.maps.event.addListener(gmap, 'click', clearSelection);
google.maps.event.addListener(gmap, 'mousemove', function (event) {
var pnt = event.latLng;
$('#coords2').html(formatPnt(pnt,5));
});
buildColorPalette();
if(!window.hWin.HEURIST4.util.isempty(initial_wkt)){
setTimeout(function(){
_loadWKT(initial_wkt);
}, 1000);
}else{
_loadSavedExtentOnInit(); //load last extent of previous session
}
if(!$.isEmptyObject(map_viewpoints)){
/* now we always keep last extent
var map_viewpoints_sel = window.hWin.HAPI4.get_prefs('map_viewpoints_sel');
var $sel_viepoints = $('#sel_viewpoints');
var not_found = true;
if(map_viewpoints_sel){
$.each(map_viewpoints, function(idx, item){
if(item.title == map_viewpoints_sel){
$sel_viepoints.val(item.key);
not_found = false;
return false;
}
});
}
if(not_found){
$sel_viepoints.find('option:last-child').attr('selected', 'selected');
}
$sel_viepoints.change();
*/
}
//load overlays from server
var rts2 = [window.hWin.HAPI4.sysinfo['dbconst']['RT_TILED_IMAGE_SOURCE'],
//window.hWin.HAPI4.sysinfo['dbconst']['RT_GEOTIFF_SOURCE'],
window.hWin.HAPI4.sysinfo['dbconst']['RT_KML_SOURCE']];
var rts = [];
for(var k=0; k<rts2.length-1; k++)
if(rts2[k]>0){
rts.push(rts2[k]);
}
if(rts.length>0){
var request = { q: {"t":rts.join(',')},
w: 'a',
detail: 'header',
source: 'sel_overlays'};
//perform search
window.hWin.HAPI4.RecordMgr.search(request, function(response){
if(response.status == window.hWin.ResponseStatus.OK){
var resdata = new hRecordSet(response.data);
map_overlays = [];
if(resdata.length()>0){
map_overlays.push({key:0, title:'select...'});
}
var idx, records = resdata.getRecords();
for(idx in records){
if(idx)
{
var record = records[idx];
var recID = resdata.fld(record, 'rec_ID'),
recName = resdata.fld(record, 'rec_Title');
map_overlays.push({key:recID, title:recName});
}
}//for
var $sel_overlays = $('#sel_overlays');
window.hWin.HEURIST4.ui.createSelector( $sel_overlays.get(0),
$.isEmptyObject(map_overlays)?window.hWin.HR('none defined'): map_overlays);
var map_overlay_sel = window.hWin.HAPI4.get_prefs('map_overlay_sel');
if(map_overlay_sel>0) {
$sel_overlays.val(map_overlay_sel);
$sel_overlays.change();
}
}else{
window.hWin.HEURIST4.msg.showMsgErr(response);
}
});
}
}
//
// extract coordinates from WKT
//
function _loadWKT(wkt) {
if (! wkt) {
wkt = decodeURIComponent(document.location.search);
}
/*var matches = wkt.match(/\??(\S+)\s+(.*)/);
if (! matches) {
return;
}
var type = matches[1];
var value = matches[2];*/
var resdata = window.hWin.HEURIST4.geo.wktValueToShapes( wkt, null, 'google' );
type = google.maps.drawing.OverlayType.MARKER;
var i;
for (i=0; i<resdata.Point.length; i++){
shape = resdata.Point[i];
selectedShape = null;//to avoid clear
_loadShape(shape, type);
}
type = google.maps.drawing.OverlayType.POLYLINE;
for (i=0; i<resdata.Polyline.length; i++){
shape = resdata.Polyline[i];
selectedShape = null; //to avoid clear
_loadShape(shape, type);
}
type = google.maps.drawing.OverlayType.POLYGON;
for (i=0; i<resdata.Polygon.length; i++){
shape = resdata.Polygon[i];
selectedShape = null; //to avoid clear
_loadShape(shape, type);
}
//zoom to full extent
var sw = new google.maps.LatLng(resdata._extent.ymin, resdata._extent.xmin);
var ne = new google.maps.LatLng(resdata._extent.ymax, resdata._extent.xmax);
var bounds = new google.maps.LatLngBounds(sw, ne);
if( Math.abs(ne.lat()-sw.lat())<0.06 && Math.abs(ne.lng()-sw.lng())<0.06 ){
gmap.setCenter(bounds.getCenter());
gmap.setZoom(14);
}else{
gmap.fitBounds(bounds);
}
/*
var gjson = parseWKT(value); //wkt to json
_loadGeoJSON( gjson ); ///!!!!!
//zoom to last loaded shape
if(selectedShape!=null){
_zoomToSelection();
}
*/
}
function _loadWKT_old(val) {
if (! val) {
val = decodeURIComponent(document.location.search);
}
var matches = val.match(/\??(\S+)\s+(.*)/);
if (! matches) {
return;
}
var type = matches[1];
var value = matches[2];
var mode = null;
var sCoords = '';
switch (type) {
case "p":
mode = google.maps.drawing.OverlayType.MARKER
matches = value.match(/POINT\s?\((\S+)\s+(\S+)\)/i);
sCoords = matches[2]+' '+matches[1];
break;
case "r": //rectangle
mode = google.maps.drawing.OverlayType.RECTANGLE
matches = value.match(/POLYGON\s?\(\((\S+)\s+(\S+),\s*(\S+)\s+(\S+),\s*(\S+)\s+(\S+),\s*(\S+)\s+(\S+),\s*\S+\s+\S+\)\)/i);
if(matches.length<6){
matches.push(matches[3]);
matches.push(matches[4]);
}
sCoords = sCoords + parseFloat(matches[2])+' '+parseFloat(matches[1])+' '+parseFloat(matches[6])+' '+parseFloat(matches[5]);
break;
case "c": //circle
mode = google.maps.drawing.OverlayType.CIRCLE
matches = value.match(/LINESTRING\s?\((\S+)\s+(\S+),\s*(\S+)\s+\S+,\s*\S+\s+\S+,\s*\S+\s+\S+\)/i);
var radius = _getDistance({lat:parseFloat(matches[2]), lng:parseFloat(matches[1])},
{lat:parseFloat(matches[2]), lng:parseFloat(matches[3])}) ;
sCoords = parseFloat(matches[2])+' '+parseFloat(matches[1])+'\nr='+radius.toFixed(2);
break;
case "l": ///polyline
mode = google.maps.drawing.OverlayType.POLYLINE
matches = value.match(/LINESTRING\s?\((.+)\)/i);
if (matches){
matches = matches[1].match(/\S+\s+\S+(?:,|$)/g);
for (var j=0; j < matches.length; ++j) {
var match_matches = matches[j].match(/(\S+)\s+(\S+)(?:,|$)/);
sCoords = sCoords + parseFloat(match_matches[2]) + ' ' + parseFloat(match_matches[1]) + '\n';
}
}
break;
case "pl": //polygon
mode = google.maps.drawing.OverlayType.POLYGON
matches = value.match(/POLYGON\s?\(\((.+)\)\)/i);
if (matches) {
matches = matches[1].match(/\S+\s+\S+(?:,|$)/g);
for (var j=0; j < matches.length; ++j) {
var match_matches = matches[j].match(/(\S+)\s+(\S+)(?:,|$)/);
sCoords = sCoords + parseFloat(match_matches[2]) + ' ' + parseFloat(match_matches[1]) + '\n';
}
}
break;
default:
return;
}
//_removeOverlay();
drawingManager.setDrawingMode(mode);
$("#coords1").val(sCoords);
_applyCoordsForSelectedShape();
}
//
//
//
function _addOverlay(rec_ID){
_removeOverlay(); //remove previous
if(!(rec_ID>0)) return;
var that = this;
/*
var request = {'a': 'search',
'entity': 'Records',
'details': 'full',
'rec_ID': rec_ID,
'request_id': window.hWin.HEURIST4.util.random()
}
window.hWin.HAPI4.EntityMgr.doRequest(request,
*/
var request = { q: {"ids":rec_ID},
w: 'a',
detail: 'detail',
source: 'sel_overlays'};
//perform search
window.hWin.HAPI4.RecordMgr.search(request, function(response){
if(response.status == window.hWin.ResponseStatus.OK){
var recordset = new hRecordSet(response.data);
var record = recordset.getFirstRecord();
_current_overlay = new hMapLayer({gmap:gmap, recordset:recordset});
}else{
window.hWin.HEURIST4.msg.showMsgErr(response);
}
});
}
//
//
//
function _removeOverlay(){
if(_current_overlay){
try {
if(_current_overlay['removeLayer']){ // hasOwnProperty
_current_overlay.removeLayer();
}
_current_overlay = null;
} catch(err) {
console.log(err);
}
}
}
//public members
var that = {
getClass: function () {return _className;},
isA: function (strClass) {return (strClass === _className);},
getVersion: function () {return _version;},
loadWKT: function(wkt){
_deleteAllShapes();
_loadWKT(wkt);
},
clearAll:function(){
_deleteAllShapes();
}
}
_init(_mapdiv_id, _initial_wkt);
return that; //returns object
}
//-------------------------------------------------------------------------
/**
* A menu that lets a user delete a selected vertex of a path.
* @constructor
*/
function DeleteMenu() {
this.div_ = document.createElement('div');
this.div_.className = 'delete-menu';
this.div_.innerHTML = 'Delete';
var menu = this;
google.maps.event.addDomListener(this.div_, 'click', function() {
menu.removeVertex();
});
}
//
//
//
function _init_DeleteMenu(){
DeleteMenu.prototype = new google.maps.OverlayView();
DeleteMenu.prototype.onAdd = function() {
var deleteMenu = this;
var map = this.getMap();
this.getPanes().floatPane.appendChild(this.div_);
// mousedown anywhere on the map except on the menu div will close the
// menu.
this.divListener_ = google.maps.event.addDomListener(map.getDiv(), 'mousedown', function(e) {
if (e.target != deleteMenu.div_) {
deleteMenu.close();
}
}, true);
};
DeleteMenu.prototype.onRemove = function() {
google.maps.event.removeListener(this.divListener_);
this.div_.parentNode.removeChild(this.div_);
// clean up
this.set('position');
this.set('path');
this.set('vertex');
};
DeleteMenu.prototype.close = function() {
this.setMap(null);
};
DeleteMenu.prototype.draw = function() {
var position = this.get('position');
var projection = this.getProjection();
if (!position || !projection) {
return;
}
var point = projection.fromLatLngToDivPixel(position);
this.div_.style.top = point.y + 'px';
this.div_.style.left = point.x + 'px';
};
/**
* Opens the menu at a vertex of a given path.
*/
DeleteMenu.prototype.open = function(map, path, vertex) {
if(path.type==google.maps.drawing.OverlayType.MARKER){
this.set('position', vertex);
}else{
this.set('position', path.getAt(vertex));
}
this.set('path', path);
this.set('vertex', vertex);
this.setMap(map);
this.draw();
};
/**
* Deletes the vertex from the path.
*/
DeleteMenu.prototype.removeVertex = function() {
var path = this.get('path');
var vertex = this.get('vertex');
if (!path || vertex == undefined) {
this.close();
return;
}
if(path.type==google.maps.drawing.OverlayType.MARKER){
path.setMap(null);
}else{
path.removeAt(vertex);
}
this.close();
};
} | HeuristNetwork/heurist | viewers/gmap/mapDraw2.js | JavaScript | gpl-3.0 | 63,290 |
# -*- coding: utf-8 -*-
# Copyright 2013 Fanficdownloader team, 2015 FanFicFare team
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
import time
import logging
logger = logging.getLogger(__name__)
import re
import urllib2
import urlparse
from bs4.element import Comment
from ..htmlcleanup import stripHTML
from .. import exceptions as exceptions
from base_adapter import BaseSiteAdapter, makeDate
class LiteroticaSiteAdapter(BaseSiteAdapter):
def __init__(self, config, url):
BaseSiteAdapter.__init__(self, config, url)
logger.debug("LiteroticaComAdapter:__init__ - url='%s'" % url)
self.decode = ["utf8",
"Windows-1252"] # 1252 is a superset of iso-8859-1.
# Most sites that claim to be
# iso-8859-1 (and some that claim to be
# utf8) are really windows-1252.
# Each adapter needs to have a unique site abbreviation.
self.story.setMetadata('siteabbrev','litero')
# normalize to first chapter. Not sure if they ever have more than 2 digits.
storyId = self.parsedUrl.path.split('/',)[2]
# replace later chapters with first chapter but don't remove numbers
# from the URL that disambiguate stories with the same title.
storyId = re.sub("-ch-?\d\d", "", storyId)
self.story.setMetadata('storyId', storyId)
## accept m(mobile)url, but use www.
url = re.sub("^(www|german|spanish|french|dutch|italian|romanian|portuguese|other)\.i",
"\1",
url)
## strip ?page=...
url = re.sub("\?page=.*$", "", url)
## set url
self._setURL(url)
# The date format will vary from site to site.
# http://docs.python.org/library/datetime.html#strftime-strptime-behavior
self.dateformat = "%m/%d/%y"
@staticmethod
def getSiteDomain():
return 'literotica.com'
@classmethod
def getAcceptDomains(cls):
return ['www.literotica.com',
'www.i.literotica.com',
'german.literotica.com',
'german.i.literotica.com',
'spanish.literotica.com',
'spanish.i.literotica.com',
'french.literotica.com',
'french.i.literotica.com',
'dutch.literotica.com',
'dutch.i.literotica.com',
'italian.literotica.com',
'italian.i.literotica.com',
'romanian.literotica.com',
'romanian.i.literotica.com',
'portuguese.literotica.com',
'portuguese.i.literotica.com',
'other.literotica.com',
'other.i.literotica.com']
@classmethod
def getSiteExampleURLs(cls):
return "http://www.literotica.com/s/story-title https://www.literotica.com/s/story-title http://portuguese.literotica.com/s/story-title http://german.literotica.com/s/story-title"
def getSiteURLPattern(self):
return r"https?://(www|german|spanish|french|dutch|italian|romanian|portuguese|other)(\.i)?\.literotica\.com/s/([a-zA-Z0-9_-]+)"
def getCategories(self, soup):
if self.getConfig("use_meta_keywords"):
categories = soup.find("meta", {"name":"keywords"})['content'].split(', ')
categories = [c for c in categories if not self.story.getMetadata('title') in c]
if self.story.getMetadata('author') in categories:
categories.remove(self.story.getMetadata('author'))
logger.debug("Meta = %s" % categories)
for category in categories:
# logger.debug("\tCategory=%s" % category)
# self.story.addToList('category', category.title())
self.story.addToList('eroticatags', category.title())
def extractChapterUrlsAndMetadata(self):
"""
NOTE: Some stories can have versions,
e.g. /my-story-ch-05-version-10
NOTE: If two stories share the same title, a running index is added,
e.g.: /my-story-ch-02-1
Strategy:
* Go to author's page, search for the current story link,
* If it's in a tr.root-story => One-part story
* , get metadata and be done
* If it's in a tr.sl => Chapter in series
* Search up from there until we find a tr.ser-ttl (this is the
story)
* Gather metadata
* Search down from there for all tr.sl until the next
tr.ser-ttl, foreach
* Chapter link is there
"""
if not (self.is_adult or self.getConfig("is_adult")):
raise exceptions.AdultCheckRequired(self.url)
logger.debug("Chapter/Story URL: <%s> " % self.url)
try:
data1 = self._fetchUrl(self.url)
soup1 = self.make_soup(data1)
#strip comments from soup
[comment.extract() for comment in soup1.findAll(text=lambda text:isinstance(text, Comment))]
except urllib2.HTTPError, e:
if e.code == 404:
raise exceptions.StoryDoesNotExist(self.url)
else:
raise e
if "This submission is awaiting moderator's approval" in data1:
raise exceptions.StoryDoesNotExist("This submission is awaiting moderator's approval. %s"%self.url)
# author
a = soup1.find("span", "b-story-user-y")
self.story.setMetadata('authorId', urlparse.parse_qs(a.a['href'].split('?')[1])['uid'][0])
authorurl = a.a['href']
if authorurl.startswith('//'):
authorurl = self.parsedUrl.scheme+':'+authorurl
self.story.setMetadata('authorUrl', authorurl)
self.story.setMetadata('author', a.text)
# get the author page
try:
dataAuth = self._fetchUrl(authorurl)
soupAuth = self.make_soup(dataAuth)
#strip comments from soup
[comment.extract() for comment in soupAuth.findAll(text=lambda text:isinstance(text, Comment))]
# logger.debug(soupAuth)
except urllib2.HTTPError, e:
if e.code == 404:
raise exceptions.StoryDoesNotExist(authorurl)
else:
raise e
## Find link to url in author's page
## site has started using //domain.name/asdf urls remove https?: from front
## site has started putting https back on again.
storyLink = soupAuth.find('a', href=re.compile(r'(https?:)?'+re.escape(self.url[self.url.index(':')+1:])))
# storyLink = soupAuth.find('a', href=self.url)#[self.url.index(':')+1:])
if storyLink is not None:
# pull the published date from the author page
# default values from single link. Updated below if multiple chapter.
logger.debug("Found story on the author page.")
date = storyLink.parent.parent.findAll('td')[-1].text
self.story.setMetadata('datePublished', makeDate(date, self.dateformat))
self.story.setMetadata('dateUpdated',makeDate(date, self.dateformat))
if storyLink is not None:
urlTr = storyLink.parent.parent
if "sl" in urlTr['class']:
isSingleStory = False
else:
isSingleStory = True
else:
raise exceptions.FailedToDownload("Couldn't find story <%s> on author's page <%s>" % (self.url, authorurl))
if isSingleStory:
# self.chapterUrls = [(soup1.h1.string, self.url)]
# self.story.setMetadata('title', soup1.h1.string)
self.story.setMetadata('title', storyLink.text.strip('/'))
logger.debug('Title: "%s"' % storyLink.text.strip('/'))
self.story.setMetadata('description', urlTr.findAll("td")[1].text)
self.story.addToList('category', urlTr.findAll("td")[2].text)
# self.story.addToList('eroticatags', urlTr.findAll("td")[2].text)
date = urlTr.findAll('td')[-1].text
self.story.setMetadata('datePublished', makeDate(date, self.dateformat))
self.story.setMetadata('dateUpdated',makeDate(date, self.dateformat))
self.chapterUrls = [(storyLink.text, self.url)]
averrating = stripHTML(storyLink.parent)
## title (0.00)
averrating = averrating[averrating.rfind('(')+1:averrating.rfind(')')]
try:
self.story.setMetadata('averrating', float(averrating))
except:
pass
# self.story.setMetadata('averrating',averrating)
# parse out the list of chapters
else:
seriesTr = urlTr.previousSibling
while 'ser-ttl' not in seriesTr['class']:
seriesTr = seriesTr.previousSibling
m = re.match("^(?P<title>.*?):\s(?P<numChapters>\d+)\sPart\sSeries$", seriesTr.find("strong").text)
self.story.setMetadata('title', m.group('title'))
seriesTitle = m.group('title')
## Walk the chapters
chapterTr = seriesTr.nextSibling
self.chapterUrls = []
dates = []
descriptions = []
ratings = []
chapters = []
while chapterTr is not None and 'sl' in chapterTr['class']:
description = "%d. %s" % (len(descriptions)+1,stripHTML(chapterTr.findAll("td")[1]))
description = stripHTML(chapterTr.findAll("td")[1])
chapterLink = chapterTr.find("td", "fc").find("a")
self.story.addToList('eroticatags', chapterTr.findAll("td")[2].text)
pub_date = makeDate(chapterTr.findAll('td')[-1].text, self.dateformat)
dates.append(pub_date)
chapterTr = chapterTr.nextSibling
chapter_title = chapterLink.text
if self.getConfig("clean_chapter_titles"):
logger.debug('\tChapter Name: "%s"' % chapterLink.string)
logger.debug('\tChapter Name: "%s"' % chapterLink.text)
if chapterLink.text.lower().startswith(seriesTitle.lower()):
chapter = chapterLink.text[len(seriesTitle):].strip()
logger.debug('\tChapter: "%s"' % chapter)
if chapter == '':
chapter_title = 'Chapter %d' % (len(self.chapterUrls) + 1)
else:
separater_char = chapter[0]
logger.debug('\tseparater_char: "%s"' % separater_char)
chapter = chapter[1:].strip() if separater_char in [":", "-"] else chapter
logger.debug('\tChapter: "%s"' % chapter)
if chapter.lower().startswith('ch.'):
chapter = chapter[len('ch.'):]
try:
chapter_title = 'Chapter %d' % int(chapter)
except:
chapter_title = 'Chapter %s' % chapter
elif chapter.lower().startswith('pt.'):
chapter = chapter[len('pt.'):]
try:
chapter_title = 'Part %d' % int(chapter)
except:
chapter_title = 'Part %s' % chapter
elif separater_char in [":", "-"]:
chapter_title = chapter
# if chapter_title == '':
# chapter_title = chapterLink.string
# pages include full URLs.
chapurl = chapterLink['href']
if chapurl.startswith('//'):
chapurl = self.parsedUrl.scheme + ':' + chapurl
logger.debug("Chapter URL: " + chapurl)
logger.debug("Chapter Title: " + chapter_title)
logger.debug("Chapter description: " + description)
chapters.append((chapter_title, chapurl, description, pub_date))
# self.chapterUrls.append((chapter_title, chapurl))
numrating = stripHTML(chapterLink.parent)
## title (0.00)
numrating = numrating[numrating.rfind('(')+1:numrating.rfind(')')]
try:
ratings.append(float(numrating))
except:
pass
chapters = sorted(chapters, key=lambda chapter: chapter[3])
for i, chapter in enumerate(chapters):
self.chapterUrls.append((chapter[0], chapter[1]))
descriptions.append("%d. %s" % (i + 1, chapter[2]))
## Set the oldest date as publication date, the newest as update date
dates.sort()
self.story.setMetadata('datePublished', dates[0])
self.story.setMetadata('dateUpdated', dates[-1])
self.story.setMetadata('datePublished', chapters[0][3])
self.story.setMetadata('dateUpdated', chapters[-1][3])
## Set description to joint chapter descriptions
self.setDescription(authorurl,"<p>"+"</p>\n<p>".join(descriptions)+"</p>")
if len(ratings) > 0:
self.story.setMetadata('averrating','%4.2f' % (sum(ratings) / float(len(ratings))))
# normalize on first chapter URL.
self._setURL(self.chapterUrls[0][1])
# reset storyId to first chapter.
self.story.setMetadata('storyId',self.parsedUrl.path.split('/',)[2])
self.story.setMetadata('numChapters', len(self.chapterUrls))
self.story.setMetadata('category', soup1.find('div', 'b-breadcrumbs').findAll('a')[1].string)
self.getCategories(soup1)
# self.story.setMetadata('description', soup1.find('meta', {'name': 'description'})['content'])
return
def getPageText(self, raw_page, url):
logger.debug('Getting page text')
# logger.debug(soup)
raw_page = raw_page.replace('<div class="b-story-body-x x-r15"><div><p>','<div class="b-story-body-x x-r15"><div>')
# logger.debug("\tChapter text: %s" % raw_page)
page_soup = self.make_soup(raw_page)
[comment.extract() for comment in page_soup.findAll(text=lambda text:isinstance(text, Comment))]
story2 = page_soup.find('div', 'b-story-body-x').div
# logger.debug("getPageText- name div div...")
# logger.debug(soup)
# story2.append(page_soup.new_tag('br'))
div = self.utf8FromSoup(url, story2)
# logger.debug(div)
fullhtml = unicode(div)
# logger.debug(fullhtml)
fullhtml = re.sub(r'<br />\s*<br />', r'</p><p>', fullhtml)
fullhtml = re.sub(r'^<div>', r'', fullhtml)
fullhtml = re.sub(r'</div>$', r'', fullhtml)
fullhtml = re.sub(r'(<p><br/></p>\s+)+$', r'', fullhtml)
# logger.debug(fullhtml)
return fullhtml
def getChapterText(self, url):
logger.debug('Getting chapter text from: %s' % url)
raw_page = self._fetchUrl(url)
page_soup = self.make_soup(raw_page)
pages = page_soup.find('select', {'name' : 'page'})
page_nums = [page.text for page in pages.findAll('option')] if pages else 0
fullhtml = ""
self.getCategories(page_soup)
if self.getConfig("description_in_chapter"):
chapter_description = page_soup.find("meta", {"name" : "description"})['content']
logger.debug("\tChapter description: %s" % chapter_description)
fullhtml += '<p><b>Description:</b> %s</p><hr />' % chapter_description
fullhtml += self.getPageText(raw_page, url)
if pages:
for page_no in xrange(2, len(page_nums) + 1):
page_url = url + "?page=%s" % page_no
logger.debug("page_url= %s" % page_url)
raw_page = self._fetchUrl(page_url)
fullhtml += self.getPageText(raw_page, url)
# fullhtml = self.utf8FromSoup(url, bs.BeautifulSoup(fullhtml))
# fullhtml = re.sub(r'^<div>', r'', fullhtml)
# fullhtml = re.sub(r'</div>$', r'', fullhtml)
# if None == div:
# raise exceptions.FailedToDownload("Error downloading Chapter: %s! Missing required element!" % url)
return fullhtml
def getClass():
return LiteroticaSiteAdapter
| PlushBeaver/FanFicFare | fanficfare/adapters/adapter_literotica.py | Python | gpl-3.0 | 17,171 |
// Generated by gencpp from file capra_msgs/AddGoal.msg
// DO NOT EDIT!
#ifndef CAPRA_MSGS_MESSAGE_ADDGOAL_H
#define CAPRA_MSGS_MESSAGE_ADDGOAL_H
#include <ros/service_traits.h>
#include <capra_msgs/AddGoalRequest.h>
#include <capra_msgs/AddGoalResponse.h>
namespace capra_msgs
{
struct AddGoal
{
typedef AddGoalRequest Request;
typedef AddGoalResponse Response;
Request request;
Response response;
typedef Request RequestType;
typedef Response ResponseType;
}; // struct AddGoal
} // namespace capra_msgs
namespace ros
{
namespace service_traits
{
template<>
struct MD5Sum< ::capra_msgs::AddGoal > {
static const char* value()
{
return "ff8d7d66dd3e4b731ef14a45d38888b6";
}
static const char* value(const ::capra_msgs::AddGoal&) { return value(); }
};
template<>
struct DataType< ::capra_msgs::AddGoal > {
static const char* value()
{
return "capra_msgs/AddGoal";
}
static const char* value(const ::capra_msgs::AddGoal&) { return value(); }
};
// service_traits::MD5Sum< ::capra_msgs::AddGoalRequest> should match
// service_traits::MD5Sum< ::capra_msgs::AddGoal >
template<>
struct MD5Sum< ::capra_msgs::AddGoalRequest>
{
static const char* value()
{
return MD5Sum< ::capra_msgs::AddGoal >::value();
}
static const char* value(const ::capra_msgs::AddGoalRequest&)
{
return value();
}
};
// service_traits::DataType< ::capra_msgs::AddGoalRequest> should match
// service_traits::DataType< ::capra_msgs::AddGoal >
template<>
struct DataType< ::capra_msgs::AddGoalRequest>
{
static const char* value()
{
return DataType< ::capra_msgs::AddGoal >::value();
}
static const char* value(const ::capra_msgs::AddGoalRequest&)
{
return value();
}
};
// service_traits::MD5Sum< ::capra_msgs::AddGoalResponse> should match
// service_traits::MD5Sum< ::capra_msgs::AddGoal >
template<>
struct MD5Sum< ::capra_msgs::AddGoalResponse>
{
static const char* value()
{
return MD5Sum< ::capra_msgs::AddGoal >::value();
}
static const char* value(const ::capra_msgs::AddGoalResponse&)
{
return value();
}
};
// service_traits::DataType< ::capra_msgs::AddGoalResponse> should match
// service_traits::DataType< ::capra_msgs::AddGoal >
template<>
struct DataType< ::capra_msgs::AddGoalResponse>
{
static const char* value()
{
return DataType< ::capra_msgs::AddGoal >::value();
}
static const char* value(const ::capra_msgs::AddGoalResponse&)
{
return value();
}
};
} // namespace service_traits
} // namespace ros
#endif // CAPRA_MSGS_MESSAGE_ADDGOAL_H
| clubcapra/Ibex | install/include/capra_msgs/AddGoal.h | C | gpl-3.0 | 2,568 |
/*
* Copyright (C) 2012 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.systemui.statusbar.phone;
import android.app.StatusBarManager;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.PorterDuff;
import android.graphics.PorterDuffXfermode;
import android.graphics.Rect;
import android.media.session.MediaSessionLegacyHelper;
import android.os.IBinder;
import android.util.AttributeSet;
import android.view.KeyEvent;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewRootImpl;
import android.view.WindowManager;
import android.view.WindowManagerGlobal;
import android.widget.FrameLayout;
import com.android.systemui.R;
import com.android.systemui.statusbar.BaseStatusBar;
import com.android.systemui.statusbar.DragDownHelper;
import com.android.systemui.statusbar.StatusBarState;
import com.android.systemui.statusbar.stack.NotificationStackScrollLayout;
public class StatusBarWindowView extends FrameLayout {
public static final String TAG = "StatusBarWindowView";
public static final boolean DEBUG = BaseStatusBar.DEBUG;
private DragDownHelper mDragDownHelper;
private NotificationStackScrollLayout mStackScrollLayout;
private NotificationPanelView mNotificationPanel;
private View mBrightnessMirror;
PhoneStatusBar mService;
private final Paint mTransparentSrcPaint = new Paint();
public StatusBarWindowView(Context context, AttributeSet attrs) {
super(context, attrs);
setMotionEventSplittingEnabled(false);
mTransparentSrcPaint.setColor(0);
mTransparentSrcPaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC));
}
@Override
protected boolean fitSystemWindows(Rect insets) {
if (getFitsSystemWindows()) {
boolean changed = insets.left != getPaddingLeft()
|| insets.top != getPaddingTop()
|| insets.right != getPaddingRight()
|| insets.bottom != getPaddingBottom();
if (changed) {
setPadding(insets.left, insets.top, insets.right, 0);
}
insets.left = 0;
insets.top = 0;
insets.right = 0;
} else {
boolean changed = getPaddingLeft() != 0
|| getPaddingRight() != 0
|| getPaddingTop() != 0
|| getPaddingBottom() != 0;
if (changed) {
setPadding(0, 0, 0, 0);
}
}
return false;
}
@Override
protected void onAttachedToWindow () {
super.onAttachedToWindow();
mStackScrollLayout = (NotificationStackScrollLayout) findViewById(
R.id.notification_stack_scroller);
mNotificationPanel = (NotificationPanelView) findViewById(R.id.notification_panel);
mDragDownHelper = new DragDownHelper(getContext(), this, mStackScrollLayout, mService);
mBrightnessMirror = findViewById(R.id.brightness_mirror);
// We really need to be able to animate while window animations are going on
// so that activities may be started asynchronously from panel animations
final ViewRootImpl root = getViewRootImpl();
if (root != null) {
root.setDrawDuringWindowsAnimating(true);
}
// We need to ensure that our window doesn't suffer from overdraw which would normally
// occur if our window is translucent. Since we are drawing the whole window anyway with
// the scrim, we don't need the window to be cleared in the beginning.
if (mService.isScrimSrcModeEnabled()) {
IBinder windowToken = getWindowToken();
WindowManager.LayoutParams lp = (WindowManager.LayoutParams) getLayoutParams();
lp.token = windowToken;
setLayoutParams(lp);
WindowManagerGlobal.getInstance().changeCanvasOpacity(windowToken, true);
setWillNotDraw(false);
} else {
setWillNotDraw(!DEBUG);
}
}
@Override
public boolean dispatchKeyEvent(KeyEvent event) {
boolean down = event.getAction() == KeyEvent.ACTION_DOWN;
switch (event.getKeyCode()) {
case KeyEvent.KEYCODE_BACK:
if (!down) {
mService.onBackPressed();
}
return true;
case KeyEvent.KEYCODE_MENU:
if (!down) {
return mService.onMenuPressed();
}
case KeyEvent.KEYCODE_SPACE:
if (!down) {
return mService.onSpacePressed();
}
break;
case KeyEvent.KEYCODE_VOLUME_DOWN:
case KeyEvent.KEYCODE_VOLUME_UP:
if (mService.isDozing()) {
MediaSessionLegacyHelper.getHelper(mContext).sendVolumeKeyEvent(event, true);
return true;
}
break;
}
if (mService.interceptMediaKey(event)) {
return true;
}
return super.dispatchKeyEvent(event);
}
@Override
public boolean dispatchTouchEvent(MotionEvent ev) {
if (mBrightnessMirror != null && mBrightnessMirror.getVisibility() == VISIBLE) {
// Disallow new pointers while the brightness mirror is visible. This is so that you
// can't touch anything other than the brightness slider while the mirror is showing
// and the rest of the panel is transparent.
if (ev.getActionMasked() == MotionEvent.ACTION_POINTER_DOWN) {
return false;
}
}
return super.dispatchTouchEvent(ev);
}
@Override
public boolean onInterceptTouchEvent(MotionEvent ev) {
boolean intercept = false;
if (mNotificationPanel.isFullyExpanded()
&& mStackScrollLayout.getVisibility() == View.VISIBLE
&& mService.getBarState() == StatusBarState.KEYGUARD
&& !mService.isQsExpanded()
&& !mService.isBouncerShowing()) {
intercept = mDragDownHelper.onInterceptTouchEvent(ev);
// wake up on a touch down event, if dozing
if (ev.getActionMasked() == MotionEvent.ACTION_DOWN) {
mService.wakeUpIfDozing(ev.getEventTime(), ev);
}
}
if (!intercept) {
super.onInterceptTouchEvent(ev);
}
if (intercept) {
MotionEvent cancellation = MotionEvent.obtain(ev);
cancellation.setAction(MotionEvent.ACTION_CANCEL);
mStackScrollLayout.onInterceptTouchEvent(cancellation);
mNotificationPanel.onInterceptTouchEvent(cancellation);
cancellation.recycle();
}
return intercept;
}
@Override
public boolean onTouchEvent(MotionEvent ev) {
boolean handled = false;
if (mService.getBarState() == StatusBarState.KEYGUARD && !mService.isQsExpanded()) {
handled = mDragDownHelper.onTouchEvent(ev);
}
if (!handled) {
handled = super.onTouchEvent(ev);
}
final int action = ev.getAction();
if (!handled && (action == MotionEvent.ACTION_UP || action == MotionEvent.ACTION_CANCEL)) {
mService.setInteracting(StatusBarManager.WINDOW_STATUS_BAR, false);
}
return handled;
}
@Override
public void onDraw(Canvas canvas) {
super.onDraw(canvas);
if (mService.isScrimSrcModeEnabled()) {
// We need to ensure that our window is always drawn fully even when we have paddings,
// since we simulate it to be opaque.
int paddedBottom = getHeight() - getPaddingBottom();
int paddedRight = getWidth() - getPaddingRight();
if (getPaddingTop() != 0) {
canvas.drawRect(0, 0, getWidth(), getPaddingTop(), mTransparentSrcPaint);
}
if (getPaddingBottom() != 0) {
canvas.drawRect(0, paddedBottom, getWidth(), getHeight(), mTransparentSrcPaint);
}
if (getPaddingLeft() != 0) {
canvas.drawRect(0, getPaddingTop(), getPaddingLeft(), paddedBottom,
mTransparentSrcPaint);
}
if (getPaddingRight() != 0) {
canvas.drawRect(paddedRight, getPaddingTop(), getWidth(), paddedBottom,
mTransparentSrcPaint);
}
}
if (DEBUG) {
Paint pt = new Paint();
pt.setColor(0x80FFFF00);
pt.setStrokeWidth(12.0f);
pt.setStyle(Paint.Style.STROKE);
canvas.drawRect(0, 0, canvas.getWidth(), canvas.getHeight(), pt);
}
}
public void cancelExpandHelper() {
if (mStackScrollLayout != null) {
mStackScrollLayout.cancelExpandHelper();
}
}
}
| s20121035/rk3288_android5.1_repo | frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowView.java | Java | gpl-3.0 | 9,570 |
package com.tds171a.soboru.beans;
import java.util.ArrayList;
import java.util.List;
import javax.enterprise.context.SessionScoped;
import javax.faces.application.FacesMessage;
import javax.faces.context.FacesContext;
import javax.faces.model.SelectItem;
import javax.inject.Named;
import com.tds171a.soboru.controllers.ReceitaController;
import com.tds171a.soboru.controllers.ReportController;
import com.tds171a.soboru.vos.Receita;
import com.tds171a.soboru.vos.Report;
@Named("reportBean")
@SessionScoped
/**
* Criação do bean herando de beanbase passando
* o vo utilizada.
*/
public class ReportBean extends BeanBase<Report> {
/**
*criando o serial do bean
*/
private static final long serialVersionUID = 4730432362349049623L;
/**
*Lista do tipo receita
*/
private List<Receita> receitas;
/**
*Construtor setando a rota e qual
*será passado para o navegador.
*/
public ReportBean() {
route_base = "/cadastro/report/";
controller = new ReportController();
setVo(new Report());
}
/**
* Override do criar, onde é criado um controller do tipo receita
* e incluido no receitas uma lista da receitacontroller.
*/
@Override
public String criar()
{
ReceitaController receitaController = new ReceitaController();
setReceitas(receitaController.listar());
return super.criar();
}
/**
* override onde passa o usuário logado
* e gera o GET do report
*/
@Override
public String incluir()
{
getVo().setUsuarioId(SessionContext.getInstance().getUsuarioLogado().getId());
return super.incluir();
}
@Override
public String deletar(Report vo) {
return super.deletar(vo);
}
/**
* Override do deletar, onde verifica a sessao,
* se existe um ítem válido e se não houver, retorna a
* pagina de criação.
*/
@Override
public String deletar() {
FacesContext context = FacesContext.getCurrentInstance();
if(((ReportController)controller).remover(getVo().getReceitaId(), getVo().getUsuarioId())) {
context.addMessage(null, new FacesMessage(FacesMessage.SEVERITY_INFO, "Deletado com sucesso!", null));
} else {
context.addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, "Nao foi possivel deletar.", null));
return route_base + DELETAR_PAGE;
}
limparVo();
return listar();
}
/**
* Verifica os dados da pagina de interação e se faltar algum dado
* informa ao cliente.
*/
@Override
public boolean validarDados() {
// TODO Auto-generated method stub
return super.validarDados();
}
/**
* Cria uma nova vo para limpar os campos para um novo registro
* sem interferencia de dados cadastrados anteriormente.
*/
@Override
public void limparVo() {
setVo(new Report());
}
/**
* @return the receitas
*/
public List<SelectItem> getReceitas()
{
List<SelectItem> items = new ArrayList<SelectItem>();
for (Receita r : this.receitas) {
items.add(new SelectItem(r.getId(), r.getNome()));
}
return items;
}
/**
* @param pReceitas the receitas to set
*/
public void setReceitas(List<Receita> pReceitas)
{
receitas = pReceitas;
}
}
| Animaleante/TDS171A_Interdisciplinar | Java/src/com/tds171a/soboru/beans/ReportBean.java | Java | gpl-3.0 | 3,267 |
```js
const styles = ['Primary', 'Danger', 'Warning', 'Success', 'Info', 'Default'];
styles.map((style, i) => {
return (
<span key={`button-${style}-${i}`}>
<Badge bsStyle={style.toLowerCase()}>{style}</Badge>{' '}
</span>
)
})
```
| Graylog2/graylog2-server | graylog2-web-interface/src/components/graylog/Badge.md | Markdown | gpl-3.0 | 251 |
<?php
namespace OCA\crate_it\Controller;
use \OCA\AppFramework\Controller\Controller;
use \OCA\AppFramework\Http\JSONResponse;
use \OCA\AppFramework\Http\TextResponse;
use \OCP\AppFramework\Http;
use OCA\crate_it\lib\ZipDownloadResponse;
class CrateController extends Controller {
/**
* @var $twig
*/
private $twig;
/**
* @var $crate_service
*/
private $crate_service;
public function __construct($api, $request, $crate_service) {
parent::__construct($api, $request);
$this->crate_service = $crate_service;
}
/**
* Create crate with name and description
*
* @Ajax
* @IsAdminExemption
* @IsSubAdminExemption
*/
public function createCrate() {
\OCP\Util::writeLog('crate_it', "CrateController::create()", \OCP\Util::DEBUG);
$name = $this->params('name');
$description = $this->params('description');
try {
// TODO: maybe this selection stuff should be in a switchcrate method
$msg = $this->crate_service->createCrate($name, $description);
$_SESSION['selected_crate'] = $name;
session_commit();
return new JSONResponse(array('crateName' => $msg, 'crateDescription' => $description));
} catch (\Exception $e) { // TODO: This is currently unreachable
return new JSONResponse(array('msg' => $e->getMessage()), Http::STATUS_INTERNAL_SERVER_ERROR);
}
}
/**
* Get crate items
*
* @Ajax
* @IsAdminExemption
* @IsSubAdminExemption
*/
public function getItems() // NOTE: this now return the entire manifest, should we change the name of the method?
{
\OCP\Util::writeLog('crate_it', "CrateController::get_items()", \OCP\Util::DEBUG);
try {
$crateName = $this->params('crate_id');
$_SESSION['selected_crate'] = $crateName;
session_commit();
\OCP\Util::writeLog('crate_it', "selected_crate:: ".$_SESSION['selected_crate'], \OCP\Util::DEBUG);
$data = $this->crate_service->getItems($crateName);
return new JSONResponse($data);
} catch (\Exception $e) {
return new JSONResponse(array('msg' => $e->getMessage()), Http::STATUS_INTERNAL_SERVER_ERROR);
}
}
/**
* Add To Crate
*
* @Ajax
* @IsAdminExemption
* @IsSubAdminExemption
*/
public function add() {
\OCP\Util::writeLog('crate_it', "CrateController::add()", \OCP\Util::DEBUG);
try {
// TODO check if this error handling works
$file = $this->params('file');
\OCP\Util::writeLog('crate_it', "Adding ".$file, \OCP\Util::DEBUG);
$crateName = $_SESSION['selected_crate'];
// TODO: naming consistency, add vs addToBag vs addToCrate
$this->crate_service->addToBag($crateName, $file);
return new JSONResponse(array('msg' => "$file added to crate $crateName"));
} catch(\Exception $e) {
return new JSONResponse(array('msg' => $e->getMessage()), Http::STATUS_INTERNAL_SERVER_ERROR);
}
}
/**
* Get Crate Size
*
* @Ajax
* @IsAdminExemption
* @IsSubAdminExemption
*/
public function getCrateSize()
{
\OCP\Util::writeLog('crate_it', "CrateController::getCrateSize()", \OCP\Util::DEBUG);
try {
$data = $this->crate_service->getCrateSize($_SESSION['selected_crate']);
return new JSONResponse($data);
} catch(\Exception $e) {
return new JSONResponse(array('msg' => $e->getMessage()), Http::STATUS_INTERNAL_SERVER_ERROR);
}
}
/**
* Update Crate
* TODO change to not just return description but all fields?
*
* @Ajax
* @IsAdminExemption
* @IsSubAdminExemption
*/
public function updateCrate()
{
\OCP\Util::writeLog('crate_it', "CrateController::updateCrate()", \OCP\Util::DEBUG);
$field = $this->params('field');
$value = $this->params('value');
try {
$this->crate_service->updateCrate($_SESSION['selected_crate'], $field, $value);
return new JSONResponse(array('msg' => "$field successfully updated", 'value' => $value));
} catch(\Exception $e) {
return new JSONResponse(array('msg' => $e->getMessage()), Http::STATUS_INTERNAL_SERVER_ERROR);
}
}
/**
* Delete Crate
*
* @Ajax
* @IsAdminExemption
* @IsSubAdminExemption
*/
public function deleteCrate() {
// TODO: all of these methods always return successfully, which shouldn't happen
// unfortunately this means rewriting methods in the bagit library
\OCP\Util::writeLog('crate_it', "CrateController::deleteCrate()", \OCP\Util::DEBUG);
$selected_crate = $_SESSION['selected_crate'];
try {
$this->crate_service->deleteCrate($selected_crate);
return new JSONResponse(array('msg' => "Crate $selected_crate has been deleted"));
} catch(\Exception $e) {
return new JSONResponse(array('msg' => $e->getMessage()), Http::STATUS_INTERNAL_SERVER_ERROR);
}
}
/**
* Rename Crate
*
* @Ajax
* @IsAdminExemption
* @IsSubAdminExemption
*/
public function renameCrate() {
\OCP\Util::writeLog('crate_it', "CrateController::renameCrate()", \OCP\Util::DEBUG);
$oldCrateName = $_SESSION['selected_crate'];
$newCrateName = $this->params('newCrateName');
try {
$this->crate_service->renameCrate($oldCrateName, $newCrateName);
$_SESSION['selected_crate'] = $newCrateName;
session_commit();
return new JSONResponse(array('msg' => "Renamed $oldCrateName to $newCrateName"));
} catch (\Exception $e) {
return new JSONResponse(array('msg' => $e->getMessage()), Http::STATUS_INTERNAL_SERVER_ERROR);
}
}
/**
* Package Crate as a Zip
*
* @IsAdminExemption
* @IsSubAdminExemption
*/
public function packageCrate() {
\OCP\Util::writeLog('crate_it', "CrateController::packageCrate()", \OCP\Util::DEBUG);
try {
$packagePath = $this->crate_service->packageCrate($_SESSION['selected_crate']);
$filename = basename($packagePath);
$response = new ZipDownloadResponse($packagePath, $filename);
} catch(\Exception $e) {
$message = 'Internal Server Error: '.$e->getMessage();
\OCP\Util::writeLog('crate_it', $message, \OCP\Util::ERROR);
$response = new TextResponse($message);
$response->setStatus(Http::STATUS_INTERNAL_SERVER_ERROR);
}
return $response;
}
/**
* Create ePub
*
* @CSRFExemption
* @IsAdminExemption
* @IsSubAdminExemption
*/
public function generateEPUB() {
\OCP\Util::writeLog('crate_it', "CrateController::generateEPUB()", \OCP\Util::DEBUG);
try {
$epubPath = $this->crate_service->generateEPUB($_SESSION['selected_crate']);
$filename = basename($epubPath);
$response = new ZipDownloadResponse($epubPath, $filename);
} catch(\Exception $e) {
$message = 'Internal Server Error: '.$e->getMessage();
\OCP\Util::writeLog('crate_it', $message, \OCP\Util::ERROR);
$response = new TextResponse($message);
$response->setStatus(Http::STATUS_INTERNAL_SERVER_ERROR);
}
return $response;
}
/**
* README previewer - this is for debugging purposes.
*
* @CSRFExemption
* @IsAdminExemption
* @IsSubAdminExemption
*/
public function readmePreview() {
\OCP\Util::writeLog('crate_it', "CrateController::readmePreview()", \OCP\Util::DEBUG);
$readme = $this->crate_service->getReadme($_SESSION['selected_crate']);
return new TextResponse($readme, 'html');
}
/**
* Check crate
*
* @Ajax
* @IsAdminExemption
* @IsSubAdminExemption
*/
public function checkCrate() {
\OCP\Util::writeLog('crate_it', "CrateController::checkCrate()", \OCP\Util::DEBUG);
try {
$selected_crate = $_SESSION['selected_crate'];
$result = $this->crate_service->checkCrate($selected_crate);
if (empty($result)) {
$msg = 'All items are valid.';
}
else if (sizeof($result) === 1) {
$msg = 'The following item no longer exists:';
}
else {
$msg = 'The following items no longer exist:';
}
return new JSONResponse(
array('msg' => $msg,
'result' => $result)
);
} catch (\Exception $e) {
return new JSONResponse (array($e->getMessage(), 'error' => $e), Http::STATUS_INTERNAL_SERVER_ERROR);
}
}
}
| uws-eresearch/owncloud | apps/crate_it/controller/cratecontroller.php | PHP | gpl-3.0 | 9,133 |
package org.freehep.swing;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JComponent;
import javax.swing.JDialog;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTabbedPane;
import javax.swing.JTextArea;
import javax.swing.SwingUtilities;
import javax.swing.WindowConstants;
/**
* A utility for displaying errors in dialogs.
* @author Tony Johnson
*/
public class ErrorDialog
{
private ErrorDialog()
{
}
/**
* Creates a dialog which will display a message to the user.
* If a Throwable is provided the user can click the "Details" button to
* get a full stack trace, including any nested errors ("caused by").
* @param source The parent component to be used for the dialog (may be null)
* @param message The message to be displayed in the dialog
* @param detail The exception that caused the error (may be null)
*/
public static void showErrorDialog(Component source, Object message, final Throwable detail)
{
final JButton details = new JButton("Details...");
details.setEnabled(detail != null);
details.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
JDialog owner = (JDialog) SwingUtilities.getAncestorOfClass(JDialog.class,details);
ErrorDetailsDialog dlg = new ErrorDetailsDialog(owner,detail);
dlg.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
dlg.pack();
dlg.setLocationRelativeTo(owner);
dlg.setVisible(true);
}
});
if (source != null) source.getToolkit().beep();
Object[] options = { "OK" , details };
JOptionPane.showOptionDialog(source,message,"Error...",JOptionPane.DEFAULT_OPTION,JOptionPane.ERROR_MESSAGE,null,options,options[0]);
}
public static class ErrorDetailsDialog extends JDialog
{
public ErrorDetailsDialog(JDialog owner, Throwable detail)
{
super(owner);
JComponent messageComponent = null;
JTabbedPane tabs = null;
Throwable ex = detail;
for (; ex != null;)
{
JTextArea ta = new JTextArea();
ta.append(ex+"\n");
StackTraceElement[] trace = ex.getStackTrace();
for (int i=0; i<trace.length; i++)
{
ta.append(" at "+trace[i]+"\n");
}
JScrollPane scroll = new JScrollPane(ta);
ta.setCaretPosition(0);
ta.setEditable(false);
scroll.setPreferredSize(new Dimension(400,300));
ex = ex.getCause();
if (ex != null)
{
if (messageComponent == null)
{
messageComponent = tabs = new JTabbedPane();
tabs.addTab("Exception",scroll);
}
else
{
tabs.addTab("Caused by",scroll);
}
}
else
{
if (messageComponent == null) messageComponent = scroll;
else tabs.addTab("Caused by",scroll);
break;
}
}
getContentPane().add(messageComponent);
JButton close = new JButton("Close")
{
public void fireActionPerformed(ActionEvent event)
{
dispose();
}
};
JPanel panel = new JPanel();
panel.add(close);
getContentPane().add(panel,BorderLayout.SOUTH);
}
}
}
| phuseman/r2cat | org/freehep/swing/ErrorDialog.java | Java | gpl-3.0 | 3,741 |
package com.gmv.vodafone;
import java.io.Serializable;
import java.time.LocalDate;
/*
* Simular entidad recuperada de la BBDD
*/
public class Oferta implements Serializable {
private static final long serialVersionUID = 1L;
private int codigoOferta;
private String referencia;
private LocalDate fechaInicio;
public Oferta() {
}
public int getCodigoOferta() {
return codigoOferta;
}
public void setCodigoOferta(int codigoOferta) {
this.codigoOferta = codigoOferta;
}
public String getReferencia() {
return referencia;
}
public void setReferencia(String referencia) {
this.referencia = referencia;
}
public LocalDate getFechaInicio() {
return fechaInicio;
}
public void setFechaInicio(LocalDate fechaInicio) {
this.fechaInicio = fechaInicio;
}
@Override
public String toString() {
return "Oferta [codigoOferta=" + codigoOferta + ", referencia=" + referencia + ", fechaInicio=" + fechaInicio
+ "]";
}
}
| crischoque/adecco | src/com/gmv/vodafone/Oferta.java | Java | gpl-3.0 | 1,006 |
/**
* This file is part of alf.io.
*
* alf.io is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* alf.io 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with alf.io. If not, see <http://www.gnu.org/licenses/>.
*/
package alfio.controller.api.admin;
import alfio.manager.EventManager;
import alfio.manager.i18n.ContentLanguage;
import alfio.manager.i18n.I18nManager;
import alfio.manager.support.OrderSummary;
import alfio.model.Event;
import alfio.model.TicketReservation;
import alfio.model.modification.EventModification;
import alfio.model.modification.EventWithStatistics;
import alfio.model.modification.TicketAllocationModification;
import alfio.model.modification.TicketCategoryModification;
import alfio.model.transaction.PaymentProxy;
import alfio.util.ValidationResult;
import alfio.util.Validator;
import com.opencsv.CSVReader;
import lombok.extern.log4j.Log4j2;
import org.apache.commons.lang3.Validate;
import org.apache.commons.lang3.tuple.Triple;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.validation.Errors;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigDecimal;
import java.security.Principal;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.stream.Collectors;
import static org.springframework.web.bind.annotation.RequestMethod.*;
@RestController
@RequestMapping("/admin/api")
@Log4j2
public class EventApiController {
private static final String OK = "OK";
private final EventManager eventManager;
private final I18nManager i18nManager;
@Autowired
public EventApiController(EventManager eventManager, I18nManager i18nManager) {
this.eventManager = eventManager;
this.i18nManager = i18nManager;
}
@ExceptionHandler(Exception.class)
@ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR)
public String unhandledException(Exception e) {
if(!IllegalArgumentException.class.isInstance(e)) {
log.warn("unhandled exception", e);
}
return e.getMessage();
}
@RequestMapping(value = "/paymentProxies", method = GET)
@ResponseStatus(HttpStatus.OK)
public List<PaymentProxy> getPaymentProxies() {
return PaymentProxy.availableProxies();
}
@RequestMapping(value = "/events", method = GET)
public List<EventWithStatistics> getAllEvents(Principal principal) {
return eventManager.getAllEventsWithStatistics(principal.getName()).stream()
.sorted().collect(Collectors.toList());
}
@RequestMapping(value = "/events/{name}", method = GET)
public Map<String, Object> getSingleEvent(@PathVariable("name") String eventName, Principal principal) {
Map<String, Object> out = new HashMap<>();
final String username = principal.getName();
final EventWithStatistics event = eventManager.getSingleEventWithStatistics(eventName, username);
out.put("event", event);
out.put("organization", eventManager.loadOrganizer(event.getEvent(), username));
return out;
}
@RequestMapping(value = "/events/check", method = POST)
public ValidationResult validateEvent(@RequestBody EventModification eventModification) {
return ValidationResult.success();
}
@RequestMapping(value = "/events/new", method = POST)
public String insertEvent(@RequestBody EventModification eventModification) {
eventManager.createEvent(eventModification);
return OK;
}
@RequestMapping(value = "/events/{id}/header/update", method = POST)
public ValidationResult updateHeader(@PathVariable("id") int id, @RequestBody EventModification eventModification, Errors errors, Principal principal) {
return Validator.validateEventHeader(eventModification, errors).ifSuccess(() -> eventManager.updateEventHeader(id, eventModification, principal.getName()));
}
@RequestMapping(value = "/events/{id}/prices/update", method = POST)
public ValidationResult updatePrices(@PathVariable("id") int id, @RequestBody EventModification eventModification, Errors errors, Principal principal) {
return Validator.validateEventPrices(eventModification, errors).ifSuccess(() -> eventManager.updateEventPrices(id, eventModification, principal.getName()));
}
@RequestMapping(value = "/events/{eventId}/categories/{categoryId}/update", method = POST)
public ValidationResult updateExistingCategory(@PathVariable("eventId") int eventId, @PathVariable("categoryId") int categoryId, @RequestBody TicketCategoryModification category, Errors errors, Principal principal) {
return Validator.validateCategory(category, errors).ifSuccess(() -> eventManager.updateCategory(categoryId, eventId, category, principal.getName()));
}
@RequestMapping(value = "/events/{eventId}/categories/new", method = POST)
public ValidationResult createCategory(@PathVariable("eventId") int eventId, @RequestBody TicketCategoryModification category, Errors errors, Principal principal) {
return Validator.validateCategory(category, errors).ifSuccess(() -> eventManager.insertCategory(eventId, category, principal.getName()));
}
@RequestMapping(value = "/events/reallocate", method = PUT)
public String reallocateTickets(@RequestBody TicketAllocationModification form) {
eventManager.reallocateTickets(form.getSrcCategoryId(), form.getTargetCategoryId(), form.getEventId());
return OK;
}
@RequestMapping(value = "/events/{eventName}/pending-payments")
public List<SerializablePair<TicketReservation, OrderSummary>> getPendingPayments(@PathVariable("eventName") String eventName, Principal principal) {
return eventManager.getPendingPayments(eventName, principal.getName()).stream().map(SerializablePair::fromPair).collect(Collectors.toList());
}
@RequestMapping(value = "/events/{eventName}/pending-payments/{reservationId}/confirm", method = POST)
public String confirmPayment(@PathVariable("eventName") String eventName, @PathVariable("reservationId") String reservationId, Principal principal) {
eventManager.confirmPayment(eventName, reservationId, principal.getName());
return OK;
}
@RequestMapping(value = "/events/{eventName}/pending-payments/{reservationId}", method = DELETE)
public String deletePendingPayment(@PathVariable("eventName") String eventName, @PathVariable("reservationId") String reservationId, Principal principal) {
eventManager.deletePendingOfflinePayment(eventName, reservationId, principal.getName());
return OK;
}
@RequestMapping(value = "/events/{eventName}/pending-payments/bulk-confirmation", method = POST)
public List<Triple<Boolean, String, String>> bulkConfirmation(@PathVariable("eventName") String eventName,
Principal principal,
@RequestParam("file") MultipartFile file) throws IOException {
try(InputStreamReader isr = new InputStreamReader(file.getInputStream())) {
CSVReader reader = new CSVReader(isr);
String username = principal.getName();
return reader.readAll().stream()
.map(line -> {
String reservationID = null;
try {
Validate.isTrue(line.length >= 2);
reservationID = line[0];
eventManager.confirmPayment(eventName, reservationID, new BigDecimal(line[1]), username);
return Triple.of(Boolean.TRUE, reservationID, "");
} catch (Exception e) {
return Triple.of(Boolean.FALSE, Optional.ofNullable(reservationID).orElse(""), e.getMessage());
}
})
.collect(Collectors.toList());
}
}
@RequestMapping(value = "/events/{eventName}/categories/{categoryId}/tickets/{ticketId}/toggle-locking", method = PUT)
public boolean toggleTicketLocking(@PathVariable("eventName") String eventName,
@PathVariable("categoryId") int categoryId,
@PathVariable("ticketId") int ticketId,
Principal principal) {
return eventManager.toggleTicketLocking(eventName, categoryId, ticketId, principal.getName());
}
@RequestMapping(value = "/events/{eventName}/languages", method = GET)
public List<ContentLanguage> getAvailableLocales(@PathVariable("eventName") String eventName) {
return i18nManager.getEventLocales(eventName);
}
@RequestMapping(value = "/events/{eventName}/categories-containing-tickets", method = GET)
public List<TicketCategoryModification> getCategoriesWithTickets(@PathVariable("eventName") String eventName, Principal principal) {
Event event = eventManager.getSingleEvent(eventName, principal.getName());
return eventManager.loadTicketCategoriesWithStats(event).stream()
.filter(tc -> !tc.getTickets().isEmpty())
.map(tc -> TicketCategoryModification.fromTicketCategory(tc.getTicketCategory(), event.getZoneId()))
.collect(Collectors.toList());
}
}
| apolci/alf.mio | src/main/java/alfio/controller/api/admin/EventApiController.java | Java | gpl-3.0 | 10,038 |
---
title: "Vodafone and SAP Join Hands to Power the Adoption of Industrial IoT"
layout: item
category: ["business"]
date: 2018-04-12T04:57:28.570Z
image: 1523528848568voda.jpg
---
<p>The ‘connected revolution’ has the potential to enable an efficient use of scarce resources, automate routine manual tasks, and improve decision-making across industrial sectors such as utilities, manufacturing, automotive, transportation and logistics, to name a few. To further accelerate the adoption of Industrial Internet of Things (IIoT) in India, Vodafone and SAP SE (NYSE: SAP) have announced a strategic partnership to develop comprehensive communications solutions for enterprises that will leverage both SAP Leonardo and Vodafone’s IoT Managed Connectivity Platform.</p>
<p>The partnership between the two global technology leaders will help enhance digital adoption by enterprises in India by providing solutions that leverage the latest in technologies including Cloud, Analytics and Internet of Things (IoT). Vodafone and SAP have signed a Memorandum of Understanding (MoU) to work together and offer a host of innovative packages comprising connectivity solutions, business application software, end-to-end device management and support services, making it easy for enterprises to embark on their digital journey.</p>
<p>“Enterprises of all sizes are seeking to embrace new-age technologies for higher efficiency,” said Neeraj Athalye, Head – Innovation & Digital Strategy Group, SAP Indian Subcontinent. “The offerings provided by Vodafone Business Services are truly complementary to the SAP Leonardo portfolio — our enterprise-grade offering for digital innovation. With this we aim to equip our customers with end-to-end solutions that will shift business value from ‘things to outcomes’.”</p>
<p>Nick Gliddon, Director – Vodafone Business Services, said, “We are delighted to announce our association with SAP. As customers digitize, industrial IoT is at the center of their programs. Working in collaboration with SAP, we offer an end to end partnership across IoT and analytics which enables meaningful insight and focused outcomes”</p> | InstantKhabar/_source | _source/news/2018-04-12-voda.html | HTML | gpl-3.0 | 2,177 |
---
-- Name: EVT-201 - GROUP OnEventHit Example
-- Author: FlightControl
-- Date Created: 08 Mar 2017
--
-- # Situation:
--
-- Two groups of planes are flying in the air and shoot an missile to a multitude of ground targets.
--
-- # Test cases:
--
-- 1. Observe the planes shooting the missile.
-- 2. Observe when the planes shoots the missile, and hit the group Tanks A, a dcs.log entry is written in the logging.
-- 3. Check the contents of the fields of the S_EVENT_HIT entry.
-- 4. The tanks of GROUP "Group Tanks A", should only send a message when they get hit.
-- 5. The tanks of GROUP "Group Tanks B", should NOT send a message when they get hit.
TanksGroup = GROUP:FindByName( "Group Tanks A" )
TanksGroup:HandleEvent( EVENTS.Hit )
function TanksGroup:OnEventHit( EventData )
self:E( "I just got hit and I am part of " .. EventData.TgtGroupName )
EventData.TgtUnit:MessageToAll( "I just got hit and I am part of " .. EventData.TgtGroupName, 15, "Alert!" )
end
| FlightControl-Master/MOOSE_MISSIONS | EVT - Event Handling/EVT-201 - GROUP OnEventHit Example/EVT-201 - GROUP OnEventHit Example.lua | Lua | gpl-3.0 | 981 |
package com.yurikoster1.letsmodreboot.item;
import com.yurikoster1.letsmodreboot.item.base.ItemLMRB;
/**
* Created by Koster on 23/10/2015.
*/
public class ItemMagicHammer extends ItemLMRB {
public ItemMagicHammer(){
super();
this.setUnlocalizedName("magicHammer");
this.maxStackSize = 1;
this.setMaxDamage(128);
this.setNoRepair();
}
}
| yurikoster1/minemod | src/main/java/com/yurikoster1/letsmodreboot/item/ItemMagicHammer.java | Java | gpl-3.0 | 353 |
/**
* Copyright (c) 2002-2012 "Neo Technology,"
* Network Engine for Objects in Lund AB [http://neotechnology.com]
*
* This file is part of Neo4j.
*
* Neo4j is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.neo4j.server.helpers;
import org.neo4j.graphdb.GraphDatabaseService;
import org.neo4j.graphdb.Transaction;
public class Transactor
{
private final org.neo4j.server.helpers.UnitOfWork unitOfWork;
private final GraphDatabaseService graphDb;
public Transactor( GraphDatabaseService graphDb, UnitOfWork unitOfWork )
{
this.unitOfWork = unitOfWork;
this.graphDb = graphDb;
}
public void execute()
{
Transaction tx = graphDb.beginTx();
try
{
unitOfWork.doWork();
tx.success();
}
finally
{
tx.finish();
}
}
}
| dksaputra/community | server/src/test/java/org/neo4j/server/helpers/Transactor.java | Java | gpl-3.0 | 1,459 |
//Copyright (c) 2008-2010 Emil Dotchevski and Reverge Studios, Inc.
//Distributed under the Boost Software License, Version 1.0. (See accompanying
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#ifndef UUID_F20566FC196311E0B99D606CDFD72085
#define UUID_F20566FC196311E0B99D606CDFD72085
#include <boost/qvm/s_traits.hpp>
namespace
boost
{
namespace
qvm
{
namespace
deduce_s_detail
{
template <class A,class B> struct deduce_s_impl { };
template <class T>
struct
deduce_s_impl<T,T>
{
typedef T type;
};
template <> struct deduce_s_impl<signed char,unsigned char> { typedef unsigned char type; };
template <> struct deduce_s_impl<signed char,unsigned short> { typedef unsigned short type; };
template <> struct deduce_s_impl<signed char,unsigned int> { typedef unsigned int type; };
template <> struct deduce_s_impl<signed char,unsigned long> { typedef unsigned long type; };
template <> struct deduce_s_impl<signed char,signed short> { typedef signed short type; };
template <> struct deduce_s_impl<signed char,signed int> { typedef signed int type; };
template <> struct deduce_s_impl<signed char,signed long> { typedef signed long type; };
template <> struct deduce_s_impl<signed char,float> { typedef float type; };
template <> struct deduce_s_impl<signed char,double> { typedef double type; };
template <> struct deduce_s_impl<unsigned char,unsigned short> { typedef unsigned short type; };
template <> struct deduce_s_impl<unsigned char,unsigned int> { typedef unsigned int type; };
template <> struct deduce_s_impl<unsigned char,unsigned long> { typedef unsigned long type; };
template <> struct deduce_s_impl<unsigned char,signed short> { typedef signed short type; };
template <> struct deduce_s_impl<unsigned char,signed int> { typedef signed int type; };
template <> struct deduce_s_impl<unsigned char,signed long> { typedef signed long type; };
template <> struct deduce_s_impl<unsigned char,float> { typedef float type; };
template <> struct deduce_s_impl<unsigned char,double> { typedef double type; };
template <> struct deduce_s_impl<signed short,unsigned short> { typedef unsigned short type; };
template <> struct deduce_s_impl<signed short,unsigned int> { typedef unsigned int type; };
template <> struct deduce_s_impl<signed short,unsigned long> { typedef unsigned long type; };
template <> struct deduce_s_impl<signed short,signed int> { typedef signed int type; };
template <> struct deduce_s_impl<signed short,signed long> { typedef signed long type; };
template <> struct deduce_s_impl<signed short,float> { typedef float type; };
template <> struct deduce_s_impl<signed short,double> { typedef double type; };
template <> struct deduce_s_impl<unsigned short,unsigned int> { typedef unsigned int type; };
template <> struct deduce_s_impl<unsigned short,unsigned long> { typedef unsigned long type; };
template <> struct deduce_s_impl<unsigned short,signed int> { typedef signed int type; };
template <> struct deduce_s_impl<unsigned short,signed long> { typedef signed long type; };
template <> struct deduce_s_impl<unsigned short,float> { typedef float type; };
template <> struct deduce_s_impl<unsigned short,double> { typedef double type; };
template <> struct deduce_s_impl<signed int,unsigned int> { typedef unsigned int type; };
template <> struct deduce_s_impl<signed int,unsigned long> { typedef unsigned long type; };
template <> struct deduce_s_impl<signed int,signed long> { typedef signed long type; };
template <> struct deduce_s_impl<signed int,float> { typedef float type; };
template <> struct deduce_s_impl<signed int,double> { typedef double type; };
template <> struct deduce_s_impl<unsigned int,unsigned long> { typedef unsigned long type; };
template <> struct deduce_s_impl<unsigned int,signed long> { typedef signed long type; };
template <> struct deduce_s_impl<unsigned int,float> { typedef float type; };
template <> struct deduce_s_impl<unsigned int,double> { typedef double type; };
template <> struct deduce_s_impl<signed long,unsigned long> { typedef unsigned long type; };
template <> struct deduce_s_impl<signed long,float> { typedef float type; };
template <> struct deduce_s_impl<signed long,double> { typedef double type; };
template <> struct deduce_s_impl<unsigned long,float> { typedef float type; };
template <> struct deduce_s_impl<unsigned long,double> { typedef double type; };
template <> struct deduce_s_impl<float,double> { typedef double type; };
template <> struct deduce_s_impl<unsigned char,signed char> { typedef unsigned char type; };
template <> struct deduce_s_impl<unsigned short,signed char> { typedef unsigned short type; };
template <> struct deduce_s_impl<unsigned int,signed char> { typedef unsigned int type; };
template <> struct deduce_s_impl<unsigned long,signed char> { typedef unsigned long type; };
template <> struct deduce_s_impl<signed short,signed char> { typedef signed short type; };
template <> struct deduce_s_impl<signed int,signed char> { typedef signed int type; };
template <> struct deduce_s_impl<signed long,signed char> { typedef signed long type; };
template <> struct deduce_s_impl<float,signed char> { typedef float type; };
template <> struct deduce_s_impl<double,signed char> { typedef double type; };
template <> struct deduce_s_impl<unsigned short,unsigned char> { typedef unsigned short type; };
template <> struct deduce_s_impl<unsigned int,unsigned char> { typedef unsigned int type; };
template <> struct deduce_s_impl<unsigned long,unsigned char> { typedef unsigned long type; };
template <> struct deduce_s_impl<signed short,unsigned char> { typedef signed short type; };
template <> struct deduce_s_impl<signed int,unsigned char> { typedef signed int type; };
template <> struct deduce_s_impl<signed long,unsigned char> { typedef signed long type; };
template <> struct deduce_s_impl<float,unsigned char> { typedef float type; };
template <> struct deduce_s_impl<double,unsigned char> { typedef double type; };
template <> struct deduce_s_impl<unsigned short,signed short> { typedef unsigned short type; };
template <> struct deduce_s_impl<unsigned int,signed short> { typedef unsigned int type; };
template <> struct deduce_s_impl<unsigned long,signed short> { typedef unsigned long type; };
template <> struct deduce_s_impl<signed int,signed short> { typedef signed int type; };
template <> struct deduce_s_impl<signed long,signed short> { typedef signed long type; };
template <> struct deduce_s_impl<float,signed short> { typedef float type; };
template <> struct deduce_s_impl<double,signed short> { typedef double type; };
template <> struct deduce_s_impl<unsigned int,unsigned short> { typedef unsigned int type; };
template <> struct deduce_s_impl<unsigned long,unsigned short> { typedef unsigned long type; };
template <> struct deduce_s_impl<signed int,unsigned short> { typedef signed int type; };
template <> struct deduce_s_impl<signed long,unsigned short> { typedef signed long type; };
template <> struct deduce_s_impl<float,unsigned short> { typedef float type; };
template <> struct deduce_s_impl<double,unsigned short> { typedef double type; };
template <> struct deduce_s_impl<unsigned int,signed int> { typedef unsigned int type; };
template <> struct deduce_s_impl<unsigned long,signed int> { typedef unsigned long type; };
template <> struct deduce_s_impl<signed long,signed int> { typedef signed long type; };
template <> struct deduce_s_impl<float,signed int> { typedef float type; };
template <> struct deduce_s_impl<double,signed int> { typedef double type; };
template <> struct deduce_s_impl<unsigned long,unsigned int> { typedef unsigned long type; };
template <> struct deduce_s_impl<signed long,unsigned int> { typedef signed long type; };
template <> struct deduce_s_impl<float,unsigned int> { typedef float type; };
template <> struct deduce_s_impl<double,unsigned int> { typedef double type; };
template <> struct deduce_s_impl<unsigned long,signed long> { typedef unsigned long type; };
template <> struct deduce_s_impl<float,signed long> { typedef float type; };
template <> struct deduce_s_impl<double,signed long> { typedef double type; };
template <> struct deduce_s_impl<float,unsigned long> { typedef float type; };
template <> struct deduce_s_impl<double,unsigned long> { typedef double type; };
template <> struct deduce_s_impl<double,float> { typedef double type; };
}
template <class A,class B>
struct
deduce_s
{
typedef typename deduce_s_detail::deduce_s_impl<A,B>::type type;
};
}
}
#endif
| purpleKarrot/JunkLoad | include/boost/qvm/deduce_s.hpp | C++ | gpl-3.0 | 9,926 |
/**
*
*/
package com.atomicDisorder.remolino;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;
import java.util.Map.Entry;
import org.apache.log4j.Logger;
import com.atomicDisorder.remolino.commons.filters.StringHubFilter;
import com.atomicDisorder.remolino.commons.filters.StringHubFilterResult;
import com.atomicDisorder.remolino.commons.messages.ObjectHub;
import com.atomicDisorder.remolino.commons.messages.StringHub;
import com.atomicDisorder.remolino.commons.messages.StringHubMessageProsumer;
import com.atomicDisorder.remolino.commons.modules.Module;
import com.atomicDisorder.remolino.commons.modules.ModuleAbstract;
import com.atomicDisorder.remolino.commons.modules.ModuleConfiguration;
import com.atomicDisorder.remolino.commons.persistance.JAXBProvider;
import com.atomicDisorder.remolino.commons.utils.Configurations;
import com.atomicDisorder.remolino.commons.utils.Reflection;
import com.atomicDisorder.remolino.stringFilters.RemolinoCommandFilter;
/**
* @author Mariano Blua
*
*/
public class Remolino extends ModuleAbstract {
private static Configurations configurations;
private static HashMap<String, Module> modules;
private static Logger logger = Logger.getLogger(Remolino.class.getName());
private static Remolino instance;
private Remolino() {
JAXBProvider.marshalClassToFile(Remolino.getConfigurations(), "Remolino.Configurations.xml");
// Load /Create StringHubs
// Deberían ser multiples y creables desde la configuracion.
StringHub mainStringHub = new com.atomicDisorder.remolino.messages.stringHub.StringHub("mainStringHub");
ObjectHub mainObjectHub = new com.atomicDisorder.remolino.messages.objectHub.ObjectHub("mainObjectHub");
//Add Remolino as a Module
getModules().put("remolino", this);
// List and Create all modulesConfigurations
logger.info("*** Loading Configured Modules ***");
for (Entry<String, ModuleConfiguration> element : getConfigurations().getModulesConfiguration().entrySet()) {
logger.info("* Loading " + element.getKey() + " Module. Type: " + element.getValue().getModuleType());
Module newModuleInstance = Reflection.getModuleInstance(element.getValue());
newModuleInstance.setStringHub(mainStringHub);
newModuleInstance.setObjectHub(mainObjectHub);
if (newModuleInstance != null) {
getModules().put(element.getKey(), newModuleInstance);
logger.info("Correctly added.");
}
}
// Init all filters modules
logger.info("*** Init filters from modules ***");
for (Entry<String, Module> element : getModules().entrySet()) {
Module currentModule = element.getValue();
currentModule.initModuleFilters();
logger.info(currentModule.getClass().getCanonicalName() + " -> Init module");
}
// Get all modules String Filters
logger.info("*** Get all modules String Filters ***");
for (Entry<String, Module> element : getModules().entrySet()) {
Module currentModule = element.getValue();
mainStringHub.addStringFiltersAll(currentModule.getOwnFilters());
logger.info(currentModule.getClass().getCanonicalName() + " -> Init module");
}
// Get all Object String Filters
logger.info("*** Get all modules Object Filters ***");
for (Entry<String, Module> element : getModules().entrySet()) {
Module currentModule = element.getValue();
mainStringHub.addStringFiltersAll(currentModule.getOwnFilters());
logger.info(currentModule.getClass().getCanonicalName() + " -> Init module");
}
// Init all modules
logger.info("*** Init all modules ***");
for (Entry<String, Module> element : getModules().entrySet()) {
Module currentModule = element.getValue();
currentModule.initModule();
logger.info(currentModule.getClass().getCanonicalName() + " -> Init module");
}
// List and Create all modulesConfigurations
/* logger.info("*** Running all runnables modules ***");
for (Entry<String, Module> element : getModules().entrySet()) {
Module currentModule = element.getValue();
if (currentModule instanceof Runnable) {
currentModule.setModuleThread(new Thread((Runnable) currentModule));
logger.info(currentModule.getClass().getCanonicalName() + " -> Starting with thread id: "
+ currentModule.getModuleThread().getId());
currentModule.getModuleThread().start();
}
}*/
// Add Remolino basic Filters to mainhub
setStringHub(mainStringHub);
// Starting all Hubs
/* mainStringHub.setThread(new Thread((Runnable) mainStringHub));
mainStringHub.getThread().start();*/
logger.info("*** Initialized ***");
while (true)
{
//System.out.println("EJECUTANDO");
for (Entry<String, Module> element : getModules().entrySet()) {
Module currentModule = element.getValue();
// System.out.println("EJECUTANDO " + currentModule.getName());
currentModule.execute();
}
//System.out.println("EJECUTANDO2");
mainStringHub.execute();
// System.out.println("EJECUTANDO3");
}
// mainStringHub.(new Thread((Runnable)currentModule));
// mainStringHub.getModuleThread().start();
}
private void shutdownModules() {
// List and Create all modulesConfigurations
logger.info("*** Shutting down all runnables modules ***");
for (Entry<String, Module> element : getModules().entrySet()) {
Module currentModule = element.getValue();
if (currentModule instanceof Runnable) {
if (currentModule.getModuleThread()!=null)
{
logger.info(currentModule.getClass().getCanonicalName() + " -> Thread interrupted "
+ currentModule.getModuleThread().getId());
currentModule.getModuleThread().interrupt();
}
}
}
logger.info("* All modules shutted down");
System.exit(0);
}
private void saveModules() {
// List and Create all modulesConfigurations
logger.info("*** Saving all modules ***");
for (Entry<String, Module> element : getModules().entrySet()) {
Module currentModule = element.getValue();
currentModule.saveModuleData();
logger.info(currentModule.getClass().getCanonicalName() + " -> Data saved");
}
logger.info("* All modules saved");
}
public static Remolino getInstance() {
if (instance == null) {
instance = new Remolino();
}
return instance;
}
public static void main(String[] args) {
Properties defaultProperties = new Properties();
defaultProperties.put("app.version", "0.1");
defaultProperties.put("log4j.properties.path", ".//properties//log4j.xml");
// defaultProperties.put("properties.path", ".//properties");
defaultProperties.put("main.path", ".//");
/*
* defaultProperties.put("default.controller.name",
* "remolino-controller");
* defaultProperties.put("default.controller.jar",
* "remolino-controller.jar");
* defaultProperties.put("default.controller.pathToMainClass",
* "com.atomicDisorder.remolino.modules.controller.Controller");
*/
defaultProperties.put("default.console.name", "remolino-console");
defaultProperties.put("default.console.jar", "remolino-console.jar");
defaultProperties.put("default.console.pathToMainClass", "com.atomicDisorder.remolino.modules.console.Console");
defaultProperties.put("use.defaults", "true");
boolean validConfiguration = getConfigurations().loadAndValidateConfiguration(defaultProperties,
"log4j.properties.path", args);
if (!validConfiguration) {
logger.fatal("FAIL STARTING Remolino " + getConfigurations().getParameters().getProperty("app.version"));
System.exit(1);
}
Remolino.getInstance();
}
private static void loadDefaultModules() {
boolean defaultAdded = false;
/*
* String defaultControllerName =
* configurations.getParameters().getProperty("default.controller.name")
* ; ModuleConfiguration defaultControllerConfiguration =
* getConfigurations().getModulesConfiguration()
* .get(defaultControllerName); if (defaultControllerConfiguration ==
* null) { defaultControllerConfiguration = new ModuleConfiguration();
* defaultControllerConfiguration.setName(defaultControllerName);
* defaultControllerConfiguration.setModuleType(ModuleConfiguration.
* ModuleTypes.Controller); defaultControllerConfiguration
* .setCompletePathToJar(configurations.getParameters().getProperty(
* "default.controller.jar"));
* defaultControllerConfiguration.setCompletePathToMainClass(
* getConfigurations().getParameters().getProperty(
* "default.controller.pathToMainClass"));
* configurations.getModulesConfiguration().put(defaultControllerName,
* defaultControllerConfiguration); defaultAdded = true; }
*/
String defaultConsoleName = getConfigurations().getParameters().getProperty("default.console.name");
ModuleConfiguration defaultConsoleConfiguration = configurations.getModulesConfiguration()
.get(defaultConsoleName);
if (defaultConsoleConfiguration == null) {
defaultConsoleConfiguration = new ModuleConfiguration();
defaultConsoleConfiguration.setName(defaultConsoleName);
defaultConsoleConfiguration.setModuleType(ModuleConfiguration.ModuleTypes.Client);
defaultConsoleConfiguration
.setCompletePathToJar(configurations.getParameters().getProperty("default.console.jar"));
defaultConsoleConfiguration.setCompletePathToMainClass(
configurations.getParameters().getProperty("default.console.pathToMainClass"));
configurations.getModulesConfiguration().put(defaultConsoleName, defaultConsoleConfiguration);
defaultAdded = true;
}
if (defaultAdded) {
saveConfigurations();
}
}
public static void saveConfigurations() {
JAXBProvider.marshalClassToFile(configurations, "Remolino.Configurations.xml");
/*
* if (configurations == null) { configurations = (Configurations)
* JAXBProvider.unmarshalFromFileOrCreate(Configurations.class,
* "Remolino.Configurations.xml"); }
*/
}
public static Configurations getConfigurations() {
if (configurations == null) {
configurations = (Configurations) JAXBProvider.unmarshalFromFileOrCreate(Configurations.class,
"Remolino.Configurations.xml");
loadDefaultModules();
}
return configurations;
}
public static void setConfigurations(Configurations configurations) {
if (configurations == null) {
Remolino.configurations = configurations;
}
}
public static HashMap<String, Module> getModules() {
if (modules == null) {
modules = new HashMap<String, Module>();
}
return modules;
}
public static boolean saveAllModulesData() {
logger.info("******* Saving Modules *******");
java.util.Iterator<Entry<String, Module>> iterator = getModules().entrySet().iterator();
while (iterator.hasNext()) {
Map.Entry pair = (Map.Entry) iterator.next();
Module module = (Module) pair.getValue();
module.saveModuleData();
logger.info("** " + module.getName() + " saved.");
}
JAXBProvider.marshalClassToFile(getConfigurations().getModulesConfiguration(), "ModulesController");
return true;
}
@Override
public void notify(StringHubFilterResult stringFilterResult) {
logger.info("*** notify Remolino: " + stringFilterResult.getClass().getCanonicalName());
switch (stringFilterResult.getRawStringMessage().toLowerCase()) {
case "console-command:rm shutdown": {
logger.info("*** Remolino shutting down modules normally");
shutdownModules();
logger.info("*** Remolino shutting down normally");
System.exit(0);
break;
}
case "console-command:rm save": {
saveModules();
break;
}
default: {
logger.warn(this.getClass().getCanonicalName() + " -> NOTIFIED BUT NOT USE -> "
+ stringFilterResult.getRawStringMessage());
}
}
}
@Override
public void initModule() {
}
@Override
public void shutdownModule() {
// TODO Auto-generated method stub
}
@Override
public void saveModuleData() {
// TODO Auto-generated method stub
}
@Override
public void execute() {
// TODO Auto-generated method stub
}
@Override
public void initModuleFilters() {
getOwnFilters().add(RemolinoCommandFilter.getInstance());
RemolinoCommandFilter.getInstance().addObserver(this);
}
}
| AtomicDisorder/remolino | remolino/src/main/java/com/atomicDisorder/remolino/Remolino.java | Java | gpl-3.0 | 12,441 |
package tmp.generated_cs;
import cide.gast.*;
import cide.gparser.*;
import cide.greferences.*;
import java.util.*;
public class jump_statement4 extends jump_statement {
public jump_statement4(return_statement return_statement, Token firstToken, Token lastToken) {
super(new Property[] {
new PropertyOne<return_statement>("return_statement", return_statement)
}, firstToken, lastToken);
}
public jump_statement4(Property[] properties, IToken firstToken, IToken lastToken) {
super(properties,firstToken,lastToken);
}
public IASTNode deepCopy() {
return new jump_statement4(cloneProperties(),firstToken,lastToken);
}
public return_statement getReturn_statement() {
return ((PropertyOne<return_statement>)getProperty("return_statement")).getValue();
}
}
| ckaestne/CIDE | CIDE_Language_CS/src/tmp/generated_cs/jump_statement4.java | Java | gpl-3.0 | 815 |
// Copyright 2004, 2005,2006,2007,2008 Koblo http://koblo.com
//
// This file is part of the Koblo SDK.
//
// the Koblo SDK is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// the Koblo SDK 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 General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with the Koblo Stools. If not, see <http://www.gnu.org/licenses/>.
class CX3DisplayConverter : public virtual de::IDisplayConverter
{
public:
CX3DisplayConverter();
virtual ~CX3DisplayConverter();
virtual void Destroy();
//! IDisplayConverter override
virtual void Value2String(tint32 iValue, tchar* psz);
//! IDisplayConverter override
virtual tint32 String2Value(const tchar* psz) throw (IException*);
//! IDisplayConverter override
virtual void SetPostFix(const tchar* psz);
//! IDisplayConverter override
virtual void AddFixedString(tint32 iValue, const tchar* psz);
protected:
de::IDisplayConverter* mpConverter;
};
| onozuka/koblo_software | Products/Koblo_Studio/trunk/include/CX3DisplayConverter.h | C | gpl-3.0 | 1,335 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.