answer stringlengths 15 1.25M |
|---|
<!DOCTYPE HTML PUBLIC "-
<!--NewPage
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_07) on Tue Jul 27 14:07:51 GMT-03:00 2010 -->
<TITLE>
Uses of Package entities.category
</TITLE>
<META NAME="date" CONTENT="2010-07-27">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Uses of Package entities.category";
}
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<HR>
<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"> <FONT CLASS="NavBarFont1">Class</FONT> </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="../../index-files/index-1.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>
</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?entities/category/package-use.html" target="_top"><B>FRAMES</B></A>
<A HREF="package-use.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>
<HR>
<CENTER>
<H2>
<B>Uses of Package<br>entities.category</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="../../entities/category/package-summary.html">entities.category</A></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><A HREF="#database.objects.category"><B>database.objects.category</B></A></TD>
<TD> </TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><A HREF="#database.objects.parameter"><B>database.objects.parameter</B></A></TD>
<TD> </TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><A HREF="#entities.measuretype"><B>entities.measuretype</B></A></TD>
<TD> </TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><A HREF="#entities.parameter"><B>entities.parameter</B></A></TD>
<TD> </TD>
</TR>
</TABLE>
<P>
<A NAME="database.objects.category"></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
Classes in <A HREF="../../entities/category/package-summary.html">entities.category</A> used by <A HREF="../../database/objects/category/package-summary.html">database.objects.category</A></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><B><A HREF="../../entities/category/class-use/Category.html#database.objects.category"><B>Category</B></A></B>
<BR>
</TD>
</TR>
</TABLE>
<P>
<A NAME="database.objects.parameter"></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
Classes in <A HREF="../../entities/category/package-summary.html">entities.category</A> used by <A HREF="../../database/objects/parameter/package-summary.html">database.objects.parameter</A></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><B><A HREF="../../entities/category/class-use/Category.html#database.objects.parameter"><B>Category</B></A></B>
<BR>
</TD>
</TR>
</TABLE>
<P>
<A NAME="entities.measuretype"></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
Classes in <A HREF="../../entities/category/package-summary.html">entities.category</A> used by <A HREF="../../entities/measuretype/package-summary.html">entities.measuretype</A></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><B><A HREF="../../entities/category/class-use/Category.html#entities.measuretype"><B>Category</B></A></B>
<BR>
</TD>
</TR>
</TABLE>
<P>
<A NAME="entities.parameter"></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
Classes in <A HREF="../../entities/category/package-summary.html">entities.category</A> used by <A HREF="../../entities/parameter/package-summary.html">entities.parameter</A></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><B><A HREF="../../entities/category/class-use/Category.html#entities.parameter"><B>Category</B></A></B>
<BR>
</TD>
</TR>
</TABLE>
<P>
<HR>
<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="<API key>"></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"> <FONT CLASS="NavBarFont1">Class</FONT> </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="../../index-files/index-1.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>
</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?entities/category/package-use.html" target="_top"><B>FRAMES</B></A>
<A HREF="package-use.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>
<HR>
</BODY>
</HTML> |
// Use of this file is subject to the terms
// accompanies this file.
// Your use of this file indicates your
// acceptance of the terms described in
#ifndef _FREEBT_DEV_H
#define _FREEBT_DEV_H
#ifdef __cplusplus
extern "C" {
#endif
NTSTATUS <API key>(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp);
NTSTATUS <API key>(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp);
NTSTATUS <API key>(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp);
NTSTATUS FreeBT_ResetPipe(IN PDEVICE_OBJECT DeviceObject, IN USBD_PIPE_HANDLE PipeInfo);
NTSTATUS FreeBT_ResetDevice(IN PDEVICE_OBJECT DeviceObject);
NTSTATUS <API key>(IN PDEVICE_OBJECT DeviceObject, IN PULONG PortStatus);
NTSTATUS <API key>(IN IN PDEVICE_OBJECT DeviceObject);
NTSTATUS <API key>(IN PDEVICE_EXTENSION DeviceExtension);
VOID <API key>(IN PDEVICE_EXTENSION DeviceExtension);
NTSTATUS <API key>(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp,
IN PDEVICE_EXTENSION DeviceExtension);
VOID CancelSelectSuspend(IN PDEVICE_EXTENSION DeviceExtension);
VOID PoIrpCompletionFunc(
IN PDEVICE_OBJECT DeviceObject,
IN UCHAR MinorFunction,
IN POWER_STATE PowerState,
IN PVOID Context,
IN PIO_STATUS_BLOCK IoStatus);
VOID <API key>(
IN PDEVICE_OBJECT DeviceObject,
IN UCHAR MinorFunction,
IN POWER_STATE PowerState,
IN PVOID Context,
IN PIO_STATUS_BLOCK IoStatus);
VOID WWIrpCompletionFunc(
IN PDEVICE_OBJECT DeviceObject,
IN UCHAR MinorFunction,
IN POWER_STATE PowerState,
IN PVOID Context,
IN PIO_STATUS_BLOCK IoStatus);
#ifdef __cplusplus
};
#endif
#endif |
#ifndef <API key>
#define <API key>
// Module
#include "Joint.h"
namespace love
{
namespace physics
{
namespace box2d
{
/**
* A RevoluteJoint allows two bodies relative rotation
* around a single point.
**/
class RevoluteJoint : public Joint
{
public:
/**
* Creates a new RevoluteJoint connecting body1 and body2.
**/
RevoluteJoint(Body *body1, Body *body2, float x, float y, bool collideConnected);
virtual ~RevoluteJoint();
/**
* Get the current joint angle in degrees.
**/
float getJointAngle() const;
/**
* Get the current joint angle speed in degrees per second.
**/
float getJointSpeed() const;
/**
* Enable/disable the joint motor.
**/
void setMotorEnabled(bool enable);
/**
* Checks whether the motor is enabled.
**/
bool isMotorEnabled() const;
/**
* Set the maximum motor torque, usually in N-m.
**/
void setMaxMotorTorque(float torque);
/**
* Sets the motor speed in radians per second.
**/
void setMotorSpeed(float speed);
/**
* Gets the motor speed in radians per second.
**/
float getMotorSpeed() const;
/**
* Get the current motor torque, usually in N-m.
* @param inv_dt The inverse timestep.
**/
float getMotorTorque(float inv_dt) const;
/**
* Get the maximum motor torque, usually in N-m.
**/
float getMaxMotorTorque() const;
/**
* Enable/disable the joint limit.
**/
void setLimitsEnabled(bool enable);
/**
* Checks whether limits are enabled.
**/
bool hasLimitsEnabled() const;
/**
* Sets the upper limit in degrees.
**/
void setUpperLimit(float limit);
/**
* Sets the lower limit in degrees.
**/
void setLowerLimit(float limit);
/**
* Sets the limits in degrees.
**/
void setLimits(float lower, float upper);
/**
* Gets the lower limit in degrees.
**/
float getLowerLimit() const;
/**
* Gets the upper limit in degrees.
**/
float getUpperLimit() const;
/**
* Gets the limits in degrees.
* @returns The lower limit.
* @returns The upper limit.
**/
int getLimits(lua_State *L);
private:
// The Box2D revolute joint object.
b2RevoluteJoint *joint;
};
} // box2d
} // physics
} // love
#endif // <API key> |
<?php
namespace Claroline\CoreBundle\Form;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\<API key>;
use Symfony\Component\OptionsResolver\<API key>;
class <API key> extends AbstractType
{
private $withLock = false;
public function __construct($withLock = false)
{
$this->withLock = $withLock;
}
public function buildForm(<API key> $builder, array $options)
{
$builder->add('visible', 'checkbox', array('label' => 'visible'));
if ($this->withLock) {
$builder->add('locked', 'checkbox', array('label' => 'locked'));
}
}
public function getName()
{
return '<API key>';
}
public function setDefaultOptions(<API key> $resolver)
{
$resolver->setDefaults(array('translation_domain' => 'platform'));
}
} |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http:
<head><title>closeAllDatabases — MongoDB Manual 2.4.3</title><link rel="shortcut icon" href="http://media.mongodb.org/favicon.ico" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="robots" content="index" />
<meta name="release" content="2.4.3"/>
<meta name="DC.Source" content="https://github.com/mongodb/docs/blob/master/source/reference/command/closeAllDatabases.txt"/>
<link rel="canonical" href="http://docs.mongodb.org/manual/reference/command/closeAllDatabases" />
<link rel="stylesheet" href="../../_static/mongodb-docs.css" type="text/css" />
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
<script type="text/javascript">
var <API key> = {
URL_ROOT: '../../',
VERSION: '2.4',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: false,
};
</script>
<script type="text/javascript" src="../../_static/jquery.js"></script>
<script type="text/javascript" src="../../_static/underscore.js"></script>
<script type="text/javascript" src="../../_static/doctools.js"></script>
<link rel="search" type="application/<API key>+xml" href="http://docs.mongodb.org/osd.xml" title="MongoDB Help"/>
<link rel="author" title="About these documents" href="../../about.html" />
<link rel="top" title="MongoDB Manual" href="../../index.html" />
<link rel="up" title="Administration Commands" href="nav-administration.html" />
<link rel="next" title="collMod" href="collMod.html" />
<link rel="prev" title="clone" href="clone.html" />
<script>
(function() {
var cx = '<API key>:WMX6838984';
var gcse = document.createElement('script'); gcse.type = 'text/javascript'; gcse.async = true;
gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + '
var s = document.<API key>('script')[0]; s.parentNode.insertBefore(gcse, s);
})();
</script></head>
<body>
<div id="header-db" class="spread">
<div class="split">
<div id="logo">
<div><a href="http:
</div>
</div>
</div>
<div class="document">
<div class="documentwrapper"><div class="bodywrapper">
<div class="body">
<div class="bc">
<ul>
<li><a href="../../reference.html">Reference</a><span class="bcpoint"> > </span></li>
<li><a href="../command.html">Database Commands</a><span class="bcpoint"> > </span></li>
<li><a href="nav-administration.html">Administration Commands</a><span class="bcpoint"> > </span></li>
<li>closeAllDatabases</li>
</ul>
</div>
<div id="cse-results">
<gcse:searchresults linkTarget="_top"></gcse:searchresults>
</div>
<div class="section" id="closealldatabases">
<h1>closeAllDatabases<a class="headerlink" href="
<dl class="dbcommand">
<dt id="dbcmd.closeAllDatabases">
<tt class="descname">closeAllDatabases</tt><a class="headerlink" href="
<dd><p><tt class="xref mongodb mongodb-dbcommand docutils literal"><span class="pre">closeAllDatabases</span></tt> is an internal command that
invalidates all cursors and closes the open database files. The
next operation that uses the database will reopen the file.</p>
<div class="admonition warning">
<p class="first admonition-title">Warning</p>
<p class="last">This command obtains a global write lock and will block other
operations until it has completed.</p>
</div>
</dd></dl>
</div>
<div id="btnv">
<ul id="btnvl">
<li id="btnvpr"><a href="clone.html" title="Previous Section: clone">< clone</a></li>
<li id="btnvup"><a href="../../reference.html" title="Parent Section: Reference" >/\ Reference</a></li>
<li id="btnvnx"><a href="collMod.html" title="Next Section: collMod">collMod ></a></li>
</ul>
</div></div></div>
</div>
<div class="sphinxsidebar">
<div class="<API key>">
<h3>
<a href="../../index.html">MongoDB Manual</a> <span id="vn">2.4</span>
</h3>
<div class="site-contents"><a href="../../contents.html">Contents</a></div>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../installation.html">Install MongoDB</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../administration.html">Administration</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../security.html">Security</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../crud.html">Core MongoDB Operations (CRUD)</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../data-modeling.html">Data Modeling</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../aggregation.html">Aggregation</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../indexes.html">Indexes</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../replication.html">Replication</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../sharding.html">Sharding</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../applications.html">Application Development</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../mongo.html">The <tt class="docutils literal"><span class="pre">mongo</span></tt> Shell</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../use-cases.html">Use Cases</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../faq.html">Frequently Asked Questions</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="../../reference.html">Reference</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="../operator.html">Query, Update and Projection Operators</a></li>
<li class="toctree-l2 current"><a class="reference internal" href="../command.html">Database Commands</a><ul class="current">
<li class="toctree-l3"><a class="reference internal" href="nav-aggregation.html">Aggregation Commands</a></li>
<li class="toctree-l3"><a class="reference internal" href="nav-geospatial.html">Geospatial Commands</a></li>
<li class="toctree-l3"><a class="reference internal" href="nav-crud.html">Query and Write Operation Commands</a></li>
<li class="toctree-l3"><a class="reference internal" href="nav-replication.html">Replication Commands</a></li>
<li class="toctree-l3"><a class="reference internal" href="nav-sharding.html">Sharding Commands</a></li>
<li class="toctree-l3 current"><a class="reference internal" href="nav-administration.html">Administration Commands</a><ul class="current">
<li class="toctree-l4"><a class="reference internal" href="clean.html">clean</a></li>
<li class="toctree-l4"><a class="reference internal" href="<API key>.html"><API key></a></li>
<li class="toctree-l4"><a class="reference internal" href="cloneCollection.html">cloneCollection</a></li>
<li class="toctree-l4"><a class="reference internal" href="clone.html">clone</a></li>
<li class="toctree-l4 current"><a class="current reference internal" href="">closeAllDatabases</a></li>
<li class="toctree-l4"><a class="reference internal" href="collMod.html">collMod</a></li>
<li class="toctree-l4"><a class="reference internal" href="compact.html">compact</a></li>
<li class="toctree-l4"><a class="reference internal" href="connPoolSync.html">connPoolSync</a></li>
<li class="toctree-l4"><a class="reference internal" href="convertToCapped.html">convertToCapped</a></li>
<li class="toctree-l4"><a class="reference internal" href="copydb.html">copydb</a></li>
<li class="toctree-l4"><a class="reference internal" href="create.html">create</a></li>
<li class="toctree-l4"><a class="reference internal" href="dropDatabase.html">dropDatabase</a></li>
<li class="toctree-l4"><a class="reference internal" href="dropIndexes.html">dropIndexes</a></li>
<li class="toctree-l4"><a class="reference internal" href="drop.html">drop</a></li>
<li class="toctree-l4"><a class="reference internal" href="filemd5.html">filemd5</a></li>
<li class="toctree-l4"><a class="reference internal" href="fsync.html">fsync</a></li>
<li class="toctree-l4"><a class="reference internal" href="getParameter.html">getParameter</a></li>
<li class="toctree-l4"><a class="reference internal" href="logRotate.html">logRotate</a></li>
<li class="toctree-l4"><a class="reference internal" href="reIndex.html">reIndex</a></li>
<li class="toctree-l4"><a class="reference internal" href="renameCollection.html">renameCollection</a></li>
<li class="toctree-l4"><a class="reference internal" href="repairDatabase.html">repairDatabase</a></li>
<li class="toctree-l4"><a class="reference internal" href="setParameter.html">setParameter</a></li>
<li class="toctree-l4"><a class="reference internal" href="shutdown.html">shutdown</a></li>
<li class="toctree-l4"><a class="reference internal" href="touch.html">touch</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="nav-diagnostic.html">Diagnostic Commands</a></li>
<li class="toctree-l3"><a class="reference internal" href="nav-internal.html">Internal Commands</a></li>
<li class="toctree-l3"><a class="reference internal" href="nav-testing.html">Testing Commands</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../method.html"><tt class="docutils literal"><span class="pre">mongo</span></tt> Shell Methods</a></li>
<li class="toctree-l2"><a class="reference internal" href="../sql-comparison.html">SQL to MongoDB Mapping Chart</a></li>
<li class="toctree-l2"><a class="reference internal" href="../program.html">MongoDB Package Components</a></li>
<li class="toctree-l2"><a class="reference internal" href="../local-database.html">The <tt class="docutils literal"><span class="pre">local</span></tt> Database</a></li>
<li class="toctree-l2"><a class="reference internal" href="../system-collections.html">System Collections</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database-profiler.html">Database Profiler Output</a></li>
<li class="toctree-l2"><a class="reference internal" href="../exit-codes.html">Exit Codes and Statuses</a></li>
<li class="toctree-l2"><a class="reference internal" href="../limits.html">MongoDB Limits and Thresholds</a></li>
<li class="toctree-l2"><a class="reference internal" href="../connection-string.html">Connection String URI Format</a></li>
<li class="toctree-l2"><a class="reference internal" href="../<API key>.html">MongoDB Extended JSON</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database-references.html">Database References</a></li>
<li class="toctree-l2"><a class="reference internal" href="../gridfs.html">GridFS Reference</a></li>
<li class="toctree-l2"><a class="reference internal" href="../glossary.html">Glossary</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../release-notes.html">Release Notes</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../about.html">About MongoDB Documentation</a></li>
</ul>
<div class="site-index"><a href="../../genindex.html">Index</a></div>
<h3>Formats</h3>
<ul class="this-page-menu">
<li><a href="/manual/single/">MongoDB Manual, Single HTML Page</a></li>
<li><a href="http://docs.mongodb.org/master/<API key>.pdf" rel="nofollow">MongoDB Manual, PDF Format</a></li>
<li><a href="http://docs.mongodb.org/master/<API key>.epub" rel="nofollow">MongoDB Manual, ePub Format</a></li>
</ul>
<h3><a href="http:
<ul>
<li><a href="http:
<li><a href="http:
<li><a href="http://mongodb.org/about/community/masters">MongoDB Masters</a></li>
<li><a href="http://planet.mongodb.org">Planet MongoDB</a></li>
</ul>
<h3><a href="http://docs.mongodb.org/ecosystem/">MongoDB Ecosystem</a></h3>
<ul>
<li><a href="http://docs.mongodb.org/ecosystem/drivers/">Drivers and Client libraries</a>
<ul>
<li><a href="http:
<li><a href="http:
<li><a href="http://docs.mongodb.org/ecosystem/drivers/csharp">C
<li><a href="http:
<li><a href="http:
<li><a href="http:
<li><a href="http:
<li><a href="http:
<li><a href="http:
<li><a href="http:
<li><a href="http:
<li><a href="http:
</ul>
</li>
<li><a href="http://docs.mongodb.org/ecosystem/tools/">Tools and Integration</a></li>
<li><a href="http://docs.mongodb.org/ecosystem/platforms/">Platform Integration</a></li>
</ul><h3>MongoDB Resources</h3>
<ul>
<li><a href="http:
<li><a href="http:
<li><a href="http:
<li><a href="http:
</ul>
</div>
</div>
<div class="clearer"></div>
</div><div id="top-right">
<div class="user-right">
<ul id="header-menu-bar" class="ajs-menu-bar">
<li class="normal"><a target="_blank" href="http://groups.google.com/group/mongodb-user">Forums</a></li>
<li class="normal"><a target="_blank" href="http://blog.mongodb.org/">Blog</a></li>
<li class="normal"><a href="http:
<li class="normal"><a href="http://docs.mongodb.org/ecosystem/drivers/">Drivers</a></li>
<li class="normal"><a href="http:
<li class="normal last"><a class="last" href="http://docs.mongodb.org/manual/meta/translation">Translations</a></li>
</ul>
</div>
</div>
<div class="search-db"><gcse:searchbox></gcse:searchbox></div>
<div id="etp">
<ul>
<li><a href="https://github.com/mongodb/docs/blob/master/source/reference/command/closeAllDatabases.txt" target="_blank" title="Edit reference/command/closeAllDatabases.txt on GitHub">Edit this Page</a></li>
<li><a href="http://github.com/mongodb/docs" target="_blank" title="Fork the documentation on GitHub and contribute.">GitHub</a></li>
<li><a id="jirafeedback" href="https://jira.mongodb.org/secure/CreateIssueDetails!init.jspa?pid=10380&issuetype=4&priority=4&summary=Comment+on%3a+%22reference/command/closeAllDatabases%2Etxt%22" target="_blank" title="Report a problem with reference/command/closeAllDatabases.txt on Jira">Report a Problem</a></li>
</ul>
</div>
<div class="footer">
<p>
© <a href="">Copyright</a> 2011-2013, 10gen, Inc.
MongoDB®, Mongo®, and the leaf logo are registered trademarks of <a href="http:
</p>
</div><script type="text/javascript">
var _gaq = _gaq || [];
var pluginUrl = (('https:' == document.location.protocol) ? 'https:
_gaq.push(['_require', 'inpage_linkid', pluginUrl]);
_gaq.push(['_setAccount', 'UA-7301842-8']);
_gaq.push(['_setDomainName', 'docs.mongodb.org']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https:
var s = document.<API key>('script')[0];
s.parentNode.insertBefore(ga, s);
})();
</script>
<script type="text/javascript">var _kiq = _kiq || [];</script>
<script type="text/javascript">
(function(){
setTimeout(function(){ var d = document, f = d.<API key>('script')[0], s = d.createElement('script'); s.type = 'text/javascript'; s.async = true; s.src = '//s3.amazonaws.com/ki.js/49119/a7n.js'; f.parentNode.insertBefore(s, f); }, 1);
})();
</script>
<script>
(function(i,s,o,g,r,a,m){i['<API key>']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.<API key>(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','
ga('create', 'UA-7301842-14', 'mongodb.org');
ga('send', 'pageview');
</script>
<script type="text/javascript">
document.write(unescape("%3Cscript src='" + document.location.protocol + "//munchkin.marketo.net/munchkin.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script>try { mktoMunchkin("017-HGS-593"); } catch(e) {}</script><script type="text/javascript">
jQuery.ajax({
url: "https://jira.mongodb.org/s/en_UScn8g8x/782/6/1.2.5/_/download/batch/com.atlassian.jira.collector.plugin.<API key>:<API key>/com.atlassian.jira.collector.plugin.<API key>:<API key>.js?collectorId=298ba4e7",
type: "get",
cache: true,
dataType: "script"
});
window.ATL_JQ_PAGE_PROPS = {
"triggerFunction": function(showCollectorDialog) {
jQuery("#jirafeedback").click(function(e) {e.preventDefault();showCollectorDialog();});},
fieldValues: {component: 'mongodb-manual', summary: 'Comment on: "manual/reference/command/closeAllDatabases.txt"'},
environment: {'repo': 'docs','source': 'reference/command/closeAllDatabases'}
};
</script><script type="text/javascript">
var versions = [{'t': '2.4 (current)', 'v': 'v2.4'}, {'t': '2.2', 'v': 'v2.2'}]
var pagename = 'reference/command/closeAllDatabases'
var stable = 'v2.4'
function vfnav() {
if ( pagename=='index' ) {
pn = ''
}
else {
pn = pagename
}
v = $(this).children("option:selected").attr('value')
if ( (v==0) || (v==stable) ) {
uri = '/manual/' + pn
}
else {
uri = '/' + v + '/' + pn
}
window.location.href= uri;
}
$(document).ready(function(){
$("#vn").html(function(){
s=$("<select/>");
o='<option/>';
$.each(versions,function(index, version) {
if ( version.v==stable ) {
dv=true;
}
$(o,{value:version.v,text: version.t}).appendTo(s);
});
if ( dv==false ) {
$(o, {value:0,text:'(stable)'}).appendTo(s);
}
return(s);
});
$("#vn select").bind('change', vfnav);
$('#vn select').val('v2.4');
});
</script>
</body>
</html> |
package com.github.situx.postagger.main.gui.ime.descriptor;
import com.github.situx.postagger.main.gui.ime.jquery.<API key>;
import java.awt.*;
public interface <API key> {
/**
* @return
* @see Component#getInputContext()
*/
public <API key> getInputContext();
/**
* Comes for free with any Component.
* Useful to have accsssible on the interface.
* @return the Font
* @see Component#getFont
*/
public Font getFont();
} |
// Aeira
// Bookstore Owner
public class AeiraScript : NpcScript
{
public override void Load()
{
SetRace(10001);
SetName("_aeira");
SetBody(height: 0.8f);
SetFace(skinColor: 16, eyeType: 2, eyeColor: 27, mouthType: 1);
SetStand("human/female/anim/<API key>");
SetLocation(14, 44978, 43143, 158);
EquipItem(Pocket.Face, 3900, 0x0090CEF1, 0x00006B55, 0x006E6162);
EquipItem(Pocket.Hair, 3022, 0x00664444, 0x00664444, 0x00664444);
EquipItem(Pocket.Armor, 15042, 0x00EBAE98, 0x00354E34, 0x00E3E4EE);
EquipItem(Pocket.Shoe, 17024, 0x00A0505E, 0x00F8784F, 0x00006E41);
EquipItem(Pocket.Head, 18028, 0x00746C54, 0x00C0C0C0, 0x00007C8C);
AddGreeting(0, "I'm sorry, but your name is...?<br/>Mmm? <username/>? Nice to meet you.");
AddGreeting(1, "Hahaha. I... Umm... I think I've met you before...<br/>Your name was...<br/>Oh, I'm sorry, <username/>. My mind went blank for a second. Hehehe.");
AddPhrase("*cough* The books are too dusty...");
AddPhrase("*Whistle*");
AddPhrase("Hahaha.");
AddPhrase("Hmm. I can't really see...");
AddPhrase("Hmm. The Bookstore is kind of small.");
AddPhrase("I wonder if this book would sell?");
AddPhrase("I wonder what Stewart is up to?");
AddPhrase("Kristell... She's unfair.");
AddPhrase("Oh, hello!");
AddPhrase("Umm... So...");
AddPhrase("Whew... I should just finish up the transcription.");
}
protected override async Task Talk()
{
SetBgm("NPC_Aeira.mp3");
await Intro(
"This girl seems to be in her late teens with big thick glasses resting at the tip of her nose.",
"Behind the glasses are two large brown eyes shining brilliantly.",
"Wearing a loose-fitting dress, she has a ribbon made of soft and thin material around her neck."
);
Msg("So, what can I help you with?", Button("Start a Conversation", "@talk"), Button("Shop", "@shop"));
switch (await Select())
{
case "@talk":
Greet();
Msg(Hide.Name, GetMoodString(), FavorExpression());
if (Title == 11002)
Msg("Wow... <username/>, you really<br/>rescued Erinn?<br/>I wasn't sure before, but you really are an amazing person.<br/>Please continue to watch over my Bookstore!");
await Conversation();
break;
case "@shop":
Msg("Welcome to the Bookstore.");
OpenShop("AeiraShop");
return;
}
End("Thank you, <npcname/>. I'll see you later!");
}
protected override async Task Keywords(string keyword)
{
switch (keyword)
{
case "personal_info":
if (Memory == 1)
{
Msg("My name? It's <npcname/>. We've never met before, have we?");
ModifyRelation(1, 0, Random(2));
}
else
{
GiveKeyword("shop_bookstore");
Msg(FavorExpression(), "Hehehe... I may not look the part, but I own this Bookstore.<br/>It's okay to be casual, but<br/>at least give me some respect as a store owner.");
ModifyRelation(Random(2), 0, Random(2));
}
break;
case "rumor":
GiveKeyword("school");
Msg(FavorExpression(), "If you want to properly train the stuff that's written on the book,<br/>why don't you first read the book in detail, then visit the school?<br/>Oh, and don't forget to talk to Stewart when you're there.");
ModifyRelation(Random(2), 0, Random(2));
break;
case "about_skill":
Msg("I've talked a lot with other people regarding skills, but<br/>you seem be very knowledgeable about music,<username/>.<br/>I'm impressed. Hahaha.");
break;
case "about_arbeit":
Msg("Unimplemented");
break;
case "shop_misc":
Msg("Hmm. The General Shop?<br/>That's where my father works at!<br/>To get to the General Shop,<br/>keep going straight towards the Square.");
Msg("The shop is reasonably priced, with plenty of quality items...<br/>And there's just about everything you may be looking for,<br/>so don't forget to pay a visit! Hehe.");
break;
case "shop_grocery":
GiveKeyword("shop_restaurant");
Msg("A grocery store?<br/>In this town, you can find the food ingredients at the Restaurant, too,<br/>so try going there instead.");
break;
case "shop_healing":
Msg("A healer? That would be Manus! You're looking for Manus' place!<br/>His house is down there.<br/>Head south along the main road to the Square.");
break;
case "shop_inn":
GiveKeyword("skill_campfire");
Msg("Oh, no. There is no inn in our town.<br/>There's really no good place to rest either.<br/>Why don't you stay with people who can use the Campfire skill for now?");
break;
case "shop_bank":
Msg("Are you looking for Austeyn?<br/>The Bank is on the west end of the Square.<br/>You should be able to spot the sign easily.");
Msg("Go there right now!");
break;
case "shop_smith":
Msg("Do we have a blacksmith's shop in this town? I think Nerys might know.<br/>It's just that I've never seen Nerys hammering<br/>or using the bellow.");
Msg("You might want to go visit the Weapons Shop first.");
break;
case "skill_range":
Msg("Hmm. A long range attack is...!");
Msg("It's a way of attacking a hostile<br/>enemy at a certain distance by using<br/>devices such as a bow, spear, spells, etc...");
Msg("Oh, pardon me.<br/>I got excited whenever I hear something I know.");
break;
case "skill_instrument":
Msg("Hehe... I guess I'm not very good at something like that.");
Msg("But those who bought instruments at my father's General Shop<br/>quickly picked it up after playing it only a few times.");
break;
case "skill_tailoring":
Msg("Why don't you go ask Simon?<br/>It would also help to buy a Tailoring Kit from my father's shop.");
break;
case "skill_gathering":
Msg("There was a time when I followed Stewart around<br/>to pick herbs all over the town.<br/>It was so much fun!");
break;
case "square":
Msg("The Square is right over there<br/>through the alley.");
break;
case "farmland":
Msg("The farmland is near here but everyone is stressed out over<br/>all the rats that are showing up there. Yuck!<br/>If you see them, please get them out of there.");
break;
case "brook":
Msg("Adelia Stream?<br/>Yes, I've heard of it.");
Msg("It's supposed to be a stream that flows near a town called Tir Chonaill,<br/>which is located just up north.");
Msg("I don't think it flows<br/>all the way down here, though.");
break;
case "shop_headman":
Msg("Hmm. Our town Chief?<br/>Never heard of one.<br/>Umm... Do we have one?");
break;
case "temple":
Msg("Oh...<br/>Church is located in the<br/>northwest part of town.");
break;
case "school":
Msg("The School is up there! Head straight up and you'll see it.<br/>If you have a good set of eyes, you could see it from here, too. Hehehe.");
Msg("Oh, if you get to go there,<br/>please see how Stewart is doing! Please.");
break;
case "skill_campfire":
Msg("Hmm.<br/>Sometimes there are novels<br/>that feature adventurers building a campfire.");
Msg("In the middle of the field, gazing upon twinkling stars,<br/>sitting around a bonfire that illuminates the darkness,<br/>enjoying the moment with others...<br/>It's all so romantic!");
Msg("Wait a minute... Did I order the books on campfire?");
break;
case "shop_restaurant":
Msg("The Restaurant? You must be talking about Glenis' place.<br/>All you need to do is go straight to the Square.");
Msg("While you are on the way, make sure to<br/>visit the General Shop, too. Tee hee.");
break;
case "shop_armory":
Msg("The Weapons Shop is over there by the south entrance.<br/>Nerys is usually outside the store so ask her.");
Msg("By the way, weapons or armor here might be<br/>really expensive...");
break;
case "shop_cloth":
Msg("The Clothing Shop? You can find it at the Square.<br/>How do you like what I'm wearing? I bought this there, too.");
Msg("I like the clothes there so much that I bought several more from them!");
break;
case "shop_bookstore":
Msg("Yes, this is the Bookstore! Ta-da!<br/>Feel free to look around, and press the 'Shop' button when you're ready.");
Msg("I know this place isn't that big so you may not find the book you like,<br/>but we often bring in new shipments so don't be too disappointed<br/>if you can't find what you like today, okay?");
break;
case "<API key>":
Msg("The Town Office? Are you looking for Eavan?<br/>Are you close friends with her?<br/>What's the relationship between you two?");
Msg("Oh, nothing. It's just strange to see someone<br/>who's looking for someone who's as cold as ice. Hehe.<br/>...");
break;
default:
RndFavorMsg(
"...?",
"Oh... Umm... That... I don't know.",
"I'm not sure I know. Maybe Stewart knows.",
"I don't know too much about that. Sorry...",
"I don't really understand what you just said...",
"Yeah, but... I don't really know anything about that.",
"Hahaha. Well, it's not really my area of expertise...",
"I don't know much about it, but let me know if you find out more.",
"I'm not sure exactly what that is but it seems important,<br/>seeing how so many people inquire about it..."
);
ModifyRelation(0, 0, Random(2));
break;
}
}
}
public class AeiraShop : NpcShopScript
{
public override void Setup()
{
Add("Skill Book", 1006); // Introduction to Music Composition
Add("Skill Book", 1012); // Campfire Manual
Add("Skill Book", 1505); // The World of Handicrafts
Add("Skill Book", 1302); // Your first Glass of Wine Vol. 1
Add("Skill Book", 1303); // Your first Glass of Wine Vol. 2
Add("Skill Book", 1011); // Improving Your Composing Skill
Add("Skill Book", 1304); // Wine for the Everyman
Add("Skill Book", 1018); // The History of Music in Erinn (1)
Add("Skill Book", 1305); // Tin's Liquor Drop
Add("Skill Book", 1083); // Campfire Skill: Beyond the Kit
Add("Skill Book", 1064); // Master Chef's Cooking Class: Baking
Add("Skill Book", 1065); // Master Chef's Cooking Class: Simmering
Add("Skill Book", 1019); // The History of Music in Erinn (2)
Add("Skill Book", 1066); // About Kneading
Add("Skill Book", 1020); // Composition Lessons with Helene (1)
Add("Skill Book", 1123); // The Great Camping Companion: Camp Kit
Add("Skill Book", 1007); // Healing: The Basics of Magic
Add("Skill Book", 1029); // A Campfire Memory
Add("Skill Book", 1114); // The History of Music in Erinn (3)
Add("Skill Book", 1111); // The Path of Composing
Add("Skill Book", 1013); // Music Theory
Add("Life Skill Book", 1055); // The Road to Becoming a Magic Warrior
Add("Life Skill Book", 1056); // How to Enjoy Field Hunting
Add("Life Skill Book", 1092); // Enchant, Another Mysterious Magic
Add("Life Skill Book", 1124); // An Easy Guide to Taking Up Residence in a Home
Add("Life Skill Book", 1102); // Your Pet
Add("Life Skill Book", 1052); // How to milk a Cow
Add("Life Skill Book", 1050); // An Unempolyed Man's Memoir of Clothes
Add("Life Skill Book", 1040); // Facial Expressions Require Practice too
Add("Life Skill Book", 1046); // Fire Arrow, The Ultimate Archery
Add("Life Skill Book", 1021); // The Tir Chonaill Environs
Add("Life Skill Book", 1022); // The Dunbarton Environs
Add("Life Skill Book", 1043); // Wizards Love the Dark
Add("Life Skill Book", 1057); // Introduction to Field Bosses
Add("Life Skill Book", 1058); // Understanding Whisps
Add("Life Skill Book", 1015); // Seal Stone Research Almanac: Rabbie Dungeon
Add("Life Skill Book", 1016); // Seal Stone Research Almanac: Ciar Dungeon
Add("Life Skill Book", 1017); // Seal Stone Research Almanac: Dugald Aisle
Add("Life Skill Book", 1033); // Guidebook for Dungeon Exploration - Theory
Add("Life Skill Book", 1034); // Guidebook for Dungeon Exploration - Practicum
Add("Life Skill Book", 1035); // An Adventurer's Memoir
Add("Life Skill Book", 1077); // Wanderer of the Fiodh Forest
Add("Life Skill Book", 1090); // How Am I Going to Survive Like This?
Add("Life Skill Book", 1031); // Understanding Elementals
Add("Life Skill Book", 1036); // Records of the Bangorr Seal Stone Investigation
Add("Life Skill Book", 1072); // Cooking on Your Own Vol. 1
Add("Life Skill Book", 1073); // Cooking on Your Own Vol. 2
Add("Literature", 1023); // The Story of Spiral Hill
Add("Literature", 1025); // Mystery of the Dungeon
Add("Literature", 1026); // A Report on Astralium
Add("Literature", 1027); // I Hate Cuteness
Add("Literature", 1028); // Tracy's Secret
Add("Literature", 1032); // The Shadow Mystery
Add("Literature", 1140); // It's a 'paper airplane' that flies.
Add("Literature", 1001); // The Story of a White Doe
Add("Literature", 1059); // A Campfire Story
Add("Literature", 1060); // Imp's Diary
Add("Literature", 1061); // The Tale of Ifan the Rich
Add("Literature", 1042); // Animal-loving Healer
Add("Literature", 1103); // The Story of a Lizard
Add("Literature", 1104); // The Origin of Moon Gates
Add("Literature", 74028); // The Forgotten Legend of Fiodh Forest
Add("Literature", 74029); // The Tragedy of Emain Macha
Add("Literature", 74027); // The Knight of Light Lugh, The Hero of Mag Tuireadh
}
} |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http:
<html xmlns="http:
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>url_encode — TwigDocs 1.15 documentation</title>
<link rel="stylesheet" href="../_static/default.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<script type="text/javascript">
var <API key> = {
URL_ROOT: '../',
VERSION: '1.15',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="../_static/jquery.js"></script>
<script type="text/javascript" src="../_static/underscore.js"></script>
<script type="text/javascript" src="../_static/doctools.js"></script>
<link rel="top" title="TwigDocs 1.15 documentation" href="../index.html" />
<link rel="up" title="Filters" href="index.html" />
<link rel="next" title="Functions" href="../functions/index.html" />
<link rel="prev" title="trim" href="trim.html" />
</head>
<body>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="../functions/index.html" title="Functions"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="trim.html" title="trim"
accesskey="P">previous</a> |</li>
<li><a href="../index.html">TwigDocs 1.15 documentation</a> »</li>
<li><a href="index.html" accesskey="U">Filters</a> »</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<div class="section" id="url-encode">
<h1><tt class="docutils literal"><span class="pre">url_encode</span></tt><a class="headerlink" href="
<div class="versionadded">
<p><span class="versionmodified">New in version 1.12.3: </span>Support for encoding an array as query string was added in Twig 1.12.3.</p>
</div>
<p>The <tt class="docutils literal"><span class="pre">url_encode</span></tt> filter percent encodes a given string as URL segment
or an array as query string:</p>
<div class="highlight-jinja"><div class="highlight"><pre><span class="cp">{{</span> <span class="s2">"path-seg*ment"</span><span class="o">|</span><span class="nf">url_encode</span> <span class="cp">}}</span><span class="x"></span>
<span class="c">{# outputs "path-seg%2Ament" #}</span><span class="x"></span>
<span class="cp">{{</span> <span class="s2">"string with spaces"</span><span class="o">|</span><span class="nf">url_encode</span><span class="o">(</span><span class="kp">true</span><span class="o">)</span> <span class="cp">}}</span><span class="x"></span>
<span class="c">{# outputs "string%20with%20spaces" #}</span><span class="x"></span>
<span class="cp">{{</span> <span class="o">{</span><span class="s1">'param'</span><span class="o">:</span> <span class="s1">'value'</span><span class="o">,</span> <span class="s1">'foo'</span><span class="o">:</span> <span class="s1">'bar'</span><span class="o">}|</span><span class="nf">url_encode</span> <span class="cp">}}</span><span class="x"></span>
<span class="c">{# outputs "param=value&foo=bar" #}</span><span class="x"></span>
</pre></div>
</div>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">Internally, Twig uses the PHP <a class="reference external" href="http:
<tt class="docutils literal"><span class="pre">true</span></tt> as the first parameter) or the <a class="reference external" href="http://php.net/http_build_query">http_build_query</a> function.</p>
</div>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="<API key>">
<h4>Previous topic</h4>
<p class="topless"><a href="trim.html"
title="previous chapter"><tt class="docutils literal"><span class="pre">trim</span></tt></a></p>
<h4>Next topic</h4>
<p class="topless"><a href="../functions/index.html"
title="next chapter">Functions</a></p>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../_sources/filters/url_encode.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<h3>Quick search</h3>
<form class="search" action="../search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="../functions/index.html" title="Functions"
>next</a> |</li>
<li class="right" >
<a href="trim.html" title="trim"
>previous</a> |</li>
<li><a href="../index.html">TwigDocs 1.15 documentation</a> »</li>
<li><a href="index.html" >Filters</a> »</li>
</ul>
</div>
<div class="footer">
© Copyright 2014, Twig Team.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.2.
</div>
</body>
</html> |
#pragma once
#include <cstddef>
#include <cstdint>
#include <memory>
namespace fs
{
class IFileHandle
{
public:
virtual ~IFileHandle() = default;
virtual bool
open() = 0;
virtual void
close() = 0;
virtual bool
eof() = 0;
virtual bool
flush() = 0;
virtual bool
seek(size_t position) = 0;
virtual size_t
size() = 0;
virtual size_t
tell() = 0;
virtual size_t
truncate() = 0;
virtual size_t
read(uint8_t *data,
size_t size,
size_t count) = 0;
virtual size_t
write(const uint8_t *data,
size_t size,
size_t count) = 0;
};
using FileHandle = std::shared_ptr<IFileHandle>;
} // namespace fs |
<?php
namespace Umbria\ProLocoBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
use Umbria\OpenApiBundle\Entity\Tourism\GraphsEntities\Consortium;
use Umbria\ProLocoBundle\Entity\SearchFilter;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
/**
* Class <API key>
* @package Umbria\ProLocoBundle\Controller
*
* @author Lorenzo Franco Ranucci <loryzizu@gmail.com>
*/
class <API key> extends Controller
{
/**
* Lists all Consortium entities.
*/
public function indexAction(Request $request)
{
$itemsOnPage = $this->container->getParameter('items_on_page');
$searchFilter = new SearchFilter();
$form = $this->createFormBuilder($searchFilter)
->add("text", TextType::class, array('required' => false))
->add('search', SubmitType::class, array('label' => 'Cerca'))
->getForm();
$form->handleRequest($request);
$text = "";
if ($form->isSubmitted() && $form->isValid()) {
// $form->getData() holds the submitted values
// but, the original `$task` variable has also been updated
$searchFilter = $form->getData();
$text = $searchFilter->getText();
$form = $this->createFormBuilder($searchFilter)
->add("text", TextType::class, array('required' => false))
->add('search', SubmitType::class, array('label' => 'Ricerca'))
->getForm();
}
$repository = $this->getDoctrine()
->getRepository('UmbriaOpenApiBundle:Tourism\GraphsEntities\Consortium');
$qb = $repository->createQueryBuilder('a');
$query = $qb
->where($qb->expr()->like('a.name', '?1'))
->setParameter(1, '%' . $text . '%');
$paginator = $this->get('knp_paginator');
$pagination = $paginator->paginate(
$query, /* query NOT result */
$request->query->getInt('page', 1)/*page number*/,
$itemsOnPage/*limit per page*/
);
return $this->render('UmbriaProLocoBundle:Consortium:index.html.twig', array(
'pagination' => $pagination,
'form' => $form->createView(),
));
}
/**
* Finds and displays a Consortium entity.
*
* @param int $id
*
* @return \Symfony\Component\HttpFoundation\Response
*/
public function showAction($id)
{
$repository = $this->getDoctrine()
->getRepository('UmbriaOpenApiBundle:Tourism\GraphsEntities\Consortium');
$consortium = $repository->findById($id);
return $this->render('UmbriaProLocoBundle:Consortium:show.html.twig', array(
'consortium' => $consortium[0]
));
}
} |
package com.waz.bitmap.gif
import java.nio.{ByteBuffer, ByteOrder, IntBuffer}
import android.graphics.{Bitmap, Color}
import com.waz.bitmap.gif.Gif.{Disposal, Frame}
class LzwDecoder(gif: Gif) {
import LzwDecoder._
ensureLibraryLoaded()
val imageWidth = gif.width
val imageHeight = gif.height
val maxImageDataSize = gif.frames.map(_.imageDataSize).max
var bgIndex = gif.bgIndex
var bgColor = if (gif.gct.isEmpty) Color.TRANSPARENT else gif.gctRGBA(bgIndex)
val inputData = ByteBuffer.allocateDirect(maxImageDataSize)
val pixels = ByteBuffer.allocateDirect(imageWidth * imageHeight * 4).order(ByteOrder.BIG_ENDIAN).asIntBuffer()
val colors = ByteBuffer.allocateDirect(256 * 4).order(ByteOrder.BIG_ENDIAN).asIntBuffer()
val currentImage = Bitmap.createBitmap(gif.width, gif.height, Bitmap.Config.ARGB_8888)
val usesDisposePrevious = gif.frames.exists(_.dispose == Gif.Disposal.Previous)
// temp, used only when frame disposal is set to PREVIOUS
lazy val pixelsSwap = ByteBuffer.allocateDirect(imageWidth * imageHeight * 4).order(ByteOrder.BIG_ENDIAN).asIntBuffer()
val failed = ByteBuffer.allocateDirect(4).asIntBuffer()
val decoder = init(inputData, pixels, colors, imageWidth, imageHeight, failed)
if(failed.get(0) == -1) {
throw new <API key>("Invalid parameters given to decoder")
}
private var destroyed = false
def destroy(): Unit = {
destroy(decoder)
destroyed = true
}
override def finalize(): Unit = {
if (!destroyed) destroy(decoder)
super.finalize()
}
def clear(): Unit = clear(decoder, 0, 0, imageWidth, imageHeight, bgColor)
/**
* Decode next frame pixels, but does not modify current frame image yet.
*/
def decode(frame: Frame): Unit = {
colors.put(if (frame.lct.isEmpty) gif.gctRGBA else frame.lctRGBA)
colors.rewind()
if (frame.dispose == Disposal.Previous) {
pixelsSwap.put(pixels)
pixels.rewind()
pixelsSwap.rewind()
}
gif.data(frame).readFully(inputData, frame.imageDataSize)
inputData.rewind()
val b = frame.bounds
decode(decoder, b.x, b.y, b.w, b.h, frame.imageDataSize, frame.transIndex, bgColor, frame.interlace, frame.transparency)
}
/**
* Updates frame image from current pixel data (and clears pixel buffer according to disposition codes).
*/
def updateImage(frame: Gif.Frame): Bitmap = {
pixels.rewind()
currentImage.<API key>(pixels)
pixels.rewind()
frame.dispose match {
case Disposal.Previous =>
pixels.put(pixelsSwap)
pixels.rewind()
pixelsSwap.rewind()
case Disposal.Background =>
val b = frame.bounds
clear(decoder, b.x, b.y, b.w, b.h, if (frame.transparency) Color.TRANSPARENT else bgColor)
case _ => // ignore
}
currentImage
}
@native protected def clear(decoder: Long, x: Int, y: Int, w: Int, h: Int, color: Int): Unit
@native protected def decode(decoder: Long, x: Int, y: Int, w: Int, h: Int, inputSize: Int, transIndex: Int, bgColor: Int, interlace: Boolean, transparency: Boolean): Unit
@native protected def init(image: ByteBuffer, pixels: IntBuffer, colors: IntBuffer, width: Int, height: Int, failed: IntBuffer): Long
@native protected def destroy(decoder: Long): Unit
}
object LzwDecoder {
private val loadLibrary = { System.loadLibrary("lzw-decoder"); true }
private def ensureLibraryLoaded() = loadLibrary
} |
String.prototype.repeat=function(num){if(num<0){return"";}else{return new Array(num+1).join(this);}};function is_object(x){return Object.prototype.toString.call(x)==="[object Object]";}function is_defined(x){return typeof x!=="undefined";}function is_array(x){return Object.prototype.toString.call(x)==="[object Array]";}function xlog(v){var tab=0;var rt=function(){return" ".repeat(tab);};var lg=function(x){var kk;if(tab>10){return"[...]";}var r="";if(!is_defined(x)){r="[VAR: UNDEFINED]";}else{if(x===""){r="[VAR: EMPTY STRING]";}else{if(is_array(x)){r="[\n";tab++;for(kk in x){if(x.hasOwnProperty(kk)){r+=rt()+kk+" : "+lg(x[kk])+",\n";}}tab--;r+=rt()+"]";}else{if(is_object(x)){r="{\n";tab++;for(kk in x){if(x.hasOwnProperty(kk)){r+=rt()+kk+" : "+lg(x[kk])+",\n";}}tab--;r+=rt()+"}";}else{r=x;}}}}return r;};return lg(v);}function ee(val){alert(xlog(val));} |
<?php
namespace ACS\ACSPanelBundle\Controller;
use Symfony\Component\HttpFoundation\Request;
use Nelmio\ApiDocBundle\Annotation\ApiDoc;
use ACS\ACSPanelBundle\Controller\Base\CommonController;
use FOS\RestBundle\Controller\Annotations as Rest;
use ACS\ACSPanelBundle\Entity\DnsDomain;
use ACS\ACSPanelBundle\Entity\DnsRecord;
use ACS\ACSPanelBundle\Form\DnsDomainType;
use ACS\ACSPanelBundle\Event\FilterDnsEvent;
use Symfony\Component\EventDispatcher\EventDispatcher;
use ACS\ACSPanelBundle\Event\DnsEvents;
/**
* DnsDomain controller.
*
* @Rest\RouteResource("DnsDomain")
*/
class DnsDomainController extends CommonController
{
public function __construct()
{
$this->setEntityRepository('ACSACSPanelBundle:DnsDomain');
$this->setEntityRouteBase('dnsdomain');
}
/**
* Lists all DnsDomain entities.
*
* @ApiDoc(
* resource=true,
* description="Show all DNS Domains owned by current user",
* )
*
* @Rest\View(templateVar="entities")
*/
public function indexAction()
{
$em = $this->getDoctrine()->getManager();
// IF is admin can see all the dnsdomains, if is user only their ones...
$entities = $this->get('<API key>')->getUserViewable($this->get('security.context')->getToken()->getUser());
$view = $this->view($entities, 200)
->setTemplateData(array('search_action' => 'dnsdomain_search'))
;
return $view;
}
/**
* Finds and displays a DnsDomain entity.
*
* @ApiDoc(
* resource=true,
* description="Show DNS Domain identifyed by id",
* )
*
* @Rest\Get("/dnsdomains/{id}/show")
* @Rest\View(templateVar="entity")
*/
public function showAction($id)
{
$entity = $this->getEntity($id);
$deleteForm = $this->createDeleteForm($id);
$template_data = array(
'search_action' => 'dnsdomain_search',
'delete_form' => $deleteForm->createView()
);
$view = $this->view($entity, 200)
->setTemplateData($template_data)
;
return $view;
}
/**
* Displays a form to create a new DnsDomain entity.
*
* @Rest\View(templateVar="entity")
*/
public function newAction()
{
$em = $this->getDoctrine()->getManager();
$user = $this->get('security.context')->getToken()->getUser();
if (!$user->canUseResource('DnsDomain',$em)) {
return $this->render('ACSACSPanelBundle:Error:resources.html.twig', array(
'entity' => 'Dns Domain'
));
}
$entity = new DnsDomain();
$form = $this->createForm(new DnsDomainType($this->container), $entity);
$template_data = array(
'search_action' => 'dnsdomain_search',
'form' => $form->createView(),
);
$view = $this->view($entity, 200)
->setTemplateData($template_data)
;
return $view;
}
/**
* @ApiDoc(
* resource=true,
* description="Creates new DNS Domain",
* )
*
* @Rest\Post("/dnsdomains/create")
* @Rest\View("ACSACSPanelBundle:DnsDomain:new.html.twig", templateVar="entity")
*/
public function createAction(Request $request)
{
$entity = new DnsDomain();
$form = $this->createForm(new DnsDomainType($this->container), $entity);
$form->bind($request);
if ($form->isValid()) {
$em = $this->getDoctrine()->getManager();
$entity->setEnabled(true);
$em->persist($entity);
$em->flush();
$this->container->get('event_dispatcher')->dispatch(DnsEvents::<API key>, new FilterDnsEvent($entity,$em));
$view = $this->routeRedirectView('dnsdomain_show', array('id' => $entity->getId()), 201);
return $this->handleView($view);
}
return $form;
}
/**
* Displays a form to edit an existing DnsDomain entity.
*
*/
public function editAction($id)
{
$entity = $this->getEntity($id);
$editForm = $this->createForm(new DnsDomainType($this->container), $entity);
$deleteForm = $this->createDeleteForm($id);
return $this->render('ACSACSPanelBundle:DnsDomain:edit.html.twig', array(
'entity' => $entity,
'search_action' => 'dnsdomain_search',
'edit_form' => $editForm->createView(),
'delete_form' => $deleteForm->createView(),
));
}
/**
* Edits an existing DnsDomain entity.
*
* @ApiDoc(
* resource=true,
* description="Updates DNS Domain identifyed by id",
* )
*/
public function updateAction(Request $request, $id)
{
$em = $this->getDoctrine()->getManager();
$entity = $this->getEntity($id);
$deleteForm = $this->createDeleteForm($id);
$editForm = $this->createForm(new DnsDomainType($this->container), $entity);
$editForm->bind($request);
if ($editForm->isValid()) {
$em->persist($entity);
$em->flush();
$this->container->get('event_dispatcher')->dispatch(DnsEvents::<API key>, new FilterDnsEvent($entity,$em));
$view = $this->routeRedirectView('dnsdomain_edit', array('id' => $id), 201);
return $this->handleView($view);
}
return $this->render('ACSACSPanelBundle:DnsDomain:edit.html.twig', array(
'search_action' => 'dnsdomain_search',
'entity' => $entity,
'edit_form' => $editForm->createView(),
'delete_form' => $deleteForm->createView(),
));
}
public function setenabledAction(Request $request, $id)
{
$entity = $this->getEntity($id);
$em = $this->getDoctrine()->getManager();
$entity = $em->getRepository('ACSACSPanelBundle:DnsDomain')->find($id);
if (!$entity) {
throw $this-><API key>('Unable to find Dns Domain entity.');
}
$entity->setEnabled(!$entity->getEnabled());
$em->persist($entity);
$em->flush();
return $this->redirect($this->generateUrl('dnsdomain'));
}
/**
* Finds and displays a DnsDomain search results.
*/
public function searchAction(Request $request)
{
$em = $this->getDoctrine()->getManager();
$rep = $em->getRepository('ACSACSPanelBundle:DnsDomain');
$term = $request->request->get('term');
$query = $rep->createQueryBuilder('d')
->where('d.id = ?1')
->innerJoin('d.domain','dom')
->orWhere('dom.domain LIKE ?2')
->orWhere('d.type LIKE ?2')
->orWhere('d.account LIKE ?2')
->setParameter('1',$term)
->setParameter('2','%'.$term.'%')
->getQuery()
;
$entities = $query->execute();
return $this->render('ACSACSPanelBundle:DnsDomain:index.html.twig', array(
'entities' => $entities,
'term' => $term,
'search_action' => 'dnsdomain_search',
));
}
} |
$(document).ready(function() {
$('#contact_form').bootstrapValidator({
// To use feedback icons, ensure that you use Bootstrap v3.1.0 or later
feedbackIcons: {
valid: 'glyphicon glyphicon-ok',
invalid: 'glyphicon glyphicon-remove',
validating: 'glyphicon glyphicon-refresh'
},
fields: {
first_name: {
validators: {
stringLength: {
min: 2,
},
notEmpty: {
message: 'Please supply your first name'
}
}
},
last_name: {
validators: {
stringLength: {
min: 2,
},
notEmpty: {
message: 'Please supply your last name'
}
}
},
email: {
validators: {
notEmpty: {
message: 'Please supply your email address'
},
emailAddress: {
message: 'Please supply a valid email address'
}
}
},
phone: {
validators: {
notEmpty: {
message: 'Please supply your phone number'
},
phone: {
country: 'US',
message: 'Please supply a vaild phone number with area code'
}
}
},
address: {
validators: {
stringLength: {
min: 8,
},
notEmpty: {
message: 'Please supply your street address'
}
}
},
city: {
validators: {
stringLength: {
min: 4,
},
notEmpty: {
message: 'Please supply your city'
}
}
},
state: {
validators: {
notEmpty: {
message: 'Please select your state'
}
}
},
zip: {
validators: {
notEmpty: {
message: 'Please supply your zip code'
},
zipCode: {
country: 'US',
message: 'Please supply a vaild zip code'
}
}
},
comment: {
validators: {
stringLength: {
min: 10,
max: 200,
message:'Please enter at least 10 characters and no more than 200'
},
notEmpty: {
message: 'Please supply a description of your project'
}
}
}
}
})
.on('success.form.bv', function(e) {
$('#success_message').slideDown({ opacity: "show" }, "slow") // Do something ...
$('#contact_form').data('bootstrapValidator').resetForm();
// Prevent form submission
e.preventDefault();
// Get the form instance
var $form = $(e.target);
// Get the BootstrapValidator instance
var bv = $form.data('bootstrapValidator');
// Use Ajax to submit form data
$.post($form.attr('action'), $form.serialize(), function(result) {
console.log(result);
}, 'json');
});
}); |
import os
import sys
from django.conf import settings
if not settings.configured:
settings_dict = dict(
INSTALLED_APPS=(
#'django.contrib.contenttypes',
'inspector_panel',
'inspector_panel.tests',
),
DATABASES={
"default": {
"ENGINE": "django.db.backends.sqlite3"
}
},
)
settings.configure(**settings_dict)
def runtests(*test_args):
if not test_args:
test_args = ['tests']
parent = os.path.dirname(os.path.abspath(__file__))
sys.path.insert(0, parent)
from django.test.simple import <API key>
failures = <API key>(
verbosity=1, interactive=True, failfast=False).run_tests(test_args)
sys.exit(failures) |
package gov.wa.wsdot.mobile.client.widget.button.image;
import com.googlecode.mgwt.ui.client.widget.button.ImageButton;
import gov.wa.wsdot.mobile.client.widget.image.LocalImageHolder;
public class LocationImageButton extends ImageButton {
public LocationImageButton() {
super(LocalImageHolder.get().location());
}
} |
using System;
using System.Reflection;
namespace CodeSharp.EventSourcing
{
<summary>
</summary>
public class ObjectContainer
{
private static IObjectContainer _container;
internal static void SetContainer(IObjectContainer container)
{
_container = container;
}
public static IObjectContainer Container { get { return _container; } }
<summary>
</summary>
<param name="type"></param>
public static void RegisterType(Type type)
{
_container.RegisterType(type);
}
<summary>
</summary>
<param name="type"></param>
<param name="key"></param>
public static void RegisterType(Type type, string key)
{
_container.RegisterType(type, key);
}
<summary>
</summary>
<param name="typePredicate"></param>
<param name="assemblies"></param>
public static void RegisterTypes(Func<Type, bool> typePredicate, params Assembly[] assemblies)
{
_container.RegisterTypes(typePredicate, assemblies);
}
<summary>
</summary>
<typeparam name="TService"></typeparam>
<typeparam name="TImpl"></typeparam>
<param name="life"></param>
public static void Register<TService, TImpl>(LifeStyle life = LifeStyle.Singleton) where TService : class where TImpl : class, TService
{
_container.Register<TService, TImpl>(life);
}
<summary>
</summary>
<typeparam name="TService"></typeparam>
<typeparam name="TImpl"></typeparam>
<param name="key"></param>
<param name="life"></param>
public static void Register<TService, TImpl>(string key, LifeStyle life = LifeStyle.Singleton)
where TService : class
where TImpl : class, TService
{
_container.Register<TService, TImpl>(key, life);
}
<summary>
</summary>
<typeparam name="TService"></typeparam>
<typeparam name="TImpl"></typeparam>
<param name="life"></param>
public static void RegisterDefault<TService, TImpl>(LifeStyle life = LifeStyle.Singleton)
where TService : class
where TImpl : class, TService
{
_container.RegisterDefault<TService, TImpl>(life);
}
<summary>
</summary>
<typeparam name="T"></typeparam>
<param name="instance"></param>
<param name="life"></param>
public static void Register<T>(T instance, LifeStyle life = LifeStyle.Singleton) where T : class
{
_container.Register<T>(instance, life);
}
<summary>
</summary>
<typeparam name="T"></typeparam>
<param name="instance"></param>
<param name="key"></param>
<param name="life"></param>
public static void Register<T>(T instance, string key, LifeStyle life = LifeStyle.Singleton) where T : class
{
_container.Register<T>(instance, key, life);
}
<summary>
</summary>
<param name="type"></param>
<returns></returns>
public static bool IsRegistered(Type type)
{
return _container.IsRegistered(type);
}
<summary>
</summary>
<param name="type"></param>
<param name="key"></param>
<returns></returns>
public static bool IsRegistered(Type type, string key)
{
return _container.IsRegistered(type, key);
}
<summary>
</summary>
<typeparam name="T"></typeparam>
<returns></returns>
public static T Resolve<T>() where T : class
{
return _container.Resolve<T>();
}
<summary>
</summary>
<typeparam name="T"></typeparam>
<param name="key"></param>
<returns></returns>
public static T Resolve<T>(string key) where T : class
{
return _container.Resolve<T>(key);
}
<summary>
</summary>
<param name="type"></param>
<returns></returns>
public static object Resolve(Type type)
{
return _container.Resolve(type);
}
<summary>
</summary>
<param name="key"></param>
<param name="type"></param>
<returns></returns>
public static object Resolve(string key, Type type)
{
return _container.Resolve(key, type);
}
}
} |
'use strict';
define('forum/topic', [
'forum/infinitescroll',
'forum/topic/threadTools',
'forum/topic/postTools',
'forum/topic/events',
'forum/topic/posts',
'forum/topic/images',
'forum/topic/replies',
'navigator',
'sort',
'components',
'storage',
], function (infinitescroll, threadTools, postTools, events, posts, images, replies, navigator, sort, components, storage) {
var Topic = {};
var currentUrl = '';
$(window).on('action:ajaxify.start', function (ev, data) {
if (Topic.replaceURLTimeout) {
clearTimeout(Topic.replaceURLTimeout);
Topic.replaceURLTimeout = 0;
}
if (!String(data.url).startsWith('topic/')) {
navigator.disable();
components.get('navbar/title').find('span').text('').hide();
app.removeAlert('bookmark');
events.removeListeners();
require(['search'], function (search) {
if (search.topicDOM.active) {
search.topicDOM.end();
}
});
}
});
Topic.init = function () {
var tid = ajaxify.data.tid;
$(window).trigger('action:topic.loading');
app.enterRoom('topic_' + tid);
posts.processPage(components.get('post'));
postTools.init(tid);
threadTools.init(tid);
replies.init(tid);
events.init();
sort.handleSort('topicPostSort', 'user.setTopicSort', 'topic/' + ajaxify.data.slug);
if (!config.usePagination) {
infinitescroll.init($('[component="topic"]'), posts.loadMorePosts);
}
<API key>();
addParentHandler();
navigator.init('[component="post"]', ajaxify.data.postcount, Topic.toTop, Topic.toBottom, Topic.navigatorCallback, Topic.calculateIndex);
handleBookmark(tid);
$(window).on('scroll', updateTopicTitle);
handleTopicSearch();
$(window).trigger('action:topic.loaded', ajaxify.data);
};
function handleTopicSearch() {
require(['search', 'mousetrap'], function (search, mousetrap) {
$('.topic-search').off('click')
.on('click', '.prev', function () {
search.topicDOM.prev();
})
.on('click', '.next', function () {
search.topicDOM.next();
});
mousetrap.bind('ctrl+f', function (e) {
if (config.topicSearchEnabled) {
// If in topic, open search window and populate, otherwise regular behaviour
var match = ajaxify.currentPage.match(/^topic\/([\d]+)/);
var tid;
if (match) {
e.preventDefault();
tid = match[1];
$('#search-fields input').val('in:topic-' + tid + ' ');
app.prepareSearch();
}
}
});
});
}
Topic.toTop = function () {
navigator.scrollTop(0);
};
Topic.toBottom = function () {
socket.emit('topics.postcount', ajaxify.data.tid, function (err, postCount) {
if (err) {
return app.alertError(err.message);
}
if (config.topicPostSort !== 'oldest_to_newest') {
postCount = 2;
}
navigator.scrollBottom(postCount - 1);
});
};
function handleBookmark(tid) {
// use the user's bookmark data if available, fallback to local if available
var bookmark = ajaxify.data.bookmark || storage.getItem('topic:' + tid + ':bookmark');
var postIndex = ajaxify.data.postIndex;
if (postIndex > 0) {
if (components.get('post/anchor', postIndex - 1).length) {
return navigator.scrollToPostIndex(postIndex - 1, true, 0);
}
} else if (bookmark && (!config.usePagination || (config.usePagination && ajaxify.data.pagination.currentPage === 1)) && ajaxify.data.postcount > ajaxify.data.bookmarkThreshold) {
app.alert({
alert_id: 'bookmark',
message: '[[topic:<API key>]]',
timeout: 0,
type: 'info',
clickfn: function () {
navigator.scrollToIndex(parseInt(bookmark - 1, 10), true);
},
closefn: function () {
storage.removeItem('topic:' + tid + ':bookmark');
},
});
setTimeout(function () {
app.removeAlert('bookmark');
}, 10000);
}
}
function <API key>() {
components.get('topic').on('click', 'blockquote .toggle', function () {
var blockQuote = $(this).parent('blockquote');
var toggle = $(this);
blockQuote.toggleClass('uncollapsed');
var collapsed = !blockQuote.hasClass('uncollapsed');
toggle.toggleClass('fa-angle-down', collapsed).toggleClass('fa-angle-up', !collapsed);
});
}
function addParentHandler() {
components.get('topic').on('click', '[component="post/parent"]', function (e) {
var toPid = $(this).attr('data-topid');
var toPost = $('[component="topic"]>[component="post"][data-pid="' + toPid + '"]');
if (toPost.length) {
e.preventDefault();
navigator.scrollToIndex(toPost.attr('data-index'), true);
return false;
}
});
}
function updateTopicTitle() {
var span = components.get('navbar/title').find('span');
if ($(window).scrollTop() > 50 && span.hasClass('hidden')) {
span.html(ajaxify.data.title).removeClass('hidden');
} else if ($(window).scrollTop() <= 50 && !span.hasClass('hidden')) {
span.html('').addClass('hidden');
}
if ($(window).scrollTop() > 300) {
app.removeAlert('bookmark');
}
}
Topic.calculateIndex = function (index, elementCount) {
if (index !== 1 && config.topicPostSort !== 'oldest_to_newest') {
return elementCount - index + 2;
}
return index;
};
Topic.navigatorCallback = function (index, elementCount, threshold) {
var path = ajaxify.removeRelativePath(window.location.pathname.slice(1));
if (!path.startsWith('topic')) {
return;
}
if (navigator.scrollActive) {
return;
}
images.loadImages(threshold);
var newUrl = 'topic/' + ajaxify.data.slug + (index > 1 ? ('/' + index) : '');
if (newUrl !== currentUrl) {
if (Topic.replaceURLTimeout) {
clearTimeout(Topic.replaceURLTimeout);
}
Topic.replaceURLTimeout = setTimeout(function () {
if (index >= elementCount && app.user.uid) {
socket.emit('topics.markAsRead', [ajaxify.data.tid]);
}
updateUserBookmark(index);
Topic.replaceURLTimeout = 0;
if (history.replaceState) {
var search = window.location.search || '';
if (!config.usePagination) {
search = (search && !/^\?page=\d+$/.test(search) ? search : '');
}
history.replaceState({
url: newUrl + search,
}, null, window.location.protocol + '//' + window.location.host + RELATIVE_PATH + '/' + newUrl + search);
}
currentUrl = newUrl;
}, 500);
}
};
function updateUserBookmark(index) {
var bookmarkKey = 'topic:' + ajaxify.data.tid + ':bookmark';
var currentBookmark = ajaxify.data.bookmark || storage.getItem(bookmarkKey);
if (ajaxify.data.postcount > ajaxify.data.bookmarkThreshold && (!currentBookmark || parseInt(index, 10) > parseInt(currentBookmark, 10) || ajaxify.data.postcount < parseInt(currentBookmark, 10))) {
if (app.user.uid) {
socket.emit('topics.bookmark', {
tid: ajaxify.data.tid,
index: index,
}, function (err) {
if (err) {
return app.alertError(err.message);
}
ajaxify.data.bookmark = index;
});
} else {
storage.setItem(bookmarkKey, index);
}
}
// removes the bookmark alert when we get to / past the bookmark
if (!currentBookmark || parseInt(index, 10) >= parseInt(currentBookmark, 10)) {
app.removeAlert('bookmark');
}
}
return Topic;
}); |
// Package errorx provides error implementation and error-related utilities.
// Conventional approach towards errors in Go is quite limited.
// The typical case implies an error being created at some point:
// return errors.New("now this is unfortunate")
// Then being passed along with a no-brainer:
// if err != nil {
// return err
// And, finally, handled by printing it to the log file:
// log.Errorf("Error: %s", err)
// This approach is simple, but quite often it is not enough.
// There is a need to add context information to error, to check or hide its properties.
// If all else fails, it pays to have a stack trace printed along with error text.
// Syntax
// The code above could be modified in this fashion:
// if err != nil {
// return errorx.Decorate(err, "this could be so much better")
// log.Errorf("Error: %+v", err)
// Here errorx.Decorate is used to add more information,
// and syntax like errorx.IsOfType can still be used to check the original error.
// This error also holds a stack trace captured at the point of creation.
// With errorx syntax, any of this may be customized: stack trace can be omitted, error type can be hidden.
// Type can be further customized with Traits, and error with Properties.
// Package provides utility functions to compose, switch over, check, and ignore errors based on their types and properties.
// See documentation for Error, Type and Namespace for more details.
package errorx |
// For more information, see LICENCE in the main folder
#ifndef _CHAR_INT_GUILD_H_
#define _CHAR_INT_GUILD_H_
enum {
GS_BASIC = 0x0001,
GS_MEMBER = 0x0002,
GS_POSITION = 0x0004,
GS_ALLIANCE = 0x0008,
GS_EXPULSION = 0x0010,
GS_SKILL = 0x0020,
GS_EMBLEM = 0x0040,
GS_CONNECT = 0x0080,
GS_LEVEL = 0x0100,
GS_MES = 0x0200,
GS_MASK = 0x03FF,
GS_BASIC_MASK = (GS_BASIC | GS_EMBLEM | GS_CONNECT | GS_LEVEL | GS_MES),
GS_REMOVE = 0x8000,
};
int <API key>(int fd);
int <API key>(void);
void <API key>(void);
int inter_guild_leave(int guild_id,int account_id,int char_id);
int <API key>(int fd,int guild_id);
int inter_guild_broken(int guild_id);
int <API key>(int guild_id,int account_id,int char_id, short gender);
int <API key>(int guild_id,int account_id, int char_id, char *name);
int <API key>(int char_id, int guild_id);
int <API key>(int char_id, int guild_id);
#endif /* _CHAR_INT_GUILD_H_ */ |
/**
* generated by Xtext
*/
package org.ebix.umm.generator;
import com.google.inject.Inject;
import org.ebix.umm.generator.GenerateXsd;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.xtext.generator.IFileSystemAccess;
import org.eclipse.xtext.generator.IGenerator;
import org.eclipse.xtext.xbase.lib.Extension;
@SuppressWarnings("all")
public class UmmGenerator implements IGenerator {
@Inject
@Extension
private GenerateXsd generator;
@Override
public void doGenerate(final Resource resource, final IFileSystemAccess fsa) {
this.generator.generateXsd(resource, fsa);
}
} |
#ifndef HELPVIEWER_H
#define HELPVIEWER_H
#include <QtCore/qglobal.h>
#include <QtCore/QString>
#include <QtCore/QUrl>
#include <QtCore/QVariant>
#include <QtWidgets/QAction>
#include <QtGui/QFont>
#if defined(BROWSER_QTWEBKIT)
# include <QWebView>
#elif defined(<API key>)
# include <QtWidgets/QTextBrowser>
#endif
QT_BEGIN_NAMESPACE
class HelpEngineWrapper;
#if defined(BROWSER_QTWEBKIT)
#define <API key>
class HelpViewer : public QWebView
#elif defined(<API key>)
#define <API key> override
class HelpViewer : public QTextBrowser
#endif
{
Q_OBJECT
class HelpViewerPrivate;
Q_DISABLE_COPY(HelpViewer)
public:
enum FindFlag {
FindBackward = 0x01,
FindCaseSensitively = 0x02
};
Q_DECLARE_FLAGS(FindFlags, FindFlag)
HelpViewer(qreal zoom, QWidget *parent = 0);
~HelpViewer();
QFont viewerFont() const;
void setViewerFont(const QFont &font);
void scaleUp();
void scaleDown();
void resetScale();
qreal scale() const;
QString title() const;
void setTitle(const QString &title);
QUrl source() const;
void setSource(const QUrl &url) <API key>;
QString selectedText() const;
bool isForwardAvailable() const;
bool isBackwardAvailable() const;
bool findText(const QString &text, FindFlags flags, bool incremental,
bool fromSearch);
static const QString AboutBlank;
static const QString LocalHelpFile;
static const QString PageNotFoundMessage;
static bool isLocalUrl(const QUrl &url);
static bool canOpenPage(const QString &url);
static QString mimeFromUrl(const QUrl &url);
static bool <API key>(const QUrl &url);
public slots:
#ifndef QT_NO_CLIPBOARD
void copy();
#endif
void home() <API key>;
void forward() <API key>;
void backward() <API key>;
signals:
void titleChanged();
#if !defined(<API key>)
// Provide signals present in QTextBrowser, QTextEdit for browsers that do not inherit QTextBrowser
void copyAvailable(bool yes);
void sourceChanged(const QUrl &url);
void forwardAvailable(bool enabled);
void backwardAvailable(bool enabled);
void highlighted(const QString &link);
void printRequested();
#elif !defined(BROWSER_QTWEBKIT)
// Provide signals present in QWebView for browsers that do not inherit QWebView
void loadStarted();
void loadFinished(bool finished);
#endif
protected:
void keyPressEvent(QKeyEvent *e) override;
void wheelEvent(QWheelEvent *event) override;
void mousePressEvent(QMouseEvent *event) override;
void mouseReleaseEvent(QMouseEvent *event) override;
private slots:
void actionChanged();
void setLoadStarted();
void setLoadFinished(bool ok);
private:
bool eventFilter(QObject *obj, QEvent *event) override;
void contextMenuEvent(QContextMenuEvent *event) override;
QVariant loadResource(int type, const QUrl &name) <API key>;
bool <API key>(QMouseEvent *e);
private:
HelpViewerPrivate *d;
};
QT_END_NAMESPACE
Q_DECLARE_METATYPE(HelpViewer*)
#endif // HELPVIEWER_H |
package com.mod.financial.view.managed.business.correspondances;
import com.mod.financial.view.utils.ADFUtils;
import com.mod.financial.view.utils.JSFUtils;
import oracle.adf.view.rich.context.AdfFacesContext;
import oracle.adf.view.rich.event.DialogEvent;
public class OutboundDocs {
public OutboundDocs() {
}
public void <API key>(DialogEvent dialogEvent) {
try {
ADFUtils.findOperation("DeleteMaster").execute();
ADFUtils.findOperation("Commit").execute();
AdfFacesContext.getCurrentInstance().addPartialTarget(JSFUtils.findComponentInRoot("masterT1"));
} catch (Exception e) {
e.printStackTrace();
}
}
} |
/*
* DO NOT EDIT. THIS FILE IS GENERATED FROM e:/builds/moz2_slave/rel-cen-xr-w32-bld/build/dom/interfaces/xul/<API key>.idl
*/
#ifndef <API key>
#define <API key>
#ifndef <API key>
#include "nsIDOMXULElement.h"
#endif
/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
class <API key>; /* forward declaration */
/* starting interface: <API key> */
#define <API key> "<API key>"
#define <API key> \
{0x4650e55f, 0x4777, 0x4271, \
{ 0x8b, 0x62, 0x96, 0x03, 0xa7, 0xdd, 0x46, 0x14 }}
class NS_NO_VTABLE NS_SCRIPTABLE <API key> : public nsIDOMXULElement {
public:
<API key>(<API key>)
/**
* Returns the parent container if any.
*/
/* readonly attribute <API key> parentContainer; */
NS_SCRIPTABLE NS_IMETHOD GetParentContainer(<API key> **aParentContainer) = 0;
};
<API key>(<API key>, <API key>)
/* Use this macro when declaring classes that implement this interface. */
#define <API key> \
NS_SCRIPTABLE NS_IMETHOD GetParentContainer(<API key> **aParentContainer);
/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define <API key>(_to) \
NS_SCRIPTABLE NS_IMETHOD GetParentContainer(<API key> **aParentContainer) { return _to GetParentContainer(aParentContainer); }
/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define <API key>(_to) \
NS_SCRIPTABLE NS_IMETHOD GetParentContainer(<API key> **aParentContainer) { return !_to ? <API key> : _to->GetParentContainer(aParentContainer); }
#if 0
/* Use the code below as a template for the implementation class for this interface. */
/* Header file */
class <API key> : public <API key>
{
public:
NS_DECL_ISUPPORTS
<API key>
<API key>();
private:
~<API key>();
protected:
/* additional members */
};
/* Implementation file */
NS_IMPL_ISUPPORTS1(<API key>, <API key>)
<API key>::<API key>()
{
/* member initializers and constructor code */
}
<API key>::~<API key>()
{
/* destructor code */
}
/* readonly attribute <API key> parentContainer; */
NS_IMETHODIMP <API key>::GetParentContainer(<API key> **aParentContainer)
{
return <API key>;
}
/* End of implementation class template. */
#endif
/* starting interface: <API key> */
#define <API key> "<API key>"
#define <API key> \
{0xbc07c626, 0x4294, 0x43ae, \
{ 0x9b, 0x0a, 0xe7, 0x26, 0xde, 0x0a, 0xdc, 0xad }}
class NS_NO_VTABLE NS_SCRIPTABLE <API key> : public <API key> {
public:
<API key>(<API key>)
/**
* Creates an item for the given label and value and appends it to the
* container.
*
* @param aLabel - the label for the new item
* @param aValue - the value of the new item
*/
/* nsIDOMXULElement appendItem (in DOMString aLabel, in DOMString aValue); */
NS_SCRIPTABLE NS_IMETHOD AppendItem(const nsAString & aLabel, const nsAString & aValue, nsIDOMXULElement **_retval NS_OUTPARAM) = 0;
/**
* Creates an item for the given label and value and inserts it into the
* container at the specified position.
*
* @param aIndex - the index where the new item will be inserted
* @param aLabel - the label for the new item
* @param aValue - the value of the new item
*/
/* nsIDOMXULElement insertItemAt (in long aIndex, in DOMString aLabel, in DOMString aValue); */
NS_SCRIPTABLE NS_IMETHOD InsertItemAt(PRInt32 aIndex, const nsAString & aLabel, const nsAString & aValue, nsIDOMXULElement **_retval NS_OUTPARAM) = 0;
/**
* Removes an item from the container.
*
* @param aIndex - index of the item to remove
*/
/* nsIDOMXULElement removeItemAt (in long aIndex); */
NS_SCRIPTABLE NS_IMETHOD RemoveItemAt(PRInt32 aIndex, nsIDOMXULElement **_retval NS_OUTPARAM) = 0;
/**
* Returns a count of items in the container.
*/
/* readonly attribute unsigned long itemCount; */
NS_SCRIPTABLE NS_IMETHOD GetItemCount(PRUint32 *aItemCount) = 0;
/**
* Returns the index of an item or -1 if the item is not in the container.
*
* @param aItem - the item to determine the index of
*/
/* long getIndexOfItem (in nsIDOMXULElement aItem); */
NS_SCRIPTABLE NS_IMETHOD GetIndexOfItem(nsIDOMXULElement *aItem, PRInt32 *_retval NS_OUTPARAM) = 0;
/**
* Returns the item at a given index or null if the item is not is the
* container.
*
* @param aIndex - the index of the item to return
*/
/* nsIDOMXULElement getItemAtIndex (in long aIndex); */
NS_SCRIPTABLE NS_IMETHOD GetItemAtIndex(PRInt32 aIndex, nsIDOMXULElement **_retval NS_OUTPARAM) = 0;
};
<API key>(<API key>, <API key>)
/* Use this macro when declaring classes that implement this interface. */
#define <API key> \
NS_SCRIPTABLE NS_IMETHOD AppendItem(const nsAString & aLabel, const nsAString & aValue, nsIDOMXULElement **_retval NS_OUTPARAM); \
NS_SCRIPTABLE NS_IMETHOD InsertItemAt(PRInt32 aIndex, const nsAString & aLabel, const nsAString & aValue, nsIDOMXULElement **_retval NS_OUTPARAM); \
NS_SCRIPTABLE NS_IMETHOD RemoveItemAt(PRInt32 aIndex, nsIDOMXULElement **_retval NS_OUTPARAM); \
NS_SCRIPTABLE NS_IMETHOD GetItemCount(PRUint32 *aItemCount); \
NS_SCRIPTABLE NS_IMETHOD GetIndexOfItem(nsIDOMXULElement *aItem, PRInt32 *_retval NS_OUTPARAM); \
NS_SCRIPTABLE NS_IMETHOD GetItemAtIndex(PRInt32 aIndex, nsIDOMXULElement **_retval NS_OUTPARAM);
/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define <API key>(_to) \
NS_SCRIPTABLE NS_IMETHOD AppendItem(const nsAString & aLabel, const nsAString & aValue, nsIDOMXULElement **_retval NS_OUTPARAM) { return _to AppendItem(aLabel, aValue, _retval); } \
NS_SCRIPTABLE NS_IMETHOD InsertItemAt(PRInt32 aIndex, const nsAString & aLabel, const nsAString & aValue, nsIDOMXULElement **_retval NS_OUTPARAM) { return _to InsertItemAt(aIndex, aLabel, aValue, _retval); } \
NS_SCRIPTABLE NS_IMETHOD RemoveItemAt(PRInt32 aIndex, nsIDOMXULElement **_retval NS_OUTPARAM) { return _to RemoveItemAt(aIndex, _retval); } \
NS_SCRIPTABLE NS_IMETHOD GetItemCount(PRUint32 *aItemCount) { return _to GetItemCount(aItemCount); } \
NS_SCRIPTABLE NS_IMETHOD GetIndexOfItem(nsIDOMXULElement *aItem, PRInt32 *_retval NS_OUTPARAM) { return _to GetIndexOfItem(aItem, _retval); } \
NS_SCRIPTABLE NS_IMETHOD GetItemAtIndex(PRInt32 aIndex, nsIDOMXULElement **_retval NS_OUTPARAM) { return _to GetItemAtIndex(aIndex, _retval); }
/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define <API key>(_to) \
NS_SCRIPTABLE NS_IMETHOD AppendItem(const nsAString & aLabel, const nsAString & aValue, nsIDOMXULElement **_retval NS_OUTPARAM) { return !_to ? <API key> : _to->AppendItem(aLabel, aValue, _retval); } \
NS_SCRIPTABLE NS_IMETHOD InsertItemAt(PRInt32 aIndex, const nsAString & aLabel, const nsAString & aValue, nsIDOMXULElement **_retval NS_OUTPARAM) { return !_to ? <API key> : _to->InsertItemAt(aIndex, aLabel, aValue, _retval); } \
NS_SCRIPTABLE NS_IMETHOD RemoveItemAt(PRInt32 aIndex, nsIDOMXULElement **_retval NS_OUTPARAM) { return !_to ? <API key> : _to->RemoveItemAt(aIndex, _retval); } \
NS_SCRIPTABLE NS_IMETHOD GetItemCount(PRUint32 *aItemCount) { return !_to ? <API key> : _to->GetItemCount(aItemCount); } \
NS_SCRIPTABLE NS_IMETHOD GetIndexOfItem(nsIDOMXULElement *aItem, PRInt32 *_retval NS_OUTPARAM) { return !_to ? <API key> : _to->GetIndexOfItem(aItem, _retval); } \
NS_SCRIPTABLE NS_IMETHOD GetItemAtIndex(PRInt32 aIndex, nsIDOMXULElement **_retval NS_OUTPARAM) { return !_to ? <API key> : _to->GetItemAtIndex(aIndex, _retval); }
#if 0
/* Use the code below as a template for the implementation class for this interface. */
/* Header file */
class <API key> : public <API key>
{
public:
NS_DECL_ISUPPORTS
<API key>
<API key>();
private:
~<API key>();
protected:
/* additional members */
};
/* Implementation file */
NS_IMPL_ISUPPORTS1(<API key>, <API key>)
<API key>::<API key>()
{
/* member initializers and constructor code */
}
<API key>::~<API key>()
{
/* destructor code */
}
/* nsIDOMXULElement appendItem (in DOMString aLabel, in DOMString aValue); */
NS_IMETHODIMP <API key>::AppendItem(const nsAString & aLabel, const nsAString & aValue, nsIDOMXULElement **_retval NS_OUTPARAM)
{
return <API key>;
}
/* nsIDOMXULElement insertItemAt (in long aIndex, in DOMString aLabel, in DOMString aValue); */
NS_IMETHODIMP <API key>::InsertItemAt(PRInt32 aIndex, const nsAString & aLabel, const nsAString & aValue, nsIDOMXULElement **_retval NS_OUTPARAM)
{
return <API key>;
}
/* nsIDOMXULElement removeItemAt (in long aIndex); */
NS_IMETHODIMP <API key>::RemoveItemAt(PRInt32 aIndex, nsIDOMXULElement **_retval NS_OUTPARAM)
{
return <API key>;
}
/* readonly attribute unsigned long itemCount; */
NS_IMETHODIMP <API key>::GetItemCount(PRUint32 *aItemCount)
{
return <API key>;
}
/* long getIndexOfItem (in nsIDOMXULElement aItem); */
NS_IMETHODIMP <API key>::GetIndexOfItem(nsIDOMXULElement *aItem, PRInt32 *_retval NS_OUTPARAM)
{
return <API key>;
}
/* nsIDOMXULElement getItemAtIndex (in long aIndex); */
NS_IMETHODIMP <API key>::GetItemAtIndex(PRInt32 aIndex, nsIDOMXULElement **_retval NS_OUTPARAM)
{
return <API key>;
}
/* End of implementation class template. */
#endif
#endif /* <API key> */ |
#ifndef __MIRC_H
#define __MIRC_H
/* mIRC color control characters */
#define MIRC_BOLD 0x02
#define MIRC_ITALICS 0x1D
#define MIRC_UNDERLINE 0x1F
#define MIRC_REVERSE 0x16
#define MIRC_BLINK 0x06
#define MIRC_PLAIN 0x0F
#define MIRC_COLOR 0x03
/* mIRC color code */
enum {
MIRC_COLOR_WHITE = 0,
MIRC_COLOR_BLACK = 1,
MIRC_COLOR_NAVY = 2,
MIRC_COLOR_GREEN = 3,
MIRC_COLOR_RED = 4,
MIRC_COLOR_MAROON = 5,
MIRC_COLOR_PURPLE = 6,
MIRC_COLOR_OLIVE = 7,
MIRC_COLOR_YELLOW = 8,
<API key> = 9,
MIRC_COLOR_TEAL = 10,
MIRC_COLOR_CYAN = 11,
<API key> = 12,
MIRC_COLOR_MAGENTA = 13,
MIRC_COLOR_GRAY = 14,
<API key> = 15,
MIRC_COLOR_UNKNOWN = 16, // Not a part of protocol, just for convenience
};
#endif /* __MIRC_H */ |
{% extends "template/onenews.html" %}
{% set title = 'Release GCompris 0.91' %}
{% set withlongcontent = 0 %}
{% block content %}
<img src='{{ newsFolder }}images/gcompris360.png'
alt='gcompris banner'
class='col-xs-12 col-md-4'
style='float: right; padding-left: 10px; cursor: pointer;'
onclick="window.open('{{ newsFolder }}images/gcompris360.png')"/>
<p>Hi,<br />
Here is GCompris 0.91, a new bugfix release to correct some issues in previous version and improve a few things.</p>
<p>Every GNU/Linux distribution shipping 0.90 should update to 0.91.</p>
<p>With 68 commits since last release, the full changelog is too long for this post.
But here is a list to summarize the changes.</p>
<p>Activities:</p>
<li class="puce">fix English text in several activities</li>
<li class="puce">fix score position in several activities</li>
<li class="puce">block some buttons and interactions when needed in several places</li>
<li class="puce">lots of fixes for audio in several activities</li>
<li class="puce">number_sequence (and others based on it), fix base layout</li>
<li class="puce">update dataset for clickanddraw, drawnumbers and drawletters</li>
<li class="puce">crane, add localized dataset</li>
<li class="puce">lightsoff, add keyboard support and other fixes</li>
<li class="puce">algorithm, add keyboard support and other fixes</li>
<li class="puce">money, fixes for locale currency used</li>
<li class="puce">ballcatch, improve audio feedback</li>
<li class="puce">calendar, several little fixes</li>
<li class="puce"><API key> fix icons size</li>
<br/>
<p>Other changes:</p>
<li class="puce">re-enable sound effects on linux</li>
<li class="puce">improved playback of sound effects, no more delay</li>
<li class="puce">add captions to images and OARS tags in the appdata</li>
<li class="puce">add Scottish Gaelic to core, and update some datasets for it</li>
<li class="puce">main bar, fix some items size</li>
<li class="puce">remove unused images</li>
<br/>
<p>You can find this new version <a href="https://gcompris.net/downloads-en.html">on the download page</a>, and soon in the Play store and Windows store.</p>
<p>On the translation side, we have 16 languages fully supported:
British English,
Catalan,
Catalan (Valencian),
Chinese Traditional,
Dutch,
French,
Greek,
Indonesian,
Irish Gaelic,
Italian,
Polish,
Portuguese,
Romanian,
Spanish,
Swedish,
Ukrainian.
<br />
We also have 15 languages partially supported:
Norwegian Nynorsk (97%),
Hindi (96%),
Turkish (90%),
Scottish Gaelic (86%),
Galician (86%),
Brazilian Portuguese (84%),
Belarusian (84%),
German (81%),
Chinese Simplified (79%),
Russian (78%),
Estonian (77%),
Slovak (76%),
Finnish (76%),
Slovenian (69%),
Breton (65%).</p>
<p>If you want to help completing one of these translations or adding a new one, please contact us.</p>
<p>Else you can still help by making some posts in your community about GCompris and don't hesitate to give feedbacks.</p>
<p>Thank you all, <br/>
Timothée & Johnny </p>
{% endblock %} |
#include "spice.h"
#include <stdio.h>
#include "mos1defs.h"
#include "cktdefs.h"
#include "fteconst.h"
#include "iferrmsg.h"
#include "noisedef.h"
#include "util.h"
#include "suffix.h"
/*
* MOS1noise (mode, operation, firstModel, ckt, data, OnDens)
* This routine names and evaluates all of the noise sources
* associated with MOSFET's. It starts with the model *firstModel and
* traverses all of its insts. It then proceeds to any other models
* on the linked list. The total output noise density generated by
* all of the MOSFET's is summed with the variable "OnDens".
*/
extern void NevalSrc();
extern double Nintegrate();
int
MOS1noise (mode, operation, genmodel, ckt, data, OnDens)
int mode;
int operation;
GENmodel *genmodel;
CKTcircuit *ckt;
register Ndata *data;
double *OnDens;
{
MOS1model *firstModel = (MOS1model *) genmodel;
register MOS1model *model;
register MOS1instance *inst;
char name[N_MXVLNTH];
double coxSquared;
double tempOnoise;
double tempInoise;
double noizDens[MOS1NSRCS];
double lnNdens[MOS1NSRCS];
int error;
int i;
/* define the names of the noise sources */
static char *MOS1nNames[MOS1NSRCS] = { /* Note that we have to keep the order */
"_rd", /* noise due to rd */ /* consistent with the index definitions */
"_rs", /* noise due to rs */ /* in MOS1defs.h */
"_id", /* noise due to id */
"_1overf", /* flicker (1/f) noise */
"" /* total transistor noise */
};
for (model=firstModel; model != NULL; model=model->MOS1nextModel) {
/* Oxide capacitance can be zero in MOS level 1. Since this will give us problems in our 1/f */
/* noise model, we ASSUME an actual "tox" of 1e-7 */
if (model->MOS1oxideCapFactor == 0.0) {
coxSquared = 3.9 * 8.854214871e-12 / 1e-7;
} else {
coxSquared = model->MOS1oxideCapFactor;
}
coxSquared *= coxSquared;
for (inst=model->MOS1instances; inst != NULL; inst=inst->MOS1nextInstance) {
switch (operation) {
case N_OPEN:
/* see if we have to to produce a summary report */
/* if so, name all the noise generators */
if (((NOISEAN*)ckt->CKTcurJob)->NStpsSm != 0) {
switch (mode) {
case N_DENS:
for (i=0; i < MOS1NSRCS; i++) {
(void)sprintf(name,"onoise_%s%s",inst->MOS1name,MOS1nNames[i]);
data->namelist = (IFuid *)trealloc((char *)data->namelist,(data->numPlots + 1)*sizeof(IFuid));
if (!data->namelist) return(E_NOMEM);
(*(SPfrontEnd->IFnewUid))(ckt,
&(data->namelist[data->numPlots++]),
(IFuid)NULL,name,UID_OTHER,(GENERIC **)NULL);
/* we've added one more plot */
}
break;
case INT_NOIZ:
for (i=0; i < MOS1NSRCS; i++) {
(void)sprintf(name,"onoise_total_%s%s",inst->MOS1name,MOS1nNames[i]);
data->namelist = (IFuid *)trealloc((char *)data->namelist,(data->numPlots + 1)*sizeof(IFuid));
if (!data->namelist) return(E_NOMEM);
(*(SPfrontEnd->IFnewUid))(ckt,
&(data->namelist[data->numPlots++]),
(IFuid)NULL,name,UID_OTHER,(GENERIC **)NULL);
/* we've added one more plot */
(void)sprintf(name,"inoise_total_%s%s",inst->MOS1name,MOS1nNames[i]);
data->namelist = (IFuid *)trealloc((char *)data->namelist,(data->numPlots + 1)*sizeof(IFuid));
if (!data->namelist) return(E_NOMEM);
(*(SPfrontEnd->IFnewUid))(ckt,
&(data->namelist[data->numPlots++]),
(IFuid)NULL,name,UID_OTHER,(GENERIC **)NULL);
/* we've added one more plot */
}
break;
}
}
break;
case N_CALC:
switch (mode) {
case N_DENS:
NevalSrc(&noizDens[MOS1RDNOIZ],&lnNdens[MOS1RDNOIZ],
ckt,THERMNOISE,inst->MOS1dNodePrime,inst->MOS1dNode,
inst-><API key>);
NevalSrc(&noizDens[MOS1RSNOIZ],&lnNdens[MOS1RSNOIZ],
ckt,THERMNOISE,inst->MOS1sNodePrime,inst->MOS1sNode,
inst-><API key>);
NevalSrc(&noizDens[MOS1IDNOIZ],&lnNdens[MOS1IDNOIZ],
ckt,THERMNOISE,inst->MOS1dNodePrime,inst->MOS1sNodePrime,
(2.0/3.0 * FABS(inst->MOS1gm)));
NevalSrc(&noizDens[MOS1FLNOIZ],(double*)NULL,ckt,
N_GAIN,inst->MOS1dNodePrime, inst->MOS1sNodePrime,
(double)0.0);
noizDens[MOS1FLNOIZ] *= model->MOS1fNcoef *
exp(model->MOS1fNexp *
log(MAX(FABS(inst->MOS1cd),N_MINLOG))) /
(data->freq * inst->MOS1w *
(inst->MOS1l - 2*model->MOS1latDiff) * coxSquared);
lnNdens[MOS1FLNOIZ] =
log(MAX(noizDens[MOS1FLNOIZ],N_MINLOG));
noizDens[MOS1TOTNOIZ] = noizDens[MOS1RDNOIZ] +
noizDens[MOS1RSNOIZ] +
noizDens[MOS1IDNOIZ] +
noizDens[MOS1FLNOIZ];
lnNdens[MOS1TOTNOIZ] =
log(MAX(noizDens[MOS1TOTNOIZ], N_MINLOG));
*OnDens += noizDens[MOS1TOTNOIZ];
if (data->delFreq == 0.0) {
/* if we haven't done any previous integration, we need to */
/* initialize our "history" variables */
for (i=0; i < MOS1NSRCS; i++) {
inst->MOS1nVar[LNLSTDENS][i] = lnNdens[i];
}
/* clear out our integration variables if it's the first pass */
if (data->freq == ((NOISEAN*)ckt->CKTcurJob)->NstartFreq) {
for (i=0; i < MOS1NSRCS; i++) {
inst->MOS1nVar[OUTNOIZ][i] = 0.0;
inst->MOS1nVar[INNOIZ][i] = 0.0;
}
}
} else { /* data->delFreq != 0.0 (we have to integrate) */
for (i=0; i < MOS1NSRCS; i++) {
if (i != MOS1TOTNOIZ) {
tempOnoise = Nintegrate(noizDens[i], lnNdens[i],
inst->MOS1nVar[LNLSTDENS][i], data);
tempInoise = Nintegrate(noizDens[i] * data->GainSqInv ,
lnNdens[i] + data->lnGainInv,
inst->MOS1nVar[LNLSTDENS][i] + data->lnGainInv,
data);
inst->MOS1nVar[LNLSTDENS][i] = lnNdens[i];
data->outNoiz += tempOnoise;
data->inNoise += tempInoise;
if (((NOISEAN*)ckt->CKTcurJob)->NStpsSm != 0) {
inst->MOS1nVar[OUTNOIZ][i] += tempOnoise;
inst->MOS1nVar[OUTNOIZ][MOS1TOTNOIZ] += tempOnoise;
inst->MOS1nVar[INNOIZ][i] += tempInoise;
inst->MOS1nVar[INNOIZ][MOS1TOTNOIZ] += tempInoise;
}
}
}
}
if (data->prtSummary) {
for (i=0; i < MOS1NSRCS; i++) { /* print a summary report */
data->outpVector[data->outNumber++] = noizDens[i];
}
}
break;
case INT_NOIZ: /* already calculated, just output */
if (((NOISEAN*)ckt->CKTcurJob)->NStpsSm != 0) {
for (i=0; i < MOS1NSRCS; i++) {
data->outpVector[data->outNumber++] = inst->MOS1nVar[OUTNOIZ][i];
data->outpVector[data->outNumber++] = inst->MOS1nVar[INNOIZ][i];
}
}
break;
} /* switch (mode) */
break;
case N_CLOSE:
return (OK); /* do nothing, the main calling routine will close */
break; /* the plots */
} /* switch (operation) */
} /* for inst */
} /* for model */
return(OK);
} |
package org.sufficientlysecure.keychain.ui.base;
import android.os.Bundle;
import android.os.Message;
import android.os.Parcelable;
import org.sufficientlysecure.keychain.service.<API key>;
import org.sufficientlysecure.keychain.service.input.CryptoInputParcel;
public abstract class <API key> <T extends Parcelable> extends <API key> {
public static final String ARG_CACHED_ACTIONS = "cached_actions";
private T <API key>;
@Override
protected void cryptoOperation(CryptoInputParcel cryptoInput) {
cryptoOperation(cryptoInput, <API key>);
}
@Override
public void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
outState.putParcelable(ARG_CACHED_ACTIONS, <API key>);
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (savedInstanceState != null) {
<API key> = savedInstanceState.getParcelable(ARG_CACHED_ACTIONS);
}
}
@Override
public boolean <API key>(Message message) {
// see if it's an InputPendingResult, and if so don't care
if (super.<API key>(message)) {
return true;
}
// if it's a non-input-pending OKAY message, always clear the cached actions parcel
if (message.arg1 == <API key>.MessageStatus.OKAY.ordinal()) {
<API key> = null;
}
return false;
}
protected abstract void cryptoOperation(CryptoInputParcel cryptoInput, T cachedActionsParcel);
protected void cacheActionsParcel(T cachedActionsParcel) {
<API key> = cachedActionsParcel;
}
protected void <API key>() {
<API key> = null;
}
} |
#ifndef <API key>
#define <API key>
#include "sqlite/Error.h"
#include "sqlite/Query.h"
#include "sqlite/Connection.h"
#include <QThread>
#include <QSemaphore>
#include <QMutex>
#include <QQueue>
#include <QSet>
class DatabaseThread;
class <API key>;
struct sqlite3;
/**
* Asynchronous Query - provides SQL connections that execute queries in a separate
* thread and notify of results through signals.
*/
class ASyncQuery : public QObject
{
Q_OBJECT
private:
<API key> *_dbConn;
SQLite::Query _query;
Whether the query is executing or has a pending execution
bool _active;
QString _currentQuery;
public:
ASyncQuery(DatabaseThread *dbConn);
virtual ~ASyncQuery();
Returns the last error raised by this query
const SQLite::Error &lastError() { return _query.lastError(); }
/**
* Starts running the query given as argument. The ASyncQuery will emit
* the following signals to notify of results, in that order:
* - firstResult() to notify that the first result will arrive
* - result(const QSqlResult &) to send all results one by one
* One of the following termination signals:
* - completed() to notify all the results were sent without any problem.
* - aborted() to notify the query has been manually aborted.
* - error() to notify an error occured.
*/
bool exec(const QString &qString);
/**
* Abort the query, provided it is being executed.
* When this method returns, it is guaranteed that the query
* is not running, no matter what its state was when it was
* called. This method return true if the query was running
* and had been interrupted, and false if the query was not
* running when being called.
*
* Warning: even though it is guaranteed the query is not
* running after this method exists, it is still possible
* that results it has emitted has not yet been processed
* by the receiving thread, and therefore will raise the
* connected slots when the receiving thread enters its
* event loop again (i.e. after this method call). The
* user should pay particular attention to this.
*/
bool abort();
bool active();
public slots:
/**
* Actual query process function that is called from within
* the database thread. Can be called manually for synchronous
* execution.
*/
void process();
signals:
Used internally to transfer from user to database thread
void queryReady();
Emitted right before the first result of the query
void firstResult();
Emits one of the results of the query
void result(const QList<QVariant> &result);
Emitted after the last result of the query
void completed();
Emitted if the query has been aborted
void aborted();
Emitted if an error occured
void error(const QString &error);
};
/**
* Provides a database connection that runs in a separate thread,
* in order to run ASyncQuery instances.
*
* Upon creation, instances of this class starts a new thread dedicated
* to executing database queries that lives until the instance is destroyed.
* Instances of ASyncQuery that are given an instance of <API key> at
* construction time will be dependent on that <API key> in the following
* respect:
* - The ASyncQuery object will be moved to the <API key>'s thread
* - The ASyncQuery queries will be performed within the <API key>'s thread
* - The ASyncQuery will be interrupted if the <API key>'s abort() function
* is called.
*/
class <API key> : public QObject
{
Q_OBJECT
// Needed as ASyncQuery tightly interacts with us
// (migrates to our thread, uses _database, ...)
friend class ASyncQuery;
friend class DatabaseThread;
private:
SQLite::Connection _connection;
Queue of queries waiting to be executed
QQueue<ASyncQuery *> _waitingQueue;
QMutex _waitingQueueMutex;
Pointer to the currently executing query
ASyncQuery *_activeQuery;
Hold by the DB thread whenever a query is active.
Used to ensure an interrupted query has actually
been completely interrupted.
QMutex <API key>;
Whenever the user requests the current query to be
aborted, this boolean is set to true.
bool _abortCurrentQuery;
/**
* Abort the currently running query, if any. When this function returns,
* the query is already terminated. This function only terminates the current
* query - if there are other queries waiting in the message queue, they start
* being processed immediatly.
* @arg query The query we want to stop. If the currently running query is not
* the one given as parameter, nothing is done.
*/
void _abortRunningQuery(ASyncQuery *query);
/**
* Only DatabaseThread can create instances of us.
*/
<API key>();
public:
virtual ~<API key>();
/**
* Connect to the database file given as parameter. Returns true in case
* of success, false otherwise.
*/
bool connect(const QString &dbFile);
/**
* Connect the database file given as parameter to alias. Returns true
* in case of success, false otherwise.
*/
bool attach(const QString &dbFile, const QString &alias);
bool detach(const QString &alias);
Returns the last error that happened on this connection
const SQLite::Error &lastError() { return _connection.lastError(); }
public slots:
/**
* Process all the queries that are in the waiting queue.
*/
virtual void processQueries();
};
class DatabaseThread : public QThread
{
Q_OBJECT
private:
List of instances, to attach databases dynamically
static QSet<DatabaseThread *> _instances;
Used to synchronize threads during construction
QSemaphore _startSem;
The object that will live in our thread space and
receive messages
<API key> *_connection;
protected:
virtual void run();
public:
DatabaseThread();
virtual ~DatabaseThread();
<API key> * connection() { return _connection; }
static const QSet<DatabaseThread *> &instances() { return _instances; }
};
#endif /* ASYNCQUERY_H_ */ |
#include "replace.h"
#include "system/network.h"
#include "system/filesys.h"
#include <dirent.h>
#include "lib/util/data_blob.h"
#include "lib/util/debug.h"
#include "lib/unix_msg/unix_msg.h"
#include "system/filesys.h"
#include "lib/messages_dgm.h"
#include "lib/param/param.h"
#include "poll_funcs/poll_funcs_tevent.h"
#include "unix_msg/unix_msg.h"
#include "lib/util/genrand.h"
struct sun_path_buf {
/*
* This will carry enough for a socket path
*/
char buf[sizeof(struct sockaddr_un)];
};
struct <API key> {
pid_t pid;
struct poll_funcs *msg_callbacks;
void *tevent_handle;
struct unix_msg_ctx *dgm_ctx;
struct sun_path_buf socket_dir;
struct sun_path_buf lockfile_dir;
int lockfile_fd;
void (*recv_cb)(const uint8_t *msg,
size_t msg_len,
int *fds,
size_t num_fds,
void *private_data);
void *<API key>;
bool *have_dgm_context;
};
static struct <API key> *global_dgm_context;
static void messaging_dgm_recv(struct unix_msg_ctx *ctx,
uint8_t *msg, size_t msg_len,
int *fds, size_t num_fds,
void *private_data);
static int <API key>(struct <API key> *c);
static int <API key>(struct <API key> *ctx,
pid_t pid, int *plockfile_fd,
uint64_t *punique)
{
char buf[64];
int lockfile_fd;
struct sun_path_buf lockfile_name;
struct flock lck;
uint64_t unique;
int unique_len, ret;
ssize_t written;
ret = snprintf(lockfile_name.buf, sizeof(lockfile_name.buf),
"%s/%u", ctx->lockfile_dir.buf, (unsigned)pid);
if (ret >= sizeof(lockfile_name.buf)) {
return ENAMETOOLONG;
}
/* no O_EXCL, existence check is via the fcntl lock */
lockfile_fd = open(lockfile_name.buf, O_NONBLOCK|O_CREAT|O_RDWR,
0644);
if ((lockfile_fd == -1) &&
((errno == ENXIO) /* Linux */ ||
(errno == ENODEV) /* Linux kernel bug */ ||
(errno == EOPNOTSUPP) /* FreeBSD */)) {
/*
* Huh -- a socket? This might be a stale socket from
* an upgrade of Samba. Just unlink and retry, nobody
* else is supposed to be here at this time.
*
* Yes, this is racy, but I don't see a way to deal
* with this properly.
*/
unlink(lockfile_name.buf);
lockfile_fd = open(lockfile_name.buf,
O_NONBLOCK|O_CREAT|O_WRONLY,
0644);
}
if (lockfile_fd == -1) {
ret = errno;
DEBUG(1, ("%s: open failed: %s\n", __func__, strerror(errno)));
return ret;
}
lck = (struct flock) {
.l_type = F_WRLCK,
.l_whence = SEEK_SET
};
ret = fcntl(lockfile_fd, F_SETLK, &lck);
if (ret == -1) {
ret = errno;
DEBUG(1, ("%s: fcntl failed: %s\n", __func__, strerror(ret)));
goto fail_close;
}
/*
* Directly using the binary value for
* <API key> is a layering
* violation. But including all of ndr here just for this
* seems to be a bit overkill to me. Also, messages_dgm might
* be replaced sooner or later by something streams-based,
* where unique_id generation will be handled differently.
*/
do {
<API key>((uint8_t *)&unique, sizeof(unique));
} while (unique == UINT64_C(0xFFFFFFFFFFFFFFFF));
unique_len = snprintf(buf, sizeof(buf), "%ju\n", (uintmax_t)unique);
/* shorten a potentially preexisting file */
ret = ftruncate(lockfile_fd, unique_len);
if (ret == -1) {
ret = errno;
DEBUG(1, ("%s: ftruncate failed: %s\n", __func__,
strerror(ret)));
goto fail_unlink;
}
written = write(lockfile_fd, buf, unique_len);
if (written != unique_len) {
ret = errno;
DEBUG(1, ("%s: write failed: %s\n", __func__, strerror(ret)));
goto fail_unlink;
}
*plockfile_fd = lockfile_fd;
*punique = unique;
return 0;
fail_unlink:
unlink(lockfile_name.buf);
fail_close:
close(lockfile_fd);
return ret;
}
int messaging_dgm_init(struct tevent_context *ev,
uint64_t *punique,
const char *socket_dir,
const char *lockfile_dir,
void (*recv_cb)(const uint8_t *msg,
size_t msg_len,
int *fds,
size_t num_fds,
void *private_data),
void *<API key>)
{
struct <API key> *ctx;
int ret;
struct sockaddr_un socket_address;
size_t len;
static bool have_dgm_context = false;
if (have_dgm_context) {
return EEXIST;
}
ctx = talloc_zero(NULL, struct <API key>);
if (ctx == NULL) {
goto fail_nomem;
}
ctx->pid = getpid();
ctx->recv_cb = recv_cb;
ctx-><API key> = <API key>;
len = strlcpy(ctx->lockfile_dir.buf, lockfile_dir,
sizeof(ctx->lockfile_dir.buf));
if (len >= sizeof(ctx->lockfile_dir.buf)) {
TALLOC_FREE(ctx);
return ENAMETOOLONG;
}
len = strlcpy(ctx->socket_dir.buf, socket_dir,
sizeof(ctx->socket_dir.buf));
if (len >= sizeof(ctx->socket_dir.buf)) {
TALLOC_FREE(ctx);
return ENAMETOOLONG;
}
socket_address = (struct sockaddr_un) { .sun_family = AF_UNIX };
len = snprintf(socket_address.sun_path,
sizeof(socket_address.sun_path),
"%s/%u", socket_dir, (unsigned)ctx->pid);
if (len >= sizeof(socket_address.sun_path)) {
TALLOC_FREE(ctx);
return ENAMETOOLONG;
}
ret = <API key>(ctx, ctx->pid, &ctx->lockfile_fd,
punique);
if (ret != 0) {
DEBUG(1, ("%s: <API key> failed: %s\n",
__func__, strerror(ret)));
TALLOC_FREE(ctx);
return ret;
}
ctx->msg_callbacks = <API key>(ctx);
if (ctx->msg_callbacks == NULL) {
goto fail_nomem;
}
ctx->tevent_handle = <API key>(
ctx, ctx->msg_callbacks, ev);
if (ctx->tevent_handle == NULL) {
goto fail_nomem;
}
unlink(socket_address.sun_path);
ret = unix_msg_init(&socket_address, ctx->msg_callbacks, 1024,
messaging_dgm_recv, ctx, &ctx->dgm_ctx);
if (ret != 0) {
DEBUG(1, ("unix_msg_init failed: %s\n", strerror(ret)));
TALLOC_FREE(ctx);
return ret;
}
<API key>(ctx, <API key>);
ctx->have_dgm_context = &have_dgm_context;
global_dgm_context = ctx;
return 0;
fail_nomem:
TALLOC_FREE(ctx);
return ENOMEM;
}
static int <API key>(struct <API key> *c)
{
/*
* First delete the socket to avoid races. The lockfile is the
* indicator that we're still around.
*/
unix_msg_free(c->dgm_ctx);
if (getpid() == c->pid) {
struct sun_path_buf name;
int ret;
ret = snprintf(name.buf, sizeof(name.buf), "%s/%u",
c->lockfile_dir.buf, (unsigned)c->pid);
if (ret >= sizeof(name.buf)) {
/*
* We've checked the length when creating, so this
* should never happen
*/
abort();
}
unlink(name.buf);
}
close(c->lockfile_fd);
if (c->have_dgm_context != NULL) {
*c->have_dgm_context = false;
}
return 0;
}
void <API key>(void)
{
TALLOC_FREE(global_dgm_context);
}
int messaging_dgm_send(pid_t pid,
const struct iovec *iov, int iovlen,
const int *fds, size_t num_fds)
{
struct <API key> *ctx = global_dgm_context;
struct sockaddr_un dst;
ssize_t dst_pathlen;
int ret;
if (ctx == NULL) {
return ENOTCONN;
}
dst = (struct sockaddr_un) { .sun_family = AF_UNIX };
dst_pathlen = snprintf(dst.sun_path, sizeof(dst.sun_path),
"%s/%u", ctx->socket_dir.buf, (unsigned)pid);
if (dst_pathlen >= sizeof(dst.sun_path)) {
return ENAMETOOLONG;
}
DEBUG(10, ("%s: Sending message to %u\n", __func__, (unsigned)pid));
ret = unix_msg_send(ctx->dgm_ctx, &dst, iov, iovlen, fds, num_fds);
return ret;
}
static void messaging_dgm_recv(struct unix_msg_ctx *ctx,
uint8_t *msg, size_t msg_len,
int *fds, size_t num_fds,
void *private_data)
{
struct <API key> *dgm_ctx = <API key>(
private_data, struct <API key>);
dgm_ctx->recv_cb(msg, msg_len, fds, num_fds,
dgm_ctx-><API key>);
}
static int <API key>(int fd, uint64_t *punique)
{
char buf[25];
ssize_t rw_ret;
unsigned long long unique;
char *endptr;
rw_ret = pread(fd, buf, sizeof(buf)-1, 0);
if (rw_ret == -1) {
return errno;
}
buf[rw_ret] = '\0';
unique = strtoull(buf, &endptr, 10);
if ((unique == 0) && (errno == EINVAL)) {
return EINVAL;
}
if ((unique == ULLONG_MAX) && (errno == ERANGE)) {
return ERANGE;
}
if (endptr[0] != '\n') {
return EINVAL;
}
*punique = unique;
return 0;
}
int <API key>(pid_t pid, uint64_t *unique)
{
struct <API key> *ctx = global_dgm_context;
struct sun_path_buf lockfile_name;
int ret, fd;
if (ctx == NULL) {
return EBADF;
}
if (pid == getpid()) {
/*
* Protect against losing our own lock
*/
return <API key>(ctx->lockfile_fd, unique);
}
ret = snprintf(lockfile_name.buf, sizeof(lockfile_name.buf),
"%s/%u", ctx->lockfile_dir.buf, (int)pid);
if (ret >= sizeof(lockfile_name.buf)) {
return ENAMETOOLONG;
}
fd = open(lockfile_name.buf, O_NONBLOCK|O_RDONLY, 0);
if (fd == -1) {
return errno;
}
ret = <API key>(fd, unique);
close(fd);
return ret;
}
int <API key>(pid_t pid)
{
struct <API key> *ctx = global_dgm_context;
struct sun_path_buf lockfile_name, socket_name;
int fd, len, ret;
struct flock lck = {};
if (ctx == NULL) {
return ENOTCONN;
}
len = snprintf(socket_name.buf, sizeof(socket_name.buf), "%s/%u",
ctx->socket_dir.buf, (unsigned)pid);
if (len >= sizeof(socket_name.buf)) {
return ENAMETOOLONG;
}
len = snprintf(lockfile_name.buf, sizeof(lockfile_name.buf), "%s/%u",
ctx->lockfile_dir.buf, (unsigned)pid);
if (len >= sizeof(lockfile_name.buf)) {
return ENAMETOOLONG;
}
fd = open(lockfile_name.buf, O_NONBLOCK|O_WRONLY, 0);
if (fd == -1) {
ret = errno;
if (ret != ENOENT) {
DEBUG(10, ("%s: open(%s) failed: %s\n", __func__,
lockfile_name.buf, strerror(ret)));
}
return ret;
}
lck.l_type = F_WRLCK;
lck.l_whence = SEEK_SET;
lck.l_start = 0;
lck.l_len = 0;
ret = fcntl(fd, F_SETLK, &lck);
if (ret != 0) {
ret = errno;
if ((ret != EACCES) && (ret != EAGAIN)) {
DEBUG(10, ("%s: Could not get lock: %s\n", __func__,
strerror(ret)));
}
close(fd);
return ret;
}
DEBUG(10, ("%s: Cleaning up : %s\n", __func__, strerror(ret)));
(void)unlink(socket_name.buf);
(void)unlink(lockfile_name.buf);
(void)close(fd);
return 0;
}
int messaging_dgm_wipe(void)
{
struct <API key> *ctx = global_dgm_context;
DIR *msgdir;
struct dirent *dp;
pid_t our_pid = getpid();
int ret;
if (ctx == NULL) {
return ENOTCONN;
}
/*
* We scan the socket directory and not the lock directory. Otherwise
* we would race against <API key>'s open(O_CREAT)
* and fcntl(SETLK).
*/
msgdir = opendir(ctx->socket_dir.buf);
if (msgdir == NULL) {
return errno;
}
while ((dp = readdir(msgdir)) != NULL) {
unsigned long pid;
pid = strtoul(dp->d_name, NULL, 10);
if (pid == 0) {
/*
* . and .. and other malformed entries
*/
continue;
}
if (pid == our_pid) {
/*
* fcntl(F_GETLK) will succeed for ourselves, we hold
* that lock ourselves.
*/
continue;
}
ret = <API key>(pid);
DEBUG(10, ("<API key>(%lu) returned %s\n",
pid, ret ? strerror(ret) : "ok"));
}
closedir(msgdir);
return 0;
}
void *<API key>(TALLOC_CTX *mem_ctx,
struct tevent_context *ev)
{
struct <API key> *ctx = global_dgm_context;
if (ctx == NULL) {
return NULL;
}
return <API key>(mem_ctx, ctx->msg_callbacks, ev);
} |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
other property
"""
import copy
from rebulk import Rebulk, Rule, RemoveMatch, RenameMatch, POST_PROCESS, AppendMatch
from rebulk.remodule import re
from ..common import dash
from ..common import seps
from ..common.pattern import is_disabled
from ..common.validators import seps_after, seps_before, seps_surround, and_
from ...reutils import build_or_pattern
from ...rules.common.formatters import raw_cleanup
def other(config): # pylint:disable=unused-argument,too-many-statements
"""
Builder for rebulk object.
:param config: rule configuration
:type config: dict
:return: Created Rebulk object
:rtype: Rebulk
"""
rebulk = Rebulk(disabled=lambda context: is_disabled(context, 'other'))
rebulk = rebulk.regex_defaults(flags=re.IGNORECASE, abbreviations=[dash]).string_defaults(ignore_case=True)
rebulk.defaults(name="other", validator=seps_surround)
rebulk.regex('Audio-?Fix', 'Audio-?Fixed', value='Audio Fixed')
rebulk.regex('Sync-?Fix', 'Sync-?Fixed', value='Sync Fixed')
rebulk.regex('Dual', 'Dual-?Audio', value='Dual Audio')
rebulk.regex('ws', 'wide-?screen', value='Widescreen')
rebulk.regex('Re-?Enc(?:oded)?', value='Reencoded')
rebulk.string('Repack', 'Rerip', value='Proper',
tags=['streaming_service.prefix', 'streaming_service.suffix'])
rebulk.string('Proper', value='Proper',
tags=['has-neighbor', 'streaming_service.prefix', 'streaming_service.suffix'])
rebulk.regex('Real-Proper', 'Real-Repack', 'Real-Rerip', value='Proper',
tags=['streaming_service.prefix', 'streaming_service.suffix', 'real'])
rebulk.regex('Real', value='Proper',
tags=['has-neighbor', 'streaming_service.prefix', 'streaming_service.suffix', 'real'])
rebulk.string('Fix', 'Fixed', value='Fix', tags=['has-neighbor-before', 'has-neighbor-after',
'streaming_service.prefix', 'streaming_service.suffix'])
rebulk.string('Dirfix', 'Nfofix', 'Prooffix', value='Fix',
tags=['streaming_service.prefix', 'streaming_service.suffix'])
rebulk.regex('(?:Proof-?)?Sample-?Fix', value='Fix',
tags=['streaming_service.prefix', 'streaming_service.suffix'])
rebulk.string('Fansub', value='Fan Subtitled', tags='has-neighbor')
rebulk.string('Fastsub', value='Fast Subtitled', tags='has-neighbor')
season_words = build_or_pattern(["seasons?", "series?"])
complete_articles = build_or_pattern(["The"])
def validate_complete(match):
"""
Make sure season word is are defined.
:param match:
:type match:
:return:
:rtype:
"""
children = match.children
if not children.named('completeWordsBefore') and not children.named('completeWordsAfter'):
return False
return True
rebulk.regex('(?P<completeArticle>' + complete_articles + '-)?' +
'(?P<completeWordsBefore>' + season_words + '-)?' +
'Complete' + '(?P<completeWordsAfter>-' + season_words + ')?',
private_names=['completeArticle', 'completeWordsBefore', 'completeWordsAfter'],
value={'other': 'Complete'},
tags=['<API key>'],
validator={'__parent__': and_(seps_surround, validate_complete)})
rebulk.string('R5', value='Region 5')
rebulk.string('RC', value='Region C')
rebulk.regex('Pre-?Air', value='Preair')
rebulk.regex('(?:PS-?)Vita', value='PS Vita')
rebulk.regex('Vita', value='PS Vita', tags='has-neighbor')
rebulk.regex('(HD)(?P<another>Rip)', value={'other': 'HD', 'another': 'Rip'},
private_parent=True, children=True, validator={'__parent__': seps_surround}, validate_all=True)
for value in ('Screener', 'Remux', 'PAL', 'SECAM', 'NTSC', 'XXX'):
rebulk.string(value, value=value)
rebulk.string('3D', value='3D', tags='has-neighbor')
rebulk.string('HQ', value='High Quality', tags='uhdbluray-neighbor')
rebulk.string('HR', value='High Resolution')
rebulk.string('LD', value='Line Dubbed')
rebulk.string('MD', value='Mic Dubbed')
rebulk.string('mHD', 'HDLight', value='Micro HD')
rebulk.string('LDTV', value='Low Definition')
rebulk.string('HFR', value='High Frame Rate')
rebulk.string('VFR', value='Variable Frame Rate')
rebulk.string('HD', value='HD', validator=None,
tags=['streaming_service.prefix', 'streaming_service.suffix'])
rebulk.regex('Full-?HD', 'FHD', value='Full HD', validator=None,
tags=['streaming_service.prefix', 'streaming_service.suffix'])
rebulk.regex('Ultra-?(?:HD)?', 'UHD', value='Ultra HD', validator=None,
tags=['streaming_service.prefix', 'streaming_service.suffix'])
rebulk.regex('Upscaled?', value='Upscaled')
for value in ('Complete', 'Classic', 'Bonus', 'Trailer', 'Retail',
'Colorized', 'Internal'):
rebulk.string(value, value=value, tags=['has-neighbor', '<API key>'])
rebulk.regex('LiNE', value='Line Audio', tags=['has-neighbor-before', 'has-neighbor-after', '<API key>'])
rebulk.regex('Read-?NFO', value='Read NFO')
rebulk.string('CONVERT', value='Converted', tags='has-neighbor')
rebulk.string('DOCU', 'DOKU', value='Documentary', tags='has-neighbor')
rebulk.string('OM', value='Open Matte', tags='has-neighbor')
rebulk.string('STV', value='Straight to Video', tags='has-neighbor')
rebulk.string('OAR', value='Original Aspect Ratio', tags='has-neighbor')
rebulk.string('Complet', value='Complete', tags=['has-neighbor', '<API key>'])
for coast in ('East', 'West'):
rebulk.regex(r'(?:Live-)?(?:Episode-)?' + coast + '-?(?:Coast-)?Feed', value=coast + ' Coast Feed')
rebulk.string('VO', 'OV', value='Original Video', tags='has-neighbor')
rebulk.string('Ova', 'Oav', value='Original Animated Video')
rebulk.regex('Scr(?:eener)?', value='Screener', validator=None,
tags=['other.validate.screener', 'source-prefix', 'source-suffix'])
rebulk.string('Mux', value='Mux', validator=seps_after,
tags=['other.validate.mux', 'video-codec-prefix', 'source-suffix'])
rebulk.string('HC', 'vost', value='Hardcoded Subtitles')
rebulk.string('SDR', value='Standard Dynamic Range', tags='uhdbluray-neighbor')
rebulk.regex('HDR(?:10)?', value='HDR10', tags='uhdbluray-neighbor')
rebulk.regex('Dolby-?Vision', value='Dolby Vision', tags='uhdbluray-neighbor')
rebulk.regex('BT-?2020', value='BT.2020', tags='uhdbluray-neighbor')
rebulk.string('Sample', value='Sample', tags=['at-end', 'not-a-release-group'])
rebulk.string('Extras', value='Extras', tags='has-neighbor')
rebulk.regex('Digital-?Extras?', value='Extras')
rebulk.string('Proof', value='Proof', tags=['at-end', 'not-a-release-group'])
rebulk.string('Obfuscated', 'Scrambled', value='Obfuscated', tags=['at-end', 'not-a-release-group'])
rebulk.string('xpost', 'postbot', 'asrequested', value='Repost', tags='not-a-release-group')
rebulk.rules(<API key>, ValidateHasNeighbor, <API key>, <API key>,
<API key>, ValidateMuxRule, <API key>, <API key>,
ValidateAtEnd, ValidateReal, ProperCountRule)
return rebulk
class ProperCountRule(Rule):
"""
Add proper_count property
"""
priority = POST_PROCESS
consequence = AppendMatch
properties = {'proper_count': [None]}
def when(self, matches, context): # pylint:disable=<API key>
propers = matches.named('other', lambda match: match.value == 'Proper')
if propers:
raws = {} # Count distinct raw values
for proper in propers:
raws[raw_cleanup(proper.raw)] = proper
proper_count_match = copy.copy(propers[-1])
proper_count_match.name = 'proper_count'
value = 0
for raw in raws.values():
value += 2 if 'real' in raw.tags else 1
proper_count_match.value = value
return proper_count_match
class <API key>(Rule):
"""
Rename `another` properties to `other`
"""
priority = 32
consequence = RenameMatch('other')
def when(self, matches, context):
return matches.named('another')
class ValidateHasNeighbor(Rule):
"""
Validate tag has-neighbor
"""
consequence = RemoveMatch
priority = 64
def when(self, matches, context):
ret = []
for to_check in matches.range(predicate=lambda match: 'has-neighbor' in match.tags):
previous_match = matches.previous(to_check, index=0)
previous_group = matches.markers.previous(to_check, lambda marker: marker.name == 'group', 0)
if previous_group and (not previous_match or previous_group.end > previous_match.end):
previous_match = previous_group
if previous_match and not matches.input_string[previous_match.end:to_check.start].strip(seps):
break
next_match = matches.next(to_check, index=0)
next_group = matches.markers.next(to_check, lambda marker: marker.name == 'group', 0)
if next_group and (not next_match or next_group.start < next_match.start):
next_match = next_group
if next_match and not matches.input_string[to_check.end:next_match.start].strip(seps):
break
ret.append(to_check)
return ret
class <API key>(Rule):
"""
Validate tag has-neighbor-before that previous match exists.
"""
consequence = RemoveMatch
priority = 64
def when(self, matches, context):
ret = []
for to_check in matches.range(predicate=lambda match: 'has-neighbor-before' in match.tags):
next_match = matches.next(to_check, index=0)
next_group = matches.markers.next(to_check, lambda marker: marker.name == 'group', 0)
if next_group and (not next_match or next_group.start < next_match.start):
next_match = next_group
if next_match and not matches.input_string[to_check.end:next_match.start].strip(seps):
break
ret.append(to_check)
return ret
class <API key>(Rule):
"""
Validate tag has-neighbor-after that next match exists.
"""
consequence = RemoveMatch
priority = 64
def when(self, matches, context):
ret = []
for to_check in matches.range(predicate=lambda match: 'has-neighbor-after' in match.tags):
previous_match = matches.previous(to_check, index=0)
previous_group = matches.markers.previous(to_check, lambda marker: marker.name == 'group', 0)
if previous_group and (not previous_match or previous_group.end > previous_match.end):
previous_match = previous_group
if previous_match and not matches.input_string[previous_match.end:to_check.start].strip(seps):
break
ret.append(to_check)
return ret
class <API key>(Rule):
"""
Validate tag other.validate.screener
"""
consequence = RemoveMatch
priority = 64
def when(self, matches, context):
ret = []
for screener in matches.named('other', lambda match: 'other.validate.screener' in match.tags):
source_match = matches.previous(screener, lambda match: match.initiator.name == 'source', 0)
if not source_match or matches.input_string[source_match.end:screener.start].strip(seps):
ret.append(screener)
return ret
class ValidateMuxRule(Rule):
"""
Validate tag other.validate.mux
"""
consequence = RemoveMatch
priority = 64
def when(self, matches, context):
ret = []
for mux in matches.named('other', lambda match: 'other.validate.mux' in match.tags):
source_match = matches.previous(mux, lambda match: match.initiator.name == 'source', 0)
if not source_match:
ret.append(mux)
return ret
class <API key>(Rule):
"""Validate HC matches."""
priority = 32
consequence = RemoveMatch
def when(self, matches, context):
to_remove = []
for hc_match in matches.named('other', predicate=lambda match: match.value == 'Hardcoded Subtitles'):
next_match = matches.next(hc_match, predicate=lambda match: match.name == 'subtitle_language', index=0)
if next_match and not matches.holes(hc_match.end, next_match.start,
predicate=lambda match: match.value.strip(seps)):
continue
previous_match = matches.previous(hc_match,
predicate=lambda match: match.name == 'subtitle_language', index=0)
if previous_match and not matches.holes(previous_match.end, hc_match.start,
predicate=lambda match: match.value.strip(seps)):
continue
to_remove.append(hc_match)
return to_remove
class <API key>(Rule):
"""Validate streaming service's neighbors."""
priority = 32
consequence = RemoveMatch
def when(self, matches, context):
to_remove = []
for match in matches.named('other',
predicate=lambda m: (m.initiator.name != 'source'
and ('streaming_service.prefix' in m.tags
or 'streaming_service.suffix' in m.tags))):
match = match.initiator
if not seps_after(match):
if 'streaming_service.prefix' in match.tags:
next_match = matches.next(match, lambda m: m.name == 'streaming_service', 0)
if next_match and not matches.holes(match.end, next_match.start,
predicate=lambda m: m.value.strip(seps)):
continue
if match.children:
to_remove.extend(match.children)
to_remove.append(match)
elif not seps_before(match):
if 'streaming_service.suffix' in match.tags:
previous_match = matches.previous(match, lambda m: m.name == 'streaming_service', 0)
if previous_match and not matches.holes(previous_match.end, match.start,
predicate=lambda m: m.value.strip(seps)):
continue
if match.children:
to_remove.extend(match.children)
to_remove.append(match)
return to_remove
class ValidateAtEnd(Rule):
"""Validate other which should occur at the end of a filepart."""
priority = 32
consequence = RemoveMatch
def when(self, matches, context):
to_remove = []
for filepart in matches.markers.named('path'):
for match in matches.range(filepart.start, filepart.end,
predicate=lambda m: m.name == 'other' and 'at-end' in m.tags):
if (matches.holes(match.end, filepart.end, predicate=lambda m: m.value.strip(seps)) or
matches.range(match.end, filepart.end, predicate=lambda m: m.name not in (
'other', 'container'))):
to_remove.append(match)
return to_remove
class ValidateReal(Rule):
"""
Validate Real
"""
consequence = RemoveMatch
priority = 64
def when(self, matches, context):
ret = []
for filepart in matches.markers.named('path'):
for match in matches.range(filepart.start, filepart.end, lambda m: m.name == 'other' and 'real' in m.tags):
if not matches.range(filepart.start, match.start):
ret.append(match)
return ret |
package ai.grakn.graql.internal.pattern;
import ai.grakn.concept.ConceptId;
import ai.grakn.concept.ResourceType;
import ai.grakn.concept.TypeLabel;
import ai.grakn.exception.GraqlQueryException;
import ai.grakn.graql.Graql;
import ai.grakn.graql.Pattern;
import ai.grakn.graql.ValuePredicate;
import ai.grakn.graql.Var;
import ai.grakn.graql.VarPattern;
import ai.grakn.graql.VarPatternBuilder;
import ai.grakn.graql.admin.Conjunction;
import ai.grakn.graql.admin.Disjunction;
import ai.grakn.graql.admin.RelationPlayer;
import ai.grakn.graql.admin.UniqueVarProperty;
import ai.grakn.graql.admin.VarPatternAdmin;
import ai.grakn.graql.admin.VarProperty;
import ai.grakn.graql.internal.pattern.property.DataTypeProperty;
import ai.grakn.graql.internal.pattern.property.HasResourceProperty;
import ai.grakn.graql.internal.pattern.property.<API key>;
import ai.grakn.graql.internal.pattern.property.HasScopeProperty;
import ai.grakn.graql.internal.pattern.property.IdProperty;
import ai.grakn.graql.internal.pattern.property.IsAbstractProperty;
import ai.grakn.graql.internal.pattern.property.IsaProperty;
import ai.grakn.graql.internal.pattern.property.LabelProperty;
import ai.grakn.graql.internal.pattern.property.LhsProperty;
import ai.grakn.graql.internal.pattern.property.NeqProperty;
import ai.grakn.graql.internal.pattern.property.PlaysProperty;
import ai.grakn.graql.internal.pattern.property.RegexProperty;
import ai.grakn.graql.internal.pattern.property.RelatesProperty;
import ai.grakn.graql.internal.pattern.property.RelationProperty;
import ai.grakn.graql.internal.pattern.property.RhsProperty;
import ai.grakn.graql.internal.pattern.property.SubProperty;
import ai.grakn.graql.internal.pattern.property.ValueProperty;
import ai.grakn.util.CommonUtil;
import ai.grakn.graql.internal.util.StringConverter;
import ai.grakn.util.ErrorMessage;
import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableMultiset;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Sets;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Optional;
import java.util.Set;
import java.util.Stack;
import java.util.function.UnaryOperator;
import java.util.stream.Stream;
import static ai.grakn.util.CommonUtil.toImmutableSet;
import static java.util.Objects.requireNonNull;
import static java.util.stream.Collectors.toSet;
/**
* Implementation of {@link VarPattern} interface
*/
class VarPatternImpl implements VarPatternAdmin {
private final Var name;
private final Set<VarProperty> properties;
VarPatternImpl(Var name, Set<VarProperty> properties) {
this.name = name;
this.properties = properties;
}
@Override
public VarPattern id(ConceptId id) {
return addProperty(new IdProperty(id));
}
@Override
public VarPattern label(String label) {
return label(TypeLabel.of(label));
}
@Override
public VarPattern label(TypeLabel label) {
return addProperty(new LabelProperty(label));
}
@Override
public VarPattern val(Object value) {
return val(Graql.eq(value));
}
@Override
public VarPattern val(ValuePredicate predicate) {
return addProperty(new ValueProperty(predicate.admin()));
}
@Override
public VarPattern has(String type, Object value) {
return has(type, Graql.eq(value));
}
@Override
public VarPattern has(String type, ValuePredicate predicate) {
return has(type, Graql.var().val(predicate));
}
@Override
public VarPattern has(String type, VarPatternBuilder varPattern) {
return has(TypeLabel.of(type), varPattern);
}
@Override
public VarPattern has(TypeLabel type, VarPatternBuilder varPattern) {
return addProperty(HasResourceProperty.of(type, varPattern.pattern().admin()));
}
@Override
public VarPattern isa(String type) {
return isa(Graql.label(type));
}
@Override
public VarPattern isa(VarPatternBuilder type) {
return addProperty(new IsaProperty(type.pattern().admin()));
}
@Override
public VarPattern sub(String type) {
return sub(Graql.label(type));
}
@Override
public VarPattern sub(VarPatternBuilder type) {
return addProperty(new SubProperty(type.pattern().admin()));
}
@Override
public VarPattern relates(String type) {
return relates(Graql.label(type));
}
@Override
public VarPattern relates(VarPatternBuilder type) {
return addProperty(new RelatesProperty(type.pattern().admin()));
}
@Override
public VarPattern plays(String type) {
return plays(Graql.label(type));
}
@Override
public VarPattern plays(VarPatternBuilder type) {
return addProperty(new PlaysProperty(type.pattern().admin(), false));
}
@Override
public VarPattern hasScope(VarPatternBuilder type) {
return addProperty(new HasScopeProperty(type.pattern().admin()));
}
@Override
public VarPattern has(String type) {
return has(Graql.label(type));
}
@Override
public VarPattern has(VarPatternBuilder type) {
return addProperty(new <API key>(type.pattern().admin(), false));
}
@Override
public VarPattern key(String type) {
return key(Graql.var().label(type));
}
@Override
public VarPattern key(VarPatternBuilder type) {
return addProperty(new <API key>(type.pattern().admin(), true));
}
@Override
public VarPattern rel(String roleplayer) {
return rel(Graql.var(roleplayer));
}
@Override
public VarPattern rel(VarPatternBuilder roleplayer) {
return addCasting(RelationPlayerImpl.of(roleplayer.pattern().admin()));
}
@Override
public VarPattern rel(String roletype, String roleplayer) {
return rel(Graql.label(roletype), Graql.var(roleplayer));
}
@Override
public VarPattern rel(VarPatternBuilder roletype, String roleplayer) {
return rel(roletype, Graql.var(roleplayer));
}
@Override
public VarPattern rel(String roletype, VarPatternBuilder roleplayer) {
return rel(Graql.label(roletype), roleplayer);
}
@Override
public VarPattern rel(VarPatternBuilder roletype, VarPatternBuilder roleplayer) {
return addCasting(RelationPlayerImpl.of(roletype.pattern().admin(), roleplayer.pattern().admin()));
}
@Override
public VarPattern isAbstract() {
return addProperty(new IsAbstractProperty());
}
@Override
public VarPattern datatype(ResourceType.DataType<?> datatype) {
return addProperty(new DataTypeProperty(requireNonNull(datatype)));
}
@Override
public VarPattern regex(String regex) {
return addProperty(new RegexProperty(regex));
}
@Override
public VarPattern lhs(Pattern lhs) {
return addProperty(new LhsProperty(lhs));
}
@Override
public VarPattern rhs(Pattern rhs) {
return addProperty(new RhsProperty(rhs));
}
@Override
public VarPattern neq(String var) {
return neq(Graql.var(var));
}
@Override
public VarPattern neq(VarPatternBuilder varPattern) {
return addProperty(new NeqProperty(varPattern.pattern().admin()));
}
@Override
public VarPattern pattern() {
return this;
}
@Override
public VarPatternAdmin admin() {
return this;
}
@Override
public Optional<ConceptId> getId() {
return getProperty(IdProperty.class).map(IdProperty::getId);
}
@Override
public Optional<TypeLabel> getTypeLabel() {
return getProperty(LabelProperty.class).map(LabelProperty::getLabelValue);
}
@Override
public Var getVarName() {
return name;
}
@Override
public VarPatternAdmin setVarName(Var name) {
Preconditions.checkState(this.name.isUserDefinedName(), ErrorMessage.<API key>.getMessage(name));
return new VarPatternImpl(name, properties);
}
@Override
public String getPrintableName() {
if (name.isUserDefinedName()) {
return name.toString();
} else {
return getTypeLabel().map(StringConverter::typeLabelToString).orElse("'" + toString() + "'");
}
}
@Override
public Stream<VarProperty> getProperties() {
return properties.stream();
}
@Override
public <T extends VarProperty> Stream<T> getProperties(Class<T> type) {
return getProperties().filter(type::isInstance).map(type::cast);
}
@Override
public <T extends UniqueVarProperty> Optional<T> getProperty(Class<T> type) {
return getProperties().filter(type::isInstance).map(type::cast).findAny();
}
@Override
public <T extends VarProperty> boolean hasProperty(Class<T> type) {
return getProperties(type).findAny().isPresent();
}
@Override
public <T extends VarProperty> VarPatternAdmin mapProperty(Class<T> type, UnaryOperator<T> mapper) {
ImmutableSet<VarProperty> newProperties = getProperties().map(property -> {
if (type.isInstance(property)) {
return mapper.apply(type.cast(property));
} else {
return property;
}
}).collect(toImmutableSet());
return new VarPatternImpl(name, newProperties);
}
@Override
public Collection<VarPatternAdmin> getInnerVars() {
Stack<VarPatternAdmin> newVars = new Stack<>();
List<VarPatternAdmin> vars = new ArrayList<>();
newVars.add(this);
while (!newVars.isEmpty()) {
VarPatternAdmin var = newVars.pop();
vars.add(var);
var.getProperties().flatMap(VarProperty::getInnerVars).forEach(newVars::add);
}
return vars;
}
@Override
public Collection<VarPatternAdmin> <API key>() {
Stack<VarPatternAdmin> newVars = new Stack<>();
List<VarPatternAdmin> vars = new ArrayList<>();
newVars.add(this);
while (!newVars.isEmpty()) {
VarPatternAdmin var = newVars.pop();
vars.add(var);
var.getProperties().flatMap(VarProperty::<API key>).forEach(newVars::add);
}
return vars;
}
@Override
public Set<TypeLabel> getTypeLabels() {
return getProperties()
.flatMap(VarProperty::getTypes)
.map(VarPatternAdmin::getTypeLabel).flatMap(CommonUtil::optionalToStream)
.collect(toSet());
}
@Override
public String toString() {
Collection<VarPatternAdmin> innerVars = getInnerVars();
innerVars.remove(this);
getProperties(HasResourceProperty.class)
.map(HasResourceProperty::getResource)
.flatMap(r -> r.getInnerVars().stream())
.forEach(innerVars::remove);
if (innerVars.stream().anyMatch(VarPatternImpl::<API key>)) {
throw new <API key>("Graql strings cannot represent a query with inner variables");
}
StringBuilder builder = new StringBuilder();
String name = this.name.isUserDefinedName() ? getPrintableName() : "";
builder.append(name);
if (this.name.isUserDefinedName() && !properties.isEmpty()) {
// Add a space after the var name
builder.append(" ");
}
boolean first = true;
for (VarProperty property : properties) {
if (!first) {
builder.append(" ");
}
first = false;
property.buildString(builder);
}
return builder.toString();
}
private VarPattern addCasting(RelationPlayer relationPlayer) {
Optional<RelationProperty> relationProperty = getProperty(RelationProperty.class);
Stream<RelationPlayer> oldCastings = relationProperty
.map(RelationProperty::getRelationPlayers)
.orElse(Stream.empty());
ImmutableMultiset<RelationPlayer> relationPlayers =
Stream.concat(oldCastings, Stream.of(relationPlayer)).collect(CommonUtil.toImmutableMultiset());
RelationProperty newProperty = new RelationProperty(relationPlayers);
return relationProperty.map(this::removeProperty).orElse(this).addProperty(newProperty);
}
private static boolean <API key>(VarPatternAdmin var) {
return var.getProperties().anyMatch(p -> !(p instanceof LabelProperty));
}
private VarPatternImpl addProperty(VarProperty property) {
if (property.isUnique()) {
testUniqueProperty((UniqueVarProperty) property);
}
return new VarPatternImpl(name, Sets.union(properties, ImmutableSet.of(property)));
}
private VarPatternImpl removeProperty(VarProperty property) {
return new VarPatternImpl(name, Sets.difference(properties, ImmutableSet.of(property)));
}
/**
* Fail if there is already an equal property of this type
*/
private void testUniqueProperty(UniqueVarProperty property) {
getProperty(property.getClass()).filter(other -> !other.equals(property)).ifPresent(other -> {
throw GraqlQueryException.<API key>(this, property, other);
});
}
@Override
public Disjunction<Conjunction<VarPatternAdmin>> <API key>() {
// a disjunction containing only one option
Conjunction<VarPatternAdmin> conjunction = Patterns.conjunction(Collections.singleton(this));
return Patterns.disjunction(Collections.singleton(conjunction));
}
@Override
public Set<Var> commonVarNames() {
return getInnerVars().stream()
.filter(v -> v.getVarName().isUserDefinedName())
.map(VarPatternAdmin::getVarName)
.collect(toSet());
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
VarPatternImpl var = (VarPatternImpl) o;
if (name.isUserDefinedName() != var.name.isUserDefinedName()) return false;
// "simplifying" this makes it harder to read
//noinspection <API key>
if (!properties.equals(var.properties)) return false;
return !name.isUserDefinedName() || name.equals(var.name);
}
@Override
public int hashCode() {
int result = properties.hashCode();
if (name.isUserDefinedName()) result = 31 * result + name.hashCode();
result = 31 * result + (name.isUserDefinedName() ? 1 : 0);
return result;
}
} |
package com.bluepowermod.api.misc;
public enum MinecraftColor {
WHITE(0xEBEBEB, 0xF0F0F0, 0xFFFFFF, 'f'),
ORANGE(0xCC7437, 0xEB8844, 0xF7A165, '6'),
MAGENTA(0xB041BA, 0xC354CD, 0xDF79E8, '1'),
LIGHT_BLUE(0x4D73C4, 0x6689D3, 0xA5BEF2, 'b'),
YELLOW(0xBAAD1E, 0xDECF2A, 0xFAE92F, 'w'),
LIME(0x3BB830, 0x41CD34, 0x8FF086, 'a'),
PINK(0xB0687B, 0xD88198, 0xE8B3C1, 'd'),
GRAY(0x2B2B2B, 0x434343, 0x575757, '8'),
LIGHT_GRAY(0xFFFFFF, 0xABABAB, 0xFFFFFF, '7'),
CYAN(0x195C78, 0x287697, 0x4688A3, '3'),
PURPLE(0x591D8F, 0x7B2FBE, 0x9C60D1, '5'),
BLUE(0x172173, 0x253192, 0x3443BF, '1'),
BROWN(0x2E1B0F, 0x51301A, 0x63381B, '4'),
GREEN(0x25330F, 0x3B511A, 0x577826, '2'),
RED(0x872926, 0xB3312C, 0xE03E38, 'c'),
BLACK(0x040404, 0x1E1B1B, 0x2B2B2B, '0'),
NONE(-1, -1, -1, (char) 0),
ANY(-1, -1, -1, (char) 0);
public static MinecraftColor[] VALID_COLORS = { WHITE, ORANGE, MAGENTA, LIGHT_BLUE, YELLOW, LIME, PINK, GRAY, LIGHT_GRAY, CYAN, PURPLE,
BLUE, BROWN, GREEN, RED, BLACK };
public static MinecraftColor[] WIRE_COLORS = { WHITE, ORANGE, MAGENTA, LIGHT_BLUE, YELLOW, LIME, PINK, GRAY, LIGHT_GRAY, CYAN, PURPLE,
BLUE, BROWN, GREEN, RED, BLACK, NONE };
private int hexDark, hex, hexLight;
private char chatColorChar;
private MinecraftColor(int hexDark, int hex, int hexLight, char chatColorChar) {
this.hexDark = hexDark;
this.hex = hex;
this.hexLight = hexLight;
this.chatColorChar = chatColorChar;
}
public int getHexDark() {
return hexDark;
}
public int getHex() {
return hex;
}
public int getHexLight() {
return hexLight;
}
public String getChatColor() {
return String.valueOf('\u00a7') + chatColorChar;
}
public char getChatColorChar() {
return chatColorChar;
}
public boolean matches(MinecraftColor color) {
if (this == ANY || color == ANY)
return true;
return this == color;
}
public boolean canConnect(MinecraftColor color) {
if (this == ANY || color == ANY || this == NONE || color == NONE)
return true;
return this == color;
}
@Override
public String toString() {
return getChatColor();
}
} |
#pragma once
namespace Language_hu {
using namespace Language_en;
constexpr uint8_t CHARSIZE = 2;
PROGMEM Language_Str LANGUAGE = _UxGT("Magyar");
PROGMEM Language_Str WELCOME_MSG = MACHINE_NAME _UxGT(" Kész.");
PROGMEM Language_Str MSG_MARLIN = _UxGT("Marlin");
PROGMEM Language_Str MSG_YES = _UxGT("IGEN");
PROGMEM Language_Str MSG_NO = _UxGT("NEM");
PROGMEM Language_Str MSG_BACK = _UxGT("Vissza");
PROGMEM Language_Str MSG_MEDIA_ABORTING = _UxGT("Megszakítás...");
PROGMEM Language_Str MSG_MEDIA_INSERTED = _UxGT("Tároló behelyezve");
PROGMEM Language_Str MSG_MEDIA_REMOVED = _UxGT("Tároló eltávolítva");
PROGMEM Language_Str MSG_MEDIA_WAITING = _UxGT("Várakozás a tárolóra");
PROGMEM Language_Str MSG_SD_INIT_FAIL = _UxGT("SD-kártya hiba");
PROGMEM Language_Str <API key> = _UxGT("Tároló olvasási hiba");
PROGMEM Language_Str <API key> = _UxGT("USB eltávolítva");
PROGMEM Language_Str <API key> = _UxGT("USB eszköz hiba");
PROGMEM Language_Str <API key> = _UxGT("Túlfolyás");
PROGMEM Language_Str MSG_LCD_ENDSTOPS = _UxGT("Végállás"); // Maximum 8 karakter
PROGMEM Language_Str <API key> = _UxGT("Szoft. végállás");
PROGMEM Language_Str MSG_MAIN = _UxGT("<Fömenü>");
PROGMEM Language_Str <API key> = _UxGT("További beállítások");
PROGMEM Language_Str MSG_CONFIGURATION = _UxGT("Konfiguráció");
PROGMEM Language_Str MSG_RUN_AUTO_FILES = _UxGT("Fájl auto. futtatás");
PROGMEM Language_Str <API key> = _UxGT("Motorok kikapcsolása");
PROGMEM Language_Str MSG_DEBUG_MENU = _UxGT("Hiba Menü");
PROGMEM Language_Str <API key> = _UxGT("Haladás sáv teszt");
PROGMEM Language_Str MSG_AUTO_HOME = _UxGT("X-Y-Z auto kezdöpont");
PROGMEM Language_Str MSG_AUTO_HOME_X = _UxGT("X kezdöpont");
PROGMEM Language_Str MSG_AUTO_HOME_Y = _UxGT("Y kezdöpont");
PROGMEM Language_Str MSG_AUTO_HOME_Z = _UxGT("Z kezdöpont");
PROGMEM Language_Str MSG_AUTO_HOME_I = _UxGT("Kezdö ") LCD_STR_I;
PROGMEM Language_Str MSG_AUTO_HOME_J = _UxGT("Kezdö ") LCD_STR_J;
PROGMEM Language_Str MSG_AUTO_HOME_K = _UxGT("Kezdö ") LCD_STR_K;
PROGMEM Language_Str MSG_AUTO_Z_ALIGN = _UxGT("Auto Z-igazítás");
PROGMEM Language_Str MSG_ITERATION = _UxGT("G34 Ismétlés: %i");
PROGMEM Language_Str <API key> = _UxGT("Pontosság csökken!");
PROGMEM Language_Str <API key> = _UxGT("Pontosság elérve");
PROGMEM Language_Str <API key> = _UxGT("X-Y-Z kezdöpont");
PROGMEM Language_Str <API key> = _UxGT("Kattints a kezdéshez.");
PROGMEM Language_Str <API key> = _UxGT("Következö pont");
PROGMEM Language_Str MSG_LEVEL_BED_DONE = _UxGT("Szintezés kész!");
PROGMEM Language_Str MSG_Z_FADE_HEIGHT = _UxGT("Szint csökkentés");
PROGMEM Language_Str <API key> = _UxGT("Kezdöpont eltolás");
PROGMEM Language_Str MSG_HOME_OFFSET_X = _UxGT("X Kezdö eltol.");
PROGMEM Language_Str MSG_HOME_OFFSET_Y = _UxGT("Y Kezdö eltol.");
PROGMEM Language_Str MSG_HOME_OFFSET_Z = _UxGT("Z Kezdö eltol.");
PROGMEM Language_Str MSG_HOME_OFFSET_I = _UxGT("Kezdö eltol. ") LCD_STR_I;
PROGMEM Language_Str MSG_HOME_OFFSET_J = _UxGT("Kezdö eltol. ") LCD_STR_J;
PROGMEM Language_Str MSG_HOME_OFFSET_K = _UxGT("Kezdö eltol. ") LCD_STR_K;
PROGMEM Language_Str <API key> = _UxGT("Eltolás beállítva.");
PROGMEM Language_Str MSG_SET_ORIGIN = _UxGT("Eredeti Be");
PROGMEM Language_Str MSG_TRAMMING_WIZARD = _UxGT("Elektromos varázsló");
PROGMEM Language_Str MSG_SELECT_ORIGIN = _UxGT("Eredeti választása");
PROGMEM Language_Str MSG_LAST_VALUE_SP = _UxGT("Utolsó érték ");
#if PREHEAT_COUNT
PROGMEM Language_Str MSG_PREHEAT_1 = _UxGT("Fütés ") PREHEAT_1_LABEL;
PROGMEM Language_Str MSG_PREHEAT_1_H = _UxGT("Fütés ") PREHEAT_1_LABEL " ~";
PROGMEM Language_Str MSG_PREHEAT_1_END = _UxGT("Fütés ") PREHEAT_1_LABEL _UxGT(" Fej");
PROGMEM Language_Str MSG_PREHEAT_1_END_E = _UxGT("Fütés ") PREHEAT_1_LABEL _UxGT(" Fej ~");
PROGMEM Language_Str MSG_PREHEAT_1_ALL = _UxGT("Fütés ") PREHEAT_1_LABEL _UxGT(" Mind");
PROGMEM Language_Str <API key> = _UxGT("Fütés ") PREHEAT_1_LABEL _UxGT(" Ágy");
PROGMEM Language_Str <API key> = _UxGT("Fütés ") PREHEAT_1_LABEL _UxGT(" Beáll");
PROGMEM Language_Str MSG_PREHEAT_M = _UxGT("Fütés $");
PROGMEM Language_Str MSG_PREHEAT_M_H = _UxGT("Fütés $ ~");
PROGMEM Language_Str MSG_PREHEAT_M_END = _UxGT("Fütés $ Fej");
PROGMEM Language_Str MSG_PREHEAT_M_END_E = _UxGT("Fütés $ Fej ~");
PROGMEM Language_Str MSG_PREHEAT_M_ALL = _UxGT("Fütés $ Mind");
PROGMEM Language_Str <API key> = _UxGT("Fütés $ Ágy");
PROGMEM Language_Str <API key> = _UxGT("Fütés $ Beáll");
#endif
PROGMEM Language_Str MSG_PREHEAT_CUSTOM = _UxGT("Egyedi elömelegítés");
PROGMEM Language_Str MSG_COOLDOWN = _UxGT("Visszahütés");
PROGMEM Language_Str <API key> = _UxGT("Frekvencia");
PROGMEM Language_Str MSG_LASER_MENU = _UxGT("Lézer vezérlés");
PROGMEM Language_Str MSG_SPINDLE_MENU = _UxGT("Orsó vezérlés");
PROGMEM Language_Str MSG_LASER_POWER = _UxGT("Lézer telj.");
PROGMEM Language_Str MSG_SPINDLE_POWER = _UxGT("Orsó telj.");
PROGMEM Language_Str MSG_LASER_TOGGLE = _UxGT("Lézer váltás");
PROGMEM Language_Str <API key> = _UxGT("Hütés váltás");
PROGMEM Language_Str <API key> = _UxGT("Levegö segéd");
PROGMEM Language_Str MSG_LASER_PULSE_MS = _UxGT("Impulzus teszt ms");
PROGMEM Language_Str <API key> = _UxGT("Tüz impulzus");
PROGMEM Language_Str MSG_FLOWMETER_FAULT = _UxGT("Áramlási hiba");
PROGMEM Language_Str MSG_SPINDLE_TOGGLE = _UxGT("Orsóváltás");
PROGMEM Language_Str <API key> = _UxGT("Vákuum váltás");
PROGMEM Language_Str MSG_SPINDLE_FORWARD = _UxGT("Orsó elöre");
PROGMEM Language_Str MSG_SPINDLE_REVERSE = _UxGT("Orsó hátra");
PROGMEM Language_Str MSG_SWITCH_PS_ON = _UxGT("Bekapcsolás");
PROGMEM Language_Str MSG_SWITCH_PS_OFF = _UxGT("Kikapcsolás");
PROGMEM Language_Str MSG_EXTRUDE = _UxGT("Adagol");
PROGMEM Language_Str MSG_RETRACT = _UxGT("Visszahúz");
PROGMEM Language_Str MSG_MOVE_AXIS = _UxGT("Tengelyek mozgatása");
PROGMEM Language_Str MSG_BED_LEVELING = _UxGT("Ágy szintezés");
PROGMEM Language_Str MSG_LEVEL_BED = _UxGT("Ágy szintezése");
PROGMEM Language_Str MSG_BED_TRAMMING = _UxGT("Elektromos segéd");
PROGMEM Language_Str <API key> = _UxGT("Ágy emelése a szonda váltásig");
PROGMEM Language_Str <API key> = _UxGT("Minden sarok tolerancián belül. Szint jó.");
PROGMEM Language_Str <API key> = _UxGT("Jó pontok: ");
PROGMEM Language_Str <API key> = _UxGT("Utolsó Z: ");
PROGMEM Language_Str MSG_NEXT_CORNER = _UxGT("Következö sarok");
PROGMEM Language_Str MSG_MESH_EDITOR = _UxGT("Háló szerkesztö");
PROGMEM Language_Str MSG_EDIT_MESH = _UxGT("Háló szerkesztése");
PROGMEM Language_Str MSG_EDITING_STOPPED = _UxGT("Háló szerk. állj");
PROGMEM Language_Str MSG_PROBING_MESH = _UxGT("Próbapont");
PROGMEM Language_Str MSG_MESH_X = _UxGT("Index X");
PROGMEM Language_Str MSG_MESH_Y = _UxGT("Index Y");
PROGMEM Language_Str MSG_MESH_EDIT_Z = _UxGT("Z érték");
PROGMEM Language_Str MSG_CUSTOM_COMMANDS = _UxGT("Egyéni parancs");
PROGMEM Language_Str MSG_M48_TEST = _UxGT("M48 Szonda teszt");
PROGMEM Language_Str MSG_M48_POINT = _UxGT("M48 Pont");
PROGMEM Language_Str <API key> = _UxGT("Szonda határon kívül");
PROGMEM Language_Str MSG_M48_DEVIATION = _UxGT("Eltérés");
PROGMEM Language_Str MSG_IDEX_MENU = _UxGT("IDEX mód");
PROGMEM Language_Str MSG_OFFSETS_MENU = _UxGT("Eszköz eltolás");
PROGMEM Language_Str <API key> = _UxGT("Automata parkolás");
PROGMEM Language_Str <API key> = _UxGT("Duplikálás");
PROGMEM Language_Str <API key> = _UxGT("Tükrözött másolás");
PROGMEM Language_Str <API key> = _UxGT("Teljes felügyelet");
PROGMEM Language_Str MSG_IDEX_DUPE_GAP = _UxGT("X-hézag másolása");
PROGMEM Language_Str MSG_HOTEND_OFFSET_X = _UxGT("2. fej X");
PROGMEM Language_Str MSG_HOTEND_OFFSET_Y = _UxGT("2. fej Y");
PROGMEM Language_Str MSG_HOTEND_OFFSET_Z = _UxGT("2. fej Z");
PROGMEM Language_Str MSG_UBL_DOING_G29 = _UxGT("Szintezz! G29");
PROGMEM Language_Str MSG_UBL_TOOLS = _UxGT("UBL eszköz");
PROGMEM Language_Str MSG_UBL_LEVEL_BED = _UxGT("Egységes ágy szint");
PROGMEM Language_Str <API key> = _UxGT("Döntési pont");
PROGMEM Language_Str MSG_UBL_MANUAL_MESH = _UxGT("Kézi háló építés");
PROGMEM Language_Str MSG_UBL_MESH_WIZARD = _UxGT("UBL Háló varázsló");
PROGMEM Language_Str MSG_UBL_BC_INSERT = _UxGT("Tégy alátétet és mérj");
PROGMEM Language_Str MSG_UBL_BC_INSERT2 = _UxGT("Mérés");
PROGMEM Language_Str MSG_UBL_BC_REMOVE = _UxGT("Üres ágyat mérj");
PROGMEM Language_Str <API key> = _UxGT("Továbblépés");
PROGMEM Language_Str <API key> = _UxGT("UBL aktívál");
PROGMEM Language_Str <API key> = _UxGT("UBL deaktívál");
PROGMEM Language_Str <API key> = _UxGT("Ágy höfok");
PROGMEM Language_Str <API key> = _UxGT("Egyéni ágy höfok");
PROGMEM Language_Str <API key> = _UxGT("Fejhöfok");
PROGMEM Language_Str <API key> = _UxGT("Egyéni fejhöfok");
PROGMEM Language_Str MSG_UBL_MESH_EDIT = _UxGT("Háló szerkesztés");
PROGMEM Language_Str <API key> = _UxGT("Egyéni háló szerkesztés");
PROGMEM Language_Str <API key> = _UxGT("Finomított háló");
PROGMEM Language_Str <API key> = _UxGT("Háló kész");
PROGMEM Language_Str <API key> = _UxGT("Egyéni háló építés");
PROGMEM Language_Str <API key> = _UxGT("Háló építés");
PROGMEM Language_Str <API key> = _UxGT("Háló építés ($)");
PROGMEM Language_Str <API key> = _UxGT("Hideg háló építés");
PROGMEM Language_Str <API key> = _UxGT("Háló magasság állítás");
PROGMEM Language_Str <API key> = _UxGT("Magasság összege");
PROGMEM Language_Str <API key> = _UxGT("Háló elfogadás");
PROGMEM Language_Str <API key> = _UxGT("Háló elfogadás ($)");
PROGMEM Language_Str <API key> = _UxGT("Valódi háló elfogadása");
PROGMEM Language_Str MSG_G26_HEATING_BED = _UxGT("G26 Ágy fütés");
PROGMEM Language_Str <API key> = _UxGT("G26 Fej fütés");
PROGMEM Language_Str <API key> = _UxGT("Kézi alapozás...");
PROGMEM Language_Str <API key> = _UxGT("Fix hosszúságú alap");
PROGMEM Language_Str MSG_G26_PRIME_DONE = _UxGT("Alapozás kész");
PROGMEM Language_Str MSG_G26_CANCELED = _UxGT("G26 Törölve");
PROGMEM Language_Str MSG_G26_LEAVING = _UxGT("Kilépö G26");
PROGMEM Language_Str <API key> = _UxGT("Ágy háló folyt.");
PROGMEM Language_Str <API key> = _UxGT("Háló szintezés");
PROGMEM Language_Str <API key> = _UxGT("3-Pontos szintezés");
PROGMEM Language_Str <API key> = _UxGT("Rács szintezés");
PROGMEM Language_Str MSG_UBL_MESH_LEVEL = _UxGT("Háló szint");
PROGMEM Language_Str MSG_UBL_SIDE_POINTS = _UxGT("Oldal pontok");
PROGMEM Language_Str MSG_UBL_MAP_TYPE = _UxGT("Térkép típus");
PROGMEM Language_Str MSG_UBL_OUTPUT_MAP = _UxGT("Háló térkép kimenet");
PROGMEM Language_Str <API key> = _UxGT("Host kimenet");
PROGMEM Language_Str <API key> = _UxGT("CSV kimenet");
PROGMEM Language_Str <API key> = _UxGT("Nyomtató bizt.mentés");
PROGMEM Language_Str MSG_UBL_INFO_UBL = _UxGT("UBL infó kimenet");
PROGMEM Language_Str <API key> = _UxGT("Kitöltési költség");
PROGMEM Language_Str <API key> = _UxGT("Kézi kitöltés");
PROGMEM Language_Str <API key> = _UxGT("Okos kitöltés");
PROGMEM Language_Str MSG_UBL_FILLIN_MESH = _UxGT("Háló kitöltés");
PROGMEM Language_Str <API key> = _UxGT("Minden érvénytelen");
PROGMEM Language_Str <API key> = _UxGT("Közelebbi érvénytelen");
PROGMEM Language_Str <API key> = _UxGT("Mindet finomhangolja");
PROGMEM Language_Str <API key> = _UxGT("Közelebbi finomhangolása");
PROGMEM Language_Str <API key> = _UxGT("Háló tárolás");
PROGMEM Language_Str <API key> = _UxGT("Memória foglalat");
PROGMEM Language_Str MSG_UBL_LOAD_MESH = _UxGT("Ágy háló betöltés");
PROGMEM Language_Str MSG_UBL_SAVE_MESH = _UxGT("Ágy háló mentés");
PROGMEM Language_Str MSG_MESH_LOADED = _UxGT("M117 Háló %i betöltve");
PROGMEM Language_Str MSG_MESH_SAVED = _UxGT("M117 Háló %i mentve");
PROGMEM Language_Str MSG_UBL_NO_STORAGE = _UxGT("Nincs tároló");
PROGMEM Language_Str MSG_UBL_SAVE_ERROR = _UxGT("Hiba: UBL mentés");
PROGMEM Language_Str <API key> = _UxGT("Hiba: UBL visszaáll.");
PROGMEM Language_Str MSG_UBL_Z_OFFSET = _UxGT("Z-eltolás: ");
PROGMEM Language_Str <API key> = _UxGT("Z-eltolás leállítva");
PROGMEM Language_Str <API key> = _UxGT("Lépésröl lépésre UBL");
PROGMEM Language_Str <API key> = _UxGT("1. Hideg háló készítés");
PROGMEM Language_Str <API key> = _UxGT("2. Inteligens kitöltés");
PROGMEM Language_Str <API key> = _UxGT("3. Háló érvényesítés");
PROGMEM Language_Str <API key> = _UxGT("4. Minden finomítása");
PROGMEM Language_Str <API key> = _UxGT("5. Háló érvényesítés");
PROGMEM Language_Str <API key> = _UxGT("6. Minden finomítása");
PROGMEM Language_Str MSG_UBL_7_SAVE_MESH = _UxGT("7. Ágy háló mentése");
PROGMEM Language_Str MSG_LED_CONTROL = _UxGT("LED vezérlés");
PROGMEM Language_Str MSG_LEDS = _UxGT("Világítás");
PROGMEM Language_Str MSG_LED_PRESETS = _UxGT("Beállított színek");
PROGMEM Language_Str MSG_SET_LEDS_RED = _UxGT("Piros");
PROGMEM Language_Str MSG_SET_LEDS_ORANGE = _UxGT("Narancs");
PROGMEM Language_Str MSG_SET_LEDS_YELLOW = _UxGT("Sárga");
PROGMEM Language_Str MSG_SET_LEDS_GREEN = _UxGT("Zöld");
PROGMEM Language_Str MSG_SET_LEDS_BLUE = _UxGT("Kék");
PROGMEM Language_Str MSG_SET_LEDS_INDIGO = _UxGT("Indigó");
PROGMEM Language_Str MSG_SET_LEDS_VIOLET = _UxGT("Viola");
PROGMEM Language_Str MSG_SET_LEDS_WHITE = _UxGT("Fehér");
PROGMEM Language_Str <API key> = _UxGT("Alapérték");
PROGMEM Language_Str MSG_LED_CHANNEL_N = _UxGT("Csatorna =");
PROGMEM Language_Str MSG_LEDS2 = _UxGT("LED-ek
PROGMEM Language_Str MSG_NEO2_PRESETS = _UxGT("Fény #2 megadott");
PROGMEM Language_Str MSG_NEO2_BRIGHTNESS = _UxGT("Fényerö");
PROGMEM Language_Str MSG_CUSTOM_LEDS = _UxGT("Egyéni szín");
PROGMEM Language_Str MSG_INTENSITY_R = _UxGT("Piros intenzitás");
PROGMEM Language_Str MSG_INTENSITY_G = _UxGT("Zöld intenzitás");
PROGMEM Language_Str MSG_INTENSITY_B = _UxGT("Kék intenzitás");
PROGMEM Language_Str MSG_INTENSITY_W = _UxGT("Fehér intenzitás");
PROGMEM Language_Str MSG_LED_BRIGHTNESS = _UxGT("Fényerö");
PROGMEM Language_Str MSG_MOVING = _UxGT("Mozgás...");
PROGMEM Language_Str MSG_FREE_XY = _UxGT("XY szabad");
PROGMEM Language_Str MSG_MOVE_X = _UxGT("X mozgás");
PROGMEM Language_Str MSG_MOVE_Y = _UxGT("Y mozgás");
PROGMEM Language_Str MSG_MOVE_Z = _UxGT("Z mozgás");
PROGMEM Language_Str MSG_MOVE_I = _UxGT("Mozgás ") LCD_STR_I;
PROGMEM Language_Str MSG_MOVE_J = _UxGT("Mozgás ") LCD_STR_J;
PROGMEM Language_Str MSG_MOVE_K = _UxGT("Mozgás ") LCD_STR_K;
PROGMEM Language_Str MSG_MOVE_E = _UxGT("Adagoló");
PROGMEM Language_Str MSG_MOVE_EN = _UxGT("Adagoló *");
PROGMEM Language_Str MSG_HOTEND_TOO_COLD = _UxGT("A fej túl hideg");
PROGMEM Language_Str MSG_MOVE_N_MM = _UxGT("Mozgás %smm");
PROGMEM Language_Str MSG_MOVE_01MM = _UxGT("Mozgás 0.1mm");
PROGMEM Language_Str MSG_MOVE_1MM = _UxGT("Mozgás 1mm");
PROGMEM Language_Str MSG_MOVE_10MM = _UxGT("Mozgás 10mm");
PROGMEM Language_Str MSG_MOVE_100MM = _UxGT("Mozgás 100mm");
PROGMEM Language_Str MSG_MOVE_0001IN = _UxGT("Mozgás 0.025mm");
PROGMEM Language_Str MSG_MOVE_001IN = _UxGT("Mozgás 0.254mm");
PROGMEM Language_Str MSG_MOVE_01IN = _UxGT("Mozgás 2.54mm");
PROGMEM Language_Str MSG_MOVE_1IN = _UxGT("Mozgáá 25.4mm");
PROGMEM Language_Str MSG_SPEED = _UxGT("Sebesség");
PROGMEM Language_Str MSG_BED_Z = _UxGT("Z ágy");
PROGMEM Language_Str MSG_NOZZLE = _UxGT("Fej");
PROGMEM Language_Str MSG_NOZZLE_N = _UxGT("Fej ~");
PROGMEM Language_Str MSG_NOZZLE_PARKED = _UxGT("Fej parkolva");
PROGMEM Language_Str MSG_NOZZLE_STANDBY = _UxGT("Fej készenlétbe");
PROGMEM Language_Str MSG_BED = _UxGT("Ágy");
PROGMEM Language_Str MSG_CHAMBER = _UxGT("Burkolat");
PROGMEM Language_Str MSG_COOLER = _UxGT("Lézer hütövíz");
PROGMEM Language_Str MSG_COOLER_TOGGLE = _UxGT("Hütö kapcsoló");
PROGMEM Language_Str <API key> = _UxGT("Áramlásbiztonság");
PROGMEM Language_Str MSG_LASER = _UxGT("Lézer");
PROGMEM Language_Str MSG_FAN_SPEED = _UxGT("Hütés sebesség");
PROGMEM Language_Str MSG_FAN_SPEED_N = _UxGT("Hütés sebesség =");
PROGMEM Language_Str MSG_STORED_FAN_N = _UxGT("Tárolt hütés =");
PROGMEM Language_Str MSG_EXTRA_FAN_SPEED = _UxGT("Extra hütés sebesség");
PROGMEM Language_Str <API key> = _UxGT("Extra hütés sebesség =");
PROGMEM Language_Str MSG_CONTROLLER_FAN = _UxGT("Hütésvezérlés");
PROGMEM Language_Str <API key> = _UxGT("Alapjárat");
PROGMEM Language_Str <API key> = _UxGT("Automatikus mód");
PROGMEM Language_Str <API key> = _UxGT("Aktív sebesség");
PROGMEM Language_Str <API key> = _UxGT("Készenlét");
PROGMEM Language_Str MSG_FLOW = _UxGT("Folyás");
PROGMEM Language_Str MSG_FLOW_N = _UxGT("Folyás ~");
PROGMEM Language_Str MSG_CONTROL = _UxGT("Konfiguráció");
PROGMEM Language_Str MSG_MIN = " " LCD_STR_THERMOMETER _UxGT(" Minimum");
PROGMEM Language_Str MSG_MAX = " " LCD_STR_THERMOMETER _UxGT(" Maximum");
PROGMEM Language_Str MSG_FACTOR = " " LCD_STR_THERMOMETER _UxGT(" Tényezö");
PROGMEM Language_Str MSG_AUTOTEMP = _UxGT("Automata höfok");
PROGMEM Language_Str MSG_LCD_ON = _UxGT("Be");
PROGMEM Language_Str MSG_LCD_OFF = _UxGT("Ki");
PROGMEM Language_Str MSG_PID_AUTOTUNE = _UxGT("PID hangolás");
PROGMEM Language_Str MSG_PID_AUTOTUNE_E = _UxGT("PID hangolás *");
PROGMEM Language_Str <API key> = _UxGT("PID hangolás kész");
PROGMEM Language_Str <API key> = _UxGT("Hangolási hiba. Rossz adagoló.");
PROGMEM Language_Str <API key> = _UxGT("Hangolási hiba. Magas hömérséklet.");
PROGMEM Language_Str MSG_PID_TIMEOUT = _UxGT("Hangolási hiba! Idötúllépés.");
PROGMEM Language_Str MSG_PID_P = _UxGT("PID-P");
PROGMEM Language_Str MSG_PID_P_E = _UxGT("PID-P *");
PROGMEM Language_Str MSG_PID_I = _UxGT("PID-I");
PROGMEM Language_Str MSG_PID_I_E = _UxGT("PID-I *");
PROGMEM Language_Str MSG_PID_D = _UxGT("PID-D");
PROGMEM Language_Str MSG_PID_D_E = _UxGT("PID-D *");
PROGMEM Language_Str MSG_PID_C = _UxGT("PID-C");
PROGMEM Language_Str MSG_PID_C_E = _UxGT("PID-C *");
PROGMEM Language_Str MSG_PID_F = _UxGT("PID-F");
PROGMEM Language_Str MSG_PID_F_E = _UxGT("PID-F *");
PROGMEM Language_Str MSG_SELECT = _UxGT("Kiválaszt");
PROGMEM Language_Str MSG_SELECT_E = _UxGT("Kiválaszt *");
PROGMEM Language_Str MSG_ACC = _UxGT("Gyorsítás");
PROGMEM Language_Str MSG_JERK = _UxGT("Rántás");
PROGMEM Language_Str MSG_VA_JERK = _UxGT("Seb.") LCD_STR_A _UxGT("-Rántás");
PROGMEM Language_Str MSG_VB_JERK = _UxGT("Seb.") LCD_STR_B _UxGT("-Rántás");
PROGMEM Language_Str MSG_VC_JERK = _UxGT("Seb.") LCD_STR_C _UxGT("-Rántás");
PROGMEM Language_Str MSG_VI_JERK = _UxGT("Seb.") LCD_STR_I _UxGT("-Rántás");
PROGMEM Language_Str MSG_VJ_JERK = _UxGT("Seb.") LCD_STR_J _UxGT("-Rántás");
PROGMEM Language_Str MSG_VK_JERK = _UxGT("Seb.") LCD_STR_K _UxGT("-Rántás");
PROGMEM Language_Str MSG_VE_JERK = _UxGT("E ránt. seb.");
PROGMEM Language_Str <API key> = _UxGT("Csomopont eltérés");
PROGMEM Language_Str MSG_VELOCITY = _UxGT("Sebesség");
PROGMEM Language_Str MSG_VMAX_A = _UxGT("Max Seb. ") LCD_STR_A;
PROGMEM Language_Str MSG_VMAX_B = _UxGT("Max Seb. ") LCD_STR_B;
PROGMEM Language_Str MSG_VMAX_C = _UxGT("Max Seb. ") LCD_STR_C;
PROGMEM Language_Str MSG_VMAX_I = _UxGT("Max Seb. ") LCD_STR_I;
PROGMEM Language_Str MSG_VMAX_J = _UxGT("Max Seb. ") LCD_STR_J;
PROGMEM Language_Str MSG_VMAX_K = _UxGT("Max Seb. ") LCD_STR_K;
PROGMEM Language_Str MSG_VMAX_E = _UxGT("Max Seb. ") LCD_STR_E;
PROGMEM Language_Str MSG_VMAX_EN = _UxGT("Max sebesség *");
PROGMEM Language_Str MSG_VMIN = _UxGT("Min sebesség");
PROGMEM Language_Str MSG_VTRAV_MIN = _UxGT("Min utazó.seb.");
PROGMEM Language_Str MSG_ACCELERATION = _UxGT("Gyorsulás");
PROGMEM Language_Str MSG_AMAX_A = _UxGT("Max gyors. ") LCD_STR_A;
PROGMEM Language_Str MSG_AMAX_B = _UxGT("Max gyors. ") LCD_STR_B;
PROGMEM Language_Str MSG_AMAX_C = _UxGT("Max gyors. ") LCD_STR_C;
PROGMEM Language_Str MSG_AMAX_I = _UxGT("Max gyors. ") LCD_STR_I;
PROGMEM Language_Str MSG_AMAX_J = _UxGT("Max gyors. ") LCD_STR_J;
PROGMEM Language_Str MSG_AMAX_K = _UxGT("Max gyors. ") LCD_STR_K;
PROGMEM Language_Str MSG_AMAX_E = _UxGT("Max gyors. ") LCD_STR_E;
PROGMEM Language_Str MSG_AMAX_EN = _UxGT("Max gyorsulás *");
PROGMEM Language_Str MSG_A_RETRACT = _UxGT("Visszahúzás");
PROGMEM Language_Str MSG_A_TRAVEL = _UxGT("Utazás");
PROGMEM Language_Str <API key> = _UxGT("Max frekvencia");
PROGMEM Language_Str <API key> = _UxGT("Min elötolás");
PROGMEM Language_Str MSG_STEPS_PER_MM = _UxGT("Lépés/mm");
PROGMEM Language_Str MSG_A_STEPS = LCD_STR_A _UxGT(" Lépés/mm");
PROGMEM Language_Str MSG_B_STEPS = LCD_STR_B _UxGT(" Lépés/mm");
PROGMEM Language_Str MSG_C_STEPS = LCD_STR_C _UxGT(" Lépés/mm");
PROGMEM Language_Str MSG_I_STEPS = LCD_STR_I _UxGT(" Lépés/mm");
PROGMEM Language_Str MSG_J_STEPS = LCD_STR_J _UxGT(" Lépés/mm");
PROGMEM Language_Str MSG_K_STEPS = LCD_STR_K _UxGT(" Lépés/mm");
PROGMEM Language_Str MSG_E_STEPS = _UxGT("E lépés/mm");
PROGMEM Language_Str MSG_EN_STEPS = _UxGT("*Lépés/mm");
PROGMEM Language_Str MSG_TEMPERATURE = _UxGT("Höfok");
PROGMEM Language_Str MSG_MOTION = _UxGT("Mozgatások");
PROGMEM Language_Str MSG_FILAMENT = _UxGT("Nyomtatószál");
PROGMEM Language_Str <API key> = _UxGT("E mm³-ben");
PROGMEM Language_Str <API key> = _UxGT("E Limit mm³-ben");
PROGMEM Language_Str <API key> = _UxGT("E Limit *");
PROGMEM Language_Str MSG_FILAMENT_DIAM = _UxGT("Szál. átm.");
PROGMEM Language_Str MSG_FILAMENT_DIAM_E = _UxGT("Szál. átm. *");
PROGMEM Language_Str MSG_FILAMENT_UNLOAD = _UxGT("Kiadás mm");
PROGMEM Language_Str MSG_FILAMENT_LOAD = _UxGT("Betöltés mm");
PROGMEM Language_Str MSG_ADVANCE_K = _UxGT("Haladó K");
PROGMEM Language_Str MSG_ADVANCE_K_E = _UxGT("Haladó K *");
PROGMEM Language_Str MSG_CONTRAST = _UxGT("LCD kontraszt");
PROGMEM Language_Str MSG_STORE_EEPROM = _UxGT("Mentés EEPROM");
PROGMEM Language_Str MSG_LOAD_EEPROM = _UxGT("Betöltés EEPROM");
PROGMEM Language_Str <API key> = _UxGT("Alapértelmezett");
PROGMEM Language_Str MSG_INIT_EEPROM = _UxGT("EEPROM inicializálás");
PROGMEM Language_Str MSG_ERR_EEPROM_CRC = _UxGT("Hiba: EEPROM CRC");
PROGMEM Language_Str <API key> = _UxGT("Hiba: EEPROM index");
PROGMEM Language_Str <API key> = _UxGT("Hiba: EEPROM verzió");
PROGMEM Language_Str MSG_SETTINGS_STORED = _UxGT("Beállítások mentve");
PROGMEM Language_Str MSG_MEDIA_UPDATE = _UxGT("Tároló frissítés");
PROGMEM Language_Str MSG_RESET_PRINTER = _UxGT("Nyomtató újraindítása");
PROGMEM Language_Str MSG_REFRESH = LCD_STR_REFRESH _UxGT("Frissítés");
PROGMEM Language_Str MSG_INFO_SCREEN = _UxGT("<Infó képernyö>");
PROGMEM Language_Str MSG_PREPARE = _UxGT("Vezérlés");
PROGMEM Language_Str MSG_TUNE = _UxGT("Hangolás");
PROGMEM Language_Str MSG_POWER_MONITOR = _UxGT("Teljesítménymonitor");
PROGMEM Language_Str MSG_CURRENT = _UxGT("Jelenlegi");
PROGMEM Language_Str MSG_VOLTAGE = _UxGT("Feszültség");
PROGMEM Language_Str MSG_POWER = _UxGT("Energia");
PROGMEM Language_Str MSG_START_PRINT = _UxGT("Nyomtatás indítása");
PROGMEM Language_Str MSG_BUTTON_NEXT = _UxGT("Tovább");
PROGMEM Language_Str MSG_BUTTON_INIT = _UxGT("Kezdet");
PROGMEM Language_Str MSG_BUTTON_STOP = _UxGT("Állj");
PROGMEM Language_Str MSG_BUTTON_PRINT = _UxGT("Nyomtatás");
PROGMEM Language_Str MSG_BUTTON_RESET = _UxGT("Újraindítás");
PROGMEM Language_Str MSG_BUTTON_IGNORE = _UxGT("Mellöz");
PROGMEM Language_Str MSG_BUTTON_CANCEL = _UxGT("Mégse");
PROGMEM Language_Str MSG_BUTTON_DONE = _UxGT("Kész");
PROGMEM Language_Str MSG_BUTTON_BACK = _UxGT("Vissza");
PROGMEM Language_Str MSG_BUTTON_PROCEED = _UxGT("Folytatás");
PROGMEM Language_Str MSG_BUTTON_SKIP = _UxGT("Kihagy");
PROGMEM Language_Str MSG_PAUSING = _UxGT("Szüneteltetve...");
PROGMEM Language_Str MSG_PAUSE_PRINT = _UxGT("Nyomtatás szünetelés");
PROGMEM Language_Str MSG_RESUME_PRINT = _UxGT("Nyomtatás folytatása");
PROGMEM Language_Str <API key> = _UxGT("Hoszt indítás");
PROGMEM Language_Str MSG_STOP_PRINT = _UxGT("Nyomtatás leállítása");
PROGMEM Language_Str MSG_END_LOOPS = _UxGT("Hurok ismétlés vége");
PROGMEM Language_Str MSG_PRINTING_OBJECT = _UxGT("Objektum nyomtatása");
PROGMEM Language_Str MSG_CANCEL_OBJECT = _UxGT("Objektum törlése");
PROGMEM Language_Str MSG_CANCEL_OBJECT_N = _UxGT("Objektum törlése =");
PROGMEM Language_Str MSG_OUTAGE_RECOVERY = _UxGT("Kiesés helyreáll.");
PROGMEM Language_Str MSG_MEDIA_MENU = _UxGT("Nyomtatás tárolóról");
PROGMEM Language_Str MSG_NO_MEDIA = _UxGT("Nincs tároló");
PROGMEM Language_Str MSG_DWELL = _UxGT("Alvás...");
PROGMEM Language_Str MSG_USERWAIT = _UxGT("Katt a folytatáshoz...");
PROGMEM Language_Str MSG_PRINT_PAUSED = _UxGT("Nyomtatás szünetelve");
PROGMEM Language_Str MSG_PRINTING = _UxGT("Nyomtatás...");
PROGMEM Language_Str MSG_PRINT_ABORTED = _UxGT("Nyomtatás leállítva");
PROGMEM Language_Str MSG_PRINT_DONE = _UxGT("Nyomtatás kész");
PROGMEM Language_Str MSG_NO_MOVE = _UxGT("Nincs mozgás.");
PROGMEM Language_Str MSG_KILLED = _UxGT("HALOTT! ");
PROGMEM Language_Str MSG_STOPPED = _UxGT("MEGÁLLT! ");
PROGMEM Language_Str MSG_CONTROL_RETRACT = _UxGT("Visszahúzás mm");
PROGMEM Language_Str <API key> = _UxGT("Visszahúzás cs. mm");
PROGMEM Language_Str <API key> = _UxGT("Viszahúzás");
PROGMEM Language_Str <API key> = _UxGT("Ugrás mm");
PROGMEM Language_Str <API key> = _UxGT("Visszah.helyre mm");
PROGMEM Language_Str <API key> = _UxGT("Csere.visszah.helyre mm");
PROGMEM Language_Str <API key> = _UxGT("Visszahúzás V");
PROGMEM Language_Str <API key> = _UxGT("S Vissza.h V");
PROGMEM Language_Str MSG_AUTORETRACT = _UxGT("Auto visszah.");
PROGMEM Language_Str <API key> = _UxGT("Visszahúzás távolság");
PROGMEM Language_Str <API key> = _UxGT("Extra csere");
PROGMEM Language_Str <API key> = _UxGT("Tisztítási távolság");
PROGMEM Language_Str MSG_TOOL_CHANGE = _UxGT("Szerszámcsere");
PROGMEM Language_Str <API key> = _UxGT("Z emelés");
PROGMEM Language_Str <API key> = _UxGT("Fösebesség");
PROGMEM Language_Str <API key> = _UxGT("Visszah. sebesség");
PROGMEM Language_Str <API key> = _UxGT("Fej parkolás");
PROGMEM Language_Str <API key> = _UxGT("Visszav.visszah. sebesség");
PROGMEM Language_Str <API key> = _UxGT("FAN sebesség");
PROGMEM Language_Str <API key> = _UxGT("FAN idö");
PROGMEM Language_Str <API key> = _UxGT("Auto BE");
PROGMEM Language_Str <API key> = _UxGT("Auto KI");
PROGMEM Language_Str MSG_TOOL_MIGRATION = _UxGT("Szerszámcsere");
PROGMEM Language_Str <API key> = _UxGT("Automata csere");
PROGMEM Language_Str <API key> = _UxGT("Utolsó adagoló");
PROGMEM Language_Str <API key> = _UxGT("Csere *");
PROGMEM Language_Str MSG_FILAMENTCHANGE = _UxGT("Szálcsere");
PROGMEM Language_Str <API key> = _UxGT("Szálcsere *");
PROGMEM Language_Str MSG_FILAMENTLOAD = _UxGT("Szál betöltés");
PROGMEM Language_Str MSG_FILAMENTLOAD_E = _UxGT("Szál betöltés *");
PROGMEM Language_Str MSG_FILAMENTUNLOAD = _UxGT("Szál eltávolítás");
PROGMEM Language_Str <API key> = _UxGT("Szál eltávolítás *");
PROGMEM Language_Str <API key> = _UxGT("Mindet eltávolít");
PROGMEM Language_Str MSG_ATTACH_MEDIA = _UxGT("Tároló");
PROGMEM Language_Str MSG_CHANGE_MEDIA = _UxGT("Tároló csere");
PROGMEM Language_Str MSG_RELEASE_MEDIA = _UxGT("Tároló Kiadása");
PROGMEM Language_Str MSG_ZPROBE_OUT = _UxGT("Z szonda tálcán kivül");
PROGMEM Language_Str MSG_SKEW_FACTOR = _UxGT("Ferdeség faktor");
PROGMEM Language_Str MSG_BLTOUCH = _UxGT("BLTouch");
PROGMEM Language_Str <API key> = _UxGT("Önteszt");
PROGMEM Language_Str MSG_BLTOUCH_RESET = _UxGT("Visszaállítás");
PROGMEM Language_Str MSG_BLTOUCH_STOW = _UxGT("Elhelyez");
PROGMEM Language_Str MSG_BLTOUCH_DEPLOY = _UxGT("Telepít");
PROGMEM Language_Str MSG_BLTOUCH_SW_MODE = _UxGT("SW-Mód");
PROGMEM Language_Str MSG_BLTOUCH_5V_MODE = _UxGT("5V-Mód");
PROGMEM Language_Str MSG_BLTOUCH_OD_MODE = _UxGT("OD-Mód");
PROGMEM Language_Str <API key> = _UxGT("Módok");
PROGMEM Language_Str <API key> = _UxGT("BLTouch 5V mód");
PROGMEM Language_Str <API key> = _UxGT("BLTouch OD mód");
PROGMEM Language_Str <API key> = _UxGT("Jelentés");
PROGMEM Language_Str <API key> = _UxGT("VESZÉLY: A rossz beállítások kárt okozhatnak! Biztos továbblép?");
PROGMEM Language_Str MSG_TOUCHMI_PROBE = _UxGT("TouchMI");
PROGMEM Language_Str MSG_TOUCHMI_INIT = _UxGT("Kezd TouchMI");
PROGMEM Language_Str MSG_TOUCHMI_ZTEST = _UxGT("Z eltolás teszt");
PROGMEM Language_Str MSG_TOUCHMI_SAVE = _UxGT("Mentés");
PROGMEM Language_Str <API key> = _UxGT("TouchMI használ");
PROGMEM Language_Str MSG_MANUAL_DEPLOY = _UxGT("Z-Szonda telepítés");
PROGMEM Language_Str MSG_MANUAL_STOW = _UxGT("Z-Szonda elhelyezés");
PROGMEM Language_Str MSG_HOME_FIRST = _UxGT("Elsö %s%s%s kell");
PROGMEM Language_Str MSG_ZPROBE_OFFSETS = _UxGT("Szonda eltolások");
PROGMEM Language_Str MSG_ZPROBE_XOFFSET = _UxGT("X szonda eltolás");
PROGMEM Language_Str MSG_ZPROBE_YOFFSET = _UxGT("Y szonda eltolás");
PROGMEM Language_Str MSG_ZPROBE_ZOFFSET = _UxGT("Z szonda eltolás");
PROGMEM Language_Str <API key> = _UxGT("Fej az ágyhoz");
PROGMEM Language_Str MSG_BABYSTEP_X = _UxGT("Mikrolépés X");
PROGMEM Language_Str MSG_BABYSTEP_Y = _UxGT("Mikrolépés Y");
PROGMEM Language_Str MSG_BABYSTEP_Z = _UxGT("Mikrolépés Z");
PROGMEM Language_Str MSG_BABYSTEP_I = _UxGT("Mikrolépés ") LCD_STR_I;
PROGMEM Language_Str MSG_BABYSTEP_J = _UxGT("Mikrolépés ") LCD_STR_J;
PROGMEM Language_Str MSG_BABYSTEP_K = _UxGT("Mikrolépés ") LCD_STR_K;
PROGMEM Language_Str MSG_BABYSTEP_TOTAL = _UxGT("Teljes");
PROGMEM Language_Str MSG_ENDSTOP_ABORT = _UxGT("Végállás megszakítva!");
PROGMEM Language_Str <API key> = _UxGT("Fütés hiba!");
PROGMEM Language_Str <API key> = _UxGT("Hiba: SZÜKSÉGTELEN HÖFOK");
PROGMEM Language_Str MSG_THERMAL_RUNAWAY = _UxGT("FÜTÉS KIMARADÁS");
PROGMEM Language_Str <API key> = _UxGT("ÁGY FÜTÉS KIMARADÁS");
PROGMEM Language_Str <API key> = _UxGT("KAMRA FÜTÉS KIMARADÁS");
PROGMEM Language_Str <API key> = _UxGT("Hütés kimaradás");
PROGMEM Language_Str MSG_COOLING_FAILED = _UxGT("Hütés sikertelen");
PROGMEM Language_Str MSG_ERR_MAXTEMP = _UxGT("Hiba: MAX höfok");
PROGMEM Language_Str MSG_ERR_MINTEMP = _UxGT("Hiba: MIN höfok");
PROGMEM Language_Str MSG_HALTED = _UxGT("A NYOMTATÓ LEÁLLT");
PROGMEM Language_Str MSG_PLEASE_RESET = _UxGT("Indítsd újra!");
PROGMEM Language_Str MSG_SHORT_DAY = _UxGT("n"); // Csak egy karakter
PROGMEM Language_Str MSG_SHORT_HOUR = _UxGT("ó"); // Csak egy karakter
PROGMEM Language_Str MSG_SHORT_MINUTE = _UxGT("p"); // Csak egy karakter
PROGMEM Language_Str MSG_HEATING = _UxGT("Fütés...");
PROGMEM Language_Str MSG_COOLING = _UxGT("Hütés...");
PROGMEM Language_Str MSG_BED_HEATING = _UxGT("Ágy fütés...");
PROGMEM Language_Str MSG_BED_COOLING = _UxGT("Ágy hütés...");
PROGMEM Language_Str MSG_PROBE_HEATING = _UxGT("Szonda fütése...");
PROGMEM Language_Str MSG_PROBE_COOLING = _UxGT("Szonda hütése...");
PROGMEM Language_Str MSG_CHAMBER_HEATING = _UxGT("Kamra fütés...");
PROGMEM Language_Str MSG_CHAMBER_COOLING = _UxGT("Kamra hütés...");
PROGMEM Language_Str MSG_LASER_COOLING = _UxGT("Lézer hütés...");
PROGMEM Language_Str MSG_DELTA_CALIBRATE = _UxGT("Delta kalibráció");
PROGMEM Language_Str <API key> = _UxGT("X kalibrálás");
PROGMEM Language_Str <API key> = _UxGT("Y kalibrálás");
PROGMEM Language_Str <API key> = _UxGT("Z kalibrálás");
PROGMEM Language_Str <API key> = _UxGT("Központ kalibrálás");
PROGMEM Language_Str MSG_DELTA_SETTINGS = _UxGT("Delta beállítások");
PROGMEM Language_Str <API key> = _UxGT("Auto kalibráció");
PROGMEM Language_Str <API key> = _UxGT("Delta magasság kalib.");
PROGMEM Language_Str <API key> = _UxGT("Z eltolás");
PROGMEM Language_Str MSG_DELTA_DIAG_ROD = _UxGT("Diag rúd");
PROGMEM Language_Str MSG_DELTA_HEIGHT = _UxGT("Magasság");
PROGMEM Language_Str MSG_DELTA_RADIUS = _UxGT("Sugár");
PROGMEM Language_Str MSG_INFO_MENU = _UxGT("A Nyomtatóról");
PROGMEM Language_Str <API key> = _UxGT("Nyomtató infó");
PROGMEM Language_Str MSG_3POINT_LEVELING = _UxGT("3-Pontos szintezés");
PROGMEM Language_Str MSG_LINEAR_LEVELING = _UxGT("Lineáris szintezés");
PROGMEM Language_Str <API key> = _UxGT("Bilineáris szintezés");
PROGMEM Language_Str MSG_UBL_LEVELING = _UxGT("Egységes ágy szintezés");
PROGMEM Language_Str MSG_MESH_LEVELING = _UxGT("Háló szintezés");
PROGMEM Language_Str MSG_MESH_DONE = _UxGT("Háló szintezés kész");
PROGMEM Language_Str MSG_INFO_STATS_MENU = _UxGT("Statisztikák");
PROGMEM Language_Str MSG_INFO_BOARD_MENU = _UxGT("Alaplap infó");
PROGMEM Language_Str <API key> = _UxGT("Termisztorok");
PROGMEM Language_Str MSG_INFO_EXTRUDERS = _UxGT("Adagolók");
PROGMEM Language_Str MSG_INFO_BAUDRATE = _UxGT("Átviteli sebesség");
PROGMEM Language_Str MSG_INFO_PROTOCOL = _UxGT("Protokol");
PROGMEM Language_Str <API key> = _UxGT("Futáselemzés: KI");
PROGMEM Language_Str MSG_INFO_RUNAWAY_ON = _UxGT("Futáselemzés: BE");
PROGMEM Language_Str <API key> = _UxGT("Fej üresjárati idök.");
PROGMEM Language_Str MSG_CASE_LIGHT = _UxGT("Munkalámpa");
PROGMEM Language_Str <API key> = _UxGT("Fényerösség");
PROGMEM Language_Str <API key> = _UxGT("HELYTELEN NYOMTATÓ");
#if LCD_WIDTH >= 20
PROGMEM Language_Str <API key> = _UxGT("Nyomtatás számláló");
PROGMEM Language_Str <API key> = _UxGT("Befejezett");
PROGMEM Language_Str MSG_INFO_PRINT_TIME = _UxGT("Összes nyomtatási idö");
PROGMEM Language_Str <API key> = _UxGT("Leghosszabb munkaidö");
PROGMEM Language_Str <API key> = _UxGT("Összes anyag");
#else
PROGMEM Language_Str <API key> = _UxGT("Nyomtatások");
PROGMEM Language_Str <API key> = _UxGT("Befejezett");
PROGMEM Language_Str MSG_INFO_PRINT_TIME = _UxGT("Összes");
PROGMEM Language_Str <API key> = _UxGT("Leghosszabb");
PROGMEM Language_Str <API key> = _UxGT("Kiadott");
#endif
PROGMEM Language_Str MSG_INFO_MIN_TEMP = _UxGT("Min höfok");
PROGMEM Language_Str MSG_INFO_MAX_TEMP = _UxGT("Max höfok");
PROGMEM Language_Str MSG_INFO_PSU = _UxGT("PSU");
PROGMEM Language_Str MSG_DRIVE_STRENGTH = _UxGT("Meghajtási erö");
PROGMEM Language_Str MSG_DAC_PERCENT_X = _UxGT("X meghajtó %");
PROGMEM Language_Str MSG_DAC_PERCENT_Y = _UxGT("Y meghajtó %");
PROGMEM Language_Str MSG_DAC_PERCENT_Z = _UxGT("Z meghajtó %");
PROGMEM Language_Str MSG_DAC_PERCENT_I = AXIS4_STR _UxGT(" Meghajtó %");
PROGMEM Language_Str MSG_DAC_PERCENT_J = AXIS5_STR _UxGT(" Meghajtó %");
PROGMEM Language_Str MSG_DAC_PERCENT_K = AXIS6_STR _UxGT(" Meghajtó %");
PROGMEM Language_Str MSG_DAC_PERCENT_E = _UxGT("E meghajtó %");
PROGMEM Language_Str MSG_ERROR_TMC = _UxGT("TMC CSATLAKOZÁSI HIBA");
PROGMEM Language_Str <API key> = _UxGT("DAC EEPROM írása");
PROGMEM Language_Str <API key> = _UxGT("NYOMTATÓSZÁL CSERE");
PROGMEM Language_Str <API key> = _UxGT("NYOMTATÁS SZÜNETEL");
PROGMEM Language_Str <API key> = _UxGT("SZÁL BETÖLTÉS");
PROGMEM Language_Str <API key> = _UxGT("SZÁL ELTÁVOLÍTÁS");
PROGMEM Language_Str <API key> = _UxGT("FOLYTATÁSI OPCIÓ:");
PROGMEM Language_Str <API key> = _UxGT("Tisztítsd meg");
PROGMEM Language_Str <API key> = _UxGT("Folytatás");
PROGMEM Language_Str <API key> = _UxGT(" Fej: ");
PROGMEM Language_Str MSG_RUNOUT_SENSOR = _UxGT("Túlfutás szenzor");
PROGMEM Language_Str <API key> = _UxGT("Túlfutás táv. mm");
PROGMEM Language_Str <API key> = _UxGT("Tájolási hiba");
PROGMEM Language_Str <API key> = _UxGT("Szondázás hiba");
PROGMEM Language_Str <API key> = _UxGT("SZÁLVÁLASZTÁS");
PROGMEM Language_Str MSG_MMU2_MENU = _UxGT("MMU");
PROGMEM Language_Str <API key> = _UxGT("MMU szoftver feltöltése!");
PROGMEM Language_Str <API key> = _UxGT("MMU figyelmeztetés.");
PROGMEM Language_Str MSG_MMU2_RESUME = _UxGT("Nyomtatás folytatása");
PROGMEM Language_Str MSG_MMU2_RESUMING = _UxGT("Folytatás...");
PROGMEM Language_Str <API key> = _UxGT("Szál betöltése");
PROGMEM Language_Str MSG_MMU2_LOAD_ALL = _UxGT("Összes betöltése");
PROGMEM Language_Str <API key> = _UxGT("Fej betöltése");
PROGMEM Language_Str <API key> = _UxGT("Szál kidobás");
PROGMEM Language_Str <API key> = _UxGT("Szál kidobás ~");
PROGMEM Language_Str <API key> = _UxGT("Kiadja a szálat");
PROGMEM Language_Str <API key> = _UxGT("Szál betölt. %i...");
PROGMEM Language_Str <API key> = _UxGT("Szál kidobás. ...");
PROGMEM Language_Str <API key> = _UxGT("Szál kiadása....");
PROGMEM Language_Str MSG_MMU2_ALL = _UxGT("Mind");
PROGMEM Language_Str MSG_MMU2_FILAMENT_N = _UxGT("Nyomtatószál ~");
PROGMEM Language_Str MSG_MMU2_RESET = _UxGT("MMU újraindítás");
PROGMEM Language_Str MSG_MMU2_RESETTING = _UxGT("MMU újraindul...");
PROGMEM Language_Str <API key> = _UxGT("Kidob, kattint");
PROGMEM Language_Str MSG_MIX = _UxGT("Kever");
PROGMEM Language_Str MSG_MIX_COMPONENT_N = _UxGT("Összetevö =");
PROGMEM Language_Str MSG_MIXER = _UxGT("Keverö");
PROGMEM Language_Str MSG_GRADIENT = _UxGT("Színátm.");
PROGMEM Language_Str MSG_FULL_GRADIENT = _UxGT("Teljes színátm.");
PROGMEM Language_Str MSG_TOGGLE_MIX = _UxGT("Váltás keverésre");
PROGMEM Language_Str MSG_CYCLE_MIX = _UxGT("Ciklikus keverés");
PROGMEM Language_Str MSG_GRADIENT_MIX = _UxGT("Színátm. keverés");
PROGMEM Language_Str <API key> = _UxGT("Fordított színátm.");
PROGMEM Language_Str MSG_ACTIVE_VTOOL = _UxGT("Aktív V-szerszám");
PROGMEM Language_Str MSG_START_VTOOL = _UxGT("Kezdés V-szerszám");
PROGMEM Language_Str MSG_END_VTOOL = _UxGT(" Vége V-szerszám");
PROGMEM Language_Str MSG_GRADIENT_ALIAS = _UxGT("Ál V-szerszám");
PROGMEM Language_Str MSG_RESET_VTOOLS = _UxGT("Újra V-szerszám");
PROGMEM Language_Str MSG_COMMIT_VTOOL = _UxGT("Gyors V-szerszám Kev.");
PROGMEM Language_Str MSG_VTOOLS_RESET = _UxGT("V-szersz. visszaáll.");
PROGMEM Language_Str MSG_START_Z = _UxGT("Kezdés Z:");
PROGMEM Language_Str MSG_END_Z = _UxGT(" Vége Z:");
PROGMEM Language_Str MSG_GAMES = _UxGT("Játékok");
PROGMEM Language_Str MSG_BRICKOUT = _UxGT("Brickout");
PROGMEM Language_Str MSG_INVADERS = _UxGT("Invaders");
PROGMEM Language_Str MSG_SNAKE = _UxGT("Sn4k3");
PROGMEM Language_Str MSG_MAZE = _UxGT("Maze");
PROGMEM Language_Str MSG_BAD_PAGE = _UxGT("Rossz oldalindex");
PROGMEM Language_Str MSG_BAD_PAGE_SPEED = _UxGT("Rossz oldalsebesség");
PROGMEM Language_Str MSG_EDIT_PASSWORD = _UxGT("Jelszó szerkesztése");
PROGMEM Language_Str MSG_LOGIN_REQUIRED = _UxGT("Belépés szükséges");
PROGMEM Language_Str <API key> = _UxGT("Jelszóbeállítások");
PROGMEM Language_Str MSG_ENTER_DIGIT = _UxGT("Írja be a számokat");
PROGMEM Language_Str MSG_CHANGE_PASSWORD = _UxGT("Jelszó Beáll/Szerk");
PROGMEM Language_Str MSG_REMOVE_PASSWORD = _UxGT("Jelszó törlése");
PROGMEM Language_Str MSG_PASSWORD_SET = _UxGT("A jelszó ");
PROGMEM Language_Str MSG_START_OVER = _UxGT("Újrakezdés");
PROGMEM Language_Str <API key> = _UxGT("Mentsd el!");
PROGMEM Language_Str <API key> = _UxGT("Jelszó törölve");
// Filament Change screens show up to 3 lines on a 4-line display
// ...or up to 2 lines on a 3-line display
#if LCD_HEIGHT >= 4
PROGMEM Language_Str <API key> = _UxGT(MSG_2_LINE("Nyomj gombot", "nyomtatás folytatáshoz"));
PROGMEM Language_Str <API key> = _UxGT(MSG_1_LINE("Parkolás..."));
PROGMEM Language_Str <API key> = _UxGT(MSG_3_LINE("Várj míg", "szálcsere", "indítás"));
PROGMEM Language_Str <API key> = _UxGT(MSG_3_LINE("Szál behelyezés", "majd nyomj gombot", "a folytatáshoz"));
PROGMEM Language_Str <API key> = _UxGT(MSG_2_LINE("Nyomj gombot", "a fej fütéséhez"));
PROGMEM Language_Str <API key> = _UxGT(MSG_2_LINE("Fej fütése", "Kérlek várj..."));
PROGMEM Language_Str <API key> = _UxGT(MSG_2_LINE("Várj a", "szál kiadására"));
PROGMEM Language_Str <API key> = _UxGT(MSG_2_LINE("Várj a", "szál betöltésére"));
PROGMEM Language_Str <API key> = _UxGT(MSG_2_LINE("Várj a", "szál tisztításra"));
PROGMEM Language_Str <API key> = _UxGT(MSG_2_LINE("Kattints a készre", "szál tiszta"));
PROGMEM Language_Str <API key> = _UxGT(MSG_2_LINE("Várj a nyomtatóra", "majd folytat..."));
#else
PROGMEM Language_Str <API key> = _UxGT(MSG_1_LINE("Katt a folytatáshoz"));
PROGMEM Language_Str <API key> = _UxGT(MSG_1_LINE("Parkolás..."));
PROGMEM Language_Str <API key> = _UxGT(MSG_1_LINE("Kérlek várj..."));
PROGMEM Language_Str <API key> = _UxGT(MSG_1_LINE("Behelyez majd katt"));
PROGMEM Language_Str <API key> = _UxGT(MSG_1_LINE("Katt a fütéshez"));
PROGMEM Language_Str <API key> = _UxGT(MSG_1_LINE("Fütés..."));
PROGMEM Language_Str <API key> = _UxGT(MSG_1_LINE("Kiadás..."));
PROGMEM Language_Str <API key> = _UxGT(MSG_1_LINE("Betöltés..."));
PROGMEM Language_Str <API key> = _UxGT(MSG_1_LINE("Tisztítás..."));
PROGMEM Language_Str <API key> = _UxGT(MSG_1_LINE("Katt ha kész"));
PROGMEM Language_Str <API key> = _UxGT(MSG_1_LINE("Folytatás..."));
#endif
PROGMEM Language_Str MSG_TMC_DRIVERS = _UxGT("TMC meghajtók");
PROGMEM Language_Str MSG_TMC_CURRENT = _UxGT("Meghajtó áram");
PROGMEM Language_Str MSG_TMC_HYBRID_THRS = _UxGT("Hibrid küszöbérték");
PROGMEM Language_Str MSG_TMC_HOMING_THRS = _UxGT("Motoros kezdöpont");
PROGMEM Language_Str <API key> = _UxGT("Léptetö mód");
PROGMEM Language_Str <API key> = _UxGT("StealthChop mód");
PROGMEM Language_Str MSG_SERVICE_RESET = _UxGT("Újraindítás");
PROGMEM Language_Str MSG_SERVICE_IN = _UxGT(" be:");
PROGMEM Language_Str MSG_BACKLASH = _UxGT("Holtjáték");
PROGMEM Language_Str MSG_BACKLASH_A = LCD_STR_A;
PROGMEM Language_Str MSG_BACKLASH_B = LCD_STR_B;
PROGMEM Language_Str MSG_BACKLASH_C = LCD_STR_C;
PROGMEM Language_Str MSG_BACKLASH_I = LCD_STR_I;
PROGMEM Language_Str MSG_BACKLASH_J = LCD_STR_J;
PROGMEM Language_Str MSG_BACKLASH_K = LCD_STR_K;
PROGMEM Language_Str <API key> = _UxGT("Korrekció");
PROGMEM Language_Str <API key> = _UxGT("Simítás");
PROGMEM Language_Str MSG_LEVEL_X_AXIS = _UxGT("X tengely szint");
PROGMEM Language_Str MSG_AUTO_CALIBRATE = _UxGT("Önkalibrálás");
#if ENABLED(TOUCH_UI_FTDI_EVE)
PROGMEM Language_Str MSG_HEATER_TIMEOUT = _UxGT("Tétlenségi idökorlát, a hömérséklet csökkent. Nyomd meg az OK gombot az ismételt felfütéshez, és újra a folytatáshoz.");
#else
PROGMEM Language_Str MSG_HEATER_TIMEOUT = _UxGT("Fütés idökorlátja");
#endif
PROGMEM Language_Str MSG_REHEAT = _UxGT("Újrafüt");
PROGMEM Language_Str MSG_REHEATING = _UxGT("Újrafütés...");
PROGMEM Language_Str MSG_PROBE_WIZARD = _UxGT("Z szonda varázsló");
PROGMEM Language_Str <API key> = _UxGT("Z referencia mérés");
PROGMEM Language_Str <API key> = _UxGT("Menj a próba pontra");
PROGMEM Language_Str MSG_SOUND = _UxGT("Hang");
PROGMEM Language_Str MSG_TOP_LEFT = _UxGT("Bal felsö");
PROGMEM Language_Str MSG_BOTTOM_LEFT = _UxGT("Bal alsó");
PROGMEM Language_Str MSG_TOP_RIGHT = _UxGT("Jobb felsö");
PROGMEM Language_Str MSG_BOTTOM_RIGHT = _UxGT("Jobb alsó");
PROGMEM Language_Str <API key> = _UxGT("Kalibrálás befejezve");
PROGMEM Language_Str <API key> = _UxGT("Kalibrálási hiba");
PROGMEM Language_Str MSG_DRIVER_BACKWARD = _UxGT(" meghajtók hátra");
PROGMEM Language_Str MSG_SD_CARD = _UxGT("SD Kártya");
PROGMEM Language_Str MSG_USB_DISK = _UxGT("USB Lemez");
}
#if FAN_COUNT == 1
#define MSG_FIRST_FAN_SPEED MSG_FAN_SPEED
#define <API key> MSG_EXTRA_FAN_SPEED
#else
#define MSG_FIRST_FAN_SPEED MSG_FAN_SPEED_N
#define <API key> <API key>
#endif |
<?php
Yii::import('CHtml',true);
/**
* CErrorHandler handles uncaught PHP errors and exceptions.
*
* It displays these errors using appropriate views based on the
* nature of the error and the mode the application runs at.
* It also chooses the most preferred language for displaying the error.
*
* CErrorHandler uses two sets of views:
* <ul>
* <li>development views, named as <code>exception.php</code>;
* <li>production views, named as <code>error<StatusCode>.php</code>;
* </ul>
* where <StatusCode> stands for the HTTP error code (e.g. error500.php).
* Localized views are named similarly but located under a subdirectory
* whose name is the language code (e.g. zh_cn/error500.php).
*
* Development views are displayed when the application is in debug mode
* (i.e. YII_DEBUG is defined as true). Detailed error information with source code
* are displayed in these views. Production views are meant to be shown
* to end-users and are used when the application is in production mode.
* For security reasons, they only display the error message without any
* sensitive information.
*
* CErrorHandler looks for the view templates from the following locations in order:
* <ol>
* <li><code>themes/ThemeName/views/system</code>: when a theme is active.</li>
* <li><code>protected/views/system</code></li>
* <li><code>framework/views</code></li>
* </ol>
* If the view is not found in a directory, it will be looked for in the next directory.
*
* The property {@link maxSourceLines} can be changed to specify the number
* of source code lines to be displayed in development views.
*
* CErrorHandler is a core application component that can be accessed via
* {@link CApplication::getErrorHandler()}.
*
* @property array $error The error details. Null if there is no error.
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @package system.base
* @since 1.0
*/
class CErrorHandler extends <API key>
{
/**
* @var integer maximum number of source code lines to be displayed. Defaults to 25.
*/
public $maxSourceLines=25;
/**
* @var integer maximum number of trace source code lines to be displayed. Defaults to 10.
* @since 1.1.6
*/
public $maxTraceSourceLines = 10;
/**
* @var string the application administrator information (could be a name or email link). It is displayed in error pages to end users. Defaults to 'the webmaster'.
*/
public $adminInfo='the webmaster';
/**
* @var boolean whether to discard any existing page output before error display. Defaults to true.
*/
public $discardOutput=true;
/**
* @var string the route (eg 'site/error') to the controller action that will be used to display external errors.
* Inside the action, it can retrieve the error information by Yii::app()->errorHandler->error.
* This property defaults to null, meaning CErrorHandler will handle the error display.
*/
public $errorAction;
private $_error;
/**
* Handles the exception/error event.
* This method is invoked by the application whenever it captures
* an exception or PHP error.
* @param CEvent $event the event containing the exception/error information
*/
public function handle($event)
{
// set event as handled to prevent it from being handled by other event handlers
$event->handled=true;
if($this->discardOutput)
{
$gzHandler=false;
foreach(ob_list_handlers() as $h)
{
if(strpos($h,'gzhandler')!==false)
$gzHandler=true;
}
// the following manual level counting is to deal with zlib.output_compression set to On
for($level=ob_get_level();$level>0;--$level)
{
if(!@ob_end_clean())
ob_clean();
}
// reset headers in case there was an ob_start("ob_gzhandler") before
if($gzHandler && !headers_sent() && ob_list_handlers()===array())
{
if(function_exists('header_remove')) // php >= 5.3
{
header_remove('Vary');
header_remove('Content-Encoding');
}
else
{
header('Vary:');
header('Content-Encoding:');
}
}
}
if($event instanceof CExceptionEvent)
$this->handleException($event->exception);
else // CErrorEvent
$this->handleError($event);
}
/**
* Returns the details about the error that is currently being handled.
* The error is returned in terms of an array, with the following information:
* <ul>
* <li>code - the HTTP status code (e.g. 403, 500)</li>
* <li>type - the error type (e.g. 'CHttpException', 'PHP Error')</li>
* <li>message - the error message</li>
* <li>file - the name of the PHP script file where the error occurs</li>
* <li>line - the line number of the code where the error occurs</li>
* <li>trace - the call stack of the error</li>
* <li>source - the context source code where the error occurs</li>
* </ul>
* @return array the error details. Null if there is no error.
*/
public function getError()
{
return $this->_error;
}
/**
* Handles the exception.
* @param Exception $exception the exception captured
*/
protected function handleException($exception)
{
$app=Yii::app();
if($app instanceof CWebApplication)
{
if(($trace=$this->getExactTrace($exception))===null)
{
$fileName=$exception->getFile();
$errorLine=$exception->getLine();
}
else
{
$fileName=$trace['file'];
$errorLine=$trace['line'];
}
$trace = $exception->getTrace();
foreach($trace as $i=>$t)
{
if(!isset($t['file']))
$trace[$i]['file']='unknown';
if(!isset($t['line']))
$trace[$i]['line']=0;
if(!isset($t['function']))
$trace[$i]['function']='unknown';
unset($trace[$i]['object']);
}
$this->_error=$data=array(
'code'=>($exception instanceof CHttpException)?$exception->statusCode:500,
'type'=>get_class($exception),
'errorCode'=>$exception->getCode(),
'message'=>$exception->getMessage(),
'file'=>$fileName,
'line'=>$errorLine,
'trace'=>$exception->getTraceAsString(),
'traces'=>$trace,
);
if(!headers_sent())
header("HTTP/1.0 {$data['code']} ".$this->getHttpHeader($data['code'], get_class($exception)));
if($exception instanceof CHttpException || !YII_DEBUG)
$this->render('error',$data);
else
{
if($this->isAjaxRequest())
$app->displayException($exception);
else
$this->render('exception',$data);
}
}
else
$app->displayException($exception);
}
/**
* Handles the PHP error.
* @param CErrorEvent $event the PHP error event
*/
protected function handleError($event)
{
$trace=debug_backtrace();
// skip the first 3 stacks as they do not tell the error position
if(count($trace)>3)
$trace=array_slice($trace,3);
$traceString='';
foreach($trace as $i=>$t)
{
if(!isset($t['file']))
$trace[$i]['file']='unknown';
if(!isset($t['line']))
$trace[$i]['line']=0;
if(!isset($t['function']))
$trace[$i]['function']='unknown';
$traceString.="#$i {$trace[$i]['file']}({$trace[$i]['line']}): ";
if(isset($t['object']) && is_object($t['object']))
$traceString.=get_class($t['object']).'->';
$traceString.="{$trace[$i]['function']}()\n";
unset($trace[$i]['object']);
}
$app=Yii::app();
if($app instanceof CWebApplication)
{
switch($event->code)
{
case E_WARNING:
$type = 'PHP warning';
break;
case E_NOTICE:
$type = 'PHP notice';
break;
case E_USER_ERROR:
$type = 'User error';
break;
case E_USER_WARNING:
$type = 'User warning';
break;
case E_USER_NOTICE:
$type = 'User notice';
break;
case E_RECOVERABLE_ERROR:
$type = 'Recoverable error';
break;
default:
$type = 'PHP error';
}
$this->_error=$data=array(
'code'=>500,
'type'=>$type,
'message'=>$event->message,
'file'=>$event->file,
'line'=>$event->line,
'trace'=>$traceString,
'traces'=>$trace,
);
if(!headers_sent())
header("HTTP/1.0 500 Internal Server Error");
if($this->isAjaxRequest())
$app->displayError($event->code,$event->message,$event->file,$event->line);
elseif(YII_DEBUG)
$this->render('exception',$data);
else
$this->render('error',$data);
}
else
$app->displayError($event->code,$event->message,$event->file,$event->line);
}
/**
* whether the current request is an AJAX (XMLHttpRequest) request.
* @return boolean whether the current request is an AJAX request.
*/
protected function isAjaxRequest()
{
return isset($_SERVER['<API key>']) && $_SERVER['<API key>']==='XMLHttpRequest';
}
/**
* Returns the exact trace where the problem occurs.
* @param Exception $exception the uncaught exception
* @return array the exact trace where the problem occurs
*/
protected function getExactTrace($exception)
{
$traces=$exception->getTrace();
foreach($traces as $trace)
{
// property access exception
if(isset($trace['function']) && ($trace['function']==='__get' || $trace['function']==='__set'))
return $trace;
}
return null;
}
/**
* Renders the view.
* @param string $view the view name (file name without extension).
* See {@link getViewFile} for how a view file is located given its name.
* @param array $data data to be passed to the view
*/
protected function render($view,$data)
{
if($view==='error' && $this->errorAction!==null)
Yii::app()->runController($this->errorAction);
else
{
// additional information to be passed to view
$data['version']=$this->getVersionInfo();
$data['time']=time();
$data['admin']=$this->adminInfo;
include($this->getViewFile($view,$data['code']));
}
}
/**
* Determines which view file should be used.
* @param string $view view name (either 'exception' or 'error')
* @param integer $code HTTP status code
* @return string view file path
*/
protected function getViewFile($view,$code)
{
$viewPaths=array(
Yii::app()->getTheme()===null ? null : Yii::app()->getTheme()->getSystemViewPath(),
Yii::app() instanceof CWebApplication ? Yii::app()->getSystemViewPath() : null,
YII_PATH.DIRECTORY_SEPARATOR.'views',
);
foreach($viewPaths as $i=>$viewPath)
{
if($viewPath!==null)
{
$viewFile=$this->getViewFileInternal($viewPath,$view,$code,$i===2?'en_us':null);
if(is_file($viewFile))
return $viewFile;
}
}
}
/**
* Looks for the view under the specified directory.
* @param string $viewPath the directory containing the views
* @param string $view view name (either 'exception' or 'error')
* @param integer $code HTTP status code
* @param string $srcLanguage the language that the view file is in
* @return string view file path
*/
protected function getViewFileInternal($viewPath,$view,$code,$srcLanguage=null)
{
$app=Yii::app();
if($view==='error')
{
$viewFile=$app->findLocalizedFile($viewPath.DIRECTORY_SEPARATOR."error{$code}.php",$srcLanguage);
if(!is_file($viewFile))
$viewFile=$app->findLocalizedFile($viewPath.DIRECTORY_SEPARATOR.'error.php',$srcLanguage);
}
else
$viewFile=$viewPath.DIRECTORY_SEPARATOR."exception.php";
return $viewFile;
}
/**
* Returns server version information.
* If the application is in production mode, empty string is returned.
* @return string server version information. Empty if in production mode.
*/
protected function getVersionInfo()
{
if(YII_DEBUG)
{
$version='<a href="http:
if(isset($_SERVER['SERVER_SOFTWARE']))
$version=$_SERVER['SERVER_SOFTWARE'].' '.$version;
}
else
$version='';
return $version;
}
/**
* Converts arguments array to its string representation
*
* @param array $args arguments array to be converted
* @return string string representation of the arguments array
*/
protected function argumentsToString($args)
{
$count=0;
$isAssoc=$args!==array_values($args);
foreach($args as $key => $value)
{
$count++;
if($count>=5)
{
if($count>5)
unset($args[$key]);
else
$args[$key]='...';
continue;
}
if(is_object($value))
$args[$key] = get_class($value);
elseif(is_bool($value))
$args[$key] = $value ? 'true' : 'false';
elseif(is_string($value))
{
if(strlen($value)>64)
$args[$key] = '"'.substr($value,0,64).'..."';
else
$args[$key] = '"'.$value.'"';
}
elseif(is_array($value))
$args[$key] = 'array('.$this->argumentsToString($value).')';
elseif($value===null)
$args[$key] = 'null';
elseif(is_resource($value))
$args[$key] = 'resource';
if(is_string($key))
{
$args[$key] = '"'.$key.'" => '.$args[$key];
}
elseif($isAssoc)
{
$args[$key] = $key.' => '.$args[$key];
}
}
$out = implode(", ", $args);
return $out;
}
/**
* Returns a value indicating whether the call stack is from application code.
* @param array $trace the trace data
* @return boolean whether the call stack is from application code.
*/
protected function isCoreCode($trace)
{
if(isset($trace['file']))
{
$systemPath=realpath(dirname(__FILE__).'/..');
return $trace['file']==='unknown' || strpos(realpath($trace['file']),$systemPath.DIRECTORY_SEPARATOR)===0;
}
return false;
}
/**
* Renders the source code around the error line.
* @param string $file source file path
* @param integer $errorLine the error line number
* @param integer $maxLines maximum number of lines to display
* @return string the rendering result
*/
protected function renderSourceCode($file,$errorLine,$maxLines)
{
$errorLine--; // adjust line number to 0-based from 1-based
if($errorLine<0 || ($lines=@file($file))===false || ($lineCount=count($lines))<=$errorLine)
return '';
$halfLines=(int)($maxLines/2);
$beginLine=$errorLine-$halfLines>0 ? $errorLine-$halfLines:0;
$endLine=$errorLine+$halfLines<$lineCount?$errorLine+$halfLines:$lineCount-1;
$lineNumberWidth=strlen($endLine+1);
$output='';
for($i=$beginLine;$i<=$endLine;++$i)
{
$isErrorLine = $i===$errorLine;
$code=sprintf("<span class=\"ln".($isErrorLine?' error-ln':'')."\">%0{$lineNumberWidth}d</span> %s",$i+1,CHtml::encode(str_replace("\t",' ',$lines[$i])));
if(!$isErrorLine)
$output.=$code;
else
$output.='<span class="error">'.$code.'</span>';
}
return '<div class="code"><pre>'.$output.'</pre></div>';
}
/**
* Return correct message for each known http error code
* @param integer $httpCode error code to map
* @param string $replacement replacement error string that is returned if code is unknown
* @return string the textual representation of the given error code or the replacement string if the error code is unknown
*/
protected function getHttpHeader($httpCode, $replacement='')
{
$httpCodes = array(
100 => 'Continue',
101 => 'Switching Protocols',
102 => 'Processing',
118 => 'Connection timed out',
200 => 'OK',
201 => 'Created',
202 => 'Accepted',
203 => 'Non-Authoritative',
204 => 'No Content',
205 => 'Reset Content',
206 => 'Partial Content',
207 => 'Multi-Status',
210 => 'Content Different',
300 => 'Multiple Choices',
301 => 'Moved Permanently',
302 => 'Found',
303 => 'See Other',
304 => 'Not Modified',
305 => 'Use Proxy',
307 => 'Temporary Redirect',
310 => 'Too many Redirect',
400 => 'Bad Request',
401 => 'Unauthorized',
402 => 'Payment Required',
403 => 'Forbidden',
404 => 'Not Found',
405 => 'Method Not Allowed',
406 => 'Not Acceptable',
407 => 'Proxy Authentication Required',
408 => 'Request Time-out',
409 => 'Conflict',
410 => 'Gone',
411 => 'Length Required',
412 => 'Precondition Failed',
413 => 'Request Entity Too Large',
414 => 'Request-URI Too Long',
415 => 'Unsupported Media Type',
416 => 'Requested range unsatisfiable',
417 => 'Expectation failed',
418 => 'I’m a teapot',
422 => 'Unprocessable entity',
423 => 'Locked',
424 => 'Method failure',
425 => 'Unordered Collection',
426 => 'Upgrade Required',
449 => 'Retry With',
450 => 'Blocked by Windows Parental Controls',
500 => 'Internal Server Error',
501 => 'Not Implemented',
502 => 'Bad Gateway ou Proxy Error',
503 => 'Service Unavailable',
504 => 'Gateway Time-out',
505 => 'HTTP Version not supported',
507 => 'Insufficient storage',
509 => 'Bandwidth Limit Exceeded',
);
if(isset($httpCodes[$httpCode]))
return $httpCodes[$httpCode];
else
return $replacement;
}
} |
#ifndef __KVDBPEAK_H
#define __KVDBPEAK_H
#include "KVDBParameterSet.h"
#include "KVINDRARRMValidator.h"
#include "TString.h"
class KVDBPeak: public KVDBParameterSet, public KVINDRARRMValidator {
private:
Bool_t fAvecGaz; //=kTRUE if gaz present in chio
TString fDetector; //name of detector
TString fSignal; //=signal type
Float_t fGain; //gain of ampli for Si = 1.00 or 1.41
Float_t fEnergy; //theoretical energy of peak
UChar_t fRing; //ring number of Si or CsI (in coinc with ChIo if peak is in ChIo)
UChar_t fModule; //module number of Si or CsI (in coinc with ChIo if peak is in ChIo)
public:
KVDBPeak();
KVDBPeak(const Char_t* detname, const Char_t* type, UShort_t pnum);
virtual ~ KVDBPeak()
{
};
void init();
void SetGas(Bool_t avec = kTRUE)
{
fAvecGaz = avec;
};
Bool_t WithGas() const
{
return fAvecGaz;
};
void SetDetector(const Char_t* name)
{
fDetector = name;
};
const Char_t* GetDetector() const
{
return fDetector.Data();
};
void SetSigType(const Char_t* sig)
{
fSignal = sig;
};
const Char_t* GetSigType() const
{
return fSignal.Data();
};
void SetGain(Float_t gain)
{
fGain = gain;
};
Float_t GetGain() const
{
return fGain;
};
void SetEnergy(Float_t e)
{
fEnergy = e;
};
Float_t GetEnergy() const
{
return fEnergy;
};
void SetRing(UChar_t ring)
{
fRing = ring;
};
UChar_t GetRing() const
{
return fRing;
};
void SetModule(UChar_t mod)
{
fModule = mod;
};
UChar_t GetModule() const
{
return fModule;
};
Double_t GetCentroid()
{
return GetParameter(0);
};
Double_t GetError()
{
return GetParameter(1);
};
Double_t GetPeakWidth()
{
return GetParameter(2);
}
ClassDef(KVDBPeak, 2) //calibration points such as alpha, elastic, Brho
};
#endif |
#ifndef STATEMONITOR_H_
#define STATEMONITOR_H_
#include "auryn_definitions.h"
#include "AurynVector.h"
#include "Monitor.h"
#include "System.h"
#include "Connection.h"
#include <fstream>
#include <iomanip>
namespace auryn {
/*! \brief Records from an arbitray state vector of one unit from the source SpikingGroup to a file.*/
class StateMonitor : public Monitor
{
protected:
/*! \brief The source SpikingGroup to record from */
SpikingGroup * src;
/*! \brief Target variable */
AurynState * target_variable;
/*! \brief Last value (used for compression) */
AurynState lastval;
AurynState lastder;
/*! \brief The source neuron id to record from */
NeuronID nid;
/*! \brief The step size (sampling interval) in units of auryn_timestep */
AurynTime ssize;
/*! \brief Defines the maximum recording time in AurynTime to save space. */
AurynTime t_stop;
/*! \brief Standard initialization */
void init(string filename, AurynDouble stepsize);
public:
/*! \brief Switch to enable/disable output compression
*
* When set to true, Auryn will compute the derivative of two consecutive datapoints of the state
* and only a value if the derivative changes. The correct function can then be recovered with linear
* interpolation (i.e. plotting in gnuplot with lines will yield the correct output).
* When compression is enabled the last value written to file always by one timestep with respect to
* the simulation clock.
* enable_compression is true by default.
*/
bool enable_compression;
/*! \brief Standard constructor
*
* \param source The neuron group to record from
* \param id The neuron id in the group to record from
* \param statename The name of the StateVector to record from
* \param filename The filename of the file to dump the output to
* \param sampling_interval The sampling interval in seconds
*/
StateMonitor(SpikingGroup * source, NeuronID id, string statename, string filename, AurynDouble sampling_interval=auryn_timestep);
/*! \brief Alternative constructor
*
* \param state The source state vector
* \param filename The filename of the file to dump the output to
* \param sampling_interval The sampling interval in seconds
*/
StateMonitor(AurynStateVector * state, NeuronID id, string filename, AurynDouble sampling_interval=auryn_timestep);
/*! \brief Alternative constructor for synaptic states
*
* \param state The source state vector
* \param filename The filename of the file to dump the output to
* \param sampling_interval The sampling interval in seconds
*/
StateMonitor(AurynSynStateVector * state, NeuronID id, string filename, AurynDouble sampling_interval=auryn_timestep);
/*! \brief Trace constructor
*
* \param trace The source synaptic trace
* \param filename The filename of the file to dump the output to
* \param sampling_interval The sampling interval in seconds
*/
StateMonitor(Trace * trace, NeuronID id, string filename, AurynDouble sampling_interval=auryn_timestep);
/*! \brief Sets relative time at which to stop recording
*
* The time is given in seconds and interpreted as relative time with
* respect to the current clock value. This features is useful to decrease
* IO. The stop time can be set again after calling run to record multiple
* snippets. */
void record_for(AurynDouble time=10.0);
/*! \brief Set an absolute time when to stop recording. */
void set_stop_time(AurynDouble time=10.0);
/*! \brief Sets the step size.
*
* Sets the sampling interval using units of AurynTime.
*
* \param step The step size*/
void set_step_size(int step=1);
virtual ~StateMonitor();
void execute();
};
}
#endif /*STATEMONITOR_H_*/ |
#! /bin/sh
# Make sure all of these programs work properly
# when invoked with --help or --version.
# This program is free software: you can redistribute it and/or modify
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# Ensure that $SHELL is set to *some* value and exported.
# This is required for dircolors, which would fail e.g., when
# invoked via debuild (which removes SHELL from the environment).
test "x$SHELL" = x && SHELL=/bin/sh
export SHELL
. "${srcdir=.}/init.sh"; path_prepend_ ../sed
<API key>=125
<API key>=125
<API key>=125
<API key>=125
<API key>=125
<API key>=125
<API key>=2
<API key>=3
<API key>=2
<API key>=3
<API key>=2
<API key>=2
<API key>=2
<API key>=2
<API key>=2
<API key>=2
<API key>=2
<API key>=2
<API key>=2
<API key>=2
<API key>=2
<API key>=2
<API key>=2
<API key>=2
<API key>=2
<API key>=2
<API key>=4
test "$built_programs" \
|| fail_ "built_programs not specified!?!"
test "$VERSION" \
|| fail_ "set envvar VERSION; it is required for a PATH sanity-check"
# Extract version from --version output of the first program
for i in $built_programs; do
v=$(env $i --version | sed -n '1s/.*
break
done
# Ensure that it matches $VERSION.
test "x$v" = "x$VERSION" \
|| fail_ "--version-\$VERSION mismatch"
for i in $built_programs; do
# Skip 'test'; it doesn't accept --help or --version.
test $i = test && continue
# false fails even when invoked with --help or --version.
# true and false are tested with these options separately.
test $i = false || test $i = true && continue
# The just-built install executable is always named 'ginstall'.
test $i = install && i=ginstall
# Make sure they exit successfully, under normal conditions.
env $i --help >/dev/null || fail=1
env $i --version >/dev/null || fail=1
# Make sure they fail upon 'disk full' error.
if test -w /dev/full && test -c /dev/full; then
env $i --help >/dev/full 2>/dev/null && fail=1
env $i --version >/dev/full 2>/dev/null && fail=1
status=$?
test $i = [ && prog=lbracket || prog=$(echo $i|sed "s/$EXEEXT$
eval "expected=\$<API key>$prog"
test x$expected = x && expected=1
if test $status = $expected; then
:
else
fail=1
echo "*** $i: bad exit status '$status' (expected $expected)," 1>&2
echo " with --help or --version output redirected to /dev/full" 1>&2
fi
fi
done
bigZ_in=bigZ-in.Z
zin=zin.gz
zin2=zin2.gz
tmp=tmp-$$
tmp_in=in-$$
tmp_in2=in2-$$
tmp_dir=dir-$$
tmp_out=out-$$
mkdir $tmp || fail=1
cd $tmp || fail=1
comm_setup () { args="$tmp_in $tmp_in"; }
csplit_setup () { args="$tmp_in
cut_setup () { args='-f 1'; }
join_setup () { args="$tmp_in $tmp_in"; }
tr_setup () { args='a a'; }
chmod_setup () { args="a+x $tmp_in"; }
# Punt on these.
chgrp_setup () { args=--version; }
chown_setup () { args=--version; }
mkfifo_setup () { args=--version; }
mknod_setup () { args=--version; }
# Punt on uptime, since it fails (e.g., failing to get boot time)
# on some systems, and we shouldn't let that stop 'make check'.
uptime_setup () { args=--version; }
# Create a file in the current directory, not in $TMPDIR.
mktemp_setup () { args=mktemp.XXXX; }
cmp_setup () { args="$tmp_in $tmp_in2"; }
# Tell dd not to print the line with transfer rate and total.
# The transfer rate would vary between runs.
dd_setup () { args=status=noxfer; }
zdiff_setup () { args="$zin $zin2"; }
zcmp_setup () { args="$zin $zin2"; }
zcat_setup () { args=$zin; }
gunzip_setup () { args=$zin; }
zmore_setup () { args=$zin; }
zless_setup () { args=$zin; }
znew_setup () { args=$bigZ_in; }
zforce_setup () { args=$zin; }
zgrep_setup () { args="z $zin"; }
zegrep_setup () { args="z $zin"; }
zfgrep_setup () { args="z $zin"; }
gzexe_setup () { args=$tmp_in; }
# We know that $tmp_in contains a "0"
grep_setup () { args="0 $tmp_in"; }
egrep_setup () { args="0 $tmp_in"; }
fgrep_setup () { args="0 $tmp_in"; }
sed_setup () { args="s/a/b/ $tmp_in"; }
diff_setup () { args="$tmp_in $tmp_in2"; }
sdiff_setup () { args="$tmp_in $tmp_in2"; }
diff3_setup () { args="$tmp_in $tmp_in2 $tmp_in2"; }
cp_setup () { args="$tmp_in $tmp_in2"; }
ln_setup () { args="$tmp_in ln-target"; }
ginstall_setup () { args="$tmp_in $tmp_in2"; }
mv_setup () { args="$tmp_in $tmp_in2"; }
mkdir_setup () { args=$tmp_dir/subdir; }
realpath_setup () { args=$tmp_in; }
rmdir_setup () { args=$tmp_dir; }
rm_setup () { args=$tmp_in; }
shred_setup () { args=$tmp_in; }
touch_setup () { args=$tmp_in2; }
truncate_setup () { args="--reference=$tmp_in $tmp_in2"; }
mkid_setup () { printf 'f(){}\ntypedef int t;\n' > f.c; args=. ; }
lid_setup () { args=; }
fid_setup () { args=f.c; }
fnid_setup () { args=; }
xtokid_setup () { args=; }
aid_setup () { args=f; }
eid_setup () { args=--version; }
gid_setup () { args=f; }
defid_setup () { args=t; }
basename_setup () { args=$tmp_in; }
dirname_setup () { args=$tmp_in; }
expr_setup () { args=foo; }
# Punt, in case GNU 'id' hasn't been installed yet.
groups_setup () { args=--version; }
pathchk_setup () { args=$tmp_in; }
yes_setup () { args=--version; }
logname_setup () { args=--version; }
nohup_setup () { args=--version; }
printf_setup () { args=foo; }
seq_setup () { args=10; }
sleep_setup () { args=0; }
stdbuf_setup () { args="-oL true"; }
timeout_setup () { args=--version; }
# I'd rather not run sync, since it spins up disks that I've
# deliberately caused to spin down (but not unmounted).
sync_setup () { args=--version; }
test_setup () { args=foo; }
# This is necessary in the unusual event that there is
# no valid entry in /etc/mtab.
df_setup () { args=/; }
# This is necessary in the unusual event that getpwuid (getuid ()) fails.
id_setup () { args=-u; }
# Use env to avoid invoking built-in sleep of Solaris 11's /bin/sh.
kill_setup () {
env sleep 31.5 &
args=$!
}
link_setup () { args="$tmp_in link-target"; }
unlink_setup () { args=$tmp_in; }
readlink_setup () {
ln -s . slink
args=slink;
}
stat_setup () { args=$tmp_in; }
unlink_setup () { args=$tmp_in; }
lbracket_setup () { args=": ]"; }
parted_setup () { args="-s $tmp_in mklabel gpt"
dd if=/dev/null of=$tmp_in seek=2000; }
# Ensure that each program "works" (exits successfully) when doing
# something more than --help or --version.
for i in $built_programs; do
# Skip these.
case $i in chroot|stty|tty|false|chcon|runcon|coreutils) continue;; esac
rm -rf $tmp_in $tmp_in2 $tmp_dir $tmp_out $bigZ_in $zin $zin2
echo z |gzip > $zin
cp $zin $zin2
cp $zin $bigZ_in
# This is sort of kludgey: use numbers so this is valid input for factor,
# and two tokens so it's valid input for tsort.
echo 2147483647 0 > $tmp_in
# Make $tmp_in2 identical. Then, using $tmp_in and $tmp_in2 as arguments
# to the likes of cmp and diff makes them exit successfully.
cp $tmp_in $tmp_in2
mkdir $tmp_dir
test $i = [ && prog=lbracket || prog=$(echo $i|sed "s/$EXEEXT$
if type ${prog}_setup > /dev/null 2>&1; then
${prog}_setup
else
args=
fi
if env $i $args < $tmp_in > $tmp_out; then
:
else
echo FAIL: $i
fail=1
fi
rm -rf $tmp_in $tmp_in2 $tmp_out $tmp_dir
done
Exit $fail |
#include "triSurf.H"
#include "<API key>.H"
#include "helperFunctions.H"
//#define DEBUGSearch
namespace Foam
{
// Static data
const label <API key>::edgeNodes_[12][2] =
{
//- edges in x-direction
{0, 1},
{2, 3},
{4, 5},
{6, 7},
//- edges in y-direction
{0, 2},
{1, 3},
{4, 6},
{5, 7},
//- edges in z-direction
{0, 4},
{1, 5},
{2, 6},
{3, 7}
};
const label <API key>::faceNodes_[6][4] =
{
{0, 4, 6, 2},
{1, 3, 7, 5},
{0, 1, 5, 4},
{2, 6, 7, 3},
{0, 2, 3, 1},
{4, 5, 7, 6}
};
const label <API key>::nodeFaces_[8][3] =
{
{0, 2, 4},
{1, 2, 4},
{0, 3, 4},
{1, 3, 4},
{0, 2, 5},
{1, 2, 5},
{0, 3, 5},
{1, 3, 5}
};
const label <API key>::faceEdges_[6][4] =
{
{8, 6, 10, 4},
{5, 11, 7, 9},
{0, 9, 2, 8},
{10, 3, 11, 1},
{4, 1, 5, 0},
{2, 7, 3, 6}
};
const label <API key>::edgeFaces_[12][2] =
{
{2, 4},
{3, 4},
{2, 5},
{3, 5},
{0, 4},
{1, 4},
{0, 5},
{1, 5},
{0, 2},
{1, 2},
{0, 3},
{1, 3}
};
const label <API key>::oppositeFace_[6] = {1, 0, 3, 2, 5, 4};
void <API key>::vertices
(
const boundBox& rootBox,
FixedList<point, 8>& vrt
) const
{
const vector tol = SMALL * (rootBox.max() - rootBox.min());
point min_, max_;
cubeBox(rootBox, min_, max_);
min_ -= tol;
max_ += tol;
vrt[0] = point(min_.x(), min_.y(), min_.z());
vrt[1] = point(max_.x(), min_.y(), min_.z());
vrt[2] = point(min_.x(), max_.y(), min_.z());
vrt[3] = point(max_.x(), max_.y(), min_.z());
vrt[4] = point(min_.x(), min_.y(), max_.z());
vrt[5] = point(max_.x(), min_.y(), max_.z());
vrt[6] = point(min_.x(), max_.y(), max_.z());
vrt[7] = point(max_.x(), max_.y(), max_.z());
}
void <API key>::edgeVertices
(
const boundBox& rootBox,
FixedList<FixedList<point, 2>, 12>& e
) const
{
FixedList<point, 8> vertices;
this->vertices(rootBox, vertices);
for(label i=0;i<12;++i)
{
e[i][0] = vertices[edgeNodes_[i][0]];
e[i][1] = vertices[edgeNodes_[i][1]];
}
}
bool <API key>::intersectsTriangle
(
const triSurf& surface,
const boundBox& rootBox,
const label tI
) const
{
const pointField& points = surface.points();
const labelledTri& ltri = surface[tI];
const vector tol = SMALL * (rootBox.max() - rootBox.min());
//- calculate the bound box of the octree cube
boundBox cBox;
cubeBox(rootBox, cBox.min(), cBox.max());
cBox.min() -= tol;
cBox.max() += tol;
//- calculate the bounding box of the triangle
boundBox tBox;
tBox.min() = tBox.max() = points[ltri[0]];
for(label pI=1;pI<3;++pI)
{
tBox.max() = Foam::max(points[ltri[pI]], tBox.max());
tBox.min() = Foam::min(points[ltri[pI]], tBox.min());
}
tBox.min() -= tol;
tBox.max() += tol;
return cBox.overlaps(tBox);
}
bool <API key>::<API key>
(
const triSurf& surface,
const boundBox& rootBox,
const label tI
) const
{
if( !intersectsTriangle(surface, rootBox, tI) )
return false;
const vector tol = SMALL * (rootBox.max() - rootBox.min());
const pointField& points = surface.points();
const labelledTri& ltri = surface[tI];
//- check if any of the vertices is in the cube
forAll(ltri, pI)
if( isVertexInside(rootBox, points[ltri[pI]]) )
return true;
//- check if any edges of the triangle intersect the cube
boundBox bb;
cubeBox(rootBox, bb.min(), bb.max());
bb.min() -= tol;
bb.max() += tol;
for(label eI=0;eI<3;++eI)
{
const edge edg(ltri[eI], ltri[(eI+1)%3]);
const point& s = points[edg.start()];
const point& e = points[edg.end()];
if( help::<API key>(s, e, bb) )
return true;
}
//- check if any cube edges intersects the triangle
FixedList<FixedList<point, 2>, 12> e;
this->edgeVertices(rootBox, e);
point intersection;
forAll(e, eI)
if(
help::triLineIntersection
(
surface,
tI,
e[eI][0],
e[eI][1],
intersection
)
)
return true;
return false;
}
bool <API key>::isVertexInside
(
const boundBox& rootBox,
const point& p
) const
{
const vector tol = SMALL * (rootBox.max() - rootBox.min());
point min, max;
cubeBox(rootBox, min, max);
max += tol;
min -= tol;
if(
((p.x() - max.x()) > 0.0) ||
((p.y() - max.y()) > 0.0) ||
((p.z() - max.z()) > 0.0) ||
((p.x() - min.x()) < 0.0) ||
((p.y() - min.y()) < 0.0) ||
((p.z() - min.z()) < 0.0)
)
return false;
return true;
}
bool <API key>::isPositionInside
(
const <API key>& cc
) const
{
# ifdef DEBUGSearch
Info << "Checking cube " << *this << endl;
Info << "level " << short(l) << " x: " << px
<< " y: " << py << " z:" << pz << endl;
# endif
if( cc.level() >= this->level() )
{
const direction diff = cc.level() - this->level();
<API key> reducedLevel =
cc.reduceLevelBy(diff);
# ifdef DEBUGSearch
Info << "diff " << label(diff) << endl;
Info << "Divider " << divider << endl;
Info << "Coordinates at level are " << reducedLevel << endl;
# endif
if( reducedLevel == *this )
return true;
}
else
{
FatalErrorIn
(
"bool <API key>::isPositionInside"
"(const label px,const label py,"
"const label pz,const direction l)"
) << "Cannot find exact position of finer cube" << exit(FatalError);
}
return false;
}
bool <API key>::intersectsLine
(
const boundBox& rootBox,
const point& s,
const point& e
) const
{
const scalar tol = SMALL * (rootBox.max().x() - rootBox.min().x());
point min, max;
cubeBox(rootBox, min, max);
//- check if the cube contains start point or end point
min -= vector(tol,tol,tol);
max += vector(tol,tol,tol);
//- check for intersections of line with the cube faces
const vector v(e - s);
scalar t;
point i;
if( mag(v.x()) > tol )
{
//- x-min face
t = (min.x() - s.x()) / v.x();
i = s + t * v;
if(
(t > -tol) && (t < (1.0+tol)) &&
(i.y() - min.y() > -tol) &&
(i.y() - max.y() < tol) &&
(i.z() - min.z() > -tol) &&
(i.z() - max.z() < tol)
)
return true;
//- x-max face
t = (max.x() - s.x()) / v.x();
i = s + t * v;
if(
(t > -tol) && (t < (1.0+tol)) &&
(i.y() - min.y() > -tol) &&
(i.y() - max.y() < tol) &&
(i.z() - min.z() > -tol) &&
(i.z() - max.z() < tol)
)
return true;
}
if( mag(v.y()) > tol)
{
//- y-min face
t = (min.y() - s.y()) / v.y();
i = s + t * v;
if(
(t > -tol) && (t < (1.0+tol)) &&
(i.x() - min.x() > -tol) &&
(i.x() - max.x() < tol) &&
(i.z() - min.z() > -tol) &&
(i.z() - max.z() < tol)
)
return true;
//- y-max face
t = (max.y() - s.y()) / v.y();
i = s + t * v;
if(
(t > -tol) && (t < (1.0+tol)) &&
(i.x() - min.x() > -tol) &&
(i.x() - max.x() < tol) &&
(i.z() - min.z() > -tol) &&
(i.z() - max.z() < tol)
)
return true;
}
if( mag(v.z()) > tol )
{
//- z-min face
t = (min.z() - s.z()) / v.z();
i = s + t * v;
if(
(t > -tol) && (t < (1.0+tol)) &&
(i.x() - min.x() > -tol) &&
(i.x() - max.x() < tol) &&
(i.y() - min.y() > -tol) &&
(i.y() - max.y() < tol)
)
return true;
//- z-min face
t = (max.z() - s.z()) / v.z();
i = s + t * v;
if(
(t > -tol) && (t < (1.0+tol)) &&
(i.x() - min.x() > -tol) &&
(i.x() - max.x() < tol) &&
(i.y() - min.y() > -tol) &&
(i.y() - max.y() < tol)
)
return true;
}
if( isVertexInside(rootBox, s) )
return true;
return false;
}
} // End namespace Foam |
#include "<API key>.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::<API key>::<API key>
(
faMesh& mesh,
const PtrList<faMesh>& procMeshes,
const PtrList<labelIOList>& edgeProcAddressing,
const PtrList<labelIOList>& faceProcAddressing,
const PtrList<labelIOList>& <API key>
)
:
mesh_(mesh),
procMeshes_(procMeshes),
edgeProcAddressing_(edgeProcAddressing),
faceProcAddressing_(faceProcAddressing),
<API key>(<API key>)
{} |
/** @file Params.cpp
* @author Gav Wood <i@gavwood.com>
* @date 2014
*/
#include "Params.h"
using namespace std;
namespace dev
{
namespace eth
{
u256 const c_genesisDifficulty = 131072;
u256 const <API key> = 1024;
u256 const c_genesisGasLimit = 3141592;
u256 const c_minGasLimit = 125000;
u256 const <API key> = 1024;
u256 const c_minimumDifficulty = 131072;
u256 const <API key> = 2048;
u256 const c_durationLimit = 8;
}
} |
<?php
require('./roots.php');
require($root_path.'include/core/<API key>.php');
error_reporting($ErrorLevel);
# Define to TRUE if you want to echo the actions
# Note: might be useless in case of large number of persons.
define('ECHO_ACTION',FALSE);
# Crude protection to avoid robots from starting the script
if(!isset($max)||($max<0)||!isset($sex)){
//header('Location:../');
echo "finished or invalid";
exit;
}
# Set the maximum nr of persons created defaults to 1000
if(isset($max)&&(empty($max)||!$max)){
$max=1000; # <== Set this value for default
}
# default to male sex
if(isset($sex)&&empty($sex)||($sex!='m'&&$sex!='f')) $sex='m';
# seed the random generator
srand ((double) microtime() * 1000000);
$inmax=180;
define('LANG_FILE','specials.php');
//$local_user='aufnahme_user';
define('NO_CHAIN',1);
require_once($root_path.'include/core/<API key>.php');
# Retrieve all available persons from the table according to selected sex
$sql1="select date_reg, name_first,name_last,date_birth,blood_group,addr_str,addr_str_nr,addr_zip,phone_1_nr,civil_status,sex,title from care_person where sex='$sex' ";
if($pool=$db->Execute($sql1)){
if($poolcount=$pool->RecordCount()){
if($max<$inmax) $inmax=$max;
if($poolcount<$inmax) $inmax=$poolcount;
# Loop to create the new values
for($x=0,$n=0;$x<$inmax;$x++,$n++){
# get a first random value
$rd1= rand(0,$poolcount-1);
# get a second random value;
$rd2= rand(0,$poolcount-1);
# if rd1 == rd2 try getting a different rd2
while($rd1==$rd2){
$rd2=rand(0,$poolcount-1);
}
# Move cursor to first random nr.
$pool->Move($rd1);
# Fetch this row
$person1=$pool->FetchRow();
# Move cursor to second random nr.
$pool->Move($rd2);
# Fetch this row
$person2=$pool->FetchRow();
# Check if date registration is usable, default to today
if($person1['date_reg']=='0000-00-00 00:00:00'){
if($person2['date_reg']=='0000-00-00 00:00:00'){
$date_reg=date('Y-m-d H:i:s'); # This is today
}else{
$date_reg=$person2['date_reg'];
}
}else{
$date_reg=$person1['date_reg'];
}
# generate random blood group
$rd3=rand(1,4);
switch($rd3){
case 1: $blood_group='A';break;
case 2: $blood_group='B';break;
case 3: $blood_group='O';break;
default : $blood_group='AB';
}
# generate random civil status
$rd4=rand(1,5);
switch($rd4){
case 4: $civil_status='single';break;
case 2: $civil_status='married';break;
case 3: $civil_status='divorced';break;
case 1: $civil_status='widowed';break;
default : $civil_status='separated';
}
# Create combined person
$sql2="insert into care_person
(date_reg,
name_first,
name_last,
date_birth,
blood_group,
addr_str,
addr_str_nr,
addr_zip,
phone_1_nr,
civil_status,
sex,
title,
status,
history,
modify_id,
modify_time,
create_id,
create_time)
values
('".$date_reg."',
'".$person2['name_first']."',
'".$person1['name_last']."',
'".$person2['date_birth']."',
'".$blood_group."',
'".$person2['addr_str']."',
'".$person1['addr_str_nr']."',
'".$person2['addr_zip']."',
'".$person1['phone_1_nr']."',
'".$civil_status."',
'".$sex."',
'".$person1['title']."',
'',
'Create: ".date('Y-m-d H:i:s')." generator',
'generator',
'".date('YmdHis')."',
'generator',
'".date('YmdHis')."')";
# for debugging
if(defined('ECHO_ACTION')&&ECHO_ACTION){
echo "<p>random 1: $rd1, random 2: $rd2<p>";
echo $person1['name_first'].' '.$person1['name_last'].' '.$person1['date_birth'].'<br>';
echo $person2['name_first'].' '.$person2['name_last'].' '.$person2['date_birth'].'<br>';
//echo "<br>$sql2";
}
# Insert the new person in the table
# Comment out the following line if you want to simulate the generation without saving into the table
$db->BeginTrans();
$ok=$db->Execute($sql2);
if($ok) {
$db->CommitTrans();
if($n>50||(defined('ECHO_ACTION')&&ECHO_ACTION)){
//echo "<p>$x<br>$sql2";
$n=0;
}
}else{
$db->RollbackTrans();
//echo "insert failed<p>";
}
}
//echo "<br>$x<br>";
$totmax=$max-$inmax;
if(!$totmax||$totmax<0){
echo "finished";
exit;
}else{
header("Location:makeperson.php?max=$totmax&sex=$sex");
exit;
}
}else{
echo "nothing found! <p> $sql1<p>";
}
}else{
echo "sql query failed! <p> $sql1<p>";
}
?> |
#1570870260
-- This file is part of Hercules.
-- http:
-- Hercules is free software: you can redistribute it and/or modify
-- (at your option) any later version.
-- This program is distributed in the hope that it will be useful,
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- along with this program. If not, see <http:
ALTER TABLE `picklog` MODIFY `type` enum('M','P','L','T','V','S','N','C','A','R','G','E','B','O','I','X','D','U','K','Y','Z','W','Q','J','H','@','0','1','2', '3') NOT NULL DEFAULT 'P';
INSERT INTO `sql_updates` (`timestamp`) VALUES (1570870260); |
<html>
<head>
<title>IconProcs -- a BYOND library</title>
<style>
body {font: 11pt 'Trebuchet MS',Tahoma,Verdana,Arial,Helvetica,sans-serif;}
h1 {margin-bottom: 0; text-align: center;}
p.subtitle {margin: 0; text-align: center;}
p.author {margin-top: 0; text-align: center; font-style: italic;}
p.version {text-align: center; font-weight: bold;}
</style>
</head>
<body>
<h1>IconProcs</h1>
<p class="subtitle">A BYOND library for manipulating icons and colors</p>
<p class="author">by Lummox JR</p>
<p class="version">version 1.0</p>
<p>The IconProcs library was made to make a lot of common icon operations much
easier. BYOND's icon manipulation routines are very capable but some of the
advanced capabilities like using alpha transparency can be unintuitive to
beginners.</p>
<h2>Changing Icons</h2>
<p>Several new procs have been added to the <tt>/icon</tt> datum to simplify
working with icons. To use them, remember you first need to setup an
<tt>/icon</tt> var like so:</p>
<pre>var/icon/my_icon = new('iconfile.dmi')</pre>
<dl>
<dt><tt>icon/ChangeOpacity(amount = 1)</tt></dt>
<dd>A very common operation in DM is to try to make an icon more or less
transparent. Making an icon more transparent is usually much easier than making
it less so, however. This proc basically is a frontend for <tt>MapColors()</tt>
which can change opacity any way you like, in much the same way that
<tt>SetIntensity()</tt> can make an icon lighter or darker. If <tt>amount</tt>
is 0.5, the opacity of the icon will be cut in half. If <tt>amount</tt> is 2,
opacity is doubled and anything more than half-opaque will become fully
opaque.</dd>
<dt><tt>icon/GrayScale()</tt></dt>
<dd>Converts the icon to grayscale instead of a fully colored icon. Alpha
values are left intact.</dd>
<dt><tt>icon/ColorTone(tone)</tt></dt>
<dd>Similar to <tt>GrayScale()</tt>, this proc converts the icon to a range of
black -> <tt>tone</tt> -> white, where <tt>tone</tt> is an RGB color (its
alpha is ignored). This can be used to create a sepia tone or similar effects.
See also the global <tt>ColorTone()</tt> proc.</dd>
<dt><tt>icon/MinColors(icon)</tt></dt>
<dd>The icon is blended with a second icon where the minimum of each RGB pixel
is the result. Transparency may increase, as if the icons were blended with
<tt>ICON_ADD</tt>. You may supply a color in place of an icon.</dd>
<dt><tt>icon/MaxColors(icon)</tt></dt>
<dd>The icon is blended with a second icon where the maximum of each RGB pixel
is the result. Opacity may increase, as if the icons were blended with
<tt>ICON_OR</tt>. You may supply a color in place of an icon.</dd>
<dt><tt>icon/Opaque(background = "#000000")</tt></dt>
<dd>All alpha values are set to 255 throughout the icon. Transparent pixels
become black, or whatever background color you specify.</dd>
<dt><tt>icon/BecomeAlphaMask()</tt></dt>
<dd>You can convert a simple grayscale icon into an alpha mask to use with other
icons very easily with this proc. The black parts become transparent, the
white parts stay white, and anything in between becomes a translucent shade of
white.</dd>
<dt><tt>icon/AddAlphaMask(mask)</tt></dt>
<dd>The alpha values of the mask icon will be blended with the current icon.
Anywhere the mask is opaque, the current icon is untouched. Anywhere the mask
is transparent, the current icon becomes transparent. Where the mask is
translucent, the current icon becomes more transparent.</dd>
<dt><tt>icon/UseAlphaMask(mask, mode)</tt></dt>
<dd>Sometimes you may want to take the alpha values from one icon and use them
on a different icon. This proc will do that. Just supply the icon whose alpha
mask you want to use, and <tt>src</tt> will change so it has the same colors
as before but uses the mask for opacity.</dd>
</dl>
<h2>Color management and HSV</h2>
<p>RGB isn't the only way to represent color. Sometimes it's more useful to
work with a model called HSV, which stands for hue, saturation, and value.</p>
<ul>
<li>The <b>hue</b> of a color describes where it is along the color wheel. It goes from red to yellow to green to cyan to blue to magenta and back to red.</li>
<li>The <b>saturation</b> of a color is how much color is in it. A color with low saturation will be more gray, and with no saturation at all it <i>is</i> a shade of gray.</li>
<li>The <b>value</b> of a color determines how bright it is. A high-value color is vivid, moderate value is dark, and no value at all is black.</li>
</ul>
<p>Just as BYOND uses <tt>"#rrggbb"</tt> to represent RGB values, a similar
format is used for HSV: <tt>"#hhhssvv"</tt>. The hue is three hex digits
because it ranges from 0 to 0x5FF.</p>
<ul>
<li>0 to 0xFF - red to yellow</li>
<li>0x100 to 0x1FF - yellow to green</li>
<li>0x200 to 0x2FF - green to cyan</li>
<li>0x300 to 0x3FF - cyan to blue</li>
<li>0x400 to 0x4FF - blue to magenta</li>
<li>0x500 to 0x5FF - magenta to red</li>
</ul>
<p>Knowing this, you can figure out that red is <tt>"#000ffff"</tt> in HSV
format, which is hue 0 (red), saturation 255 (as colorful as possible), value
255 (as bright as possible). Green is <tt>"#200ffff"</tt> and blue is
<tt>"#400ffff"</tt>.</p>
<p>More than one HSV color can match the same RGB color.</p>
<p>Here are some procs you can use for color management:</p>
<dl>
<dt><tt>ReadRGB(rgb)</tt></dt>
<dd>Takes an RGB string like <tt>"#ffaa55"</tt> and converts it to a list such
as <tt>list(255,170,85)</tt>. If an RGBA format is used that includes alpha,
the list will have a fourth item for the alpha value.</dd>
<dt><tt>hsv(hue, sat, val, apha)</tt></dt>
<dd>Counterpart to <tt>rgb()</tt>, this takes the values you input and converts
them to a string in <tt>"#hhhssvv"</tt> or <tt>"#hhhssvvaa"</tt> format. Alpha
is not included in the result if null.</dd>
<dt><tt>ReadHSV(rgb)</tt></dt>
<dd>Takes an HSV string like <tt>"#100FF80"</tt> and converts it to a list such
as <tt>list(256,255,128)</tt>. If an HSVA format is used that includes alpha,
the list will have a fourth item for the alpha value.</dd>
<dt><tt>RGBtoHSV(rgb)</tt></dt>
<dd>Takes an RGB or RGBA string like <tt>"#ffaa55"</tt> and converts it into an
HSV or HSVA color such as <tt>"#080aaff"</tt>.</dd>
<dt><tt>HSVtoRGB(hsv)</tt></dt>
<dd>Takes an HSV or HSVA string like <tt>"#080aaff"</tt> and converts it into
an RGB or RGBA color such as <tt>"#ff55aa"</tt>.</dd>
<dt><tt>BlendRGB(rgb1, rgb2, amount)</tt></dt>
<dd>Blends between two RGB or RGBA colors using regular RGB blending. If
<tt>amount</tt> is 0, the first color is the result; if 1, the second color is
the result. 0.5 produces an average of the two. Values outside the 0 to 1 range
are allowed as well. The returned value is an RGB or RGBA color.</dd>
<dt><tt>BlendHSV(hsv1, hsv2, amount)</tt></dt>
<dd>Blends between two HSV or HSVA colors using HSV blending, which tends to
produce nicer results than regular RGB blending because the brightness of the
color is left intact. If <tt>amount</tt> is 0, the first color is the result;
if 1, the second color is the result. 0.5 produces an average of the two.
Values outside the 0 to 1 range are allowed as well. The returned value is an
HSV or HSVA color.</dd>
<dt><tt>BlendRGBasHSV(rgb1, rgb2, amount)</tt></dt>
<dd>Like <tt>BlendHSV()</tt>, but the colors used and the return value are RGB
or RGBA colors. The blending is done in HSV form.</dd>
<dt><tt>HueToAngle(hue)</tt></dt>
<dd>Converts a hue to an angle range of 0 to 360. Angle 0 is red, 120 is green,
and 240 is blue.</dd>
<dt><tt>AngleToHue(hue)</tt></dt>
<dd>Converts an angle to a hue in the valid range.</dd>
<dt><tt>RotateHue(hsv, angle)</tt></dt>
<dd>Takes an HSV or HSVA value and rotates the hue forward through red, green,
and blue by an angle from 0 to 360. (Rotating red by 60° produces yellow.)
The result is another HSV or HSVA color with the same saturation and value as
the original, but a different hue.</dd>
<dt><tt>GrayScale(rgb)</tt></dt>
<dd>Takes an RGB or RGBA color and converts it to grayscale. Returns an RGB or
RGBA string.</dd>
<dt><tt>ColorTone(rgb, tone)</tt></dt>
<dd>Similar to <tt>GrayScale()</tt>, this proc converts an RGB or RGBA color to
a range of black -> <tt>tone</tt> -> white instead of using strict shades
of gray. The <tt>tone</tt> value is an RGB color; any alpha value is
ignored.</dd>
</dl>
</body>
</html> |
/* Generated automatically. DO NOT EDIT! */
#define SIMD_HEADER "simd-avx2.h"
#include "../common/hc2cbdftv_4.c" |
pwd
version=$(cat jenkins/version.txt)
rm -Rf build
mkdir -p build
cd build
cmake -D <API key>:BOOL=OFF -D BUILD_LUA_WRAPPERS:BOOL=OFF .. || exit 1
make || exit 1
tar -cjf deepcl-linux64-${version}.tar.bz2 --exclude=CMake* --exclude=CMakeFiles --exclude=cmake* --exclude=Makefile --exclude=*.png --exclude=*.dat * |
package org.echocat.locela.api.java.annotations;
import org.junit.Test;
import static org.echocat.locela.api.java.testing.Assert.assertThat;
import static org.echocat.locela.api.java.testing.BaseMatchers.is;
import static org.echocat.locela.api.java.testing.BaseMatchers.isInstanceOf;
import static org.echocat.locela.api.java.annotations.AnnotationParser.annotationParser;
public class <API key> {
protected static final AnnotationParser PARSER = annotationParser();
@Test
public void <API key>() throws Exception {
assertThat(((CommentAnnotation) PARSER.parse("comment(\"foo bar\")")).getContent(), is("foo bar"));
}
@Test
public void whiteSpaces() throws Exception {
final FooAnnotation annotation1 = (FooAnnotation) PARSER.parse(" foo ( true ,\t3.4 ,\"a string\"\t)");
assertThat(annotation1.isABoolean(), is(true));
assertThat(annotation1.getADouble(), is(3.4D));
assertThat(annotation1.getAString(), is("a string"));
final FooAnnotation annotation2 = (FooAnnotation) PARSER.parse("\tfoo ( false,\t-3.4 , \" ddd\")\t\t");
assertThat(annotation2.isABoolean(), is(false));
assertThat(annotation2.getADouble(), is(-3.4D));
assertThat(annotation2.getAString(), is(" ddd"));
}
@SuppressWarnings("unchecked")
@Test
public void booleanValues() throws Exception {
assertThat(((GenericAnnotation<Boolean>) PARSER.parse("boolean(true)")).getValue(), is(true));
assertThat(((GenericAnnotation<Boolean>) PARSER.parse("boolean(false)")).getValue(), is(false));
assertThat(((GenericAnnotation<Boolean>) PARSER.parse("boolean(yes)")).getValue(), is(true));
assertThat(((GenericAnnotation<Boolean>) PARSER.parse("boolean(no)")).getValue(), is(false));
assertThat(((GenericAnnotation<Boolean>) PARSER.parse("boolean(on)")).getValue(), is(true));
assertThat(((GenericAnnotation<Boolean>) PARSER.parse("boolean(off)")).getValue(), is(false));
}
@SuppressWarnings("unchecked")
@Test
public void doubleValues() throws Exception {
assertThat(((GenericAnnotation<Double>) PARSER.parse("double(1)")).getValue(), is(1D));
assertThat(((GenericAnnotation<Double>) PARSER.parse("double(2)")).getValue(), is(2D));
assertThat(((GenericAnnotation<Double>) PARSER.parse("double(-1)")).getValue(), is(-1D));
assertThat(((GenericAnnotation<Double>) PARSER.parse("double(-2)")).getValue(), is(-2D));
assertThat(((GenericAnnotation<Double>) PARSER.parse("double(12345.6789)")).getValue(), is(12345.6789D));
assertThat(((GenericAnnotation<Double>) PARSER.parse("double(-9876.54321)")).getValue(), is(-9876.54321D));
}
@SuppressWarnings("unchecked")
@Test
public void stringValues() throws Exception {
assertThat(((GenericAnnotation<String>) PARSER.parse("string(\"a\")")).getValue(), is("a"));
assertThat(((GenericAnnotation<String>) PARSER.parse("string(\" b \")")).getValue(), is(" b "));
assertThat(((GenericAnnotation<String>) PARSER.parse("string(\" c\\\" \")")).getValue(), is(" c\" "));
assertThat(((GenericAnnotation<String>) PARSER.parse("string(\" d\\n \")")).getValue(), is(" d\n "));
assertThat(((GenericAnnotation<String>) PARSER.parse("string(\" e\\r \")")).getValue(), is(" e\r "));
assertThat(((GenericAnnotation<String>) PARSER.parse("string(\" f\\t \")")).getValue(), is(" f\t "));
assertThat(((GenericAnnotation<String>) PARSER.parse("string(\" g\\\\ \")")).getValue(), is(" g\\ "));
}
@Test
public void nullValues() throws Exception {
assertThat(((GenericAnnotation<?>) PARSER.parse("boolean(null)")).getValue(), is(null));
assertThat(((GenericAnnotation<?>) PARSER.parse("double(null)")).getValue(), is(null));
assertThat(((GenericAnnotation<?>) PARSER.parse("string(null)")).getValue(), is(null));
}
@Test(expected = <API key>.class)
public void <API key>() throws Exception {
PARSER.parse("foo(null) a");
}
@Test(expected = <API key>.class)
public void <API key>() throws Exception {
PARSER.parse("foo(\\");
}
@Test(expected = <API key>.class)
public void <API key>() throws Exception {
PARSER.parse("foo(a b)");
}
@Test(expected = <API key>.class)
public void <API key>() throws Exception {
PARSER.parse("foo(a \"b\")");
}
@Test(expected = <API key>.class)
public void <API key>() throws Exception {
PARSER.parse("foo(a");
}
@Test(expected = <API key>.class)
public void illegalLiteral() throws Exception {
PARSER.parse("foo(moo)");
}
@Test(expected = <API key>.class)
public void <API key>() throws Exception {
PARSER.parse("foo(1,)");
}
@Test(expected = <API key>.class)
public void <API key>() throws Exception {
PARSER.parse("foo");
}
@Test(expected = <API key>.class)
public void <API key>() throws Exception {
PARSER.parse("foo b()");
}
@Test(expected = <API key>.class)
public void <API key>() throws Exception {
PARSER.parse("
}
@Test(expected = <API key>.class)
public void emptyId() throws Exception {
PARSER.parse("()");
}
@Test
public void noParameters() throws Exception {
assertThat(PARSER.parse("bar()"), isInstanceOf(BarAnnotation.class));
assertThat(PARSER.parse("bar( )"), isInstanceOf(BarAnnotation.class));
}
} |
name: Bug
about: For when something is there, but doesn't work how it should.
<!
<!
Community Note
* Please vote on this issue by adding a [reaction](https://blog.github.com/<API key>/) to the original issue to help the community and maintainers prioritize this request
* Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
* If you are interested in working on this issue or have submitted a pull request, please leave a comment
* If an issue is assigned to the "modular-magician" user, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If an issue is assigned to a user, that user is claiming responsibility for the issue. If an issue is assigned to "hashibot", a community member has claimed the issue already.
<!
Terraform Version
Affected Resource(s)
<!
* google_XXXXX
Terraform Configuration Files
tf
# Copy-paste your Terraform configurations here - for large Terraform configs,
# please use a service like Dropbox and share a link to the ZIP file. For
# If reproducing the bug involves modifying the config file (e.g., apply a config,
# change a value, apply the config again, see the bug) then please include both the
# version of the config before the change, and the version of the config after the change.
Debug Output
<!
Please provide a link to a GitHub Gist containing the complete debug output. Please do NOT paste the debug output in the issue; just paste a link to the Gist.
To obtain the debug output, see the [Terraform documentation on debugging](https:
>
Panic Output
<!
Expected Behavior
<!
Actual Behavior
<!
Steps to Reproduce
<!
1. `terraform apply`
Important Factoids
<!
References
<!
Information about referencing Github Issues: https://help.github.com/articles/<API key>/#<API key>
Are there any other GitHub issues (open or closed) or pull requests that should be linked here? Vendor documentation? For example:
>
* #0000 |
# Publishing
Repository is an entry point to most of end-user ES4J functionality.
It puts all components (journalling, indexing, querying) together and allows to publish commands.
java
Repository repository = StandardRepository.builder()
.journal(new MemoryJournal())
.indexEngine(new MemoryIndexEngine()).
build();
// ES4J should find commands and events in this
// hierarchy of packages:
repository.<API key>(new <API key>(new Package[]{getClass().getPackage()}));
repository.addEventSetProvider(new <API key>(new Package[]{getClass().getPackage()}));
repository.startAsync().awaitRunning();
StandardRepository also supports OSGi glue all components together.
Now we're ready to publish the command:
java
Address restaurantAddress = new Address("559 W Pender St, Vancouver, BC",
"Canada", "Vancouver",
"V6B 1V5", 49.2837512, -123.1134196);
Restaurant restaurant = repository.publish(new RegisterRestaurant("Kyzock",
restaurantAddress,
new OpeningHours(11, 30, 19, 00))).get(); |
package openapi
import (
"context"
"io/ioutil"
"net/http"
"net/url"
"strings"
"fmt"
"github.com/antihax/optional"
)
// Linger please
var (
_ context.Context
)
type DiskApiService service
/*
DiskApiService /actions/resize
Action resize
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param diskId ID of disk
* @param diskActionResize
@return Disk
*/
func (a *DiskApiService) DiskActionResize(ctx context.Context, diskId string, diskActionResize DiskActionResize) (Disk, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Post")
localVarPostBody interface{}
<API key> string
localVarFileName string
localVarFileBytes []byte
localVarReturnValue Disk
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/disk/{diskId}/actions/resize"
localVarPath = strings.Replace(localVarPath, "{"+"diskId"+"}", fmt.Sprintf("%v", diskId), -1)
<API key> := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
<API key> := []string{"application/json"}
// set Content-Type header
<API key> := <API key>(<API key>)
if <API key> != "" {
<API key>["Content-Type"] = <API key>
}
// to determine the Accept header
<API key> := []string{"application/json"}
// set Accept header
<API key> := selectHeaderAccept(<API key>)
if <API key> != "" {
<API key>["Accept"] = <API key>
}
// body params
localVarPostBody = &diskActionResize
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
<API key>["x-project"] = key
}
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
<API key>["x-auth-token"] = key
}
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
<API key>["x-auth-token"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, <API key>, localVarQueryParams, localVarFormParams, <API key>, localVarFileName, localVarFileBytes)
if err != nil {
return localVarReturnValue, nil, err
}
<API key>, err := a.client.callAPI(r)
if err != nil || <API key> == nil {
return localVarReturnValue, <API key>, err
}
localVarBody, err := ioutil.ReadAll(<API key>.Body)
<API key>.Body.Close()
if err != nil {
return localVarReturnValue, <API key>, err
}
if <API key>.StatusCode >= 300 {
newErr := GenericOpenAPIError{
body: localVarBody,
error: <API key>.Status,
}
if <API key>.StatusCode == 202 {
var v Disk
err = a.client.decode(&v, localVarBody, <API key>.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, <API key>, newErr
}
newErr.model = v
return localVarReturnValue, <API key>, newErr
}
return localVarReturnValue, <API key>, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, <API key>.Header.Get("Content-Type"))
if err != nil {
newErr := GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, <API key>, newErr
}
return localVarReturnValue, <API key>, nil
}
/*
DiskApiService /actions/transfer
Action transfer
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param diskId ID of disk
* @param diskActionTransfer
@return Disk
*/
func (a *DiskApiService) DiskActionTransfer(ctx context.Context, diskId string, diskActionTransfer DiskActionTransfer) (Disk, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Post")
localVarPostBody interface{}
<API key> string
localVarFileName string
localVarFileBytes []byte
localVarReturnValue Disk
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/disk/{diskId}/actions/transfer"
localVarPath = strings.Replace(localVarPath, "{"+"diskId"+"}", fmt.Sprintf("%v", diskId), -1)
<API key> := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
<API key> := []string{"application/json"}
// set Content-Type header
<API key> := <API key>(<API key>)
if <API key> != "" {
<API key>["Content-Type"] = <API key>
}
// to determine the Accept header
<API key> := []string{"application/json"}
// set Accept header
<API key> := selectHeaderAccept(<API key>)
if <API key> != "" {
<API key>["Accept"] = <API key>
}
// body params
localVarPostBody = &diskActionTransfer
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
<API key>["x-project"] = key
}
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
<API key>["x-auth-token"] = key
}
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
<API key>["x-auth-token"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, <API key>, localVarQueryParams, localVarFormParams, <API key>, localVarFileName, localVarFileBytes)
if err != nil {
return localVarReturnValue, nil, err
}
<API key>, err := a.client.callAPI(r)
if err != nil || <API key> == nil {
return localVarReturnValue, <API key>, err
}
localVarBody, err := ioutil.ReadAll(<API key>.Body)
<API key>.Body.Close()
if err != nil {
return localVarReturnValue, <API key>, err
}
if <API key>.StatusCode >= 300 {
newErr := GenericOpenAPIError{
body: localVarBody,
error: <API key>.Status,
}
if <API key>.StatusCode == 202 {
var v Disk
err = a.client.decode(&v, localVarBody, <API key>.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, <API key>, newErr
}
newErr.model = v
return localVarReturnValue, <API key>, newErr
}
return localVarReturnValue, <API key>, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, <API key>.Header.Get("Content-Type"))
if err != nil {
newErr := GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, <API key>, newErr
}
return localVarReturnValue, <API key>, nil
}
/*
DiskApiService Create
Create disk
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param diskCreate
@return Disk
*/
func (a *DiskApiService) DiskCreate(ctx context.Context, diskCreate DiskCreate) (Disk, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Post")
localVarPostBody interface{}
<API key> string
localVarFileName string
localVarFileBytes []byte
localVarReturnValue Disk
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/disk"
<API key> := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
<API key> := []string{"application/json"}
// set Content-Type header
<API key> := <API key>(<API key>)
if <API key> != "" {
<API key>["Content-Type"] = <API key>
}
// to determine the Accept header
<API key> := []string{"application/json"}
// set Accept header
<API key> := selectHeaderAccept(<API key>)
if <API key> != "" {
<API key>["Accept"] = <API key>
}
// body params
localVarPostBody = &diskCreate
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
<API key>["x-project"] = key
}
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
<API key>["x-auth-token"] = key
}
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
<API key>["x-auth-token"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, <API key>, localVarQueryParams, localVarFormParams, <API key>, localVarFileName, localVarFileBytes)
if err != nil {
return localVarReturnValue, nil, err
}
<API key>, err := a.client.callAPI(r)
if err != nil || <API key> == nil {
return localVarReturnValue, <API key>, err
}
localVarBody, err := ioutil.ReadAll(<API key>.Body)
<API key>.Body.Close()
if err != nil {
return localVarReturnValue, <API key>, err
}
if <API key>.StatusCode >= 300 {
newErr := GenericOpenAPIError{
body: localVarBody,
error: <API key>.Status,
}
if <API key>.StatusCode == 202 {
var v Disk
err = a.client.decode(&v, localVarBody, <API key>.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, <API key>, newErr
}
newErr.model = v
return localVarReturnValue, <API key>, newErr
}
return localVarReturnValue, <API key>, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, <API key>.Header.Get("Content-Type"))
if err != nil {
newErr := GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, <API key>, newErr
}
return localVarReturnValue, <API key>, nil
}
/*
DiskApiService Delete
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param diskId ID of disk
*/
func (a *DiskApiService) DiskDelete(ctx context.Context, diskId string) (*http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Delete")
localVarPostBody interface{}
<API key> string
localVarFileName string
localVarFileBytes []byte
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/disk/{diskId}"
localVarPath = strings.Replace(localVarPath, "{"+"diskId"+"}", fmt.Sprintf("%v", diskId), -1)
<API key> := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
<API key> := []string{}
// set Content-Type header
<API key> := <API key>(<API key>)
if <API key> != "" {
<API key>["Content-Type"] = <API key>
}
// to determine the Accept header
<API key> := []string{}
// set Accept header
<API key> := selectHeaderAccept(<API key>)
if <API key> != "" {
<API key>["Accept"] = <API key>
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
<API key>["x-project"] = key
}
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
<API key>["x-auth-token"] = key
}
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
<API key>["x-auth-token"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, <API key>, localVarQueryParams, localVarFormParams, <API key>, localVarFileName, localVarFileBytes)
if err != nil {
return nil, err
}
<API key>, err := a.client.callAPI(r)
if err != nil || <API key> == nil {
return <API key>, err
}
localVarBody, err := ioutil.ReadAll(<API key>.Body)
<API key>.Body.Close()
if err != nil {
return <API key>, err
}
if <API key>.StatusCode >= 300 {
newErr := GenericOpenAPIError{
body: localVarBody,
error: <API key>.Status,
}
return <API key>, newErr
}
return <API key>, nil
}
/*
DiskApiService /accessrights/:identity
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param diskId ID of disk
* @param identity identity
@return Disk
*/
func (a *DiskApiService) <API key>(ctx context.Context, diskId string, identity string) (Disk, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Delete")
localVarPostBody interface{}
<API key> string
localVarFileName string
localVarFileBytes []byte
localVarReturnValue Disk
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/disk/{diskId}/accessrights/{identity}"
localVarPath = strings.Replace(localVarPath, "{"+"diskId"+"}", fmt.Sprintf("%v", diskId), -1)
localVarPath = strings.Replace(localVarPath, "{"+"identity"+"}", fmt.Sprintf("%v", identity), -1)
<API key> := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
<API key> := []string{}
// set Content-Type header
<API key> := <API key>(<API key>)
if <API key> != "" {
<API key>["Content-Type"] = <API key>
}
// to determine the Accept header
<API key> := []string{"application/json"}
// set Accept header
<API key> := selectHeaderAccept(<API key>)
if <API key> != "" {
<API key>["Accept"] = <API key>
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
<API key>["x-project"] = key
}
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
<API key>["x-auth-token"] = key
}
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
<API key>["x-auth-token"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, <API key>, localVarQueryParams, localVarFormParams, <API key>, localVarFileName, localVarFileBytes)
if err != nil {
return localVarReturnValue, nil, err
}
<API key>, err := a.client.callAPI(r)
if err != nil || <API key> == nil {
return localVarReturnValue, <API key>, err
}
localVarBody, err := ioutil.ReadAll(<API key>.Body)
<API key>.Body.Close()
if err != nil {
return localVarReturnValue, <API key>, err
}
if <API key>.StatusCode >= 300 {
newErr := GenericOpenAPIError{
body: localVarBody,
error: <API key>.Status,
}
if <API key>.StatusCode == 200 {
var v Disk
err = a.client.decode(&v, localVarBody, <API key>.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, <API key>, newErr
}
newErr.model = v
return localVarReturnValue, <API key>, newErr
}
if <API key>.StatusCode == 202 {
var v Disk
err = a.client.decode(&v, localVarBody, <API key>.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, <API key>, newErr
}
newErr.model = v
return localVarReturnValue, <API key>, newErr
}
return localVarReturnValue, <API key>, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, <API key>.Header.Get("Content-Type"))
if err != nil {
newErr := GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, <API key>, newErr
}
return localVarReturnValue, <API key>, nil
}
/*
DiskApiService /tag/:key
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param diskId ID of disk
* @param key key
@return map[string]interface{}
*/
func (a *DiskApiService) DiskDeleteTagKey(ctx context.Context, diskId string, key string) (map[string]interface{}, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Delete")
localVarPostBody interface{}
<API key> string
localVarFileName string
localVarFileBytes []byte
localVarReturnValue map[string]interface{}
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/disk/{diskId}/tag/{key}"
localVarPath = strings.Replace(localVarPath, "{"+"diskId"+"}", fmt.Sprintf("%v", diskId), -1)
localVarPath = strings.Replace(localVarPath, "{"+"key"+"}", fmt.Sprintf("%v", key), -1)
<API key> := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
<API key> := []string{}
// set Content-Type header
<API key> := <API key>(<API key>)
if <API key> != "" {
<API key>["Content-Type"] = <API key>
}
// to determine the Accept header
<API key> := []string{"application/json"}
// set Accept header
<API key> := selectHeaderAccept(<API key>)
if <API key> != "" {
<API key>["Accept"] = <API key>
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
<API key>["x-project"] = key
}
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
<API key>["x-auth-token"] = key
}
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
<API key>["x-auth-token"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, <API key>, localVarQueryParams, localVarFormParams, <API key>, localVarFileName, localVarFileBytes)
if err != nil {
return localVarReturnValue, nil, err
}
<API key>, err := a.client.callAPI(r)
if err != nil || <API key> == nil {
return localVarReturnValue, <API key>, err
}
localVarBody, err := ioutil.ReadAll(<API key>.Body)
<API key>.Body.Close()
if err != nil {
return localVarReturnValue, <API key>, err
}
if <API key>.StatusCode >= 300 {
newErr := GenericOpenAPIError{
body: localVarBody,
error: <API key>.Status,
}
if <API key>.StatusCode == 200 {
var v map[string]interface{}
err = a.client.decode(&v, localVarBody, <API key>.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, <API key>, newErr
}
newErr.model = v
return localVarReturnValue, <API key>, newErr
}
return localVarReturnValue, <API key>, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, <API key>.Header.Get("Content-Type"))
if err != nil {
newErr := GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, <API key>, newErr
}
return localVarReturnValue, <API key>, nil
}
/*
DiskApiService /services/:serviceId
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param diskId ID of disk
* @param serviceId serviceId
@return DiskServices
*/
func (a *DiskApiService) <API key>(ctx context.Context, diskId string, serviceId string) (DiskServices, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
<API key> string
localVarFileName string
localVarFileBytes []byte
localVarReturnValue DiskServices
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/disk/{diskId}/services/{serviceId}"
localVarPath = strings.Replace(localVarPath, "{"+"diskId"+"}", fmt.Sprintf("%v", diskId), -1)
localVarPath = strings.Replace(localVarPath, "{"+"serviceId"+"}", fmt.Sprintf("%v", serviceId), -1)
<API key> := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
<API key> := []string{}
// set Content-Type header
<API key> := <API key>(<API key>)
if <API key> != "" {
<API key>["Content-Type"] = <API key>
}
// to determine the Accept header
<API key> := []string{"application/json"}
// set Accept header
<API key> := selectHeaderAccept(<API key>)
if <API key> != "" {
<API key>["Accept"] = <API key>
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
<API key>["x-project"] = key
}
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
<API key>["x-auth-token"] = key
}
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
<API key>["x-auth-token"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, <API key>, localVarQueryParams, localVarFormParams, <API key>, localVarFileName, localVarFileBytes)
if err != nil {
return localVarReturnValue, nil, err
}
<API key>, err := a.client.callAPI(r)
if err != nil || <API key> == nil {
return localVarReturnValue, <API key>, err
}
localVarBody, err := ioutil.ReadAll(<API key>.Body)
<API key>.Body.Close()
if err != nil {
return localVarReturnValue, <API key>, err
}
if <API key>.StatusCode >= 300 {
newErr := GenericOpenAPIError{
body: localVarBody,
error: <API key>.Status,
}
if <API key>.StatusCode == 200 {
var v DiskServices
err = a.client.decode(&v, localVarBody, <API key>.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, <API key>, newErr
}
newErr.model = v
return localVarReturnValue, <API key>, newErr
}
return localVarReturnValue, <API key>, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, <API key>.Header.Get("Content-Type"))
if err != nil {
newErr := GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, <API key>, newErr
}
return localVarReturnValue, <API key>, nil
}
/*
DiskApiService /tag
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param diskId ID of disk
@return map[string]interface{}
*/
func (a *DiskApiService) DiskGetTag(ctx context.Context, diskId string) (map[string]interface{}, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
<API key> string
localVarFileName string
localVarFileBytes []byte
localVarReturnValue map[string]interface{}
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/disk/{diskId}/tag"
localVarPath = strings.Replace(localVarPath, "{"+"diskId"+"}", fmt.Sprintf("%v", diskId), -1)
<API key> := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
<API key> := []string{}
// set Content-Type header
<API key> := <API key>(<API key>)
if <API key> != "" {
<API key>["Content-Type"] = <API key>
}
// to determine the Accept header
<API key> := []string{"application/json"}
// set Accept header
<API key> := selectHeaderAccept(<API key>)
if <API key> != "" {
<API key>["Accept"] = <API key>
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
<API key>["x-project"] = key
}
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
<API key>["x-auth-token"] = key
}
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
<API key>["x-auth-token"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, <API key>, localVarQueryParams, localVarFormParams, <API key>, localVarFileName, localVarFileBytes)
if err != nil {
return localVarReturnValue, nil, err
}
<API key>, err := a.client.callAPI(r)
if err != nil || <API key> == nil {
return localVarReturnValue, <API key>, err
}
localVarBody, err := ioutil.ReadAll(<API key>.Body)
<API key>.Body.Close()
if err != nil {
return localVarReturnValue, <API key>, err
}
if <API key>.StatusCode >= 300 {
newErr := GenericOpenAPIError{
body: localVarBody,
error: <API key>.Status,
}
if <API key>.StatusCode == 200 {
var v map[string]interface{}
err = a.client.decode(&v, localVarBody, <API key>.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, <API key>, newErr
}
newErr.model = v
return localVarReturnValue, <API key>, newErr
}
return localVarReturnValue, <API key>, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, <API key>.Header.Get("Content-Type"))
if err != nil {
newErr := GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, <API key>, newErr
}
return localVarReturnValue, <API key>, nil
}
/*
DiskApiService List
List disk
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param optional nil or *DiskListOpts - Optional Parameters:
* @param "Name" (optional.String) - Filter by name
@return []Disk
*/
type DiskListOpts struct {
Name optional.String
}
func (a *DiskApiService) DiskList(ctx context.Context, localVarOptionals *DiskListOpts) ([]Disk, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
<API key> string
localVarFileName string
localVarFileBytes []byte
localVarReturnValue []Disk
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/disk"
<API key> := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if localVarOptionals != nil && localVarOptionals.Name.IsSet() {
localVarQueryParams.Add("name", parameterToString(localVarOptionals.Name.Value(), ""))
}
// to determine the Content-Type header
<API key> := []string{}
// set Content-Type header
<API key> := <API key>(<API key>)
if <API key> != "" {
<API key>["Content-Type"] = <API key>
}
// to determine the Accept header
<API key> := []string{"application/json"}
// set Accept header
<API key> := selectHeaderAccept(<API key>)
if <API key> != "" {
<API key>["Accept"] = <API key>
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
<API key>["x-project"] = key
}
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
<API key>["x-auth-token"] = key
}
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
<API key>["x-auth-token"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, <API key>, localVarQueryParams, localVarFormParams, <API key>, localVarFileName, localVarFileBytes)
if err != nil {
return localVarReturnValue, nil, err
}
<API key>, err := a.client.callAPI(r)
if err != nil || <API key> == nil {
return localVarReturnValue, <API key>, err
}
localVarBody, err := ioutil.ReadAll(<API key>.Body)
<API key>.Body.Close()
if err != nil {
return localVarReturnValue, <API key>, err
}
if <API key>.StatusCode >= 300 {
newErr := GenericOpenAPIError{
body: localVarBody,
error: <API key>.Status,
}
if <API key>.StatusCode == 200 {
var v []Disk
err = a.client.decode(&v, localVarBody, <API key>.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, <API key>, newErr
}
newErr.model = v
return localVarReturnValue, <API key>, newErr
}
return localVarReturnValue, <API key>, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, <API key>.Header.Get("Content-Type"))
if err != nil {
newErr := GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, <API key>, newErr
}
return localVarReturnValue, <API key>, nil
}
/*
DiskApiService /accessrights
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param diskId ID of disk
@return []string
*/
func (a *DiskApiService) <API key>(ctx context.Context, diskId string) ([]string, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
<API key> string
localVarFileName string
localVarFileBytes []byte
localVarReturnValue []string
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/disk/{diskId}/accessrights"
localVarPath = strings.Replace(localVarPath, "{"+"diskId"+"}", fmt.Sprintf("%v", diskId), -1)
<API key> := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
<API key> := []string{}
// set Content-Type header
<API key> := <API key>(<API key>)
if <API key> != "" {
<API key>["Content-Type"] = <API key>
}
// to determine the Accept header
<API key> := []string{"application/json"}
// set Accept header
<API key> := selectHeaderAccept(<API key>)
if <API key> != "" {
<API key>["Accept"] = <API key>
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
<API key>["x-project"] = key
}
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
<API key>["x-auth-token"] = key
}
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
<API key>["x-auth-token"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, <API key>, localVarQueryParams, localVarFormParams, <API key>, localVarFileName, localVarFileBytes)
if err != nil {
return localVarReturnValue, nil, err
}
<API key>, err := a.client.callAPI(r)
if err != nil || <API key> == nil {
return localVarReturnValue, <API key>, err
}
localVarBody, err := ioutil.ReadAll(<API key>.Body)
<API key>.Body.Close()
if err != nil {
return localVarReturnValue, <API key>, err
}
if <API key>.StatusCode >= 300 {
newErr := GenericOpenAPIError{
body: localVarBody,
error: <API key>.Status,
}
if <API key>.StatusCode == 200 {
var v []string
err = a.client.decode(&v, localVarBody, <API key>.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, <API key>, newErr
}
newErr.model = v
return localVarReturnValue, <API key>, newErr
}
return localVarReturnValue, <API key>, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, <API key>.Header.Get("Content-Type"))
if err != nil {
newErr := GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, <API key>, newErr
}
return localVarReturnValue, <API key>, nil
}
/*
DiskApiService /queue
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param diskId ID of disk
@return []Event
*/
func (a *DiskApiService) DiskListQueue(ctx context.Context, diskId string) ([]Event, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
<API key> string
localVarFileName string
localVarFileBytes []byte
localVarReturnValue []Event
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/disk/{diskId}/queue"
localVarPath = strings.Replace(localVarPath, "{"+"diskId"+"}", fmt.Sprintf("%v", diskId), -1)
<API key> := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
<API key> := []string{}
// set Content-Type header
<API key> := <API key>(<API key>)
if <API key> != "" {
<API key>["Content-Type"] = <API key>
}
// to determine the Accept header
<API key> := []string{"application/json"}
// set Accept header
<API key> := selectHeaderAccept(<API key>)
if <API key> != "" {
<API key>["Accept"] = <API key>
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
<API key>["x-project"] = key
}
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
<API key>["x-auth-token"] = key
}
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
<API key>["x-auth-token"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, <API key>, localVarQueryParams, localVarFormParams, <API key>, localVarFileName, localVarFileBytes)
if err != nil {
return localVarReturnValue, nil, err
}
<API key>, err := a.client.callAPI(r)
if err != nil || <API key> == nil {
return localVarReturnValue, <API key>, err
}
localVarBody, err := ioutil.ReadAll(<API key>.Body)
<API key>.Body.Close()
if err != nil {
return localVarReturnValue, <API key>, err
}
if <API key>.StatusCode >= 300 {
newErr := GenericOpenAPIError{
body: localVarBody,
error: <API key>.Status,
}
if <API key>.StatusCode == 200 {
var v []Event
err = a.client.decode(&v, localVarBody, <API key>.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, <API key>, newErr
}
newErr.model = v
return localVarReturnValue, <API key>, newErr
}
return localVarReturnValue, <API key>, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, <API key>.Header.Get("Content-Type"))
if err != nil {
newErr := GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, <API key>, newErr
}
return localVarReturnValue, <API key>, nil
}
/*
DiskApiService /services
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param diskId ID of disk
@return []DiskServices
*/
func (a *DiskApiService) DiskListServices(ctx context.Context, diskId string) ([]DiskServices, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
<API key> string
localVarFileName string
localVarFileBytes []byte
localVarReturnValue []DiskServices
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/disk/{diskId}/services"
localVarPath = strings.Replace(localVarPath, "{"+"diskId"+"}", fmt.Sprintf("%v", diskId), -1)
<API key> := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
<API key> := []string{}
// set Content-Type header
<API key> := <API key>(<API key>)
if <API key> != "" {
<API key>["Content-Type"] = <API key>
}
// to determine the Accept header
<API key> := []string{"application/json"}
// set Accept header
<API key> := selectHeaderAccept(<API key>)
if <API key> != "" {
<API key>["Accept"] = <API key>
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
<API key>["x-project"] = key
}
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
<API key>["x-auth-token"] = key
}
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
<API key>["x-auth-token"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, <API key>, localVarQueryParams, localVarFormParams, <API key>, localVarFileName, localVarFileBytes)
if err != nil {
return localVarReturnValue, nil, err
}
<API key>, err := a.client.callAPI(r)
if err != nil || <API key> == nil {
return localVarReturnValue, <API key>, err
}
localVarBody, err := ioutil.ReadAll(<API key>.Body)
<API key>.Body.Close()
if err != nil {
return localVarReturnValue, <API key>, err
}
if <API key>.StatusCode >= 300 {
newErr := GenericOpenAPIError{
body: localVarBody,
error: <API key>.Status,
}
if <API key>.StatusCode == 200 {
var v []DiskServices
err = a.client.decode(&v, localVarBody, <API key>.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, <API key>, newErr
}
newErr.model = v
return localVarReturnValue, <API key>, newErr
}
return localVarReturnValue, <API key>, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, <API key>.Header.Get("Content-Type"))
if err != nil {
newErr := GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, <API key>, newErr
}
return localVarReturnValue, <API key>, nil
}
/*
DiskApiService /tag
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param diskId ID of disk
* @param body
@return map[string]interface{}
*/
func (a *DiskApiService) DiskPatchTag(ctx context.Context, diskId string, body map[string]interface{}) (map[string]interface{}, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Patch")
localVarPostBody interface{}
<API key> string
localVarFileName string
localVarFileBytes []byte
localVarReturnValue map[string]interface{}
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/disk/{diskId}/tag"
localVarPath = strings.Replace(localVarPath, "{"+"diskId"+"}", fmt.Sprintf("%v", diskId), -1)
<API key> := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
<API key> := []string{"application/json"}
// set Content-Type header
<API key> := <API key>(<API key>)
if <API key> != "" {
<API key>["Content-Type"] = <API key>
}
// to determine the Accept header
<API key> := []string{"application/json"}
// set Accept header
<API key> := selectHeaderAccept(<API key>)
if <API key> != "" {
<API key>["Accept"] = <API key>
}
// body params
localVarPostBody = &body
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
<API key>["x-project"] = key
}
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
<API key>["x-auth-token"] = key
}
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
<API key>["x-auth-token"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, <API key>, localVarQueryParams, localVarFormParams, <API key>, localVarFileName, localVarFileBytes)
if err != nil {
return localVarReturnValue, nil, err
}
<API key>, err := a.client.callAPI(r)
if err != nil || <API key> == nil {
return localVarReturnValue, <API key>, err
}
localVarBody, err := ioutil.ReadAll(<API key>.Body)
<API key>.Body.Close()
if err != nil {
return localVarReturnValue, <API key>, err
}
if <API key>.StatusCode >= 300 {
newErr := GenericOpenAPIError{
body: localVarBody,
error: <API key>.Status,
}
if <API key>.StatusCode == 200 {
var v map[string]interface{}
err = a.client.decode(&v, localVarBody, <API key>.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, <API key>, newErr
}
newErr.model = v
return localVarReturnValue, <API key>, newErr
}
return localVarReturnValue, <API key>, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, <API key>.Header.Get("Content-Type"))
if err != nil {
newErr := GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, <API key>, newErr
}
return localVarReturnValue, <API key>, nil
}
/*
DiskApiService /accessrights
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param diskId ID of disk
* @param <API key>
@return Disk
*/
func (a *DiskApiService) <API key>(ctx context.Context, diskId string, <API key> <API key>) (Disk, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Post")
localVarPostBody interface{}
<API key> string
localVarFileName string
localVarFileBytes []byte
localVarReturnValue Disk
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/disk/{diskId}/accessrights"
localVarPath = strings.Replace(localVarPath, "{"+"diskId"+"}", fmt.Sprintf("%v", diskId), -1)
<API key> := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
<API key> := []string{"application/json"}
// set Content-Type header
<API key> := <API key>(<API key>)
if <API key> != "" {
<API key>["Content-Type"] = <API key>
}
// to determine the Accept header
<API key> := []string{"application/json"}
// set Accept header
<API key> := selectHeaderAccept(<API key>)
if <API key> != "" {
<API key>["Accept"] = <API key>
}
// body params
localVarPostBody = &<API key>
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
<API key>["x-project"] = key
}
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
<API key>["x-auth-token"] = key
}
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
<API key>["x-auth-token"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, <API key>, localVarQueryParams, localVarFormParams, <API key>, localVarFileName, localVarFileBytes)
if err != nil {
return localVarReturnValue, nil, err
}
<API key>, err := a.client.callAPI(r)
if err != nil || <API key> == nil {
return localVarReturnValue, <API key>, err
}
localVarBody, err := ioutil.ReadAll(<API key>.Body)
<API key>.Body.Close()
if err != nil {
return localVarReturnValue, <API key>, err
}
if <API key>.StatusCode >= 300 {
newErr := GenericOpenAPIError{
body: localVarBody,
error: <API key>.Status,
}
if <API key>.StatusCode == 200 {
var v Disk
err = a.client.decode(&v, localVarBody, <API key>.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, <API key>, newErr
}
newErr.model = v
return localVarReturnValue, <API key>, newErr
}
if <API key>.StatusCode == 202 {
var v Disk
err = a.client.decode(&v, localVarBody, <API key>.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, <API key>, newErr
}
newErr.model = v
return localVarReturnValue, <API key>, newErr
}
return localVarReturnValue, <API key>, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, <API key>.Header.Get("Content-Type"))
if err != nil {
newErr := GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, <API key>, newErr
}
return localVarReturnValue, <API key>, nil
}
/*
DiskApiService Get
Returns a single disk
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param diskId ID of disk
@return Disk
*/
func (a *DiskApiService) DiskShow(ctx context.Context, diskId string) (Disk, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
<API key> string
localVarFileName string
localVarFileBytes []byte
localVarReturnValue Disk
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/disk/{diskId}"
localVarPath = strings.Replace(localVarPath, "{"+"diskId"+"}", fmt.Sprintf("%v", diskId), -1)
<API key> := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
<API key> := []string{}
// set Content-Type header
<API key> := <API key>(<API key>)
if <API key> != "" {
<API key>["Content-Type"] = <API key>
}
// to determine the Accept header
<API key> := []string{"application/json"}
// set Accept header
<API key> := selectHeaderAccept(<API key>)
if <API key> != "" {
<API key>["Accept"] = <API key>
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
<API key>["x-project"] = key
}
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
<API key>["x-auth-token"] = key
}
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
<API key>["x-auth-token"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, <API key>, localVarQueryParams, localVarFormParams, <API key>, localVarFileName, localVarFileBytes)
if err != nil {
return localVarReturnValue, nil, err
}
<API key>, err := a.client.callAPI(r)
if err != nil || <API key> == nil {
return localVarReturnValue, <API key>, err
}
localVarBody, err := ioutil.ReadAll(<API key>.Body)
<API key>.Body.Close()
if err != nil {
return localVarReturnValue, <API key>, err
}
if <API key>.StatusCode >= 300 {
newErr := GenericOpenAPIError{
body: localVarBody,
error: <API key>.Status,
}
if <API key>.StatusCode == 200 {
var v Disk
err = a.client.decode(&v, localVarBody, <API key>.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, <API key>, newErr
}
newErr.model = v
return localVarReturnValue, <API key>, newErr
}
return localVarReturnValue, <API key>, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, <API key>.Header.Get("Content-Type"))
if err != nil {
newErr := GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, <API key>, newErr
}
return localVarReturnValue, <API key>, nil
}
/*
DiskApiService Update
Returns modified disk
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param diskId ID of disk
* @param diskUpdate
@return Disk
*/
func (a *DiskApiService) DiskUpdate(ctx context.Context, diskId string, diskUpdate DiskUpdate) (Disk, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Patch")
localVarPostBody interface{}
<API key> string
localVarFileName string
localVarFileBytes []byte
localVarReturnValue Disk
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/disk/{diskId}"
localVarPath = strings.Replace(localVarPath, "{"+"diskId"+"}", fmt.Sprintf("%v", diskId), -1)
<API key> := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
<API key> := []string{"application/json"}
// set Content-Type header
<API key> := <API key>(<API key>)
if <API key> != "" {
<API key>["Content-Type"] = <API key>
}
// to determine the Accept header
<API key> := []string{"application/json"}
// set Accept header
<API key> := selectHeaderAccept(<API key>)
if <API key> != "" {
<API key>["Accept"] = <API key>
}
// body params
localVarPostBody = &diskUpdate
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
<API key>["x-project"] = key
}
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
<API key>["x-auth-token"] = key
}
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
<API key>["x-auth-token"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, <API key>, localVarQueryParams, localVarFormParams, <API key>, localVarFileName, localVarFileBytes)
if err != nil {
return localVarReturnValue, nil, err
}
<API key>, err := a.client.callAPI(r)
if err != nil || <API key> == nil {
return localVarReturnValue, <API key>, err
}
localVarBody, err := ioutil.ReadAll(<API key>.Body)
<API key>.Body.Close()
if err != nil {
return localVarReturnValue, <API key>, err
}
if <API key>.StatusCode >= 300 {
newErr := GenericOpenAPIError{
body: localVarBody,
error: <API key>.Status,
}
if <API key>.StatusCode == 200 {
var v Disk
err = a.client.decode(&v, localVarBody, <API key>.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, <API key>, newErr
}
newErr.model = v
return localVarReturnValue, <API key>, newErr
}
return localVarReturnValue, <API key>, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, <API key>.Header.Get("Content-Type"))
if err != nil {
newErr := GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, <API key>, newErr
}
return localVarReturnValue, <API key>, nil
} |
{# This Source Code Form is subject to the terms of the Mozilla Public
{% extends "firefox/releases/notes.html" %}
{% set product_class = 'mzp-t-product-beta' %}
{% if release.product == 'Firefox for Android' %}
{% set page_id = 'data-gtm-page-id="/firefox/android/beta/releasenotes"' %}
{% set download_button %}
{{ download_firefox('beta', platform='android', alt_copy=_('Download Firefox for Android Beta')) }}
{% endset %}
{% set download_all_link = firefox_url('android', 'all', channel='beta') %}
{% elif release.product == 'Firefox' %}
{% set page_id = 'data-gtm-page-id="/firefox/beta/releasenotes/"' %}
{% set download_button %}
{{ download_firefox('beta', platform='desktop', force_direct=True, alt_copy=_('Download Firefox Beta')) }}
{% endset %}
{% set download_all_link = firefox_url('desktop', 'all', channel='beta') %}
{% endif %} |
# rvi_mobile_unlock
RVI Mobile Unlock demo android app.
App that will discover and iBeacon and try to establish a BT RFCOMM socket to the car.
On the car side right now there is a Raspberry PI executing the Erlang RVI stack.
The PI has to have BT scanning on and also BT LE announcement of the Beacon
Shell
sudo hciconfig hci0 piscan leadv
sudo hcitool -i hci0 cmd 0x08 0x0008 1E 02 01 1A 1A FF 4C 00 02 15 33 43 33 43 46 46 47 45 38 45 54 32 39 31 34 30 39 00 00 00 C5 00
sudo hcitool -i hci0 cmd 0x08 0x0006 A0 00 A0 00 03 00 00 00 00 00 00 00 00 07 00
sudo hcitool -i hci0 cmd 0x08 0x000a 01
Note that the Beacon will change. Right now is a proper iBeacon and can be detected with any apps.
One good in particular is the Locate App
[iOS App](https://itunes.apple.com/us/app/locate-beacon/id738709014?mt=8) or
[Android App](https://play.google.com/store/apps/details?id=com.radiusnetworks.locate&hl=en)
# INSTALL
- Raspbian
- rvi_0.4.0
- fob.py
- jsonrpclib + rvilib.py
- apt-get install bluez
- /etc/rc.local
- /etc/bluetooth/main.conf Add DisablePlugins = pnat
# TO BUILD
- sudo apt-get update
- apt-get install libbluetooth-dev
- apt-get install git
- apt-get install libssl-dev
- apt-get install libncurses-dev
- Unpack OTP R16B03
- ./configure --prefix=/usr
- make
- make install
# SET UP IN VEHICLE
Default pin configuration is below, with all pins assumed to be active high:
Python
GPIO_UNLOCK = 5
GPIO_LOCK = 6
GPIO_LIGHTS = 13
GPIO_TRUNK = 19
GPIO_PANIC = 26
GPIO_START = 20
GPIO_STOP = 21 |
import cloneDeep from 'lodash.clonedeep';
import { validateAddon } from 'schema/validator';
import { validManifest } from './helpers';
describe('/version', () => {
it('should be invalid due to invalid version', () => {
const manifest = cloneDeep(validManifest);
manifest.version = '01';
validateAddon(manifest);
expect(validateAddon.errors.length).toEqual(1);
expect(validateAddon.errors[0].dataPath).toEqual('/version');
});
it('should be invalid due to missing version', () => {
const manifest = cloneDeep(validManifest);
manifest.version = undefined;
validateAddon(manifest);
expect(validateAddon.errors.length).toEqual(1);
expect(validateAddon.errors[0].dataPath).toEqual('/version');
expect(validateAddon.errors[0].params.missingProperty).toEqual('version');
});
it('should be valid if it is a toolkit version', () => {
const manifest = cloneDeep(validManifest);
manifest.version = '1.0.0.0pre0';
validateAddon(manifest);
expect(validateAddon.errors).toBeNull();
});
}); |
<html xmlns:soap="http:
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
<script src="./commonRes.js" language="JavaScript"> type="text/javascript"></script>
<link href="doc-style.css" type="text/css" rel="StyleSheet">
</head>
<script src="dynamic-content.js" type="text/javascript"></script>
<body>
<table cellspacing="0" class="header-footer" id="top">
<tr>
<td>
<br>
</td><td></td><td></td><td></td>
</tr>
<tr>
<td><a href="index-mo_types.html">Managed Object Types</a></td><td><a href="index-do_types.html">Data Object Types</a></td><td><a href="index-properties.html">All Properties</a></td><td><a href="index-methods.html">All Methods</a></td>
</tr>
</table>
<br>
<a id="vim.vm.customization.DhcpIpV6Generator" name="vim.vm.customization.DhcpIpV6Generator"></a>
<h1>Data Object - <API key></h1>
<dl>
<dt>Extends</dt>
<dd>
<a href="vim.vm.customization.IpV6Generator.html"><API key></a>
</dd>
<dt>Since </dt>
<dd>vSphere API 4.0</dd>
<p></p>
</dl>
<H2>Data Object
Description</H2>
<p></p>
Use a DHCP server to configure ipv6 address
<p></p>
<a id="field_detail" name="field_detail"></a>
<p class="table-title">Properties</p>
<table cellspacing="0">
<tr>
<th>
Name
</th><th>
Type
</th><th>
Description
</th>
</tr>
<tr class="r0">
<td colspan="3">None</td>
</tr>
<tr class="r1">
<td colspan="3">
Properties inherited from <a href="vim.vm.customization.IpV6Generator.html"><API key></a></td>
</tr>
<tr class="r0">
<td colspan="3">None</td>
</tr>
<tr class="r1">
<td colspan="3">
Properties inherited from <a href="vmodl.DynamicData.html">DynamicData</a></td>
</tr>
<tr class="r0">
<td colspan="3"><a href="vmodl.DynamicData.html#dynamicProperty">dynamicProperty</a>, <a href="vmodl.DynamicData.html#dynamicType">dynamicType</a></td>
</tr>
</table>
<br>
<a style="margin-bottom:10px; margin-top:10px; cursor:hand; cursor:pointer" onclick="resize_textarea('wsdl-textarea');expandcontent(this, 'wsdl-div')">Show WSDL type definition</a>
<div class="switchcontent" id="wsdl-div">
<textarea cols="20" rows="10" name="wsdl-textarea" wrap="off" readonly="1" id="wsdl-textarea"> <complexType xmlns="http:
<complexContent>
<extension base="vim25:<API key>">
<sequence>
</sequence>
</extension>
</complexContent>
</complexType></textarea>
</div>
<br>
<br>
<table cellspacing="0" class="header-footer" id="bottom">
<tr>
<td><a href="#top">Top of page</a></td><td></td><td></td><td></td>
</tr>
<tr>
<td><a href="index-mo_types.html">Managed Object Types</a></td><td><a href="index-do_types.html">Data Object Types</a></td><td><a href="index-properties.html">All Properties</a></td><td><a href="index-methods.html">All Methods</a></td>
</tr>
</table>
<br>
<script language="javascript">document.write(ID_Copyright);</script>
<br>
<script language="javascript">document.write(<API key>);</script>
</body>
</html> |
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
#ifndef nsUCvKOCID_h___
#define nsUCvKOCID_h___
#include "nsISupports.h"
// Class ID for our EUCKRToUnicode charset converter
// {<API key>}
#define <API key> \
{ 0x379c2775, 0xec77, 0x11d2, {0x8a, 0xac, 0x0, 0x60, 0x8, 0x11, 0xa8, 0x36}}
// Class ID for our UnicodeToEUCKR charset converter
// {<API key>}
#define <API key> \
{ 0x379c2778, 0xec77, 0x11d2, {0x8a, 0xac, 0x0, 0x60, 0x8, 0x11, 0xa8, 0x36}}
#endif |
package policyupdate
import (
"io/ioutil"
"os"
"strings"
"testing"
"github.com/hashicorp/consul/agent"
"github.com/hashicorp/consul/api"
"github.com/hashicorp/consul/logger"
"github.com/hashicorp/consul/testrpc"
"github.com/hashicorp/consul/testutil"
"github.com/mitchellh/cli"
"github.com/stretchr/testify/assert"
)
func <API key>(t *testing.T) {
t.Parallel()
if strings.ContainsRune(New(cli.NewMockUi()).Help(), '\t') {
t.Fatal("help has tabs")
}
}
func <API key>(t *testing.T) {
t.Parallel()
assert := assert.New(t)
testDir := testutil.TempDir(t, "acl")
defer os.RemoveAll(testDir)
a := agent.NewTestAgent(t.Name(), `
primary_datacenter = "dc1"
acl {
enabled = true
tokens {
master = "root"
}
}`)
a.Agent.LogWriter = logger.NewLogWriter(512)
defer a.Shutdown()
testrpc.WaitForLeader(t, a.RPC, "dc1")
ui := cli.NewMockUi()
cmd := New(ui)
rules := []byte("service \"\" { policy = \"write\" }")
err := ioutil.WriteFile(testDir+"/rules.hcl", rules, 0644)
assert.NoError(err)
// Create a policy
client := a.Client()
policy, _, err := client.ACL().PolicyCreate(
&api.ACLPolicy{Name: "test-policy"},
&api.WriteOptions{Token: "root"},
)
assert.NoError(err)
args := []string{
"-http-addr=" + a.HTTPAddr(),
"-token=root",
"-id=" + policy.ID,
"-name=new-name",
"-rules=@" + testDir + "/rules.hcl",
}
code := cmd.Run(args)
assert.Equal(code, 0)
assert.Empty(ui.ErrorWriter.String())
} |
#include "functional.hpp"
#include "pw9xx.hpp"
template <typename num>
static num pbesol_enhancement(const num & na, const num & gaa) {
using <API key>::S2;
const parameter muge = 0.123456790123;
const parameter kappa = 0.804;
num st2 = S2(na, gaa);
num mu = muge;
num t1 = 1 + mu * st2 / kappa;
return 1 + kappa - kappa / t1;
}
template <typename num> static num energy_pbesolx(const num & na, const num & gaa) {
const parameter c = pow(81 / (4 * M_PI), 1.0 / 3.0) / 2;
num na43 = pow(na, 4.0 / 3.0);
num lda = -c * na43;
num pbesolx = lda * pbesol_enhancement(na, gaa);
return pbesolx;
}
template <typename num> static num energy(const densvars<num> & d) {
return energy_pbesolx(d.a, d.gaa) + energy_pbesolx(d.b, d.gbb);
}
FUNCTIONAL(XC_PBESOLX) = {"PBEsol Exchange Functional",
"PBEsol Exchange Functional\n"
"J.P. Perdew et al., Phys. Rev. Lett. 100, 136406 (2008)\n"
"Implemented by Eduardo Fabiano\n",
XC_DENSITY | XC_GRADIENT,
ENERGY_FUNCTION(energy)}; |
<style type="text/css">
body {
background-color: white;
}
.cdalogo {
background-image: url("resources/sample_bg.png");
background-repeat: repeat-y;
height: 360px;
color: #f5f5f5;
padding-bottom: 20px;
}
.spacer200 {
height: 200px;
}
.dsTest {
font-size: 24px;
font-weight: bold;
color: white;
}
table#testTable th {
font-size: 22px;
font-weight: normal;
color: black;
font-family: Verdana, Helvetica, sans-serif;
}
div.desc p {
font-family: Verdana, Helvetica, sans-serif;
font-size: 12px;
}
#testTable {
width: 100%;
font-family: Verdana, Helvetica, sans-serif;
font-size: 11px;
}
#testTable tr {
height: 20px;
}
.logo {
padding-top: 20px;
text-align: center;
font-family: Verdana, Helvetica, sans-serif;
font-size: 12px;
}
#testTable tr td:nth-child(1) {
font-family: monospace;
font-size: 12px;
}
#testTable tr td:nth-child(4) {
text-align: center;
}
#testTable td.testPending {
font-style: italic;
color: blue
}
#testTable td.testPassed {
font-style: italic;
color: green
}
#testTable td.testFailed {
font-style: italic;
color: red
}
</style>
<link type="text/css" href="../cda/static/blueprint/screen.css" rel="stylesheet" />
<div class="webdetailsHead">
<div class="webdetailsLogo">
<a href="http:
</div>
<div class="buttoncontact ">
<a href="mailto:portugal.leads@hitachivantara.com" title="Contact Hitachi Vantara directly here.">Get in Touch</a>
</div>
</div>
<div class="container">
<div class="span-23 clearfix cdalogo">
<div class="span-18 clearfix last">
<div class="span-18 clearfix last" style="height: 30px;">
</div>
<div class="span-6 clearfix prepend-1">
Version ${project.version}
</div>
<div class="span-8 append-3 cdaDesc desc last">
<p> CDA is the <b>Data Access component</b> developed for Pentaho </p>
<p> Here you can not only access the available datasources but also use it
as a test page and reference to the way CDA works </p>
</div>
<div class="span-18 prepend-1 clearfix last dsTest">
Datasource Test
</div>
</div>
<div class="logo">
<a id="about" href="/pentaho/api/repos/cda/static/about.html">About</a>
</div>
</div>
<div class="span-22 prepend-1 clearfix last">
<table id="testTable" cellpadding="0" cellspacing="0">
<tr>
<th>Access method</th>
<th>Description</th>
<th>Sample</th>
<th>Result</th>
</tr>
</table>
</div>
</div>
<div class="webdetailsFooter">
<div class="<API key>">
<a href="https://community.hitachivantara.com/s/topic/0TO1J0000017kVNWAY/ctools" target="_blank"></a>
</div>
</div>
<script language="javascript" type="text/javascript">
var components = [];
</script>
<script language="javascript" type="text/javascript">
function load() {
Dashboards.init(components);
}
load();
// To add test cases, just edit this array
var testCases = [
{
type: "sql.jdbc",
desc: "Sql query over a jdbc datasource",
url: webAppPath + "/plugin/cda/api/doQuery?dataAccessId=1&path=/public/plugin-samples/cda/cdafiles/sql-jdbc.cda",
expectedCols: 4,
expectedRows: 3
},
{
type: "sql.jndi",
desc: "Sql query over a jndi datasource",
url: webAppPath + "/plugin/cda/api/doQuery?dataAccessId=1&path=/public/plugin-samples/cda/cdafiles/sql-jndi.cda",
expectedCols: 4,
expectedRows: 2
},
{
type: "sql.stringarray.jndi",
desc: "Sql query with string array over a jndi datasource",
url: webAppPath + "/plugin/cda/api/doQuery?dataAccessId=1&path=/public/plugin-samples/cda/cdafiles/<API key>.cda",
expectedCols: 2,
expectedRows: 48
},
{
type: "mondrian.jdbc",
desc: "Mdx query over a jdbc mondrian connection",
url: webAppPath + "/plugin/cda/api/doQuery?dataAccessId=1&path=/public/plugin-samples/cda/cdafiles/mondrian-jdbc.cda",
expectedCols: 4,
expectedRows: 3
},
{
type: "mondrian.jndi",
desc: "Mdx query over a jndi mondrian connection",
url: webAppPath + "/plugin/cda/api/doQuery?dataAccessId=1&path=/public/plugin-samples/cda/cdafiles/mondrian-jndi.cda",
expectedCols: 4,
expectedRows: 3
},
{
type: "mondrian.jdbc (denormalized)",
desc: "Denormalized Mdx query over a jdbc mondrian connection",
url: webAppPath + "/plugin/cda/api/doQuery?dataAccessId=1&path=/public/plugin-samples/cda/cdafiles/<API key>.cda",
expectedCols: 4,
expectedRows: 6
},
{
type: "mondrian.jndi (denormalized)",
desc: "Denormalized Mdx query over a jndi mondrian connection",
url: webAppPath + "/plugin/cda/api/doQuery?dataAccessId=1&path=/public/plugin-samples/cda/cdafiles/<API key>.cda",
expectedCols: 5,
expectedRows: 6
},
{
type: "olap4j",
desc: "Mdx query over a olap4j connection",
url: webAppPath + "/plugin/cda/api/doQuery?dataAccessId=1&path=/public/plugin-samples/cda/cdafiles/olap4j.cda",
expectedCols: 4,
expectedRows: 1
},
/*{
type: "olap4j.jndi",
desc: "Mdx query over a olap4j connection",
url: "../cda/doQuery?dataAccessId=1&path=/plugin-samples/cda/cdafiles/olap4j-jndi.cda",
expectedCols: 4,
expectedRows: 1
},*/
{
type: "kettle",
desc: "Kettle transformation",
url: webAppPath + "/plugin/cda/api/doQuery?dataAccessId=1&path=/public/plugin-samples/cda/cdafiles/kettle.cda",
expectedCols: 4,
expectedRows: 1
},
{
type: "metadata",
desc: "Mql query over a metadata connection",
url: webAppPath + "/plugin/cda/api/doQuery?dataAccessId=1&path=/public/plugin-samples/cda/cdafiles/metadata.cda",
expectedCols: 2,
expectedRows: 198
},
{
type: "scripting",
desc: "Scripting data access",
url: webAppPath + "/plugin/cda/api/doQuery?dataAccessId=1&path=/public/plugin-samples/cda/cdafiles/scripting.cda",
expectedCols: 5,
expectedRows: 4
},
{
type: "scripting (json object)",
desc: "Scripting data access using a json object",
url: webAppPath + "/plugin/cda/api/doQuery?dataAccessId=1&path=/public/plugin-samples/cda/cdafiles/json-scripting.cda",
expectedCols: 5,
expectedRows: 4
},
{
type : "xpath",
desc : "Xpath data access over XML file",
url : webAppPath + "/plugin/cda/api/doQuery?dataAccessId=1&path=/public/plugin-samples/cda/cdafiles/xpath.cda",
expectedCols : 2,
expectedRows : 1
},
{
type: "Compound join",
desc: "Joining 2 different datasets",
url: webAppPath + "/plugin/cda/api/doQuery?dataAccessId=3&path=/public/plugin-samples/cda/cdafiles/compoundJoin.cda",
expectedCols: 5,
expectedRows: 12
},
{
type: "Compound Union",
desc: "Appending two different unions",
url: webAppPath + "/plugin/cda/api/doQuery?dataAccessId=3&path=/public/plugin-samples/cda/cdafiles/compoundUnion.cda",
expectedCols: 2,
expectedRows: 4
}
];
// Init table
// Build code to execute
var Caller = Base.extend({
idx : -1,
testInfo : {},
constructor : function(idx) {
this.idx = idx;
this.testInfo = testCases[idx];
this.init();
},
init : function() {
// Add this line to the table
var sampleFile = this.testInfo.url.match(/cdafiles\/(.*)/)[0];
$("#testTable").append("<tr><td>" + this.testInfo.type + "</td><td>" + this.testInfo.desc + "</td><td><a href='javascript:showFile(\"" + sampleFile + "\")'>" + sampleFile + "</a></td><td class='testResult testPending'><img src=\"resources/testing.png\" /></td></tr>");
},
makeCall : function() {
var myself = this;
$.getJSON(this.testInfo.url, function(data) {
myself.verifyData(data);
});
},
verifyData : function(data) {
var valid = true;
var statusText = "";
var statusImage = "";
var cssClass;
if (data.resultset.length != this.testInfo.expectedRows) {
valid = false;
statusText += "Unexpected number of rows; ";
}
if (data.metadata.length != this.testInfo.expectedCols) {
valid = false;
statusText += "Unexpected number of columns; ";
}
if (valid) {
statusText = "";
statusImage = "<img src=\"resources/ok.png\" />"
cssClass = "testPassed";
} else {
cssClass = "testFailed";
}
// Update status
var statusCell = $("#testTable tr:eq(" + (this.idx + 1) + ") td:eq(3)");
statusImage.length > 0 ? statusCell.html(statusImage) : statusCell.text(statusText);
statusCell.removeClass("testPending");
statusCell.addClass(cssClass);
}
});
var showFile = function(link) {
$.fancybox({
type : "iframe",
href : webAppPath + "/plugin/cda/api/getCdaFile?path=/public/plugin-samples/cda/" + link,
width : $(window).width() - 100,
height : $(window).height() - 50
});
// GB_show("Source file",webAppPath + "/content/cda/getCdaFile?path=/plugin-samples/cda/" + link, $(window).height() - 50 , $(window).width() - 100);
}
// Call it
for (var i = 0; i < testCases.length; i++) {
var c = new Caller(i);
c.makeCall();
}
</script> |
subcategory: "Kinesis"
layout: "aws"
page_title: "AWS: aws_kinesis_stream"
description: |-
Provides a Kinesis Stream data source.
# Data Source: aws_kinesis_stream
Use this data source to get information about a Kinesis Stream for use in other
resources.
For more details, see the [Amazon Kinesis Documentation][1].
## Example Usage
hcl
data "aws_kinesis_stream" "stream" {
name = "stream-name"
}
## Argument Reference
* `name` - (Required) The name of the Kinesis Stream.
## Attributes Reference
`id` is set to the Amazon Resource Name (ARN) of the Kinesis Stream. In addition, the following attributes
are exported:
* `arn` - The Amazon Resource Name (ARN) of the Kinesis Stream (same as id).
* `name` - The name of the Kinesis Stream.
* `creation_timestamp` - The approximate UNIX timestamp that the stream was created.
* `status` - The current status of the stream. The stream status is one of CREATING, DELETING, ACTIVE, or UPDATING.
* `retention_period` - Length of time (in hours) data records are accessible after they are added to the stream.
* `open_shards` - The list of shard ids in the OPEN state. See [Shard State][2] for more.
* `closed_shards` - The list of shard ids in the CLOSED state. See [Shard State][2] for more.
* `shard_level_metrics` - A list of shard-level CloudWatch metrics which are enabled for the stream. See [Monitoring with CloudWatch][3] for more.
* `tags` - A map of tags to assigned to the stream.
[1]: https://aws.amazon.com/documentation/kinesis/
[2]: https://docs.aws.amazon.com/streams/latest/dev/<API key>.html#<API key>
[3]: https://docs.aws.amazon.com/streams/latest/dev/<API key>.html |
'use strict';
var _ = require('lodash'),
Tree = require('../../../../lib/view/utils/tree');
describe('Tree', function() {
var tree,
levelItem = { level : 'some-level' },
blockItem = _.extend({}, levelItem, {
block : 'some-block',
tech : 'some-tech',
path : 'some-path'
}),
blockModeItem = _.extend({}, levelItem, blockItem, {
modName : 'some-mod-name',
modVal : 'some-mod-val'
}),
elemItem = _.extend({}, levelItem, blockItem, {
elem : 'some-elem'
}),
elemModeItem = _.extend({}, levelItem, blockItem, elemItem, {
modName : 'some-elem-mod-name',
modVal : 'some-elem-mod-val'
});
function getChild(order) {
var result = tree.getTree();
for(var i = 1; i <= order; i++)
result = result.nodes[0];
return result;
}
beforeEach(function() {
tree = new Tree('some-title');
});
it('should create tree with given title', function() {
assert.equal(tree.getTree().label, 'some-title');
});
it('should create tree with empty nodes array', function() {
assert.lengthOf(tree.getTree().nodes, 0);
});
describe('add level node', function() {
it('should add level node if it does not exist yet', function() {
tree.addNode(levelItem);
assert.deepEqual(getChild(1), { label : 'some-level', nodes : [] });
});
it('should not add level nodes with same labels multiple times', function() {
tree.addNode(levelItem);
tree.addNode(levelItem);
assert.lengthOf(tree.getTree().nodes, 1);
});
it('should return founded or created level node', function() {
assert.deepEqual(tree.addNode(levelItem), { label : 'some-level', nodes : [] });
});
});
describe('add block node', function() {
var treeItem = { label : 'some-block', nodes : [], leaf : { 'some-tech' : 'some-path' } };
it('should add block node if it does not exist yet', function() {
tree.addNode(blockItem, true);
assert.deepEqual(getChild(2), treeItem);
});
it('should not add block nodes with same labels multiple times', function() {
tree.addNode(blockItem, true);
tree.addNode(blockItem, true);
assert.lengthOf(getChild(1).nodes, 1);
});
it('should return founded or created block node', function() {
assert.deepEqual(tree.addNode(blockItem, true), treeItem);
});
});
describe('addModeNode', function() {
var treeItem = {
label : '_some-mod-name',
nodes : [
{
label : 'some-mod-val',
nodes : [],
leaf : { 'some-tech' : 'some-path' }
}
]
};
it('should add block mode node if it does not exist yet', function() {
tree.addNode(blockModeItem, true);
assert.deepEqual(getChild(3), treeItem);
});
it('should not add block mode nodes with same labels multiple times', function() {
tree.addNode(blockModeItem, true);
tree.addNode(blockModeItem, true);
assert.lengthOf(getChild(2).nodes, 1);
});
it('should return founded or created block mode node', function() {
assert(tree.addNode(blockModeItem, true), treeItem);
});
});
describe('addElemNode', function() {
var treeItem = {
label : '__some-elem',
nodes : [],
leaf : { 'some-tech' : 'some-path' }
};
it('should add elem node if it does not exist yet', function() {
tree.addNode(elemItem, true);
assert.deepEqual(getChild(3), treeItem);
});
it('should not add elem nodes with same labels multiple times', function() {
tree.addNode(elemItem, true);
tree.addNode(elemItem, true);
assert.lengthOf(getChild(2).nodes, 1);
});
it('should return founded or created elem node', function() {
assert(tree.addNode(elemItem, true), treeItem);
});
});
describe('addElemModeNode', function() {
var treeItem = {
label : '_some-elem-mod-name',
nodes : [
{
label : 'some-elem-mod-val',
nodes : [],
leaf : { 'some-tech' : 'some-path' }
}
]
};
it('should add elem mode node if it does not exist yet', function() {
tree.addNode(elemModeItem, true);
assert.deepEqual(getChild(4), treeItem);
});
it('should not add elem mode nodes with same labels multiple times', function() {
tree.addNode(elemModeItem, true);
tree.addNode(elemModeItem, true);
assert.lengthOf(getChild(3).nodes, 1);
});
it('should return founded or created elem mode node', function() {
assert(tree.addNode(elemModeItem, true), treeItem);
});
});
}); |
package com.servinglynk.hmis.warehouse.enums;
import java.util.Map;
import java.util.HashMap;
/**
* Defines the <API key> enumeration.
*
* @author Sandeep Dolia
*
*/
public enum <API key> {
/** Enum Constant. */
ZERO("0"),
/** Enum Constant. */
ONE("1"),
/** Enum Constant. */
NINTY_NINE("99");
/**
* Internal storage of status field value, see the Enum spec for
* clarification.
*/
private final String status;
/**
* Enum constructor for ActiveState.
* @param state Value.
*/
<API key>(final String state) {
this.status = state;
}
/** Construct a map for reverse lookup. */
private static Map<String, <API key>> valueMap = new HashMap<String, <API key>>();
static {
// construct hashmap for later possible use.
for (<API key> unit : values()) {
valueMap.put(unit.getValue(), unit);
}
}
/**
* Current string value stored in the enum.
*
* @return string value.
*/
public String getValue() {
return this.status;
}
/**
* Perform a reverse lookup (given a value, obtain the enum).
*
* @param value to search
* @return Enum object.
*/
public static <API key> lookupEnum(String value) {
return <API key>.valueMap.get(value);
}
} |
package com.servinglynk.report.bean;
import java.math.BigInteger;
public class <API key> {
private BigInteger q27cMaleTotal=BigInteger.valueOf(0);
private BigInteger <API key>=BigInteger.valueOf(0);
private BigInteger <API key>=BigInteger.valueOf(0);
private BigInteger <API key>=BigInteger.valueOf(0);
private BigInteger <API key>=BigInteger.valueOf(0);
private BigInteger q27cFemaleTotal=BigInteger.valueOf(0);
private BigInteger <API key>=BigInteger.valueOf(0);
private BigInteger <API key>=BigInteger.valueOf(0);
private BigInteger <API key>=BigInteger.valueOf(0);
private BigInteger <API key>=BigInteger.valueOf(0);
private BigInteger <API key>=BigInteger.valueOf(0);
private BigInteger <API key>=BigInteger.valueOf(0);
private BigInteger <API key>=BigInteger.valueOf(0);
private BigInteger <API key>=BigInteger.valueOf(0);
private BigInteger <API key>=BigInteger.valueOf(0);
private BigInteger <API key>=BigInteger.valueOf(0);
private BigInteger <API key>=BigInteger.valueOf(0);
private BigInteger <API key>=BigInteger.valueOf(0);
private BigInteger <API key>=BigInteger.valueOf(0);
private BigInteger <API key>=BigInteger.valueOf(0);
private BigInteger q27cOtherTotal=BigInteger.valueOf(0);
private BigInteger <API key>=BigInteger.valueOf(0);
private BigInteger <API key>=BigInteger.valueOf(0);
private BigInteger <API key>=BigInteger.valueOf(0);
private BigInteger <API key>=BigInteger.valueOf(0);
private BigInteger q27cDKRTotal=BigInteger.valueOf(0);
private BigInteger q27cDKRWithoutChild=BigInteger.valueOf(0);
private BigInteger <API key>=BigInteger.valueOf(0);
private BigInteger <API key>=BigInteger.valueOf(0);
private BigInteger <API key>=BigInteger.valueOf(0);
private BigInteger <API key>=BigInteger.valueOf(0);
private BigInteger <API key>=BigInteger.valueOf(0);
private BigInteger <API key>=BigInteger.valueOf(0);
private BigInteger <API key>=BigInteger.valueOf(0);
private BigInteger <API key>=BigInteger.valueOf(0);
private BigInteger q27cTotTotal=BigInteger.valueOf(0);
private BigInteger q27cTotWithoutChild=BigInteger.valueOf(0);
private BigInteger <API key>=BigInteger.valueOf(0);
private BigInteger <API key>=BigInteger.valueOf(0);
private BigInteger <API key>=BigInteger.valueOf(0);
public BigInteger getQ27cMaleTotal() {
return q27cMaleTotal;
}
public void setQ27cMaleTotal(BigInteger q27cMaleTotal) {
this.q27cMaleTotal = q27cMaleTotal;
}
public BigInteger <API key>() {
return <API key>;
}
public void <API key>(BigInteger <API key>) {
this.<API key> = <API key>;
}
public BigInteger <API key>() {
return <API key>;
}
public void <API key>(BigInteger <API key>) {
this.<API key> = <API key>;
}
public BigInteger <API key>() {
return <API key>;
}
public void <API key>(BigInteger <API key>) {
this.<API key> = <API key>;
}
public BigInteger <API key>() {
return <API key>;
}
public void <API key>(
BigInteger <API key>) {
this.<API key> = <API key>;
}
public BigInteger getQ27cFemaleTotal() {
return q27cFemaleTotal;
}
public void setQ27cFemaleTotal(BigInteger q27cFemaleTotal) {
this.q27cFemaleTotal = q27cFemaleTotal;
}
public BigInteger <API key>() {
return <API key>;
}
public void <API key>(BigInteger <API key>) {
this.<API key> = <API key>;
}
public BigInteger <API key>() {
return <API key>;
}
public void <API key>(
BigInteger <API key>) {
this.<API key> = <API key>;
}
public BigInteger <API key>() {
return <API key>;
}
public void <API key>(BigInteger <API key>) {
this.<API key> = <API key>;
}
public BigInteger <API key>() {
return <API key>;
}
public void <API key>(
BigInteger <API key>) {
this.<API key> = <API key>;
}
public BigInteger <API key>() {
return <API key>;
}
public void <API key>(
BigInteger <API key>) {
this.<API key> = <API key>;
}
public BigInteger <API key>() {
return <API key>;
}
public void <API key>(
BigInteger <API key>) {
this.<API key> = <API key>;
}
public BigInteger <API key>() {
return <API key>;
}
public void <API key>(
BigInteger <API key>) {
this.<API key> = <API key>;
}
public BigInteger <API key>() {
return <API key>;
}
public void <API key>(
BigInteger <API key>) {
this.<API key> = <API key>;
}
public BigInteger <API key>() {
return <API key>;
}
public void <API key>(
BigInteger <API key>) {
this.<API key> = <API key>;
}
public BigInteger <API key>() {
return <API key>;
}
public void <API key>(
BigInteger <API key>) {
this.<API key> = <API key>;
}
public BigInteger <API key>() {
return <API key>;
}
public void <API key>(
BigInteger <API key>) {
this.<API key> = <API key>;
}
public BigInteger <API key>() {
return <API key>;
}
public void <API key>(
BigInteger <API key>) {
this.<API key> = <API key>;
}
public BigInteger <API key>() {
return <API key>;
}
public void <API key>(
BigInteger <API key>) {
this.<API key> = <API key>;
}
public BigInteger <API key>() {
return <API key>;
}
public void <API key>(
BigInteger <API key>) {
this.<API key> = <API key>;
}
public BigInteger getQ27cOtherTotal() {
return q27cOtherTotal;
}
public void setQ27cOtherTotal(BigInteger q27cOtherTotal) {
this.q27cOtherTotal = q27cOtherTotal;
}
public BigInteger <API key>() {
return <API key>;
}
public void <API key>(BigInteger <API key>) {
this.<API key> = <API key>;
}
public BigInteger <API key>() {
return <API key>;
}
public void <API key>(
BigInteger <API key>) {
this.<API key> = <API key>;
}
public BigInteger <API key>() {
return <API key>;
}
public void <API key>(BigInteger <API key>) {
this.<API key> = <API key>;
}
public BigInteger <API key>() {
return <API key>;
}
public void <API key>(
BigInteger <API key>) {
this.<API key> = <API key>;
}
public BigInteger getQ27cDKRTotal() {
return q27cDKRTotal;
}
public void setQ27cDKRTotal(BigInteger q27cDKRTotal) {
this.q27cDKRTotal = q27cDKRTotal;
}
public BigInteger <API key>() {
return q27cDKRWithoutChild;
}
public void <API key>(BigInteger q27cDKRWithoutChild) {
this.q27cDKRWithoutChild = q27cDKRWithoutChild;
}
public BigInteger <API key>() {
return <API key>;
}
public void <API key>(BigInteger <API key>) {
this.<API key> = <API key>;
}
public BigInteger <API key>() {
return <API key>;
}
public void <API key>(BigInteger <API key>) {
this.<API key> = <API key>;
}
public BigInteger <API key>() {
return <API key>;
}
public void <API key>(
BigInteger <API key>) {
this.<API key> = <API key>;
}
public BigInteger <API key>() {
return <API key>;
}
public void <API key>(
BigInteger <API key>) {
this.<API key> = <API key>;
}
public BigInteger <API key>() {
return <API key>;
}
public void <API key>(
BigInteger <API key>) {
this.<API key> = <API key>;
}
public BigInteger <API key>() {
return <API key>;
}
public void <API key>(
BigInteger <API key>) {
this.<API key> = <API key>;
}
public BigInteger <API key>() {
return <API key>;
}
public void <API key>(
BigInteger <API key>) {
this.<API key> = <API key>;
}
public BigInteger <API key>() {
return <API key>;
}
public void <API key>(
BigInteger <API key>) {
this.<API key> = <API key>;
}
public BigInteger getQ27cTotTotal() {
return q27cTotTotal;
}
public void setQ27cTotTotal(BigInteger q27cTotTotal) {
this.q27cTotTotal = q27cTotTotal;
}
public BigInteger <API key>() {
return q27cTotWithoutChild;
}
public void <API key>(BigInteger q27cTotWithoutChild) {
this.q27cTotWithoutChild = q27cTotWithoutChild;
}
public BigInteger <API key>() {
return <API key>;
}
public void <API key>(BigInteger <API key>) {
this.<API key> = <API key>;
}
public BigInteger <API key>() {
return <API key>;
}
public void <API key>(BigInteger <API key>) {
this.<API key> = <API key>;
}
public BigInteger <API key>() {
return <API key>;
}
public void <API key>(
BigInteger <API key>) {
this.<API key> = <API key>;
}
} |
<?php
namespace thebuggenie\core\entities\tables;
use thebuggenie\core\framework;
use b2db\Core,
b2db\Criteria,
b2db\Criterion;
/**
* Workflow transition validation rules table
*
* @package thebuggenie
* @subpackage tables
*
* @Table(name="<API key>")
* @Entity(class="\thebuggenie\core\entities\<API key>")
*/
class <API key> extends ScopedTable
{
const B2DB_TABLE_VERSION = 1;
const B2DBNAME = '<API key>';
const ID = '<API key>.id';
const SCOPE = '<API key>.scope';
const RULE = '<API key>.rule';
const TRANSITION_ID = '<API key>.transition_id';
const WORKFLOW_ID = '<API key>.workflow_id';
const RULE_VALUE = '<API key>.rule_value';
const PRE_OR_POST = '<API key>.pre_or_post';
public function getByTransitionID($transition_id)
{
$crit = $this->getCriteria();
$crit->addWhere(self::SCOPE, framework\Context::getScope()->getID());
$crit->addWhere(self::TRANSITION_ID, $transition_id);
$actions = array('pre' => array(), 'post' => array());
if ($res = $this->select($crit, false))
{
foreach ($res as $rule)
{
$actions[$rule->isPreOrPost()][$rule->getRule()] = $rule;
}
}
return $actions;
}
} |
from allauth.socialaccount.forms import SignupForm as BaseSignupForm
from django import forms
from django.core import validators
from django.utils.translation import gettext_lazy as _
USERNAME_REQUIRED = _("Username is required.")
USERNAME_SHORT = _(
"Username is too short (%(show_value)s characters). "
"It must be at least %(limit_value)s characters."
)
USERNAME_LONG = _(
"Username is too long (%(show_value)s characters). "
"It must be %(limit_value)s characters or less."
)
TERMS_REQUIRED = _("You must agree to the terms of use.")
class SignupForm(BaseSignupForm):
"""
The user registration form for allauth.
This overrides the default error messages for the username form field
with our own strings.
The heavy lifting happens in the view.
"""
terms = forms.BooleanField(
label=_("I agree"), required=True, error_messages={"required": TERMS_REQUIRED}
)
<API key> = forms.BooleanField(
label=_("I would like to make my GitHub profile URL public"), required=False
)
<API key> = forms.BooleanField(required=False)
<API key> = "_duplicate_email"
def __init__(self, *args, **kwargs):
super(SignupForm, self).__init__(*args, **kwargs)
self.fields["username"].error_messages = {
"required": USERNAME_REQUIRED,
"min_length": USERNAME_SHORT,
"max_length": USERNAME_LONG,
}
def clean_email(self):
value = self.cleaned_data["email"]
validators.validate_email(value)
return super(SignupForm, self).clean_email()
def <API key>(self):
raise forms.ValidationError(self.<API key>) |
package azurerm
import (
"fmt"
"net/http"
"testing"
"github.com/Azure/azure-sdk-for-go/arm/compute"
"github.com/hashicorp/terraform/helper/acctest"
"github.com/hashicorp/terraform/helper/resource"
"github.com/hashicorp/terraform/terraform"
)
func <API key>(t *testing.T) {
var vm compute.VirtualMachine
ri := acctest.RandInt()
config := fmt.Sprintf(<API key>, ri, ri, ri, ri, ri, ri, ri)
resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: <API key>,
Steps: []resource.TestStep{
{
Config: config,
Check: resource.<API key>(
<API key>("<API key>.test", &vm),
),
},
},
})
}
func <API key>(t *testing.T) {
var vm compute.VirtualMachine
ri := acctest.RandInt()
config := fmt.Sprintf(<API key>, ri, ri, ri, ri, ri, ri, ri)
resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: <API key>,
Steps: []resource.TestStep{
{
Config: config,
Check: resource.<API key>(
<API key>("<API key>.test", &vm),
<API key>("<API key>.test", &vm),
),
ExpectNonEmptyPlan: true,
},
},
})
}
func <API key>(t *testing.T) {
var vm compute.VirtualMachine
ri := acctest.RandInt()
config := fmt.Sprintf(<API key>, ri, ri, ri, ri, ri, ri, ri)
resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: <API key>,
Steps: []resource.TestStep{
{
Config: config,
Check: resource.<API key>(
<API key>("<API key>.test", &vm),
),
},
},
})
}
func <API key>(t *testing.T) {
var vm compute.VirtualMachine
ri := acctest.RandInt()
preConfig := fmt.Sprintf(<API key>, ri, ri, ri, ri, ri, ri, ri)
postConfig := fmt.Sprintf(<API key>, ri, ri, ri, ri, ri, ri, ri)
resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: <API key>,
Steps: []resource.TestStep{
{
Config: preConfig,
Check: resource.<API key>(
<API key>("<API key>.test", &vm),
resource.<API key>(
"<API key>.test", "tags.%", "2"),
resource.<API key>(
"<API key>.test", "tags.environment", "Production"),
resource.<API key>(
"<API key>.test", "tags.cost-center", "Ops"),
),
},
{
Config: postConfig,
Check: resource.<API key>(
<API key>("<API key>.test", &vm),
resource.<API key>(
"<API key>.test", "tags.%", "1"),
resource.<API key>(
"<API key>.test", "tags.environment", "Production"),
),
},
},
})
}
//Because we use CreateOrUpdate, we were sending an empty password on update requests
func <API key>(t *testing.T) {
var vm compute.VirtualMachine
ri := acctest.RandInt()
preConfig := fmt.Sprintf(<API key>, ri, ri, ri, ri, ri, ri, ri)
postConfig := fmt.Sprintf(<API key>, ri, ri, ri, ri, ri, ri, ri)
resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: <API key>,
Steps: []resource.TestStep{
{
Config: preConfig,
Check: resource.<API key>(
<API key>("<API key>.test", &vm),
resource.<API key>(
"<API key>.test", "vm_size", "Standard_A0"),
),
},
{
Config: postConfig,
Check: resource.<API key>(
<API key>("<API key>.test", &vm),
resource.<API key>(
"<API key>.test", "vm_size", "Standard_A1"),
),
},
},
})
}
func <API key>(t *testing.T) {
var vm compute.VirtualMachine
ri := acctest.RandInt()
config := fmt.Sprintf(<API key>, ri, ri, ri, ri, ri, ri)
resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: <API key>,
Steps: []resource.TestStep{
{
Config: config,
Check: resource.<API key>(
<API key>("<API key>.test", &vm),
),
},
},
})
}
func <API key>(t *testing.T) {
var vm compute.VirtualMachine
ri := acctest.RandInt()
config := fmt.Sprintf(<API key>, ri, ri, ri, ri, ri, ri)
resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: <API key>,
Steps: []resource.TestStep{
{
Config: config,
Check: resource.<API key>(
<API key>("<API key>.test", &vm),
),
},
},
})
}
func <API key>(t *testing.T) {
var vm compute.VirtualMachine
ri := acctest.RandInt()
config := fmt.Sprintf(<API key>, ri, ri, ri, ri, ri, ri)
resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: <API key>,
Steps: []resource.TestStep{
{
Config: config,
Check: resource.<API key>(
<API key>("<API key>.test", &vm),
),
},
},
})
}
func <API key>(t *testing.T) {
var vm compute.VirtualMachine
ri := acctest.RandInt()
config := fmt.Sprintf(<API key>, ri, ri, ri, ri, ri, ri)
resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: <API key>,
Steps: []resource.TestStep{
{
Config: config,
Check: resource.<API key>(
<API key>("<API key>.test", &vm),
),
},
},
})
}
func <API key>(t *testing.T) {
var vm compute.VirtualMachine
ri := acctest.RandInt()
preConfig := fmt.Sprintf(<API key>, ri, ri, ri, ri, ri, ri, ri)
postConfig := fmt.Sprintf(<API key>, ri, ri, ri, ri, ri)
resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: <API key>,
Steps: []resource.TestStep{
{
Config: preConfig,
Check: resource.<API key>(
<API key>("<API key>.test", &vm),
),
},
{
Config: postConfig,
Check: resource.<API key>(
<API key>("myosdisk1.vhd", true),
<API key>("mydatadisk1.vhd", true),
),
},
},
})
}
func <API key>(t *testing.T) {
var vm compute.VirtualMachine
ri := acctest.RandInt()
preConfig := fmt.Sprintf(<API key>, ri, ri, ri, ri, ri, ri, ri, ri)
postConfig := fmt.Sprintf(<API key>, ri, ri, ri, ri, ri, ri)
resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: <API key>,
Steps: []resource.TestStep{
{
Config: preConfig,
Check: resource.<API key>(
<API key>("<API key>.test", &vm),
),
},
{
Config: postConfig,
Check: resource.<API key>(
<API key>("myosdisk1.vhd", false),
<API key>("mydatadisk1.vhd", false),
),
},
},
})
}
func <API key>(t *testing.T) {
var afterCreate, afterUpdate compute.VirtualMachine
ri := acctest.RandInt()
preConfig := fmt.Sprintf(<API key>, ri, ri, ri, ri, ri, ri, ri)
postConfig := fmt.Sprintf(<API key>, ri, ri, ri, ri, ri, ri, ri)
resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: <API key>,
Steps: []resource.TestStep{
resource.TestStep{
Config: preConfig,
Check: resource.<API key>(
<API key>("<API key>.test", &afterCreate),
),
},
resource.TestStep{
Config: postConfig,
Check: resource.<API key>(
<API key>("<API key>.test", &afterUpdate),
<API key>(
t, &afterCreate, &afterUpdate),
),
},
},
})
}
func <API key>(t *testing.T) {
var afterCreate, afterUpdate compute.VirtualMachine
ri := acctest.RandInt()
preConfig := fmt.Sprintf(<API key>, ri, ri, ri, ri, ri, ri, ri, ri)
postConfig := fmt.Sprintf(<API key>, ri, ri, ri, ri, ri, ri, ri, ri)
resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: <API key>,
Steps: []resource.TestStep{
resource.TestStep{
Config: preConfig,
Check: resource.<API key>(
<API key>("<API key>.test", &afterCreate),
),
},
resource.TestStep{
Config: postConfig,
Check: resource.<API key>(
<API key>("<API key>.test", &afterUpdate),
<API key>(
t, &afterCreate, &afterUpdate),
),
},
},
})
}
func <API key>(t *testing.T) {
var afterCreate, afterUpdate compute.VirtualMachine
ri := acctest.RandInt()
preConfig := fmt.Sprintf(<API key>, ri, ri, ri, ri, ri, ri, ri)
postConfig := fmt.Sprintf(<API key>, ri, ri, ri, ri, ri, ri, ri)
resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: <API key>,
Steps: []resource.TestStep{
resource.TestStep{
Config: preConfig,
Check: resource.<API key>(
<API key>("<API key>.test", &afterCreate),
),
},
resource.TestStep{
Config: postConfig,
Check: resource.<API key>(
<API key>("<API key>.test", &afterUpdate),
<API key>(
t, &afterCreate, &afterUpdate),
),
},
},
})
}
func <API key>(t *testing.T) {
var afterCreate, afterUpdate compute.VirtualMachine
ri := acctest.RandInt()
preConfig := fmt.Sprintf(<API key>, ri, ri, ri, ri, ri, ri, ri)
postConfig := fmt.Sprintf(<API key>, ri, ri, ri, ri, ri, ri, ri)
resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: <API key>,
Steps: []resource.TestStep{
resource.TestStep{
Config: preConfig,
Check: resource.<API key>(
<API key>("<API key>.test", &afterCreate),
),
},
resource.TestStep{
Config: postConfig,
Check: resource.<API key>(
<API key>("<API key>.test", &afterUpdate),
<API key>(
t, &afterCreate, &afterUpdate),
),
},
},
})
}
func <API key>(name string, vm *compute.VirtualMachine) resource.TestCheckFunc {
return func(s *terraform.State) error {
// Ensure we have enough information in state to look up in API
rs, ok := s.RootModule().Resources[name]
if !ok {
return fmt.Errorf("Not found: %s", name)
}
vmName := rs.Primary.Attributes["name"]
resourceGroup, hasResourceGroup := rs.Primary.Attributes["resource_group_name"]
if !hasResourceGroup {
return fmt.Errorf("Bad: no resource group found in state for virtual machine: %s", vmName)
}
conn := testAccProvider.Meta().(*ArmClient).vmClient
resp, err := conn.Get(resourceGroup, vmName, "")
if err != nil {
return fmt.Errorf("Bad: Get on vmClient: %s", err)
}
if resp.StatusCode == http.StatusNotFound {
return fmt.Errorf("Bad: VirtualMachine %q (resource group: %q) does not exist", vmName, resourceGroup)
}
*vm = resp
return nil
}
}
func <API key>(t *testing.T,
before, after *compute.VirtualMachine) resource.TestCheckFunc {
return func(s *terraform.State) error {
if before.ID == after.ID {
t.Fatalf("Expected change of Virtual Machine IDs, but both were %v", before.ID)
}
return nil
}
}
func <API key>(s *terraform.State) error {
conn := testAccProvider.Meta().(*ArmClient).vmClient
for _, rs := range s.RootModule().Resources {
if rs.Type != "<API key>" {
continue
}
name := rs.Primary.Attributes["name"]
resourceGroup := rs.Primary.Attributes["resource_group_name"]
resp, err := conn.Get(resourceGroup, name, "")
if err != nil {
return nil
}
if resp.StatusCode != http.StatusNotFound {
return fmt.Errorf("Virtual Machine still exists:\n%#v", resp.Properties)
}
}
return nil
}
func <API key>(name string, shouldExist bool) resource.TestCheckFunc {
return func(s *terraform.State) error {
for _, rs := range s.RootModule().Resources {
if rs.Type != "<API key>" {
continue
}
// fetch storage account and container name
resourceGroup := rs.Primary.Attributes["resource_group_name"]
storageAccountName := rs.Primary.Attributes["<API key>"]
containerName := rs.Primary.Attributes["name"]
storageClient, _, err := testAccProvider.Meta().(*ArmClient).<API key>(resourceGroup, storageAccountName)
if err != nil {
return fmt.Errorf("Error creating Blob storage client: %s", err)
}
exists, err := storageClient.BlobExists(containerName, name)
if err != nil {
return fmt.Errorf("Error checking if Disk VHD Blob exists: %s", err)
}
if exists && !shouldExist {
return fmt.Errorf("Disk VHD Blob still exists")
} else if !exists && shouldExist {
return fmt.Errorf("Disk VHD Blob should exist")
}
}
return nil
}
}
func <API key>(name string, vm *compute.VirtualMachine) resource.TestCheckFunc {
return func(s *terraform.State) error {
// Ensure we have enough information in state to look up in API
rs, ok := s.RootModule().Resources[name]
if !ok {
return fmt.Errorf("Not found: %s", name)
}
vmName := rs.Primary.Attributes["name"]
resourceGroup, hasResourceGroup := rs.Primary.Attributes["resource_group_name"]
if !hasResourceGroup {
return fmt.Errorf("Bad: no resource group found in state for virtual machine: %s", vmName)
}
conn := testAccProvider.Meta().(*ArmClient).vmClient
_, err := conn.Delete(resourceGroup, vmName, make(chan struct{}))
if err != nil {
return fmt.Errorf("Bad: Delete on vmClient: %s", err)
}
return nil
}
}
var <API key> = `
resource "<API key>" "test" {
name = "acctestRG-%d"
location = "West US"
}
resource "<API key>" "test" {
name = "acctvn-%d"
address_space = ["10.0.0.0/16"]
location = "West US"
resource_group_name = "${<API key>.test.name}"
}
resource "azurerm_subnet" "test" {
name = "acctsub-%d"
resource_group_name = "${<API key>.test.name}"
<API key> = "${<API key>.test.name}"
address_prefix = "10.0.2.0/24"
}
resource "<API key>" "test" {
name = "acctni-%d"
location = "West US"
resource_group_name = "${<API key>.test.name}"
ip_configuration {
name = "testconfiguration1"
subnet_id = "${azurerm_subnet.test.id}"
<API key> = "dynamic"
}
}
resource "<API key>" "test" {
name = "accsa%d"
resource_group_name = "${<API key>.test.name}"
location = "westus"
account_type = "Standard_LRS"
tags {
environment = "staging"
}
}
resource "<API key>" "test" {
name = "vhds"
resource_group_name = "${<API key>.test.name}"
<API key> = "${<API key>.test.name}"
<API key> = "private"
}
resource "<API key>" "test" {
name = "acctvm-%d"
location = "West US"
resource_group_name = "${<API key>.test.name}"
<API key> = ["${<API key>.test.id}"]
vm_size = "Standard_A0"
<API key> {
publisher = "Canonical"
offer = "UbuntuServer"
sku = "14.04.2-LTS"
version = "latest"
}
storage_os_disk {
name = "myosdisk1"
vhd_uri = "${<API key>.test.<API key>}${<API key>.test.name}/myosdisk1.vhd"
caching = "ReadWrite"
create_option = "FromImage"
disk_size_gb = "45"
}
os_profile {
computer_name = "hostname%d"
admin_username = "testadmin"
admin_password = "Password1234!"
}
<API key> {
<API key> = false
}
tags {
environment = "Production"
cost-center = "Ops"
}
}
`
var <API key> = `
resource "<API key>" "test" {
name = "acctestRG-%d"
location = "West US"
}
resource "<API key>" "test" {
name = "acctvn-%d"
address_space = ["10.0.0.0/16"]
location = "West US"
resource_group_name = "${<API key>.test.name}"
}
resource "azurerm_subnet" "test" {
name = "acctsub-%d"
resource_group_name = "${<API key>.test.name}"
<API key> = "${<API key>.test.name}"
address_prefix = "10.0.2.0/24"
}
resource "<API key>" "test" {
name = "acctni-%d"
location = "West US"
resource_group_name = "${<API key>.test.name}"
ip_configuration {
name = "testconfiguration1"
subnet_id = "${azurerm_subnet.test.id}"
<API key> = "dynamic"
}
}
resource "<API key>" "test" {
name = "accsa%d"
resource_group_name = "${<API key>.test.name}"
location = "westus"
account_type = "Standard_LRS"
tags {
environment = "staging"
}
}
resource "<API key>" "test" {
name = "vhds"
resource_group_name = "${<API key>.test.name}"
<API key> = "${<API key>.test.name}"
<API key> = "private"
}
resource "<API key>" "test" {
name = "acctvm-%d"
location = "West US"
resource_group_name = "${<API key>.test.name}"
<API key> = ["${<API key>.test.id}"]
vm_size = "Standard_A0"
<API key> = true
<API key> {
publisher = "Canonical"
offer = "UbuntuServer"
sku = "14.04.2-LTS"
version = "latest"
}
storage_os_disk {
name = "myosdisk1"
vhd_uri = "${<API key>.test.<API key>}${<API key>.test.name}/myosdisk1.vhd"
caching = "ReadWrite"
create_option = "FromImage"
}
os_profile {
computer_name = "hostname%d"
admin_username = "testadmin"
admin_password = "Password1234!"
}
<API key> {
<API key> = false
}
tags {
environment = "Production"
cost-center = "Ops"
}
}
`
var <API key> = `
resource "<API key>" "test" {
name = "acctestRG-%d"
location = "West US"
}
resource "<API key>" "test-sa" {
name = "acctestRG-sa-%d"
location = "West US"
}
resource "<API key>" "test" {
name = "acctvn-%d"
address_space = ["10.0.0.0/16"]
location = "West US"
resource_group_name = "${<API key>.test.name}"
}
resource "azurerm_subnet" "test" {
name = "acctsub-%d"
resource_group_name = "${<API key>.test.name}"
<API key> = "${<API key>.test.name}"
address_prefix = "10.0.2.0/24"
}
resource "<API key>" "test" {
name = "acctni-%d"
location = "West US"
resource_group_name = "${<API key>.test.name}"
ip_configuration {
name = "testconfiguration1"
subnet_id = "${azurerm_subnet.test.id}"
<API key> = "dynamic"
}
}
resource "<API key>" "test" {
name = "accsa%d"
resource_group_name = "${<API key>.test-sa.name}"
location = "westus"
account_type = "Standard_LRS"
tags {
environment = "staging"
}
}
resource "<API key>" "test" {
name = "vhds"
resource_group_name = "${<API key>.test-sa.name}"
<API key> = "${<API key>.test.name}"
<API key> = "private"
}
resource "<API key>" "test" {
name = "acctvm-%d"
location = "West US"
resource_group_name = "${<API key>.test.name}"
<API key> = ["${<API key>.test.id}"]
vm_size = "Standard_A0"
<API key> {
publisher = "Canonical"
offer = "UbuntuServer"
sku = "14.04.2-LTS"
version = "latest"
}
storage_os_disk {
name = "myosdisk1"
vhd_uri = "${<API key>.test.<API key>}${<API key>.test.name}/myosdisk1.vhd"
caching = "ReadWrite"
create_option = "FromImage"
}
<API key> = true
storage_data_disk {
name = "mydatadisk1"
vhd_uri = "${<API key>.test.<API key>}${<API key>.test.name}/mydatadisk1.vhd"
disk_size_gb = "1023"
create_option = "Empty"
lun = 0
}
<API key> = true
os_profile {
computer_name = "hostname%d"
admin_username = "testadmin"
admin_password = "Password1234!"
}
<API key> {
<API key> = false
}
tags {
environment = "Production"
cost-center = "Ops"
}
}
`
var <API key> = `
resource "<API key>" "test" {
name = "acctestRG-%d"
location = "West US"
}
resource "<API key>" "test-sa" {
name = "acctestRG-sa-%d"
location = "West US"
}
resource "<API key>" "test" {
name = "acctvn-%d"
address_space = ["10.0.0.0/16"]
location = "West US"
resource_group_name = "${<API key>.test.name}"
}
resource "azurerm_subnet" "test" {
name = "acctsub-%d"
resource_group_name = "${<API key>.test.name}"
<API key> = "${<API key>.test.name}"
address_prefix = "10.0.2.0/24"
}
resource "<API key>" "test" {
name = "acctni-%d"
location = "West US"
resource_group_name = "${<API key>.test.name}"
ip_configuration {
name = "testconfiguration1"
subnet_id = "${azurerm_subnet.test.id}"
<API key> = "dynamic"
}
}
resource "<API key>" "test" {
name = "accsa%d"
resource_group_name = "${<API key>.test-sa.name}"
location = "westus"
account_type = "Standard_LRS"
tags {
environment = "staging"
}
}
resource "<API key>" "test" {
name = "vhds"
resource_group_name = "${<API key>.test-sa.name}"
<API key> = "${<API key>.test.name}"
<API key> = "private"
}
`
var <API key> = `
resource "<API key>" "test" {
name = "acctestRG-%d"
location = "West US"
}
resource "<API key>" "test" {
name = "acctvn-%d"
address_space = ["10.0.0.0/16"]
location = "West US"
resource_group_name = "${<API key>.test.name}"
}
resource "azurerm_subnet" "test" {
name = "acctsub-%d"
resource_group_name = "${<API key>.test.name}"
<API key> = "${<API key>.test.name}"
address_prefix = "10.0.2.0/24"
}
resource "<API key>" "test" {
name = "acctni-%d"
location = "West US"
resource_group_name = "${<API key>.test.name}"
ip_configuration {
name = "testconfiguration1"
subnet_id = "${azurerm_subnet.test.id}"
<API key> = "dynamic"
}
}
resource "<API key>" "test" {
name = "accsa%d"
resource_group_name = "${<API key>.test.name}"
location = "westus"
account_type = "Standard_LRS"
tags {
environment = "staging"
}
}
resource "<API key>" "test" {
name = "vhds"
resource_group_name = "${<API key>.test.name}"
<API key> = "${<API key>.test.name}"
<API key> = "private"
}
`
var <API key> = `
resource "<API key>" "test" {
name = "acctestRG-%d"
location = "West US"
}
resource "<API key>" "test" {
name = "acctvn-%d"
address_space = ["10.0.0.0/16"]
location = "West US"
resource_group_name = "${<API key>.test.name}"
}
resource "azurerm_subnet" "test" {
name = "acctsub-%d"
resource_group_name = "${<API key>.test.name}"
<API key> = "${<API key>.test.name}"
address_prefix = "10.0.2.0/24"
}
resource "<API key>" "test" {
name = "acctni-%d"
location = "West US"
resource_group_name = "${<API key>.test.name}"
ip_configuration {
name = "testconfiguration1"
subnet_id = "${azurerm_subnet.test.id}"
<API key> = "dynamic"
}
}
resource "<API key>" "test" {
name = "accsa%d"
resource_group_name = "${<API key>.test.name}"
location = "westus"
account_type = "Standard_LRS"
tags {
environment = "staging"
}
}
resource "<API key>" "test" {
name = "vhds"
resource_group_name = "${<API key>.test.name}"
<API key> = "${<API key>.test.name}"
<API key> = "private"
}
resource "<API key>" "test" {
name = "acctvm-%d"
location = "West US"
resource_group_name = "${<API key>.test.name}"
<API key> = ["${<API key>.test.id}"]
vm_size = "Standard_A0"
<API key> {
publisher = "Canonical"
offer = "UbuntuServer"
sku = "14.04.2-LTS"
version = "latest"
}
storage_os_disk {
name = "myosdisk1"
vhd_uri = "${<API key>.test.<API key>}${<API key>.test.name}/myosdisk1.vhd"
caching = "ReadWrite"
create_option = "FromImage"
}
storage_data_disk {
name = "mydatadisk1"
vhd_uri = "${<API key>.test.<API key>}${<API key>.test.name}/mydatadisk1.vhd"
disk_size_gb = "1023"
create_option = "Empty"
lun = 0
}
os_profile {
computer_name = "hostname%d"
admin_username = "testadmin"
admin_password = "Password1234!"
}
<API key> {
<API key> = false
}
tags {
environment = "Production"
cost-center = "Ops"
}
}
`
var <API key> = `
resource "<API key>" "test" {
name = "acctestRG-%d"
location = "West US"
}
resource "<API key>" "test" {
name = "acctvn-%d"
address_space = ["10.0.0.0/16"]
location = "West US"
resource_group_name = "${<API key>.test.name}"
}
resource "azurerm_subnet" "test" {
name = "acctsub-%d"
resource_group_name = "${<API key>.test.name}"
<API key> = "${<API key>.test.name}"
address_prefix = "10.0.2.0/24"
}
resource "<API key>" "test" {
name = "acctni-%d"
location = "West US"
resource_group_name = "${<API key>.test.name}"
ip_configuration {
name = "testconfiguration1"
subnet_id = "${azurerm_subnet.test.id}"
<API key> = "dynamic"
}
}
resource "<API key>" "test" {
name = "accsa%d"
resource_group_name = "${<API key>.test.name}"
location = "westus"
account_type = "Standard_LRS"
tags {
environment = "staging"
}
}
resource "<API key>" "test" {
name = "vhds"
resource_group_name = "${<API key>.test.name}"
<API key> = "${<API key>.test.name}"
<API key> = "private"
}
resource "<API key>" "test" {
name = "acctvm-%d"
location = "West US"
resource_group_name = "${<API key>.test.name}"
<API key> = ["${<API key>.test.id}"]
vm_size = "Standard_A0"
<API key> {
publisher = "Canonical"
offer = "UbuntuServer"
sku = "14.04.2-LTS"
version = "latest"
}
storage_os_disk {
name = "myosdisk1"
vhd_uri = "${<API key>.test.<API key>}${<API key>.test.name}/myosdisk1.vhd"
caching = "ReadWrite"
create_option = "FromImage"
}
os_profile {
computer_name = "hostname%d"
admin_username = "testadmin"
admin_password = "Password1234!"
}
<API key> {
<API key> = false
}
tags {
environment = "Production"
}
}
`
var <API key> = `
resource "<API key>" "test" {
name = "acctestRG-%d"
location = "West US"
}
resource "<API key>" "test" {
name = "acctvn-%d"
address_space = ["10.0.0.0/16"]
location = "West US"
resource_group_name = "${<API key>.test.name}"
}
resource "azurerm_subnet" "test" {
name = "acctsub-%d"
resource_group_name = "${<API key>.test.name}"
<API key> = "${<API key>.test.name}"
address_prefix = "10.0.2.0/24"
}
resource "<API key>" "test" {
name = "acctni-%d"
location = "West US"
resource_group_name = "${<API key>.test.name}"
ip_configuration {
name = "testconfiguration1"
subnet_id = "${azurerm_subnet.test.id}"
<API key> = "dynamic"
}
}
resource "<API key>" "test" {
name = "accsa%d"
resource_group_name = "${<API key>.test.name}"
location = "westus"
account_type = "Standard_LRS"
tags {
environment = "staging"
}
}
resource "<API key>" "test" {
name = "vhds"
resource_group_name = "${<API key>.test.name}"
<API key> = "${<API key>.test.name}"
<API key> = "private"
}
resource "<API key>" "test" {
name = "acctvm-%d"
location = "West US"
resource_group_name = "${<API key>.test.name}"
<API key> = ["${<API key>.test.id}"]
vm_size = "Standard_A1"
<API key> {
publisher = "Canonical"
offer = "UbuntuServer"
sku = "14.04.2-LTS"
version = "latest"
}
storage_os_disk {
name = "myosdisk1"
vhd_uri = "${<API key>.test.<API key>}${<API key>.test.name}/myosdisk1.vhd"
caching = "ReadWrite"
create_option = "FromImage"
}
os_profile {
computer_name = "hostname%d"
admin_username = "testadmin"
admin_password = "Password1234!"
}
<API key> {
<API key> = false
}
}
`
var <API key> = `
resource "<API key>" "test" {
name = "acctestRG-%d"
location = "West US"
}
resource "<API key>" "test" {
name = "acctvn-%d"
address_space = ["10.0.0.0/16"]
location = "West US"
resource_group_name = "${<API key>.test.name}"
}
resource "azurerm_subnet" "test" {
name = "acctsub-%d"
resource_group_name = "${<API key>.test.name}"
<API key> = "${<API key>.test.name}"
address_prefix = "10.0.2.0/24"
}
resource "<API key>" "test" {
name = "acctni-%d"
location = "West US"
resource_group_name = "${<API key>.test.name}"
ip_configuration {
name = "testconfiguration1"
subnet_id = "${azurerm_subnet.test.id}"
<API key> = "dynamic"
}
}
resource "<API key>" "test" {
name = "accsa%d"
resource_group_name = "${<API key>.test.name}"
location = "westus"
account_type = "Standard_LRS"
tags {
environment = "staging"
}
}
resource "<API key>" "test" {
name = "vhds"
resource_group_name = "${<API key>.test.name}"
<API key> = "${<API key>.test.name}"
<API key> = "private"
}
resource "<API key>" "test" {
name = "acctvm-%d"
location = "West US"
resource_group_name = "${<API key>.test.name}"
<API key> = ["${<API key>.test.id}"]
vm_size = "Standard_A0"
<API key> {
publisher = "<API key>"
offer = "WindowsServer"
sku = "2012-Datacenter"
version = "latest"
}
storage_os_disk {
name = "myosdisk1"
vhd_uri = "${<API key>.test.<API key>}${<API key>.test.name}/myosdisk1.vhd"
caching = "ReadWrite"
create_option = "FromImage"
}
os_profile {
computer_name = "winhost01"
admin_username = "testadmin"
admin_password = "Password1234!"
}
<API key> {
<API key> = false
provision_vm_agent = true
}
}
`
var <API key> = `
resource "<API key>" "test" {
name = "acctestRG-%d"
location = "West US"
}
resource "<API key>" "test" {
name = "acctvn-%d"
address_space = ["10.0.0.0/16"]
location = "West US"
resource_group_name = "${<API key>.test.name}"
}
resource "azurerm_subnet" "test" {
name = "acctsub-%d"
resource_group_name = "${<API key>.test.name}"
<API key> = "${<API key>.test.name}"
address_prefix = "10.0.2.0/24"
}
resource "<API key>" "test" {
name = "acctni-%d"
location = "West US"
resource_group_name = "${<API key>.test.name}"
ip_configuration {
name = "testconfiguration1"
subnet_id = "${azurerm_subnet.test.id}"
<API key> = "dynamic"
}
}
resource "<API key>" "test" {
name = "accsa%d"
resource_group_name = "${<API key>.test.name}"
location = "westus"
account_type = "Standard_LRS"
tags {
environment = "staging"
}
}
resource "<API key>" "test" {
name = "vhds"
resource_group_name = "${<API key>.test.name}"
<API key> = "${<API key>.test.name}"
<API key> = "private"
}
resource "<API key>" "test" {
name = "acctvm-%d"
location = "West US"
resource_group_name = "${<API key>.test.name}"
<API key> = ["${<API key>.test.id}"]
vm_size = "Standard_A0"
<API key> {
publisher = "<API key>"
offer = "WindowsServer"
sku = "2012-Datacenter"
version = "latest"
}
storage_os_disk {
name = "myosdisk1"
vhd_uri = "${<API key>.test.<API key>}${<API key>.test.name}/myosdisk1.vhd"
caching = "ReadWrite"
create_option = "FromImage"
}
os_profile {
computer_name = "winhost01"
admin_username = "testadmin"
admin_password = "Password1234!"
}
<API key> {
provision_vm_agent = true
<API key> {
pass = "oobeSystem"
component = "<API key>"
setting_name = "FirstLogonCommands"
content = "<FirstLogonCommands><SynchronousCommand><CommandLine>shutdown /r /t 0 /c \"initial reboot\"</CommandLine><Description>reboot</Description><Order>1</Order></SynchronousCommand></FirstLogonCommands>"
}
}
}
`
var <API key> = `
resource "<API key>" "test" {
name = "acctestRG-%d"
location = "West US"
}
resource "<API key>" "test" {
name = "acctvn-%d"
address_space = ["10.0.0.0/16"]
location = "West US"
resource_group_name = "${<API key>.test.name}"
}
resource "azurerm_subnet" "test" {
name = "acctsub-%d"
resource_group_name = "${<API key>.test.name}"
<API key> = "${<API key>.test.name}"
address_prefix = "10.0.2.0/24"
}
resource "<API key>" "test" {
name = "acctni-%d"
location = "West US"
resource_group_name = "${<API key>.test.name}"
ip_configuration {
name = "testconfiguration1"
subnet_id = "${azurerm_subnet.test.id}"
<API key> = "dynamic"
}
}
resource "<API key>" "test" {
name = "accsa%d"
resource_group_name = "${<API key>.test.name}"
location = "westus"
account_type = "Standard_LRS"
tags {
environment = "staging"
}
}
resource "<API key>" "test" {
name = "vhds"
resource_group_name = "${<API key>.test.name}"
<API key> = "${<API key>.test.name}"
<API key> = "private"
}
resource "<API key>" "test" {
name = "acctvm-%d"
location = "West US"
resource_group_name = "${<API key>.test.name}"
<API key> = ["${<API key>.test.id}"]
vm_size = "Standard_A0"
<API key> {
publisher = "<API key>"
offer = "WindowsServer"
sku = "2012-Datacenter"
version = "latest"
}
storage_os_disk {
name = "myosdisk1"
vhd_uri = "${<API key>.test.<API key>}${<API key>.test.name}/myosdisk1.vhd"
caching = "ReadWrite"
create_option = "FromImage"
}
os_profile {
computer_name = "winhost01"
admin_username = "testadmin"
admin_password = "Password1234!"
}
boot_diagnostics {
enabled = true
storage_uri = "${<API key>.test.<API key>}"
}
<API key> {
winrm {
protocol = "http"
}
}
}
`
var <API key> = `
resource "<API key>" "test" {
name = "acctestRG-%d"
location = "West US"
}
resource "<API key>" "test" {
name = "acctvn-%d"
address_space = ["10.0.0.0/16"]
location = "West US"
resource_group_name = "${<API key>.test.name}"
}
resource "azurerm_subnet" "test" {
name = "acctsub-%d"
resource_group_name = "${<API key>.test.name}"
<API key> = "${<API key>.test.name}"
address_prefix = "10.0.2.0/24"
}
resource "<API key>" "test" {
name = "acctni-%d"
location = "West US"
resource_group_name = "${<API key>.test.name}"
ip_configuration {
name = "testconfiguration1"
subnet_id = "${azurerm_subnet.test.id}"
<API key> = "dynamic"
}
}
resource "<API key>" "test" {
name = "accsa%d"
resource_group_name = "${<API key>.test.name}"
location = "westus"
account_type = "Standard_LRS"
tags {
environment = "staging"
}
}
resource "<API key>" "test" {
name = "vhds"
resource_group_name = "${<API key>.test.name}"
<API key> = "${<API key>.test.name}"
<API key> = "private"
}
resource "<API key>" "test" {
name = "acctvm-%d"
location = "West US"
resource_group_name = "${<API key>.test.name}"
<API key> = ["${<API key>.test.id}"]
vm_size = "Standard_A0"
<API key> {
publisher = "<API key>"
offer = "WindowsServer"
sku = "2012-Datacenter"
version = "latest"
}
storage_os_disk {
name = "myosdisk1"
vhd_uri = "${<API key>.test.<API key>}${<API key>.test.name}/myosdisk1.vhd"
caching = "ReadWrite"
create_option = "FromImage"
}
os_profile {
computer_name = "winhost01"
admin_username = "testadmin"
admin_password = "Password1234!"
}
<API key> {
winrm {
protocol = "http"
}
}
}
`
var <API key> = `
resource "<API key>" "test" {
name = "acctestRG-%d"
location = "West US"
}
resource "<API key>" "test" {
name = "acctvn-%d"
address_space = ["10.0.0.0/16"]
location = "West US"
resource_group_name = "${<API key>.test.name}"
}
resource "azurerm_subnet" "test" {
name = "acctsub-%d"
resource_group_name = "${<API key>.test.name}"
<API key> = "${<API key>.test.name}"
address_prefix = "10.0.2.0/24"
}
resource "<API key>" "test" {
name = "acctni-%d"
location = "West US"
resource_group_name = "${<API key>.test.name}"
ip_configuration {
name = "testconfiguration1"
subnet_id = "${azurerm_subnet.test.id}"
<API key> = "dynamic"
}
}
resource "<API key>" "test" {
name = "accsa%d"
resource_group_name = "${<API key>.test.name}"
location = "westus"
account_type = "Standard_LRS"
tags {
environment = "staging"
}
}
resource "<API key>" "test" {
name = "availabilityset%d"
location = "West US"
resource_group_name = "${<API key>.test.name}"
}
resource "<API key>" "test" {
name = "vhds"
resource_group_name = "${<API key>.test.name}"
<API key> = "${<API key>.test.name}"
<API key> = "private"
}
resource "<API key>" "test" {
name = "acctvm-%d"
location = "West US"
resource_group_name = "${<API key>.test.name}"
<API key> = ["${<API key>.test.id}"]
vm_size = "Standard_A0"
availability_set_id = "${<API key>.test.id}"
<API key> = true
<API key> {
publisher = "Canonical"
offer = "UbuntuServer"
sku = "14.04.2-LTS"
version = "latest"
}
storage_os_disk {
name = "myosdisk1"
vhd_uri = "${<API key>.test.<API key>}${<API key>.test.name}/myosdisk1.vhd"
caching = "ReadWrite"
create_option = "FromImage"
}
os_profile {
computer_name = "hostname%d"
admin_username = "testadmin"
admin_password = "Password1234!"
}
<API key> {
<API key> = false
}
}
`
var <API key> = `
resource "<API key>" "test" {
name = "acctestRG-%d"
location = "West US"
}
resource "<API key>" "test" {
name = "acctvn-%d"
address_space = ["10.0.0.0/16"]
location = "West US"
resource_group_name = "${<API key>.test.name}"
}
resource "azurerm_subnet" "test" {
name = "acctsub-%d"
resource_group_name = "${<API key>.test.name}"
<API key> = "${<API key>.test.name}"
address_prefix = "10.0.2.0/24"
}
resource "<API key>" "test" {
name = "acctni-%d"
location = "West US"
resource_group_name = "${<API key>.test.name}"
ip_configuration {
name = "testconfiguration1"
subnet_id = "${azurerm_subnet.test.id}"
<API key> = "dynamic"
}
}
resource "<API key>" "test" {
name = "accsa%d"
resource_group_name = "${<API key>.test.name}"
location = "westus"
account_type = "Standard_LRS"
tags {
environment = "staging"
}
}
resource "<API key>" "test" {
name = "<API key>%d"
location = "West US"
resource_group_name = "${<API key>.test.name}"
}
resource "<API key>" "test" {
name = "vhds"
resource_group_name = "${<API key>.test.name}"
<API key> = "${<API key>.test.name}"
<API key> = "private"
}
resource "<API key>" "test" {
name = "acctvm-%d"
location = "West US"
resource_group_name = "${<API key>.test.name}"
<API key> = ["${<API key>.test.id}"]
vm_size = "Standard_A0"
availability_set_id = "${<API key>.test.id}"
<API key> = true
<API key> {
publisher = "Canonical"
offer = "UbuntuServer"
sku = "14.04.2-LTS"
version = "latest"
}
storage_os_disk {
name = "myosdisk1"
vhd_uri = "${<API key>.test.<API key>}${<API key>.test.name}/myosdisk1.vhd"
caching = "ReadWrite"
create_option = "FromImage"
}
os_profile {
computer_name = "hostname%d"
admin_username = "testadmin"
admin_password = "Password1234!"
}
<API key> {
<API key> = false
}
}
`
var <API key> = `
resource "<API key>" "test" {
name = "acctestRG-%d"
location = "West US"
}
resource "<API key>" "test" {
name = "acctvn-%d"
address_space = ["10.0.0.0/16"]
location = "West US"
resource_group_name = "${<API key>.test.name}"
}
resource "azurerm_subnet" "test" {
name = "acctsub-%d"
resource_group_name = "${<API key>.test.name}"
<API key> = "${<API key>.test.name}"
address_prefix = "10.0.2.0/24"
}
resource "<API key>" "test" {
name = "acctni-%d"
location = "West US"
resource_group_name = "${<API key>.test.name}"
ip_configuration {
name = "testconfiguration1"
subnet_id = "${azurerm_subnet.test.id}"
<API key> = "dynamic"
}
}
resource "<API key>" "test" {
name = "accsa%d"
resource_group_name = "${<API key>.test.name}"
location = "westus"
account_type = "Standard_LRS"
tags {
environment = "staging"
}
}
resource "<API key>" "test" {
name = "vhds"
resource_group_name = "${<API key>.test.name}"
<API key> = "${<API key>.test.name}"
<API key> = "private"
}
resource "<API key>" "test" {
name = "acctvm-%d"
location = "West US"
resource_group_name = "${<API key>.test.name}"
<API key> = ["${<API key>.test.id}"]
vm_size = "Standard_A0"
<API key> = true
<API key> {
publisher = "Canonical"
offer = "UbuntuServer"
sku = "14.04.2-LTS"
version = "latest"
}
storage_os_disk {
name = "myosdisk1"
vhd_uri = "${<API key>.test.<API key>}${<API key>.test.name}/myosdisk1.vhd"
caching = "ReadWrite"
create_option = "FromImage"
}
os_profile {
computer_name = "newhostname%d"
admin_username = "testadmin"
admin_password = "Password1234!"
}
<API key> {
<API key> = false
}
}
`
var <API key> = `
resource "<API key>" "test" {
name = "acctestRG-%d"
location = "West US"
}
resource "<API key>" "test" {
name = "acctvn-%d"
address_space = ["10.0.0.0/16"]
location = "West US"
resource_group_name = "${<API key>.test.name}"
}
resource "azurerm_subnet" "test" {
name = "acctsub-%d"
resource_group_name = "${<API key>.test.name}"
<API key> = "${<API key>.test.name}"
address_prefix = "10.0.2.0/24"
}
resource "<API key>" "test" {
name = "acctni-%d"
location = "West US"
resource_group_name = "${<API key>.test.name}"
ip_configuration {
name = "testconfiguration1"
subnet_id = "${azurerm_subnet.test.id}"
<API key> = "dynamic"
}
}
resource "<API key>" "test" {
name = "accsa%d"
resource_group_name = "${<API key>.test.name}"
location = "westus"
account_type = "Standard_LRS"
tags {
environment = "staging"
}
}
resource "<API key>" "test" {
name = "vhds"
resource_group_name = "${<API key>.test.name}"
<API key> = "${<API key>.test.name}"
<API key> = "private"
}
resource "<API key>" "test" {
name = "acctvm-%d"
location = "West US"
resource_group_name = "${<API key>.test.name}"
<API key> = ["${<API key>.test.id}"]
vm_size = "Standard_A0"
<API key> = true
<API key> {
publisher = "Canonical"
offer = "UbuntuServer"
sku = "14.04.2-LTS"
version = "latest"
}
storage_os_disk {
name = "myosdisk1"
vhd_uri = "${<API key>.test.<API key>}${<API key>.test.name}/myosdisk1.vhd"
caching = "ReadWrite"
create_option = "FromImage"
disk_size_gb = "45"
}
os_profile {
computer_name = "hostname%d"
admin_username = "testadmin"
admin_password = "Password1234!"
}
<API key> {
<API key> = false
}
tags {
environment = "Production"
cost-center = "Ops"
}
}
`
var <API key> = `
resource "<API key>" "test" {
name = "acctestRG-%d"
location = "West US"
}
resource "<API key>" "test" {
name = "acctvn-%d"
address_space = ["10.0.0.0/16"]
location = "West US"
resource_group_name = "${<API key>.test.name}"
}
resource "azurerm_subnet" "test" {
name = "acctsub-%d"
resource_group_name = "${<API key>.test.name}"
<API key> = "${<API key>.test.name}"
address_prefix = "10.0.2.0/24"
}
resource "<API key>" "test" {
name = "acctni-%d"
location = "West US"
resource_group_name = "${<API key>.test.name}"
ip_configuration {
name = "testconfiguration1"
subnet_id = "${azurerm_subnet.test.id}"
<API key> = "dynamic"
}
}
resource "<API key>" "test" {
name = "accsa%d"
resource_group_name = "${<API key>.test.name}"
location = "westus"
account_type = "Standard_LRS"
tags {
environment = "staging"
}
}
resource "<API key>" "test" {
name = "vhds"
resource_group_name = "${<API key>.test.name}"
<API key> = "${<API key>.test.name}"
<API key> = "private"
}
resource "<API key>" "test" {
name = "acctvm-%d"
location = "West US"
resource_group_name = "${<API key>.test.name}"
<API key> = ["${<API key>.test.id}"]
vm_size = "Standard_A0"
<API key> = true
<API key> {
publisher = "CoreOS"
offer = "CoreOS"
sku = "Stable"
version = "latest"
}
storage_os_disk {
name = "myosdisk1"
vhd_uri = "${<API key>.test.<API key>}${<API key>.test.name}/myosdisk1.vhd"
caching = "ReadWrite"
create_option = "FromImage"
disk_size_gb = "45"
}
os_profile {
computer_name = "hostname%d"
admin_username = "testadmin"
admin_password = "Password1234!"
}
<API key> {
<API key> = false
}
tags {
environment = "Production"
cost-center = "Ops"
}
}
`
var <API key> = `
resource "<API key>" "test" {
name = "acctestRG-%d"
location = "West US"
}
resource "<API key>" "test" {
name = "acctvn-%d"
address_space = ["10.0.0.0/16"]
location = "West US"
resource_group_name = "${<API key>.test.name}"
}
resource "azurerm_subnet" "test" {
name = "acctsub-%d"
resource_group_name = "${<API key>.test.name}"
<API key> = "${<API key>.test.name}"
address_prefix = "10.0.2.0/24"
}
resource "<API key>" "test" {
name = "acctni-%d"
location = "West US"
resource_group_name = "${<API key>.test.name}"
ip_configuration {
name = "testconfiguration1"
subnet_id = "${azurerm_subnet.test.id}"
<API key> = "dynamic"
}
}
resource "<API key>" "test" {
name = "accsa%d"
resource_group_name = "${<API key>.test.name}"
location = "westus"
account_type = "Standard_LRS"
tags {
environment = "staging"
}
}
resource "<API key>" "test" {
name = "vhds"
resource_group_name = "${<API key>.test.name}"
<API key> = "${<API key>.test.name}"
<API key> = "private"
}
resource "<API key>" "test" {
name = "acctvm-%d"
location = "West US"
resource_group_name = "${<API key>.test.name}"
<API key> = ["${<API key>.test.id}"]
vm_size = "Standard_A0"
<API key> {
publisher = "Canonical"
offer = "UbuntuServer"
sku = "14.04.2-LTS"
version = "latest"
}
storage_os_disk {
name = "myosdisk1"
vhd_uri = "${<API key>.test.<API key>}${<API key>.test.name}/myosdiskchanged2.vhd"
caching = "ReadWrite"
create_option = "FromImage"
disk_size_gb = "45"
}
os_profile {
computer_name = "hostname%d"
admin_username = "testadmin"
admin_password = "Password1234!"
}
<API key> {
<API key> = false
}
tags {
environment = "Production"
cost-center = "Ops"
}
}
` |
# Paasmaker - Platform as a Service
# This Source Code Form is subject to the terms of the Mozilla Public
import logging
import paasmaker
from apirequest import APIRequest, APIResponse
logger = logging.getLogger(__name__)
logger.addHandler(logging.NullHandler())
class <API key>(APIRequest):
"""
Get the details for a single application.
"""
def __init__(self, *args, **kwargs):
super(<API key>, self).__init__(*args, **kwargs)
self.application_id = None
self.method = 'GET'
def set_application(self, application_id):
"""
Set the application ID for the request.
"""
self.application_id = application_id
def get_endpoint(self):
return '/application/%d' % self.application_id
class <API key>(APIRequest):
"""
List applications in a workspace.
"""
def __init__(self, *args, **kwargs):
super(<API key>, self).__init__(*args, **kwargs)
self.workspace_id = None
self.method = 'GET'
def set_workspace(self, workspace_id):
"""
Set the workspace ID to list the applications for.
"""
self.workspace_id = workspace_id
def get_endpoint(self):
return '/workspace/%d/applications' % self.workspace_id
class <API key>(APIRequest):
"""
Create a new application.
"""
def __init__(self, *args, **kwargs):
self.params = {}
self.params['manifest_path'] = 'manifest.yml'
self.params['parameters'] = {}
self.workspace_id = None
super(<API key>, self).__init__(*args, **kwargs)
def set_workspace(self, workspace_id):
"""
Set the workspace that this application belongs in.
"""
self.workspace_id = workspace_id
def set_uploaded_file(self, unique_identifier):
"""
If the source for this new version is an uploaded file,
this function sets the unique server-generated file
identifier for this version.
"""
self.params['uploaded_file'] = unique_identifier
def set_scm(self, scm):
"""
Set the SCM name for this new version.
"""
self.params['scm'] = scm
def set_parameters(self, parameters):
"""
Set the SCM parameters for this new version.
"""
self.params['parameters'] = parameters
def set_manifest_path(self, manifest_path):
"""
Set the manifest path inside the files. Defaults to ``manifest.yml``.
"""
self.params['manifest_path'] = manifest_path
def build_payload(self):
return self.params
def get_endpoint(self):
return '/workspace/%d/applications/new' % self.workspace_id
class <API key>(APIRequest):
"""
Create a new version of an existing application.
"""
def __init__(self, *args, **kwargs):
self.params = {}
self.params['manifest_path'] = 'manifest.yml'
self.params['parameters'] = {}
self.application_id = None
super(<API key>, self).__init__(*args, **kwargs)
def set_application(self, application_id):
"""
Set the application ID to create a new version for.
"""
self.application_id = application_id
def set_uploaded_file(self, unique_identifier):
"""
If the source for this new version is an uploaded file,
this function sets the unique server-generated file
identifier for this version.
"""
self.params['uploaded_file'] = unique_identifier
def set_scm(self, scm):
"""
Set the SCM name for this new version.
"""
self.params['scm'] = scm
def set_parameters(self, parameters):
"""
Set the SCM parameters for this new version.
"""
self.params['parameters'] = parameters
def set_manifest_path(self, manifest_path):
"""
Set the manifest path inside the files. Defaults to ``manifest.yml``.
"""
self.params['manifest_path'] = manifest_path
def build_payload(self):
return self.params
def get_endpoint(self):
return '/application/%d/newversion' % self.application_id
class <API key>(APIRequest):
"""
Deletes an application.
"""
def __init__(self, *args, **kwargs):
super(<API key>, self).__init__(*args, **kwargs)
self.application_id = None
def set_application(self, application_id):
"""
Set the application ID for the request.
"""
self.application_id = application_id
def get_endpoint(self):
return '/application/%d/delete' % self.application_id |
import IdentityModel from './_base';
import DS from 'ember-data';
const { attr } = DS;
export default IdentityModel.extend({
formFields: ['toEntityId', 'fromEntityIds', 'force'],
toEntityId: attr('string', {
label: 'Entity to merge to',
}),
fromEntityIds: attr({
label: 'Entities to merge from',
editType: 'stringArray',
}),
force: attr('boolean', {
label: 'Keep MFA secrets from the "to" entity if there are merge conflicts',
defaultValue: false,
}),
}); |
<?php
namespace Rbs\Commerce\Process;
/**
* @name \Rbs\Commerce\Process\CouponInterface
*/
interface CouponInterface
{
/**
* @return string
*/
public function getCode();
/**
* @return string
*/
public function getTitle();
/**
* @return \Zend\Stdlib\Parameters
*/
public function getOptions();
/**
* @return array
*/
public function toArray();
} |
# coding: utf-8
from django import forms
from django.contrib.auth.models import User
from django.utils.translation import ugettext_lazy as _
from registration import forms as registration_forms
from kobo.static_lists import SECTORS, COUNTRIES
USERNAME_REGEX = r'^[a-z][a-z0-9_]+$'
USERNAME_MAX_LENGTH = 30
<API key> = _(
'Usernames must be between 2 and 30 characters in length, '
'and may only consist of lowercase letters, numbers, '
'and underscores, where the first character must be a letter.'
)
class RegistrationForm(registration_forms.RegistrationForm):
username = forms.RegexField(
regex=USERNAME_REGEX,
max_length=USERNAME_MAX_LENGTH,
label=_("Username"),
error_messages={'invalid': <API key>}
)
name = forms.CharField(
label=_('Name'),
required=False,
)
organization = forms.CharField(
label=_('Organization name'),
required=False,
)
gender = forms.ChoiceField(
label=_('Gender'),
required=False,
widget=forms.RadioSelect,
choices=(
('male', _('Male')),
('female', _('Female')),
('other', _('Other')),
)
)
sector = forms.ChoiceField(
label=_('Sector'),
required=False,
choices=(('', ''),
) + SECTORS,
)
country = forms.ChoiceField(
label=_('Country'),
required=False,
choices=(('', ''),) + COUNTRIES,
)
class Meta:
model = User
fields = [
'name',
'organization',
'username',
'email',
'sector',
'country',
'gender',
# The 'password' field appears without adding it here; adding it
# anyway results in a duplicate
] |
cur_frm.cscript.generate = function(doc, dt, dn) {
console.log("inside generate...")
// console.log([doc.code_contact,"Hello"])
return wn.call({
method: "selling.doctype.<API key>.<API key>.<API key>",
// args: {
// verification_code: doc.code_contact,
// user_agent: doc.user_agent
});
} |
//
//
//
//
//# This program is free software: you can redistribute it and/or modify #
//
//# published by the Free Software Foundation, either version 3 of the #
//
//
//# This program is distributed in the hope that it will be useful, #
//
//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
//
//
//
//
//
//# IMS MAXIMS provides absolutely NO GUARANTEE OF THE CLINICAL SAFTEY of #
//# this program. Users of this software do so entirely at their own risk. #
//# IMS MAXIMS only ensures the Clinical Safety of unaltered run-time #
//# software that it builds, deploys and maintains. #
//
//
//#EOH
// This code was generated by Barbara Worwood using IMS Development Environment (version 1.80 build 5589.25814)
// WARNING: DO NOT MODIFY the content of this file
package ims.therapies.domain.base.impl;
import ims.domain.impl.DomainImpl;
public abstract class BasePlinthWorkImpl extends DomainImpl implements ims.therapies.domain.PlinthWork, ims.domain.impl.Transactional
{
private static final long serialVersionUID = 1L;
@SuppressWarnings("unused")
public void <API key>(ims.core.admin.vo.<API key> <API key>)
{
}
@SuppressWarnings("unused")
public void validatelistMedics(ims.core.vo.HcpFilter voHcpFilter)
{
}
@SuppressWarnings("unused")
public void <API key>(ims.therapies.vo.PlinthWorkVo voPlinthWork)
{
}
@SuppressWarnings("unused")
public void <API key>(ims.core.admin.vo.CareContextRefVo voCareContextRef)
{
}
} |
body {
background:#ddd;
}
.ccp-container {
_height:1%;
}
.ccp-header {
background:#dedede url(../images/1x40_gray.jpg) 0 0 repeat-x;
border-left:2px solid #aaa;
border-right:2px solid #aaa;
_width:100%;
}
#<API key> {
float:left;
margin:35px 0 5px 20px;
}
.ccp-header-menu {
position:absolute;
right:-15px;
top:0;
height: 1px;
}
.ccp-header-menu a {
color:#000;
}
.ccp-site-menu {
height: 17px; /* 5px top + 5px bottom + 17px high = 27px total */
padding:5px 20px 5px 5px;
position:relative;
margin-top: -1px;
}
.ccp-site-menu ul {
padding:0;
margin:0;
}
.ccp-user-menu {
height: 17px; /* 5px top + 5px bottom + 17px high = 27px total */
padding:5px 15px 5px 5px;
margin-right: -5px;
margin-top: -1px;
}
.ccp-user-menu ul {
padding:0;
margin:0;
}
.ccp-search-form {
clear:both;
float:right;
margin-top:15px;
padding-right: 30px;
color: #000;
}
.ccp-header h1,
.ccp-search-form{
color:#000;
}
.ccp-body {
background:#fff;
border-width:0 2px 2px 2px;
border-color:#aaa;
border-style:solid;
}
.ccp-navigation {
background:#000;
}
.ccp-navigation ul li a {
color:#fff;
}
.ccp-navigation ul li em {
}
.ccp-navigation ul li a.active,
.ccp-navigation ul li a:hover {
background:#dedede;
-moz-border-radius:5px;
-<API key>:5px;
color:#000;
}
.ccp-navigation ul li a.active em {
color:#000;
}
/* Profile Banner */
.<API key> {
margin:0 0 5px 0;
}
.<API key> {
margin:0 0 10px 0;
}
.ccp-footer {
background: none;
border-bottom: none;
} |
var unblock_youku = unblock_youku || {}; // namespace
// for both chrome extension and server
unblock_youku.common_urls = [
//'http://ting.baidu.com/song/*/download*',
'http://*/vrs_flash.action*',
'http://*/?prot=2&type=1*',
'http://*/?prot=2&file=/*',
'http://music.baidu.com/song/*/download*',
'http://ac.qq.com/*/v/cid/*',
'http://api.3g.youku.com/openapi-wireless/videos/*/download*',
'http://api.3g.youku.com/videos/*/download*',
'http://dynamic.app.m.letv.com/*/dynamic.php?*playid*',
// make the first * matches only domain names or ip addresses
re_str = re_str.replace(/^http:\\\/\\\/\.\*/i, 'http:\/\/[^\/]*');
regex_list.push(new RegExp('^' + re_str, 'i'));
}
return regex_list;
}
// also export as a node.js module
var exports = exports || {};
exports.url_list = unblock_youku.common_urls.concat(unblock_youku.server_extra_urls);
exports.url_regex_list = urls2regexs(exports.url_list); |
package com.funambol.email.util;
import java.util.Date;
import java.util.Locale;
import java.util.TimeZone;
import java.util.zip.CRC32;
import java.util.LinkedHashMap;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.io.BufferedInputStream;
import java.io.<API key>;
import java.io.<API key>;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.PrintStream;
import java.net.InetAddress;
import java.net.<API key>;
import java.sql.Timestamp;
import javax.mail.Address;
import javax.mail.Flags;
import javax.mail.Message;
import javax.mail.Part;
import javax.mail.MessagingException;
import javax.mail.search.ComparisonTerm;
import javax.mail.internet.MimeUtility;
import javax.mail.internet.MimeMessage.RecipientType;
import com.funambol.email.exception.EntityException;
import com.funambol.email.model.DefaultFolder;
import com.funambol.email.model.EmailFilter;
import com.funambol.email.model.FlagProperties;
import com.funambol.email.model.ItemFolder;
import com.funambol.email.model.MailServerAccount;
import com.funambol.email.model.SyncItemInfo;
import com.funambol.email.pdi.mail.Email;
import com.funambol.framework.engine.SyncItem;
import com.funambol.framework.engine.SyncItemKey;
import com.funambol.framework.engine.SyncItemState;
import com.funambol.framework.tools.Base64;
import com.funambol.framework.logging.FunambolLogger;
import com.funambol.framework.logging.<API key>;
import java.util.Map;
/**
* <p>Utility class</p>
*
* @version $Id: Utility.java,v 1.6 2008-07-17 09:55:50 testa Exp $
*/
public class Utility {
protected static FunambolLogger log = <API key>.getLogger(Def.LOGGER_NAME);
/**
* get the Messages from the Mail Server
*
* @param folder The mail folder name.
* @param maxNum Maximum number of messages to retrieve.
* @return Array of messages.
*/
public static Message[] getMessages(javax.mail.Folder folder, int maxNum)
throws MessagingException{
if (log.isTraceEnabled()) {
log.trace("Get Messages Utility");
}
int max = 100;
Message[] messages = null;
int mNumber = folder.getMessageCount();
if (mNumber > max){
if (log.isTraceEnabled()) {
log.trace("Get "+max+" messages");
}
messages = folder.getMessages(mNumber-max,mNumber);
} else {
if (log.isTraceEnabled()) {
log.trace("Get all messages");
}
messages = folder.getMessages();
}
return messages;
}
/**
* convert the db value 'y' in the boolean "true"
*/
public static boolean booleanFromString(String value){
boolean bol = false;
if (value != null){
if (!value.equals("")){
if (value.equalsIgnoreCase("Y")){
bol = true;
}
}
}
return bol;
}
/**
* convert the db value 'y' in the boolean "true"
*/
public static String booleanToString(boolean value){
String bol = "n";
if (value){
bol = "y";
}
return bol;
}
/**
* convert a String db value in the integer value
*/
public static int integerFromString(String value){
int val = 0;
if (value != null){
if (!value.equals("")){
try {
val = Integer.parseInt(value);
} catch (Exception e){
// do nothing
}
}
}
return val;
}
/**
* credantials format: "username:passowrd"
*
* @param username String
* @param credentials String
* @return password String
*/
public static String getPassword(String username, String credentials) {
String up = new String(Base64.decode(credentials));
int l = username.length();
return up.substring(l + 1, up.length());
}
/**
* Returns true if the syncitem is a Mail,
* false if the sycItem is a Folder
*
* @param si SyncItem
* @return boolean
*/
protected boolean isEmail(SyncItem si) {
boolean isEmail = true;
String itemType = si.getType();
if (itemType != null){
isEmail = itemType.equals(Def.TYPE_EMAIL);
}
return isEmail;
}
/**
* create a dummy message-id if the email has message-id = null
*
* @param guid
* @param crc
* @param date
* @return
*/
public static String <API key>(String guid, String crc, String date) {
String dummyMsgId = null;
try {
// crc of date
CRC32 checksumEngine = new CRC32();
long checksum = 0;
byte[] bytesDate = date.getBytes();
checksumEngine.update(bytesDate, 0, bytesDate.length);
checksum = checksumEngine.getValue();
checksumEngine.reset();
dummyMsgId = "<" + crc + checksum + "." + guid + ">";
} catch (Exception me) {
// do nothing; we just want to return 0
}
return dummyMsgId;
}
/**
* converts the Nokia folder name in the defaul folder name
*
* @param oldfolder folder name in the Server String
* @param df DefaultFolder
* @return newfolder folder name in the Nokia device String
*/
public static String <API key>(String oldfolder, DefaultFolder df) {
String newfolder = null;
if (oldfolder.equalsIgnoreCase(Def.NOKIA_INBOX_ENG)) {
newfolder = df.getInboxName();
} else if (oldfolder.equalsIgnoreCase(Def.NOKIA_OUTBOX_ENG)) {
newfolder = df.getOutboxName();
} else if (oldfolder.equalsIgnoreCase(Def.NOKIA_SENT_ENG)) {
newfolder = df.getSentName();
} else if (oldfolder.equalsIgnoreCase(Def.NOKIA_DRAFTS_ENG)) {
newfolder = df.getDraftsName();
}
return newfolder;
}
/**
*
* converts the id of an email in the sent folder with an ID
* for and email in the outbox folder
*
* @param oldID id that starts with S
* @return newID id that starts with O
*/
public static String <API key>(String oldID) {
String newID = null;
if (log.isTraceEnabled()) {
log.trace("<API key> old id " + oldID);
}
int i = oldID.indexOf(Def.SEPARATOR_FIRST);
newID = Def.FOLDER_OUTBOX_ID + oldID.substring(i, oldID.length());
if (log.isTraceEnabled()) {
log.trace("<API key> new id " + newID);
}
return newID;
}
/**
*
* converts the id of an email in the outbox folder with an ID
* for and email in the sent folder
*
* @param oldID id that starts with O
* @return newID id that starts with S
*/
public static String <API key>(String oldID) {
String newID = null;
if (log.isTraceEnabled()) {
log.trace("<API key> old id " + oldID);
}
int i = oldID.indexOf(Def.SEPARATOR_FIRST);
newID = Def.FOLDER_SENT_ID + oldID.substring(i, oldID.length());
if (log.isTraceEnabled()) {
log.trace("<API key> new id " + newID);
}
return newID;
}
/**
* get content from a SyncItem
*
* @param syncItem SyncItem
* @return content of the SyncItem String
* @throws EntityException
*/
public static String <API key>(SyncItem syncItem)
throws EntityException {
String content;
try {
byte[] itemContent = syncItem.getContent();
if (itemContent == null) {
itemContent = new byte[0];
}
content = new String(itemContent);
}
catch (Exception e) {
throw new EntityException("Error getting the item " + syncItem, e);
}
return content;
}
/**
*
* @param message Message
* @return String
*/
public static String getHeaderMessageID(Message message) {
try {
String[] values = message.getHeader(Def.HEADER_MESSAGE_ID);
if ((values != null) && (values.length > 0)) {
return values[0];
}
} catch (MessagingException exception) {
// do nothing; we just want to return null
}
return null;
}
/**
*
* @param message Message
* @return String
*/
public static String getHeaderSubject(Message message) {
try {
String value = message.getSubject();
// limit the subject
if (value != null){
if (value.length() >= 700){
value = value.substring(0,700);
}
}
return value;
} catch (MessagingException exception) {
// do nothing; we just want to return null
}
return null;
}
/**
*
* check if there is the Form field in the message
*
* @param message Message
* @return String
*/
public static boolean hasHeaderFrom(Message message) {
try {
Address[] values = message.getFrom();
if (values == null){
return false;
} else {
if (values.length == 0){
return false;
} else {
return true;
}
}
} catch (MessagingException exception) {
// do nothing; we just want to return null
}
return false;
}
/**
*
* @param message Message
* @return String
*/
public static String getHeaderSender(Message message) {
try {
Address address = null;
Address[] values = message.getFrom();
if (values != null){
for (int i=0; i<values.length; i++){
address = values[i];
if (address != null){
return address.toString();
}
}
}
} catch (MessagingException exception) {
// do nothing; we just want to return null
}
return null;
}
/**
*
* @param message Message
* @return String
*/
public static String getHeaderReceiver(Message message) {
try {
Address address = null;
Address[] values = message.getRecipients(RecipientType.TO);
if (values != null){
for (int i=0; i<values.length; i++){
address = values[i];
if (address != null){
return address.toString();
}
}
}
} catch (MessagingException exception) {
// do nothing; we just want to return null
}
return null;
}
/**
*
* @param message Message
* @return String
*/
public static String <API key>(Message message) {
try {
String[] values = message.getHeader(Def.<API key>);
if ((values != null) && (values.length > 0)) {
return values[0];
}
} catch (MessagingException exception) {
// do nothing; we just want to return null
}
return "";
}
/**
*
* @param part Part
* @return String
*/
public static String <API key>(Part part) {
try {
String[] values = part.getHeader(Def.<API key>);
if ((values != null) && (values.length > 0)) {
return values[0];
}
} catch (MessagingException exception) {
// do nothing; we just want to return null
}
return "";
}
/**
*
* get the message id from the email that the client try to send
* format: Message-ID: O/<API key>==@192.168.55.101
*
* @param msg String
* @return String
*/
public static String getHeaderMessageID(String msg) {
String messageid = null;
int s = Def.HEADER_MESSAGE_ID.length() + 2;
int i = msg.indexOf(Def.HEADER_MESSAGE_ID+": ");
if (i == -1){
i = msg.indexOf("Message-Id: ");
if (i != -1){
int start = i + s;
messageid = msg.substring(start, msg.length());
int end = messageid.indexOf("\n");
messageid = messageid.substring(0, end);
}
} else {
int start = i + s;
messageid = msg.substring(start, msg.length());
int end = messageid.indexOf("\n");
messageid = messageid.substring(0, end);
}
return messageid;
}
/**
*
* @param msg
* @return
*/
public static String getHeaderFrom(String msg) {
String messageid = null;
int s = Def.HEADER_MESSAGE_ID.length() + 2;
int i = msg.indexOf(Def.HEADER_FROM + ": ");
if (i == -1){
i = msg.indexOf("Message-Id: ");
if (i != -1){
int start = i + s;
messageid = msg.substring(start, msg.length());
int end = messageid.indexOf("\n");
messageid = messageid.substring(0, end);
}
} else {
int start = i + s;
messageid = msg.substring(start, msg.length());
int end = messageid.indexOf("\n");
messageid = messageid.substring(0, end);
}
return messageid;
}
/**
*
* @param message Message
* @return String
*/
public static String getHeaderSyncLabel(Message message) {
String syncLabel = null;
try {
String[] values = message.getHeader(Def.HEADER_SYNCMESSAGE);
if ((values != null) && (values.length > 0)) {
syncLabel = values[0];
}
} catch (MessagingException exception) {
// do nothing; we just want to return null
}
return syncLabel;
}
/**
* Returns the charset in the ContentType
* It can be used when the standard method
* <br>
* ContentType ct = new ContentType(part.getContentType());
* <br>
* String specifiedCharset = ct.getParameter("charset");
* <br>
* doesn't work and return null
*
*
* @param message Message
* @return charset String
*/
public static String getHeaderCharset(Message message)
throws EntityException {
String charset = null;
String[] values = null;
String subj = "";
try {
subj = message.getSubject();
values = message.getHeader(Def.HEADER_CONTENT_TYPE);
if ((values != null) && (values.length == 1)) {
String s = values[0];
int chstart = s.indexOf(Def.HEADER_CHARSET);
if (chstart != -1){
charset = s.substring(chstart+Def.HEADER_CHARSET.length()+1,
s.length());
}
}
} catch (MessagingException me) {
throw new EntityException(
"Error getting Header Charset for email: [" + subj + "]", me);
}
return charset;
}
/**
* Returns the charset in the ContentType
* It can be used when the standard method
* <br>
* ContentType ct = new ContentType(part.getContentType());
* <br>
* String specifiedCharset = ct.getParameter("charset");
* <br>
* doesn't work and return null
*
*
* @param headerContentType String
* @return charset String
*/
public static String getHeaderCharset(String headerContentType)
throws EntityException {
String charset = null;
try {
int chstart = headerContentType.indexOf(Def.HEADER_CHARSET);
if (chstart != -1){
charset = headerContentType.substring(
chstart+Def.HEADER_CHARSET.length()+1,
headerContentType.length());
}
} catch (Exception me) {
throw new EntityException("Error getting Charset for email", me);
}
return charset;
}
/**
* Date : Thu Oct 06 09:46:47 CEST 2005
* Returns a received date in UTC format
*
* @param message Message
* @param loc Locale
* @return String
*/
public static String getHeaderReceived(Message message, Locale loc) {
String out = null;
try {
Date d = message.getReceivedDate();
// convert in UTC format
DateFormat utcf = new SimpleDateFormat("yyyyMMdd'T'HHmmss'Z'", loc);
utcf.setTimeZone(TimeZone.getTimeZone("UTC"));
out = utcf.format(d);
}
catch (Exception e) {
// do nothing; we just want to return null
}
return out;
}
/**
* Returns the Header Date in String Format
*
* @param message Message
* @return date in the header Date
*/
public static String getHeaderDateForCRC(Message message)
throws EntityException {
String date = "";
try {
String[] values = message.getHeader(Def.HEADER_DATE);
if ((values != null) && (values.length > 0)) {
date = values[0];
}
} catch (MessagingException me) {
throw new EntityException("Error getting Header Date for CRC", me);
}
return date;
}
/**
* the method checks if the folder is a default folder
* On Exchange server the Default folder are:
* - /Inbox
* - /Outbox
* - /Sent
* - /Draft
* - /Trash
* It's depend of the language (see configuration panel)
*
* @param df DefaultFolder
* @param fullPath String
* @return boolean
* @throws EntityException
*/
public static boolean <API key>(DefaultFolder df, String fullPath)
throws EntityException {
return fullPath.equals(Def.SEPARATOR_FIRST + df.getInboxName()) ||
fullPath.equals(Def.SEPARATOR_FIRST + df.getOutboxName()) ||
fullPath.equals(Def.SEPARATOR_FIRST + df.getSentName()) ||
fullPath.equals(Def.SEPARATOR_FIRST + df.getDraftsName()) ||
fullPath.equals(Def.SEPARATOR_FIRST + df.getTrashName());
}
/**
* the method checks if the folder is a default folder
* On Exchange server the Default folder are:
* - /Inbox
* - /Outbox
* - /Sent
* - /Draft
* - /Trash
* It's depend of the language (see configuration panel)
*
* @param df DefaultFolder
* @param fullPath String
* @return folder id String
* @throws EntityException
*/
public static String getDefaultFolderId(DefaultFolder df, String fullPath)
throws EntityException {
if (fullPath.equals(Def.SEPARATOR_FIRST + df.getInboxName())) {
return Def.FOLDER_INBOX_GUID;
}
if (fullPath.equals(Def.SEPARATOR_FIRST + df.getOutboxName())) {
return Def.FOLDER_OUTBOX_GUID;
}
if (fullPath.equals(Def.SEPARATOR_FIRST + df.getSentName())) {
return Def.FOLDER_SENT_GUID;
}
if (fullPath.equals(Def.SEPARATOR_FIRST + df.getDraftsName())) {
return Def.FOLDER_DRAFTS_GUID;
}
if (fullPath.equals(Def.SEPARATOR_FIRST + df.getTrashName())) {
return Def.FOLDER_TRASH_GUID;
}
throw new EntityException(fullPath + " is not a default folder.");
}
/**
* @param fullpath String
* @return String
*/
public static String <API key>(String fullpath) {
String folderName;
int lastslash = fullpath.lastIndexOf(Def.SEPARATOR_FIRST);
folderName = fullpath.substring(lastslash + 1, fullpath.length());
return folderName;
}
/**
* set folder role using the name
*
* @param folderName String
* @return folder role String
*/
public static String getFolderRole(String folderName, DefaultFolder df) {
String folderRole = null;
if (folderName.equalsIgnoreCase(df.getInboxName())) {
folderRole = Def.FOLDER_INBOX_ROLE;
} else if (folderName.equalsIgnoreCase(df.getOutboxName())) {
folderRole = Def.FOLDER_OUTBOX_ROLE;
} else if (folderName.equalsIgnoreCase(df.getSentName())) {
folderRole = Def.FOLDER_SENT_ROLE;
} else if (folderName.equalsIgnoreCase(df.getDraftsName())) {
folderRole = Def.FOLDER_DRAFTS_ROLE;
} else if (folderName.equalsIgnoreCase(df.getTrashName())) {
folderRole = Def.FOLDER_TRASH_ROLE;
}
return folderRole;
}
/**
* set creation date of a folder
*
* @return UTC creation date String
*/
public static String <API key>() {
String creationDate;
creationDate = "20050101T000000Z";
return creationDate;
}
/**
* gets the parent path of a folder using the full folder path
*
* @param fullpath String
* @return String
*/
public static String <API key>(String fullpath) {
String parentFullpath;
int lastslash = fullpath.lastIndexOf(Def.SEPARATOR_FIRST);
// gell all before last slash
parentFullpath = fullpath.substring(0, lastslash);
// add initial separator
parentFullpath = Def.SEPARATOR_FIRST + parentFullpath;
if (parentFullpath.equals(Def.SEPARATOR_FIRST + "INBOX")) {
parentFullpath = Def.SEPARATOR_FIRST + "Inbox";
}
return parentFullpath;
}
/**
*
* get the ID in the specified partIndex
* 1 it returns the FID
* 2 it returns the FMID
* 3 it returns the UIDV
*
* @param key String
* @return id (it depends on the separator type)
*/
public static String getKeyPart(String key, int partIndex) {
String id = null;
if (partIndex == 1) { // get FID
int endFolderId = key.indexOf(Def.SEPARATOR_FIRST);
if (endFolderId > 0) {
id = key.substring(0, endFolderId);
} else {
// it should return "key" but for backward compatibility it
// returns null
id = null;
}
} else if (partIndex == 2) { // get FMID
int endFolderId = key.indexOf(Def.SEPARATOR_FIRST);
int startValidityId = key.indexOf(Def.SEPARATOR_SECOND);
if (startValidityId > 0) {
// there is the Validity ID
if (endFolderId >= 0) {
id = key.substring((endFolderId + Def.SEPARATOR_FIRST.length()), startValidityId);
} else {
id = key.substring(0, startValidityId);
}
} else {
// there is not the Validity ID
if (endFolderId >= 0) {
id = key.substring((endFolderId + Def.SEPARATOR_FIRST.length()), key.length());
} else {
id = key;
}
}
} else if (partIndex == 3) { // get UIDV
int startValidityId = key.indexOf(Def.SEPARATOR_SECOND);
if (startValidityId > 0) {
id = key.substring((startValidityId + Def.SEPARATOR_SECOND.length()), key.length());
}
}
return id;
}
/**
* Convert the UTC string in a Timestamp
*
* @param utc the string containing the utc time.
* @return Timestamp the Timestamp object, null if any error occurs during
* conversion.
*/
public static Timestamp UtcToTimestamp(String utc) {
Timestamp t = null;
Date date = UtcToDate(utc);
if(date!=null) {
t = new Timestamp(date.getTime());
}
return t;
}
/**
* Convert an UTC string in a Date.
*
* @param utc the string containing the utc time.
* @return Date the date object, null if any error occurs during conversion.
*/
public static Date UtcToDate(String utc) {
Date d = null;
if (utc != null) {
try {
DateFormat utcFormatter = new SimpleDateFormat("yyyyMMdd'T'HHmmss'Z'");
utcFormatter.setTimeZone(TimeZone.getTimeZone("UTC"));
d = utcFormatter.parse(utc);
} catch (Exception e) {
if (log.isTraceEnabled()) {
log.trace("Unparsable date: " + e.toString());
}
}
}
return d;
}
/**
* Converts the UTC string in a long value
*
* @param utc the string containing the utc time.
*
* @return long is the result value for the conversion of the string, 0 if any
* error occurs.
*/
public static long UtcToLong(String utc) {
long longDate = 0;
Date date = UtcToDate(utc);
if(date!=null) {
longDate = date.getTime();
}
return longDate;
}
/**
* merge arrays
*
* @param i CrcSyncItemInfo[]
* @param o CrcSyncItemInfo[]
* @param d CrcSyncItemInfo[]
* @param s CrcSyncItemInfo[]
* @param t CrcSyncItemInfo[]
* @return CrcSyncItemInfo[]
*/
public static String[] mergeArray(String[] i,
String[] o,
String[] d,
String[] s,
String[] t) {
String[] ids;
int length = 0;
int ilength = 0;
int olength = 0;
int dlength = 0;
int slength = 0;
int tlength = 0;
if (i != null) {
ilength = i.length;
length = ilength;
}
if (o != null) {
olength = o.length;
length = length + olength;
}
if (d != null) {
dlength = d.length;
length = length + dlength;
}
if (s != null) {
slength = s.length;
length = length + slength;
}
if (t != null) {
tlength = t.length;
length = length + tlength;
}
ids = new String[length];
int yi, yo, yd, ys, yt;
for (yi = 0; yi < ilength; yi++) {
ids[yi] = i[yi];
}
for (yo = 0; yo < olength; yo++) {
ids[yi + yo] = o[yo];
}
for (yd = 0; yd < dlength; yd++) {
ids[yi + yo + yd] = d[yd];
}
for (ys = 0; ys < slength; ys++) {
ids[yi + yo + yd + ys] = s[ys];
}
for (yt = 0; yt < tlength; yt++) {
ids[yi + yo + yd + ys + yt] = t[yt];
}
return ids;
}
/**
*
* @param hmi
* @param hmo
* @param hms
* @param hmd
* @param hmt
* @return
*/
public static Map mergeMap(Map hmi,
Map hmo,
Map hms,
Map hmd,
Map hmt){
Map all = new LinkedHashMap();
if (hmi != null){
if (hmi.size()>0){
all.putAll(hmi);
}
}
if (hmo != null){
if (hmo.size()>0){
all.putAll(hmo);
}
}
if (hms != null){
if (hms.size()>0){
all.putAll(hms);
}
}
if (hmd != null){
if (hmd.size()>0){
all.putAll(hmd);
}
}
if (hmt != null){
if (hmt.size()>0){
all.putAll(hmt);
}
}
return all;
}
/**
* merge arrays
*
* @param i CrcSyncItemInfo[]
* @param o CrcSyncItemInfo[]
* @param d CrcSyncItemInfo[]
* @param s CrcSyncItemInfo[]
* @param t CrcSyncItemInfo[]
* @return CrcSyncItemInfo[]
*/
public static SyncItemInfo[] mergeArray(SyncItemInfo[] i,
SyncItemInfo[] o,
SyncItemInfo[] d,
SyncItemInfo[] s,
SyncItemInfo[] t) {
SyncItemInfo[] syncItemInfo;
int length = 0;
int ilength = 0;
int olength = 0;
int dlength = 0;
int slength = 0;
int tlength = 0;
if (i != null) {
ilength = i.length;
length = ilength;
}
if (o != null) {
olength = o.length;
length = length + olength;
}
if (d != null) {
dlength = d.length;
length = length + dlength;
}
if (s != null) {
slength = s.length;
length = length + slength;
}
if (t != null) {
tlength = t.length;
length = length + tlength;
}
syncItemInfo = new SyncItemInfo[length];
int yi;
int yo;
int yd;
int ys;
int yt;
for (yi = 0; yi < ilength; yi++) {
syncItemInfo[yi] = i[yi];
}
for (yo = 0; yo < olength; yo++) {
syncItemInfo[yi + yo] = o[yo];
}
for (yd = 0; yd < dlength; yd++) {
syncItemInfo[yi + yo + yd] = d[yd];
}
for (ys = 0; ys < slength; ys++) {
syncItemInfo[yi + yo + yd + ys] = s[ys];
}
for (yt = 0; yt < tlength; yt++) {
syncItemInfo[yi + yo + yd + ys + yt] = t[yt];
}
return syncItemInfo;
}
/**
* merge arrays
*
* @param i CrcSyncItemInfo[]
* @param o CrcSyncItemInfo[]
* @param d CrcSyncItemInfo[]
* @param s CrcSyncItemInfo[]
* @param t CrcSyncItemInfo[]
* @return CrcSyncItemInfo[]
*/
public static ItemFolder[] mergeArray(ItemFolder[] i,
ItemFolder[] o,
ItemFolder[] d,
ItemFolder[] s,
ItemFolder[] t) {
ItemFolder[] itemFolder;
int length = 0;
int ilength = 0;
int olength = 0;
int dlength = 0;
int slength = 0;
int tlength = 0;
if (i != null) {
ilength = i.length;
length = ilength;
}
if (o != null) {
olength = o.length;
length = length + olength;
}
if (d != null) {
dlength = d.length;
length = length + dlength;
}
if (s != null) {
slength = s.length;
length = length + slength;
}
if (t != null) {
tlength = t.length;
length = length + tlength;
}
itemFolder = new ItemFolder[length];
int yi, yo, yd, ys, yt;
for (yi = 0; yi < ilength; yi++) {
itemFolder[yi] = i[yi];
}
for (yo = 0; yo < olength; yo++) {
itemFolder[yi + yo] = o[yo];
}
for (yd = 0; yd < dlength; yd++) {
itemFolder[yi + yo + yd] = d[yd];
}
for (ys = 0; ys < slength; ys++) {
itemFolder[yi + yo + yd + ys] = s[ys];
}
for (yt = 0; yt < tlength; yt++) {
itemFolder[yi + yo + yd + ys + yt] = t[yt];
}
return itemFolder;
}
/**
*
* create a String with the email flags
*
* @param msg Message
* @return long
*/
public static String createFlagsList(Message msg) {
String fgS = "";
try {
FlagProperties fg = <API key>(msg);
fgS = fg.toString();
} catch (Exception me) {
// do nothing; return ""
}
return fgS;
}
/**
*
* Compute CRC-32 checksum value for the specified Message
*
* @param flagList String
* @return long
*/
public static long createCRC(String flagList, String protocol) {
if (Def.PROTOCOL_POP3.equals(protocol)){
return 0;
}
CRC32 checksumEngine = new CRC32();
long checksumFlag = 0;
try {
byte[] bytesFlags = flagList.getBytes();
checksumEngine.update(bytesFlags, 0, bytesFlags.length);
checksumFlag = checksumEngine.getValue();
checksumEngine.reset();
} catch (Exception me) {
// do nothing; we just want to return 0
}
return checksumFlag;
}
/**
* the Funambol client send id in format: I/1234
* the mobile phone can send the LUID not in the format : 1234
*
* @param syncItem SyncItem
* @return FID, FMID and UIDV in an array String[]
*/
public static String[] getKeyParts(SyncItem syncItem) {
String[] keys = new String[3];
String key = syncItem.getKey().getKeyAsString();
String FID;
if (syncItem.getParentKey() != null) {
FID = getKeyPart(syncItem.getParentKey().getKeyAsString(), 2);
} else {
FID = getKeyPart(key,1);
}
keys[0] = FID;
String FMID = getKeyPart(key,2);
keys[1] = FMID;
// get uid validity IMAP GUID : I/1234-FUN-646464
String UIDV = getKeyPart(key,3);
keys[2] = UIDV;
return keys;
}
/**
*
*
* @param protocol
* @param uid
* @param UIDV
* @return
*/
public static String createGUID (String protocol, String uid, String UIDV){
String GUID = null;
if (protocol.equals(Def.PROTOCOL_IMAP)){
GUID = Utility.createIMAPGUID(Def.FOLDER_INBOX_ID, uid, UIDV);
} else {
GUID = Utility.createPOPGUID(Def.FOLDER_INBOX_ID, uid);
}
return GUID;
}
/**
*
*
* @param protocol
* @param GUID
* @return
*/
public static String createUID (String protocol, String GUID){
String FMID = null;
if (protocol.equals(Def.PROTOCOL_IMAP)){
FMID = Utility.getKeyPart(GUID,2);
} else {
FMID = Utility.getKeyPart(GUID,2);
}
return FMID;
}
/**
* sets the EMAIL GUID = FID + Def.SEPARATOR + FMID + Def.SEPARATOR + UIDV
*
* @param FID folder id String
* @param FMID mail id in the folder String
* @param UIDV folder validity String
* @return String
*/
public static String createIMAPGUID(String FID, String FMID, String UIDV) {
return FID + Def.SEPARATOR_FIRST + FMID + Def.SEPARATOR_SECOND + UIDV;
}
/**
* sets the EMAIL GUID = FID + Def.SEPARATOR + FMID
*
* @param FID folder id String
* @param FMID mail id in the folder String
* @return String
*/
public static String createPOPGUID(String FID, String FMID) {
return FID + Def.SEPARATOR_FIRST + FMID ;
}
/**
* sets the FOLDER GUID = FID + Def.SEPARATOR + FMID
*
* @param FID folder id String
* @param FMID mail id in the folder String
* @return String
*/
public static String createFolderGUID(String FID, String FMID) {
return FID + Def.SEPARATOR_FIRST + FMID;
}
/**
*
* @param timeFilterClause String
* @return comparison term for time filter int
*/
public static int getComparisonTerm(String timeFilterClause) {
int out = ComparisonTerm.GE;
if (timeFilterClause.equalsIgnoreCase("EQ") ||
timeFilterClause.equalsIgnoreCase("GT") ||
timeFilterClause.equalsIgnoreCase("GE")) {
out = ComparisonTerm.GE;
} else if (timeFilterClause.equalsIgnoreCase("LT") ||
timeFilterClause.equalsIgnoreCase("LE")) {
out = ComparisonTerm.LE;
}
return out;
}
/**
* Convert the given Date in an UTC string.
*
* @param origDate Date is the object to convert.
*
* @return String is the utc representation of the given Date object.
*/
public static String UtcFromDate(Date origDate) {
String out = null;
DateFormat utcf = new SimpleDateFormat("yyyyMMdd'T'HHmmss'Z'");
utcf.setTimeZone(TimeZone.getTimeZone("UTC"));
if (origDate != null) {
out = utcf.format(origDate);
}
return out;
}
/**
* <p>Decode the given <i>text</i> considering it encoded
* with the given <i>encode type</i>.</p>
*
* @param text
* @param encodeType
* @return the decoded text
* @throws MessagingException
*/
public static String decode(String text, String encodeType)
throws MessagingException {
StringBuffer decodedText;
InputStream inputStream;
BufferedInputStream buffIn;
byte[] tempBuff;
int readLength;
if (text == null) {
return null;
}
inputStream = new <API key>(text.getBytes());
if (Def.<API key>.equals(encodeType)) {
InputStream is = MimeUtility.decode(inputStream, Def.<API key>);
buffIn = new BufferedInputStream(is);
tempBuff = new byte[1024];
decodedText = new StringBuffer();
try {
while ((readLength = buffIn.read(tempBuff)) > -1) {
decodedText.append(new String(tempBuff, 0, readLength));
}
} catch (IOException e) {
throw new MessagingException(e.getMessage(), e);
}
}
return text;
}
/**
* Checks if it's possible to optimize the syncml message
* dimension.
* For instance: an email in the inbox with only the 'read' flag updated
* and already on the client.
*
* If we have a filter with the value "ID" we have to return false
* because the client is asking all the emails.
*
* @param status status of the item; char
* @param FID parent id of the item: String
* @param filter the email filter
* @return true if it's possible to optimize the syncml dimension
*
*/
public static boolean <API key>(char status,
String FID,
EmailFilter filter){
boolean opt = false;
if (filter != null){
String filterID = filter.getId();
if (filterID != null){
//do not need optimization
opt = false;
} else {
if (
status == SyncItemState.UPDATED
&&
(Def.FOLDER_INBOX_GUID.equalsIgnoreCase(FID) ||
Def.FOLDER_OUTBOX_GUID.equalsIgnoreCase(FID) ||
Def.FOLDER_SENT_GUID.equalsIgnoreCase(FID) ||
Def.FOLDER_TRASH_GUID.equalsIgnoreCase(FID) )
){
opt = true;
}
}
}
return opt;
}
/**
* returns an object with the flags: read, replied , flagged, forwarded.
*
* @param email Email
* @return FlagProperties
*
*/
public static FlagProperties getFlags(Email email){
FlagProperties fp = new FlagProperties();
String flagS = "false";
boolean read = false;
boolean replied = false;
boolean flagged = false;
boolean forwarded = false;
if (email != null) {
flagS = (String)email.getRead().getPropertyValue();
if (flagS != null){
read = (Boolean.valueOf(flagS)).booleanValue();
}
flagS = (String)email.getReplied().getPropertyValue();
if (flagS != null){
replied = (Boolean.valueOf(flagS)).booleanValue();
}
flagS = (String)email.getFlagged().getPropertyValue();
if (flagS != null){
flagged = (Boolean.valueOf(flagS)).booleanValue();
}
flagS = (String)email.getForwarded().getPropertyValue();
if (flagS != null){
forwarded = (Boolean.valueOf(flagS)).booleanValue();
}
}
fp.setSeen(read);
fp.setAnswered(replied);
fp.setFlagged(flagged);
fp.setForwarded(forwarded);
return fp;
}
/**
* returns an object with the flags: read, replied , flagged, forwarded.
*
* @param msg Message
* @return FlagProperties
*
*/
public static FlagProperties getFlags(Message msg){
FlagProperties fp = new FlagProperties();
boolean read = false;
boolean replied = false;
boolean flagged = false;
boolean forwarded = false;
if (msg != null) {
try {
read = msg.isSet(Flags.Flag.SEEN);
replied = msg.isSet(Flags.Flag.ANSWERED);
flagged = msg.isSet(Flags.Flag.FLAGGED);
forwarded = isForwarded(msg, Def.IS_FORWARDED_FLAG);
} catch (MessagingException me){
log.error("Error getting the flags from the Message", me);
}
}
fp.setSeen(read);
fp.setAnswered(replied);
fp.setFlagged(flagged);
fp.setForwarded(forwarded);
return fp;
}
/**
* compare 2 date
* @param d1
* @param d2
* @return true if d1 >= d2
*/
public static boolean d1Afterd2(Date d1, Date d2){
long d1t = d1.getTime();
long d2t = d2.getTime();
boolean check = (d1t >= d2t);
return check ;
}
/**
* compare 2 date
* @param d1
* @param d2
* @return true if d1 < d2
*/
public static boolean d1Befored2(Date d1, Date d2){
long d1t = d1.getTime();
long d2t = d2.getTime();
boolean check = (d1t < d2t);
return check ;
}
/**
* utility method for the test classes
*/
public static String readFile(String filename) throws Exception{
String content = "";
byte[] bytes = null;
int offset = 0;
int numRead = 0;
try {
String sContent = "";
File file = new File(filename);
InputStream is = new FileInputStream(file);
// Get the size of the file
long length = file.length();
if (length > Integer.MAX_VALUE) {
throw new Exception ("file too long");
}
// Create the byte array to hold the data
bytes = new byte[(int)length];
// Read in the bytes
while (offset < bytes.length
&& (numRead=is.read(bytes, offset, bytes.length-offset)) >= 0) {
offset += numRead;
}
// Ensure all the bytes have been read in
if (offset < bytes.length) {
throw new Exception("Could not completely read file "+file.getName());
}
is.close();
} catch (Exception e) {
log.error("Error in method readFile", e);
}
return new String(bytes);
}
/**
* for testing purpose
*/
public static void printMessage(Message msg){
try {
OutputStream os = new <API key>();
msg.writeTo(os);
String s = os.toString();
System.out.println(s);
} catch (Exception e){
log.error("Error in method printMessage", e);
}
}
/**
* for testing purpose
* default file name
* "D:\\development\\funambol_v6\\v6\\modules\\emailconnector\\src\\java\\com\\funambol\\email\\test\\A.txt";
*
*/
public static void printMessageInFile(Message msg, String fileName){
String fn ="C:\\"+fileName+".txt";
try {
OutputStream os = new <API key>();
msg.writeTo(os);
String msgS = os.toString();
FileOutputStream out = new FileOutputStream(fn);
PrintStream p = new PrintStream( out );
p.println (msgS);
p.close();
} catch (Exception e){
log.error("Error in method printMessageInFile", e);
}
}
/**
* Used in the ConsoleManager.
* From the UI we get a value in the minute format
* but we have to set in the DB a millisecond format
*/
public static long setMillis(long minutes) {
long ms = (60 * minutes) * 1000;
return ms;
}
/**
* Used in the ConsoleDAO.
* in the DB there is a value in milliSecond format
* and we have to show in the UI a minute format
*/
public static long setMinutes(long millis) {
long minutes = (millis/1000) / 60;
if (minutes == 0){
minutes = 1;
}
return minutes;
}
/**
* used for debug purpose in the MailServer connection
*
*/
public static String getMailServerIP(String server){
String ip = "unknown ip";
try {
InetAddress ina = InetAddress.getByName(server);
ip = ina.getHostAddress();
} catch (<API key> uhe){
// do nothing
}
return ip;
}
/**
* Creates a <code>FlagProperties</code> object which represents the flags
* for a given message.
* @param msg message from which extract flags
* @return a <code>FlagProperties</code> object or <code>null</code>, if some
* exception occurs while reading message.
*/
public static FlagProperties <API key>(Message msg) {
FlagProperties flagProperties = null;
try {
boolean isSeen = msg.isSet(Flags.Flag.SEEN);
boolean isAnswered = msg.isSet(Flags.Flag.ANSWERED);
boolean isDeleted = msg.isSet(Flags.Flag.DELETED);
boolean isDraft = msg.isSet(Flags.Flag.DRAFT);
boolean isFlagged = msg.isSet(Flags.Flag.FLAGGED);
boolean isForwarded = isForwarded(msg, Def.IS_FORWARDED_FLAG);
flagProperties = new FlagProperties(isSeen,
isAnswered,
isDeleted,
isDraft,
isFlagged,
isForwarded);
} catch (MessagingException me) {
// do nothing
}
return flagProperties;
}
/**
* add the prefix 'recent:' for a gmail serrver
*
* @param msa MailServerAccount
* @return username
*
*/
public static String getLogin(MailServerAccount msa){
String userNew = "";
String type = msa.getMailServer().getMailServerType();
String loginFromDB = msa.getMsLogin();
if (Def.SERVER_TYPE_GMAIL.equals(type) &&
Def.PROTOCOL_POP3.equals(msa.getMailServer().getProtocol())) {
// check the prefix
if (loginFromDB.startsWith("recent:")){
userNew = loginFromDB;
} else {
userNew = "recent:" + loginFromDB;
}
} else {
userNew = loginFromDB;
}
return userNew;
}
/**
* This method tries to assert if a message has been forwarded or not.
* <p/>
* It looks in the user flags list for the string that represent the forwarded
* flag (comparison is case insensitive). Note that is up to the mail server
* to write in the user list information that sais if the message has been
* forwarded and also choose what string to put. Thus this method may not
* return the correct information, if the mail server uses a flag different
* from <code>forwardedFlag</code> or does not put any information at all.
*
* @see EntityManager.createMessage for how to set forwarded flag for incoming
* mails.
*
* @param message email message
* @param forwardedFlag string that represent the forwarded flag
* @return <code>true</code> if the <code>forwardedFlag</code> is contained
* in the user flag list, <code>false</code> otherwise.
* @throws javax.mail.MessagingException
*/
private static boolean isForwarded(Message message, String forwardedFlag)
throws MessagingException {
String[] userFlags = message.getFlags().getUserFlags();
if (userFlags == null) {
return false;
}
for (String flag : userFlags) {
if (flag.equalsIgnoreCase(forwardedFlag)) {
return true;
}
}
return false;
}
} |
.PHONY: help chain dh
NAME := cert
help: ## Display this help
@echo If you want to use an existing certifaction auhoritiy, place ca_key.pem
@echo \(private key of the ca\) and ca_cert.pem \(the public cert of the ca\) in
@echo this directory.
@echo
@echo Otherwise everything will be created
@echo
@cat $(MAKEFILE_LIST) | grep -E '^[0-9a-zA-Z_-]+:.*?## .*$$' | sort -k1,1 | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
clean: ## Remove files
rm -f *.pem *.srl *.csr
chain: | $(NAME).pem ## Create a cert-chain (cert.pem) or 'make chain NAME=bla' for bla.pem
dh: | dh.pem ## Create the dh-parameters
dh.pem:
openssl dhparam -out dh.pem -5 4096
ca_key.pem:
openssl genrsa -out ca_key.pem 4096
$(NAME)_key.pem:
openssl genrsa -out $(NAME)_key.pem 4096
ca_cert.pem: | ca_key.pem
openssl req -x509 -new -nodes -key ca_key.pem \
-days 36500 -out ca_cert.pem -sha512
$(NAME).csr: | $(NAME)_key.pem
openssl req -new -key $(NAME)_key.pem -sha512 \
-out $(NAME).csr
$(NAME)_pub.pem: | $(NAME).csr ca_cert.pem
openssl x509 -req -in $(NAME).csr -CA ca_cert.pem \
-CAkey ca_key.pem -extensions sslclient,sslserver \
-CAcreateserial -out $(NAME)_pub.pem -days 36500 \
-sha512
$(NAME).pem: | $(NAME)_pub.pem
cat $(NAME)_key.pem > $(NAME).pem && \
cat $(NAME)_pub.pem >> $(NAME).pem && \
cat ca_cert.pem >> $(NAME).pem || \
sh -c "rm $(NAME).pem; false" |
package io.bitsquare.trade.offer;
import com.google.inject.Singleton;
import io.bitsquare.app.AppModule;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.core.env.Environment;
public class OfferModule extends AppModule {
private static final Logger log = LoggerFactory.getLogger(OfferModule.class);
public OfferModule(Environment env) {
super(env);
}
@Override
protected final void configure() {
bind(OpenOfferManager.class).in(Singleton.class);
bind(OfferBookService.class).in(Singleton.class);
}
} |
//
//
//
//
//# This program is free software: you can redistribute it and/or modify #
//
//# published by the Free Software Foundation, either version 3 of the #
//
//
//# This program is distributed in the hope that it will be useful, #
//
//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
//
//
//
//
//
//# IMS MAXIMS provides absolutely NO GUARANTEE OF THE CLINICAL SAFTEY of #
//# this program. Users of this software do so entirely at their own risk. #
//# IMS MAXIMS only ensures the Clinical Safety of unaltered run-time #
//# software that it builds, deploys and maintains. #
//
//
//#EOH
// This code was generated by Barbara Worwood using IMS Development Environment (version 1.80 build 5589.25814)
// WARNING: DO NOT MODIFY the content of this file
package ims.core.forms.vitalsignsmetrics;
public final class FormInfo extends ims.framework.FormInfo
{
private static final long serialVersionUID = 1L;
public FormInfo(Integer formId)
{
super(formId);
}
public String getNamespaceName()
{
return "Core";
}
public String getFormName()
{
return "VitalSignsMetrics";
}
public int getWidth()
{
return 848;
}
public int getHeight()
{
return 632;
}
public String[] getContextVariables()
{
return new String[] { "_cv_Core.VitalSign", "_cv_Core.IdForm" };
}
public String <API key>()
{
return "_lv_Core.VitalSignsMetrics.<API key>" + String.valueOf(getFormId());
}
public ims.framework.FormInfo[] <API key>()
{
ims.framework.FormInfo[] componentsInfo = new ims.framework.FormInfo[0];
return componentsInfo;
}
public String getImagePath()
{
return "Images/Core/<API key>.png";
}
} |
import React from 'react';
import {IArticle} from 'superdesk-api';
import {flatMap} from 'lodash';
import {extensions} from 'appConfig';
import {IAuthoringAction} from './services/<API key>;
import {dataApi} from 'core/helpers/CrudManager';
import {CreatedInfo} from './created-info';
import {ModifiedInfo} from './modified-info';
const defaultToolbarItems: Array<React.ComponentType<{article: IArticle}>> = [CreatedInfo, ModifiedInfo];
interface IProps {
article: IArticle;
action: IAuthoringAction;
onChange(article: IArticle): void;
}
interface IState {
articleOriginal?: IArticle;
}
export class <API key> extends React.PureComponent<IProps, IState> {
constructor(props: IProps) {
super(props);
this.state = {};
this.<API key> = this.<API key>.bind(this);
}
<API key>() {
// fetching original item from the server since `IProps['article']` contains changes
// which it shouldn't contain since it is in read-only mode.
// I've tried passing `origItem` from authoring-topbar, but it contains changes as well,
// namely `_editable` and `_locked` fields which doesn't allow for computing correct diff.
dataApi.findOne<IArticle>('archive', this.props.article._id).then((articleOriginal) => {
this.setState({articleOriginal});
});
}
componentDidUpdate(prevProps: IProps) {
if (this.props.action === 'view' && JSON.stringify(prevProps.article) !== JSON.stringify(this.props.article)) {
// <API key> react/<API key>
this.setState({articleOriginal: undefined}, () => {
this.<API key>();
});
}
}
componentDidMount() {
if (this.props.action === 'view') {
this.<API key>();
}
}
render() {
if (this.props.action === 'view' && typeof this.state.articleOriginal === 'undefined') {
return null; // fetching article from the server
}
const <API key> = defaultToolbarItems.concat(
flatMap(
Object.values(extensions),
(extension) => extension.activationResult?.contributions?.<API key> ?? [],
),
);
// extensions should be able to expose pure components which check equality by reference
const <API key> = {...this.props.article};
return (
<div className="<API key>>
{<API key>.map(
(Component, i) => (
<div key={i} className="<API key>>
<Component
article={
this.props.action === 'view' ? this.state.articleOriginal : <API key>
}
/>
</div>
),
)}
</div>
);
}
} |
# -*- coding: utf-8 -*-
# directory
import re
from openerp import netsvc
from openerp.osv import osv, fields
class partner(osv.osv):
_name = 'res.partner'
_inherits = { }
_inherit = [ 'res.partner' ]
_columns = {
'authorization_ids': fields.one2many('nautical.authorization', 'partner_id', string='Authorizations'),
'<API key>': fields.one2many('nautical.partner_record', 'partner_id', string='<API key>'),
'owned_craft_ids': fields.one2many('nautical.craft', 'owner_id', string='Owned Crafts'),
}
_defaults = {
}
_constraints = [
]
partner()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
//
//
//
//
//# This program is free software: you can redistribute it and/or modify #
//
//# published by the Free Software Foundation, either version 3 of the #
//
//
//# This program is distributed in the hope that it will be useful, #
//
//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
//
//
//
//
//
//# IMS MAXIMS provides absolutely NO GUARANTEE OF THE CLINICAL SAFTEY of #
//# this program. Users of this software do so entirely at their own risk. #
//# IMS MAXIMS only ensures the Clinical Safety of unaltered run-time #
//# software that it builds, deploys and maintains. #
//
//
//#EOH
// This code was generated by Barbara Worwood using IMS Development Environment (version 1.80 build 5589.25814)
// WARNING: DO NOT MODIFY the content of this file
package ims.RefMan.vo;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.Iterator;
import ims.framework.enumerations.SortOrder;
/**
* Linked to RefMan.AtConsultation business object (ID: 1096100004).
*/
public class <API key> extends ims.vo.<API key> implements ims.domain.<API key>, ims.vo.ImsCloneable, Iterable<AtConsultationRefVo>
{
private static final long serialVersionUID = 1L;
private ArrayList<AtConsultationRefVo> col = new ArrayList<AtConsultationRefVo>();
public final String getBoClassName()
{
return "ims.RefMan.domain.objects.AtConsultation";
}
public ims.domain.IDomainGetter[] <API key>()
{
ims.domain.IDomainGetter[] result = new ims.domain.IDomainGetter[col.size()];
col.toArray(result);
return result;
}
public boolean add(AtConsultationRefVo value)
{
if(value == null)
return false;
if(this.col.indexOf(value) < 0)
{
return this.col.add(value);
}
return false;
}
public boolean add(int index, AtConsultationRefVo value)
{
if(value == null)
return false;
if(this.col.indexOf(value) < 0)
{
this.col.add(index, value);
return true;
}
return false;
}
public void clear()
{
this.col.clear();
}
public void remove(int index)
{
this.col.remove(index);
}
public int size()
{
return this.col.size();
}
public int indexOf(AtConsultationRefVo instance)
{
return col.indexOf(instance);
}
public AtConsultationRefVo get(int index)
{
return this.col.get(index);
}
public boolean set(int index, AtConsultationRefVo value)
{
if(value == null)
return false;
this.col.set(index, value);
return true;
}
public void remove(AtConsultationRefVo instance)
{
if(instance != null)
{
int index = indexOf(instance);
if(index >= 0)
remove(index);
}
}
public boolean contains(AtConsultationRefVo instance)
{
return indexOf(instance) >= 0;
}
public Object clone()
{
<API key> clone = new <API key>();
for(int x = 0; x < this.col.size(); x++)
{
if(this.col.get(x) != null)
clone.col.add((AtConsultationRefVo)this.col.get(x).clone());
else
clone.col.add(null);
}
return clone;
}
public boolean isValidated()
{
return true;
}
public String[] validate()
{
return null;
}
public AtConsultationRefVo[] toArray()
{
AtConsultationRefVo[] arr = new AtConsultationRefVo[col.size()];
col.toArray(arr);
return arr;
}
public <API key> sort()
{
return sort(SortOrder.ASCENDING);
}
public <API key> sort(SortOrder order)
{
return sort(new <API key>(order));
}
@SuppressWarnings("unchecked")
public <API key> sort(Comparator comparator)
{
Collections.sort(this.col, comparator);
return this;
}
public Iterator<AtConsultationRefVo> iterator()
{
return col.iterator();
}
@Override
protected ArrayList getTypedCollection()
{
return col;
}
private class <API key> implements Comparator
{
private int direction = 1;
public <API key>()
{
this(SortOrder.ASCENDING);
}
public <API key>(SortOrder order)
{
if (order == SortOrder.DESCENDING)
{
this.direction = -1;
}
}
public int compare(Object obj1, Object obj2)
{
AtConsultationRefVo voObj1 = (AtConsultationRefVo)obj1;
AtConsultationRefVo voObj2 = (AtConsultationRefVo)obj2;
return direction*(voObj1.compareTo(voObj2));
}
}
} |
# -*- encoding: utf-8 -*-
# This program is free software: you can redistribute it and/or modify #
# (at your option) any later version. #
# This program is distributed in the hope that it will be useful, #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
import clv_batch_history |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.utils import date_diff, getdate, formatdate, cint, month_diff, flt
from frappe.model.document import Document
from erpnext.hr.utils import <API key>
class PayrollPeriod(Document):
def validate(self):
self.validate_dates()
self.validate_overlap()
def validate_dates(self):
if getdate(self.start_date) > getdate(self.end_date):
frappe.throw(_("End date can not be less than start date"))
def validate_overlap(self):
query = """
select name
from `tab{0}`
where name != %(name)s
and company = %(company)s and (start_date between %(start_date)s and %(end_date)s \
or end_date between %(start_date)s and %(end_date)s \
or (start_date < %(start_date)s and end_date > %(end_date)s))
"""
if not self.name:
# hack! if name is null, it could cause problems with !=
self.name = "New "+self.doctype
overlap_doc = frappe.db.sql(query.format(self.doctype),{
"start_date": self.start_date,
"end_date": self.end_date,
"name": self.name,
"company": self.company
}, as_dict = 1)
if overlap_doc:
msg = _("A {0} exists between {1} and {2} (").format(self.doctype,
formatdate(self.start_date), formatdate(self.end_date)) \
+ """ <b><a href="#Form/{0}/{1}">{1}</a></b>""".format(self.doctype, overlap_doc[0].name) \
+ _(") for {0}").format(self.company)
frappe.throw(msg)
def <API key>(start_date, end_date, employee, company=None):
if not company:
company = frappe.db.get_value("Employee", employee, "company")
payroll_period = frappe.db.sql("""
select name, start_date, end_date
from `tabPayroll Period`
where
company=%(company)s
and %(start_date)s between start_date and end_date
and %(end_date)s between start_date and end_date
""", {
'company': company,
'start_date': start_date,
'end_date': end_date
})
if len(payroll_period) > 0:
actual_no_of_days = date_diff(getdate(payroll_period[0][2]), getdate(payroll_period[0][1])) + 1
working_days = actual_no_of_days
if not cint(frappe.db.get_value("HR Settings", None, "<API key>")):
holidays = <API key>(employee, getdate(payroll_period[0][1]), getdate(payroll_period[0][2]))
working_days -= len(holidays)
return payroll_period[0][0], working_days, actual_no_of_days
return False, False, False
def get_payroll_period(from_date, to_date, company):
payroll_period = frappe.db.sql("""
select name, start_date, end_date
from `tabPayroll Period`
where start_date<=%s and end_date>= %s and company=%s
""", (from_date, to_date, company), as_dict=1)
return payroll_period[0] if payroll_period else None
def get_period_factor(employee, start_date, end_date, payroll_frequency, payroll_period, <API key>=0):
# TODO if both deduct checked update the factor to make tax consistent
period_start, period_end = payroll_period.start_date, payroll_period.end_date
joining_date, relieving_date = frappe.db.get_value("Employee", employee, ["date_of_joining", "relieving_date"])
if getdate(joining_date) > getdate(period_start):
period_start = joining_date
if relieving_date and getdate(relieving_date) < getdate(period_end):
period_end = relieving_date
total_sub_periods, <API key> = 0.0, 0.0
if payroll_frequency == "Monthly" and not <API key>:
total_sub_periods = month_diff(payroll_period.end_date, payroll_period.start_date)
<API key> = month_diff(period_end, start_date)
else:
salary_days = date_diff(end_date, start_date) + 1
<API key> = date_diff(payroll_period.end_date, payroll_period.start_date) + 1
total_sub_periods = flt(<API key>) / flt(salary_days)
<API key> = date_diff(period_end, start_date) + 1
<API key> = flt(<API key>) / flt(salary_days)
return total_sub_periods, <API key> |
import React from 'react'
import PropTypes from 'prop-types'
import { Field } from 'components/Forms'
import DiagramField from './DiagramField'
class CampaignDiagram extends React.Component {
render () {
const { campaign } = this.props
return (
<Field
name='campaign.diagram'
defaultValue={JSON.stringify(campaign.diagram)}
component={DiagramField}
/>
)
}
}
CampaignDiagram.propTypes = {
campaign: PropTypes.object.isRequired
}
export default CampaignDiagram |
package com.procedures;
public class ByteBuilder {
public ByteBuilder(int capacity) {
array = new byte[capacity];
}
public void append(byte[] data, int offset, int length) {
for (int i = offset; i < offset + length; ++i) {
array[position] = data[i];
position += 1;
}
}
public void append(byte[] data) { append(data, 0, data.length); }
public byte[] array() { return array; }
private final byte[] array;
private int position = 0;
} |
<?php
$mess=array(
"Authentication One-time-password" => "Autenticazione One-Time-Password",
"Use Google Authenticator, Yubikey or standard password to authenticate users." => "Usa Google Authenticator, Yubikey o altre password standard per autenticare gli utenti.",
"Order" => "Ordine",
"Order this plugin with other auth frontends" => "Ordina questo plugin rispetto agli altri frontend di autenticazione",
"Protocol Type" => "Tipo Protocollo",
"Enable/disable automatically based on the protocol used" => "Abilita/Disabilita automaticamente in base al protocollo in uso",
"Sessions Only" => "Solo Sessioni",
"Modify login page" => "Modifica pagina di login",
"Login page will be modified to give user a OTP textbox." => "La pagina di login verrà modificata per mostrare all'utente un campo per l'OTP",
"Yubico Secret Key" => "Chiave Segreta Yubico",
"Yubico secret key attached to your account" => "Chiave segreta collegata al tuo account Yubico",
"Yubico Client ID" => "ID Client Yubico",
"Yubico client id attached to your account" => "Client ID collegato al tuo account Yubico",
"General" => "General",
"YubiKey 1" => "YubiKey 1",
"YubiKey 2" => "YubiKey 2",
"Google Authenticator" => "Google Authenticator",
"Google Authenticator Secret" => "Google Authenticator Secret",
"Google Authenticator Last" => "Google Authenticator Last",
"Google Authenticator replay protection, do not edit" => "Google Authenticator replay protection, do not edit",
); |
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.utils import flt, get_datetime, format_datetime
class <API key>(frappe.ValidationError): pass
def validate_return(doc):
if not doc.meta.get_field("is_return") or not doc.is_return:
return
<API key>(doc)
<API key>(doc)
def <API key>(doc):
if not doc.return_against:
frappe.throw(_("{0} is mandatory for Return").format(doc.meta.get_label("return_against")))
else:
filters = {"doctype": doc.doctype, "docstatus": 1, "company": doc.company}
if doc.meta.get_field("customer"):
filters["customer"] = doc.customer
elif doc.meta.get_field("supplier"):
filters["supplier"] = doc.supplier
if not frappe.db.exists(filters):
frappe.throw(_("Invalid {0}: {1}")
.format(doc.meta.get_label("return_against"), doc.return_against))
else:
ref_doc = frappe.get_doc(doc.doctype, doc.return_against)
# validate posting date time
<API key> = "%s %s" % (doc.posting_date, doc.get("posting_time") or "00:00:00")
<API key> = "%s %s" % (ref_doc.posting_date, ref_doc.get("posting_time") or "00:00:00")
if get_datetime(<API key>) < get_datetime(<API key>):
frappe.throw(_("Posting timestamp must be after {0}").format(format_datetime(<API key>)))
# validate same exchange rate
if doc.conversion_rate != ref_doc.conversion_rate:
frappe.throw(_("Exchange Rate must be same as {0} {1} ({2})")
.format(doc.doctype, doc.return_against, ref_doc.conversion_rate))
# validate update stock
if doc.doctype == "Sales Invoice" and doc.update_stock and not ref_doc.update_stock:
frappe.throw(_("'Update Stock' can not be checked because items are not delivered via {0}")
.format(doc.return_against))
def <API key>(doc):
from erpnext.stock.doctype.serial_no.serial_no import get_serial_nos
valid_items = frappe._dict()
select_fields = "item_code, qty" if doc.doctype=="Purchase Invoice" \
else "item_code, qty, serial_no, batch_no"
for d in frappe.db.sql("""select {0} from `tab{1} Item` where parent = %s"""
.format(select_fields, doc.doctype), doc.return_against, as_dict=1):
valid_items = get_ref_item_dict(valid_items, d)
if doc.doctype in ("Delivery Note", "Sales Invoice"):
for d in frappe.db.sql("""select item_code, qty, serial_no, batch_no from `tabPacked Item`
where parent = %s""".format(doc.doctype), doc.return_against, as_dict=1):
valid_items = get_ref_item_dict(valid_items, d)
<API key> = <API key>(doc)
# ( not mandatory when it is Purchase Invoice or a Sales Invoice without Update Stock )
warehouse_mandatory = not (doc.doctype=="Purchase Invoice" or (doc.doctype=="Sales Invoice" and not doc.update_stock))
items_returned = False
for d in doc.get("items"):
if flt(d.qty) < 0:
if d.item_code not in valid_items:
frappe.throw(_("Row # {0}: Returned Item {1} does not exists in {2} {3}")
.format(d.idx, d.item_code, doc.doctype, doc.return_against))
else:
ref = valid_items.get(d.item_code, frappe._dict())
<API key> = flt(<API key>.get(d.item_code))
max_return_qty = flt(ref.qty) - <API key>
if <API key> >= ref.qty:
frappe.throw(_("Item {0} has already been returned").format(d.item_code), <API key>)
elif abs(d.qty) > max_return_qty:
frappe.throw(_("Row # {0}: Cannot return more than {1} for Item {2}")
.format(d.idx, ref.qty, d.item_code), <API key>)
elif ref.batch_no and d.batch_no not in ref.batch_no:
frappe.throw(_("Row # {0}: Batch No must be same as {1} {2}")
.format(d.idx, doc.doctype, doc.return_against))
elif ref.serial_no:
if not d.serial_no:
frappe.throw(_("Row # {0}: Serial No is mandatory").format(d.idx))
else:
serial_nos = get_serial_nos(d.serial_no)
for s in serial_nos:
if s not in ref.serial_no:
frappe.throw(_("Row # {0}: Serial No {1} does not match with {2} {3}")
.format(d.idx, s, doc.doctype, doc.return_against))
if warehouse_mandatory and not d.get("warehouse"):
frappe.throw(_("Warehouse is mandatory"))
items_returned = True
if not items_returned:
frappe.throw(_("Atleast one item should be entered with negative quantity in return document"))
def get_ref_item_dict(valid_items, ref_item_row):
from erpnext.stock.doctype.serial_no.serial_no import get_serial_nos
valid_items.setdefault(ref_item_row.item_code, frappe._dict({
"qty": 0,
"serial_no": [],
"batch_no": []
}))
item_dict = valid_items[ref_item_row.item_code]
item_dict["qty"] += ref_item_row.qty
if ref_item_row.get("serial_no"):
item_dict["serial_no"] += get_serial_nos(ref_item_row.serial_no)
if ref_item_row.get("batch_no"):
item_dict["batch_no"].append(ref_item_row.batch_no)
return valid_items
def <API key>(doc):
return frappe._dict(frappe.db.sql("""
select
child.item_code, sum(abs(child.qty)) as qty
from
`tab{0} Item` child, `tab{1}` par
where
child.parent = par.name and par.docstatus = 1
and par.is_return = 1 and par.return_against = %s and child.qty < 0
group by item_code
""".format(doc.doctype, doc.doctype), doc.return_against))
def make_return_doc(doctype, source_name, target_doc=None):
from frappe.model.mapper import get_mapped_doc
def set_missing_values(source, target):
doc = frappe.get_doc(target)
doc.is_return = 1
doc.return_against = source.name
doc.ignore_pricing_rule = 1
if doctype == "Sales Invoice":
doc.is_pos = 0
# look for Print Heading "Credit Note"
if not doc.<API key>:
doc.<API key> = frappe.db.get_value("Print Heading", _("Credit Note"))
elif doctype == "Purchase Invoice":
# look for Print Heading "Debit Note"
doc.<API key> = frappe.db.get_value("Print Heading", _("Debit Note"))
for tax in doc.get("taxes"):
if tax.charge_type == "Actual":
tax.tax_amount = -1 * tax.tax_amount
doc.run_method("<API key>")
def update_item(source_doc, target_doc, source_parent):
target_doc.qty = -1* source_doc.qty
if doctype == "Purchase Receipt":
target_doc.received_qty = -1* source_doc.qty
target_doc.prevdoc_doctype = source_doc.prevdoc_doctype
target_doc.prevdoc_docname = source_doc.prevdoc_docname
target_doc.<API key> = source_doc.<API key>
elif doctype == "Purchase Invoice":
target_doc.purchase_order = source_doc.purchase_order
target_doc.purchase_receipt = source_doc.purchase_receipt
target_doc.po_detail = source_doc.po_detail
target_doc.pr_detail = source_doc.pr_detail
elif doctype == "Delivery Note":
target_doc.against_sales_order = source_doc.against_sales_order
target_doc.<API key> = source_doc.<API key>
target_doc.so_detail = source_doc.so_detail
target_doc.si_detail = source_doc.si_detail
target_doc.expense_account = source_doc.expense_account
elif doctype == "Sales Invoice":
target_doc.sales_order = source_doc.sales_order
target_doc.delivery_note = source_doc.delivery_note
target_doc.so_detail = source_doc.so_detail
target_doc.dn_detail = source_doc.dn_detail
target_doc.expense_account = source_doc.expense_account
doclist = get_mapped_doc(doctype, source_name, {
doctype: {
"doctype": doctype,
"validation": {
"docstatus": ["=", 1],
}
},
doctype +" Item": {
"doctype": doctype + " Item",
"field_map": {
"serial_no": "serial_no",
"batch_no": "batch_no"
},
"postprocess": update_item
},
}, target_doc, set_missing_values)
return doclist |
'use strict';
var expect = require('chai').expect;
var FileDemuxer = require('../../lib/file-handling/file-demuxer');
var stream = require('readable-stream');
var noisegen = require('noisegen');
var os = require('os');
var fs = require('fs');
var path = require('path');
var utils = require('../../lib/utils');
var TMP_DIR = path.join(os.tmpdir(), '<API key>');
var filePathEven = path.join(TMP_DIR, '<API key>.data');
var filePathOdd = path.join(TMP_DIR, '<API key>.data');
var filePathEmpty = path.join(TMP_DIR, '<API key>.data');
var rimraf = require('rimraf');
var mkdirp = require('mkdirp');
var proxyquire = require('proxyquire');
describe('FileDemuxer', function() {
before(function(done) {
this.timeout(6000);
if (utils.existsSync(TMP_DIR)) {
rimraf.sync(TMP_DIR);
}
mkdirp.sync(TMP_DIR);
var randomEven = noisegen({ length: 1024 * 1024 * 8 });
var tmpfile = fs.createWriteStream(filePathEven);
tmpfile.on('finish', function() {
var randomOdd = noisegen({ length: (1024 * 1024 * 16) + 512 });
var tmpfile = fs.createWriteStream(filePathOdd);
tmpfile.on('finish', done);
randomOdd.pipe(tmpfile);
});
randomEven.pipe(tmpfile);
});
after(function() {
rimraf.sync(TMP_DIR);
});
describe('@constructor', function() {
it('should create an instance with the new keyword', function() {
expect(new FileDemuxer(filePathEven)).to.be.instanceOf(FileDemuxer);
});
it('should create an instance without the new keyword', function() {
expect(FileDemuxer(filePathEven)).to.be.instanceOf(FileDemuxer);
});
it('should gracefully handle errors when reading from fs', function(done) {
var dmux = new FileDemuxer(filePathEven);
dmux.on('error', function(err) {
expect(err.message).to.equal('HDD FAILING! WUT DO?!?');
done();
});
dmux._source.emit('error', new Error('HDD FAILING! WUT DO?!?'));
});
});
describe('#event:shard', function() {
it('should correctly demux the even file stream', function(done) {
this.timeout(6000);
var dmx = new FileDemuxer(filePathEven);
var shards = 0; // eslint-disable-line no-unused-vars
var bytes = 0;
dmx.on('shard', function(shard) {
shards++;
expect(shard).to.be.instanceOf(stream.Readable);
shard.on('data', function(data) {
bytes += data.length;
});
});
dmx.on('finish', function() {
expect(bytes).to.equal(1024 * 1024 * 8);
done();
});
});
it('should correctly demux the odd file stream', function(done) {
this.timeout(6000);
var dmx = new FileDemuxer(filePathOdd);
var shards = 0;
dmx.on('shard', function(shard) {
expect(shard).to.be.instanceOf(stream.Readable);
var bytes = 0;
shard.on('data', function(data) {
bytes += data.length;
});
shard.on('end', function() {
shards++;
if (shards === 1) {
expect(bytes).to.equal(FileDemuxer.DEFAULTS.shardSize);
} else if (shards === 3) {
expect(bytes).to.equal(512);
done();
}
});
});
});
it('should emit an error if file size is 0B', function(done) {
this.timeout(6000);
fs.closeSync(fs.openSync(filePathEmpty, 'w'));
var dmx = new FileDemuxer(filePathEmpty);
dmx.on('error', function(err) {
expect(err.message).to.equal('File size cannot be 0 Bytes.');
done();
});
});
});
});
describe('FileDemuxer#getOptimalShardSize', function() {
var FileDemuxerStub = proxyquire('../../lib/file-handling/file-demuxer', {
'os': {
freemem: function() {
return 1024 * (1024 * 1024); //1GB of memory
}
}
});
it('should return 8 for 8', function() {
expect(
FileDemuxerStub.getOptimalShardSize(
{
fileSize: 3 * (1024 * 1024),
shardConcurrency: 3
}
)
).to.equal(8 * (1024 * 1024));
});
it('should return 8 for 16', function() {
expect(
FileDemuxerStub.getOptimalShardSize(
{
fileSize: 16 * (1024 * 1024),
shardConcurrency: 3
}
)
).to.equal(8 * (1024 * 1024));
});
it('should return 8 for 32', function() {
expect(
FileDemuxerStub.getOptimalShardSize(
{
fileSize: 32 * (1024 * 1024),
shardConcurrency: 3
}
)
).to.equal(8 * (1024 * 1024));
});
it('should return 8 for 64', function() {
expect(
FileDemuxerStub.getOptimalShardSize(
{
fileSize: 64 * (1024 * 1024),
shardConcurrency: 3
}
)
).to.equal(8 * (1024 * 1024));
});
it('should return 8 for 128', function() {
expect(
FileDemuxerStub.getOptimalShardSize(
{
fileSize: 128 * (1024 * 1024),
shardConcurrency: 3
}
)
).to.equal(8 * (1024 * 1024));
});
it('should return 16 for 256', function() {
expect(
FileDemuxerStub.getOptimalShardSize(
{
fileSize: 256 * (1024 * 1024),
shardConcurrency: 3
}
)
).to.equal(16 * (1024 * 1024));
});
it('should return 32 for 512', function() {
expect(
FileDemuxerStub.getOptimalShardSize(
{
fileSize: 512 * (1024 * 1024),
shardConcurrency: 3
}
)
).to.equal(32 * (1024 * 1024));
});
it('should return 64 for 1024', function() {
expect(
FileDemuxerStub.getOptimalShardSize(
{
fileSize: 1024 * (1024 * 1024),
shardConcurrency: 3
}
)
).to.equal(64 * (1024 * 1024));
});
it('should return 128 for 2048', function() {
expect(
FileDemuxerStub.getOptimalShardSize(
{
fileSize: 2048 * (1024 * 1024),
shardConcurrency: 3
}
)
).to.equal(128 * (1024 * 1024));
});
it('should return 256 for 4096', function() {
expect(
FileDemuxerStub.getOptimalShardSize(
{
fileSize: 4096 * (1024 * 1024),
shardConcurrency: 3
}
)
).to.equal(256 * (1024 * 1024));
});
it('should return 8 for 4096 if only 16MB of memory', function() {
var LowMemDemuxer = proxyquire('../../lib/file-handling/file-demuxer', {
'os': {
freemem: function() {
return 16 * (1024 * 1024); // 16MB of memory
}
}
});
expect(
LowMemDemuxer.getOptimalShardSize(
{
fileSize: 4096 * (1024 * 1024),
shardConcurrency: 3
}
)
).to.equal(8 * (1024 * 1024));
});
}); |
/*can@2.2.9#map/list/list*/
define([
'can/util/library',
'can/map',
'can/list',
'can/compute'
], function (can) {
can.extend(can.List.prototype, {
filter: function (callback) {
var filtered = new this.constructor();
var self = this;
var generator = function (element, index) {
var binder = function (ev, val) {
var index = filtered.indexOf(element);
if (!val && index !== -1) {
filtered.splice(index, 1);
}
if (val && index === -1) {
filtered.push(element);
}
};
var compute = can.compute(function () {
return callback(element, self.indexOf(element), self);
});
compute.bind('change', binder);
binder(null, compute());
};
this.bind('add', function (ev, data, index) {
can.each(data, function (element, i) {
generator(element, index + i);
});
});
this.bind('remove', function (ev, data, index) {
can.each(data, function (element, i) {
var index = filtered.indexOf(element);
if (index !== -1) {
filtered.splice(index, 1);
}
});
});
this.forEach(generator);
return filtered;
},
map: function (callback) {
var mapped = new can.List();
var self = this;
var generator = function (element, index) {
var compute = can.compute(function () {
return callback(element, index, self);
});
compute.bind('change', function (ev, val) {
mapped.splice(index, 1, val);
});
mapped.splice(index, 0, compute());
};
this.forEach(generator);
this.bind('add', function (ev, data, index) {
can.each(data, function (element, i) {
generator(element, index + i);
});
});
this.bind('remove', function (ev, data, index) {
mapped.splice(index, data.length);
});
return mapped;
}
});
return can.List;
}); |
'use strict';
import '../../modules/pareto.src.js'; |
package com.rapidminer.operator.generator;
import java.util.HashSet;
import java.util.Set;
import com.rapidminer.example.Attribute;
import com.rapidminer.example.table.AttributeFactory;
import com.rapidminer.tools.Ontology;
import com.rapidminer.tools.RandomGenerator;
/**
* Generates a data set for two attributes. The data build two spiral
* functions around the origin up to a maximal radius.
*
* @author Ingo Mierswa
*/
public class <API key> extends ClusterFunction {
/** The number of turns. */
private static final int NUMBER_OF_TURNS = 3;
/** The offset for the spiral angle. */
private static final double ANGLE_OFFSET = 3.0d * Math.PI / 2.0d;
/** The angle factor. */
private static final double ANGLE_FACTOR = 2 * Math.PI;
/** The radius factor for the second spiral. */
private static final double RADIUS_OFFSET = 2.0d;
/** The maximal radius of the spiral. */
private double bound = 10.0d;
/** The current number. */
private int currentNumber = 0;
/** The currently used angle phi. */
private double currentPhi = 0.0d;
/** The angle delta which is added for each iteration. */
private double deltaPhi;
/** The current radius factor. */
private double currentRadiusOffset = 0.0d;
/** The currently used label. */
private double currentLabel;
/** The label attribute. */
Attribute label = AttributeFactory.createAttribute("label", Ontology.NOMINAL);
public <API key>() {
label.getMapping().mapString("spiral1");
label.getMapping().mapString("spiral2");
}
/** Does nothing. */
public void init(RandomGenerator random) {
this.currentPhi = ANGLE_OFFSET;
this.deltaPhi = (NUMBER_OF_TURNS * ANGLE_FACTOR - ANGLE_OFFSET) / (this.numberOfExamples / 2.0d);
this.currentNumber = 0;
this.currentRadiusOffset = 0.0d;
this.currentLabel = getLabel().getMapping().mapString("spiral1");
}
public Attribute getLabel() {
return label;
}
public double calculate(double[] att) throws FunctionException {
return currentLabel;
}
public double[] createArguments(int number, RandomGenerator random) throws FunctionException {
if (number != 2)
throw new FunctionException("Ring clustering function", "must have 2 attributes!");
double[] args = new double[number];
if (currentNumber == numberOfExamples / 2) {
currentPhi = ANGLE_OFFSET;
currentRadiusOffset = RADIUS_OFFSET;
currentLabel = getLabel().getMapping().mapString("spiral2");
}
currentPhi += deltaPhi;
double r = bound * currentPhi / (ANGLE_FACTOR * NUMBER_OF_TURNS - ANGLE_OFFSET) - currentRadiusOffset;
args[0] = Math.cos(currentPhi) * r + random.nextGaussian() * 0.1d;
args[1] = Math.sin(currentPhi) * r + random.nextGaussian() * 0.1d;
currentNumber++;
return args;
}
@Override
protected Set<String> getClusterSet() {
HashSet<String> clusters = new HashSet<String>();
clusters.add("spiral1");
clusters.add("spiral2");
return clusters;
}
@Override
public int <API key>() {
return 2;
}
@Override
public int <API key>() {
return 2;
}
} |
# Alces HPC Software Toolkit #
# This file/package is part of Symphony #
# Symphony is free software: you can redistribute it and/or modify it under #
# any later version. #
# Symphony is distributed in the hope that it will be useful, but WITHOUT #
# for more details. #
# For more information on the Symphony Toolkit, please visit: #
require 'alces/stack/hunter/cli'
require 'alces/stack/hunter/listener'
module Alces
module Stack
module Hunter
class << self
def listen!(*args)
Listener.new(*args).listen!
end
end
end
end
end |
//
//
//
//
//# This program is free software: you can redistribute it and/or modify #
//
//# published by the Free Software Foundation, either version 3 of the #
//
//
//# This program is distributed in the hope that it will be useful, #
//
//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
//
//
//
//
//
//# IMS MAXIMS provides absolutely NO GUARANTEE OF THE CLINICAL SAFTEY of #
//# this program. Users of this software do so entirely at their own risk. #
//# IMS MAXIMS only ensures the Clinical Safety of unaltered run-time #
//# software that it builds, deploys and maintains. #
//
//
//#EOH
// This code was generated by Barbara Worwood using IMS Development Environment (version 1.80 build 5589.25814)
// WARNING: DO NOT MODIFY the content of this file
package ims.admin.forms.<API key>;
public interface IFormUILogicCode
{
// No methods yet.
} |
<?php
function <API key>() {
$user = Users::loggedInUser();
// don't save stats for non logged user
if (!$user) {
return;
}
$required = array("publisherId" => null, "streamName" => null, "metrics" => null, "minPeriod" => null);
Q_Valid::requireFields(array_keys($required), $_REQUEST, true);
$request = Q::take($_REQUEST, $required);
foreach (array_keys($required) as $field) {
if(empty($request[$field])) {
throw new <API key>(array('field' => $field, 'range' => "not empty"));
}
}
$minPeriod = $request["minPeriod"];
$row = new Streams_Metrics();
$row->userId = $user->id;
$row->publisherId = $request["publisherId"];
$row->streamName = $request["streamName"];
if (!$row->retrieve()) {
$row->save();
$row->metrics = null;
}
if (empty($row->metrics)) {
$row->metrics = Q::json_encode($request["metrics"]);
} else {
$metrics = Q::json_decode($row->metrics, true);
foreach ($request["metrics"] as $reqMetric) {
if (sizeof($reqMetric) == 1) {
continue;
}
$reqStart = (float)$reqMetric[0];
$reqEnd = (float)$reqMetric[1];
$used = false;
foreach ($metrics as $i => $rowMetric) {
$rowStart = (float)$rowMetric[0];
$rowEnd = (float)$rowMetric[1];
// this period already stored
if ($reqStart >= $rowStart - $minPeriod && $reqEnd <= $rowEnd + $minPeriod) {
if ($reqStart < $rowStart) {
$metrics[$i][0] = $reqStart;
}
if ($reqEnd > $rowEnd) {
$metrics[$i][1] = $reqEnd;
}
$used = true;
}
// this period completely overlaps stored period, so just replace
elseif ($reqStart < $rowStart && $reqEnd > $rowEnd) {
$metrics[$i] = $reqMetric;
$used = true;
}
// this period overlaps stored period before start, so change start of period
elseif ($reqStart < $rowStart - $minPeriod && $rowStart - $minPeriod < $reqEnd && $reqEnd <= $rowEnd + $minPeriod) {
$metrics[$i][0] = $reqStart;
$used = true;
}
// this period overlaps stored period from end, so change end of period
elseif ($reqStart >= $rowStart - $minPeriod && $reqStart < $rowEnd + $minPeriod && $reqEnd > $rowEnd + $minPeriod) {
$metrics[$i][1] = $reqEnd;
$used = true;
}
}
// this is new period
if (!$used) {
$metrics[] = $reqMetric;
}
}
$row->metrics = Q::json_encode($metrics);
}
$row->save();
} |
package org.opennms.plugins.elasticsearch.rest.bulk;
import java.util.ArrayList;
import java.util.List;
import io.searchbox.action.BulkableAction;
import io.searchbox.core.Bulk;
public class BulkWrapper extends Bulk {
public BulkWrapper(Builder builder) {
super(builder);
}
public List<BulkableAction> getActions() {
return new ArrayList<>(bulkableActions);
}
public int size() {
return bulkableActions.size();
}
public boolean isEmpty() {
return bulkableActions.isEmpty();
}
} |
//
//
//
//
//# This program is free software: you can redistribute it and/or modify #
//
//# published by the Free Software Foundation, either version 3 of the #
//
//
//# This program is distributed in the hope that it will be useful, #
//
//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
//
//
//
//
//
//# IMS MAXIMS provides absolutely NO GUARANTEE OF THE CLINICAL SAFTEY of #
//# this program. Users of this software do so entirely at their own risk. #
//# IMS MAXIMS only ensures the Clinical Safety of unaltered run-time #
//# software that it builds, deploys and maintains. #
//
//
//#EOH
// This code was generated by Barbara Worwood using IMS Development Environment (version 1.80 build 5589.25814)
// WARNING: DO NOT MODIFY the content of this file
package ims.RefMan.vo;
/**
* Linked to Pathways.<API key> business object (ID: 1088100014).
*/
public class <API key> extends ims.pathways.vo.<API key> implements ims.vo.ImsCloneable, Comparable
{
private static final long serialVersionUID = 1L;
public <API key>()
{
}
public <API key>(Integer id, int version)
{
super(id, version);
}
public <API key>(ims.RefMan.vo.beans.<API key> bean)
{
this.id = bean.getId();
this.version = bean.getVersion();
this.breachreason = bean.getBreachReason() == null ? null : ims.pathways.vo.lookups.<API key>.buildLookup(bean.getBreachReason());
this.breachreasoncomment = bean.<API key>();
this.breachreasondate = bean.getBreachReasonDate() == null ? null : bean.getBreachReasonDate().buildDateTime();
this.<API key> = bean.<API key>() == null ? null : bean.<API key>().buildVo();
this.correctioncomments = bean.<API key>();
this.<API key> = bean.<API key>() == null ? null : bean.<API key>().buildVo();
this.corrected = bean.getCorrected();
}
public void populate(ims.vo.ValueObjectBeanMap map, ims.RefMan.vo.beans.<API key> bean)
{
this.id = bean.getId();
this.version = bean.getVersion();
this.breachreason = bean.getBreachReason() == null ? null : ims.pathways.vo.lookups.<API key>.buildLookup(bean.getBreachReason());
this.breachreasoncomment = bean.<API key>();
this.breachreasondate = bean.getBreachReasonDate() == null ? null : bean.getBreachReasonDate().buildDateTime();
this.<API key> = bean.<API key>() == null ? null : bean.<API key>().buildVo(map);
this.correctioncomments = bean.<API key>();
this.<API key> = bean.<API key>() == null ? null : bean.<API key>().buildVo(map);
this.corrected = bean.getCorrected();
}
public ims.vo.ValueObjectBean getBean()
{
return this.getBean(new ims.vo.ValueObjectBeanMap());
}
public ims.vo.ValueObjectBean getBean(ims.vo.ValueObjectBeanMap map)
{
ims.RefMan.vo.beans.<API key> bean = null;
if(map != null)
bean = (ims.RefMan.vo.beans.<API key>)map.getValueObjectBean(this);
if (bean == null)
{
bean = new ims.RefMan.vo.beans.<API key>();
map.addValueObjectBean(this, bean);
bean.populate(map, this);
}
return bean;
}
public Object <API key>(String fieldName)
{
if(fieldName == null)
throw new ims.framework.exceptions.<API key>("Invalid field name");
fieldName = fieldName.toUpperCase();
if(fieldName.equals("BREACHREASON"))
return getBreachReason();
if(fieldName.equals("BREACHREASONCOMMENT"))
return <API key>();
if(fieldName.equals("BREACHREASONDATE"))
return getBreachReasonDate();
if(fieldName.equals("<API key>"))
return <API key>();
if(fieldName.equals("CORRECTIONCOMMENTS"))
return <API key>();
if(fieldName.equals("<API key>"))
return <API key>();
if(fieldName.equals("CORRECTED"))
return getCorrected();
return super.<API key>(fieldName);
}
public boolean <API key>()
{
return this.breachreason != null;
}
public ims.pathways.vo.lookups.<API key> getBreachReason()
{
return this.breachreason;
}
public void setBreachReason(ims.pathways.vo.lookups.<API key> value)
{
this.isValidated = false;
this.breachreason = value;
}
public boolean <API key>()
{
return this.breachreasoncomment != null;
}
public String <API key>()
{
return this.breachreasoncomment;
}
public static int <API key>()
{
return 5000;
}
public void <API key>(String value)
{
this.isValidated = false;
this.breachreasoncomment = value;
}
public boolean <API key>()
{
return this.breachreasondate != null;
}
public ims.framework.utils.DateTime getBreachReasonDate()
{
return this.breachreasondate;
}
public void setBreachReasonDate(ims.framework.utils.DateTime value)
{
this.isValidated = false;
this.breachreasondate = value;
}
public boolean <API key>()
{
return this.<API key> != null;
}
public ims.core.vo.MemberOfStaffLiteVo <API key>()
{
return this.<API key>;
}
public void <API key>(ims.core.vo.MemberOfStaffLiteVo value)
{
this.isValidated = false;
this.<API key> = value;
}
public boolean <API key>()
{
return this.correctioncomments != null;
}
public String <API key>()
{
return this.correctioncomments;
}
public static int <API key>()
{
return 5000;
}
public void <API key>(String value)
{
this.isValidated = false;
this.correctioncomments = value;
}
public boolean getCorrection<API key>()
{
return this.<API key> != null;
}
public ims.core.vo.<API key> <API key>()
{
return this.<API key>;
}
public void <API key>(ims.core.vo.<API key> value)
{
this.isValidated = false;
this.<API key> = value;
}
public boolean <API key>()
{
return this.corrected != null;
}
public Boolean getCorrected()
{
return this.corrected;
}
public void setCorrected(Boolean value)
{
this.isValidated = false;
this.corrected = value;
}
public boolean isValidated()
{
if(this.isBusy)
return true;
this.isBusy = true;
if(!this.isValidated)
{
this.isBusy = false;
return false;
}
if(this.<API key> != null)
{
if(!this.<API key>.isValidated())
{
this.isBusy = false;
return false;
}
}
if(this.<API key> != null)
{
if(!this.<API key>.isValidated())
{
this.isBusy = false;
return false;
}
}
this.isBusy = false;
return true;
}
public String[] validate()
{
return validate(null);
}
public String[] validate(String[] existingErrors)
{
if(this.isBusy)
return null;
this.isBusy = true;
java.util.ArrayList<String> listOfErrors = new java.util.ArrayList<String>();
if(existingErrors != null)
{
for(int x = 0; x < existingErrors.length; x++)
{
listOfErrors.add(existingErrors[x]);
}
}
if(this.<API key> != null)
{
String[] listOfOtherErrors = this.<API key>.validate();
if(listOfOtherErrors != null)
{
for(int x = 0; x < listOfOtherErrors.length; x++)
{
listOfErrors.add(listOfOtherErrors[x]);
}
}
}
if(this.<API key> != null)
{
String[] listOfOtherErrors = this.<API key>.validate();
if(listOfOtherErrors != null)
{
for(int x = 0; x < listOfOtherErrors.length; x++)
{
listOfErrors.add(listOfOtherErrors[x]);
}
}
}
int errorCount = listOfErrors.size();
if(errorCount == 0)
{
this.isBusy = false;
this.isValidated = true;
return null;
}
String[] result = new String[errorCount];
for(int x = 0; x < errorCount; x++)
result[x] = (String)listOfErrors.get(x);
this.isBusy = false;
this.isValidated = false;
return result;
}
public void clearIDAndVersion()
{
this.id = null;
this.version = 0;
}
public Object clone()
{
if(this.isBusy)
return this;
this.isBusy = true;
<API key> clone = new <API key>(this.id, this.version);
if(this.breachreason == null)
clone.breachreason = null;
else
clone.breachreason = (ims.pathways.vo.lookups.<API key>)this.breachreason.clone();
clone.breachreasoncomment = this.breachreasoncomment;
if(this.breachreasondate == null)
clone.breachreasondate = null;
else
clone.breachreasondate = (ims.framework.utils.DateTime)this.breachreasondate.clone();
if(this.<API key> == null)
clone.<API key> = null;
else
clone.<API key> = (ims.core.vo.MemberOfStaffLiteVo)this.<API key>.clone();
clone.correctioncomments = this.correctioncomments;
if(this.<API key> == null)
clone.<API key> = null;
else
clone.<API key> = (ims.core.vo.<API key>)this.<API key>.clone();
clone.corrected = this.corrected;
clone.isValidated = this.isValidated;
this.isBusy = false;
return clone;
}
public int compareTo(Object obj)
{
return compareTo(obj, true);
}
public int compareTo(Object obj, boolean caseInsensitive)
{
if (obj == null)
{
return -1;
}
if(caseInsensitive); // this is to avoid eclipse warning only.
if (!(<API key>.class.isAssignableFrom(obj.getClass())))
{
throw new ClassCastException("A <API key> object cannot be compared an Object of type " + obj.getClass().getName());
}
if (this.id == null)
return 1;
if (((<API key>)obj).getBoId() == null)
return -1;
return this.id.compareTo(((<API key>)obj).getBoId());
}
public synchronized static int <API key>()
{
return ims.vo.ValueObject.generateUniqueID();
}
public int <API key>()
{
int count = 0;
if(this.breachreason != null)
count++;
if(this.breachreasoncomment != null)
count++;
if(this.breachreasondate != null)
count++;
if(this.<API key> != null)
count++;
if(this.correctioncomments != null)
count++;
if(this.<API key> != null)
count++;
if(this.corrected != null)
count++;
return count;
}
public int <API key>()
{
return 7;
}
protected ims.pathways.vo.lookups.<API key> breachreason;
protected String breachreasoncomment;
protected ims.framework.utils.DateTime breachreasondate;
protected ims.core.vo.MemberOfStaffLiteVo <API key>;
protected String correctioncomments;
protected ims.core.vo.<API key> <API key>;
protected Boolean corrected;
private boolean isValidated = false;
private boolean isBusy = false;
} |
//
//
//
//
//# This program is free software: you can redistribute it and/or modify #
//
//# published by the Free Software Foundation, either version 3 of the #
//
//
//# This program is distributed in the hope that it will be useful, #
//
//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
//
//
//
//
//
//# IMS MAXIMS provides absolutely NO GUARANTEE OF THE CLINICAL SAFTEY of #
//# this program. Users of this software do so entirely at their own risk. #
//# IMS MAXIMS only ensures the Clinical Safety of unaltered run-time #
//# software that it builds, deploys and maintains. #
//
//
//#EOH
// This code was generated by Barbara Worwood using IMS Development Environment (version 1.80 build 5589.25814)
// WARNING: DO NOT MODIFY the content of this file
package ims.RefMan.vo;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.Iterator;
import ims.framework.enumerations.SortOrder;
/**
* Linked to core.clinical.<API key> business object (ID: 1003100093).
*/
public class <API key> extends ims.vo.<API key> implements ims.vo.ImsCloneable, Iterable<<API key>>
{
private static final long serialVersionUID = 1L;
private ArrayList<<API key>> col = new ArrayList<<API key>>();
public String getBoClassName()
{
return "ims.core.clinical.domain.objects.<API key>";
}
public boolean add(<API key> value)
{
if(value == null)
return false;
if(this.col.indexOf(value) < 0)
{
return this.col.add(value);
}
return false;
}
public boolean add(int index, <API key> value)
{
if(value == null)
return false;
if(this.col.indexOf(value) < 0)
{
this.col.add(index, value);
return true;
}
return false;
}
public void clear()
{
this.col.clear();
}
public void remove(int index)
{
this.col.remove(index);
}
public int size()
{
return this.col.size();
}
public int indexOf(<API key> instance)
{
return col.indexOf(instance);
}
public <API key> get(int index)
{
return this.col.get(index);
}
public boolean set(int index, <API key> value)
{
if(value == null)
return false;
this.col.set(index, value);
return true;
}
public void remove(<API key> instance)
{
if(instance != null)
{
int index = indexOf(instance);
if(index >= 0)
remove(index);
}
}
public boolean contains(<API key> instance)
{
return indexOf(instance) >= 0;
}
public Object clone()
{
<API key> clone = new <API key>();
for(int x = 0; x < this.col.size(); x++)
{
if(this.col.get(x) != null)
clone.col.add((<API key>)this.col.get(x).clone());
else
clone.col.add(null);
}
return clone;
}
public boolean isValidated()
{
for(int x = 0; x < col.size(); x++)
if(!this.col.get(x).isValidated())
return false;
return true;
}
public String[] validate()
{
return validate(null);
}
public String[] validate(String[] existingErrors)
{
if(col.size() == 0)
return null;
java.util.ArrayList<String> listOfErrors = new java.util.ArrayList<String>();
if(existingErrors != null)
{
for(int x = 0; x < existingErrors.length; x++)
{
listOfErrors.add(existingErrors[x]);
}
}
for(int x = 0; x < col.size(); x++)
{
String[] listOfOtherErrors = this.col.get(x).validate();
if(listOfOtherErrors != null)
{
for(int y = 0; y < listOfOtherErrors.length; y++)
{
listOfErrors.add(listOfOtherErrors[y]);
}
}
}
int errorCount = listOfErrors.size();
if(errorCount == 0)
return null;
String[] result = new String[errorCount];
for(int x = 0; x < errorCount; x++)
result[x] = (String)listOfErrors.get(x);
return result;
}
public <API key> sort()
{
return sort(SortOrder.ASCENDING);
}
public <API key> sort(boolean caseInsensitive)
{
return sort(SortOrder.ASCENDING, caseInsensitive);
}
public <API key> sort(SortOrder order)
{
return sort(new <API key>(order));
}
public <API key> sort(SortOrder order, boolean caseInsensitive)
{
return sort(new <API key>(order, caseInsensitive));
}
@SuppressWarnings("unchecked")
public <API key> sort(Comparator comparator)
{
Collections.sort(col, comparator);
return this;
}
public ims.core.clinical.vo.<API key> toRefVoCollection()
{
ims.core.clinical.vo.<API key> result = new ims.core.clinical.vo.<API key>();
for(int x = 0; x < this.col.size(); x++)
{
result.add(this.col.get(x));
}
return result;
}
public <API key>[] toArray()
{
<API key>[] arr = new <API key>[col.size()];
col.toArray(arr);
return arr;
}
public Iterator<<API key>> iterator()
{
return col.iterator();
}
@Override
protected ArrayList getTypedCollection()
{
return col;
}
private class <API key> implements Comparator
{
private int direction = 1;
private boolean caseInsensitive = true;
public <API key>()
{
this(SortOrder.ASCENDING);
}
public <API key>(SortOrder order)
{
if (order == SortOrder.DESCENDING)
{
direction = -1;
}
}
public <API key>(SortOrder order, boolean caseInsensitive)
{
if (order == SortOrder.DESCENDING)
{
direction = -1;
}
this.caseInsensitive = caseInsensitive;
}
public int compare(Object obj1, Object obj2)
{
<API key> voObj1 = (<API key>)obj1;
<API key> voObj2 = (<API key>)obj2;
return direction*(voObj1.compareTo(voObj2, this.caseInsensitive));
}
public boolean equals(Object obj)
{
return false;
}
}
public ims.RefMan.vo.beans.<API key>[] getBeanCollection()
{
return <API key>();
}
public ims.RefMan.vo.beans.<API key>[] <API key>()
{
ims.RefMan.vo.beans.<API key>[] result = new ims.RefMan.vo.beans.<API key>[col.size()];
for(int i = 0; i < col.size(); i++)
{
<API key> vo = ((<API key>)col.get(i));
result[i] = (ims.RefMan.vo.beans.<API key>)vo.getBean();
}
return result;
}
public static <API key> <API key>(java.util.Collection beans)
{
<API key> coll = new <API key>();
if(beans == null)
return coll;
java.util.Iterator iter = beans.iterator();
while (iter.hasNext())
{
coll.add(((ims.RefMan.vo.beans.<API key>)iter.next()).buildVo());
}
return coll;
}
public static <API key> <API key>(ims.RefMan.vo.beans.<API key>[] beans)
{
<API key> coll = new <API key>();
if(beans == null)
return coll;
for(int x = 0; x < beans.length; x++)
{
coll.add(beans[x].buildVo());
}
return coll;
}
} |
//
//
//
//
//# This program is free software: you can redistribute it and/or modify #
//
//# published by the Free Software Foundation, either version 3 of the #
//
//
//# This program is distributed in the hope that it will be useful, #
//
//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
//
//
//
//
//
//# IMS MAXIMS provides absolutely NO GUARANTEE OF THE CLINICAL SAFTEY of #
//# this program. Users of this software do so entirely at their own risk. #
//# IMS MAXIMS only ensures the Clinical Safety of unaltered run-time #
//# software that it builds, deploys and maintains. #
//
//
//#EOH
// This code was generated by Barbara Worwood using IMS Development Environment (version 1.80 build 5589.25814)
// WARNING: DO NOT MODIFY the content of this file
package ims.scheduling.vo;
/**
* Linked to Scheduling.Booking_Appointment business object (ID: 1055100007).
*/
public class <API key> extends ims.scheduling.vo.<API key> implements ims.vo.ImsCloneable, Comparable
{
private static final long serialVersionUID = 1L;
public <API key>()
{
}
public <API key>(Integer id, int version)
{
super(id, version);
}
public <API key>(ims.scheduling.vo.beans.<API key> bean)
{
this.id = bean.getId();
this.version = bean.getVersion();
this.appointmentdate = bean.getAppointmentDate() == null ? null : bean.getAppointmentDate().buildDate();
this.apptstarttime = bean.getApptStartTime() == null ? null : bean.getApptStartTime().buildTime();
this.apptstatus = bean.getApptStatus() == null ? null : ims.scheduling.vo.lookups.Status_Reason.buildLookup(bean.getApptStatus());
this.activity = bean.getActivity() == null ? null : bean.getActivity().buildVo();
this.session = bean.getSession() == null ? null : bean.getSession().buildVo();
this.iscabbooking = bean.getIsCABBooking();
this.patient = bean.getPatient() == null ? null : bean.getPatient().buildVo();
this.outcome = bean.getOutcome() == null ? null : ims.scheduling.vo.lookups.ApptOutcome.buildLookup(bean.getOutcome());
this.outcomecomments = bean.getOutcomeComments();
this.haselectivelist = bean.getHasElectiveList();
this.wasprinted = bean.getWasPrinted();
this.bookingletter = bean.getBookingLetter() == null ? null : bean.getBookingLetter().buildVo();
this.linkedappointments = ims.scheduling.vo.<API key>.<API key>(bean.<API key>());
this.electivelist = bean.getElectiveList() == null ? null : new ims.RefMan.vo.<API key>(new Integer(bean.getElectiveList().getId()), bean.getElectiveList().getVersion());
this.<API key> = bean.<API key>() == null ? null : bean.<API key>().buildVo();
this.<API key> = bean.<API key>() == null ? null : bean.<API key>().buildVo();
this.referral = bean.getReferral() == null ? null : bean.getReferral().buildVo();
this.bookingcomments = bean.getBookingComments();
this.comments = bean.getComments();
}
public void populate(ims.vo.ValueObjectBeanMap map, ims.scheduling.vo.beans.<API key> bean)
{
this.id = bean.getId();
this.version = bean.getVersion();
this.appointmentdate = bean.getAppointmentDate() == null ? null : bean.getAppointmentDate().buildDate();
this.apptstarttime = bean.getApptStartTime() == null ? null : bean.getApptStartTime().buildTime();
this.apptstatus = bean.getApptStatus() == null ? null : ims.scheduling.vo.lookups.Status_Reason.buildLookup(bean.getApptStatus());
this.activity = bean.getActivity() == null ? null : bean.getActivity().buildVo(map);
this.session = bean.getSession() == null ? null : bean.getSession().buildVo(map);
this.iscabbooking = bean.getIsCABBooking();
this.patient = bean.getPatient() == null ? null : bean.getPatient().buildVo(map);
this.outcome = bean.getOutcome() == null ? null : ims.scheduling.vo.lookups.ApptOutcome.buildLookup(bean.getOutcome());
this.outcomecomments = bean.getOutcomeComments();
this.haselectivelist = bean.getHasElectiveList();
this.wasprinted = bean.getWasPrinted();
this.bookingletter = bean.getBookingLetter() == null ? null : bean.getBookingLetter().buildVo(map);
this.linkedappointments = ims.scheduling.vo.<API key>.<API key>(bean.<API key>());
this.electivelist = bean.getElectiveList() == null ? null : new ims.RefMan.vo.<API key>(new Integer(bean.getElectiveList().getId()), bean.getElectiveList().getVersion());
this.<API key> = bean.<API key>() == null ? null : bean.<API key>().buildVo(map);
this.<API key> = bean.<API key>() == null ? null : bean.<API key>().buildVo(map);
this.referral = bean.getReferral() == null ? null : bean.getReferral().buildVo(map);
this.bookingcomments = bean.getBookingComments();
this.comments = bean.getComments();
}
public ims.vo.ValueObjectBean getBean()
{
return this.getBean(new ims.vo.ValueObjectBeanMap());
}
public ims.vo.ValueObjectBean getBean(ims.vo.ValueObjectBeanMap map)
{
ims.scheduling.vo.beans.<API key> bean = null;
if(map != null)
bean = (ims.scheduling.vo.beans.<API key>)map.getValueObjectBean(this);
if (bean == null)
{
bean = new ims.scheduling.vo.beans.<API key>();
map.addValueObjectBean(this, bean);
bean.populate(map, this);
}
return bean;
}
public Object <API key>(String fieldName)
{
if(fieldName == null)
throw new ims.framework.exceptions.<API key>("Invalid field name");
fieldName = fieldName.toUpperCase();
if(fieldName.equals("APPOINTMENTDATE"))
return getAppointmentDate();
if(fieldName.equals("APPTSTARTTIME"))
return getApptStartTime();
if(fieldName.equals("APPTSTATUS"))
return getApptStatus();
if(fieldName.equals("ACTIVITY"))
return getActivity();
if(fieldName.equals("SESSION"))
return getSession();
if(fieldName.equals("ISCABBOOKING"))
return getIsCABBooking();
if(fieldName.equals("PATIENT"))
return getPatient();
if(fieldName.equals("OUTCOME"))
return getOutcome();
if(fieldName.equals("OUTCOMECOMMENTS"))
return getOutcomeComments();
if(fieldName.equals("HASELECTIVELIST"))
return getHasElectiveList();
if(fieldName.equals("WASPRINTED"))
return getWasPrinted();
if(fieldName.equals("BOOKINGLETTER"))
return getBookingLetter();
if(fieldName.equals("LINKEDAPPOINTMENTS"))
return <API key>();
if(fieldName.equals("ELECTIVELIST"))
return getElectiveList();
if(fieldName.equals("<API key>"))
return <API key>();
if(fieldName.equals("<API key>"))
return <API key>();
if(fieldName.equals("REFERRAL"))
return getReferral();
if(fieldName.equals("BOOKINGCOMMENTS"))
return getBookingComments();
if(fieldName.equals("COMMENTS"))
return getComments();
return super.<API key>(fieldName);
}
public boolean <API key>()
{
return this.appointmentdate != null;
}
public ims.framework.utils.Date getAppointmentDate()
{
return this.appointmentdate;
}
public void setAppointmentDate(ims.framework.utils.Date value)
{
this.isValidated = false;
this.appointmentdate = value;
}
public boolean <API key>()
{
return this.apptstarttime != null;
}
public ims.framework.utils.Time getApptStartTime()
{
return this.apptstarttime;
}
public void setApptStartTime(ims.framework.utils.Time value)
{
this.isValidated = false;
this.apptstarttime = value;
}
public boolean <API key>()
{
return this.apptstatus != null;
}
public ims.scheduling.vo.lookups.Status_Reason getApptStatus()
{
return this.apptstatus;
}
public void setApptStatus(ims.scheduling.vo.lookups.Status_Reason value)
{
this.isValidated = false;
this.apptstatus = value;
}
public boolean <API key>()
{
return this.activity != null;
}
public ims.core.vo.<API key> getActivity()
{
return this.activity;
}
public void setActivity(ims.core.vo.<API key> value)
{
this.isValidated = false;
this.activity = value;
}
public boolean getSessionIsNotNull()
{
return this.session != null;
}
public ims.scheduling.vo.<API key> getSession()
{
return this.session;
}
public void setSession(ims.scheduling.vo.<API key> value)
{
this.isValidated = false;
this.session = value;
}
public boolean <API key>()
{
return this.iscabbooking != null;
}
public Boolean getIsCABBooking()
{
return this.iscabbooking;
}
public void setIsCABBooking(Boolean value)
{
this.isValidated = false;
this.iscabbooking = value;
}
public boolean getPatientIsNotNull()
{
return this.patient != null;
}
public ims.core.vo.<API key> getPatient()
{
return this.patient;
}
public void setPatient(ims.core.vo.<API key> value)
{
this.isValidated = false;
this.patient = value;
}
public boolean getOutcomeIsNotNull()
{
return this.outcome != null;
}
public ims.scheduling.vo.lookups.ApptOutcome getOutcome()
{
return this.outcome;
}
public void setOutcome(ims.scheduling.vo.lookups.ApptOutcome value)
{
this.isValidated = false;
this.outcome = value;
}
public boolean <API key>()
{
return this.outcomecomments != null;
}
public String getOutcomeComments()
{
return this.outcomecomments;
}
public static int <API key>()
{
return 500;
}
public void setOutcomeComments(String value)
{
this.isValidated = false;
this.outcomecomments = value;
}
public boolean <API key>()
{
return this.haselectivelist != null;
}
public Boolean getHasElectiveList()
{
return this.haselectivelist;
}
public void setHasElectiveList(Boolean value)
{
this.isValidated = false;
this.haselectivelist = value;
}
public boolean <API key>()
{
return this.wasprinted != null;
}
public Boolean getWasPrinted()
{
return this.wasprinted;
}
public void setWasPrinted(Boolean value)
{
this.isValidated = false;
this.wasprinted = value;
}
public boolean <API key>()
{
return this.bookingletter != null;
}
public ims.core.vo.<API key> getBookingLetter()
{
return this.bookingletter;
}
public void setBookingLetter(ims.core.vo.<API key> value)
{
this.isValidated = false;
this.bookingletter = value;
}
public boolean <API key>()
{
return this.linkedappointments != null;
}
public ims.scheduling.vo.<API key> <API key>()
{
return this.linkedappointments;
}
public void <API key>(ims.scheduling.vo.<API key> value)
{
this.isValidated = false;
this.linkedappointments = value;
}
public boolean <API key>()
{
return this.electivelist != null;
}
public ims.RefMan.vo.<API key> getElectiveList()
{
return this.electivelist;
}
public void setElectiveList(ims.RefMan.vo.<API key> value)
{
this.isValidated = false;
this.electivelist = value;
}
public boolean <API key>()
{
return this.<API key> != null;
}
public ims.scheduling.vo.<API key> <API key>()
{
return this.<API key>;
}
public void <API key>(ims.scheduling.vo.<API key> value)
{
this.isValidated = false;
this.<API key> = value;
}
public boolean <API key>()
{
return this.<API key> != null;
}
public ims.admin.vo.<API key> <API key>()
{
return this.<API key>;
}
public void <API key>(ims.admin.vo.<API key> value)
{
this.isValidated = false;
this.<API key> = value;
}
public boolean <API key>()
{
return this.referral != null;
}
public ims.RefMan.vo.<API key> getReferral()
{
return this.referral;
}
public void setReferral(ims.RefMan.vo.<API key> value)
{
this.isValidated = false;
this.referral = value;
}
public boolean <API key>()
{
return this.bookingcomments != null;
}
public String getBookingComments()
{
return this.bookingcomments;
}
public static int <API key>()
{
return 255;
}
public void setBookingComments(String value)
{
this.isValidated = false;
this.bookingcomments = value;
}
public boolean <API key>()
{
return this.comments != null;
}
public String getComments()
{
return this.comments;
}
public static int <API key>()
{
return 500;
}
public void setComments(String value)
{
this.isValidated = false;
this.comments = value;
}
public boolean isValidated()
{
if(this.isBusy)
return true;
this.isBusy = true;
if(!this.isValidated)
{
this.isBusy = false;
return false;
}
this.isBusy = false;
return true;
}
public String[] validate()
{
return validate(null);
}
public String[] validate(String[] existingErrors)
{
if(this.isBusy)
return null;
this.isBusy = true;
java.util.ArrayList<String> listOfErrors = new java.util.ArrayList<String>();
if(existingErrors != null)
{
for(int x = 0; x < existingErrors.length; x++)
{
listOfErrors.add(existingErrors[x]);
}
}
if(this.patient == null)
listOfErrors.add("Patient is mandatory");
if(this.outcomecomments != null)
if(this.outcomecomments.length() > 500)
listOfErrors.add("The length of the field [outcomecomments] in the value object [ims.scheduling.vo.<API key>] is too big. It should be less or equal to 500");
if(this.comments != null)
if(this.comments.length() > 500)
listOfErrors.add("The length of the field [comments] in the value object [ims.scheduling.vo.<API key>] is too big. It should be less or equal to 500");
int errorCount = listOfErrors.size();
if(errorCount == 0)
{
this.isBusy = false;
this.isValidated = true;
return null;
}
String[] result = new String[errorCount];
for(int x = 0; x < errorCount; x++)
result[x] = (String)listOfErrors.get(x);
this.isBusy = false;
this.isValidated = false;
return result;
}
public void clearIDAndVersion()
{
this.id = null;
this.version = 0;
}
public Object clone()
{
if(this.isBusy)
return this;
this.isBusy = true;
<API key> clone = new <API key>(this.id, this.version);
if(this.appointmentdate == null)
clone.appointmentdate = null;
else
clone.appointmentdate = (ims.framework.utils.Date)this.appointmentdate.clone();
if(this.apptstarttime == null)
clone.apptstarttime = null;
else
clone.apptstarttime = (ims.framework.utils.Time)this.apptstarttime.clone();
if(this.apptstatus == null)
clone.apptstatus = null;
else
clone.apptstatus = (ims.scheduling.vo.lookups.Status_Reason)this.apptstatus.clone();
if(this.activity == null)
clone.activity = null;
else
clone.activity = (ims.core.vo.<API key>)this.activity.clone();
if(this.session == null)
clone.session = null;
else
clone.session = (ims.scheduling.vo.<API key>)this.session.clone();
clone.iscabbooking = this.iscabbooking;
if(this.patient == null)
clone.patient = null;
else
clone.patient = (ims.core.vo.<API key>)this.patient.clone();
if(this.outcome == null)
clone.outcome = null;
else
clone.outcome = (ims.scheduling.vo.lookups.ApptOutcome)this.outcome.clone();
clone.outcomecomments = this.outcomecomments;
clone.haselectivelist = this.haselectivelist;
clone.wasprinted = this.wasprinted;
if(this.bookingletter == null)
clone.bookingletter = null;
else
clone.bookingletter = (ims.core.vo.<API key>)this.bookingletter.clone();
if(this.linkedappointments == null)
clone.linkedappointments = null;
else
clone.linkedappointments = (ims.scheduling.vo.<API key>)this.linkedappointments.clone();
clone.electivelist = this.electivelist;
if(this.<API key> == null)
clone.<API key> = null;
else
clone.<API key> = (ims.scheduling.vo.<API key>)this.<API key>.clone();
if(this.<API key> == null)
clone.<API key> = null;
else
clone.<API key> = (ims.admin.vo.<API key>)this.<API key>.clone();
if(this.referral == null)
clone.referral = null;
else
clone.referral = (ims.RefMan.vo.<API key>)this.referral.clone();
clone.bookingcomments = this.bookingcomments;
clone.comments = this.comments;
clone.isValidated = this.isValidated;
this.isBusy = false;
return clone;
}
public int compareTo(Object obj)
{
return compareTo(obj, true);
}
public int compareTo(Object obj, boolean caseInsensitive)
{
if (obj == null)
{
return -1;
}
if(caseInsensitive); // this is to avoid eclipse warning only.
if (!(<API key>.class.isAssignableFrom(obj.getClass())))
{
throw new ClassCastException("A <API key> object cannot be compared an Object of type " + obj.getClass().getName());
}
if (this.id == null)
return 1;
if (((<API key>)obj).getBoId() == null)
return -1;
return this.id.compareTo(((<API key>)obj).getBoId());
}
public synchronized static int <API key>()
{
return ims.vo.ValueObject.generateUniqueID();
}
public int <API key>()
{
int count = 0;
if(this.appointmentdate != null)
count++;
if(this.apptstarttime != null)
count++;
if(this.apptstatus != null)
count++;
if(this.activity != null)
count++;
if(this.session != null)
count++;
if(this.iscabbooking != null)
count++;
if(this.patient != null)
count++;
if(this.outcome != null)
count++;
if(this.outcomecomments != null)
count++;
if(this.haselectivelist != null)
count++;
if(this.wasprinted != null)
count++;
if(this.bookingletter != null)
count++;
if(this.linkedappointments != null)
count++;
if(this.electivelist != null)
count++;
if(this.<API key> != null)
count++;
if(this.<API key> != null)
count++;
if(this.referral != null)
count++;
if(this.bookingcomments != null)
count++;
if(this.comments != null)
count++;
return count;
}
public int <API key>()
{
return 19;
}
protected ims.framework.utils.Date appointmentdate;
protected ims.framework.utils.Time apptstarttime;
protected ims.scheduling.vo.lookups.Status_Reason apptstatus;
protected ims.core.vo.<API key> activity;
protected ims.scheduling.vo.<API key> session;
protected Boolean iscabbooking;
protected ims.core.vo.<API key> patient;
protected ims.scheduling.vo.lookups.ApptOutcome outcome;
protected String outcomecomments;
protected Boolean haselectivelist;
protected Boolean wasprinted;
protected ims.core.vo.<API key> bookingletter;
protected ims.scheduling.vo.<API key> linkedappointments;
protected ims.RefMan.vo.<API key> electivelist;
protected ims.scheduling.vo.<API key> <API key>;
protected ims.admin.vo.<API key> <API key>;
protected ims.RefMan.vo.<API key> referral;
protected String bookingcomments;
protected String comments;
private boolean isValidated = false;
private boolean isBusy = false;
} |
{!! $thread->toHTML(
false,
isset($multiboard) ? $multiboard : false,
false
) !!}
@if (!$thread->reply_to)
@spaceless
@if ($thread->reply_count > count($thread->replies) && !$thread->reply_to)
<div class="<API key>">
{{-- Normal Reply Count --}}
<span class="<API key>">{{ Lang::get(
$thread->reply_file_count > 0 ? 'board.omitted.text.both' : 'board.omitted.text.only',
[
'text_posts' => Lang::choice(
'board.omitted.count.replies',
$thread->reply_count - $thread->getReplyCount(),
[
'count' => $thread->reply_count - $thread->getReplyCount()
]
),
'text_files' => Lang::choice(
'board.omitted.count.files',
$thread->reply_file_count - $thread->getReplyFileCount(),
[
'count' => $thread->reply_file_count - $thread->getReplyFileCount()
]
),
]
) }}</span>
{{-- JavaScript Expand Inline
<a class="<API key> no-mobile require-js" href="#">{{ Lang::get(
'board.omitted.show.inline'
) }}</a>
</div>
@endif
@if (!isset($catalog) || !$catalog)
<ul class="thread-replies">
@foreach ($thread->getReplies() as $reply)
<li class="thread-reply">
<article class="reply">
@endspaceless
{!! $reply->toHTML(
false,
isset($multiboard) ? $multiboard : false,
false
) !!}
@spaceless
</article>
</li>
@endforeach
@if (isset($updater) && $updater === true)
@include('widgets.thread-autoupdater')
@endif
</ul>
@endif
@endspaceless
@endif |
import { Factory } from "ember-cli-mirage";
import faker from "faker";
import { randomDuration } from "../helpers/duration";
export default Factory.extend({
name: () => faker.commerce.productName(),
estimatedTime: () => randomDuration(),
// customer: association()
afterCreate(project, server) {
project.update({ customerId: server.create("customer").id });
}
}); |
$( function()
{
'use strict';
QUnit.module( 'scrollspy plugin' );
QUnit.test( 'should be defined on jquery object', function( assert )
{
assert.expect( 1 );
assert.ok( $( document.body ).scrollspy, 'scrollspy method is defined' )
} );
QUnit.module( 'scrollspy', {
beforeEach: function()
{
// Run all tests in noConflict mode -- it's the only way to ensure that the plugin works in noConflict mode
$.fn.bootstrapScrollspy = $.fn.scrollspy.noConflict()
},
afterEach: function()
{
$.fn.scrollspy = $.fn.bootstrapScrollspy;
delete $.fn.bootstrapScrollspy
}
} );
QUnit.test( 'should provide no conflict', function( assert )
{
assert.expect( 1 );
assert.strictEqual( $.fn.scrollspy, undefined, 'scrollspy was set back to undefined (org value)' )
} );
QUnit.test( 'should return jquery collection containing the element', function( assert )
{
assert.expect( 2 );
var $el = $( '<div/>' );
var $scrollspy = $el.bootstrapScrollspy();
assert.ok( $scrollspy instanceof $, 'returns jquery collection' );
assert.strictEqual( $scrollspy[0], $el[0], 'collection contains element' )
} );
QUnit.test( 'should only switch "active" class on current target', function( assert )
{
assert.expect( 1 );
var done = assert.async();
var sectionHTML = '<div id="root" class="active">'
+ '<div class="topbar">'
+ '<div class="topbar-inner">'
+ '<div class="container" id="ss-target">'
+ '<ul class="nav">'
+ '<li><a href="#masthead">Overview</a></li>'
+ '<li><a href="#detail">Detail</a></li>'
+ '</ul>'
+ '</div>'
+ '</div>'
+ '</div>'
+ '<div id="scrollspy-example" style="height: 100px; overflow: auto;">'
+ '<div style="height: 200px;">'
+ '<h4 id="masthead">Overview</h4>'
+ '<p style="height: 200px">'
+ 'Ad leggings keytar, brunch id art party dolor labore.'
+ '</p>'
+ '</div>'
+ '<div style="height: 200px;">'
+ '<h4 id="detail">Detail</h4>'
+ '<p style="height: 200px">'
+ 'Veniam marfa mustache skateboard, adipisicing fugiat velit pitchfork beard.'
+ '</p>'
+ '</div>'
+ '</div>'
+ '</div>';
var $section = $( sectionHTML ).appendTo( '#qunit-fixture' );
var $scrollspy = $section
.show()
.find( '#scrollspy-example' )
.bootstrapScrollspy( {target: '#ss-target'} );
$scrollspy.on( 'scroll.bs.scrollspy', function()
{
assert.ok( $section.hasClass( 'active' ), '"active" class still on root node' );
done()
} );
$scrollspy.scrollTop( 350 )
} );
QUnit.test( 'should correctly select middle navigation option when large offset is used', function( assert )
{
assert.expect( 3 );
var done = assert.async();
var sectionHTML = '<div id="header" style="height: 500px;"></div>'
+ '<nav id="navigation" class="navbar">'
+ '<ul class="nav navbar-nav">'
+ '<li class="active"><a id="one-link" href="#one">One</a></li>'
+ '<li><a id="two-link" href="#two">Two</a></li>'
+ '<li><a id="three-link" href="#three">Three</a></li>'
+ '</ul>'
+ '</nav>'
+ '<div id="content" style="height: 200px; overflow-y: auto;">'
+ '<div id="one" style="height: 500px;"></div>'
+ '<div id="two" style="height: 300px;"></div>'
+ '<div id="three" style="height: 10px;"></div>'
+ '</div>';
var $section = $( sectionHTML ).appendTo( '#qunit-fixture' );
var $scrollspy = $section
.show()
.filter( '#content' );
$scrollspy.bootstrapScrollspy( {target: '#navigation', offset: $scrollspy.position().top} );
$scrollspy.on( 'scroll.bs.scrollspy', function()
{
assert.ok( !$section.find( '#one-link' ).parent().hasClass( 'active' ),
'"active" class removed from first section' );
assert.ok( $section.find( '#two-link' ).parent().hasClass( 'active' ), '"active" class on middle section' );
assert.ok( !$section.find( '#three-link' ).parent().hasClass( 'active' ),
'"active" class not on last section' );
done()
} );
$scrollspy.scrollTop( 550 )
} );
QUnit.test( 'should add the active class to the correct element', function( assert )
{
assert.expect( 2 );
var navbarHtml =
'<nav class="navbar">'
+ '<ul class="nav">'
+ '<li id="li-1"><a href="#div-1">div 1</a></li>'
+ '<li id="li-2"><a href="#div-2">div 2</a></li>'
+ '</ul>'
+ '</nav>';
var contentHtml =
'<div class="content" style="overflow: auto; height: 50px">'
+ '<div id="div-1" style="height: 100px; padding: 0; margin: 0">div 1</div>'
+ '<div id="div-2" style="height: 200px; padding: 0; margin: 0">div 2</div>'
+ '</div>';
$( navbarHtml ).appendTo( '#qunit-fixture' );
var $content = $( contentHtml )
.appendTo( '#qunit-fixture' )
.bootstrapScrollspy( {offset: 0, target: '.navbar'} );
var <API key> = function( element, target )
{
var deferred = $.Deferred();
var scrollHeight = Math.ceil( $content.scrollTop() + $( target ).position().top );
var done = assert.async();
$content.one( 'scroll', function()
{
assert.ok( $( element ).hasClass( 'active' ), 'target:' + target + ', element' + element );
done();
deferred.resolve()
} );
$content.scrollTop( scrollHeight );
return deferred.promise()
};
$.when( <API key>( '#li-1', '#div-1' ) )
.then( function()
{
return <API key>( '#li-2', '#div-2' )
} )
} );
QUnit.test( 'should add the active class correctly when there are nested elements at 0 scroll offset',
function( assert )
{
assert.expect( 6 );
var times = 0;
var done = assert.async();
var navbarHtml = '<nav id="navigation" class="navbar">'
+ '<ul class="nav">'
+ '<li id="li-1"><a href="#div-1">div 1</a>'
+ '<ul>'
+ '<li id="li-2"><a href="#div-2">div 2</a></li>'
+ '</ul>'
+ '</li>'
+ '</ul>'
+ '</nav>';
var contentHtml = '<div class="content" style="position: absolute; top: 0px; overflow: auto; height: 50px">'
+ '<div id="div-1" style="padding: 0; margin: 0">'
+ '<div id="div-2" style="height: 200px; padding: 0; margin: 0">div 2</div>'
+ '</div>'
+ '</div>';
$( navbarHtml ).appendTo( '#qunit-fixture' );
var $content = $( contentHtml )
.appendTo( '#qunit-fixture' )
.bootstrapScrollspy( {offset: 0, target: '#navigation'} );
!function testActiveElements()
{
if (++times > 3) {
return done();
}
$content.one( 'scroll', function()
{
assert.ok( $( '#li-1' ).hasClass( 'active' ), 'nav item for outer element has "active" class' );
assert.ok( $( '#li-2' ).hasClass( 'active' ), 'nav item for inner element has "active" class' );
testActiveElements()
} );
$content.scrollTop( $content.scrollTop() + 10 )
}()
} );
QUnit.test( 'should clear selection if above the first section', function( assert )
{
assert.expect( 3 );
var done = assert.async();
var sectionHTML = '<div id="header" style="height: 500px;"></div>'
+ '<nav id="navigation" class="navbar">'
+ '<ul class="nav navbar-nav">'
+ '<li class="active"><a id="one-link" href="#one">One</a></li>'
+ '<li><a id="two-link" href="#two">Two</a></li>'
+ '<li><a id="three-link" href="#three">Three</a></li>'
+ '</ul>'
+ '</nav>';
$( sectionHTML ).appendTo( '#qunit-fixture' );
var scrollspyHTML = '<div id="content" style="height: 200px; overflow-y: auto;">'
+ '<div id="spacer" style="height: 100px;"/>'
+ '<div id="one" style="height: 100px;"/>'
+ '<div id="two" style="height: 100px;"/>'
+ '<div id="three" style="height: 100px;"/>'
+ '<div id="spacer" style="height: 100px;"/>'
+ '</div>';
var $scrollspy = $( scrollspyHTML ).appendTo( '#qunit-fixture' );
$scrollspy
.bootstrapScrollspy( {
target: '#navigation',
offset: $scrollspy.position().top
} )
.one( 'scroll.bs.scrollspy', function()
{
assert.strictEqual( $( '.active' ).length, 1, '"active" class on only one element present' );
assert.strictEqual( $( '.active' ).has( '#two-link' ).length, 1, '"active" class on second section' );
$scrollspy
.one( 'scroll.bs.scrollspy', function()
{
assert.strictEqual( $( '.active' ).length, 0, 'selection cleared' );
done()
} )
.scrollTop( 0 )
} )
.scrollTop( 201 )
} );
QUnit.test( 'should correctly select navigation element on backward scrolling when each target section height is 100%',
function( assert )
{
assert.expect( 5 );
var navbarHtml =
'<nav class="navbar">'
+ '<ul class="nav">'
+ '<li id="li-100-1"><a href="#div-100-1">div 1</a></li>'
+ '<li id="li-100-2"><a href="#div-100-2">div 2</a></li>'
+ '<li id="li-100-3"><a href="#div-100-3">div 3</a></li>'
+ '<li id="li-100-4"><a href="#div-100-4">div 4</a></li>'
+ '<li id="li-100-5"><a href="#div-100-5">div 5</a></li>'
+ '</ul>'
+ '</nav>';
var contentHtml =
'<div class="content" style="position: relative; overflow: auto; height: 100px">'
+ '<div id="div-100-1" style="position: relative; height: 100%; padding: 0; margin: 0">div 1</div>'
+ '<div id="div-100-2" style="position: relative; height: 100%; padding: 0; margin: 0">div 2</div>'
+ '<div id="div-100-3" style="position: relative; height: 100%; padding: 0; margin: 0">div 3</div>'
+ '<div id="div-100-4" style="position: relative; height: 100%; padding: 0; margin: 0">div 4</div>'
+ '<div id="div-100-5" style="position: relative; height: 100%; padding: 0; margin: 0">div 5</div>'
+ '</div>';
$( navbarHtml ).appendTo( '#qunit-fixture' );
var $content = $( contentHtml )
.appendTo( '#qunit-fixture' )
.bootstrapScrollspy( {offset: 0, target: '.navbar'} );
var <API key> = function( element, target )
{
var deferred = $.Deferred();
var scrollHeight = Math.ceil( $content.scrollTop() + $( target ).position().top );
var done = assert.async();
$content.one( 'scroll', function()
{
assert.ok( $( element ).hasClass( 'active' ), 'target:' + target + ', element: ' + element );
done();
deferred.resolve()
} );
$content.scrollTop( scrollHeight );
return deferred.promise()
};
$.when( <API key>( '#li-100-5', '#div-100-5' ) )
.then( function()
{
return <API key>( '#li-100-4', '#div-100-4' )
} )
.then( function()
{
return <API key>( '#li-100-3', '#div-100-3' )
} )
.then( function()
{
return <API key>( '#li-100-2', '#div-100-2' )
} )
.then( function()
{
return <API key>( '#li-100-1', '#div-100-1' )
} )
} )
} ); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.