answer
stringlengths 15
1.25M
|
|---|
var class_mock =
[
[ "Mock", "class_mock.html#<API key>", null ],
[ "Mock", "class_mock.html#<API key>", null ],
[ "MOCK_METHOD0", "class_mock.html#<API key>", null ],
[ "MOCK_METHOD1", "class_mock.html#<API key>", null ],
[ "MOCK_METHOD1", "class_mock.html#<API key>", null ],
[ "MOCK_METHOD1", "class_mock.html#<API key>", null ],
[ "MOCK_METHOD1", "class_mock.html#<API key>", null ],
[ "MOCK_METHOD1", "class_mock.html#<API key>", null ],
[ "MOCK_METHOD1", "class_mock.html#<API key>", null ],
[ "MOCK_METHOD1", "class_mock.html#<API key>", null ],
[ "MOCK_METHOD1", "class_mock.html#<API key>", null ],
[ "MOCK_METHOD1", "class_mock.html#<API key>", null ]
];
|
#include "StdAfx.h"
#include ".\datawriter.h"
using namespace std;
DataWriter::DataWriter(const std::string &fileName)
{
this->fileName = fileName;
fileStream = NULL;
//Initialize the filestream
fileStream = new fstream(fileName.c_str(), ios::out|ios::binary|ios::trunc);
}
void DataWriter::Write(int data, const size_t size)
{
if (fileStream)
{
if (fileStream->is_open())
{
int sizeCount = 0;
while (data > 0)
{
fileStream->put(char(data%256));
data /= 256;
++sizeCount;
}
while (sizeCount < size) //Fill the remaining characters
{
fileStream->put(char(0));
++sizeCount;
}
}
}
}
void DataWriter::Write(const char data)
{
if (fileStream)
{
if (fileStream->is_open())
{
fileStream->put(data);
}
}
}
void DataWriter::Write(const char* data, const size_t size)
{
if (!data)
{
std::cout << "Warning: attempted to write null pointer\n";
return;
}
if (fileStream)
{
if (fileStream->is_open())
{
if (strlen(data) > size)
{
cout << "Warning: Attempting to write data to area larger than specified size\n";
return;
}
fileStream->write(data,strlen(data));
if (strlen(data) < size)
{
for (unsigned int i = 0; i < size - strlen(data); ++i)
{
fileStream->put(char(0));//The files we're dealing with are little-endian, so fill after the placement of the data
}
}
}
}
}
|
# Material-UI Versions
<p class="description">You can come back to this page and switch the version of the docs you're reading at any time.</p>
## Stable versions
The most recent version is recommended in production.
{{"demo": "pages/versions/StableVersions.js", "hideHeader": true}}
Here you can find the latest unreleased documentation and code. You can use it to see what changes are coming and provide better feedback to Material-UI contributors.
{{"demo": "pages/versions/LatestVersion.js", "hideHeader": true}}
## Versioning strategy
We recognize that you need **stability** from the Material-UI library. Stability ensures that reusable components and libraries, tutorials, tools, and learned practices don't become obsolete unexpectedly. Stability is essential for the ecosystem around Material-UI to thrive.
This document contains **the practices that we follow** to provide you with a leading-edge UI library, balanced with stability. We strive to ensure that future changes are always introduced in a predictable way. We want everyone who depends on Material-UI to know when and how new features are added, and to be well-prepared when obsolete ones are removed.
Material-UI strictly follows [Semantic Versioning 2.0.0](https://semver.org/). Material-UI version numbers have three parts: `major.minor.patch`. The version number is incremented based on the level of change included in the release.
- **Major releases** contain significant new features, some but minimal developer assistance is expected during the update. When updating to a new major release, you may need to run update scripts, refactor code, run additional tests, and learn new APIs.
- **Minor releases** contain important new features. Minor releases are fully backward-compatible; no developer assistance is expected during update, but you can optionally modify your apps and libraries to begin using new APIs, features, and capabilities that were added in the release.
- **Patch releases** are low risk, contain bug fixes and small new features. No developer assistance is expected during update.
## Release frequency
We work toward a regular schedule of releases, so that you can plan and coordinate your updates with the continuing evolution of Material-UI.
In general, you can expect the following release cycle:
- A **major** release every 6 months.
- 1-3 **minor** releases for each major release.
- A **patch** release every week (anytime for urgent bugfix).
## Release schedule
> Disclaimer: The dates are offered as general guidance and may be adjusted by us when necessary to ensure delivery of a high-quality code.
| Date | Version |
|:
| May 2019 | `@material-ui/core` v4.0.0 |
| December 2019 | `@material-ui/core` v5.0.0 |
You can follow [our milestones](https://github.com/mui-org/material-ui/milestones) for a more detailed overview.
## Support policy
We only support the latest version of Material-UI. We don't yet have the resources to offer [LTS](https://en.wikipedia.org/wiki/Long-term_support) releases.
## Deprecation practices
Sometimes **"breaking changes"**, such as the removal of support for select APIs and features, are necessary.
To make these transitions as easy as possible, we make two commitments to you:
- We work hard to minimize the number of breaking changes and to provide migration tools when possible.
- We follow the deprecation policy described here, so you have time to update your apps to the latest APIs and best practices.
To help ensure that you have sufficient time and a clear path to update, this is our deprecation policy:
- We announce deprecated features in the changelog, and when possible, with warnings at runtime.
- When we announce a deprecation, we also announce a recommended update path.
- We support existing use of a stable API during the deprecation period, so your code will keep working during that period.
- We only make peer dependency updates (React) that require changes to your apps in a major release.
|
namespace mazes.Core.Grids {
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using mazes.Core.Cells;
using mazes.Core.Grids.Cartesian;
public class WeaveGrid : Grid {
private readonly List<UnderCell> _underCells = new List<UnderCell>();
public WeaveGrid(int rows, int cols) : base(rows, cols) {
PrepareGrid();
ConfigureCells();
}
private void PrepareGrid() {
var rows = new List<List<Cell>>();
for (var row = 0; row < Rows; row++) {
var newRow = new List<Cell>();
for (var column = 0; column < Columns; column++) {
newRow.Add(new OverCell(row, column, this));
}
rows.Add(newRow);
}
_grid = rows;
}
private void ConfigureCells() {
foreach (var cell in Cells.Cast<OverCell>()) {
var row = cell.Row;
var col = cell.Column;
cell.North = (OverCell)this[row - 1, col];
cell.South = (OverCell)this[row + 1, col];
cell.West = (OverCell)this[row, col - 1];
cell.East = (OverCell)this[row, col + 1];
}
}
public void TunnelUnder(OverCell overCell) {
var underCell = new UnderCell(overCell);
_underCells.Add(underCell);
}
public override IEnumerable<Cell> Cells => base.Cells.Union(_underCells);
public override Image ToImg(int cellSize = 50, float insetPrc = 0) {
return base.ToImg(cellSize, insetPrc == 0 ? 0.1f : insetPrc);
}
protected override void ToImgWithInset(Graphics g, CartesianCell cell, DrawMode mode, int cellSize, int x, int y, int inset) {
if (cell is UnderCell) {
var (x1, x2, x3, x4, y1, y2, y3, y4) = <API key>(x, y, cellSize, inset);
if (cell.VerticalPassage) {
g.DrawLine(Pens.Black, x2, y1, x2, y2);
g.DrawLine(Pens.Black, x3, y1, x3, y2);
g.DrawLine(Pens.Black, x2, y3, x2, y4);
g.DrawLine(Pens.Black, x3, y3, x3, y4);
} else {
g.DrawLine(Pens.Black, x1, y2, x2, y2);
g.DrawLine(Pens.Black, x1, y3, x2, y3);
g.DrawLine(Pens.Black, x3, y2, x4, y2);
g.DrawLine(Pens.Black, x3, y3, x4, y3);
}
} else {
base.ToImgWithInset(g, cell, mode, cellSize, x, y, inset);
}
}
}
}
|
package stream.flarebot.flarebot.mod.modlog;
public enum ModAction {
BAN(true, ModlogEvent.USER_BANNED),
SOFTBAN(true, ModlogEvent.USER_SOFTBANNED),
FORCE_BAN(true, ModlogEvent.USER_BANNED),
TEMP_BAN(true, ModlogEvent.USER_TEMP_BANNED),
UNBAN(false, ModlogEvent.USER_UNBANNED),
KICK(true, ModlogEvent.USER_KICKED),
TEMP_MUTE(true, ModlogEvent.USER_TEMP_MUTED),
MUTE(true, ModlogEvent.USER_MUTED),
UNMUTE(false, ModlogEvent.USER_UNMUTED),
WARN(true, ModlogEvent.USER_WARNED);
private boolean infraction;
private ModlogEvent event;
ModAction(boolean infraction, ModlogEvent modlogEvent) {
this.infraction = infraction;
this.event = modlogEvent;
}
public boolean isInfraction() {
return infraction;
}
@Override
public String toString() {
return name().charAt(0) + name().substring(1).toLowerCase().replaceAll("_", " ");
}
public String getLowercaseName() {
return toString().toLowerCase();
}
public ModlogEvent getEvent() {
return event;
}
}
|
<?php
namespace cs;
use h;
$Config = Config::instance();
$db = DB::instance();
$Index = Index::instance();
$module_object = $Config->module('Update');
if (!$module_object->version) {
$module_object->version = 0;
}
if (isset($Config->route[0]) && $Config->route[0] == 'process') {
$version = (int)$module_object->version;
for ($i = 1; file_exists(MFOLDER."/sql/$i.sql") || file_exists(MFOLDER."/php/$i.php"); ++$i) {
if ($version < $i) {
if (file_exists(MFOLDER."/sql/$i.sql")) {
foreach (explode(';', file_get_contents(MFOLDER."/sql/$i.sql")) as $s) {
if ($s) {
$db->{'0'}()->q($s);
}
}
}
if (file_exists(MFOLDER."/php/$i.php")) {
include MFOLDER."/php/$i.php";
}
$module_object->version = $i;
}
}
$Index->save(true);
}
$Index->buttons = false;
$Index->content(
h::{'p.cs-center'}("Current revision: $module_object->version").
h::{'a.cs-button.cs-center'}(
'Update System structure',
[
'href' => 'admin/Update/process'
]
)
);
|
<!DOCTYPE HTML PUBLIC "-
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (version 1.6.0_18) on Thu Dec 18 17:18:41 PST 2014 -->
<title>Uses of Class javax.swing.plaf.basic.BasicFileChooserUI.UpdateAction (Java Platform SE 7 )</title>
<meta name="date" content="2014-12-18">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Uses of Class javax.swing.plaf.basic.BasicFileChooserUI.UpdateAction (Java Platform SE 7 )";
}
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<div class="topNav"><a name="navbar_top">
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="../package-summary.html">Package</a></li>
<li><a href="../../../../../javax/swing/plaf/basic/BasicFileChooserUI.UpdateAction.html" title="class in javax.swing.plaf.basic">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-files/index-1.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
<div class="aboutLanguage"><em><strong>Java™ Platform<br>Standard Ed. 7</strong></em></div>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?javax/swing/plaf/basic/class-use/BasicFileChooserUI.UpdateAction.html" target="_top">Frames</a></li>
<li><a href="BasicFileChooserUI.UpdateAction.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="<API key>">
<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!
allClassesLink = document.getElementById("<API key>");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
</script>
</div>
<a name="skip-navbar_top">
</a></div>
<div class="header">
<h2 title="Uses of Class javax.swing.plaf.basic.BasicFileChooserUI.UpdateAction" class="title">Uses of Class<br>javax.swing.plaf.basic.BasicFileChooserUI.UpdateAction</h2>
</div>
<div class="classUseContainer">No usage of javax.swing.plaf.basic.BasicFileChooserUI.UpdateAction</div>
<div class="bottomNav"><a name="navbar_bottom">
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="<API key>">
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="../package-summary.html">Package</a></li>
<li><a href="../../../../../javax/swing/plaf/basic/BasicFileChooserUI.UpdateAction.html" title="class in javax.swing.plaf.basic">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-files/index-1.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
<div class="aboutLanguage"><em><strong>Java™ Platform<br>Standard Ed. 7</strong></em></div>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?javax/swing/plaf/basic/class-use/BasicFileChooserUI.UpdateAction.html" target="_top">Frames</a></li>
<li><a href="BasicFileChooserUI.UpdateAction.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="<API key>">
<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!
allClassesLink = document.getElementById("<API key>");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
</script>
</div>
<a name="skip-navbar_bottom">
</a></div>
<p class="legalCopy"><small><font size="-1"> <a href="http://bugreport.sun.com/bugreport/">Submit a bug or feature</a> <br>For further API reference and developer documentation, see <a href="http://docs.oracle.com/javase/7/docs/index.html" target="_blank">Java SE Documentation</a>. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.<br> <a href="../../../../../../legal/cpyr.html">Copyright</a> &
</body>
</html>
|
<!DOCTYPE html>
<html xmlns="http:
<head>
<link href="http://gmpg.org/xfn/11" rel="profile">
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<link rel="stylesheet" href="/public/font-awesome/css/font-awesome.min.css">
<!-- Enable responsiveness on mobile devices-->
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1">
<title>
404: Page not found · Home
</title>
<!-- CSS -->
<link rel="stylesheet" href="/public/css/poole.css">
<link rel="stylesheet" href="/public/css/syntax.css">
<link rel="stylesheet" href="/public/css/hyde.css">
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=PT+Sans:400,400italic,700|Abril+Fatface">
<!-- Icons -->
<link rel="<API key>" sizes="144x144" href="/public/<API key>.png">
<link rel="shortcut icon" href="/public/favicon.ico">
<!-- RSS -->
<link rel="alternate" type="application/rss+xml" title="RSS" href="/atom.xml">
</head>
<body>
<div class="sidebar">
<div class="container sidebar-sticky">
<div class="sidebar-about">
<img src="/public/logo.png">
<p class="lead"></p>
</div>
<ul class="sidebar-nav">
<li class="sidebar-nav-item">
<a href="/"> Home</a>
</li>
<li class="sidebar-nav-item">
<a href="/about.html">About</a>
</li>
<li class="sidebar-nav-item">
<a href="/projects.html">Projects</a>
</li>
<li class="sidebar-nav-item">
<a href="/feedback.html">Feedback</a>
</li>
</ul>
<p>© 2014. All rights reserved.</p>
</div>
</div>
<div class="content container">
<div class="page">
<h1 class="page-title">404: Page not found</h1>
<p class="lead">Sorry, we've misplaced that URL or it's pointing to something that doesn't exist. <a href="/">Head back home</a> to try finding it again.</p>
</div>
</div>
</body>
</html>
|
#pragma once
#include "dg/enums.h"
#include "json/json.h"
namespace eule{
/**
* @brief Provide a mapping between input file and named parameters
*/
struct Parameters
{
unsigned n; //!< \# of polynomial coefficients in R and Z
unsigned Nx; //!< \# of cells in x -direction
unsigned Ny; //!< \# of cells in y -direction
unsigned Nz; //!< \# of cells in z -direction
double dt; //!< timestep
unsigned n_out; //!< \# of polynomial coefficients in output file
unsigned Nx_out; //!< \# of cells in x-direction in output file
unsigned Ny_out; //!< \# of cells in y-direction in output file
unsigned Nz_out; //!< \# of cells in z-direction in output file
unsigned itstp; //!< \# of steps between outputs
unsigned maxout; //!< \# of outputs excluding first
double eps_pol; //!< accuracy of polarization
double jfactor;
double eps_maxwell; //!< accuracy of induction equation
double eps_gamma; //!< accuracy of gamma operator
double eps_time;//!< accuracy of implicit timestep
double eps_hat;
double mu[2]; //!< mu[0] = mu_e, m[1] = mu_i
double tau[2]; //!< tau[0] = -1, tau[1] = tau_i
double beta; //!< plasma beta
double nu_perp; //!< perpendicular diffusion
double nu_parallel; //!< parallel diffusion
double c; //!< parallel resistivity
double amp; //!< blob amplitude
double sigma; //!< perpendicular blob width
double posX; //!< perpendicular position relative to box width
double posY; //!< perpendicular position relative to box height
double sigma_z; //!< parallel blob width in units of pi
double k_psi; //!< mode number
double omega_source; //!< source amplitude
double nprofileamp; //!< amplitude of profile
double bgprofamp; //!< background profile amplitude
double boxscaleRp; //!< box can be larger
double boxscaleRm;//!< box can be larger
double boxscaleZp;//!< box can be larger
double boxscaleZm;//!< box can be larger
enum dg::bc bc; //!< global perpendicular boundary condition
unsigned pollim; //!< 0= no poloidal limiter, 1 = poloidal limiter
unsigned pardiss; //!< 0 = adjoint parallel dissipation, 1 = nonadjoint parallel dissipation
unsigned mode; //!< 0 = blob simulations (several rounds fieldaligned), 1 = straight blob simulation( 1 round fieldaligned), 2 = turbulence simulations ( 1 round fieldaligned),
unsigned initcond; //!< 0 = zero electric potential, 1 = ExB vorticity equals ion diamagnetic vorticity
unsigned curvmode; //!< 0 = low beta, 1 = toroidal field line
Parameters( const Json::Value& js) {
n = js["n"].asUInt();
Nx = js["Nx"].asUInt();
Ny = js["Ny"].asUInt();
Nz = js["Nz"].asUInt();
dt = js["dt"].asDouble();
n_out = js["n_out"].asUInt();
Nx_out = js["Nx_out"].asUInt();
Ny_out = js["Ny_out"].asUInt();
Nz_out = js["Nz_out"].asUInt();
itstp = js["itstp"].asUInt();
maxout = js["maxout"].asUInt();
eps_pol = js["eps_pol"].asDouble();
jfactor = js["jumpfactor"].asDouble();
eps_maxwell = js["eps_maxwell"].asDouble();
eps_gamma = js["eps_gamma"].asDouble();
eps_time = js["eps_time"].asDouble();
eps_hat = 1.;
mu[0] = js["mu"].asDouble();
mu[1] = +1.;
tau[0] = -1.;
tau[1] = js["tau"].asDouble();
beta = js["beta"].asDouble();
nu_perp = js["nu_perp"].asDouble();
nu_parallel = js["nu_parallel"].asDouble();
c = js["resistivity"].asDouble();
amp = js["amplitude"].asDouble();
sigma = js["sigma"].asDouble();
posX = js["posX"].asDouble();
posY = js["posY"].asDouble();
sigma_z = js["sigma_z"].asDouble();
k_psi = js["k_psi"].asDouble();
omega_source = js["source"].asDouble();
bc = dg::str2bc(js["bc"].asString());
nprofileamp = js["nprofileamp"].asDouble();
bgprofamp = js["bgprofamp"].asDouble();
boxscaleRp = js.get("boxscaleRp",1.05).asDouble();
boxscaleRm = js.get("boxscaleRm",1.05).asDouble();
boxscaleZp = js.get("boxscaleZp",1.05).asDouble();
boxscaleZm = js.get("boxscaleZm",1.05).asDouble();
pollim = js.get( "pollim", 0).asUInt();
pardiss = js.get( "pardiss", 0).asUInt();
mode = js.get( "mode", 0).asUInt();
initcond = js.get( "initial", 0).asUInt();
curvmode = js.get( "curvmode", 0).asUInt();
}
/**
* @brief Display parameters
*
* @param os Output stream
*/
void display( std::ostream& os = std::cout ) const
{
os << "Physical parameters are: \n"
<<" mu_e = "<<mu[0]<<"\n"
<<" mu_i = "<<mu[1]<<"\n"
<<" beta = "<<beta<<"\n"
<<" El.-temperature: = "<<tau[0]<<"\n"
<<" Ion-temperature: = "<<tau[1]<<"\n"
<<" perp. Viscosity: = "<<nu_perp<<"\n"
<<" par. Resistivity: = "<<c<<"\n"
<<" par. Viscosity: = "<<nu_parallel<<"\n";
os <<"Blob parameters are: \n"
<< " amplitude: "<<amp<<"\n"
<< " width: "<<sigma<<"\n"
<< " posX: "<<posX<<"\n"
<< " posY: "<<posY<<"\n"
<< " sigma_z: "<<sigma_z<<"\n";
os << "Profile parameters are: \n"
<<" omega_source: "<<omega_source<<"\n"
<<" density profile amplitude: "<<nprofileamp<<"\n"
<<" background profile amplitude: "<<bgprofamp<<"\n"
<<" boxscale R+: "<<boxscaleRp<<"\n"
<<" boxscale R-: "<<boxscaleRm<<"\n"
<<" boxscale Z+: "<<boxscaleZp<<"\n"
<<" boxscale Z-: "<<boxscaleZm<<"\n";
os << "Algorithmic parameters are: \n"
<<" n = "<<n<<"\n"
<<" Nx = "<<Nx<<"\n"
<<" Ny = "<<Ny<<"\n"
<<" Nz = "<<Nz<<"\n"
<<" dt = "<<dt<<"\n";
os << " Stopping for Polar CG: "<<eps_pol<<"\n"
<<" Jump scale factor: "<<jfactor<<"\n"
<<" Stopping for Maxwell CG: "<<eps_maxwell<<"\n"
<<" Stopping for Gamma CG: "<<eps_gamma<<"\n"
<<" Stopping for Time CG: "<<eps_time<<"\n";
os << "Output parameters are: \n"
<<" n_out = "<<n_out<<"\n"
<<" Nx_out = "<<Nx_out<<"\n"
<<" Ny_out = "<<Ny_out<<"\n"
<<" Nz_out = "<<Nz_out<<"\n"
<<" Steps between output: "<<itstp<<"\n"
<<" Number of outputs: "<<maxout<<"\n";
os << "Boundary condition is: \n"
<<" global BC = "<<dg::bc2str(bc)<<"\n"
<<" Poloidal limiter = "<<pollim<<"\n"
<<" Parallel dissipation = "<<pardiss<<"\n"
<<" Computation mode = "<<mode<<"\n"
<<" init cond = "<<initcond<<"\n"
<<" curvature mode = "<<curvmode<<"\n";
os << std::flush;
}
};
}//namespace eule
|
import PartyBot from '<API key>';
import React, { PropTypes, Component } from 'react';
import cssModules from 'react-css-modules';
import styles from './index.module.scss';
import Heading from 'grommet/components/Heading';
import Box from 'grommet/components/Box';
import Footer from 'grommet/components/Footer';
import Button from 'grommet/components/Button';
import Form from 'grommet/components/Form';
import FormField from 'grommet/components/FormField';
import FormFields from 'grommet/components/FormFields';
import NumberInput from 'grommet/components/NumberInput';
import CloseIcon from 'grommet/components/icons/base/Close';
import Dropzone from 'react-dropzone';
import Layer from 'grommet/components/Layer';
import Header from 'grommet/components/Header';
import Section from 'grommet/components/Section';
import Paragraph from 'grommet/components/Paragraph';
import request from 'superagent';
import Select from 'react-select';
import { <API key>, CLOUDINARY_NAME, CLOUDINARY_KEY, CLOUDINARY_SECRET, <API key> } from '../../constants';
import Immutable from 'immutable';
import _ from 'underscore';
class ManageTablesPage extends Component {
constructor(props) {
super(props);
this.handleMobile = this.handleMobile.bind(this);
this.closeSetup = this.closeSetup.bind(this);
this.onDrop = this.onDrop.bind(this);
this.addVariant = this.addVariant.bind(this);
this.submitSave = this.submitSave.bind(this);
this.submitDelete = this.submitDelete.bind(this);
this.state = {
isMobile: false,
tableId: props.params.table_id || null,
confirm: false,
name: '',
variants: [],
organisationId: '<API key>',
venues: [],
venueId: '',
events: [],
eventId: '',
selectedEvents: [],
tableTypes: [],
tableTypeId: undefined,
tags: 'table',
image: null,
prevImage: null,
isNewImage: null,
prices: []
};
}
componentWillMount() {
if (this.state.tableId) {
this.setState({variants: []});
}
}
componentDidMount() {
if (typeof window !== 'undefined') {
window.addEventListener('resize', this.handleMobile);
}
let options = {
organisationId: this.state.organisationId
};
this.getVenues(options);
// IF TABLE ID EXISTS
if(this.props.params.table_id) {
let tOptions = {
organisationId: this.state.organisationId,
productId: this.props.params.table_id
}
this.getTable(tOptions);
}
}
<API key>() {
if (typeof window !== 'undefined') {
window.removeEventListener('resize', this.handleMobile);
}
}
handleMobile() {
const isMobile = window.innerWidth <= 768;
this.setState({
isMobile,
});
};
getVenues = (options) => {
PartyBot.venues.<API key>(options, (errors, response, body) => {
if(response.statusCode == 200) {
if(body.length > 0) {
this.setState({venueId: body[0]._id});
let ttOptions = {
organisationId: this.state.organisationId,
venue_id: this.state.venueId
}
// this.getEvents(ttOptions);
this.getTableTypes(ttOptions);
}
this.setState({venues: body, events: []});
}
});
}
getEvents = (options) => {
PartyBot.events.<API key>(options, (err, response, body) => {
if(!err && response.statusCode == 200) {
if(body.length > 0) {
this.setState({eventId: body[0]._id});
}
body.map((value, index) =>{
this.setState({events: this.state.events.concat({ _event: value._id, name: value.name, selected: false })});
});
}
});
}
getTableTypes = (options) => {
PartyBot.tableTypes.<API key>(options, (errors, response, body) => {
if(response.statusCode == 200) {
if(body.length > 0) {
this.setState({tableTypes: body});
let params = {
organisationId: this.state.organisationId,
venueId: this.state.venueId,
tableTypeId: body[0]._id
}
PartyBot.tableTypes.getTableType(params, (aerr, aresponse, abody) => {
let events = abody._events.map((value) => {
return value._event_id.map((avalue) => {
return {
value: avalue._id,
label: avalue.name
}
});
});
this.setState({
tableTypeId: body[0]._id,
events: _.flatten(events)
});
});
}
}
});
}
getTable = (options) => {
PartyBot.products.<API key>(options, (error, response, body) => {
if(response.statusCode == 200) {
this.setState({
name: body.name,
image: {
preview: body.image
},
prevImage: {
preview: body.image
},
variants: body.prices.map((value, index) => {
return { _event: value._event, price: value.price }
})
});
}
});
}
onVenueChange = (event) => {
let id = event.target.value;
this.setState({ venueId: id, events: [], variants: []});
let options = {
organisationId: this.state.organisationId,
venue_id: id
};
this.getTableTypes(options);
// this.getEvents(options);
}
onEventChange = (item, index, event) => {
let variants = Immutable.List(this.state.variants);
let mutated = variants.set(index, { _event: event.target.value, price: item.price});
this.setState( { variants: mutated.toArray() } );
}
onPriceChange = (item, index, event) => {
let variants = Immutable.List(this.state.variants);
let mutated = variants.set(index, { _event: item._event, price: event.target.value});
this.setState( { variants: mutated.toArray() } );
}
closeSetup(){
this.setState({
confirm: false
});
this.context.router.push('/tables');
}
addVariant() { // will create then get?
var newArray = this.state.variants.slice();
newArray.push({
_event_id: [],
description: "",
image: null,
imageUrl: ""
});
this.setState({variants:newArray})
}
removeVariant(index, event){ // delete variant ID
let variants = Immutable.List(this.state.variants);
let mutated = variants.remove(index);
// let selectedEvents = Immutable.List(this.state.selectedEvents);
// let mutatedEvents = selectedEvents.remove(index);
this.setState({
variants: mutated.toJS(),
});
}
onEventAdd = (index, selectedEvents) => {
let cloned = Immutable.List(this.state.variants);
let anIndex = Immutable.fromJS(cloned.get(index));
anIndex = anIndex.set('_event_id', selectedEvents);
let newClone = cloned.set(index, anIndex);
let selectedEventState = Immutable.List(this.state.selectedEvents);
let <API key> = selectedEventState.set(index, selectedEvents);
this.setState({selectedEvents: <API key>.toJS(), variants: newClone.toJS()});
}
setDescrpiption = (index, event) => {
let cloned = Immutable.List(this.state.variants);
let anIndex = Immutable.fromJS(cloned.get(index));
anIndex = anIndex.set('description', event.target.value);
let newClone = cloned.set(index, anIndex);
this.setState({variants: newClone.toJS()});
}
onDrop = (index, file) => {
this.setState({ isBusy: true });
let upload = request.post(<API key>)
.field('upload_preset', <API key>)
.field('file', file[0]);
console.log('dragged');
upload.end((err, response) => {
if (err) {
} else {
let cloned = Immutable.List(this.state.variants);
let anIndex = Immutable.fromJS(cloned.get(index));
anIndex = anIndex.set('image', file[0]);
anIndex = anIndex.set('imageUrl', response.body.secure_url);
let newClone = cloned.set(index, anIndex);
this.setState({variants: newClone.toJS(), isBusy: false});
}
});
}
onTypeChange = (event) => {
var id = event.target.value;
let params = {
organisationId: this.state.organisationId,
venueId: this.state.venueId,
tableTypeId: id
}
PartyBot.tableTypes.getTableType(params, (err, response, body) => {
let events = body._events.map((value) => {
return value._event_id.map((avalue) => {
return {
value: avalue._id,
label: avalue.name
}
});
});
this.setState({
tableTypeId: id,
variants: [],
events: _.flatten(events)
});
});
}
setName = (event) => {
this.setState({name: event.target.value});
}
getTypeOptions = () => {
return this.state.tableTypes.map((value, index) => {
return <option key={index} value={value._id}>{value.name}</option>;
});
}
getTableVariants = () => {
return this.state.variants.map((value, index) => {
return (
<Box key={index} separator="all">
<FormField label="Event" htmlFor="events" />
<Select
name="events"
options={this.state.events.filter((x) => {
let a = _.contains(_.uniq(_.flatten(this.state.selectedEvents)), x);
return !a;
})}
value={value._event_id}
onChange={this.onEventAdd.bind(this, index)}
multi={true}
/>
<FormField label="Description" htmlFor="<API key>">
<input id="<API key>" type="text" onChange={this.setDescrpiption.bind(this, index)} value={value.description}/>
</FormField>
<FormField label="Image">
{value.image ?
<Box size={{ width: 'large' }} align="center" justify="center">
<div>
<img src={value.image.preview} width="200" />
</div>
<Box size={{ width: 'large' }}>
<Button label="Cancel" onClick={this.onRemoveImage.bind(this)} plain={true} icon={<CloseIcon />}/>
</Box>
</Box> :
<Box align="center" justify="center" size={{ width: 'large' }}>
|
# Be sure to restart your server when you modify this file.
# Your secret key for verifying the integrity of signed cookies.
# If you change this key, all old signed cookies will become invalid!
# Make sure the secret is at least 30 characters and all random,
# no regular words or you'll be exposed to dictionary attacks.
I2db::Application.config.secret_<API key><API key>'
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Core.Interfaces
{
public static class <API key>
{
<summary>
This application name represents default commands - when there is no
command for specific application
</summary>
public const string DEFAULT_APPLICATION = "DEFAULT";
}
<summary>
Represents simple association that connects application, remote command and feedback to this command.
If ApplicationName is null - this is a default behaviour.
</summary>
public interface IApplicationCommand
{
<summary>
Name of the application
</summary>
string ApplicationName { get; }
<summary>
Remote command
</summary>
RemoteCommand RemoteCommand { get; }
<summary>
Command to be executed
</summary>
ICommand Command { get; }
<summary>
Executes associated command
</summary>
void Do();
}
}
|
<?php
namespace seregazhuk\tests\Bot\Providers;
use seregazhuk\PinterestBot\Api\Providers\User;
use seregazhuk\PinterestBot\Helpers\UrlBuilder;
/**
* Class ProfileSettingsTest
* @method User getProvider()
*/
class ProfileSettingsTest extends ProviderBaseTest
{
/** @test */
public function <API key>()
{
$provider = $this->getProvider();
$provider->sessionsHistory();
$this->assertWasGetRequest(UrlBuilder::<API key>);
}
/** @test */
public function <API key>()
{
$provider = $this->getProvider();
$provider->getLocales();
$this->assertWasGetRequest(UrlBuilder::<API key>);
}
/** @test */
public function <API key>()
{
$provider = $this->getProvider();
$provider->getCountries();
$this->assertWasGetRequest(UrlBuilder::<API key>);
}
/** @test */
public function <API key>()
{
$provider = $this->getProvider();
$provider->getAccountTypes();
$this->assertWasGetRequest(UrlBuilder::<API key>);
}
protected function getProviderClass()
{
return User::class;
}
}
|
<wicket:extend>
<div class="row">
<div class="col-md-12">
<h3>Ergebnisse</h3>
<br/>
</div>
</div>
<div class="row">
<div class="col-md-12 result-border">
<div class="row">
<div class="col-md-12">
<h4>
Erkannte Version:
<wicket:container wicket:id="schemaVersion"/>
</h4>
</div>
</div>
<div wicket:id="schemvalidationOK">
<div class="row">
<div class="col-md-12">
<br/>
<h4>Schemavalidierung</h4>
</div>
</div>
<div class="row">
<div class="col-md-12 alert alert-success">
<p>Die gewählte ebInterface Instanz entspricht den Vorgaben
des ebInterface Schemas.</p>
</div>
</div>
</div>
<div wicket:id="schemvalidationNOK">
<div class="row">
<div class="col-md-12">
<br/>
<h4>Schemavalidierung</h4>
</div>
</div>
<div class="row">
<div class="col-md-12 alert alert-danger">
<p>Die gewählte ebInterface Instanz entspricht nicht den
Vorgaben des ebInterface Schemas.</p>
<p>
<strong>Fehlerdetails: </strong>
<wicket:container wicket:id="<API key>"/>
</p>
</div>
</div>
</div>
<div wicket:id="<API key>">
<div class="row">
<div class="col-md-12">
<br/>
<h4>Validierung der XML Signatur</h4>
</div>
</div>
<div class="row">
<div class="col-md-12">
<h5>Signatur</h5>
<div wicket:id="signatureDetails"/>
<h5>Zertifikat:</h5>
<div wicket:id="certificateDetails"/>
<h5>Manifest:</h5>
<div wicket:id="manifestDetails"/>
</div>
</div>
</div>
<div wicket:id="schematronOK">
<div class="row">
<div class="col-md-12">
<br/>
<h4>
<API key>
<wicket:container wicket:id="selectedSchematron"/>
</h4>
</div>
</div>
<div class="row">
<div class="col-md-12 alert alert-success">
<p>Die gewählte ebInterface Instanz verletzt keine der
Schematronregeln</p>
</div>
</div>
</div>
<div wicket:id="schematronNOK">
<div class="row">
<div class="col-md-12">
<br/>
<h4>
<API key>
<wicket:container wicket:id="selectedSchematron"/>
</h4>
</div>
</div>
<div class="row">
<div class="col-md-12 alert alert-danger">
<p>Die gewählte ebInterface Instanz verletzt Schematron
Regeln:</p>
<div wicket:id="errorDetailsPanel"></div>
</div>
</div>
</div>
<div wicket:id="zugferdMappingLog">
<div class="row">
<div class="col-md-12">
<br/>
<h4>
<API key>
</h4>
</div>
</div>
<div class="row">
<div wicket:id="<API key>">
<div class="col-md-12 alert alert-success">
<div wicket:id="<API key>"></div>
</div>
</div>
<div wicket:id="<API key>">
<div class="col-md-12 alert alert-danger">
<div wicket:id="<API key>"></div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<br/> <br/>
<a class="btn btn-ghost btn-ghost--red" type="submit"
wicket:id="<API key>">Download ZUGFeRD XML</a>
<a class="btn btn-ghost btn-ghost--red" type="submit"
wicket:id="<API key>">Download ZUGFeRD PDF</a>
</div>
<div class="col-md-12">
<br/> <br/> <a class="btn btn-ghost btn-ghost--red" wicket:id="returnLink">Neue
Anfrage starten</a> <br/> <br/> <br/> <br/>
</div>
</div>
</wicket:extend>
|
package edu.isep.sixcolors.view.listener;
import edu.isep.sixcolors.model.Config;
import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
/**
* A popup window asking if the player want's to exit Six Colors
*/
public class Exit implements ActionListener {
@Override
public void actionPerformed(ActionEvent e) {
int option = JOptionPane.showConfirmDialog(
null,
Config.EXIT_MESSAGE,
Config.EXIT_TITLE,
JOptionPane.YES_NO_OPTION,
JOptionPane.QUESTION_MESSAGE
);
if (option == JOptionPane.YES_OPTION){
System.exit(0);
}
}
}
|
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using gView.Framework.IO;
using gView.Framework.Data;
using gView.Framework.UI;
namespace gView.Framework.UI.Dialogs
{
public partial class FormMetadata : Form
{
private Metadata _metadata;
private object _metadataObject;
public FormMetadata(XmlStream xmlStream, object metadataObject)
{
InitializeComponent();
_metadata = new Metadata();
_metadata.ReadMetadata(xmlStream);
_metadataObject = metadataObject;
}
private void FormMetadata_Load(object sender, EventArgs e)
{
if (_metadata.Providers == null) return;
foreach (IMetadataProvider provider in _metadata.Providers)
{
if (provider == null) continue;
TabPage page = new TabPage(provider.Name);
if (provider is IPropertyPage)
{
Control ctrl = ((IPropertyPage)provider).PropertyPage(null) as Control;
if (ctrl != null)
{
page.Controls.Add(ctrl);
ctrl.Dock = DockStyle.Fill;
}
if (ctrl is <API key>)
((<API key>)ctrl).MetadataObject = _metadataObject;
}
tabControl1.TabPages.Add(page);
}
}
public XmlStream Stream
{
get
{
XmlStream stream = new XmlStream("Metadata");
if (_metadata != null)
_metadata.WriteMetadata(stream);
return stream;
}
}
}
}
|
eslint-plugin-extjs
=========
[ {
// do something
}
);
Ext.Array.each(
['a', 'b'],
function() {
// do something
},
this,
false
);
The following patterns are not considered warnings:
Ext.Array.forEach(
['a', 'b'],
function() {
// do something
}
);
Ext.Array.each(
['a', 'b'],
function(item) {
if (item === 'a') {
return false;
}
}
);
Ext.Array.each(
['a', 'b'],
function() {
// do something
},
this,
true
);
ext-deps
One problem with larger ExtJS projects is keeping the [`uses`][ext-uses] and
[`requires`][ext-requires] configs for a class synchronized as its body changes
over time and dependencies are added and removed. This rule checks that all
external references within a particular class have a corresponding entry in the
`uses` or `requires` config, and that there are no extraneous dependencies
listed in the class configuration that are not referenced in the class body.
The following patterns are considered warnings:
Ext.define('App', {
requires: ['Ext.panel.Panel']
});
Ext.define('App', {
constructor: function() {
this.panel = new Ext.panel.Panel();
}
});
The following patterns are not considered warnings:
Ext.define('App', {
requires: ['Ext.panel.Panel'],
constructor: function() {
this.panel = new Ext.panel.Panel();
}
});
Ext.define('App', {
extend: 'Ext.panel.Panel'
});
no-ext-create
While using [`Ext.create`][ext-create] for instantiation has some benefits
during development, mainly synchronous loading of missing classes, it remains
slower than the `new` operator due to its extra overhead. For projects with
properly configured [`uses`][ext-uses] and [`requires`][ext-requires] blocks,
the extra features of `Ext.create` are not needed, so the `new` keyword should
be preferred in cases where the class name is static. This is confirmed by
Sencha employees, one of whom has [said][ext-create-forum]:
> 'Ext.create' is slower than 'new'. Its chief benefit is for situations where
> the class name is a dynamic value and 'new' is not an option. As long as the
> 'requires' declarations are correct, the overhead of 'Ext.create' is simply
> not needed.
The following patterns are considered warnings:
var panel = Ext.create('Ext.util.Something', {
someConfig: true
});
The following patterns are not considered warnings:
var panel = new Ext.util.Something({
someConfig: true
});
var panel = Ext.create(getDynamicClassName(), {
config: true
});
no-ext-multi-def
Best practices for ExtJS 4 [dictate][ext-class-system] that each class
definition be placed in its own file, and that the filename should correspond to
the class being defined therein. This rule checks that there is no more than one
top-level class definition included per file.
The following patterns are considered warnings:
// all in one file
Ext.define('App.First', {
});
Ext.define('App.Second', {
});
The following patterns are not considered warnings:
// file a
Ext.define('App', {
// class definition
});
// file b
Ext.define('App', {
dynamicDefine: function() {
Ext.define('Dynamic' + Ext.id(), {
// class definition
});
}
});
[array-foreach]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach
[ext-array-foreach]: http://docs.sencha.com/extjs/4.2.1/#!/api/Ext.<API key>
[ext-array-each]: http://docs.sencha.com/extjs/4.2.1/#!/api/Ext.Array-method-each
[ext-class-system]: http://docs.sencha.com/extjs/4.2.1/#!/guide/<API key>%29-source-files
[ext-create]: http://docs.sencha.com/extjs/4.2.1/#!/api/Ext-method-create
[ext-create-forum]: http://www.sencha.com/forum/showthread.php?166536-Ext.draw-Ext.<API key>&p=700522&viewfull=1#post700522
[ext-requires]: http://docs.sencha.com/extjs/4.2.1/#!/api/Ext.Class-cfg-requires
[ext-uses]: http://docs.sencha.com/extjs/4.2.1/#!/api/Ext.Class-cfg-uses
|
This is an example from `pst-solides3d` documentation.
Compiled example

|
namespace EgaViewer_v2
{
partial class CustomPictureBox
{
<summary>
Required designer variable.
</summary>
private System.ComponentModel.IContainer components = null;
<summary>
Clean up any resources being used.
</summary>
<param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
<summary>
Required method for Designer support - do not modify
the contents of this method with the code editor.
</summary>
private void InitializeComponent()
{
components = new System.ComponentModel.Container();
}
#endregion
}
}
|
// SFML - Simple and Fast Multimedia Library
// Laurent Gomila (laurent@sfml-dev.org)
// In no event will the authors be held liable for any damages arising from the use of this software.
// including commercial applications, and to alter it and redistribute it freely,
// subject to the following restrictions:
// 1. The origin of this software must not be misrepresented;
// you must not claim that you wrote the original software.
// If you use this software in a product, an acknowledgment
// in the product documentation would be appreciated but is not required.
// 2. Altered source versions must be plainly marked as such,
// and must not be misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
#import <Cocoa/Cocoa.h>
#import <SFML/Graphics.hpp>
/*
* NB: We need pointers for C++ objects fields in Obj-C interface !
* The recommended way is to use PIMPL idiom.
*
* It's elegant. Moreover, we do no constrain
* other file including this one to be Obj-C++.
*/
struct SFMLmainWindow;
@interface CocoaAppDelegate : NSObject <<API key>>
{
@private
NSWindow* m_window;
NSView* m_sfmlView;
NSTextField* m_textField;
SFMLmainWindow* m_mainWindow;
NSTimer* m_renderTimer;
BOOL m_visible;
BOOL m_initialized;
}
@property (retain) IBOutlet NSWindow* window;
@property (assign) IBOutlet NSView* sfmlView;
@property (assign) IBOutlet NSTextField* textField;
-(IBAction)colorChanged:(NSPopUpButton*)sender;
-(IBAction)rotationChanged:(NSSlider*)sender;
-(IBAction)visibleChanged:(NSButton*)sender;
-(IBAction)textChanged:(NSTextField*)sender;
-(IBAction)updateText:(NSButton*)sender;
@end
/*
* This interface is used to prevent the system alert produced when the SFML view
* has the focus and the user press a key.
*/
@interface SilentWindow : NSWindow
-(void)keyDown:(NSEvent*)theEvent;
@end
|
namespace StudentClass
{
public class Course
{
public Course(string name)
: this()
{
this.Name = name;
}
public Course()
{
}
public string Name { get; private set; }
public override string ToString()
{
return this.Name;
}
}
}
|
// Generated by class-dump 3.5 (64 bit).
#import "CDStructures.h"
@interface <API key> : NSObject <<API key>>
{
SEL _action;
long long _tag;
}
@property long long tag; // @synthesize tag=_tag;
@property SEL action; // @synthesize action=_action;
@end
|
<!DOCTYPE HTML PUBLIC "-
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_112-google-v7) on Thu Mar 02 16:51:04 PST 2017 -->
<title><API key></title>
<meta name="date" content="2017-03-02">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="<API key>";
}
}
catch(err) {
}
var methods = {"i0":9,"i1":9};
var tabs = {65535:["t0","All Methods"],1:["t1","Static Methods"],8:["t4","Concrete Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<div class="topNav"><a name="navbar.top">
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../index-all.html">Index</a></li>
<li><a href="../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../org/robolectric/res/ResourceTable.Visitor.html" title="interface in org.robolectric.res"><span class="typeNameLink">Prev Class</span></a></li>
<li><a href="../../../org/robolectric/res/<API key>.html" title="interface in org.robolectric.res"><span class="typeNameLink">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../index.html?org/robolectric/res/<API key>.html" target="_top">Frames</a></li>
<li><a href="<API key>.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="<API key>">
<li><a href="../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!
allClassesLink = document.getElementById("<API key>");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary: </li>
<li>Nested | </li>
<li>Field | </li>
<li><a href="#constructor.summary">Constr</a> | </li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li>Field | </li>
<li><a href="#constructor.detail">Constr</a> | </li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.top">
</a></div>
<div class="header">
<div class="subTitle">org.robolectric.res</div>
<h2 title="Class <API key>" class="title">Class <API key></h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object</li>
<li>
<ul class="inheritance">
<li>org.robolectric.res.<API key></li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<br>
<pre>public class <span class="typeNameLabel"><API key></span>
extends java.lang.Object</pre>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<ul class="blockList">
<li class="blockList"><a name="constructor.summary">
</a>
<h3>Constructor Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../../org/robolectric/res/<API key>.html#<API key>--"><API key></a></span>()</code> </td>
</tr>
</table>
</li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="method.summary">
</a>
<h3>Method Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd"> </span></span><span id="t1" class="tableTab"><span><a href="javascript:show(1);">Static Methods</a></span><span class="tabEnd"> </span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd"> </span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code>static <a href="../../../org/robolectric/res/<API key>.html" title="class in org.robolectric.res"><API key></a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../org/robolectric/res/<API key>.html#<API key>.robolectric.res.ResourcePath-"><API key></a></span>(<a href="../../../org/robolectric/res/ResourcePath.html" title="class in org.robolectric.res">ResourcePath</a> resourcePath)</code>
<div class="block">Builds an Android framework resource table in the "android" package space.</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>static <a href="../../../org/robolectric/res/<API key>.html" title="class in org.robolectric.res"><API key></a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../org/robolectric/res/<API key>.html#<API key>.lang.String-org.robolectric.res.ResourcePath...-">newResourceTable</a></span>(java.lang.String packageName,
<a href="../../../org/robolectric/res/ResourcePath.html" title="class in org.robolectric.res">ResourcePath</a>... resourcePaths)</code>
<div class="block">Creates an application resource table which can be constructed with multiple resources paths representing
overlayed resource libraries.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.java.lang.Object">
</a>
<h3>Methods inherited from class java.lang.Object</h3>
<code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<ul class="blockList">
<li class="blockList"><a name="constructor.detail">
</a>
<h3>Constructor Detail</h3>
<a name="<API key>
</a>
<ul class="blockListLast">
<li class="blockList">
<h4><API key></h4>
<pre>public <API key>()</pre>
</li>
</ul>
</li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="method.detail">
</a>
<h3>Method Detail</h3>
<a name="<API key>.robolectric.res.ResourcePath-">
</a>
<ul class="blockList">
<li class="blockList">
<h4><API key></h4>
<pre>public static <a href="../../../org/robolectric/res/<API key>.html" title="class in org.robolectric.res"><API key></a> <API key>(<a href="../../../org/robolectric/res/ResourcePath.html" title="class in org.robolectric.res">ResourcePath</a> resourcePath)</pre>
<div class="block">Builds an Android framework resource table in the "android" package space.</div>
</li>
</ul>
<a name="<API key>.lang.String-org.robolectric.res.ResourcePath...-">
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>newResourceTable</h4>
<pre>public static <a href="../../../org/robolectric/res/<API key>.html" title="class in org.robolectric.res"><API key></a> newResourceTable(java.lang.String packageName,
<a href="../../../org/robolectric/res/ResourcePath.html" title="class in org.robolectric.res">ResourcePath</a>... resourcePaths)</pre>
<div class="block">Creates an application resource table which can be constructed with multiple resources paths representing
overlayed resource libraries.</div>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<div class="bottomNav"><a name="navbar.bottom">
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../index-all.html">Index</a></li>
<li><a href="../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../org/robolectric/res/ResourceTable.Visitor.html" title="interface in org.robolectric.res"><span class="typeNameLink">Prev Class</span></a></li>
<li><a href="../../../org/robolectric/res/<API key>.html" title="interface in org.robolectric.res"><span class="typeNameLink">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../index.html?org/robolectric/res/<API key>.html" target="_top">Frames</a></li>
<li><a href="<API key>.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="<API key>">
<li><a href="../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!
allClassesLink = document.getElementById("<API key>");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary: </li>
<li>Nested | </li>
<li>Field | </li>
<li><a href="#constructor.summary">Constr</a> | </li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li>Field | </li>
<li><a href="#constructor.detail">Constr</a> | </li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.bottom">
</a></div>
</body>
</html>
|
//Generated by the Argon Build System
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "opus/silk/float/main_FLP.h"
/* Autocorrelations for a warped frequency axis */
void <API key>(
silk_float *corr, /* O Result [order + 1] */
const silk_float *input, /* I Input data to correlate */
const silk_float warping, /* I Warping coefficient */
const opus_int length, /* I Length of input */
const opus_int order /* I Correlation order (even) */
)
{
opus_int n, i;
double tmp1, tmp2;
double state[ MAX_SHAPE_LPC_ORDER + 1 ] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 };
double C[ MAX_SHAPE_LPC_ORDER + 1 ] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 };
/* Order must be even */
silk_assert( ( order & 1 ) == 0 );
/* Loop over samples */
for( n = 0; n < length; n++ ) {
tmp1 = input[ n ];
/* Loop over allpass sections */
for( i = 0; i < order; i += 2 ) {
/* Output of allpass section */
tmp2 = state[ i ] + warping * ( state[ i + 1 ] - tmp1 );
state[ i ] = tmp1;
C[ i ] += state[ 0 ] * tmp1;
/* Output of allpass section */
tmp1 = state[ i + 1 ] + warping * ( state[ i + 2 ] - tmp2 );
state[ i + 1 ] = tmp2;
C[ i + 1 ] += state[ 0 ] * tmp2;
}
state[ order ] = tmp1;
C[ order ] += state[ 0 ] * tmp1;
}
/* Copy correlations in silk_float output format */
for( i = 0; i < order + 1; i++ ) {
corr[ i ] = ( silk_float )C[ i ];
}
}
|
export const <API key> = {"viewBox":"0 0 24 24","children":[{"name":"path","attribs":{"d":"M0 0h24v24H0V0z","fill":"none"},"children":[]},{"name":"path","attribs":{"d":"M8.1 13.34l2.83-2.83L3.91 3.5c-1.56 1.56-1.56 4.09 0 5.66l4.19 4.18zm12.05-3.19c1.91-1.91 2.28-4.65.81-6.12-1.46-1.46-4.2-1.1-6.12.81-1.59 1.59-2.09 3.74-1.38 5.27L3.7 19.87l1.41 1.41L12 14.41l6.88 6.88 1.41-1.41L13.41 13l1.47-1.47c1.53.71 3.68.21 5.27-1.38z"},"children":[]}]};
|
# encoding: UTF-8
module DocuBot::LinkTree; end
class DocuBot::LinkTree::Node
attr_accessor :title, :link, :page, :parent
def initialize( title=nil, link=nil, page=nil )
@title,@link,@page = title,link,page
@children = []
end
def anchor
@link[/
end
def file
@link.sub(/
end
def leaf?
!@children.any?{ |node| node.page != @page }
end
# Add a new link underneath a link to its logical parent
def <API key>( title, link, page=nil )
node = DocuBot::LinkTree::Node.new( title, link, page )
parent_link = if node.anchor
node.file
elsif File.basename(link)=='index.html'
File.dirname(File.dirname(link))/'index.html'
else
(File.dirname(link) / 'index.html')
end
#puts "Adding #{title.inspect} (#{link}) to hierarchy under #{parent_link}"
parent = descendants.find{ |n| n.link==parent_link } || self
parent << node
end
def <<( node )
node.parent = self
@children << node
end
def []( child_index )
@children[child_index]
end
def children( parent_link=nil, &block )
if parent_link
root = find( parent_link )
root ? root.children( &block ) : []
else
@children
end
end
def descendants
( @children + @children.map{ |child| child.descendants } ).flatten
end
def find( link )
# TODO: this is eminently cachable
descendants.find{ |node| node.link==link }
end
def depth
# Cached assuming no one is going to shuffle the nodes after placement
@depth ||= ancestors.length
end
def ancestors
# Cached assuming no one is going to shuffle the nodes after placement
return @ancestors if @ancestors
@ancestors = []
node = self
@ancestors << node while node = node.parent
@ancestors.reverse!
end
def to_s
"#{@title} (#{@link}) - #{@page && @page.title}"
end
def to_txt( depth=0 )
indent = " "*depth
[
indent+to_s,
children.map{|kid|kid.to_txt(depth+1)}
].flatten.join("\n")
end
end
class DocuBot::LinkTree::Root < DocuBot::LinkTree::Node
undef_method :title
undef_method :link
undef_method :page
attr_reader :bundle
def initialize( bundle )
@bundle = bundle
@children = []
end
def <<( node )
node.parent = nil
@children << node
end
def to_s
"(Table of Contents)"
end
end
|
"use strict"
const messages = require("..").messages
const ruleName = require("..").ruleName
const rules = require("../../../rules")
const rule = rules[ruleName]
testRule(rule, {
ruleName,
config: ["always"],
accept: [ {
code: "a { background-size: 0 , 0; }",
}, {
code: "a { background-size: 0 ,0; }",
}, {
code: "a::before { content: \"foo,bar,baz\"; }",
description: "strings",
}, {
code: "a { transform: translate(1,1); }",
description: "function arguments",
} ],
reject: [ {
code: "a { background-size: 0, 0; }",
message: messages.expectedBefore(),
line: 1,
column: 23,
}, {
code: "a { background-size: 0 , 0; }",
message: messages.expectedBefore(),
line: 1,
column: 25,
}, {
code: "a { background-size: 0\n, 0; }",
message: messages.expectedBefore(),
line: 2,
column: 1,
}, {
code: "a { background-size: 0\r\n, 0; }",
description: "CRLF",
message: messages.expectedBefore(),
line: 2,
column: 1,
}, {
code: "a { background-size: 0\t, 0; }",
message: messages.expectedBefore(),
line: 1,
column: 24,
} ],
})
testRule(rule, {
ruleName,
config: ["never"],
accept: [ {
code: "a { background-size: 0, 0; }",
}, {
code: "a { background-size: 0,0; }",
}, {
code: "a::before { content: \"foo ,bar ,baz\"; }",
description: "strings",
}, {
code: "a { transform: translate(1 ,1); }",
description: "function arguments",
} ],
reject: [ {
code: "a { background-size: 0 , 0; }",
message: messages.rejectedBefore(),
line: 1,
column: 24,
}, {
code: "a { background-size: 0 , 0; }",
message: messages.rejectedBefore(),
line: 1,
column: 25,
}, {
code: "a { background-size: 0\n, 0; }",
message: messages.rejectedBefore(),
line: 2,
column: 1,
}, {
code: "a { background-size: 0\r\n, 0; }",
description: "CRLF",
message: messages.rejectedBefore(),
line: 2,
column: 1,
}, {
code: "a { background-size: 0\t, 0; }",
message: messages.rejectedBefore(),
line: 1,
column: 24,
} ],
})
testRule(rule, {
ruleName,
config: ["always-single-line"],
accept: [ {
code: "a { background-size: 0 , 0; }",
}, {
code: "a { background-size: 0 ,0; }",
}, {
code: "a { background-size: 0 ,0;\n}",
description: "single-line list, multi-line block",
}, {
code: "a { background-size: 0 ,0;\r\n}",
description: "single-line list, multi-line block with CRLF",
}, {
code: "a { background-size: 0,\n0; }",
description: "ignores multi-line list",
}, {
code: "a { background-size: 0,\r\n0; }",
description: "ignores multi-line list with CRLF",
}, {
code: "a::before { content: \"foo,bar,baz\"; }",
description: "strings",
}, {
code: "a { transform: translate(1,1); }",
description: "function arguments",
} ],
reject: [ {
code: "a { background-size: 0, 0; }",
message: messages.<API key>(),
line: 1,
column: 23,
}, {
code: "a { background-size: 0, 0;\n}",
message: messages.<API key>(),
line: 1,
column: 23,
}, {
code: "a { background-size: 0, 0;\r\n}",
description: "CRLF",
message: messages.<API key>(),
line: 1,
column: 23,
}, {
code: "a { background-size: 0 , 0; }",
message: messages.<API key>(),
line: 1,
column: 25,
}, {
code: "a { background-size: 0\t, 0; }",
message: messages.<API key>(),
line: 1,
column: 24,
} ],
})
testRule(rule, {
ruleName,
config: ["never-single-line"],
accept: [ {
code: "a { background-size: 0, 0; }",
}, {
code: "a { background-size: 0,0; }",
}, {
code: "a { background-size: 0,0;\n}",
description: "single-line list, multi-line block",
}, {
code: "a { background-size: 0,0;\r\n}",
description: "single-line list, multi-line block with CRLF",
}, {
code: "a { background-size: 0 ,\n0; }",
description: "ignores multi-line list",
}, {
code: "a { background-size: 0 ,\r\n0; }",
description: "ignores multi-line list with CRLF",
}, {
code: "a::before { content: \"foo ,bar ,baz\"; }",
description: "strings",
}, {
code: "a { transform: translate(1 ,1); }",
description: "function arguments",
} ],
reject: [ {
code: "a { background-size: 0 , 0; }",
message: messages.<API key>(),
line: 1,
column: 24,
}, {
code: "a { background-size: 0 , 0;\n}",
message: messages.<API key>(),
line: 1,
column: 24,
}, {
code: "a { background-size: 0 , 0;\r\n}",
description: "CRLF",
message: messages.<API key>(),
line: 1,
column: 24,
}, {
code: "a { background-size: 0 , 0; }",
message: messages.<API key>(),
line: 1,
column: 25,
}, {
code: "a { background-size: 0\t, 0; }",
message: messages.<API key>(),
line: 1,
column: 24,
} ],
})
|
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Login Page - Photon Admin Panel Theme</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">
<link rel="shortcut icon" href="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/js/bootstrap/js/plugins/prettify/js/plugins/favicon.ico"/>
<link rel="apple-touch-icon" href="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/js/bootstrap/js/plugins/prettify/js/plugins/iosicon.png"/>
<link rel="stylesheet" href="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/js/bootstrap/js/plugins/prettify/js/plugins/css/css_compiled/photon-min.css?v1.1" media="all"/>
<link rel="stylesheet" href="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/js/bootstrap/js/plugins/prettify/js/plugins/css/css_compiled/photon-min-part2.css?v1.1" media="all"/>
<link rel="stylesheet" href="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/js/bootstrap/js/plugins/prettify/js/plugins/css/css_compiled/<API key>.css?v1.1" media="all"/>
<!--[if IE]>
<link rel="stylesheet" type="text/css" href="css/css_compiled/ie-only-min.css?v1.1" />
<![endif]
<!--[if lt IE 9]>
<link rel="stylesheet" type="text/css" href="css/css_compiled/ie8-only-min.css?v1.1" />
<script type="text/javascript" src="js/plugins/excanvas.js"></script>
<script type="text/javascript" src="js/plugins/html5shiv.js"></script>
<script type="text/javascript" src="js/plugins/respond.min.js"></script>
<script type="text/javascript" src="js/plugins/fixFontIcons.js"></script>
<![endif]
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.0/jquery-ui.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/js/bootstrap/js/plugins/prettify/js/plugins/js/bootstrap/bootstrap.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/js/bootstrap/js/plugins/prettify/js/plugins/js/plugins/modernizr.custom.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/js/bootstrap/js/plugins/prettify/js/plugins/js/plugins/jquery.pnotify.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/js/bootstrap/js/plugins/prettify/js/plugins/js/plugins/less-1.3.1.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/js/bootstrap/js/plugins/prettify/js/plugins/js/plugins/xbreadcrumbs.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/js/bootstrap/js/plugins/prettify/js/plugins/js/plugins/jquery.maskedinput-1.3.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/js/bootstrap/js/plugins/prettify/js/plugins/js/plugins/jquery.autotab-1.1b.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/js/bootstrap/js/plugins/prettify/js/plugins/js/plugins/charCount.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/js/bootstrap/js/plugins/prettify/js/plugins/js/plugins/jquery.textareaCounter.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/js/bootstrap/js/plugins/prettify/js/plugins/js/plugins/elrte.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/js/bootstrap/js/plugins/prettify/js/plugins/js/plugins/elrte.en.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/js/bootstrap/js/plugins/prettify/js/plugins/js/plugins/select2.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/js/bootstrap/js/plugins/prettify/js/plugins/js/plugins/jquery-picklist.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/js/bootstrap/js/plugins/prettify/js/plugins/js/plugins/jquery.validate.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/js/bootstrap/js/plugins/prettify/js/plugins/js/plugins/additional-methods.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/js/bootstrap/js/plugins/prettify/js/plugins/js/plugins/jquery.form.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/js/bootstrap/js/plugins/prettify/js/plugins/js/plugins/jquery.metadata.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/js/bootstrap/js/plugins/prettify/js/plugins/js/plugins/jquery.mockjax.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/js/bootstrap/js/plugins/prettify/js/plugins/js/plugins/jquery.uniform.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/js/bootstrap/js/plugins/prettify/js/plugins/js/plugins/jquery.tagsinput.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/js/bootstrap/js/plugins/prettify/js/plugins/js/plugins/jquery.rating.pack.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/js/bootstrap/js/plugins/prettify/js/plugins/js/plugins/farbtastic.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/js/bootstrap/js/plugins/prettify/js/plugins/js/plugins/jquery.timeentry.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/js/bootstrap/js/plugins/prettify/js/plugins/js/plugins/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/js/bootstrap/js/plugins/prettify/js/plugins/js/plugins/jquery.jstree.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/js/bootstrap/js/plugins/prettify/js/plugins/js/plugins/dataTables.bootstrap.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/js/bootstrap/js/plugins/prettify/js/plugins/js/plugins/jquery.mousewheel.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/js/bootstrap/js/plugins/prettify/js/plugins/js/plugins/jquery.mCustomScrollbar.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/js/bootstrap/js/plugins/prettify/js/plugins/js/plugins/jquery.flot.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/js/bootstrap/js/plugins/prettify/js/plugins/js/plugins/jquery.flot.stack.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/js/bootstrap/js/plugins/prettify/js/plugins/js/plugins/jquery.flot.pie.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/js/bootstrap/js/plugins/prettify/js/plugins/js/plugins/jquery.flot.resize.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/js/bootstrap/js/plugins/prettify/js/plugins/js/plugins/raphael.2.1.0.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/js/bootstrap/js/plugins/prettify/js/plugins/js/plugins/justgage.1.0.1.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/js/bootstrap/js/plugins/prettify/js/plugins/js/plugins/jquery.qrcode.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/js/bootstrap/js/plugins/prettify/js/plugins/js/plugins/jquery.clock.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/js/bootstrap/js/plugins/prettify/js/plugins/js/plugins/jquery.countdown.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/js/bootstrap/js/plugins/prettify/js/plugins/js/plugins/jquery.jqtweet.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/js/bootstrap/js/plugins/prettify/js/plugins/js/plugins/jquery.cookie.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/js/bootstrap/js/plugins/prettify/js/plugins/js/plugins/<API key>.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/js/bootstrap/js/plugins/prettify/js/plugins/js/plugins/prettify/prettify.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/js/bootstrap/js/plugins/prettify/js/plugins/js/plugins/bootstrapSwitch.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/js/bootstrap/js/plugins/prettify/js/plugins/js/plugins/mfupload.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/js/bootstrap/js/plugins/prettify/js/plugins/js/common.js"></script>
</head>
<body class="body-login">
<div class="nav-fixed-topright" style="visibility: hidden">
<ul class="nav nav-user-menu">
<li class="<API key>">
<a href="javascript:;">
<i class="user-icon"></i><span class="nav-user-selection">Theme Options</span><i class="icon-menu-arrow"></i>
</a>
<ul class="nav user-sub-menu">
<li class="light">
<a href="javascript:;">
<i class='icon-photon stop'></i>Light Version
</a>
</li>
<li class="dark">
<a href="javascript:;">
<i class='icon-photon stop'></i>Dark Version
</a>
</li>
</ul>
</li>
<li>
<a href="javascript:;">
<i class="icon-photon mail"></i>
</a>
</li>
<li>
<a href="javascript:;">
<i class="icon-photon comment_alt2_stroke"></i>
<div class="notification-count">12</div>
</a>
</li>
</ul>
</div>
<script>
$(function(){
setTimeout(function(){
$('.nav-fixed-topright').removeAttr('style');
}, 300);
$(window).scroll(function(){
if($('.<API key>').length){
var scrollState = $(window).scrollTop();
if (scrollState > 0) $('.nav-fixed-topright').addClass('nav-released');
else $('.nav-fixed-topright').removeClass('nav-released')
}
});
$('.<API key>').on('click', function(){
$(this).toggleClass('active-user-menu');
});
$('.user-sub-menu .light').on('click', function(){
if ($('body').is('.light-version')) return;
$('body').addClass('light-version');
setTimeout(function() {
$.cookie('themeColor', 'light', {
expires: 7,
path: '/'
});
}, 500);
});
$('.user-sub-menu .dark').on('click', function(){
if ($('body').is('.light-version')) {
$('body').removeClass('light-version');
$.cookie('themeColor', 'dark', {
expires: 7,
path: '/'
});
}
});
});
</script>
<div class="container-login">
<div class="<API key>">
<div class="form-window-login">
<div class="<API key>">
<div class="login-logo">
<img src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/js/bootstrap/js/plugins/prettify/js/plugins/images/photon/login-logo@2x.png" alt="Photon UI"/>
</div>
<h2 class="login-title">Welcome to Photon UI!</h2>
<div class="login-member">Not a Member? <a href="jquery.autotab-1.1b.js.html#">Sign Up »</a>
<a href="jquery.autotab-1.1b.js.html#" class="btn btn-facebook"><i class="icon-fb"></i>Login with Facebook<i class="icon-fb-arrow"></i></a>
</div>
<div class="login-or">Or</div>
<div class="login-input-area">
<form method="POST" action="dashboard.php">
<span class="help-block">Login With Your Photon Account</span>
<input type="text" name="email" placeholder="Email">
<input type="password" name="password" placeholder="Password">
<button type="submit" class="btn btn-large btn-success btn-login">Login</button>
</form>
<a href="jquery.autotab-1.1b.js.html#" class="forgot-pass">Forgot Your Password?</a>
</div>
</div>
</div>
</div>
</div>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-1936460-27']);
_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>
</body>
</html>
|
code[class*="language-"],
pre[class*="language-"] {
color: black;
text-shadow: 0 1px white;
font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
direction: ltr;
text-align: left;
white-space: pre;
word-spacing: normal;
word-break: normal;
line-height: 1.5;
-moz-tab-size: 4;
-o-tab-size: 4;
tab-size: 4;
-webkit-hyphens: none;
-moz-hyphens: none;
-ms-hyphens: none;
hyphens: none;
}
pre[class*="language-"]::-moz-selection, pre[class*="language-"] ::-moz-selection,
code[class*="language-"]::-moz-selection, code[class*="language-"] ::-moz-selection {
text-shadow: none;
background: #b3d4fc;
}
pre[class*="language-"]::selection, pre[class*="language-"] ::selection,
code[class*="language-"]::selection, code[class*="language-"] ::selection {
text-shadow: none;
background: #b3d4fc;
}
@media print {
code[class*="language-"],
pre[class*="language-"] {
text-shadow: none;
}
}
/* Code blocks */
pre[class*="language-"] {
padding: 1em;
margin: .5em 0;
overflow: auto;
}
:not(pre) > code[class*="language-"],
pre[class*="language-"] {
background: #f5f2f0;
}
/* Inline code */
:not(pre) > code[class*="language-"] {
padding: .1em;
border-radius: .3em;
}
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
color: slategray;
}
.token.punctuation {
color: #999;
}
.namespace {
opacity: .7;
}
.token.property,
.token.tag,
.token.boolean,
.token.number,
.token.constant,
.token.symbol,
.token.deleted {
color: #905;
}
.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted {
color: #690;
}
.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string {
color: #a67f59;
background: hsla(0, 0%, 100%, .5);
}
.token.atrule,
.token.attr-value,
.token.keyword {
color: #07a;
}
.token.function {
color: #DD4A68;
}
.token.regex,
.token.important,
.token.variable {
color: #e90;
}
.token.important,
.token.bold {
font-weight: bold;
}
.token.italic {
font-style: italic;
}
.token.entity {
cursor: help;
}
pre[data-line] {
position: relative;
padding: 1em 0 1em 3em;
}
.line-highlight {
position: absolute;
left: 0;
right: 0;
padding: inherit 0;
margin-top: 1em;
background: hsla(24, 20%, 50%,.08);
background: -moz-linear-gradient(left, hsla(24, 20%, 50%,.1) 70%, hsla(24, 20%, 50%,0));
background: -<API key>(left, hsla(24, 20%, 50%,.1) 70%, hsla(24, 20%, 50%,0));
background: -o-linear-gradient(left, hsla(24, 20%, 50%,.1) 70%, hsla(24, 20%, 50%,0));
background: linear-gradient(left, hsla(24, 20%, 50%,.1) 70%, hsla(24, 20%, 50%,0));
pointer-events: none;
line-height: inherit;
white-space: pre;
}
.line-highlight:before,
.line-highlight[data-end]:after {
content: attr(data-start);
position: absolute;
top: .4em;
left: .6em;
min-width: 1em;
padding: 0 .5em;
background-color: hsla(24, 20%, 50%,.4);
color: hsl(24, 20%, 95%);
font: bold 65%/1.5 sans-serif;
text-align: center;
vertical-align: .3em;
border-radius: 999px;
text-shadow: none;
box-shadow: 0 1px white;
}
.line-highlight[data-end]:after {
content: attr(data-end);
top: auto;
bottom: .4em;
}
pre.line-numbers {
position: relative;
padding-left: 3.8em;
counter-reset: linenumber;
}
pre.line-numbers > code {
position: relative;
}
.line-numbers .line-numbers-rows {
position: absolute;
pointer-events: none;
top: 0;
font-size: 100%;
left: -3.8em;
width: 3em; /* works for line-numbers below 1000 lines */
letter-spacing: -1px;
border-right: 1px solid #999;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.line-numbers-rows > span {
pointer-events: none;
display: block;
counter-increment: linenumber;
}
.line-numbers-rows > span:before {
content: counter(linenumber);
color: #999;
display: block;
padding-right: 0.8em;
text-align: right;
}
|
# -*- coding: utf-8 -*-
from datetime import datetime, timedelta
import os
from flask import request
from flask import Flask
import pytz
import db
from utils import get_remote_addr, get_location_data
app = Flask(__name__)
@app.route('/yo-water/', methods=['POST', 'GET'])
def yowater():
payload = request.args if request.args else request.get_json(force=True)
username = payload.get('username')
reminder = db.reminders.find_one({'username': username})
reply_object = payload.get('reply')
if reply_object is None:
if db.reminders.find_one({'username': username}) is None:
address = get_remote_addr(request)
data = get_location_data(address)
if not data:
return 'Timezone needed'
user_data = {'created': datetime.now(pytz.utc),
'username': username}
if data.get('time_zone'):
user_data.update({'timezone': data.get('time_zone')})
db.reminders.insert(user_data)
return 'OK'
else:
reply_text = reply_object.get('text')
if reply_text == u'Can\'t right now ':
reminder['trigger_date'] = datetime.now(pytz.utc) + timedelta(minutes=15)
else:
reminder['step'] += 1
reminder['trigger_date'] = datetime.now(pytz.utc) + timedelta(minutes=60)
reminder['last_reply_date'] = datetime.now(pytz.utc)
db.reminders.update({'username': username},
reminder)
db.replies.insert({'username': username,
'created': datetime.now(pytz.utc),
'reply': reply_text})
return 'OK'
if __name__ == "__main__":
app.debug = True
app.run(host="0.0.0.0", port=int(os.environ.get("PORT", "5000")))
|
<html>
<head>
<title>Terry George's panel show appearances</title>
<script type="text/javascript" src="../common.js"></script>
<link rel="stylesheet" media="all" href="../style.css" type="text/css"/>
<script type="text/javascript" src="../people.js"></script>
<!--#include virtual="head.txt" -->
</head>
<body>
<!--#include virtual="nav.txt" -->
<div class="page">
<h1>Terry George's panel show appearances</h1>
<p>Terry George has appeared in <span class="total">1</span> episodes between 2009-2009. <a href="http:
<div class="performerholder">
<table class="performer">
<tr style="vertical-align:bottom;">
<td><div style="height:100px;" class="performances male" title="1"></div><span class="year">2009</span></td>
</tr>
</table>
</div>
<ol class="episodes">
<li><strong>2009-06-26</strong> / <a href="../shows/loosewomen.html">Loose Women</a></li>
</ol>
</div>
</body>
</html>
|
{% extends "base.html" %}
{% block title %} new statement
{% endblock title %}
{% load crispy_forms_tags %}
{% block content %}
<h1>Create a new {{ model_name_lower }}!</h1>
{% if request.user.is_anonymous %}
Only signed-in users can create {{ model_name_lower }}s!
{% else %}
{% crispy form form.helper %}
{% endif %}
{% endblock content %}
{% block javascript %}
{{ block.super }}
{{ form.media }}
{% endblock javascript %}
|
from django.conf.urls import patterns, include, url
from django.conf import settings
from django.conf.urls.static import static
from django.contrib import admin
admin.autodiscover()
import views
urlpatterns = patterns('',
url(r'^pis', views.pis),
url(r'^words', views.words, { 'titles': False }),
url(r'^projects', views.projects),
url(r'^posters', views.posters),
url(r'^posterpresenters', views.posterpresenters),
url(r'^pigraph', views.pigraph),
url(r'^institutions', views.institutions),
url(r'^institution/(?P<institutionid>\d+)', views.institution),
url(r'^profile/$', views.profile),
url(r'^schedule/(?P<email>\S+)', views.schedule),
url(r'^ratemeeting/(?P<rmid>\d+)/(?P<email>\S+)', views.ratemeeting),
url(r'^submitrating/(?P<rmid>\d+)/(?P<email>\S+)', views.submitrating),
url(r'^feedback/(?P<email>\S+)', views.after),
url(r'^breakouts', views.breakouts),
url(r'^breakout/(?P<bid>\d+)', views.breakout),
url(r'^about', views.about),
url(r'^buginfo', views.buginfo),
url(r'^allrms', views.allrms),
url(r'^allratings', views.allratings),
url(r'^login', views.login),
url(r'^logout', views.logout),
url(r'^edit_home_page', views.edit_home_page),
url(r'^pi/(?P<userid>\d+)', views.pi), # , name = 'pi'),
url(r'^pi/(?P<email>\S+)', views.piEmail), # , name = 'pi'),
url(r'^project/(?P<abstractid>\S+)', views.project, name = 'project'),
url(r'^scope=(?P<scope>\w+)/(?P<url>.+)$', views.set_scope),
url(r'^active=(?P<active>\d)/(?P<url>.+)$', views.set_active),
url(r'^admin/', include(admin.site.urls)),
(r'', include('django_browserid.urls')),
url(r'^$', views.index, name = 'index'),
) + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
|
var test = require('tap').test;
var CronExpression = require('../lib/expression');
test('Fields are exposed', function(t){
try {
var interval = CronExpression.parse('0 1 2 3 * 1-3,5');
t.ok(interval, 'Interval parsed');
CronExpression.map.forEach(function(field) {
interval.fields[field] = [];
t.throws(function() {
interval.fields[field].push(-1);
}, /Cannot add property .*?, object is not extensible/, field + ' is frozen');
delete interval.fields[field];
});
interval.fields.dummy = [];
t.same(interval.fields.dummy, undefined, 'Fields is frozen');
t.same(interval.fields.second, [0], 'Second matches');
t.same(interval.fields.minute, [1], 'Minute matches');
t.same(interval.fields.hour, [2], 'Hour matches');
t.same(interval.fields.dayOfMonth, [3], 'Day of month matches');
t.same(interval.fields.month, [1,2,3,4,5,6,7,8,9,10,11,12], 'Month matches');
t.same(interval.fields.dayOfWeek, [1,2,3,5], 'Day of week matches');
} catch (err) {
t.error(err, 'Interval parse error');
}
t.end();
});
|
<!DOCTYPE html PUBLIC "-
<html xmlns="http:
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.9.1"/>
<title>Boost::context future: Member List</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">Boost::context future
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.9.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main Page</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="annotated.html"><span>Class List</span></a></li>
<li><a href="classes.html"><span>Class Index</span></a></li>
<li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class Members</span></a></li>
</ul>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="<API key>">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="class_future.html">Future</a></li><li class="navelem"><a class="el" href="<API key>.html">AlreadyFulfilled</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">Future< ValueType, ErrorType >::AlreadyFulfilled Member List</div> </div>
</div><!--header
<div class="contents">
<p>This is the complete list of members for <a class="el" href="<API key>.html">Future< ValueType, ErrorType >::AlreadyFulfilled</a>, including all inherited members.</p>
<table class="directory">
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>what</b>() const noexcept (defined in <a class="el" href="<API key>.html">Future< ValueType, ErrorType >::AlreadyFulfilled</a>)</td><td class="entry"><a class="el" href="<API key>.html">Future< ValueType, ErrorType >::AlreadyFulfilled</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
</table></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Tue Jul 7 2015 13:05:59 for Boost::context future by &
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.9.1
</small></address>
</body>
</html>
|
<?php
use Illuminate\Database\Seeder;
// composer require laracasts/testdummy
use Laracasts\TestDummy\Factory as TestDummy;
class UsersTableSeeder extends Seeder
{
public function run()
{
DB::table('users')->insert([
'name' => 'system',
'email' => 'system@levelup.app',
'password' => bcrypt('system'),
]);
}
}
|
package br.eti.qisolucoes.contactcloud.config;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.authentication.builders.<API key>;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.<API key>;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.web.util.matcher.<API key>;
@Configuration
@EnableWebSecurity
public class SecurityConfig extends <API key> {
@Autowired
private UserDetailsService userDetailsService;
@Override
protected void configure(HttpSecurity http) throws Exception {
http.authorizeRequests().antMatchers("/").authenticated()
|
package de.chandre.admintool.security.dbuser.repo;
import java.util.List;
import java.util.Set;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import de.chandre.admintool.security.dbuser.domain.ATRole;
@Repository
public interface RoleRepository extends JpaRepository<ATRole, String> {
ATRole findByName(String name);
@Query("SELECT r.name FROM ATRole r")
List<String> findAllRoleNames();
List<ATRole> findByNameIn(Set<String> ids);
List<ATRole> findByIdIn(Set<String> ids);
void deleteByName(String name);
}
|
import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
import { render, fillIn } from '@ember/test-helpers';
import hbs from '<API key>';
module('Integration | Component | inputs/text-input', function (hooks) {
setupRenderingTest(hooks);
hooks.beforeEach(async function () {
this.config = {
value: '123 hello',
name: 'myInput',
disabled: false,
autocomplete: 'name',
texts: {
placeholder: 'Your name',
},
};
await render(hbs`<Inputs::TextInput @config={{config}} />`);
});
test('it renders', async function (assert) {
assert.dom('textarea').hasAttribute('name', 'myInput');
assert.dom('textarea').hasAttribute('autocomplete', 'name');
assert.dom('textarea').hasAttribute('placeholder', 'Your name');
});
test('it updates value', async function (assert) {
assert.dom('textarea').hasValue('123 hello');
this.set('config.value', 'hello?');
assert.dom('textarea').hasValue('hello?');
await fillIn('textarea', 'bye!');
assert.equal(this.config.value, 'bye!');
});
test('it can be disabled', async function (assert) {
assert.dom('textarea').isNotDisabled();
this.set('config.disabled', true);
assert.dom('textarea').isDisabled();
});
test('it supports presence validations', async function (assert) {
assert.dom('textarea').<API key>('required');
this.set('config.validations', { required: true });
assert.dom('textarea').hasAttribute('required');
});
});
|
#!/usr/bin/env node
var listCommand = [];
require('./listCommand')(listCommand)
var logDetail = (str) => {
console.log(' > '+str);
}
var printHelp = () => {
var txtHelp = "";
var h = ' ';
var t = ' ';
txtHelp += "\n"+h+"Usage : rider [command] \n";
txtHelp += "\n"+h+"Command List : \n";
var maxText = 0;
if(listCommand == undefined){
logDetail("not found help detail");
return;
}
Object.keys(listCommand).forEach((keyName) => {
var item = listCommand[keyName];
if(maxText < item.name.length+item.params.length)
maxText = item.name.length+item.params.length+4;
});
var maxT = Math.ceil(maxText/4);
Object.keys(listCommand).forEach((keyName) => {
var item = listCommand[keyName];
var x = (item.name.length+item.params.length+4)/4;
x = Math.ceil(x);
var space = '\t';
for (var i = 0; i < maxT-x-1; i++) {
space += '\t';
}
var txt = "";
if(item.params.length > 0){
space += '\t';
txt = '\t'+item.name +" [" +item.params+"] " + space +item.desc+"\n";
}else{
txt = '\t'+item.name + space +item.desc+"\n";
}
txtHelp +=txt;
txtHelp +"\n";
});
console.log(txtHelp);
process.exit(0);
}
var parseParams = (params, cb) => {
if(params.length < 3){
return cb(true);
}
cb(false);
}
var checkCommand = (cmd) => {
var foundCmd = false;
Object.keys(listCommand).forEach((keyName) => {
if(keyName == cmd){
foundCmd = true;
return;
}
});
return !foundCmd;
}
var runCommand = (params, cb) => {
var opt = params[2];
var objRun = listCommand[opt];
if(objRun != undefined && objRun != null){
objRun.runCommand(params, cb);
}
}
var main = () => {
console.log(">> Rider ... ");
var params = process.argv;
parseParams(params, (err) => {
if(err){
printHelp();
return;
}
var opt = params[2];
if(opt == "-h" || opt == "--help"){
printHelp();
return;
}
if(checkCommand(opt)){
printHelp();
return;
}
runCommand(params, () => {
process.exit(0);
});
});
}
// -- call main function --
main();
|
<?php
/*
* Arabian language
*/
$lang = [
'albums' => 'Альбомы'
];
|
// RSAEncryptor.h
// iOSProject
#import <Foundation/Foundation.h>
@interface RSAEncryptor : NSObject
/**
*
*
* @param str
* @param path '.der'
*/
+ (NSString *)encryptString:(NSString *)str <API key>:(NSString *)path;
/**
*
*
* @param str
* @param path '.p12'
* @param password
*/
+ (NSString *)decryptString:(NSString *)str <API key>:(NSString *)path password:(NSString *)password;
/**
*
*
* @param str
* @param pubKey
*/
+ (NSString *)encryptString:(NSString *)str publicKey:(NSString *)pubKey;
/**
*
*
* @param str
* @param privKey
*/
+ (NSString *)decryptString:(NSString *)str privateKey:(NSString *)privKey;
@end
|
# Digital ecosystem dashboard
This dashboard was technically and graphically made by [Sebcreation](http:
## Requirements
This application requires [Node JS](http:
After installing Node JS, gulp.js can easily be installed via Terminal :
$ npm install -g gulp
Compass can easily be installed via Terminal :
$ gem update --system
$ gem install compass
Please refer the [user guide](http://compass-style.org/install/)
|
<?php
namespace Hal\Controller;
/*
* File: /app/code/core/system/base_controller.php
* Purpose: Base class from which all controllers extend
*/
class Base_Controller {
protected $action;
public $cache;
public $config;
private $controller;
private $controller_class;
private $controller_filename;
protected $core;
protected $cron;
protected $data;
protected $db;
protected $dispatcher;
public $load;
public $log;
protected $model;
protected $param;
protected $route;
public $session;
public $template;
public $toolbox;
public $view;
public function __construct($app)
{
$this->config = $app['config'];
$this->core = $app;
$this->cron = $app['cron'];
$this->db = $app['database'];
$this->dispatcher = $app['dispatcher'];
$this->event = $app['event'];
$this->load = $app['load'];
$this->log = $app['log'];
$this->model = $app['system_model'];
$this->orm = $app['orm'];
$this->route = $app['router'];
$this->session = $app['session'];
$this->template = $app['template'];
$this->toolbox = $app['toolbox'];
}
public final function parse()
{
# Define child controller extending this class
$this->controller = $this->route->controller;
# The class name contained inside child controller
$this->controller_class = $this->controller.'_Controller';
# File name of child controller
$this->controller_filename = ucwords($this->controller_class).'.php';
# Action being requested from child controller
$this->action = $this->route->action;
$action = trim(strtolower($this->route->action));
# URL parameters
$this->param = $this->route->param;
# Pass controller information to view files; used for debugger
$this->template->assign('controller', $this->controller);
$this->template->assign('controller_class', $this->controller_class);
$this->template->assign('controller_filename', $this->controller_filename);
$this->template->assign('action', $action);
# Admin, Public and Override classes
$_admin_class = $this->controller_class;
$_web_class = "\Web\Controller\\".$this->controller_class;
$_override_class = "\Hal\ControllerOverride\\".$this->controller_class;
# Check if the admin controller is being requested
if ($this->controller == $this->config->setting('admin_controller') && is_readable(CORE_PATH.'controllers/'.$this->controller_filename) && $this->controller_filename) {
require_once CORE_PATH.'controllers/'.$this->controller_filename;
if (class_exists($_admin_class)) {
# File found and class exists, so instantiate controller class
$__instantiate_class = new $this->controller_class($this->core);
if (method_exists($__instantiate_class, $action)) {
# Class method exists
$__instantiate_class->$action();
} else {
# Valid controller, but invalid action
$this->template->assign('controller_path', CORE_PATH.'controllers/'.$this->controller_filename);
$this->template->assign('content', 'error/action.tpl');
}
} else {
# Controller file exists, but class name
# is not formatted / spelled properly
$this->template->assign('content', 'error/<API key>.tpl');
}
}
# First search for requested controller file in override directory
elseif (is_readable(<API key>.'controllers/'.$this->controller_filename) && class_exists($_web_class)) {
require_once <API key>.'controllers/'.$this->controller_filename;
if (class_exists($_override_class)) {
# File found and class exists, so instantiate controller class
$__instantiate_class = new $_override_class($this->core);
// if (!is_subclass_of($__instantiate_class, $_web_class))
// echo $_override_class . ' DOES NOT EXTEND ' . $_web_class;
if (method_exists($__instantiate_class, $action)) {
# Class method exists
$__instantiate_class->$action();
} else {
# Valid controller, but invalid action
$this->template->assign('controller_path', <API key>.'controllers/'.$this->controller_filename);
$this->template->assign('content', 'error/action.tpl');
}
} else {
# Controller file exists, but class name
# is not formatted / spelled properly
$this->template->assign('content', 'error/<API key>.tpl');
}
} else {
if (!is_readable($this->config->setting('controllers_path').$this->controller_filename)) {
# Controller file does not exist, or
if ($this->config->setting('debug_mode') === 'OFF' {
return $this->redirect('error/_404');
} else {
$controller = new \Web\Controller\Error_Controller($this->core);
$controller->controller();
}
}
# Search for requested controller file in public directory
if (is_readable($this->config->setting('controllers_path').$this->controller_filename) && $this->controller_filename) {
require_once $this->config->setting('controllers_path').$this->controller_filename;
if (class_exists($_web_class)) {
# File found and class exists, so instantiate controller class
$__instantiate_class = new $_web_class($this->core);
if (method_exists($__instantiate_class, $action)) {
# Class method exists
$__instantiate_class->$action();
} else {
# Valid controller, but invalid action
if ($this->config->setting('debug_mode') === 'OFF' {
$this->redirect('error/_404');
} else {
$this->template->assign('controller_path', $this->config->setting('controllers_path').$this->controller_filename);
$this->template->assign('content', 'error/action.tpl');
}
}
} else {
# Controller file exists, but class name is not formatted / spelled properly
if ($this->config->setting('debug_mode') === 'OFF' {
$this->redirect('error/_404');
} else {
$this->template->assign('content', 'error/<API key>.tpl');
}
}
} else {
# Controller file does not exist, or
if ($this->config->setting('debug_mode') === 'OFF' {
$this->redirect('error/_404');
} else {
$this->template->assign('content', 'error/controller.tpl');
}
}
}
}
public function model($model) {
return $this->load->model("$model");
}
public function redirect($url) {
if ($url === 'http_referer') {
return header('Location: '.$_SERVER['HTTP_REFERER']);
exit;
}
return header('Location: '.BASE_URL.$url);
}
public function session() {
return $this->toolbox('session');
}
public function toolbox($helper) {
# Load a Toolbox helper
return $this->toolbox["$helper"];
}
}
|
title: While We're At It
category: The Guts of FP
order: 1
You won't get very far in most imperative languages without the humble `while` loop or one of it's variants such as `for`. Even though for loops are more commonly used, they are just syntactic sugar on while, so let's start there:
{% highlight javascript %}
let i = 0;
while (i < someEndValue) {
// do something interesting here
i++;
}
{% endhighlight %}
While it's possible for `someEndValue` to be anything it's extremely common for it to be the length of a collection.
{% highlight javascript %}
let i = 0;
while (i < someCollection.length) {
// do something with someCollection[i] here
i++;
}
{% endhighlight %}
This immediately brings up a problem, if we want to avoid mutating state, what useful thing could we do in the body of the while loop? While is not an expression, so we can't be returning a value. While demands that we mutate something inside the body, even if we are creating a new value each loop we're still rebinding the variable to a new value. This is as close to no-mutation as we can accomplish with while, but we're still clobbering that outer variable each time.
{% highlight javascript %}
let numbers = [];
let i = 0;
while (i < 5) {
numbers.push(i);
i++;
}
{% endhighlight %}
Furthermore, since `while` is not an expression, there is no way to really combine it with anything else. This is a concept known as composition and we'll return to it later. Fortunately there's another construct that can be used to accomplish a looping structure but allows you to return a value at the end and doesn't need to mutate anything or reassign variables. This means you can use `const someValue = doTheThing(...)` or even `const someValue = doTheThing(...).andThen(...)`. You may have never thought about `recursion` this way, but it's true!
> Recursion is the ability of a function to be applied to an argument inside itself. If done wrong this leads to an infinite chain of application in much the same way that forgetting the `i++` at the end of a `while` is an infinite loop.
{% highlight javascript %}
const populateArray =
(numbers, i, endValue) =>
i < endValue
? populateArray([...numbers, i], i + 1, endValue)
: numbers;
const result = populateArray([], 0, 5);
{% endhighlight %}
The process of running this function would look like this.
{% highlight javascript %}
numbers i
| |
v v
populateArray([], 0, 5)
numbers i
| |
v v
populateArray([0], 1, 5)
numbers i
| |
v v
populateArray([0, 1], 2, 5)
numbers i
| |
v v
populateArray([0, 1, 2], 3, 5)
numbers i
| |
v v
populateArray([0, 1, 2, 3], 4, 5)
numbers i
| |
v v
populateArray([0, 1, 2, 3, 4], 5, 5)
{% endhighlight %}
When we run `populateArray`, 0 is less than 5, so we recursively call `populateArray` again, but this time with `[0]` and `1` for the `numbers` and `i` arguments. This continues down until `i` is 5 at which point we return the current value of numbers which is `[0, 1, 2, 3, 4]`. This value is in turn returned by each prior `populateArray` and the final result is thus `[0, 1, 2, 3, 4]`.
This may look more complex than the `while` example if you're not used to thinking recursively and using it in this manner. Hopefully though you see much of the operations we're performing are the same.
- `i < 5` is the same as `i < endValue`
- `numbers.push(i)` and `[...numbers, i]` are both adding an element to the array
- `i++` and `i + 1` both move the counter up one
Everything we could express in a while loop we can do via recursion and not need to mutate an outer variable along the way. With that said though, you probably don't write many while loops given there are constructs that more directly do what you want such as for. Let's look at a few common cases.
# Filter: reject unwanted values
{% highlight javascript %}
const itemsToKeep = [];
for (var i = 0; i < collection.length; i++) {
if (someCriteria(collection[i])) {
itemsToKeep.push(collection[i]);
}
}
{% endhighlight %}
# Map: transform values
{% highlight javascript %}
const newCollection = [];
for (var i = 0; i < collection.length; i++) {
newCollection.push(
someOperation(collection[i])
);
}
{% endhighlight %}
If your language supports a `foreach` style iteration (`for x of y` in ES6) where the value itself is bound to a local variable instead of using an index, these could both be re-written using that.
Both these cases have a striking amount of similarity. Hopefully you've noticed this at some point as well. In fact, almost every line of each of these two cases are the same
- `const itemsToKeep = []` is `const newCollection = []`
- `for (var i = 0; i < collection.length; i++) {` is identical for both
- `itemsToKeep.push` is `newCollection.push`
The only difference is that in the first case the item is conditionally added, and in the second, the item is processed before being added. This is the fundamental difference between the two operations, one filters out elements, the other maps one value to another. **_If the "when and what to insert" decision could be parameterized, then the rest of the code could be written once and not every time we need this construct._**
Higher Order Functions
To accomplish this feat we would need a function that could be parameterized by another function.
{% highlight javascript %}
const doThing = (someFunction, someValue) => someFunction(someValue);
{% endhighlight %}
What are `someFunction` and `someValue`? No idea! Here's a function that receives _another_ function as an argument and can use it to produce a return value. We can go in the opposite direction as well.
{% highlight javascript %}
const makeFunction = () =>
(someNumber) =>
someNumber + 1;
const newFunction = makeFunction();
newFunction(5);
{% endhighlight %}
This is not particularly interesting, in fact a function written like this could be converted back to a constant like you're used to.
{% highlight javascript %}
const newFunction = (someNumber) => someNumber + 1;
{% endhighlight %}
The interesting part is simply that functions are just values and can be returned like any other value, although this is not particularly common in JavaScript.
The first function does not need to have zero arguments, in fact it's often useful for it to have arguments since the function that is returned can see and reference those variables.
{% highlight javascript %}
const makeGreeting =
(message) =>
(name) =>
message + " " + name;
const jolly = makeGreeting("Hello there");
const grouchy = makeGreeting("Get off my lawn!");
jolly("Tina"); // "Hello there Tina"
grouchy("Max"); // "Get off my lawn! Max"
// we don't need to create an intermediate function
makeGreeting("Look ma, no funtion, right")("Sam"); // "Look ma, no funtion, right Sam"
{% endhighlight %}
The inner returned functions can also be written on a single line
{% highlight javascript %}
const makeGreeting = (message) => (name) => message + " " + name;
{% endhighlight %}
> A function that receives another function as an argument, or returns a new function as a return value is known as a **higher order function**.
This may not seem very useful at first, but let's apply the idea to the problem from before and see how this both helps eliminates the need for mutation of a variable, and solves a broad class of problems, all at once.
Fold and Friends
For any while loop of the shape with the form:
- Initialize a new collection
- Iterate over existing collection
- Insert values into new collection
there is a generalized solution known commonly as `fold`, `reduce`, or `aggregate`.
general shape of:
{% highlight javascript %}
const newValue = fold(<API key>, initialNewValue, <API key>);
{% endhighlight %}
The `<API key>` is a function that takes the working `initialNewValue` and combines it with an element from `<API key>`. This might be done by doing a if check in the case of a filter type operation, or by running the element through a function first as in the case of the map type operation. Or it might be something unrelated to collections in the case of a sum type operation.
# Filter type operation
{% highlight javascript %}
const filterFn =
(element, collection) =>
someCondition(element)
? [...collection, element]
: collection;
const someCondition = (x) => x > 5;
filterFn(7, [4, 5]) // [4, 5, 7]
filterFn(4, [4, 5]) // [4, 5]
{% endhighlight %}
# Map type operation
{% highlight javascript %}
const mapFn = (element, collection) => [...collection, someOperation(element)];
const someOperation = (str) => str + "!";
mapFn("hi", [])
mapFn("excited", ["I", "am"]) // ["I", "am", "excited!"]
{% endhighlight %}
And we could use these functions with `fold` in a more concrete setting:
{% highlight javascript %}
const filteredValues = fold(filterFn, [], [3, 4, 5, 6]);
const transformedValues = fold(mapFn, [], ["programming", "is", "fun"]);
{% endhighlight %}
> This is generally the point where people's eyes glaze over as we begin to get a bit more abstract. From here on out, we will be working with concepts you likely have never encountered. This is genuinely hard to get at first, but the "different paradigm" type of understanding is on the other side, so hang in there!
Exercise
Ready for a challenge? Open `exercises/fold.js` in your editor and implement the `fold` function that can operate on arrays. Do this either using a for loop or using recursion (or try both). It matters much less how something like `fold` is implemented "under the hood" as long as the interface is pure.
To test your changes, run `npm run -s fold` from the `exercises` directory.
> Ask questions!
## [Next](/3-guts-of-fp/type-it-out)
|
import { BaseController } from "./BaseController";
import { Route } from "./BaseController";
import * as loadHtml from "./HtmlLoader";
export class MainController extends BaseController
{
main = (): void =>
{
loadHtml.load(this.requestData, '/views/index.html', {});
}
routes: Route[] = [
new Route("/", this.main)
];
}
|
import React from "react";
import $ from "jquery";
import "bootstrap/dist/js/bootstrap.min";
import "jquery-ui/ui/widgets/datepicker";
import {
<API key>,
<API key>,
putFullTimeEmployer,
putParttimeEmployer
} from "../actions/PostData";
import DropDownBtn from "../components/DropDownBtn";
import {<API key>} from "../utils/Utils";
import {connect} from "react-redux";
class ModalEmployer extends React.Component {
<API key> = (nextProps) => {
if (nextProps.data) {
this.setState(nextProps.data);
if (nextProps.data.day_salary) {
this.setState({
type: 'congNhat'
})
} else {
this.setState({
type: 'bienChe'
})
}
}
if (nextProps.data == null) {
this.setState(this.emptyObject)
}
}
emptyObject = {
"salary_level": "",
"name": "",
"month_salary": "",
"phone": "",
"birthday": "",
"allowance": "",
"department_id": this.props.departments.length > 0 ? this.props.departments[0].id : "",
day_salary: "",
}
onClickSave = () => {
let data = {
"name": this.state.name,
"phone": this.state.phone,
"birthday": <API key>(this.state.birthday),
"department_id": this.state.department_id,
}
if (this.state.type === "bienChe") {
data.salary_level = this.state.salary_level;
data.month_salary = this.state.month_salary;
data.allowance = this.state.allowance;
if (this.props.data) {
putFullTimeEmployer(this.props.data.id, data, this.props.fetchEmployers);
}
else {
<API key>(data, this.props.fetchEmployers);
}
}
if (this.state.type === "congNhat") {
data.day_salary = this.state.day_salary;
if (this.props.data) {
putParttimeEmployer(this.props.data.id, data, this.props.fetchEmployers);
}
else {
<API key>(data, this.props.fetchEmployers)
}
}
$('#create').modal('toggle');
}
constructor(props) {
super(props);
this.state = Object.assign(this.emptyObject, {type: null})
}
onChangeText = (event) => {
this.setState({
[event.target.name]: event.target.value
})
}
clickType = (type) => {
this.setState({
type
})
}
componentDidMount = () => {
$('#datepicker').datepicker({
uiLibrary: 'bootstrap4',
iconsLibrary: 'fontawesome',
onSelect: (dateText) => {
this.setState({
birthday: dateText
})
},
dateFormat: 'dd/mm/yy'
});
}
renderExtraForm = () => {
if (this.state.type) {
switch (this.state.type) {
case "bienChe":
return <div>
<label htmlFor="id">Lương tháng</label>
<div className="input-group">
<input onChange={this.onChangeText} name="month_salary" type="text" className="form-control"
id="id" aria-describedby="basic-addon3" value={this.state.month_salary}/>
</div>
<label htmlFor="id">Bậc lương</label>
<div className="input-group">
<input onChange={this.onChangeText} name="salary_level" type="text" className="form-control"
id="id" aria-describedby="basic-addon3" value={this.state.salary_level}/>
</div>
<label htmlFor="id">Phụ cấp</label>
<div className="input-group">
<input onChange={this.onChangeText} name="allowance" type="text" className="form-control"
id="id" aria-describedby="basic-addon3" value={this.state.allowance}/>
</div>
</div>
break;
case "congNhat":
return <div>
<label htmlFor="id">Lương ngày</label>
<div className="input-group">
<input name="day_salary" value={this.state.day_salary} onChange={this.onChangeText}
type="text"
className="form-control" id="id" aria-describedby="basic-addon3"/>
</div>
</div>
break;
}
}
}
onSelectDepartment = (item) => {
this.setState({
department_id: item.id
})
}
renderDropDownBtn = () => {
if (this.props.departments.length > 0) {
return (
<DropDownBtn onChange={this.onSelectDepartment} default data={this.props.departments}></DropDownBtn>
)
}
}
render() {
return (
<div className="modal fade" id="create" tabIndex="-1" role="dialog" aria-labelledby="exampleModalLabel"
aria-hidden="true">
<div className="modal-dialog" role="document">
<div className="modal-content">
<div className="modal-header">
<h5 className="modal-title" id="exampleModalLabel">Thêm nhân viên</h5>
<button type="button" className="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div className="modal-body">
<label htmlFor="name">Tên nhân viên</label>
<div className="input-group">
<input onChange={this.onChangeText} value={this.state.name} name="name" type="text"
className="form-control" id="name" aria-describedby="basic-addon3"/>
</div>
<label htmlFor="datepicker">Ngày tháng năm sinh</label>
<div className="input-group date" data-provide="datepicker">
<input onClick={this.onChangeText} onChange={this.onChangeText}
value={this.state.birthday}
name="birthday" type="text" className="form-control" id="datepicker"/>
</div>
<label htmlFor="phone">Số điện thoại</label>
<div className="input-group">
<input onChange={this.onChangeText} value={this.state.phone} name="phone" type="text"
className="form-control" id="phone" aria-describedby="basic-addon3"/>
</div>
<div className="btn-group">
<label htmlFor="name" className="margin-R10">Chọn phòng ban</label>
{this.renderDropDownBtn()}
</div>
<div className="btn-group btn-middle align-middle">
{
(() => {
if (this.props.data) {
if (this.props.data.day_salary === null) {
return (<button className="btn btn-primary"
id="bien-che">Nhân viên Biên chế
</button>)
}
else {
return (
<button className="btn btn-info"
id="cong-nhat">Nhân viên Công nhật
</button>
)
}
}
else {
let arr = [];
arr.push(<button onClick={this.clickType.bind(this, "bienChe")}
className="btn btn-primary"
id="bien-che">Nhân viên Biên chế
</button>);
arr.push(<button onClick={this.clickType.bind(this, "congNhat")}
className="btn btn-info"
id="cong-nhat">Nhân viên Công nhật
</button>);
return arr;
}
})()
}
</div>
{
this.renderExtraForm()
}
</div>
<div className="modal-footer">
<button type="button" className="btn btn-secondary" data-dismiss="modal">Hủy</button>
<button onClick={this.onClickSave} type="button" className="btn btn-primary">Lưu</button>
</div>
</div>
</div>
</div>
)
}
}
const mapStateToProps = state => {
return {
departments: state.app.departments
}
}
export default connect(mapStateToProps)(ModalEmployer)
|
require 'spec_helper'
describe Character do
before do
@character = Character.new(name: "Walder Frey", page: 'index.html')
end
subject { @character}
it { should respond_to(:name)}
it { should respond_to(:icon)}
it { should respond_to(:page)}
it { should respond_to(:degrees)}
it { should respond_to(:all_relationships)}
it { should respond_to(:children)}
it { should respond_to(:parents)}
it { should respond_to(:relationships)}
it { should respond_to(:<API key>)}
it { should be_valid}
describe "when name is not present" do
before {@character.name = nil}
it {should_not be_valid}
end
describe "when page is not present" do
before {@character.page = nil}
it {should_not be_valid}
end
describe "character with page already exists" do
before do
<API key> = @character.dup
<API key>.page.upcase!
<API key>.save
end
it { should_not be_valid}
end
describe "character relationships" do
before{ @character.save}
let!(:child_character) do
FactoryGirl.create(:character)
end
let!(:relationship) { @character.relationships.build(:child_id => child_character.id)}
it "should display for both" do
expect(@character.all_relationships.to_a).to eq child_character.all_relationships.to_a
end
it "should destroy relationships" do
relationships = @character.relationships.to_a
@character.destroy
expect(relationships).not_to be_empty
relationships.each do |relationship|
expect(Relationship.where(:id => relationship.id)).to be_empty
end
end
end
end
|
package net.sf.jabref.gui.util;
import javafx.concurrent.Task;
/**
* An object that executes submitted {@link Task}s. This
* interface provides a way of decoupling task submission from the
* mechanics of how each task will be run, including details of thread
* use, scheduling, thread pooling, etc.
*/
public interface TaskExecutor {
/**
* Runs the given task.
*
* @param task the task to run
* @param <V> type of return value of the task
*/
<V> void execute(BackgroundTask<V> task);
}
|
author: generalchoa
comments: true
date: 2014-01-31 23:22:32+00:00
layout: post
slug: <API key>
title: Week13 - Day35B - Beefmode
wordpress_id: 1429
categories:
- B
- StrongLifts
tags:
- agile 8
- deadlift
- dips
- incline db press
- plank
- preacher curls
- push-up
- seated db curls
- shoulder shocker
- squat
- standing bb curls
**Weight: **185 lbs ??
**Duration**: 11:45am - 1:02pm ~ 1hr. 17min.
Time recorded is from when I started the pre-workout stretches until I started my post-workout stretches. The Shoulder Shocker felt hugely improved, weights felt light for the first 2 sets. Usually, I'm dying at the end of the second set. Weight on the scale was at 187 this morning! Getting into freshly washed and dried jeans was pretty tough, haha. Legs are getting too beefy from all this squatting.
**Squats: **3x5xBar + 5x115 + 3x145 + 2x165 + 1x185 + 3x5x205
Went down pretty slow to control the bar and prevent tweaking the back. This makes it quite a bit harder since I'm increasing time under the bar. These are getting pretty heavy. Getting close to the magical 225, 2-plate squat. I think I may incorporate some back off sets, very similar to Madcow's heavy day scheme or Wendler's Boring But Big accessory.
**Seated Plate Raises: **3x10x25
**Seated Lateral Raise: **3x10x12
**Seated DB Shrug + Clean + Half Press: **3x10x12
Able to get to the end of the second set without feeling dead. Felt a huge improvement here. Doing the cleaning movement, I'm using a more explosive pull to clean the dumbbells up instead just using all shoulders. It is a clean after all.
**Deadlift: **5x135 + 3x165 + 2x185 + 1x215 + 1x240 + 5x265
Supinated left, regular right. Pretty heavy, kept the bar glued to my shins. Not sure if I was rounding, but my low back wasn't killing me afterwards.
**Accessories:
**Preacher BB Curls: **14x50**
Incline DB Press: **10x50**
Standing EZ Bar Curls: 10x40
Dips: **12**/4/4
Seated DB Curls: **10x30**
Pushups: 10/10/8
Cranked out some extra reps on the 50lb preacher. I think once I get to 18+ reps on the 50, I'm going to jump up. Went up to 50lbs on the incline db press. These were pretty difficult, so definitely sticking to 50s for a while. Dips are still improving, both in strength and endurance. Pushups felt improved today as well. Going to for 3 sets of 10 reps across next time.
**Core:
**Elbow Planks: **1min.**
Burn, baby, burn.
|
package com.mgireesh;
public class Solution extends VersionControl {
public int firstBadVersion(int n) {
int badVersion = 0;
int start = 1;
int end = n;
while (start < end) {
int mid = start + (end - start) / 2;
if (isBadVersion(mid)) {
end = mid;
} else {
start = mid + 1;
}
}
return start;
}
}
|
<?php
namespace Aurex\Framework\Module\Modules\FormDoctrineModule;
use Symfony\Bridge\Doctrine\Form\<API key>,
Silex\Provider\<API key>,
Aurex\Framework\Module\ModuleInterface,
Silex\Provider\<API key>,
Silex\Provider\FormServiceProvider,
Aurex\Framework\Aurex;
/**
* Class FormDoctrineModule
*
* @package Aurex\Framework\Module\Modules\FormDoctrineModule
*/
class FormDoctrineModule implements ModuleInterface
{
/**
* {@inheritDoc}
*/
public function integrate(Aurex $aurex)
{
$aurex->register(new FormServiceProvider);
$aurex->register(new <API key>);
$aurex->register(new <API key>, [
'locale' => 'en'
]);
$aurex['form.extensions'] = $aurex->extend('form.extensions', function ($extensions, $app) {
$managerRegistry = new FormManagerRegistry(null, [], ['default'], null, null, '\Doctrine\ORM\Proxy\Proxy');
$managerRegistry->setContainer($app);
unset($extensions);
return [(new <API key>($managerRegistry))];
});
$aurex->getInjector()->share($aurex['form.factory']);
}
/**
* {@inheritDoc}
*/
public function <API key>()
{
return null;
}
}
|
<html><head><title>dlib C++ Library - <API key>.cpp</title></head><body bgcolor='white'><pre>
<font color='#009900'>// The contents of this file are in the public domain. See <API key>.txt
</font>
<font color='#009900'>/*
This example contains a detailed discussion of the template expression
technique used to implement the matrix tools in the dlib C++ library.
It also gives examples showing how a user can create their own custom
matrix expressions.
Note that you should be familiar with the dlib::matrix before reading
this example. So if you haven't done so already you should read the
matrix_ex.cpp example program.
*/</font>
<font color='#0000FF'>#include</font> <font color='#5555FF'><</font>iostream<font color='#5555FF'>></font>
<font color='#0000FF'>#include</font> <font color='#5555FF'><</font>dlib<font color='#5555FF'>/</font>matrix.h<font color='#5555FF'>></font>
<font color='#0000FF'>using</font> <font color='#0000FF'>namespace</font> dlib;
<font color='#0000FF'>using</font> <font color='#0000FF'>namespace</font> std;
<font color='
</font>
<font color='#0000FF'><u>void</u></font> <b><a name='<API key>'></a><API key></b><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>;
<font color='
</font>
<font color='#0000FF'><u>int</u></font> <b><a name='main'></a>main</b><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>
<b>{</b>
<font color='#009900'>// Declare some variables used below
</font> matrix<font color='#5555FF'><</font><font color='#0000FF'><u>double</u></font>,<font color='#979000'>3</font>,<font color='#979000'>1</font><font color='#5555FF'>></font> y;
matrix<font color='#5555FF'><</font><font color='#0000FF'><u>double</u></font>,<font color='#979000'>3</font>,<font color='#979000'>3</font><font color='#5555FF'>></font> M;
matrix<font color='#5555FF'><</font><font color='#0000FF'><u>double</u></font><font color='#5555FF'>></font> x;
<font color='#009900'>// set all elements to 1
</font> y <font color='#5555FF'>=</font> <font color='#979000'>1</font>;
M <font color='#5555FF'>=</font> <font color='#979000'>1</font>;
<font color='
</font> <font color='#009900'>// Now I will discuss the "template expressions" technique and how it is
</font> <font color='#009900'>// used in the matrix object. First consider the following expression:
</font> x <font color='#5555FF'>=</font> y <font color='#5555FF'>+</font> y;
<font color='#009900'>/*
Normally this expression results in machine code that looks, at a high
level, like the following:
temp = y + y;
x = temp
Temp is a temporary matrix returned by the overloaded + operator.
temp then contains the result of adding y to itself. The assignment
operator copies the value of temp into x and temp is then destroyed while
the blissful C++ user never sees any of this.
This is, however, totally inefficient. In the process described above
you have to pay for the cost of constructing a temporary matrix object
and allocating its memory. Then you pay the additional cost of copying
it over to x. It also gets worse when you have more complex expressions
such as x = round(y + y + y + M*y) which would involve the creation and copying
of 5 temporary matrices.
All these inefficiencies are removed by using the template expressions
technique. The basic idea is as follows, instead of having operators and
functions return temporary matrix objects you return a special object that
represents the expression you wish to perform.
So consider the expression x = y + y again. With dlib::matrix what happens
is the expression y+y returns a matrix_exp object instead of a temporary matrix.
The construction of a matrix_exp does not allocate any memory or perform any
computations. The matrix_exp however has an interface that looks just like a
dlib::matrix object and when you ask it for the value of one of its elements
it computes that value on the spot. Only in the assignment operator does
someone ask the matrix_exp for these values so this avoids the use of any
temporary matrices. Thus the statement x = y + y is equivalent to the following
code:
// loop over all elements in y matrix
for (long r = 0; r < y.nr(); ++r)
for (long c = 0; c < y.nc(); ++c)
x(r,c) = y(r,c) + y(r,c);
This technique works for expressions of arbitrary complexity. So if you
typed x = round(y + y + y + M*y) it would involve no temporary matrices being
created at all. Each operator takes and returns only matrix_exp objects.
Thus, no computations are performed until the assignment operator requests
the values from the matrix_exp it receives as input.
There is, however, a slight complication in all of this. It is for statements
that involve the multiplication of a complex matrix_exp such as the following:
*/</font>
x <font color='#5555FF'>=</font> M<font color='#5555FF'>*</font><font face='Lucida Console'>(</font>M<font color='#5555FF'>+</font>M<font color='#5555FF'>+</font>M<font color='#5555FF'>+</font>M<font color='#5555FF'>+</font>M<font color='#5555FF'>+</font>M<font color='#5555FF'>+</font>M<font face='Lucida Console'>)</font>;
<font color='#009900'>/*
According to the discussion above, this statement would compute the value of
M*(M+M+M+M+M+M+M) totally without any temporary matrix objects. This sounds
good but we should take a closer look. Consider that the + operator is
invoked 6 times. This means we have something like this:
x = M * (matrix_exp representing M+M+M+M+M+M+M);
M is being multiplied with a quite complex matrix_exp. Now recall that when
you ask a matrix_exp what the value of any of its elements are it computes
their values *right then*.
If you think on what is involved in performing a matrix multiply you will
realize that each element of a matrix is accessed M.nr() times. In the
case of our above expression the cost of accessing an element of the
matrix_exp on the right hand side is the cost of doing 6 addition operations.
Thus, it would be faster to assign M+M+M+M+M+M+M to a temporary matrix and then
multiply that by M. This is exactly what the dlib::matrix does under the covers.
This is because it is able to spot expressions where the introduction of a
temporary is needed to speed up the computation and it will automatically do this
for you.
Another complication that is dealt with automatically is aliasing. All matrix
expressions are said to "alias" their contents. For example, consider
the following expressions:
M + M
M * M
We say that the expressions (M + M) and (M * M) alias M. Additionally, we say that
the expression (M * M) destructively aliases M.
To understand why we say (M * M) destructively aliases M consider what would happen
if we attempted to evaluate it without first assigning (M * M) to a temporary matrix.
That is, if we attempted to perform the following:
for (long r = 0; r < M.nr(); ++r)
for (long c = 0; c < M.nc(); ++c)
M(r,c) = rowm(M,r)*colm(M,c);
It is clear that the result would be corrupted and M wouldn't end up with the right
values in it. So in this case we must perform the following:
temp = M*M;
M = temp;
This sort of interaction is what defines destructive aliasing. Whenever we are
assigning a matrix expression to a destination that is destructively aliased by
the expression we need to introduce a temporary. The dlib::matrix is capable of
recognizing the two forms of aliasing and introduces temporary matrices only when
necessary.
*/</font>
<font color='#009900'>// Next we discuss how to create custom matrix expressions. In what follows we
</font> <font color='#009900'>// will define three different matrix expressions and show their use.
</font> <font color='#BB00BB'><API key></font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>;
<b>}</b>
<font color='
</font><font color='
</font><font color='
</font>
<font color='#0000FF'>template</font> <font color='#5555FF'><</font><font color='#0000FF'>typename</font> M<font color='#5555FF'>></font>
<font color='#0000FF'>struct</font> <b><a name='example_op_trans'></a>example_op_trans</b>
<b>{</b>
<font color='#009900'>/*!
This object defines a matrix expression that represents a transposed matrix.
As discussed above, constructing this object doesn't compute anything. It just
holds a reference to a matrix and presents an interface which defines
matrix transposition.
!*/</font>
<font color='#009900'>// Here we simply hold a reference to the matrix we are supposed to be the transpose of.
</font> <b><a name='example_op_trans'></a>example_op_trans</b><font face='Lucida Console'>(</font> <font color='#0000FF'>const</font> M<font color='#5555FF'>&</font> m_<font face='Lucida Console'>)</font> : m<font face='Lucida Console'>(</font>m_<font face='Lucida Console'>)</font><b>{</b><b>}</b>
<font color='#0000FF'>const</font> M<font color='#5555FF'>&</font> m;
<font color='#009900'>// The cost field is used by matrix multiplication code to decide if a temporary needs to
</font> <font color='#009900'>// be introduced. It represents the computational cost of evaluating an element of the
</font> <font color='#009900'>// matrix expression. In this case we say that the cost of obtaining an element of the
</font> <font color='#009900'>// transposed matrix is the same as obtaining an element of the original matrix (since
</font> <font color='#009900'>// transpose doesn't really compute anything).
</font> <font color='#0000FF'>const</font> <font color='#0000FF'>static</font> <font color='#0000FF'><u>long</u></font> cost <font color='#5555FF'>=</font> M::cost;
<font color='#009900'>// Here we define the matrix expression's compile-time known dimensions. Since this
</font> <font color='#009900'>// is a transpose we define them to be the reverse of M's dimensions.
</font> <font color='#0000FF'>const</font> <font color='#0000FF'>static</font> <font color='#0000FF'><u>long</u></font> NR <font color='#5555FF'>=</font> M::NC;
<font color='#0000FF'>const</font> <font color='#0000FF'>static</font> <font color='#0000FF'><u>long</u></font> NC <font color='#5555FF'>=</font> M::NR;
<font color='#009900'>// Define the type of element in this matrix expression. Also define the
</font> <font color='#009900'>// memory manager type used and the layout. Usually we use the same types as the
</font> <font color='#009900'>// input matrix.
</font> <font color='#0000FF'>typedef</font> <font color='#0000FF'>typename</font> M::type type;
<font color='#0000FF'>typedef</font> <font color='#0000FF'>typename</font> M::mem_manager_type mem_manager_type;
<font color='#0000FF'>typedef</font> <font color='#0000FF'>typename</font> M::layout_type layout_type;
<font color='#009900'>// This is where the action is. This function is what defines the value of an element of
</font> <font color='#009900'>// this matrix expression. Here we are saying that m(c,r) == trans(m)(r,c) which is just
</font> <font color='#009900'>// the definition of transposition. Note also that we must define the return type from this
</font> <font color='#009900'>// function as a typedef. This typedef lets us either return our argument by value or by
</font> <font color='#009900'>// reference. In this case we use the same type as the underlying m matrix. Later in this
</font> <font color='#009900'>// example program you will see two other options.
</font> <font color='#0000FF'>typedef</font> <font color='#0000FF'>typename</font> M::const_ret_type const_ret_type;
const_ret_type <b><a name='apply'></a>apply</b> <font face='Lucida Console'>(</font><font color='#0000FF'><u>long</u></font> r, <font color='#0000FF'><u>long</u></font> c<font face='Lucida Console'>)</font> <font color='#0000FF'>const</font> <b>{</b> <font color='#0000FF'>return</font> <font color='#BB00BB'>m</font><font face='Lucida Console'>(</font>c,r<font face='Lucida Console'>)</font>; <b>}</b>
<font color='#009900'>// Define the run-time defined dimensions of this matrix.
</font> <font color='#0000FF'><u>long</u></font> <b><a name='nr'></a>nr</b> <font face='Lucida Console'>(</font><font face='Lucida Console'>)</font> <font color='#0000FF'>const</font> <b>{</b> <font color='#0000FF'>return</font> m.<font color='#BB00BB'>nc</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>; <b>}</b>
<font color='#0000FF'><u>long</u></font> <b><a name='nc'></a>nc</b> <font face='Lucida Console'>(</font><font face='Lucida Console'>)</font> <font color='#0000FF'>const</font> <b>{</b> <font color='#0000FF'>return</font> m.<font color='#BB00BB'>nr</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>; <b>}</b>
<font color='#009900'>// Recall the discussion of aliasing. Each matrix expression needs to define what
</font> <font color='#009900'>// kind of aliasing it introduces so that we know when to introduce temporaries. The
</font> <font color='#009900'>// aliases() function indicates that the matrix transpose expression aliases item if
</font> <font color='#009900'>// and only if the m matrix aliases item.
</font> <font color='#0000FF'>template</font> <font color='#5555FF'><</font><font color='#0000FF'>typename</font> U<font color='#5555FF'>></font> <font color='#0000FF'><u>bool</u></font> <b><a name='aliases'></a>aliases</b> <font face='Lucida Console'>(</font> <font color='#0000FF'>const</font> matrix_exp<font color='#5555FF'><</font>U<font color='#5555FF'>></font><font color='#5555FF'>&</font> item<font face='Lucida Console'>)</font> <font color='#0000FF'>const</font> <b>{</b> <font color='#0000FF'>return</font> m.<font color='#BB00BB'>aliases</font><font face='Lucida Console'>(</font>item<font face='Lucida Console'>)</font>; <b>}</b>
<font color='#009900'>// This next function indicates that the matrix transpose expression also destructively
</font> <font color='#009900'>// aliases anything m aliases. I.e. transpose has destructive aliasing.
</font> <font color='#0000FF'>template</font> <font color='#5555FF'><</font><font color='#0000FF'>typename</font> U<font color='#5555FF'>></font> <font color='#0000FF'><u>bool</u></font> <b><a name='<API key>'></a><API key></b> <font face='Lucida Console'>(</font> <font color='#0000FF'>const</font> matrix_exp<font color='#5555FF'><</font>U<font color='#5555FF'>></font><font color='#5555FF'>&</font> item<font face='Lucida Console'>)</font> <font color='#0000FF'>const</font> <b>{</b> <font color='#0000FF'>return</font> m.<font color='#BB00BB'>aliases</font><font face='Lucida Console'>(</font>item<font face='Lucida Console'>)</font>; <b>}</b>
<b>}</b>;
<font color='#009900'>// Here we define a simple function that creates and returns transpose expressions. Note that the
</font><font color='#009900'>// matrix_op<> template is a matrix_exp object and exists solely to reduce the amount of boilerplate
</font><font color='#009900'>// you have to write to create a matrix expression.
</font><font color='#0000FF'>template</font> <font color='#5555FF'><</font> <font color='#0000FF'>typename</font> M <font color='#5555FF'>></font>
<font color='#0000FF'>const</font> matrix_op<font color='#5555FF'><</font>example_op_trans<font color='#5555FF'><</font>M<font color='#5555FF'>></font> <font color='#5555FF'>></font> <b><a name='example_trans'></a>example_trans</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'>const</font> matrix_exp<font color='#5555FF'><</font>M<font color='#5555FF'>></font><font color='#5555FF'>&</font> m
<font face='Lucida Console'>)</font>
<b>{</b>
<font color='#0000FF'>typedef</font> example_op_trans<font color='#5555FF'><</font>M<font color='#5555FF'>></font> op;
<font color='#009900'>// m.ref() returns a reference to the object of type M contained in the matrix expression m.
</font> <font color='#0000FF'>return</font> matrix_op<font color='#5555FF'><</font>op<font color='#5555FF'>></font><font face='Lucida Console'>(</font><font color='#BB00BB'>op</font><font face='Lucida Console'>(</font>m.<font color='#BB00BB'>ref</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><font face='Lucida Console'>)</font><font face='Lucida Console'>)</font>;
<b>}</b>
<font color='
</font>
<font color='#0000FF'>template</font> <font color='#5555FF'><</font><font color='#0000FF'>typename</font> T<font color='#5555FF'>></font>
<font color='#0000FF'>struct</font> <b><a name='<API key>'></a><API key></b>
<b>{</b>
<font color='#009900'>/*!
This object defines a matrix expression that holds a reference to a std::vector<T>
and makes it look like a column vector. Thus it enables you to use a std::vector
as if it was a dlib::matrix.
!*/</font>
<b><a name='<API key>'></a><API key></b><font face='Lucida Console'>(</font> <font color='#0000FF'>const</font> std::vector<font color='#5555FF'><</font>T<font color='#5555FF'>></font><font color='#5555FF'>&</font> vect_<font face='Lucida Console'>)</font> : vect<font face='Lucida Console'>(</font>vect_<font face='Lucida Console'>)</font><b>{</b><b>}</b>
<font color='#0000FF'>const</font> std::vector<font color='#5555FF'><</font>T<font color='#5555FF'>></font><font color='#5555FF'>&</font> vect;
<font color='#009900'>// This expression wraps direct memory accesses so we use the lowest possible cost.
</font> <font color='#0000FF'>const</font> <font color='#0000FF'>static</font> <font color='#0000FF'><u>long</u></font> cost <font color='#5555FF'>=</font> <font color='#979000'>1</font>;
<font color='#0000FF'>const</font> <font color='#0000FF'>static</font> <font color='#0000FF'><u>long</u></font> NR <font color='#5555FF'>=</font> <font color='#979000'>0</font>; <font color='#009900'>// We don't know the length of the vector until runtime. So we put 0 here.
</font> <font color='#0000FF'>const</font> <font color='#0000FF'>static</font> <font color='#0000FF'><u>long</u></font> NC <font color='#5555FF'>=</font> <font color='#979000'>1</font>; <font color='#009900'>// We do know that it only has one column (since it's a vector)
</font> <font color='#0000FF'>typedef</font> T type;
<font color='#009900'>// Since the std::vector doesn't use a dlib memory manager we list the default one here.
</font> <font color='#0000FF'>typedef</font> <API key> mem_manager_type;
<font color='#009900'>// The layout type also doesn't really matter in this case. So we list row_major_layout
</font> <font color='#009900'>// since it is a good default.
</font> <font color='#0000FF'>typedef</font> row_major_layout layout_type;
<font color='#009900'>// Note that we define const_ret_type to be a reference type. This way we can
</font> <font color='#009900'>// return the contents of the std::vector by reference.
</font> <font color='#0000FF'>typedef</font> <font color='#0000FF'>const</font> T<font color='#5555FF'>&</font> const_ret_type;
const_ret_type <b><a name='apply'></a>apply</b> <font face='Lucida Console'>(</font><font color='#0000FF'><u>long</u></font> r, <font color='#0000FF'><u>long</u></font> <font face='Lucida Console'>)</font> <font color='#0000FF'>const</font> <b>{</b> <font color='#0000FF'>return</font> vect[r]; <b>}</b>
<font color='#0000FF'><u>long</u></font> <b><a name='nr'></a>nr</b> <font face='Lucida Console'>(</font><font face='Lucida Console'>)</font> <font color='#0000FF'>const</font> <b>{</b> <font color='#0000FF'>return</font> vect.<font color='#BB00BB'>size</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>; <b>}</b>
<font color='#0000FF'><u>long</u></font> <b><a name='nc'></a>nc</b> <font face='Lucida Console'>(</font><font face='Lucida Console'>)</font> <font color='#0000FF'>const</font> <b>{</b> <font color='#0000FF'>return</font> <font color='#979000'>1</font>; <b>}</b>
<font color='#009900'>// This expression never aliases anything since it doesn't contain any matrix expression (it
</font> <font color='#009900'>// contains only a std::vector which doesn't count since you can't assign a matrix expression
</font> <font color='#009900'>// to a std::vector object).
</font> <font color='#0000FF'>template</font> <font color='#5555FF'><</font><font color='#0000FF'>typename</font> U<font color='#5555FF'>></font> <font color='#0000FF'><u>bool</u></font> <b><a name='aliases'></a>aliases</b> <font face='Lucida Console'>(</font> <font color='#0000FF'>const</font> matrix_exp<font color='#5555FF'><</font>U<font color='#5555FF'>></font><font color='#5555FF'>&</font> <font face='Lucida Console'>)</font> <font color='#0000FF'>const</font> <b>{</b> <font color='#0000FF'>return</font> <font color='#979000'>false</font>; <b>}</b>
<font color='#0000FF'>template</font> <font color='#5555FF'><</font><font color='#0000FF'>typename</font> U<font color='#5555FF'>></font> <font color='#0000FF'><u>bool</u></font> <b><a name='<API key>'></a><API key></b> <font face='Lucida Console'>(</font> <font color='#0000FF'>const</font> matrix_exp<font color='#5555FF'><</font>U<font color='#5555FF'>></font><font color='#5555FF'>&</font> <font face='Lucida Console'>)</font> <font color='#0000FF'>const</font> <b>{</b> <font color='#0000FF'>return</font> <font color='#979000'>false</font>; <b>}</b>
<b>}</b>;
<font color='#0000FF'>template</font> <font color='#5555FF'><</font> <font color='#0000FF'>typename</font> T <font color='#5555FF'>></font>
<font color='#0000FF'>const</font> matrix_op<font color='#5555FF'><</font><API key><font color='#5555FF'><</font>T<font color='#5555FF'>></font> <font color='#5555FF'>></font> <b><a name='<API key>'></a><API key></b> <font face='Lucida Console'>(</font>
<font color='#0000FF'>const</font> std::vector<font color='#5555FF'><</font>T<font color='#5555FF'>></font><font color='#5555FF'>&</font> vector
<font face='Lucida Console'>)</font>
<b>{</b>
<font color='#0000FF'>typedef</font> <API key><font color='#5555FF'><</font>T<font color='#5555FF'>></font> op;
<font color='#0000FF'>return</font> matrix_op<font color='#5555FF'><</font>op<font color='#5555FF'>></font><font face='Lucida Console'>(</font><font color='#BB00BB'>op</font><font face='Lucida Console'>(</font>vector<font face='Lucida Console'>)</font><font face='Lucida Console'>)</font>;
<b>}</b>
<font color='
</font>
<font color='#0000FF'>template</font> <font color='#5555FF'><</font><font color='#0000FF'>typename</font> M, <font color='#0000FF'>typename</font> T<font color='#5555FF'>></font>
<font color='#0000FF'>struct</font> <b><a name='<API key>'></a><API key></b>
<b>{</b>
<font color='#009900'>/*!
This object defines a matrix expression that represents a matrix with a single
scalar value added to all its elements.
!*/</font>
<b><a name='<API key>'></a><API key></b><font face='Lucida Console'>(</font> <font color='#0000FF'>const</font> M<font color='#5555FF'>&</font> m_, <font color='#0000FF'>const</font> T<font color='#5555FF'>&</font> val_<font face='Lucida Console'>)</font> : m<font face='Lucida Console'>(</font>m_<font face='Lucida Console'>)</font>, val<font face='Lucida Console'>(</font>val_<font face='Lucida Console'>)</font><b>{</b><b>}</b>
<font color='#009900'>// A reference to the matrix
</font> <font color='#0000FF'>const</font> M<font color='#5555FF'>&</font> m;
<font color='#009900'>// A copy of the scalar value that should be added to each element of m
</font> <font color='#0000FF'>const</font> T val;
<font color='#009900'>// This time we add 1 to the cost since evaluating an element of this
</font> <font color='#009900'>// expression means performing 1 addition operation.
</font> <font color='#0000FF'>const</font> <font color='#0000FF'>static</font> <font color='#0000FF'><u>long</u></font> cost <font color='#5555FF'>=</font> M::cost <font color='#5555FF'>+</font> <font color='#979000'>1</font>;
<font color='#0000FF'>const</font> <font color='#0000FF'>static</font> <font color='#0000FF'><u>long</u></font> NR <font color='#5555FF'>=</font> M::NR;
<font color='#0000FF'>const</font> <font color='#0000FF'>static</font> <font color='#0000FF'><u>long</u></font> NC <font color='#5555FF'>=</font> M::NC;
<font color='#0000FF'>typedef</font> <font color='#0000FF'>typename</font> M::type type;
<font color='#0000FF'>typedef</font> <font color='#0000FF'>typename</font> M::mem_manager_type mem_manager_type;
<font color='#0000FF'>typedef</font> <font color='#0000FF'>typename</font> M::layout_type layout_type;
<font color='#009900'>// Note that we declare const_ret_type to be a non-reference type. This is important
</font> <font color='#009900'>// since apply() computes a new temporary value and thus we can't return a reference
</font> <font color='#009900'>// to it.
</font> <font color='#0000FF'>typedef</font> type const_ret_type;
const_ret_type <b><a name='apply'></a>apply</b> <font face='Lucida Console'>(</font><font color='#0000FF'><u>long</u></font> r, <font color='#0000FF'><u>long</u></font> c<font face='Lucida Console'>)</font> <font color='#0000FF'>const</font> <b>{</b> <font color='#0000FF'>return</font> <font color='#BB00BB'>m</font><font face='Lucida Console'>(</font>r,c<font face='Lucida Console'>)</font> <font color='#5555FF'>+</font> val; <b>}</b>
<font color='#0000FF'><u>long</u></font> <b><a name='nr'></a>nr</b> <font face='Lucida Console'>(</font><font face='Lucida Console'>)</font> <font color='#0000FF'>const</font> <b>{</b> <font color='#0000FF'>return</font> m.<font color='#BB00BB'>nr</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>; <b>}</b>
<font color='#0000FF'><u>long</u></font> <b><a name='nc'></a>nc</b> <font face='Lucida Console'>(</font><font face='Lucida Console'>)</font> <font color='#0000FF'>const</font> <b>{</b> <font color='#0000FF'>return</font> m.<font color='#BB00BB'>nc</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>; <b>}</b>
<font color='#009900'>// This expression aliases anything m aliases.
</font> <font color='#0000FF'>template</font> <font color='#5555FF'><</font><font color='#0000FF'>typename</font> U<font color='#5555FF'>></font> <font color='#0000FF'><u>bool</u></font> <b><a name='aliases'></a>aliases</b> <font face='Lucida Console'>(</font> <font color='#0000FF'>const</font> matrix_exp<font color='#5555FF'><</font>U<font color='#5555FF'>></font><font color='#5555FF'>&</font> item<font face='Lucida Console'>)</font> <font color='#0000FF'>const</font> <b>{</b> <font color='#0000FF'>return</font> m.<font color='#BB00BB'>aliases</font><font face='Lucida Console'>(</font>item<font face='Lucida Console'>)</font>; <b>}</b>
<font color='#009900'>// Unlike the transpose expression. This expression only destructively aliases something if m does.
</font> <font color='#009900'>// So this expression has the regular non-destructive kind of aliasing.
</font> <font color='#0000FF'>template</font> <font color='#5555FF'><</font><font color='#0000FF'>typename</font> U<font color='#5555FF'>></font> <font color='#0000FF'><u>bool</u></font> <b><a name='<API key>'></a><API key></b> <font face='Lucida Console'>(</font> <font color='#0000FF'>const</font> matrix_exp<font color='#5555FF'><</font>U<font color='#5555FF'>></font><font color='#5555FF'>&</font> item<font face='Lucida Console'>)</font> <font color='#0000FF'>const</font> <b>{</b> <font color='#0000FF'>return</font> m.<font color='#BB00BB'><API key></font><font face='Lucida Console'>(</font>item<font face='Lucida Console'>)</font>; <b>}</b>
<b>}</b>;
<font color='#0000FF'>template</font> <font color='#5555FF'><</font> <font color='#0000FF'>typename</font> M, <font color='#0000FF'>typename</font> T <font color='#5555FF'>></font>
<font color='#0000FF'>const</font> matrix_op<font color='#5555FF'><</font><API key><font color='#5555FF'><</font>M,T<font color='#5555FF'>></font> <font color='#5555FF'>></font> <b><a name='add_scalar'></a>add_scalar</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'>const</font> matrix_exp<font color='#5555FF'><</font>M<font color='#5555FF'>></font><font color='#5555FF'>&</font> m,
T val
<font face='Lucida Console'>)</font>
<b>{</b>
<font color='#0000FF'>typedef</font> <API key><font color='#5555FF'><</font>M,T<font color='#5555FF'>></font> op;
<font color='#0000FF'>return</font> matrix_op<font color='#5555FF'><</font>op<font color='#5555FF'>></font><font face='Lucida Console'>(</font><font color='#BB00BB'>op</font><font face='Lucida Console'>(</font>m.<font color='#BB00BB'>ref</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>, val<font face='Lucida Console'>)</font><font face='Lucida Console'>)</font>;
<b>}</b>
<font color='
</font>
<font color='#0000FF'><u>void</u></font> <b><a name='<API key>'></a><API key></b><font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font>
<b>{</b>
matrix<font color='#5555FF'><</font><font color='#0000FF'><u>double</u></font><font color='#5555FF'>></font> <font color='#BB00BB'>x</font><font face='Lucida Console'>(</font><font color='#979000'>2</font>,<font color='#979000'>3</font><font face='Lucida Console'>)</font>;
x <font color='#5555FF'>=</font> <font color='#979000'>1</font>, <font color='#979000'>1</font>, <font color='#979000'>1</font>,
<font color='#979000'>2</font>, <font color='#979000'>2</font>, <font color='#979000'>2</font>;
cout <font color='#5555FF'><</font><font color='#5555FF'><</font> x <font color='#5555FF'><</font><font color='#5555FF'><</font> endl;
<font color='#009900'>// Finally, lets use the matrix expressions we defined above.
</font>
<font color='#009900'>// prints the transpose of x
</font> cout <font color='#5555FF'><</font><font color='#5555FF'><</font> <font color='#BB00BB'>example_trans</font><font face='Lucida Console'>(</font>x<font face='Lucida Console'>)</font> <font color='#5555FF'><</font><font color='#5555FF'><</font> endl;
<font color='#009900'>// prints this:
</font> <font color='#009900'>// 11 11 11
</font> <font color='#009900'>// 12 12 12
</font> cout <font color='#5555FF'><</font><font color='#5555FF'><</font> <font color='#BB00BB'>add_scalar</font><font face='Lucida Console'>(</font>x, <font color='#979000'>10</font><font face='Lucida Console'>)</font> <font color='#5555FF'><</font><font color='#5555FF'><</font> endl;
<font color='#009900'>// matrix expressions can be nested, even the user defined ones.
</font> <font color='#009900'>// the following statement prints this:
</font> <font color='#009900'>// 11 12
</font> <font color='#009900'>// 11 12
</font> <font color='#009900'>// 11 12
</font> cout <font color='#5555FF'><</font><font color='#5555FF'><</font> <font color='#BB00BB'>example_trans</font><font face='Lucida Console'>(</font><font color='#BB00BB'>add_scalar</font><font face='Lucida Console'>(</font>x, <font color='#979000'>10</font><font face='Lucida Console'>)</font><font face='Lucida Console'>)</font> <font color='#5555FF'><</font><font color='#5555FF'><</font> endl;
<font color='#009900'>// Since we setup the alias detection correctly we can even do this:
</font> x <font color='#5555FF'>=</font> <font color='#BB00BB'>example_trans</font><font face='Lucida Console'>(</font><font color='#BB00BB'>add_scalar</font><font face='Lucida Console'>(</font>x, <font color='#979000'>10</font><font face='Lucida Console'>)</font><font face='Lucida Console'>)</font>;
cout <font color='#5555FF'><</font><font color='#5555FF'><</font> "<font color='#CC0000'>new x:\n</font>" <font color='#5555FF'><</font><font color='#5555FF'><</font> x <font color='#5555FF'><</font><font color='#5555FF'><</font> endl;
cout <font color='#5555FF'><</font><font color='#5555FF'><</font> "<font color='#CC0000'>Do some testing with the <API key>() function: </font>" <font color='#5555FF'><</font><font color='#5555FF'><</font> endl;
std::vector<font color='#5555FF'><</font><font color='#0000FF'><u>float</u></font><font color='#5555FF'>></font> vect;
vect.<font color='#BB00BB'>push_back</font><font face='Lucida Console'>(</font><font color='#979000'>1</font><font face='Lucida Console'>)</font>;
vect.<font color='#BB00BB'>push_back</font><font face='Lucida Console'>(</font><font color='#979000'>3</font><font face='Lucida Console'>)</font>;
vect.<font color='#BB00BB'>push_back</font><font face='Lucida Console'>(</font><font color='#979000'>5</font><font face='Lucida Console'>)</font>;
<font color='#009900'>// Now lets treat our std::vector like a matrix and print some things.
</font> cout <font color='#5555FF'><</font><font color='#5555FF'><</font> <font color='#BB00BB'><API key></font><font face='Lucida Console'>(</font>vect<font face='Lucida Console'>)</font> <font color='#5555FF'><</font><font color='#5555FF'><</font> endl;
cout <font color='#5555FF'><</font><font color='#5555FF'><</font> <font color='#BB00BB'>add_scalar</font><font face='Lucida Console'>(</font><font color='#BB00BB'><API key></font><font face='Lucida Console'>(</font>vect<font face='Lucida Console'>)</font>, <font color='#979000'>10</font><font face='Lucida Console'>)</font> <font color='#5555FF'><</font><font color='#5555FF'><</font> endl;
<font color='#009900'>/*
As an aside, note that dlib contains functions equivalent to the ones we
defined above. They are:
- dlib::trans()
- dlib::mat() (converts things into matrices)
- operator+ (e.g. you can say my_mat + 1)
Also, if you are going to be creating your own matrix expression you should also
look through the matrix code in the dlib/matrix folder. There you will find
many other examples of matrix expressions.
*/</font>
<b>}</b>
<font color='
</font>
</pre></body></html>
|
define('exports@*', [], function(require, exports, module){
exports.a = 1;
});
|
package types
// ApiVersion custom ENUM for SDK forward compatibility
type ApiVersion int
const (
ApiV1 ApiVersion = iota
)
// EnvironmentType
// https://docs.coinapi.io/#endpoints-2
type EnvironmentType int
const (
ProdEncrypted EnvironmentType = iota
ProdInsecure
TestEncrypted
TestInsecure
)
// MessageType replicates the official incoming message types as (kinda) string enum.
// https://docs.coinapi.io/#messages
type MessageType string
const (
TRADE MessageType = "trade"
QUOTE MessageType = "quote"
BOOK_L2_FULL MessageType = "book" // Orderbook L2 (Full)
BOOK_L2_TOP_5 MessageType = "book5" // Orderbook L2 (5 best Bid / Ask)
BOOK_L2_TOP_20 MessageType = "book20" // Orderbook L2 (20 best Bid / Ask)
BOOK_L2_TOP_50 MessageType = "book50" // Orderbook L2 (50 best Bid / Ask)
BOOK_L3_FULL MessageType = "book_l3" // Orderbook L3 (Full) https://docs.coinapi.io/#<API key>
OHLCV MessageType = "ohlcv"
VOLUME MessageType = "volume"
HEARTBEAT MessageType = "hearbeat" // DO NOT FIX! it's a typo in the official msg spec!
ERROR MessageType = "error" // Otherwise processMessage(.) fails to handle heartbeat messages!
EXCHANGERATE MessageType = "exrate"
RECONNECT MessageType = "reconnect"
)
// ReconnectType defines the reconnect behavior upon receiving a reconnect message
// https://docs.coinapi.io/#reconnect-in
type ReconnectType int
const (
OnConnectionClose ReconnectType = iota
OnReconnectMessage
)
|
require 'rubygems'
require 'bundler'
Bundler.require
require 'sinatra'
set :public_folder, 'static'
get '/' do
File.read(File.join('index.html'))
end
get '/api/' do
#content_type :js
content_type("application/javascript")
response["Content-Type"] = "application/javascript"
#require 'config/initializers/beamly.rb'
root = ::File.dirname(__FILE__)
require ::File.join( root, 'config', 'initializers', 'beamly' )
#require 'config/initializers/beamly'
z = Beamly::Epg.new
region_id = z.regions.first.id
provider_id = z.providers.first.id
result = z.catalogues(region_id, provider_id)
services = z.epg(result.first.epg_id)
today = Date.today.strftime("%Y/%m/%d")
schedule = z.schedule(services[8].service_id, today)
today_formatted = Date.today.strftime("%Y-%m-%d")
headers "Content-Type" => "application/json"
json = '['
schedule.each do |item|
time_formatted = Time.at(item.start).getlocal.strftime("%Y-%m-%d %H:%M")
json += '
{
"date": "'+time_formatted+'",
"episodes":
[
{
"show": {
"title": "'+item.title+'",
"year": 2013,
"genres": ["Comedy"],
},
"episode":{"images": {"screen": "http://img-a.zeebox.com/940x505/'+item.img+'"}}
}
]
},
'
end
json += ']'
formatted_callback = "#{params['callback']}("+json+')'
content_type("application/javascript")
response["Content-Type"] = "application/javascript"
formatted_callback
end
|
using System.Threading.Tasks;
using FluentAssertions;
using Histrio.Testing;
using Xunit;
namespace Histrio.Tests.Cell
{
public class <API key> : GivenWhenThen
{
[Theory,
InlineData(true),
InlineData(333),
InlineData(new[] {true, true}),
InlineData("foo")]
public void <API key><T>(T expectedValue)
{
var theater = new Theater();
var <API key> = new <API key><Reply<T>>();
;
Address customer = null;
Address cell = null;
Given(() =>
{
cell = theater.CreateActor(new CellBehavior<T>());
var set = new Set<T>(expectedValue);
theater.Dispatch(set, cell);
customer = theater.CreateActor(new AssertionBehavior<Reply<T>>(<API key>, 1));
});
When(() =>
{
var get = new Get(customer);
theater.Dispatch(get, cell);
});
Then(async () =>
{
var actualValue = await <API key>.Task;
actualValue.Content.<API key>(expectedValue);
});
}
}
}
|
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class oscilation : MonoBehaviour {
public float m_speed = 0.008f;
public int m_distance = 45;
private int compteur = 0;
private int compteur2 = 0;
// Use this for initialization
void Start () {
Vector3 yOrigin = transform.localPosition;
/*Vector3 move = new Vector3(0.0f,0.0f,0.0f);
Vector3 move2 = new Vector3(0.0f,0.0f,0.0f);
move.y = m_speed;
move2.y = -m_speed;*/
}
// Update is called once per frame
void Update () {
if (compteur < m_distance) {
Vector3 move = new Vector3(0.0f,0.0f,0.0f);
move.y = m_speed;
transform.localPosition = transform.localPosition + move;
compteur++;
} else if (compteur2 < m_distance) {
Vector3 move2 = new Vector3(0.0f,0.0f,0.0f);
move2.y = -m_speed;
compteur2++;
transform.localPosition = transform.localPosition + move2;
} else {
compteur = 0;
compteur2 = 0;
}
}
}
|
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Entity;
using System.Linq;
using System.Threading.Tasks;
using System.Net;
using System.Web;
using System.Web.Mvc;
using Transit.Models;
namespace Transit.Controllers
{
public class RoutesController : Controller
{
private <API key> db = new <API key>();
// GET: Routes
public async Task<ActionResult> Index()
{
var routes = db.Routes.Include(r => r.agency).Include(r => r.type);
return View(await routes.ToListAsync());
}
// GET: Routes/Details/5
public async Task<ActionResult> Details(int? id)
{
if (id == null)
{
return new <API key>(HttpStatusCode.BadRequest);
}
Route route = await db.Routes.FindAsync(id);
if (route == null)
{
return HttpNotFound();
}
return View(route);
}
// GET: Routes/Create
public ActionResult Create()
{
ViewBag.agencyId = new SelectList(db.Agencies, "id", "name");
ViewBag.typeId = new SelectList(db.RouteTypes, "id", "label");
return View();
}
// POST: Routes/Create
// To protect from overposting attacks, please enable the specific properties you want to bind to, for
[HttpPost]
[<API key>]
public async Task<ActionResult> Create([Bind(Include = "id,agencyId,label,fullName,description,typeId,url,color,textColor")] Route route)
{
if (ModelState.IsValid)
{
db.Routes.Add(route);
await db.SaveChangesAsync();
return RedirectToAction("Index");
}
ViewBag.agencyId = new SelectList(db.Agencies, "id", "name", route.agencyId);
ViewBag.typeId = new SelectList(db.RouteTypes, "id", "label", route.typeId);
return View(route);
}
// GET: Routes/Edit/5
public async Task<ActionResult> Edit(int? id)
{
if (id == null)
{
return new <API key>(HttpStatusCode.BadRequest);
}
Route route = await db.Routes.FindAsync(id);
if (route == null)
{
return HttpNotFound();
}
ViewBag.agencyId = new SelectList(db.Agencies, "id", "name", route.agencyId);
ViewBag.typeId = new SelectList(db.RouteTypes, "id", "label", route.typeId);
return View(route);
}
// POST: Routes/Edit/5
// To protect from overposting attacks, please enable the specific properties you want to bind to, for
[HttpPost]
[<API key>]
public async Task<ActionResult> Edit([Bind(Include = "id,agencyId,label,fullName,description,typeId,url,color,textColor")] Route route)
{
if (ModelState.IsValid)
{
db.Entry(route).State = EntityState.Modified;
await db.SaveChangesAsync();
return RedirectToAction("Index");
}
ViewBag.agencyId = new SelectList(db.Agencies, "id", "name", route.agencyId);
ViewBag.typeId = new SelectList(db.RouteTypes, "id", "label", route.typeId);
return View(route);
}
// GET: Routes/Delete/5
public async Task<ActionResult> Delete(int? id)
{
if (id == null)
{
return new <API key>(HttpStatusCode.BadRequest);
}
Route route = await db.Routes.FindAsync(id);
if (route == null)
{
return HttpNotFound();
}
return View(route);
}
// POST: Routes/Delete/5
[HttpPost, ActionName("Delete")]
[<API key>]
public async Task<ActionResult> DeleteConfirmed(int id)
{
Route route = await db.Routes.FindAsync(id);
db.Routes.Remove(route);
await db.SaveChangesAsync();
return RedirectToAction("Index");
}
protected override void Dispose(bool disposing)
{
if (disposing)
{
db.Dispose();
}
base.Dispose(disposing);
}
}
}
|
jQuery(document).ready(function(){
jQuery('.carousel').carousel()
var FPS = 30;
var player = $('#player')
var pWidth = player.width();
$window = $(window)
var wWidth = $window.width();
setInterval(function() {
update();
}, 1000/FPS);
function update() {
if(keydown.space) {
player.shoot();
}
if(keydown.left) {
console.log('go left')
player.css('left', '-=10');
}
if(keydown.right) {
console.log('go right')
var x = player.position().left;
if(x + pWidth > wWidth)
{
player.css('left', '0')
}
else if(x < 0 )
{
var p = wWidth + x - pWidth;
var t = p + 'px'
player.css('left', t)
}
else {
player.css('left', '+=10');
}
}
}
$('')
})
|
<reference path="tsUnit.ts" />
<reference path="MockExpression.ts" />
<reference path="../src/EventBinding.ts" />
module jsBind {
private fireEvent(elem: any): void {
if (document.createEventObject) {
// IE 9 & 10
var event: any = document.createEventObject();
event.eventType = "onclick";
elem.fireEvent("onclick", event);
} else if (dispatchEvent) {
// For DOM
var evt = document.createEvent("HTMLEvents");
evt.initEvent("click", false, true);
elem.dispatchEvent(evt);
} else {
// IE 8-
elem.fireEvent("onclick");
}
}
export class EventBindingTests {
public testEvaluate(c: tsUnit.TestContext): void {
var elem: any = document.getElementById("Results");
var expr = new MockExpression(42);
var binding = new EventBinding(elem, "click", expr, null, null);
binding.evaluate();
fireEvent(elem);
c.isTrue(expr.wasEvaluated);
}
public testDispose(c: tsUnit.TestContext): void {
var elem: any = document.getElementById("Results");
var expr = new MockExpression(42);
var binding = new EventBinding(elem, "click", expr, null, null);
binding.evaluate();
// Check the dispose occurs
binding.dispose();
c.isTrue(expr.isDisposed);
fireEvent(elem);
c.isFalse(expr.wasEvaluated);
}
}
}
|
// This software may be modified and distributed under the terms
#if UNITY_EDITOR
using SpriterDotNet;
using System;
using System.IO;
using System.Linq;
using UnityEditor;
using UnityEngine;
namespace SpriterDotNetUnity
{
public class SpriterImporter : AssetPostprocessor
{
private static readonly string[] ScmlExtensions = new string[] { ".scml" };
private static readonly float DeltaZ = -0.001f;
private static void <API key>(string[] importedAssets, string[] deletedAssets, string[] movedAssets, string[] movedFromPath)
{
foreach (string asset in importedAssets)
{
if (!IsScml(asset)) continue;
CreateSpriter(asset);
}
foreach (string asset in deletedAssets)
{
if (!IsScml(asset)) continue;
}
for (int i = 0; i < movedAssets.Length; i++)
{
string asset = movedAssets[i];
if (!IsScml(asset)) continue;
}
}
private static bool IsScml(string path)
{
return ScmlExtensions.Any(path.EndsWith);
}
private static void CreateSpriter(string path)
{
string data = File.ReadAllText(path);
Spriter spriter = SpriterParser.Parse(data);
string rootFolder = Path.GetDirectoryName(path);
foreach (SpriterEntity entity in spriter.Entities)
{
GameObject go = new GameObject();
go.name = entity.Name;
<API key> sdnBehaviour = go.AddComponent<<API key>>();
sdnBehaviour.Entity = entity;
sdnBehaviour.enabled = true;
LoadSprites(sdnBehaviour, spriter, rootFolder);
CreateChildren(entity, sdnBehaviour, spriter, go);
string prefabPath = rootFolder + "/" + entity.Name + ".prefab";
PrefabUtility.CreatePrefab(prefabPath, go, <API key>.ConnectToPrefab);
GameObject.DestroyImmediate(go);
}
}
private static void CreateChildren(SpriterEntity entity, <API key> sdnBehaviour, Spriter spriter, GameObject parent)
{
int maxObjects = 0;
foreach (SpriterAnimation animation in entity.Animations)
{
foreach (SpriterMainLineKey mainKey in animation.MainlineKeys)
{
maxObjects = Math.Max(maxObjects, mainKey.ObjectRefs.Length);
}
}
sdnBehaviour.Children = new GameObject[maxObjects];
sdnBehaviour.Pivots = new GameObject[maxObjects];
for (int i = 0; i < maxObjects; ++i)
{
GameObject pivot = new GameObject();
GameObject child = new GameObject();
sdnBehaviour.Pivots[i] = pivot;
sdnBehaviour.Children[i] = child;
pivot.transform.SetParent(parent.transform);
child.transform.SetParent(pivot.transform);
child.transform.localPosition = new Vector3(0, 0, DeltaZ * i);
pivot.name = "pivot " + i;
child.name = "child " + i;
child.AddComponent<SpriteRenderer>();
}
}
private static void LoadSprites(<API key> sdnBehaviour, Spriter spriter, string rootFolder)
{
sdnBehaviour.Folders = new SdnFolder[spriter.Folders.Length];
for (int i = 0; i < spriter.Folders.Length; ++i)
{
SpriterFolder folder = spriter.Folders[i];
SdnFolder sdnFolder = new SdnFolder();
sdnFolder.Files = new Sprite[folder.Files.Length];
sdnBehaviour.Folders[i] = sdnFolder;
for (int j = 0; j < folder.Files.Length; ++j)
{
SpriterFile file = folder.Files[j];
string spritePath = rootFolder;
spritePath += "/";
spritePath += file.Name;
Sprite sprite = AssetDatabase.LoadAssetAtPath<Sprite>(spritePath);
if (sprite == null)
{
Debug.LogWarning("Unable to load sprite: " + spritePath);
continue;
}
sdnFolder.Files[j] = sprite;
}
}
}
}
}
#endif
|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import base64
import json
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions
from behave import *
@step('I share first element in the history list')
def step_impl(context):
context.execute_steps(u'''
given I open History dialog
''')
history = context.browser.find_element_by_id("HistoryPopup")
entries = history.<API key>('.//li[not(@data-clone-template)]')
assert len(entries) > 0, "There are no entries in the history"
item = entries[0]
context.execute_steps(u'''
given I open History dialog
''')
|
layout: link
type: link
link: https:
title: "Bloomberg: Why Indonesia Failed to Cash in on the China-U.S. Trade War"
category: links
tags:
- life
- "daily found"
- development
- indonesia
categories: dailyfound
published: true
comments: true
Dengan adanya perang dagang antara Amerika dan Tiongkok, banyak berimbas terhadap industri-industri yang ada didua negara itu, dan beberapa negara di asia tenggara bisa mengambil untung dari kondisi itu.
Sebut Vietnam, Thailand, banyak investor yang mengalihkan investasinya ke negara tersebut, alasan kenapa Indonesia tidak begitu besar terkena imbasnya.
<!--more
> The reasons for the poor performance are well documented: inadequate infrastructure, particularly in transport; rigid labor rules; limits on how much foreigners can invest in several industries; bureaucratic red tape and a habit of backtracking on regulations that makes it tricky to do business in the country.
Memang sangat berbelit investasi di sini, belum lagi kondisi pekerjanya yang terhitung mahal, belum juga preman-preman, ditambah isu investor asing yang berkonotasi negatif, pemerintah dianggap menjual negara ini ke asing, padahal membuka investasi.
Membangun infrastuktur yang bisa dijadikan pendukung pemerataan usaha, juga mempermudah transportasi sehingga atraktif untuk investor, tapi tetap itu dianggap sebagai suatu pemborosan.
Ada juga kalimat andalan "Negara ini kaya, masa *gak* bisa mengambil untung dari itu? tidak butuh asing untuk mengelola", dan ucapan-ucapan sejenis, yang mana tentu itu keluar dari ketidak tahuan akan kondisi, seperti penonton bola, biasanya penonton bola lebih pintar dari pemainnya, yang latihan 10 jam sehari, kalau gagal gol akan dibilang bodoh oleh penonton budiman.
Sama seperti warga yang mengomentari pemerintah, merasa lebih pintar.
|
import { entryPoint } from '@rpgjs/standalone'
import globalConfigClient from './config/client'
import globalConfigServer from './config/server'
import modules from './modules'
document.addEventListener('DOMContentLoaded', function() {
entryPoint(modules, {
globalConfigClient,
globalConfigServer
}).start()
})
|
// object code form for any purpose and without fee is hereby granted,
// restricted rights notice below appear in all supporting
// documentation.
// AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
// MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.
// DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
// UNINTERRUPTED OR ERROR FREE.
// Use, duplication, or disclosure by the U.S. Government is subject to
// restrictions set forth in FAR 52.227-19 (Commercial Computer
// (Rights in Technical Data and Computer Software), as applicable.
#ifndef ATILDEFS_H
#include "AtilDefs.h"
#endif
#ifndef <API key>
#include "<API key>.h"
#endif
#ifndef <API key>
#define <API key>
#if __GNUC__ >= 4
#pragma GCC visibility push(default)
#endif
namespace Atil
{
<summary>
This class groups properties into a set of properties much
like a "structure" in "c".
</summary>
class <API key> : public <API key>
{
public:
<summary>
The virtual destructor.
</summary>
virtual ~<API key> ();
<summary>
This returns the number of properties in the set.
</summary>
<returns>
The number of properties in the set.
</returns>
virtual int getNumProperties () const;
<summary>
This returns a selected property from the properties in the set.
</summary>
<param name="nIndex">
The index of the property to that is returned.
</param>
<returns>
A pointer to the property at the index. This pointer should not be freed by the caller.
</returns>
virtual <API key>* getProperty (int nIndex) const;
protected:
<summary>
(Protected) Copy constructor.
</summary>
<param name="iter">
The instance to be copied.
</param>
<API key> (const <API key>& iter);
<summary>
(Protected) The simple constructor.
</summary>
<API key> ();
<summary>
(Protected) The pre-allocating constructor.
</summary>
<param name="nNumToAlloc">
The number of properties that will be in the set.
</param>
<API key> (int nNumToAlloc);
<summary>
(Protected) This sets the property at index in the set.
</summary>
<param name="nIndex">
The index of the property that is to be set.
</param>
<param name="pProperty">
A pointer to the property that should be placed at the index. The
property will be <c>clone()</c> copied. The pointer is not held by the set.
</param>
void setProperty (int nIndex, <API key>* pProperty);
<summary>
(Protected) This adds the property to the set.
</summary>
<param name="pProperty">
A pointer to the property that should be placed at the index. The
property will be <c>clone()</c> copied. The pointer is not held by the set.
</param>
void appendProperty (<API key>* pProperty);
<summary>
(Protected) The array of property pointers held by the set.
</summary>
<API key>** mppProperties;
<summary>
(Protected) The number of properties that have been set into the set.
</summary>
int mnNumProperties;
<summary>
(Protected) The length of the property array.
</summary>
int mnArraySize;
private:
<API key>& operator= (const <API key>& from);
};
} // end of namespace Atil
#if __GNUC__ >= 4
#pragma GCC visibility pop
#endif
#endif
|
'use strict';
// Configuring the Articles module
angular.module('about').run(['Menus',
function(Menus) {
// Set top bar menu items
Menus.addMenuItem('mainmenu', 'About Us', 'about', 'left-margin', '/about-us', true, null, 3);
}
]);
|
package cwr;
import java.util.ArrayList;
public class RobotBite
{
//0 = time [state]
//1 = x [state]
//2 = y [state]
//3 = energy [state]
//4 = bearing radians [relative position]
//5 = distance [relative position]
//6 = heading radians [travel]
//7 = velocity [travel]
String name;
long cTime;
double cx;
double cy;
cwruBase origin;
double cEnergy;
double cBearing_radians;
double cDistance;
double cHeading_radians;
double cVelocity;
ArrayList<Projection> projec; //forward projections for x
public RobotBite(String name, long time, cwruBase self,
double energy, double bearing_radians, double distance,
double heading_radians, double velocity)
{
this.name = name;
cTime = time;
origin = self;
cEnergy = energy;
cBearing_radians = bearing_radians;
double myBearing = self.getHeadingRadians();
//System.out.println("I'm going "+self.getHeadingRadians());
double adjust_bearing = (bearing_radians+myBearing)%(2*Math.PI);
//System.out.println("input bearing "+(bearing_radians));
//System.out.println("adjust bearing "+(adjust_bearing));
//System.out.println("math bearing"+(-adjust_bearing+Math.PI/2));
cDistance = distance;
cHeading_radians = heading_radians;
//System.out.println("location heading "+heading_radians);
cVelocity = velocity;
double myX = self.getX();
double myY = self.getY();
double math_bearing = (-adjust_bearing+Math.PI/2)%(2*Math.PI);
//double math_heading = (-heading_radians+Math.PI/2)%(2*Math.PI);
/*
* 0
* 90
* -90 180 0 90
* -90
* 180
*/
double dX = distance*Math.cos(math_bearing);
//System.out.println("location dx:" + dX);
double dY = distance*Math.sin(math_bearing);
//System.out.println("location dy:" + dY);
cx = myX+dX;
cy = myY+dY;
}
public void attachProjection(ArrayList<Projection> projList)
{
projec = projList;
}
}
|
export default function closest(n, arr) {
let i
let ndx
let diff
let best = Infinity
let low = 0
let high = arr.length - 1
while (low <= high) {
// <API key> no-bitwise
i = low + ((high - low) >> 1)
diff = arr[i] - n
if (diff < 0) {
low = i + 1
} else if (diff > 0) {
high = i - 1
}
diff = Math.abs(diff)
if (diff < best) {
best = diff
ndx = i
}
if (arr[i] === n) break
}
return arr[ndx]
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ClearScript.Installer.Demo
{
public class Class1
{
}
}
|
export default function fibonacci(n){
if(n <= 2){
return 1;
}
let n1 = 1, n2 = 1, sn = 0;
for(let i = 0; i < n - 2; i ++){
sn = n1 + n2;
n1 = n2;
n2 = sn;
}
return sn;
}
|
import * as UTILS from '@utils';
const app = new WHS.App([
UTILS.appModules({
position: new THREE.Vector3(0, 40, 70)
})
]);
const halfMat = {
transparent: true,
opacity: 0.5
};
const box = new WHS.Box({
geometry: {
width: 30,
height: 2,
depth: 2
},
modules: [
new PHYSICS.BoxModule({
mass: 0
})
],
material: new THREE.MeshPhongMaterial({
color: UTILS.$colors.mesh,
halfMat
}),
position: {
y: 40
}
});
const box2 = new WHS.Box({
geometry: {
width: 30,
height: 1,
depth: 20
},
modules: [
new PHYSICS.BoxModule({
mass: 10,
damping: 0.1
})
],
material: new THREE.MeshPhongMaterial({
color: UTILS.$colors.softbody,
halfMat
}),
position: {
y: 38,
z: 12
}
});
const pointer = new WHS.Sphere({
modules: [
new PHYSICS.SphereModule()
],
material: new THREE.MeshPhongMaterial({
color: UTILS.$colors.mesh
})
});
console.log(pointer);
pointer.position.set(0, 60, -8);
pointer.addTo(app);
box.addTo(app);
box2.addTo(app).then(() => {
const constraint = new PHYSICS.DOFConstraint(box2, box,
new THREE.Vector3(0, 38, 1)
);
app.addConstraint(constraint);
constraint.enableAngularMotor(10, 20);
});
UTILS.addPlane(app, 250);
UTILS.addBasicLights(app);
app.start();
|
package unit.com.bitdubai.fermat_dmp_plugin.layer.basic_wallet.bitcoin_wallet.developer.bitdubai.version_1.structure.<API key>;
import com.bitdubai.fermat_api.layer.dmp_basic_wallet.common.exceptions.<API key>;
import com.bitdubai.fermat_api.layer.dmp_basic_wallet.bitcoin_wallet.interfaces.<API key>;
import com.bitdubai.fermat_api.layer.osa_android.database_system.Database;
import com.bitdubai.fermat_api.layer.osa_android.database_system.DatabaseTable;
import com.bitdubai.fermat_api.layer.osa_android.database_system.DatabaseTableRecord;
import com.bitdubai.fermat_api.layer.osa_android.database_system.DatabaseTransaction;
import com.bitdubai.fermat_api.layer.osa_android.database_system.<API key>;
import com.bitdubai.fermat_api.layer.osa_android.database_system.exceptions.<API key>;
import com.bitdubai.fermat_api.layer.osa_android.database_system.exceptions.<API key>;
import com.bitdubai.fermat_api.layer.osa_android.database_system.exceptions.<API key>;
import com.bitdubai.fermat_pip_api.layer.<API key>.error_manager.ErrorManager;
import com.bitdubai.fermat_dmp_plugin.layer.basic_wallet.bitcoin_wallet.developer.bitdubai.version_1.structure.<API key>;
import com.bitdubai.fermat_dmp_plugin.layer.basic_wallet.bitcoin_wallet.developer.bitdubai.version_1.structure.<API key>;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
import java.util.ArrayList;
import java.util.List;
import unit.com.bitdubai.fermat_dmp_plugin.layer.basic_wallet.bitcoin_wallet.developer.bitdubai.version_1.structure.mocks.<API key>;
import unit.com.bitdubai.fermat_dmp_plugin.layer.basic_wallet.bitcoin_wallet.developer.bitdubai.version_1.structure.mocks.<API key>;
import static com.googlecode.catchexception.CatchException.catchException;
import static com.googlecode.catchexception.CatchException.caughtException;
import static org.fest.assertions.api.Assertions.assertThat;
import static org.fest.assertions.api.Assertions.fail;
import static org.mockito.Mockito.doThrow;
import static org.mockito.Mockito.when;
@RunWith(MockitoJUnitRunner.class)
public class DebitTest {
@Mock
private ErrorManager mockErrorManager;
@Mock
private <API key> <API key>;
@Mock
private Database mockDatabase;
@Mock
private DatabaseTable mockWalletTable;
@Mock
private DatabaseTable mockBalanceTable;
@Mock
private DatabaseTransaction mockTransaction;
private List<DatabaseTableRecord> mockRecords;
private DatabaseTableRecord mockBalanceRecord;
private DatabaseTableRecord mockWalletRecord;
private <API key> <API key>;
private <API key> testBalance;
@Before
public void setUpMocks(){
<API key> = new <API key>();
mockBalanceRecord = new <API key>();
mockWalletRecord = new <API key>();
mockRecords = new ArrayList<>();
mockRecords.add(mockBalanceRecord);
setUpMockitoRules();
}
public void setUpMockitoRules(){
when(mockDatabase.getTable(<API key>.<API key>)).thenReturn(mockWalletTable);
when(mockDatabase.getTable(<API key>.<API key>)).thenReturn(mockBalanceTable);
when(mockBalanceTable.getRecords()).thenReturn(mockRecords);
when(mockWalletTable.getEmptyRecord()).thenReturn(mockWalletRecord);
when(mockDatabase.newTransaction()).thenReturn(mockTransaction);
}
@Before
public void <API key>(){
testBalance = new <API key>(mockDatabase);
}
@Test
public void <API key>() throws Exception{
catchException(testBalance).debit(<API key>);
assertThat(caughtException()).isNull();
}
@Test
public void <API key>() throws Exception{
doThrow(new <API key>("MOCK", null, null, null)).when(mockDatabase).openDatabase();
catchException(testBalance).debit(<API key>);
assertThat(caughtException())
.isNotNull()
.isInstanceOf(<API key>.class);
}
@Test
public void <API key>() throws Exception{
doThrow(new <API key>("MOCK", null, null, null)).when(mockDatabase).openDatabase();
catchException(testBalance).debit(<API key>);
assertThat(caughtException())
.isNotNull()
.isInstanceOf(<API key>.class);
}
@Test
public void <API key>() throws Exception{
doThrow(new <API key>("MOCK", null, null, null)).when(mockWalletTable).loadToMemory();
catchException(testBalance).debit(<API key>);
assertThat(caughtException())
.isNotNull()
.isInstanceOf(<API key>.class);
}
}
|
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH
// THE CODE OR THE USE OR OTHER DEALINGS IN THE CODE.
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using Windows.Foundation;
namespace Microsoft.Toolkit.Uwp.Services.OAuth
{
<summary>
OAuth Uri extensions.
</summary>
internal static class OAuthUriExtensions
{
<summary>
Get query parameters from Uri.
</summary>
<param name="uri">Uri to process.</param>
<returns>Dictionary of query parameters.</returns>
public static IDictionary<string, string> GetQueryParams(this Uri uri)
{
return new WwwFormUrlDecoder(uri.Query).ToDictionary(decoderEntry => decoderEntry.Name, decoderEntry => decoderEntry.Value);
}
<summary>
Get absolute Uri.
</summary>
<param name="uri">Uri to process.</param>
<returns>Uri without query string.</returns>
public static string <API key>(this Uri uri)
{
if (string.IsNullOrEmpty(uri.Query))
{
return uri.AbsoluteUri;
}
return uri.AbsoluteUri.Replace(uri.Query, string.Empty);
}
<summary>
Normalize the Uri into string.
</summary>
<param name="uri">Uri to process.</param>
<returns>Normalized string.</returns>
public static string Normalize(this Uri uri)
{
var result = new StringBuilder(string.Format(CultureInfo.InvariantCulture, "{0}://{1}", uri.Scheme, uri.Host));
if (!((uri.Scheme == "http" && uri.Port == 80) || (uri.Scheme == "https" && uri.Port == 443)))
{
result.Append(string.Concat(":", uri.Port));
}
result.Append(uri.AbsolutePath);
return result.ToString();
}
}
}
|
<html><body>
<h4>Windows 10 x64 (18363.900)</h4><br>
<h2>_OPENCOUNT_REASON</h2>
<font face="arial"> <API key> = 0n0<br>
OpenCount_AsyncRead = 0n1<br>
<API key> = 0n2<br>
<API key> = 0n3<br>
<API key> = 0n4<br>
<API key> = 0n5<br>
<API key> = 0n6<br>
<API key> = 0n7<br>
<API key> = 0n8<br>
<API key> = 0n9<br>
OpenCount_MdlWrite = 0n10<br>
<API key> = 0n11<br>
<API key> = 0n12<br>
<API key> = 0n13<br>
<API key> = 0n14<br>
<API key> = 0n15<br>
OpenCount_ReadAhead = 0n16<br>
<API key> = 0n17<br>
<API key> = 0n18<br>
<API key> = 0n19<br>
<API key> = 0n20<br>
<API key> = 0n21<br>
<API key> = 0n22<br>
<API key> = 0n23<br>
<API key> = 0n24<br>
<API key> = 0n25<br>
<API key> = 0n26<br>
<API key> = 0n27<br>
</font></body></html>
|
#ifndef BITMAP_H
#define BITMAP_H
#include <allegro5/allegro.h>
#include <memory>
#include "renderlist.h"
// This class does double duty as a renderable, and a wrapper for allegro bitmap.
class Bitmap;
using BitmapPtr = std::shared_ptr<Bitmap>;
class Bitmap : public Renderable
{
ALLEGRO_BITMAP* bitmap;
float x, y;
float scale;
public:
Bitmap() : bitmap(nullptr), x(0), y(0), scale(1.0f)
{}
Bitmap( ALLEGRO_BITMAP* _bitmap, int _x = 0 , int _y = 0 ) : bitmap(_bitmap), x(_x), y(_y), scale(1.0f)
{}
~Bitmap();
void render();
void create( int w, int h, int flags = 0 );
bool loadFromFile( const std::string& filename, int flags = 0 );
bool saveToFile( const std::string& filename );
BitmapPtr getSubBitmap( int _x, int _y, int _w, int _h );
void setBitmap( ALLEGRO_BITMAP* nb );
void setBitmap( BitmapPtr& nb );
void blit( const BitmapPtr& other, float x, float y, float scale );
float getX() { return x; }
float getY() { return y; }
float getScale() { return scale; }
void setX( int _x ) { x = _x; }
void setY( int _y ) { y = _y; }
int getWidth() { return al_get_bitmap_width( bitmap ); }
int getHeight() { return <API key>( bitmap ); }
void setScale( float _scale ) { scale = _scale; }
};
#endif // BITMAP_H
|
package main
import (
"fmt"
"github.com/cailei/gopm_index/gopm/index"
"github.com/hailiang/gosocks"
"io"
"io/ioutil"
"log"
"net/http"
"net/url"
"os"
)
type Agent struct {
client *http.Client
}
func newAgent() *Agent {
client := http.DefaultClient
// check if using a proxy
proxy_addr := os.Getenv("GOPM_PROXY")
if proxy_addr != "" {
fmt.Printf("NOTE: Using socks5 proxy: %v\n", proxy_addr)
proxy := socks.DialSocksProxy(socks.SOCKS5, proxy_addr)
transport := &http.Transport{Dial: proxy}
client = &http.Client{Transport: transport}
}
return &Agent{client}
}
func (agent *Agent) getFullIndexReader() io.Reader {
request := remote_db_host + "/all"
return agent._get_body_reader(request)
}
func (agent *Agent) uploadPackage(meta index.PackageMeta) {
request := fmt.Sprintf("%v/publish", remote_db_host)
// marshal PackageMeta to json
json, err := meta.ToJson()
if err != nil {
log.Fatalln(err)
}
// create a POST request
response, err := http.PostForm(request, url.Values{"pkg": {string(json)}})
if err != nil {
log.Fatalln(err)
}
body, err := ioutil.ReadAll(response.Body)
defer response.Body.Close()
if err != nil {
log.Fatalln(err)
}
if len(body) > 0 {
fmt.Println(string(body))
}
// check response
if response.StatusCode != 200 {
log.Fatalln(response.Status)
}
}
func (agent *Agent) _get_body_reader(request string) io.ReadCloser {
// GET the index content
response, err := agent.client.Get(request)
if err != nil {
log.Fatalln(err)
}
// check response
if response.StatusCode != 200 {
body, err := ioutil.ReadAll(response.Body)
if err != nil {
log.Fatalln(err)
}
if len(body) > 0 {
fmt.Println(string(body))
}
log.Fatalln(response.Status)
}
return response.Body
}
|
package org.usfirst.frc.team6135.robot.subsystems;
import java.awt.geom.Arc2D.Double;
import org.usfirst.frc.team6135.robot.RobotMap;
import org.usfirst.frc.team6135.robot.commands.teleopDrive;
import com.kauailabs.navx.frc.AHRS;
import edu.wpi.first.wpilibj.ADXRS450_Gyro;
import edu.wpi.first.wpilibj.RobotDrive;
import edu.wpi.first.wpilibj.SerialPort;
import edu.wpi.first.wpilibj.VictorSP;
import edu.wpi.first.wpilibj.command.Subsystem;
public class Drive extends Subsystem {
//Constants
private static final boolean rReverse = true;
private static final boolean lReverse = false;
private static final double kA=0.03;
//Objects
private VictorSP leftDrive = null;
private VictorSP rightDrive = null;
public ADXRS450_Gyro gyro=null;
public AHRS ahrs=null;
public RobotDrive robotDrive=null;
//Constructors
public Drive() {
gyro=RobotMap.gyro;
ahrs=new AHRS(SerialPort.Port.kUSB1);
robotDrive=new RobotDrive(RobotMap.leftDriveVictor,RobotMap.rightDriveVictor);
leftDrive = RobotMap.leftDriveVictor;
rightDrive = RobotMap.rightDriveVictor;
leftDrive.set(0);
rightDrive.set(0);
leftDrive.setInverted(lReverse);
rightDrive.setInverted(rReverse);
ahrs.reset();
}
//Direct object access methods
public void setMotors(double l, double r) {//sets motor speeds accounting for directions of motors
leftDrive.set(l);
rightDrive.set(r);
}
public void setLeft(double d) {
leftDrive.set(d);
}
public void setRight(double d) {
rightDrive.set(d);
}
//Teleop Driving methods
private static final double accBoundX = 0.7; //The speed after which the drive starts to accelerate over time
private static final int accLoopX = 15; //The number of loops for the bot to accelerate to max speed
private int accLoopCountX = 0;
public double accCalcX(double input) {//applies a delay for motors to reach full speed for larger joystick inputs
if(input > accBoundX && accLoopCountX < accLoopX) {//positive inputs
return accBoundX + (input - accBoundX) * (accLoopCountX++ / (double) accLoopX);
}
else if(input < -accBoundX && accLoopCountX < accLoopX) {//negative inputs
return -accBoundX + (input + accBoundX) * (accLoopCountX++ / (double) accLoopX);
}
else if(Math.abs(input) <= accBoundX) {
accLoopCountX = 0;
}
return input;
}
private static final double accBoundY = 0.7; //The speed after which the drive starts to accelerate over time
private static final int accLoopY = 15; //The number of loops for the bot to accelerate to max speed
private int accLoopCountY = 0;
public double accCalcY(double input) {//applies a delay for motors to reach full speed for larger joystick inputs
if(input > accBoundY && accLoopCountY < accLoopY) {//positive inputs
return accBoundY + (input - accBoundY) * (accLoopCountY++ / (double) accLoopY);
}
else if(input < -accBoundY && accLoopCountY < accLoopY) {//negative inputs
return -accBoundY + (input + accBoundY) * (accLoopCountY++ / (double) accLoopY);
}
else if(Math.abs(input) <= accBoundY) {
accLoopCountY = 0;
}
return input;
}
private static final double accBoundZ = 0.7; //The speed after which the drive starts to accelerate over time
private static final int accLoopZ = 15; //The number of loops for the bot to accelerate to max speed
private int accLoopCountZ = 0;
public double accCalcZ(double input) {//applies a delay for motors to reach full speed for larger joystick inputs
if(input > accBoundZ && accLoopCountZ < accLoopZ) {//positive inputs
return accBoundZ + (input - accBoundZ) * (accLoopCountZ++ / (double) accLoopZ);
}
else if(input < -accBoundZ && accLoopCountZ < accLoopZ) {//negative inputs
return -accBoundZ + (input + accBoundZ) * (accLoopCountZ++ / (double) accLoopZ);
}
else if(Math.abs(input) <= accBoundZ) {
accLoopCountZ = 0;
}
return input;
}
public double sensitivityCalc(double input) {//Squares magnitude of input to reduce magnitude of smaller joystick inputs
if (input >= 0.0) {
return (input * input);
}
else {
return -(input * input);
}
}
public void reverse() {
leftDrive.setInverted(!leftDrive.getInverted());
rightDrive.setInverted(!rightDrive.getInverted());
VictorSP temp1 = leftDrive;
VictorSP temp2 = rightDrive;
rightDrive = temp1;
leftDrive = temp2;
}
public double getGyroAngle()
{
return gyro.getAngle();
}
public double getNAVXAngle()
{
return ahrs.getAngle();
}
public void driveStraight()
{
robotDrive.drive(0.6, -gyro.getAngle()*kA);
}
@Override
protected void initDefaultCommand() {
setDefaultCommand(new teleopDrive());
}
}
|
module Shopping
class LineItem < ActiveRecord::Base
extend Shopping::<API key>
belongs_to :cart
belongs_to :source, polymorphic: true
validate :<API key>, on: :create
validate :unpurchased_cart
validates :quantity, allow_nil: true, numericality: {only_integer: true, greater_than: -1}
validates :cart_id, presence: true
validates :source_id, presence: true
validates :source_type, presence: true
attr_accessible :cart_id, :source, :source_id, :source_type, :quantity, :list_price, :sale_price, :options
before_create :set_prices, :set_name
def <API key>
other = Shopping::LineItem.where(source_id: self.source_id, source_type: self.source_type, cart_id: self.cart_id)
if other.count > 0
self.errors.add(:source, "A line item with identical source and cart exists, update quantity instead (id=#{other.first.id})")
end
end
def unpurchased_cart
if cart && cart.purchased?
changes.keys.each do |k|
self.errors.add(k, "Cannot change `#{k}', cart is purchased")
end
end
end
def set_name
self.source_name ||= source.try(:name)
end
def set_prices
self.list_price ||= source.try(:price)
self.sale_price ||= source.try(:price)
end
end
end
|
<?php
use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\Config\Loader\LoaderInterface;
class AppKernel extends Kernel
{
public function registerBundles()
{
$bundles = array(
new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
new Symfony\Bundle\SecurityBundle\SecurityBundle(),
new Symfony\Bundle\TwigBundle\TwigBundle(),
new Symfony\Bundle\MonologBundle\MonologBundle(),
new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
new Symfony\Bundle\AsseticBundle\AsseticBundle(),
new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
new Sensio\Bundle\<API key>\<API key>(),
new Tuhn\HelloBundle\TuhnHelloBundle(),
new Trungnd\StoreBundle\TrungndStoreBundle(),
);
if (in_array($this->getEnvironment(), array('dev', 'test'))) {
$bundles[] = new Acme\DemoBundle\AcmeDemoBundle();
$bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
$bundles[] = new Sensio\Bundle\DistributionBundle\<API key>();
$bundles[] = new Sensio\Bundle\GeneratorBundle\<API key>();
}
return $bundles;
}
public function <API key>(LoaderInterface $loader)
{
$loader->load(__DIR__.'/config/config_'.$this->getEnvironment().'.yml');
}
}
|
#!/usr/bin/env python
"""
This script is used to run tests, create a coverage report and output the
statistics at the end of the tox run.
To run this script just execute ``tox``
"""
import re
from fabric.api import local, warn
from fabric.colors import green, red
if __name__ == '__main__':
# Kept some files for backwards compatibility. If support is dropped,
# remove it here
deprecated_files = '*utils_email*,*utils_log*'
local('flake8 --ignore=E126 --ignore=W391 --statistics'
' --exclude=submodules,migrations,build .')
local('coverage run --source="django_libs" manage.py test -v 2'
' --traceback --failfast --settings=django_libs.tests.settings'
' --pattern="*_tests.py"')
local('coverage html -d coverage'
' --omit="*__init__*,*/settingsmigrationstests/*,'
'*admin*,{}"'.format(deprecated_files))
total_line = local('grep -n pc_cov coverage/index.html', capture=True)
percentage = float(re.findall(r'(\d+)%', total_line)[-1])
if percentage < 100:
warn(red('Coverage is {0}%'.format(percentage)))
else:
print(green('Coverage is {0}%'.format(percentage)))
|
using System;
namespace KeyWatcher.Reactive
{
internal sealed class ObservingKeyWatcher
: IObserver<char>
{
private readonly string id;
internal ObservingKeyWatcher(string id) =>
this.id = id;
public void OnCompleted() =>
Console.Out.WriteLine($"{this.id} - {nameof(this.OnCompleted)}");
public void OnError(Exception error) =>
Console.Out.WriteLine($"{this.id} - {nameof(this.OnError)} - {error.Message}");
public void OnNext(char value) =>
Console.Out.WriteLine($"{this.id} - {nameof(this.OnNext)} - {value}");
}
}
|
from baroque.entities.event import Event
class EventCounter:
"""A counter of events."""
def __init__(self):
self.events_count = 0
self.<API key> = dict()
def increment_counting(self, event):
"""Counts an event
Args:
event (:obj:`baroque.entities.event.Event`): the event to be counted
"""
assert isinstance(event, Event)
self.events_count += 1
t = type(event.type)
if t in self.<API key>:
self.<API key>[t] += 1
else:
self.<API key>[t] = 1
def count_all(self):
"""Tells how many events have been counted globally
Returns:
int
"""
return self.events_count
def count(self, eventtype):
"""Tells how many events have been counted of the specified type
Args:
eventtype (:obj:`baroque.entities.eventtype.EventType`): the type of events to be counted
Returns:
int
"""
return self.<API key>.get(type(eventtype), 0)
|
const uint8_t u8g2_font_timR08_tf[2170] U8G2_FONT_SECTION("u8g2_font_timR08_tf") =
"\277\0\3\2\4\4\2\4\5\13\15\377\375\7\376\7\376\1H\2\277\10a \5\0\246\4!\7q\343"
"\304\240\4\42\7#\66E\242\4#\16ubM)I\6\245\62(\245$\1$\14\224^U\64D\242"
"i\310\22\0%\21w\42\316\60$Q\322\226$RRJ\332\22\0&\20x\42\226\232\244\312\264D\221"
"\226)\311\242\0'\6!\266\204\0(\13\223\32U\22%Q-\312\2)\14\223\32E\26eQ%J"
"\42\0*\7\63sE\322\1+\12U\242U\30\15R\30\1,\6\42\336\204\22-\6\23*\305\0."
"\6\21\343D\0/\12s\342T%\252D\21\0\60\12tb\215\22yJ\24\0\61\10scM\42u"
"\31\62\14tb\215\22eQ\26EC\0\63\14tb\215\22e\211\230\15\11\0\64\14ub]&%"
"\245d\320\302\4\65\13tb\315\22\215Y\66$\0\66\13tb\225\22-\221)Q\0\67\12tb\305"
" \325\242\254\4\70\14tb\215\22I\211\22I\211\2\71\13tb\215\22\231\222)\221\0:\6Q\343"
"D\26;\7b\336L\254\4<\7ScUR+=\10\65\246\305\240\16\2>\10SbEV)\1"
"?\13s\42\305\220DI\224&\0@\24\230Z\326\220\205I\264(Q\242D\211\222\230\332\221A\1A"
"\15w\42^:&a\222\15R\226\34B\15u\242\305\20U\242d\252D\203\2C\14v\342\315\60d"
"jUK\206\4D\20v\342\305 EJ\226dI\226D\303\220\0E\14u\242\305\240DI\70\205\321"
"\60F\14u\242\305\240DI\70\205\331\4G\16v\342\315\60dj\64\204[\62$\0H\17w\42\306"
"\262dQ\26\15R\26e\311\1I\10s\42\305\22u\31J\12t\42\315\224\265T$\0K\16v\342"
"\305\242D\225LL\262(Y\4L\11u\242\305\26v\32\6M\21y\242\306\266hR\322\224\64%K"
"\324\262$\3N\20w\42\306\262H\225RR\212\244H\231\22\0O\14v\342\315\220H\243qR\206\4"
"P\14u\242\305\20U\242d\12\263\11Q\14\226\332\315\220H\243qRV\3R\15v\342\305\220EM"
"[\222E\311\42S\13tb\315\20m\242\64$\0T\12u\242\305\245\24\266-\0U\17w\42\306\262"
"dQ\26eQ\26)\332\4V\17w\42\306\262d\221\242%a\222\306\31\0W\22{\241\306r\311J"
"R\244%K\230\264fq\226\1X\14w\42\306\262d\225\264\222U\16Y\14w\42\306\262d\225p\215"
"\323\11Z\10u\242\305\255\267a[\10\222\332\304\322\27\1\134\11s\342D\224E\265(]\10\222\332\204"
"\322\227\1^\7\63sME\11_\6\25V\305 `\6\42\372D\24a\10S\42\205\226\34\2b\14"
"ua\205\30N\225(\211\222\5c\7S\42\315T\23d\15ub\225\30-Q\22%Q\244\4e\7"
"S\42\315%\23f\12t\42\225\22MYi\1g\14tZ\315\220\64eJ\64$\0h\13va\205"
"\232nQO\212\0i\7r\342L\244tj\11\223\331T(uZ\0k\13va\205Z\252d[T"
"\22l\10s\42\205\324\313\0m\14X\42\306\42\265D\225\250\342\0n\12Ub\305T\211\222(\61o"
"\11Tb\215\22\231\22\5p\16\205U\305\20U\242$J\246\60\233\0q\14\205V\315\22%Q\22E"
"cmr\11S\42E\222(Q\62s\10S\42\315\226\15\1t\11d\42M\64eE\1u\14Ub"
"\205\62%Q\22EJ\0v\14Va\305\242DY\222\251\21\0w\15Y!\306b\211jIQQ\223"
"\14x\12U\242\205\242\324*\211\1y\14vY\205\262D\225P\14\65\21z\11Tb\305\20\65\15\2"
"{\12\223\32U\22U\262\250\26|\6\221\232\304\3}\13\223\32E\26\325\222\250\22\1~\7&\352\215"
"d\1\240\5\0\246\4\241\7q\333D\62\10\242\14t^U\64DZ\224H\21\0\243\14ub\225\224"
"D\331\226I\203\2\244\14efE\226LI\224DK\26\245\15ubE\226TL\321 e\13\0\246"
"\6q\242\304\62\247\17\224Z\315\20%QRJJI\64$\0\250\6\23wE\22\251\16wc\326V"
"\211\24%\223\224Z\66\1\252\10S*\205\246d\3\253\11DfM\242\64%\1\254\7%\347\305 \6"
"\255\6\23*\305\0\256\15wc\326VI\26\223\322-\233\0\257\6\23\66\305\0\260\11D.\215\22I"
"\211\2\261\14u\242U\30\15R\230\3\203\0\262\7C\356\314R\31\263\10C\356\304\222-\0\264\6\42"
"\366\214\2\265\16uZE\224DI\224D\311\42\206\0\266\23\226\232\315\60(\311\222,\221\222%Y\222"
"%Y\222\0\267\6\21\252D\0\270\7\63\26M\266\0\271\10C\356L\42%\3\272\7S*M\307\1"
"\273\12DfE\22%\25%\1\274\21w\42N\226HY\24\15I\226h\203\222%\0\275\17w\42N"
"\226HY\24\15\211\224\224\232\6\276\17w\42\306\324\230DJ-\321\6%K\0\277\12s\32M\32%"
"Q\62\4\300\20\247\42V\16\344p:&a\222\15R\226\34\301\17\247\42f\232\303\351\230\204I\66H"
"Yr\302\20\247\42^\232\344h:&a\222\15R\226\34\303\21\247\42^\222%\71\232\216I\230d\203"
"\224%\7\304\17\227\42V\222\243\351\230\204I\66HYr\305\20\247\42^\232\244q:&a\222\15R"
"\226\34\306\20xb\336 M\225\64\231\206\60\212\206d\10\307\17\246\326\315\60djUK\206,\316\64"
"\0\310\17\245\242M\232\3\203\22%\341\24F\303\0\311\16\245\242]\35\30\224(\11\247\60\32\6\312\17"
"\245\242U\226\304\203\22%\341\24F\303\0\313\15\225\242MyP\242$\234\302h\30\314\12\243\42E\26"
".Q\227\1\315\12\243\42U\22.Q\227\1\316\11\243\42M\333\22u\31\317\12\223\42E\222-Q\227"
"\1\320\20v\342\305 EJ\66DI\226D\303\220\0\321\23\247\42^\222%\71$-R$UJI"
")R\246\4\322\17\246\342U\234CC\42\215\306I\31\22\0\323\17\246\342]\230cC\42\215\306I\31"
"\22\0\324\17\246\342]\230\344\310\220H\243qR\206\4\325\20\246\342U\22%\71\64$\322h\234\224!"
"\1\326\17\226\342M\224#C\42\215\306I\31\22\0\327\12U\242E\226\324*\265\0\330\22\230\35>\20"
"\15\222\251\22\205Q\22E\246A\312\1\331\22\247\42V\16\344\330\262dQ\26eQ\26)\332\4\332\22"
"\247\42f\232c\313\222EY\224EY\244h\23\0\333\22\247\42^\232\344\320\262dQ\26eQ\26)"
"\332\4\334\22\227\42V\222C\313\222EY\224EY\244h\23\0\335\16\247\42f\232c\226\254\22\256q"
":\1\336\13u\242\305\26N\225)\233\0\337\13tbU\245EJ*C\2\340\11\203\42E\26j\311"
"!\341\11\203\42U\22j\311!\342\11\203\42M\233\226\34\2\343\14\204\42M\242\244b\244T\26\0\344"
"\11s\42E\222i\311!\345\11\203\42M\27-\71\4\346\13U\242\205\42%\311RR\4\347\11\203\26"
"\315TS\262\5\350\11\203\42E\226.K&\351\11\203\42U\222.K&\352\11\203\42M\343\262d\2"
"\353\11s\42E\22.K&\354\10\202\342D\24)\35\355\11\203\342T\22J]\0\356\10\203\342L\233"
"\324\5\357\11s\342D\222I]\0\360\14\204bM\66$\321\20\231\22\5\361\14\205bMw`\252D"
"I\224\30\362\13\204bM\30+\221)Q\0\363\13\204bU\35P\42S\242\0\364\14\204bM\224\304"
"JdJ\24\0\365\14\204bM\242\304JdJ\24\0\366\13tbE\22+\221)Q\0\367\12U\242"
"U\16\14:\20\1\370\12v]m\64\365iJ\1\371\17\205bM\232\3Q\22%Q\22EJ\0\372"
"\17\205bU\226#Q\22%Q\22EJ\0\373\17\205bU\226\304Q\22%Q\22EJ\0\374\15u"
"bM\71J\242$J\242H\11\375\17\246Y]\230C\312\22UB\61\324D\0\376\17\245U\205\30N"
"\225(\211\222)\314&\0\377\16\226YM\35Q\226\250\22\212\241&\2\0\0\0";
|
import React from 'react'
import { <API key> } from './index'
const PlanMapRoute = () => {
return (
<div>
<<API key> />
</div>
)
}
export default PlanMapRoute
|
// Reliant.h
// Reliant
#ifndef <API key>
#define <API key>
#import "OCSObjectContext.h"
#import "<API key>.h"
#import "NSObject+<API key>.h"
#import "NSObject+OCSReliantInjection.h"
#endif
|
// Squidex Headless CMS
using System.Collections.Immutable;
using OpenIddict.Abstractions;
using OpenIddict.Server;
using static OpenIddict.Server.<API key>;
namespace Squidex.Areas.IdentityServer.Config
{
public sealed class <API key> : <API key><<API key>>
{
public ValueTask HandleAsync(<API key> context)
{
if (context == null)
{
return default;
}
if (!string.IsNullOrWhiteSpace(context.Response.AccessToken))
{
var scopes = context.<API key>?.GetScopes() ?? ImmutableArray<string>.Empty;
context.Response.Scope = string.Join(" ", scopes);
}
return default;
}
}
}
|
using System.Diagnostics.CodeAnalysis;
namespace Npoi.Mapper
{
<summary>
Information for one row that read from file.
</summary>
<typeparam name="TTarget">The target mapping type for a row.</typeparam>
[SuppressMessage("ReSharper", "<API key>.Global")]
public class RowInfo<TTarget> : IRowInfo
{
#region Properties
<summary>
Row number.
</summary>
public int RowNumber { get; set; }
<summary>
Constructed value object from the row.
</summary>
public TTarget Value { get; set; }
<summary>
Column index of the first error.
</summary>
public int ErrorColumnIndex { get; set; }
<summary>
Error message for the first error.
</summary>
public string ErrorMessage { get; set; }
#endregion
#region Constructors
<summary>
Initialize a new RowData object.
</summary>
<param name="rowNumber">The row number</param>
<param name="value">Constructed value object from the row</param>
<param name="errorColumnIndex">Column index of the first error cell</param>
<param name="errorMessage">The error message</param>
public RowInfo(int rowNumber, TTarget value, int errorColumnIndex, string errorMessage)
{
RowNumber = rowNumber;
Value = value;
ErrorColumnIndex = errorColumnIndex;
ErrorMessage = errorMessage;
}
#endregion
}
}
|
const path = require('path');
module.exports = {
lazyLoad: true,
pick: {
posts(markdownData) {
return {
meta: markdownData.meta,
description: markdownData.description,
};
},
},
plugins: [path.join(__dirname, '..', 'node_modules', '<API key>')],
routes: [{
path: '/',
component: './template/Archive',
}, {
path: '/posts/:post',
dataPath: '/:post',
component: './template/Post',
}, {
path: '/tags',
component: './template/TagCloud',
}],
};
|
<?php
namespace WindowsAzure\DistributionBundle\Deployment;
interface <API key>
{
/**
* @param array $dirs
* @param array $subdirs
*/
public function getIterator(array $dirs, array $subdirs);
}
|
import { Injectable } from '@angular/core';
import {Http,Response,ConnectionBackend,Headers,RequestMethod} from '@angular/http';
import { Observable } from 'rxjs/Observable';
import 'rxjs/add/operator/map';
import 'rxjs/add/operator/toPromise';
import{AppHttpUtil} from '../appUtil/httpUtil';
import {AppPermService} from "./permService";
import {AppUrlConfig} from "../appConfig/urlConfig";
@Injectable()
export class AppLoginService {
constructor(private httpUtil: AppHttpUtil,private urlConfig:AppUrlConfig){
}
login(_name:string,_pass:string){
return this.httpUtil.ajax({
url:this.urlConfig.emarketService+'system/login/',
method:RequestMethod.Post,
body:{
loginName:_name,
password:_pass
}
});
}
}
|
#import <AppKit/AppKit.h>
#include "ui/UIEditBox/Mac/CCUITextInput.h"
@interface <API key> : NSTextField<CCUITextInput>
{
NSMutableDictionary* <API key>;
}
@end
|
// Init ES2015 + .jsx environments for .require()
require('babel-register');
var express = require('express');
var fluxexapp = require('./fluxexapp');
var serverAction = require('./actions/server');
var fluxexServerExtra = require('fluxex/extra/server');
var app = express();
// Provide /static/js/main.js
fluxexServerExtra.initStatic(app);
// Mount test page at /test
app.use('/product', fluxexServerExtra.<API key>(fluxexapp, serverAction.samplePage));
// Start server
app.listen(process.env.TESTPORT || 3000);
console.log('Fluxex started! Go http://localhost:3001/product?id=124');
|
import numpy as np
class Surface(object):
def __init__(self, image, edge_points3d, edge_points2d):
"""
Constructor for a surface defined by a texture image and
4 boundary points. Choose the first point as the origin
of the surface's coordinate system.
:param image: image array
:param edge_points3d: array of 3d coordinates of 4 corner points in clockwise direction
:param edge_points2d: array of 2d coordinates of 4 corner points in clockwise direction
"""
assert len(edge_points3d) == 4 and len(edge_points2d) == 4
self.image = image
self.edge_points3d = edge_points3d
self.edge_points2d = np.float32(edge_points2d) # This is required for using cv2's <API key>
self.normal = self._get_normal_vector()
def top_left_corner3d(self):
return self.edge_points3d[0]
def top_right_corner3d(self):
return self.edge_points3d[1]
def <API key>(self):
return self.edge_points3d[2]
def <API key>(self):
return self.edge_points3d[3]
def distance_to_point(self, point):
point_to_surface = point - self.top_left_corner3d()
distance_to_surface = self.normal.dot(point_to_surface)
return distance_to_surface
def _get_normal_vector(self):
"""
:return: the normal vector of the surface. It determined the front side
of the surface and it's not necessarily a unit vector
"""
p0 = self.edge_points3d[0]
p1 = self.edge_points3d[1]
p3 = self.edge_points3d[3]
v1 = p3 - p0
v2 = p1 - p0
normal = np.cross(v1, v2)
norm = np.linalg.norm(normal)
return normal / norm
class Polyhedron(object):
def __init__(self, surfaces):
self.surfaces = surfaces
class Space(object):
def __init__(self, models=None):
self.models = models or []
def add_model(self, model):
assert isinstance(model, Polyhedron)
self.models.append(model)
class Line2D(object):
def __init__(self, point1, point2):
"""
Using the line equation a*x + b*y + c = 0 with b >= 0
:param point1: starting point
:param point2: ending point
:return: a Line object
"""
assert len(point1) == 2 and len(point2) == 2
self.a = point2[1] - point1[1]
self.b = point1[0] - point2[0]
self.c = point1[1] * point2[0] - point1[0] * point2[1]
if self.b < 0:
self.a = -self.a
self.b = -self.b
self.c = -self.c
def is_point_on_left(self, point):
return self.a * point[0] + self.b * point[1] + self.c > 0
def is_point_on_right(self, point):
return self.a * point[0] + self.b * point[1] + self.c < 0
def is_point_on_line(self, point):
return self.a * point[0] + self.b * point[1] + self.c == 0
def get_y_from_x(self, x):
if self.b == 0:
return 0.0
return 1.0 * (-self.c - self.a * x) / self.b
def get_x_from_y(self, y):
if self.a == 0:
return 0.0
return 1.0 * (-self.c - self.b * y) / self.a
|
# Sparse Arrays
Internally the V8 engine can represent `Array`s following one of two approaches:
- **Fast Elements**: linear storage for compact keys sets.
- **Dictionary Elements**: hash table storage (more expensive to access on runtime).
If you want V8 to represent your `Array` in the `Fast Elements` form, you need to take into account the following:
- Use contiguous keys starting at `0`.
- Don't pre-allocate large `Array` (e.g. *> 64K* elements) that you don't use.
- Don't delete elements, specially in numeric `Array`s.
- Don't load uninitialized or deleted elements.
Another consideration: any name used as property name that is not a `String` will be serialized, read more at [Properties Names](v8-tips/properties-names).
|
## Install
npm i
npm start
|
A PvPGNChatParser converts raw messages received from PvPGNChat to ChatMessage objects
|
import { fullSrc } from '../element/element';
import { pixels } from '../math/unit';
import { Clone } from './clone';
import { Container } from './container';
import { Image } from './image';
import { Overlay } from './overlay';
import { Wrapper } from './wrapper';
export class ZoomDOM {
static useExisting(element: HTMLImageElement, parent: HTMLElement, grandparent: HTMLElement): ZoomDOM {
let overlay = Overlay.create();
let wrapper = new Wrapper(grandparent);
let container = new Container(parent);
let image = new Image(element);
let src = fullSrc(element);
if (src === element.src) {
return new ZoomDOM(overlay, wrapper, container, image);
} else {
return new ZoomDOM(overlay, wrapper, container, image, new Clone(container.clone()));
}
}
static create(element: HTMLImageElement): ZoomDOM {
let overlay = Overlay.create();
let wrapper = Wrapper.create();
let container = Container.create();
let image = new Image(element);
let src = fullSrc(element);
if (src === element.src) {
return new ZoomDOM(overlay, wrapper, container, image);
} else {
return new ZoomDOM(overlay, wrapper, container, image, Clone.create(src));
}
}
readonly overlay: Overlay;
readonly wrapper: Wrapper;
readonly container: Container;
readonly image: Image;
readonly clone?: Clone;
constructor(overlay: Overlay, wrapper: Wrapper, container: Container, image: Image, clone?: Clone) {
this.overlay = overlay;
this.wrapper = wrapper;
this.container = container;
this.image = image;
this.clone = clone;
}
<API key>(): void {
this.wrapper.element.appendChild(this.container.element);
}
<API key>(): void {
let parent = this.image.element.parentElement as HTMLElement;
parent.replaceChild(this.wrapper.element, this.image.element);
}
<API key>(): void {
this.container.element.appendChild(this.image.element);
}
<API key>(): void {
if (this.clone !== undefined) {
this.container.element.appendChild(this.clone.element);
}
}
<API key>(): void {
if (this.clone !== undefined) {
this.clone.show();
this.image.hide();
}
}
<API key>(): void {
if (this.clone !== undefined) {
this.image.show();
this.clone.hide();
}
}
fixWrapperHeight(): void {
this.wrapper.element.style.height = pixels(this.image.element.height);
}
collapsed(): void {
this.overlay.removeFrom(document.body);
this.image.deactivate();
this.wrapper.finishCollapsing();
}
/**
* Called at the end of an expansion to check if the clone loaded before our expansion finished. If it did, and is
* still not visible, we can now show it to the client.
*/
showCloneIfLoaded(): void {
if (this.clone !== undefined && this.clone.isLoaded() && this.clone.isHidden()) {
this.<API key>();
}
}
}
|
define(function(){
return {"":"",
"":"",
"":"",
"":"",
"":"𡯂",
"":"",
"":"",
"":"",
"":"",
"":"",
"":"",
"":"",
"":"",
"":"",
"":"",
"":"",
"":"",
"":"",
"":"",
"":"",
"":"",
"":"",
"":"",
"":"𤣥",
"":"",
"":"",
"":"",
"":"",
"":"",
"":"",
"":"",
"":"",
"":"",
"":"",
"":"",
"":"",
"":"",
"":"",
"":"",
"":"",
"":"",
"":"",
"":"廾",
"":""};
});
|
"use strict";
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var qs = require("querystring");
var partial = require("lodash.partial");
var endpoints = require("./stats-endpoints");
var dicts = require("./dicts");
var translateKeys = require("./util/translate-keys");
var transport = require("./get-json");
var translate = partial(translateKeys, dicts.jsToNbaMap);
var stats = Object.create({
setTransport: function setTransport(_transport) {
transport = _transport;
},
getTransport: function getTransport() {
return transport;
}
});
Object.keys(endpoints).forEach(function (key) {
stats[key] = makeStatsMethod(endpoints[key]);
});
function makeStatsMethod(endpoint) {
return function statsMethod(query, callback) {
if (typeof query === "function") {
callback = query;
query = {};
}
if (typeof callback !== "function") {
throw new TypeError("Must pass a callback function.");
}
var params = _extends({}, endpoint.defaults, translate(query));
transport(endpoint.url, params, function (err, response) {
if (err) return callback(err);
if (response == null) return callback();
// response is something like "GameID is required"
if (typeof response === "string") return callback(new Error(response));
if (endpoint.transform) return callback(null, endpoint.transform(response));
callback(null, response);
});
};
}
module.exports = stats;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.