answer stringlengths 15 1.25M |
|---|
demo-ui-android
============
Android SDK UI
01_ActionBar:()
02_PortraitShape:
03_MessageBubble:
04_ChatBackground:
<API key>:
06_FriendList:
07_GroupSettingsDemo
09_SendMessageCusomizationDemo
11_PortraitClickBehaviorDemo |
from .virtual_create import *
__all__ = ["VirtualCreate"] |
package tehnut.lib.mc.tile.sync.adapters;
import net.minecraft.nbt.NBTTagCompound;
public class NBTAdapterString implements INBTTypeAdapter<String> {
public static final INBTTypeAdapter<String> INSTANCE = new NBTAdapterString();
@Override
public void write(NBTTagCompound compound, String value, String fieldName) {
compound.setString(fieldName, value);
}
@Override
public String read(NBTTagCompound compound, String fieldName) {
return compound.getString(fieldName);
}
} |
#import "NSObject.h"
@class NSMutableDictionary, NSString;
@interface <API key> : NSObject
{
NSMutableDictionary *<API key>;
NSString *<API key>;
}
+ (id)allocWithZone:(struct _NSZone *)arg1;
+ (id)sharedManager;
@property(retain, nonatomic) NSString *<API key>; // @synthesize <API key>=<API key>;
@property(retain, nonatomic) NSMutableDictionary *<API key>; // @synthesize <API key>=<API key>;
- (void).cxx_destruct;
- (id)emailForPersonID:(id)arg1;
- (id)fullNameForPersonID:(id)arg1;
- (id)lastNameForPersonID:(id)arg1;
- (id)<API key>:(id)arg1;
- (_Bool)<API key>:(id)arg1;
- (void)initWithPath:(id)arg1;
@end |
namespace TotaMoviesRental.Migrations
{
using System;
using System.Data.Entity.Migrations;
public partial class <API key> : DbMigration
{
public override void Up()
{
AlterColumn("dbo.Customers", "Birthdate", c => c.DateTime(nullable: false));
}
public override void Down()
{
AlterColumn("dbo.Customers", "Birthdate", c => c.DateTime());
}
}
} |
layout: post
title: "Algorithms"
date: 2013-03-15
excerpt: "Lorem Ipsum is simply dummy text of the printing and typesetting industry. "
comments: false
Portland in shoreditch Vice, labore typewriter pariatur hoodie fap sartorial Austin. Pinterest literally occupy Schlitz forage. Odio ad blue bottle vinyl, 90's narwhal commodo bitters pour-over nostrud. Ugh est hashtag in, fingerstache adipisicing laboris esse Pinterest shabby chic Portland. Shoreditch bicycle rights anim, flexitarian laboris put a bird on it vinyl cupidatat narwhal. Hashtag artisan skateboard, flannel Bushwick nesciunt salvia aute fixie do plaid post-ironic dolor McSweeney's. Cliche pour-over chambray nulla four loko skateboard sapiente hashtag.
Vero laborum commodo occupy. Semiotics voluptate mumblecore pug. Cosby sweater ullamco quinoa ennui assumenda, sapiente occupy delectus lo-fi. Ea fashion axe Marfa cillum aliquip. Retro Bushwick keytar cliche. Before they sold out sustainable gastropub Marfa readymade, ethical Williamsburg skateboard brunch qui consectetur gentrify semiotics. Mustache cillum irony, fingerstache magna pour-over keffiyeh tousled selfies.
## Cupidatat 90's lo-fi authentic try-hard
In pug Portland incididunt mlkshk put a bird on it vinyl quinoa. Terry Richardson shabby chic +1, scenester Tonx excepteur tempor fugiat voluptate fingerstache aliquip nisi next level. Farm-to-table hashtag Truffaut, Odd Future ex meggings gentrify single-origin coffee try-hard 90's.
* Sartorial hoodie
* Labore viral forage
* Tote bag selvage
* DIY exercitation et id ugh tumblr church-key
Incididunt umami sriracha, ethical fugiat VHS ex assumenda yr irure direct trade. Marfa Truffaut bicycle rights, kitsch placeat Etsy kogi asymmetrical. Beard locavore flexitarian, kitsch photo booth hoodie plaid ethical readymade leggings yr.
Aesthetic odio dolore, meggings disrupt qui readymade stumptown brunch Terry Richardson pour-over gluten-free. Banksy american apparel in selfies, biodiesel flexitarian organic meh wolf quinoa gentrify banjo kogi. Readymade tofu ex, scenester dolor umami fingerstache occaecat fashion axe Carles jean shorts minim. Keffiyeh fashion axe nisi Godard mlkshk dolore. Lomo you probably haven't heard of them eu non, Odd Future Truffaut pug keytar meggings McSweeney's Pinterest cred. Etsy literally aute esse, eu bicycle rights qui meggings fanny pack. Gentrify leggings pug flannel duis.
## Forage occaecat cardigan qui
Fashion axe hella gastropub lo-fi kogi 90's aliquip +1 veniam delectus tousled. Cred sriracha locavore gastropub kale chips, iPhone mollit sartorial. Anim dolore 8-bit, pork belly dolor photo booth aute flannel small batch. Dolor disrupt ennui, tattooed whatever salvia Banksy sartorial roof party selfies raw denim sint meh pour-over. Ennui eu cardigan sint, gentrify iPhone cornhole.
> Whatever velit occaecat quis deserunt gastropub, leggings elit tousled roof party 3 wolf moon kogi pug blue bottle ea. Fashion axe shabby chic Austin quinoa pickled laborum bitters next level, disrupt deep v accusamus non fingerstache.
Tote bag asymmetrical elit sunt. Occaecat authentic Marfa, hella McSweeney's next level irure veniam master cleanse. Sed hoodie letterpress artisan wolf leggings, 3 wolf moon commodo ullamco. Anim occupy ea labore Terry Richardson. Tofu ex master cleanse in whatever pitchfork banh mi, occupy fugiat fanny pack Austin authentic. Magna fugiat 3 wolf moon, labore McSweeney's sustainable vero consectetur. Gluten-free disrupt enim, aesthetic fugiat jean shorts trust fund keffiyeh magna try-hard.
## Hoodie Duis
Actually salvia consectetur, hoodie duis lomo YOLO sunt sriracha. Aute pop-up brunch farm-to-table odio, salvia irure occaecat. Sriracha small batch literally skateboard. Echo Park nihil hoodie, aliquip forage artisan laboris. Trust fund reprehenderit nulla locavore. Stumptown raw denim kitsch, keffiyeh nulla twee dreamcatcher fanny pack ullamco 90's pop-up est culpa farm-to-table. Selfies 8-bit do pug odio.
Thundercats Ho!
Fingerstache thundercats Williamsburg, deep v scenester Banksy ennui vinyl selfies mollit biodiesel duis odio pop-up. Banksy 3 wolf moon try-hard, sapiente enim stumptown deep v ad letterpress. Squid beard brunch, exercitation raw denim yr sint direct trade. Raw denim narwhal id, flannel DIY McSweeney's seitan. Letterpress artisan bespoke accusamus, meggings laboris consequat Truffaut qui in seitan. Sustainable cornhole Schlitz, twee Cosby sweater banh mi deep v forage letterpress flannel whatever keffiyeh. Sartorial cred irure, semiotics ethical sed blue bottle nihil letterpress.
Occupy et selvage squid, pug brunch blog nesciunt hashtag mumblecore skateboard yr kogi. Ugh small batch swag four loko. Fap post-ironic qui tote bag farm-to-table american apparel scenester keffiyeh vero, swag non pour-over gentrify authentic pitchfork. Schlitz scenester lo-fi voluptate, tote bag irony bicycle rights pariatur vero Vice freegan wayfarers exercitation nisi shoreditch. Chambray tofu vero sed. Street art swag literally leggings, Cosby sweater mixtape PBR lomo Banksy non in pitchfork ennui McSweeney's selfies. Odd Future Banksy non authentic.
Aliquip enim artisan dolor post-ironic. Pug tote bag Marfa, deserunt pour-over Portland wolf eu odio intelligentsia american apparel ugh ea. Sunt viral et, 3 wolf moon gastropub pug id. Id fashion axe est typewriter, mlkshk Portland art party aute brunch. Sint pork belly Cosby sweater, deep v mumblecore kitsch american apparel. Try-hard direct trade tumblr sint skateboard. Adipisicing bitters excepteur biodiesel, pickled gastropub aute veniam. |
//adding opensource modules to application
var express = require('express');
var path = require('path');
var favicon = require('serve-favicon');
var logger = require('morgan');
var cookieParser = require('cookie-parser');
var bodyParser = require('body-parser');
var bcrypt = require('bcrypt-nodejs');
var passport = require('passport');
var LocalStrategy = require('passport-local').Strategy;
var session = require('express-session');
var mongoose = require('mongoose');
var models_user = require('./angular/models/user.js');
var models_carrier = require('./angular/models/carrier.js');
var x2js = require('x2js');
var escape = require('escape-html');
//connection database
//mongoose.connect('mongodb://remote:MiltonKeynes@ec2-54-197-83-74.compute-1.amazonaws.com:27017/gofaseterapp');
//'mongodb://{NEW USERNAME}:{NEW PASSWORD}@{EC2 URL}:{PORT}/dummyDB'
mongoose.connect('mongodb://gofasterappdb:prodinstance@ec2-35-167-79-162.us-west-2.compute.amazonaws.com:27017/gofasterappdb');
//import the routers
var router = require('./routes/router');
var authenticate = require('./routes/authentication')(passport);
//for using express throughout this application
var app = express();
//tell node that My application will use ejs engine for rendering, view engine setup
app.set('views', path.join(__dirname, 'views'));
app.set('view engine', 'ejs');
//tell node the global configuration about parser,logger and passport
app.use(cookieParser());
app.use(logger('dev'));
app.use(session({
secret: 'keyboard cat'
}));
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: false }));
app.use(passport.initialize()); //initializing passport
app.use(passport.session()); //initializing passport session
//tell node about these directories that application may get resources from
app.use('/', router);
app.use('/auth', authenticate);
// app.use(express.static(path.join(__dirname, 'scripts')));
app.use(express.static(path.join(__dirname, 'node_modules')));
app.use(express.static(path.join(__dirname, 'Content')));
app.use(express.static(path.join(__dirname, 'angular')));
app.use(express.static(path.join(__dirname, 'views/pages')));
app.use(express.static(path.join(__dirname, 'views/authentication')));
app.use(express.static(path.join(__dirname, 'public')));
app.use('/scripts', express.static(__dirname + '/node_modules/<API key>/dist/'));
app.use('/scripts1', express.static(__dirname + '/node_modules/<API key>/dist/'));
app.use('/scripts2', express.static(__dirname + '/node_modules/angular-smart-table/dist/'));
app.use('/scripts4', express.static(__dirname + '/node_modules/ng-file-upload/dist/'));
//providing auth-api to passport so that it can use it.
var initPassport = require('./passport/passport-init');
initPassport(passport);
//running server on node
// var server = app.listen(3000, function () {
// var host = server.address().address;
// var port = server.address().port;
// catch 404 and forward to error handler
app.use(function(req, res, next) {
var err = new Error('Not Found');
err.status = 404;
next(err);
});
// error handlers
// development error handler
// will print stacktrace
if (app.get('env') === 'development') {
app.use(function(err, req, res, next) {
res.status(err.status || 500);
res.render('error', {
message: err.message,
error: err
});
});
}
// production error handler
// no stacktraces leaked to user
app.use(function(err, req, res, next) {
res.status(err.status || 500);
res.render('error', {
message: err.message,
error: {}
});
});
//exporting this application as a module
module.exports = app; |
const gulp = require('gulp');
const gutil = require('gulp-util');
const runSequence = require('run-sequence');
const buildServer = require('./helpers/buildServer');
const runStdPlatform = require('./helpers/runStdPlatform');
const runWebPlatform = require('./helpers/runWebPlatform');
const tryPackage = require('./helpers/tryPackage');
/**
* Run the project
*/
gulp.task('run', ['switch'], (callback) => {
switch (global.settings.platform) {
case 'web': {
const enabled = tryPackage('webpack');
if (enabled) {
runWebPlatform(callback);
}
else {
gutil.log(gutil.colors.red('Need web platform. Run `gulp enable web`.'));
callback();
}
break;
}
case 'server': {
global.settings.platform = 'web';
runSequence('build', () => {
global.settings.platform = 'server';
buildServer('run', callback);
});
break;
}
default:
runStdPlatform(callback);
}
}); |
#ifndef __PARTICLE_H__
#define __PARTICLE_H__
#include "scene.h"
#include <vector>
#include <functional>
#include <3ds/types.h>
const u8 STILL = 1;
const u8 FLOATING = 2;
const u8 BURNABLE = 4;
const u8 BURNS_TO_EMBER = 8;
const u8 SELECTABLE = 16;
const u8 DATA = 32;
const u8 NO_DRAW = 64;
class Scene;
class ParticleType {
public:
// Still
static ParticleType* NOTHING;
static ParticleType* WALL;
static ParticleType* IRONWALL;
static ParticleType* TORCH;
static ParticleType* STOVE;
static ParticleType* ICE;
static ParticleType* RUST;
static ParticleType* EMBER;
static ParticleType* PLANT;
static ParticleType* VOID;
// Spouts
static ParticleType* WATERSPOUT;
static ParticleType* SANDSPOUT;
static ParticleType* SALTSPOUT;
static ParticleType* OILSPOUT;
// Elemental
static ParticleType* WATER;
static ParticleType* DIRT;
static ParticleType* SALT;
static ParticleType* OIL;
static ParticleType* SAND;
static ParticleType* ASH;
// Combined
static ParticleType* SALTWATER;
static ParticleType* MUD;
static ParticleType* ACID;
// Floating
static ParticleType* STEAM;
static ParticleType* FIRE;
// Electricity
static ParticleType* ELECTRICITY;
// Explosive
static ParticleType* EXPLOSION;
static ParticleType* GUNPOWDER;
static std::vector<ParticleType*>* TYPES;
static void InitParticles();
ParticleType(const char* name, u8 r, u8 g, u8 b, u8 flags) {
this->name = name;
this->r = r;
this->g = g;
this->b = b;
this->flags = flags;
}
ParticleType(const char* name, u8 r, u8 g, u8 b) : ParticleType(name, r, g, b, 0) {}
const char* GetName() {
return this->name;
}
u8 GetRed() {
return this->r;
}
u8 GetGreen() {
return this->g;
}
u8 GetBlue() {
return this->b;
}
bool IsStill() {
return CheckFlag(STILL);
}
bool IsFloating() {
return CheckFlag(FLOATING);
}
bool IsBurnable() {
return CheckFlag(BURNABLE);
}
bool BurnsToEmber() {
return CheckFlag(BURNS_TO_EMBER);
}
bool IsSelectable() {
return CheckFlag(SELECTABLE);
}
bool HasData() {
return CheckFlag(DATA);
}
bool IsDrawn() {
return !CheckFlag(NO_DRAW);
}
std::function<void(Scene*, int, int)> GetPhysics() {
return this->physics;
}
void SetPhysics(std::function<void(Scene*, int, int)> physics) {
this->physics = physics;
}
private:
const char* name;
u8 r;
u8 g;
u8 b;
u8 flags;
std::function<void(Scene*, int, int)> physics = NULL;
bool CheckFlag(u8 flag) {
return (this->flags & flag) == flag;
}
};
#endif |
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>reveal.js - The HTML Presentation Framework</title>
<meta name="description" content="A framework for easily creating beautiful presentations using HTML">
<meta name="author" content="Hakim El Hattab">
<meta name="<API key>" content="yes" />
<meta name="<API key>" content="black-translucent" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, minimal-ui">
<link rel="stylesheet" href="css/reveal.css">
<link rel="stylesheet" href="css/theme/moon.css" id="theme">
<!-- Code syntax highlighting -->
<link rel="stylesheet" href="lib/css/zenburn.css">
<!-- Printing and PDF exports -->
<script>
var link = document.createElement( 'link' );
link.rel = 'stylesheet';
link.type = 'text/css';
link.href = window.location.search.match( /print-pdf/gi ) ? 'css/print/pdf.css' : 'css/print/paper.css';
document.<API key>( 'head' )[0].appendChild( link );
</script>
<!--[if lt IE 9]>
<script src="lib/js/html5shiv.js"></script>
<![endif]
</head>
<body>
<div class="reveal">
<!-- Any section element inside of this container is displayed as a slide -->
<div class="slides">
<section>
<h1>Reveal.js</h1>
<h3>The HTML Presentation Framework</h3>
<p>
<small>Created by <a href="http:
</p>
</section>
<section>
<h2>Hello There</h2>
<p>
reveal.js enables you to create beautiful interactive slide decks using HTML. This presentation will show you examples of what it can do.
</p>
</section>
<!-- Example of nested vertical slides -->
<section>
<section>
<h2>Vertical Slides</h2>
<p>Slides can be nested inside of each other.</p>
<p>Use the <em>Space</em> key to navigate through all slides.</p>
<br>
<a href="#" class="navigate-down">
<img width="178" height="238" data-src="https://s3.amazonaws.com/hakim-static/reveal-js/arrow.png" alt="Down arrow">
</a>
</section>
<section>
<h2>Basement Level 1</h2>
<p>Nested slides are useful for adding additional detail underneath a high level horizontal slide.</p>
</section>
<section>
<h2>Basement Level 2</h2>
<p>That's it, time to go back up.</p>
<br>
<a href="
<img width="178" height="238" data-src="https://s3.amazonaws.com/hakim-static/reveal-js/arrow.png" alt="Up arrow" style="transform: rotate(180deg); -webkit-transform: rotate(180deg);">
</a>
</section>
</section>
<section>
<h2>Slides</h2>
<p>
Not a coder? Not a problem. There's a fully-featured visual editor for authoring these, try it out at <a href="http:
</p>
</section>
<section>
<h2>Point of View</h2>
<p>
Press <strong>ESC</strong> to enter the slide overview.
</p>
<p>
Hold down alt and click on any element to zoom in on it using <a href="http://lab.hakim.se/zoom-js">zoom.js</a>. Alt + click anywhere to zoom back out.
</p>
</section>
<section>
<h2>Touch Optimized</h2>
<p>
Presentations look great on touch devices, like mobile phones and tablets. Simply swipe through your slides.
</p>
</section>
<section data-markdown>
<script type="text/template">
## Markdown support
Write content using inline or external Markdown.
Instructions and more info available in the [readme](https://github.com/hakimel/reveal.js#markdown).
<section data-markdown>
## Markdown support
Write content using inline or external Markdown.
Instructions and more info available in the [readme](https://github.com/hakimel/reveal.js#markdown).
</section>
</script>
</section>
<section>
<section id="fragments">
<h2>Fragments</h2>
<p>Hit the next arrow...</p>
<p class="fragment">... to step through ...</p>
<p><span class="fragment">... a</span> <span class="fragment">fragmented</span> <span class="fragment">slide.</span></p>
<aside class="notes">
This slide has fragments which are also stepped through in the notes window.
</aside>
</section>
<section>
<h2>Fragment Styles</h2>
<p>There's different types of fragments, like:</p>
<p class="fragment grow">grow</p>
<p class="fragment shrink">shrink</p>
<p class="fragment fade-out">fade-out</p>
<p class="fragment current-visible">current-visible</p>
<p class="fragment highlight-red">highlight-red</p>
<p class="fragment highlight-blue">highlight-blue</p>
</section>
</section>
<section id="transitions">
<h2>Transition Styles</h2>
<p>
You can select from different transitions, like: <br>
<a href="?transition=none#/transitions">None</a> -
<a href="?transition=fade#/transitions">Fade</a> -
<a href="?transition=slide#/transitions">Slide</a> -
<a href="?transition=convex#/transitions">Convex</a> -
<a href="?transition=concave#/transitions">Concave</a> -
<a href="?transition=zoom#/transitions">Zoom</a>
</p>
</section>
<section id="themes">
<h2>Themes</h2>
<p>
reveal.js comes with a few themes built in: <br>
<!-- Hacks to swap themes after the page has loaded. Not flexible and only intended for the reveal.js demo deck. -->
<a href="#" onclick="document.getElementById('theme').setAttribute('href','css/theme/black.css'); return false;">Black (default)</a> -
<a href="#" onclick="document.getElementById('theme').setAttribute('href','css/theme/white.css'); return false;">White</a> -
<a href="#" onclick="document.getElementById('theme').setAttribute('href','css/theme/league.css'); return false;">League</a> -
<a href="#" onclick="document.getElementById('theme').setAttribute('href','css/theme/sky.css'); return false;">Sky</a> -
<a href="#" onclick="document.getElementById('theme').setAttribute('href','css/theme/beige.css'); return false;">Beige</a> -
<a href="#" onclick="document.getElementById('theme').setAttribute('href','css/theme/simple.css'); return false;">Simple</a> <br>
<a href="#" onclick="document.getElementById('theme').setAttribute('href','css/theme/serif.css'); return false;">Serif</a> -
<a href="#" onclick="document.getElementById('theme').setAttribute('href','css/theme/blood.css'); return false;">Blood</a> -
<a href="#" onclick="document.getElementById('theme').setAttribute('href','css/theme/night.css'); return false;">Night</a> -
<a href="#" onclick="document.getElementById('theme').setAttribute('href','css/theme/moon.css'); return false;">Moon</a> -
<a href="#" onclick="document.getElementById('theme').setAttribute('href','css/theme/solarized.css'); return false;">Solarized</a>
</p>
</section>
<section>
<section data-background="#dddddd">
<h2>Slide Backgrounds</h2>
<p>
Set <code>data-background="#dddddd"</code> on a slide to change the background color. All CSS color formats are supported.
</p>
<a href="#" class="navigate-down">
<img width="178" height="238" data-src="https://s3.amazonaws.com/hakim-static/reveal-js/arrow.png" alt="Down arrow">
</a>
</section>
<section data-background="https://s3.amazonaws.com/hakim-static/reveal-js/image-placeholder.png">
<h2>Image Backgrounds</h2>
<pre><code><section data-background="image.png"></code></pre>
</section>
<section data-background="https://s3.amazonaws.com/hakim-static/reveal-js/image-placeholder.png" <API key>="repeat" <API key>="100px">
<h2>Tiled Backgrounds</h2>
<pre><code style="word-wrap: break-word;"><section data-background="image.png" <API key>="repeat" <API key>="100px"></code></pre>
</section>
<section <API key>="https://s3.amazonaws.com/static.slid.es/site/homepage/v1/<API key>.mp4,https://s3.amazonaws.com/static.slid.es/site/homepage/v1/<API key>.webm" <API key>="#000000">
<div style="background-color: rgba(0, 0, 0, 0.9); color: #fff; padding: 20px;">
<h2>Video Backgrounds</h2>
<pre><code style="word-wrap: break-word;"><section <API key>="video.mp4,video.webm"></code></pre>
</div>
</section>
<section data-background="http://i.giphy.com/90F8aUepslB84.gif">
<h2>... and GIFs!</h2>
</section>
</section>
<section data-transition="slide" data-background="#4d7e65" <API key>="zoom">
<h2>Background Transitions</h2>
<p>
Different background transitions are available via the <API key> option. This one's called "zoom".
</p>
<pre><code>Reveal.configure({ <API key>: 'zoom' })</code></pre>
</section>
<section data-transition="slide" data-background="#b5533c" <API key>="zoom">
<h2>Background Transitions</h2>
<p>
You can override background transitions per-slide.
</p>
<pre><code style="word-wrap: break-word;"><section <API key>="zoom"></code></pre>
</section>
<section>
<h2>Pretty Code</h2>
<pre><code data-trim contenteditable>
function linkify( selector ) {
if( <API key> ) {
var nodes = document.querySelectorAll( selector );
for( var i = 0, len = nodes.length; i < len; i++ ) {
var node = nodes[i];
if( !node.className ) {
node.className += ' roll';
}
}
}
}
</code></pre>
<p>Code syntax highlighting courtesy of <a href="http://softwaremaniacs.org/soft/highlight/en/description/">highlight.js</a>.</p>
</section>
<section>
<h2>Marvelous List</h2>
<ul>
<li>No order here</li>
<li>Or here</li>
<li>Or here</li>
<li>Or here</li>
</ul>
</section>
<section>
<h2>Fantastic Ordered List</h2>
<ol>
<li>One is smaller than...</li>
<li>Two is smaller than...</li>
<li>Three!</li>
</ol>
</section>
<section>
<h2>Tabular Tables</h2>
<table>
<thead>
<tr>
<th>Item</th>
<th>Value</th>
<th>Quantity</th>
</tr>
</thead>
<tbody>
<tr>
<td>Apples</td>
<td>$1</td>
<td>7</td>
</tr>
<tr>
<td>Lemonade</td>
<td>$2</td>
<td>18</td>
</tr>
<tr>
<td>Bread</td>
<td>$3</td>
<td>2</td>
</tr>
</tbody>
</table>
</section>
<section>
<h2>Clever Quotes</h2>
<p>
These guys come in two forms, inline: <q cite="http://<API key>.techtarget.com/definition/<API key>">
“The nice thing about standards is that there are so many to choose from”</q> and block:
</p>
<blockquote cite="http://<API key>.techtarget.com/definition/<API key>">
“For years there has been a theory that millions of monkeys typing at random on millions of typewriters would
reproduce the entire works of Shakespeare. The Internet has proven this theory to be untrue.”
</blockquote>
</section>
<section>
<h2>Intergalactic Interconnections</h2>
<p>
You can link between slides internally,
<a href="#/2/3">like this</a>.
</p>
</section>
<section>
<h2>Speaker View</h2>
<p>There's a <a href="https://github.com/hakimel/reveal.js#speaker-notes">speaker view</a>. It includes a timer, preview of the upcoming slide as well as your speaker notes.</p>
<p>Press the <em>S</em> key to try it out.</p>
<aside class="notes">
Oh hey, these are some notes. They'll be hidden in your presentation, but you can see them if you open the speaker notes window (hit 's' on your keyboard).
</aside>
</section>
<section>
<h2>Export to PDF</h2>
<p>Presentations can be <a href="https://github.com/hakimel/reveal.js#pdf-export">exported to PDF</a>, here's an example:</p>
<iframe src="//www.slideshare.net/slideshow/embed_code/42840540" width="445" height="355" frameborder="0" marginwidth="0" marginheight="0" scrolling="no" style="border:3px solid #666; margin-bottom:5px; max-width: 100%;" allowfullscreen> </iframe>
</section>
<section>
<h2>Global State</h2>
<p>
Set <code>data-state="something"</code> on a slide and <code>"something"</code>
will be added as a class to the document element when the slide is open. This lets you
apply broader style changes, like switching the page background.
</p>
</section>
<section data-state="customevent">
<h2>State Events</h2>
<p>
Additionally custom events can be triggered on a per slide basis by binding to the <code>data-state</code> name.
</p>
<pre><code class="javascript" data-trim contenteditable style="font-size: 18px;">
Reveal.addEventListener( 'customevent', function() {
console.log( '"customevent" has fired' );
} );
</code></pre>
</section>
<section>
<h2>Take a Moment</h2>
<p>
Press B or . on your keyboard to pause the presentation. This is helpful when you're on stage and want to take distracting slides off the screen.
</p>
</section>
<section>
<h2>Much more</h2>
<ul>
<li>Right-to-left support</li>
<li><a href="https://github.com/hakimel/reveal.js#api">Extensive JavaScript API</a></li>
<li><a href="https://github.com/hakimel/reveal.js#auto-sliding">Auto-progression</a></li>
<li><a href="https://github.com/hakimel/reveal.js#parallax-background">Parallax backgrounds</a></li>
<li><a href="https://github.com/hakimel/reveal.js#keyboard-bindings">Custom keyboard bindings</a></li>
</ul>
</section>
<section style="text-align: left;">
<h1>THE END</h1>
<p>
- <a href="http://slides.com">Try the online editor</a> <br>
- <a href="https://github.com/hakimel/reveal.js">Source code & documentation</a>
</p>
</section>
</div>
</div>
<script src="lib/js/head.min.js"></script>
<script src="js/reveal.js"></script>
<script>
// Full list of configuration options available at:
// https://github.com/hakimel/reveal.js#configuration
Reveal.initialize({
controls: true,
progress: true,
history: true,
center: true,
transition: 'convex', // none/fade/slide/convex/concave/zoom
// Optional reveal.js plugins
dependencies: [
{ src: 'lib/js/classList.js', condition: function() { return !document.body.classList; } },
{ src: 'plugin/markdown/marked.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
{ src: 'plugin/markdown/markdown.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
{ src: 'plugin/highlight/highlight.js', async: true, condition: function() { return !!document.querySelector( 'pre code' ); }, callback: function() { hljs.<API key>(); } },
{ src: 'plugin/zoom-js/zoom.js', async: true },
{ src: 'plugin/notes/notes.js', async: true }
]
});
</script>
</body>
</html> |
package prg2.connectfour.persistence;
import java.io.File;
import java.io.<API key>;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import prg2.connectfour.logic.Game;
import prg2.connectfour.logic.GameFactory;
import prg2.connectfour.logic.Grid;
import prg2.connectfour.logic.Player;
public class SaveManager {
private ISaveFileProvider saveFileProvider;
public SaveManager(ISaveFileProvider saveFileProvider) {
this.saveFileProvider = saveFileProvider;
}
public boolean hasSave() {
return this.saveFileProvider.get().exists();
}
public boolean save(Game game) throws IOException {
File file = this.saveFileProvider.get();
if (!file.exists())
file.createNewFile();
FileWriter writer = new FileWriter(file, false);
writer.write(game.grid.width);
writer.write(game.grid.height);
ArrayList<Integer> turns = game.getTurns();
writer.write(turns.size());
for (int turn : turns) {
writer.write(turn);
}
writer.close();
return true;
}
public Game load(Player... players) {
if (!hasSave()) {
throw new <API key>("no save available");
}
File file = this.saveFileProvider.get();
FileReader reader;
try {
reader = new FileReader(file);
} catch (<API key> e) {
e.printStackTrace();
assert false : "FileReader file not found. Should not happen.";
return null;
}
try {
int width = reader.read();
int height = reader.read();
ArrayList<Integer> turns = new ArrayList<>();
int size = reader.read();
for (int i = 0; i < size; i++) {
turns.add(reader.read());
}
reader.close();
Grid grid = new Grid(width, height);
return GameFactory
.create()
.withPlayers(players)
.withGrid(grid)
.withTurns(turns)
.finish();
} catch (IOException e) {
e.printStackTrace();
return null;
} finally {
file.delete();
}
}
} |
from django.db import models
# Create your models here.
class ImageModel(models.Model):
image = models.ImageField(upload_to = 'pic_folder/') |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>lc: Not compatible </title>
<link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" />
<link href="../../../../../bootstrap.min.css" rel="stylesheet">
<link href="../../../../../bootstrap-custom.css" rel="stylesheet">
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
<script src="../../../../../moment.min.js"></script>
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]
</head>
<body>
<div class="container">
<div class="navbar navbar-default" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a>
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="../..">clean / released</a></li>
<li class="active"><a href="">8.7.1 / lc - 8.9.0</a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href="../..">« Up</a>
<h1>
lc
<small>
8.9.0
<span class="label label-info">Not compatible </span>
</small>
</h1>
<p> <em><script>document.write(moment("2022-01-28 23:20:48 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-01-28 23:20:48 UTC)</em><p>
<h2>Context</h2>
<pre># Packages matching: installed
# Name # Installed # Synopsis
base-bigarray base
base-threads base
base-unix base
camlp5 7.14 <API key> of OCaml
conf-findutils 1 Virtual package relying on findutils
conf-perl 2 Virtual package relying on perl
coq 8.7.1 Formal proof management system
num 1.4 The legacy Num library for arbitrary-precision integer and rational arithmetic
ocaml 4.09.1 The OCaml compiler (virtual package)
ocaml-base-compiler 4.09.1 Official release 4.09.1
ocaml-config 1 OCaml Switch Configuration
ocamlfind 1.9.2 A library manager for OCaml
# opam file:
opam-version: "2.0"
maintainer: "Hugo.Herbelin@inria.fr"
homepage: "http:
license: "LGPL 2.1"
build: [make "-j%{jobs}%"]
install: [make "install"]
remove: ["rm" "-R" "%{lib}%/coq/user-contrib/lc"]
depends: [
"ocaml"
"coq" {>= "8.9" & < "8.10~"}
]
tags: [
"keyword: modules"
"keyword: monads"
"keyword: category"
"keyword: lambda calculus"
"keyword: higher-order syntax"
"category: Computer Science/Lambda Calculi"
"date: 2006-01-12"
"date: 2008-09-9"
]
authors: [
"André Hirschowitz <ah@math.unice.fr> [http://math.unice.fr/~ah/]"
"Marco Maggesi <maggesi@math.unifi.it> [http:
]
bug-reports: "https://github.com/coq-contribs/lc/issues"
dev-repo: "git+https://github.com/coq-contribs/lc.git"
synopsis: "Modules over monads and lambda-calculi"
description: """
We define a notion of module over a monad and use it to
propose a new definition (or semantics) for abstract
syntax (with binding constructions). Using our notion of
module, we build a category of `exponential' monads,
which can be understood as the category of
lambda-calculi, and prove that it has an initial object
(the pure untyped lambda-calculus)."""
flags: light-uninstall
url {
src: "https://github.com/coq-contribs/lc/archive/v8.9.0.tar.gz"
checksum: "md5=<API key>"
}
</pre>
<h2>Lint</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Dry install </h2>
<p>Dry install with the current Coq version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam install -y --show-action coq-lc.8.9.0 coq.8.7.1</code></dd>
<dt>Return code</dt>
<dd>5120</dd>
<dt>Output</dt>
<dd><pre>[NOTE] Package coq is already installed (current version is 8.7.1).
The following dependencies couldn't be met:
- coq-lc -> coq >= 8.9
Your request can't be satisfied:
- No available version of coq satisfies the constraints
No solution found, exiting
</pre></dd>
</dl>
<p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-lc.8.9.0</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Install dependencies</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Install </h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Installation size</h2>
<p>No files were installed.</p>
<h2>Uninstall 🧹</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Missing removes</dt>
<dd>
none
</dd>
<dt>Wrong removes</dt>
<dd>
none
</dd>
</dl>
</div>
</div>
</div>
<hr/>
<div class="footer">
<p class="text-center">
Sources are on <a href="https:
</p>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="../../../../../bootstrap.min.js"></script>
</body>
</html> |
<?php
namespace BattleWheel\Application\Models;
use BattleWheel\Framework\Model\VanillaModel as VanillaModel;
class Error extends VanillaModel
{
} |
require "smooth_operator/associations/reflection"
module SmoothOperator
module Associations
class <API key> < Reflection
attr_reader :related_reflection, :macro
def initialize(association, related_reflection, options)
super(association, options)
@related_reflection, @macro = related_reflection, options[:macro]
end
def primary_key
@primary_key ||= options[:primary_key] || :id
end
def foreign_key
@foreign_key ||= options[:foreign_key] || foreign_key_default
end
def set_relational_keys(origin, destination)
return nil if options[:standalone] == true
if has_many? || has_one?
set_foreign_key(destination, primary_key_of(origin))
elsif belongs_to?
set_foreign_key(origin, primary_key_of(destination))
end
end
def set_foreign_key(object, id)
setter = "#{foreign_key}="
if object.respond_to?(setter)
object.send(setter, id)
elsif object.respond_to?("<API key>")
object.<API key>(setter, id)
end
end
def primary_key_of(object)
object.send(primary_key)
end
def has_many?
macro == :has_many
end
def has_one?
macro == :has_one
end
def belongs_to?
macro == :belongs_to
end
def collection?
has_many?
end
def rails_serialization?
options[:rails_serialization] == true
end
private
def foreign_key_default
if has_many? || has_one?
"#{related_reflection.single_name}_id"
elsif belongs_to?
"#{single_name}_id"
end.to_sym
end
end
end
end |
<nav id="dl-menu" class="dl-menuwrapper" role="navigation">
<button class="dl-trigger">Open Menu</button>
<ul class="dl-menu">
<li><a href="{{ site.url }}/"><i class="fa fa-fw fa-home"></i></a></li>
<li>
<a href="#"><i class="fa fa-fw fa-star"></i></a>
<ul class="dl-submenu">
<li><a href="{{ site.url }}/posts/"><i class="fa fa-fw fa-arrow-right"></i></a></li>
<li><a href="{{ site.url }}/category/"><i class="fa fa-fw fa-folder-open"></i></a></li>
<li><a href="{{ site.url }}/tags/"><i class="fa fa-fw fa-tags"></i></a></li>
</ul>
</li>
<li>
<a href="#"><i class="fa fa-fw fa-user"></i></a>
<ul class="dl-submenu">
<li>
<img src="{{ site.url }}/images/{{ site.owner.avatar }}" alt="{{ site.owner.name }} photo" class="author-photo">
<h4>{{ site.owner.name }}</h4>
<p>{{ site.owner.bio }}</p>
</li>
<!-- <li><a href="{{ site.url }}/about/"></a></li> -->
{% if site.owner.email %}<li>
<a href="mailto:{{ site.owner.email }}"><i class="fa fa-fw fa-envelope"></i> Email</a>
</li>{% endif %}
{% if site.owner.twitter %}<li>
<a href="https://twitter.com/{{ site.owner.twitter }}"><i class="fa fa-fw fa-twitter"></i> Twitter</a>
</li>{% endif %}
{% if site.owner.facebook %}<li>
<a href="https://facebook.com/{{ site.owner.facebook }}"><i class="fa fa-fw fa-facebook"></i> Facebook</a>
</li>{% endif %}
{% if site.owner.google_plus %}<li>
<a href="https://google.com/{{ site.owner.google_plus }}"><i class="fa fa-fw fa-google-plus"></i> Google+</a>
</li>{% endif %}
{% if site.owner.linkedin %}<li>
<a href="https://linkedin.com/in/{{ site.owner.linkedin }}"><i class="fa fa-fw fa-linkedin"></i> LinkedIn</a>
</li>{% endif %}
{% if site.owner.github %}<li>
<a href="https://github.com/{{ site.owner.github }}"><i class="fa fa-fw fa-github"></i> GitHub</a>
</li>{% endif %}
{% if site.owner.stackexchange %}<li>
<a href="{{ site.owner.stackexchange }}"><i class="fa fa-fw fa-stack-exchange"></i> Stackexchange</a>
</li>{% endif %}
{% if site.owner.instagram %}<li>
<a href="https://instagram.com/{{ site.owner.instagram }}"><i class="fa fa-fw fa-instagram"></i> Instagram</a>
</li>{% endif %}
{% if site.owner.flickr %}<li>
<a href="https:
</li>{% endif %}
{% if site.owner.tumblr %}<li>
<a href="http://{{ site.owner.tumblr }}.tumblr.com"><i class="fa fa-fw fa-tumblr"></i> Tumblr</a>
</li>{% endif %}
</ul><!-- /.dl-submenu -->
</li>
{% for link in site.data.navigation %}
{% if link.url contains 'http' %}
{% assign domain = '' %}
{% else %}
{% assign domain = site.url %}
{% endif %}
<li><a href="{{ domain }}{{ link.url }}" {% if link.url contains 'http' %}target="_blank"{% endif %}>{{ link.title }}</a></li>
{% endfor %}
</ul><!-- /.dl-menu -->
</nav><!-- /.dl-menuwrapper --> |
class NumArray {
public:
vector<int> sum;
NumArray(vector<int> &nums) {
sum.reserve(nums.size());
int s = 0;
for (int i : nums) {
s += i;
sum.push_back(s);
}
}
int sumRange(int i, int j) {
return i > 0 ? sum[j] - sum[i - 1] : sum[j];
}
};
// Your NumArray object will be instantiated and called as such:
// NumArray numArray(nums);
// numArray.sumRange(0, 1);
// numArray.sumRange(1, 2); |
<div class="col-lg-12 location-container">
<table class="table">
<tr class="location-row" style="cursor: pointer" ng-repeat="loc in locations" apptouch="locationClick(loc)">
<td>{{loc.name}}</td>
<td>{{loc.address}}</td>
<td><button class="btn btn-warning" apptouch="doEditLocation(loc)"><span class="glyphicon glyphicon-pencil"></span></button></td>
<td><button class="btn btn-danger"><span class="glyphicon glyphicon-remove" apptouch="doDeleteLocation(loc)"></span></button></td>
</tr>
</table>
</div> |
# <API key>: true
require 'test_helper'
require 'prolog/services/markdown_to_html'
describe 'Prolog::Services::MarkdownToHtml' do
let(:described_class) { Prolog::Services::MarkdownToHtml }
it 'has no initializer method, instead using that of BasicObject' do
method = described_class.new.method :initialize
expect(method.owner).must_equal BasicObject
end
describe 'has a .call method that' do
it 'requires a :content parameter' do
error = expect { described_class.call }.must_raise ArgumentError
expect(error.message).must_equal 'missing keyword: content'
end
describe 'returns' do
let(:actual) { described_class.call content: @content }
after { expect(actual).must_equal @expected }
it 'an empty string when :content is an empty string' do
@content = @expected = ''
end
it 'an HTML paragraph wrapping a simple text :content string' do
@content = 'This is a test.'
@expected = %w[<p> </p>].join @content
end
it 'a sequence of paragraphs wrapping <API key> content' do
@content = "This is a test.\n\nThis is another test."
@expected = '<p>This is a test.</p><p>This is another test.</p>'
end
it 'a para with content separated by a <br/> tag at an input newline' do
@content = "This is a test.\nThis is another test."
@expected = '<p>This is a test.<br/>This is another test.</p>'
end
it 'correct markup for more complex input' do
# rubocop:disable Layout/IndentHeredoc
@content = <<~ENDIT
# First Header
## Second Header
Third Header
This is an *initial* paragraph under the ~~third~~ header.
* First Item
* A *Second* Item
* THe *__Last__* Item
In closing, we thank the Academy of Lorem Ipsum.
ENDIT
# rubocop:enable Layout/IndentHeredoc
@expected = '<h1>First Header</h1><h2>Second Header</h2>' \
'<h3>Third Header</h3><p>This is an <em>initial</em> ' \
'paragraph under the <del>third</del> header.</p>' \
'<ul><li>First Item</li><li>A <em>Second</em> Item</li>' \
'<li>THe <em><strong>Last</strong></em> Item</li></ul>' \
'<p>In closing, we thank the Academy of Lorem Ipsum.</p>'
end
end # describe 'returns'
end # describe 'has a .call method that'
end |
describe("About Expects", function() {
// We shall contemplate truth by testing reality, via spec expectations.
it("should expect true", function() {
expect(true).toBeTruthy(); //This should be true
});
// To understand reality, we must compare our expectations against reality.
it("should expect equality", function () {
var expectedValue = 1 + 1;
var actualValue = 1 + 1;
expect(actualValue === expectedValue).toBeTruthy();
});
// Some ways of asserting equality are better than others.
it("should assert equality a better way", function () {
var expectedValue = 1 + 1;
var actualValue = 1 + 1;
// toEqual() compares using common sense equality.
expect(actualValue).toEqual(expectedValue);
});
// Sometimes you need to be really exact about what you "type."
it("should assert equality with ===", function () {
var expectedValue = '2';
var actualValue = (1 + 1).toString();
expect(actualValue).toBe(expectedValue);
});
// Sometimes we will ask you to fill in the values.
it("should have filled in values", function () {
expect(1 + 1).toEqual(2);
});
}); |
/* class BHashTable declaration */
/* virtual functions */ |
SmsCheck::Engine.routes.draw do
end |
describe('Moto Eviscerator', function() {
integration(function() {
describe('Moto Eviscerator\'s ability', function() {
beforeEach(function() {
this.setupTest({
phase: 'conflict',
player1: {
inPlay: ['moto-eviscerator','yogo-outcast']
},
player2: {
inPlay: ['doji-whisperer']
}
});
this.yogo = this.player1.findCardByName('yogo-outcast');
this.moto = this.player1.findCardByName('moto-eviscerator');
this.whisperer = this.player2.findCardByName('doji-whisperer');
this.noMoreActions();
});
it('should spend an honor to move into the conflict (attack)', function() {
this.initiateConflict({
type: 'military',
attackers: [this.yogo],
defenders: []
});
this.player2.pass();
let honor = this.player1.honor;
this.player1.clickCard(this.moto);
expect(this.moto.inConflict).toBe(true);
expect(this.player1.honor).toBe(honor - 1);
});
it('should spend an honor to move into the conflict (defense)', function() {
this.player1.passConflict();
this.noMoreActions();
this.initiateConflict({
type: 'political',
attackers: [this.whisperer],
defenders: []
});
let honor = this.player1.honor;
this.player1.clickCard(this.moto);
expect(this.moto.inConflict).toBe(true);
expect(this.player1.honor).toBe(honor - 1);
});
it('should not work if already participating', function() {
this.initiateConflict({
type: 'military',
attackers: [this.moto],
defenders: []
});
this.player2.pass();
let honor = this.player1.honor;
this.player1.clickCard(this.moto);
expect(this.moto.inConflict).toBe(true);
expect(this.player1.honor).toBe(honor);
});
});
});
}); |
<?php
namespace PhpPdg\CfgBridge;
use PHPCfg\Script;
class System {
/** @var Script[] */
private $scripts = [];
public function addScript($filename, Script $script) {
if (isset($this->scripts[$filename]) === true) {
throw new \<API key>("CFG with filename `$filename` already exists");
}
$this->scripts[$filename] = $script;
}
/**
* @return string[]
*/
public function getFilenames() {
return array_keys($this->scripts);
}
/**
* @param string $filename
* @return Script
* @throws \<API key>
*/
public function getScript($filename) {
if (isset($this->scripts[$filename]) === false) {
throw new \<API key>("No CFG with filename `$filename`");
}
return $this->scripts[$filename];
}
} |
package org.knowm.xchange.cryptsy.dto.account;
import java.util.ArrayList;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.knowm.xchange.cryptsy.dto.<API key>;
/**
* @author ObsessiveOrange
*/
public class <API key> extends <API key><List<CryptsyTransfers>> {
/**
* Constructor
*
* @param success True if successful
* @param value The BTC-e account info
* @param error Any error
*/
public <API key>(@JsonProperty("success") int success, @JsonProperty("return") List<CryptsyTransfers> value,
@JsonProperty("error") String error) {
super(success, (value == null ? new ArrayList<CryptsyTransfers>() : value), error);
}
} |
// Why base-58 instead of standard base-64 encoding?
// - Don't want 0OIl characters that look the same in some fonts and
// could be used to create visually identical looking account numbers.
// - A string with non-alphanumeric characters is not as easily accepted as an account number.
// - E-mail usually won't line-break if there's no punctuation to break at.
// - Double-clicking selects the whole number as one word if it's all alphanumeric.
#ifndef BITCOIN_BASE58_H
#define BITCOIN_BASE58_H
#include <string>
#include <vector>
#include "bignum.h"
#include "key.h"
#include "script.h"
#include "allocators.h"
static const char* pszBase58 = "<API key>";
// Encode a byte sequence as a base58-encoded string
inline std::string EncodeBase58(const unsigned char* pbegin, const unsigned char* pend)
{
CAutoBN_CTX pctx;
CBigNum bn58 = 58;
CBigNum bn0 = 0;
// Convert big endian data to little endian
// Extra zero at the end make sure bignum will interpret as a positive number
std::vector<unsigned char> vchTmp(pend-pbegin+1, 0);
reverse_copy(pbegin, pend, vchTmp.begin());
// Convert little endian data to bignum
CBigNum bn;
bn.setvch(vchTmp);
// Convert bignum to std::string
std::string str;
// Expected size increase from base58 conversion is approximately 137%
// use 138% to be safe
str.reserve((pend - pbegin) * 138 / 100 + 1);
CBigNum dv;
CBigNum rem;
while (bn > bn0)
{
if (!BN_div(&dv, &rem, &bn, &bn58, pctx))
throw bignum_error("EncodeBase58 : BN_div failed");
bn = dv;
unsigned int c = rem.getulong();
str += pszBase58[c];
}
// Leading zeroes encoded as base58 zeros
for (const unsigned char* p = pbegin; p < pend && *p == 0; p++)
str += pszBase58[0];
// Convert little endian std::string to big endian
reverse(str.begin(), str.end());
return str;
}
// Encode a byte vector as a base58-encoded string
inline std::string EncodeBase58(const std::vector<unsigned char>& vch)
{
return EncodeBase58(&vch[0], &vch[0] + vch.size());
}
// Decode a base58-encoded string psz into byte vector vchRet
// returns true if decoding is successful
inline bool DecodeBase58(const char* psz, std::vector<unsigned char>& vchRet)
{
CAutoBN_CTX pctx;
vchRet.clear();
CBigNum bn58 = 58;
CBigNum bn = 0;
CBigNum bnChar;
while (isspace(*psz))
psz++;
// Convert big endian string to bignum
for (const char* p = psz; *p; p++)
{
const char* p1 = strchr(pszBase58, *p);
if (p1 == NULL)
{
while (isspace(*p))
p++;
if (*p != '\0')
return false;
break;
}
bnChar.setulong(p1 - pszBase58);
if (!BN_mul(&bn, &bn, &bn58, pctx))
throw bignum_error("DecodeBase58 : BN_mul failed");
bn += bnChar;
}
// Get bignum as little endian data
std::vector<unsigned char> vchTmp = bn.getvch();
// Trim off sign byte if present
if (vchTmp.size() >= 2 && vchTmp.end()[-1] == 0 && vchTmp.end()[-2] >= 0x80)
vchTmp.erase(vchTmp.end()-1);
// Restore leading zeros
int nLeadingZeros = 0;
for (const char* p = psz; *p == pszBase58[0]; p++)
nLeadingZeros++;
vchRet.assign(nLeadingZeros + vchTmp.size(), 0);
// Convert little endian data to big endian
reverse_copy(vchTmp.begin(), vchTmp.end(), vchRet.end() - vchTmp.size());
return true;
}
// Decode a base58-encoded string str into byte vector vchRet
// returns true if decoding is successful
inline bool DecodeBase58(const std::string& str, std::vector<unsigned char>& vchRet)
{
return DecodeBase58(str.c_str(), vchRet);
}
// Encode a byte vector to a base58-encoded string, including checksum
inline std::string EncodeBase58Check(const std::vector<unsigned char>& vchIn)
{
// add 4-byte hash check to the end
std::vector<unsigned char> vch(vchIn);
uint256 hash = Hash2(vch.begin(), vch.end());
vch.insert(vch.end(), (unsigned char*)&hash, (unsigned char*)&hash + 4);
return EncodeBase58(vch);
}
// Decode a base58-encoded string psz that includes a checksum, into byte vector vchRet
// returns true if decoding is successful
inline bool DecodeBase58Check(const char* psz, std::vector<unsigned char>& vchRet)
{
if (!DecodeBase58(psz, vchRet))
return false;
if (vchRet.size() < 4)
{
vchRet.clear();
return false;
}
uint256 hash = Hash2(vchRet.begin(), vchRet.end()-4);
if (memcmp(&hash, &vchRet.end()[-4], 4) != 0)
{
vchRet.clear();
return false;
}
vchRet.resize(vchRet.size()-4);
return true;
}
// Decode a base58-encoded string str that includes a checksum, into byte vector vchRet
// returns true if decoding is successful
inline bool DecodeBase58Check(const std::string& str, std::vector<unsigned char>& vchRet)
{
return DecodeBase58Check(str.c_str(), vchRet);
}
/** Base class for all base58-encoded data */
class CBase58Data
{
protected:
// the version byte
unsigned char nVersion;
// the actually encoded data
typedef std::vector<unsigned char, <API key><unsigned char> > vector_uchar;
vector_uchar vchData;
CBase58Data()
{
nVersion = 0;
vchData.clear();
}
void SetData(int nVersionIn, const void* pdata, size_t nSize)
{
nVersion = nVersionIn;
vchData.resize(nSize);
if (!vchData.empty())
memcpy(&vchData[0], pdata, nSize);
}
void SetData(int nVersionIn, const unsigned char *pbegin, const unsigned char *pend)
{
SetData(nVersionIn, (void*)pbegin, pend - pbegin);
}
public:
bool SetString(const char* psz)
{
std::vector<unsigned char> vchTemp;
DecodeBase58Check(psz, vchTemp);
if (vchTemp.empty())
{
vchData.clear();
nVersion = 0;
return false;
}
nVersion = vchTemp[0];
vchData.resize(vchTemp.size() - 1);
if (!vchData.empty())
memcpy(&vchData[0], &vchTemp[1], vchData.size());
OPENSSL_cleanse(&vchTemp[0], vchData.size());
return true;
}
bool SetString(const std::string& str)
{
return SetString(str.c_str());
}
std::string ToString() const
{
std::vector<unsigned char> vch(1, nVersion);
vch.insert(vch.end(), vchData.begin(), vchData.end());
return EncodeBase58Check(vch);
}
int CompareTo(const CBase58Data& b58) const
{
if (nVersion < b58.nVersion) return -1;
if (nVersion > b58.nVersion) return 1;
if (vchData < b58.vchData) return -1;
if (vchData > b58.vchData) return 1;
return 0;
}
bool operator==(const CBase58Data& b58) const { return CompareTo(b58) == 0; }
bool operator<=(const CBase58Data& b58) const { return CompareTo(b58) <= 0; }
bool operator>=(const CBase58Data& b58) const { return CompareTo(b58) >= 0; }
bool operator< (const CBase58Data& b58) const { return CompareTo(b58) < 0; }
bool operator> (const CBase58Data& b58) const { return CompareTo(b58) > 0; }
};
/** base58-encoded Bitcoin addresses.
* <API key> have version 0 (or 111 testnet).
* The data vector contains RIPEMD160(SHA256(pubkey)), where pubkey is the serialized public key.
* <API key> have version 5 (or 196 testnet).
* The data vector contains RIPEMD160(SHA256(cscript)), where cscript is the serialized redemption script.
*/
class CBitcoinAddress;
class <API key> : public boost::static_visitor<bool>
{
private:
CBitcoinAddress *addr;
public:
<API key>(CBitcoinAddress *addrIn) : addr(addrIn) { }
bool operator()(const CKeyID &id) const;
bool operator()(const CScriptID &id) const;
bool operator()(const CNoDestination &no) const;
};
class CBitcoinAddress : public CBase58Data
{
public:
enum
{
PUBKEY_ADDRESS = 33,
SCRIPT_ADDRESS = 38,
PUBKEY_ADDRESS_TEST = 119,
SCRIPT_ADDRESS_TEST = 199,
};
bool Set(const CKeyID &id) {
SetData(fTestNet ? PUBKEY_ADDRESS_TEST : PUBKEY_ADDRESS, &id, 20);
return true;
}
bool Set(const CScriptID &id) {
SetData(fTestNet ? SCRIPT_ADDRESS_TEST : SCRIPT_ADDRESS, &id, 20);
return true;
}
bool Set(const CTxDestination &dest)
{
return boost::apply_visitor(<API key>(this), dest);
}
bool IsValid() const
{
unsigned int nExpectedSize = 20;
bool fExpectTestNet = false;
switch(nVersion)
{
case PUBKEY_ADDRESS:
nExpectedSize = 20; // Hash of public key
fExpectTestNet = false;
break;
case SCRIPT_ADDRESS:
nExpectedSize = 20; // Hash of CScript
fExpectTestNet = false;
break;
case PUBKEY_ADDRESS_TEST:
nExpectedSize = 20;
fExpectTestNet = true;
break;
case SCRIPT_ADDRESS_TEST:
nExpectedSize = 20;
fExpectTestNet = true;
break;
default:
return false;
}
return fExpectTestNet == fTestNet && vchData.size() == nExpectedSize;
}
CBitcoinAddress()
{
}
CBitcoinAddress(const CTxDestination &dest)
{
Set(dest);
}
CBitcoinAddress(const std::string& strAddress)
{
SetString(strAddress);
}
CBitcoinAddress(const char* pszAddress)
{
SetString(pszAddress);
}
CTxDestination Get() const {
if (!IsValid())
return CNoDestination();
switch (nVersion) {
case PUBKEY_ADDRESS:
case PUBKEY_ADDRESS_TEST: {
uint160 id;
memcpy(&id, &vchData[0], 20);
return CKeyID(id);
}
case SCRIPT_ADDRESS:
case SCRIPT_ADDRESS_TEST: {
uint160 id;
memcpy(&id, &vchData[0], 20);
return CScriptID(id);
}
}
return CNoDestination();
}
bool GetKeyID(CKeyID &keyID) const {
if (!IsValid())
return false;
switch (nVersion) {
case PUBKEY_ADDRESS:
case PUBKEY_ADDRESS_TEST: {
uint160 id;
memcpy(&id, &vchData[0], 20);
keyID = CKeyID(id);
return true;
}
default: return false;
}
}
bool IsScript() const {
if (!IsValid())
return false;
switch (nVersion) {
case SCRIPT_ADDRESS:
case SCRIPT_ADDRESS_TEST: {
return true;
}
default: return false;
}
}
};
bool inline <API key>::operator()(const CKeyID &id) const { return addr->Set(id); }
bool inline <API key>::operator()(const CScriptID &id) const { return addr->Set(id); }
bool inline <API key>::operator()(const CNoDestination &id) const { return false; }
/** A base58-encoded secret key */
class CBitcoinSecret : public CBase58Data
{
public:
enum
{
PRIVKEY_ADDRESS = CBitcoinAddress::PUBKEY_ADDRESS + 128,
<API key> = CBitcoinAddress::PUBKEY_ADDRESS_TEST + 128,
};
void SetSecret(const CSecret& vchSecret, bool fCompressed)
{
assert(vchSecret.size() == 32);
SetData(fTestNet ? <API key> : PRIVKEY_ADDRESS, &vchSecret[0], vchSecret.size());
if (fCompressed)
vchData.push_back(1);
}
CSecret GetSecret(bool &fCompressedOut)
{
CSecret vchSecret;
vchSecret.resize(32);
memcpy(&vchSecret[0], &vchData[0], 32);
fCompressedOut = vchData.size() == 33;
return vchSecret;
}
bool IsValid() const
{
bool fExpectTestNet = false;
switch(nVersion)
{
case 128:
break;
case PRIVKEY_ADDRESS:
break;
case 239:
fExpectTestNet = true;
break;
case <API key>:
fExpectTestNet = true;
break;
default:
return false;
}
return fExpectTestNet == fTestNet && (vchData.size() == 32 || (vchData.size() == 33 && vchData[32] == 1));
}
bool SetString(const char* pszSecret)
{
return CBase58Data::SetString(pszSecret) && IsValid();
}
bool SetString(const std::string& strSecret)
{
return SetString(strSecret.c_str());
}
CBitcoinSecret(const CSecret& vchSecret, bool fCompressed)
{
SetSecret(vchSecret, fCompressed);
}
CBitcoinSecret()
{
}
};
#endif // BITCOIN_BASE58_H |
<!doctype html>
<html>
<head>
<meta name="viewport" content="width=device-width" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Simple Transactional Email</title>
<style>
img {
border: none;
-<API key>: bicubic;
max-width: 100%; }
body {
background-color: #f6f6f6;
font-family: sans-serif;
-<API key>: antialiased;
font-size: 14px;
line-height: 1.4;
margin: 0;
padding: 0;
-ms-text-size-adjust: 100%;
-<API key>: 100%; }
table {
border-collapse: separate;
mso-table-lspace: 0pt;
mso-table-rspace: 0pt;
width: 100%; }
table td {
font-family: sans-serif;
font-size: 14px;
vertical-align: top; }
.body {
background-color: #f6f6f6;
width: 100%; }
/* Set a max-width, and make it display as block so it will automatically stretch to that width, but will also shrink down on a phone or something */
.container {
display: block;
Margin: 0 auto !important;
/* makes it centered */
max-width: 580px;
padding: 10px;
width: auto !important;
width: 580px; }
/* This should also be a block element, so that it will fill 100% of the .container */
.content {
box-sizing: border-box;
display: block;
Margin: 0 auto;
max-width: 580px;
padding: 10px; }
.main {
background: #fff;
border-radius: 3px;
width: 100%; }
.wrapper {
box-sizing: border-box;
padding: 20px; }
.footer {
clear: both;
padding-top: 10px;
text-align: center;
width: 100%; }
.footer td,
.footer p,
.footer span,
.footer a {
color: #999999;
font-size: 12px;
text-align: center; }
h1,
h2,
h3,
h4 {
color: #000000;
font-family: sans-serif;
font-weight: 400;
line-height: 1.4;
margin: 0;
Margin-bottom: 30px; }
h1 {
font-size: 35px;
font-weight: 300;
text-align: center;
text-transform: capitalize; }
p,
ul,
ol {
font-family: sans-serif;
font-size: 14px;
font-weight: normal;
margin: 0;
Margin-bottom: 15px; }
p li,
ul li,
ol li {
list-style-position: inside;
margin-left: 5px; }
a {
color: #3498db;
text-decoration: underline; }
.btn {
box-sizing: border-box;
width: 100%; }
.btn > tbody > tr > td {
padding-bottom: 15px; }
.btn table {
width: auto; }
.btn table td {
background-color: #ffffff;
border-radius: 5px;
text-align: center; }
.btn a {
background-color: #ffffff;
border: solid 1px #3498db;
border-radius: 5px;
box-sizing: border-box;
color: #3498db;
cursor: pointer;
display: inline-block;
font-size: 14px;
font-weight: bold;
margin: 0;
padding: 12px 25px;
text-decoration: none;
text-transform: capitalize; }
.btn-primary table td {
background-color: #3498db; }
.btn-primary a {
background-color: #3498db;
border-color: #3498db;
color: #ffffff; }
.last {
margin-bottom: 0; }
.first {
margin-top: 0; }
.align-center {
text-align: center; }
.align-right {
text-align: right; }
.align-left {
text-align: left; }
.clear {
clear: both; }
.mt0 {
margin-top: 0; }
.mb0 {
margin-bottom: 0; }
.preheader {
color: transparent;
display: none;
height: 0;
max-height: 0;
max-width: 0;
opacity: 0;
overflow: hidden;
mso-hide: all;
visibility: hidden;
width: 0; }
.powered-by a {
text-decoration: none; }
hr {
border: 0;
border-bottom: 1px solid #f6f6f6;
Margin: 20px 0; }
@media only screen and (max-width: 620px) {
table[class=body] h1 {
font-size: 28px !important;
margin-bottom: 10px !important; }
table[class=body] p,
table[class=body] ul,
table[class=body] ol,
table[class=body] td,
table[class=body] span,
table[class=body] a {
font-size: 16px !important; }
table[class=body] .wrapper,
table[class=body] .article {
padding: 10px !important; }
table[class=body] .content {
padding: 0 !important; }
table[class=body] .container {
padding: 0 !important;
width: 100% !important; }
table[class=body] .main {
border-left-width: 0 !important;
border-radius: 0 !important;
border-right-width: 0 !important; }
table[class=body] .btn table {
width: 100% !important; }
table[class=body] .btn a {
width: 100% !important; }
table[class=body] .img-responsive {
height: auto !important;
max-width: 100% !important;
width: auto !important; }}
@media all {
.ExternalClass {
width: 100%; }
.ExternalClass,
.ExternalClass p,
.ExternalClass span,
.ExternalClass font,
.ExternalClass td,
.ExternalClass div {
line-height: 100%; }
.apple-link a {
color: inherit !important;
font-family: inherit !important;
font-size: inherit !important;
font-weight: inherit !important;
line-height: inherit !important;
text-decoration: none !important; }
.btn-primary table td:hover {
background-color: #34495e !important; }
.btn-primary a:hover {
background-color: #34495e !important;
border-color: #34495e !important; } }
</style>
</head>
<body class="">
<table border="0" cellpadding="0" cellspacing="0" class="body">
<tr>
<td> </td>
<td class="container">
<div class="content">
<!-- START CENTERED WHITE CONTAINER -->
<table class="main">
<!-- START MAIN CONTENT AREA -->
<tr>
<td class="wrapper">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td>
<p><?php echo "Dear " . $car_owner_data['firstName'] . " " . $car_owner_data['lastName']; ?> , </p>
<p>Car Drop off process for car plate number <?php echo $car_details['carPlateNumber']; ?> is going to start with in next 60 minute(s) . </p>
<p>Please try to be available on car Drop off location.</p>
</td>
</tr>
</table>
</td>
</tr>
<!-- END MAIN CONTENT AREA -->
</table>
<!-- START FOOTER -->
<div class="footer">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td class="content-block">
<span class="apple-link">Karpenisiou 30, Nicosia, 1077, Cyprus</span>
<span style="display:none"><br> Don't like these emails? <a href="">Unsubscribe</a>.</span>
</td>
</tr>
</table>
</div>
<!-- END FOOTER -->
<!-- END CENTERED WHITE CONTAINER --></div>
</td>
<td> </td>
</tr>
</table>
</body>
</html> |
#include "ei.h"
#include <gtk/gtk.h>
#include <gmodule.h>
#include <glade/glade.h>
#include <pango/pango.h>
/* starts the cnode, returns file descriptor*/
int gn_start_cnode(char **argv);
/* called when there's data on the erlang node socket */
gboolean gn_handle_read(GIOChannel *source,GIOCondition cond,gpointer data);
/* called by all signals */
void gn_sighandler(GtkWidget *widget);
void gn_erl(GtkWidget *widget);
void erl(GtkWidget *widget);
/* inits libglade */
gboolean gn_glade_init(char *filename);
/* marshalling functions (gtknode_marshal.c) */
void gn_wrap_ans(char* tag, ei_x_buff* xbuf);
void gn_enc_1_error(ei_x_buff *xbuf, char *err);
void gn_enc_2_error(ei_x_buff *xbuf, char *err);
void gn_put_tuple(ei_x_buff *xbuf, int N);
void gn_put_void(ei_x_buff *xbuf);
void gn_put_pid(ei_x_buff *xbuf, erlang_pid *p);
void gn_put_boolean(ei_x_buff *xbuf, int i);
void gn_put_double(ei_x_buff *xbuf, double d);
void gn_put_longlong(ei_x_buff *xbuf, long long l);
void gn_put_ulonglong(ei_x_buff *xbuf, unsigned long long l);
void gn_put_string(ei_x_buff *xbuf, char *p);
void gn_put_object(ei_x_buff *xbuf, GObject *w);
void gn_put_enum(ei_x_buff *xbuf, char* type_name, gint enum_val);
void gn_put_flags(ei_x_buff *xbuf, char* type_name, guint flags);
gboolean gn_get_arg_pid(ei_x_buff *xbuf, char *buff, int *index, erlang_pid *p);
gboolean gn_get_arg_gboolean(ei_x_buff *xbuf, char *B, int *I, gboolean *a);
gboolean gn_get_arg_char(ei_x_buff *xbuf, char *B, int *I, char **a);
gboolean gn_get_arg_gchar(ei_x_buff *xbuf, char *B, int *I, gchar **a);
gboolean <API key>(ei_x_buff *xbuf, char *B, int *I, gchar *a);
gboolean gn_get_arg_gint(ei_x_buff *xbuf, char *buff, int *index, gint *a);
gboolean gn_get_arg_int(ei_x_buff *xbuf, char *buff, int *index, int *a);
gboolean gn_get_arg_gint64(ei_x_buff *xbuf, char *B, int *I, gint64 *a);
gboolean gn_get_arg_glong(ei_x_buff *xbuf, char *B, int *I, glong *a);
gboolean gn_get_arg_guint16(ei_x_buff *xbuf, char *B, int *I, guint16 *a);
gboolean gn_get_arg_guint32(ei_x_buff *xbuf, char *B, int *I, guint32 *a);
gboolean gn_get_arg_guint(ei_x_buff *xbuf, char *B, int *I, guint *a);
gboolean gn_get_arg_gfloat(ei_x_buff *xbuf, char *B, int *I, gfloat *a);
gboolean gn_get_arg_gdouble(ei_x_buff *xbuf, char *B, int *I, gdouble *a);
gboolean gn_get_arg_enum(ei_x_buff *xbuf, char *B, int *I, gchar* ec, gint *i);
gboolean gn_get_arg_flags(ei_x_buff *xbuf, char *B, int *I,
gchar* type_name, gint *flags);
gboolean gn_get_arg_list(ei_x_buff *xbuf, char *B, int *I,
char* type, void** go);
gboolean gn_get_arg_object(ei_x_buff *xbuf, char *B, int *I,
GType type, GObject** go);
gboolean gn_get_arg_struct(ei_x_buff *xbuf, char *B, int *I,
char* type, void** go);
gboolean gn_check_object(ei_x_buff *xbuf, gchar* object_name,
GType type, GObject** object);
gboolean gn_check_struct(ei_x_buff *xbuf,
gchar* struct_name, gchar* struct_type, void** pp);
gboolean gn_check_arity(ei_x_buff *xbuf, int a1, int a2);
void gn_store_obj(gchar *bf, GObject *w);
gint gn_get_list(ei_x_buff *xbuf, char *buff, int *index);
gint gn_get_tuple(ei_x_buff *xbuf, char *buff, int *index);
gboolean gn_get_enum_name(const gchar *type_name, gint i, gchar *enum_name);
gboolean gn_get_enum_val(ei_x_buff *xbuf,
const gchar *type_name, gchar *enum_name, gint *i);
GType gn_GType_from_name(const gchar* name);
void gn_send(ei_x_buff *xbuf);
void gn_send_signal(const char *widgetname, const char *evtyp);
GtkWidget* <API key>(char* widget_name); |
#include <iostream>
#include <memory>
#include <list>
#include <vector>
#include <string>
#include "Astar.hpp"
#define debug
int main() {
Astar a;
Map warehouseMap;
#ifdef debug
std::vector<int> mapArray {1, 1, 1, 1, 0, 1, 0,
0, 0, 0, 1, 1, 0, 0,
0, 0, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 0};
#endif
int startPt, endPt;
int userChoice;
// menu
std::cout << "Astar Path Planning using C++" << std::endl;
std::cout << "Choose which map to use: " << std::endl;
std::cout << "1) default map" << std::endl;
std::cout << "2) load map" << std::endl;
std::cin >> userChoice;
if (userChoice == 1) {
warehouseMap.storeMap(mapArray);
warehouseMap.displayMap();
} else {
std::cout << "Please Enter the full path of the Map (.csv) file";
std::cout << std::endl;
std::string mapPath;
std::cin >> mapPath;
warehouseMap.loadMap(mapPath);
warehouseMap.displayMap();
}
std::cout << std::endl;
std::cout << "The numbers in the map indicate the node index ";
std::cout << "and \"X\" indicate obstacles. Enter the ";
std::cout << "node index of the Start and End points: ";
std::cout << std::endl;
std::cin >> startPt >> endPt;
bool success = a.createNodeList(warehouseMap, startPt-1, endPt-1);
if (success == true) {
int noOfSteps;
noOfSteps = a.planPath();
if (noOfSteps == 0) {
std::cout << "Start and End Point are same" << std::endl;
cv::Mat pathDrawing = a.displayMap();
cv::imshow("Planned Path", pathDrawing);
cv::waitKey(0);
} else if (noOfSteps == -1) {
std::cout << "The no possible path between the two points";
} else {
std::cout << "Number of Steps taken in the shortest path is: ";
std::cout << noOfSteps << std::endl;
cv::Mat pathDrawing = a.displayMap();
cv::imshow("Planned Path", pathDrawing);
cv::waitKey(0);
}
} else {
std::cout << "Enter a valid start and end point" << std::endl;
}
return 0;
} |
/*
ID: yezhiyo1
PROG: nuggets
LANG: C++
*/
#include <iostream>
#include <fstream>
#include <sstream>
#include <vector>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <string>
#include <algorithm>
#include <cmath>
#include <memory.h>
using namespace std;
ifstream fin("nuggets.in");
ofstream fout("nuggets.out");
int n;
const long long int M=2000000000;
vector <int> a;
int gcd(int x,int y){
if (y==0){
return x;
}
return gcd(y,x%y);
}
deque <bool> c;
int main (){
fin>>n;
a.resize(n);
for (int i=0;i<n;i++){
fin>>a[i];
}
sort(a.begin(),a.end());
int g=a[0];
for (int i=0;i<n;i++){
g=gcd(g,a[i]);
}
if (g!=1){
fout<<0<<endl;
return 0;
}
int b=0;
int y=-1;
c.resize(a[n-1]+1,false);
c[0]=true;
for (int i=1;i<c.size();i++){
c[i]=false;
for (int j=0;j<n;j++){
if (i-a[j]>=0){
if (c[i-a[j]]){
c[i]=true;
break;
}
}
}
if (!c[i]){
y=i;
}
}
int count=0;
for (int i=a[n-1]+1;i<=M;i++){
bool x=false;
for (int j=0;j<n;j++){
if (c[i-a[j]-b]){
x=true;
break;
}
}
if (!x){
y=i;
count=0;
}
else{
count++;
if (count>a[n-1]+2){
break;
}
}
c.pop_front();
c.push_back(x);
b++;
}
if (y==-1){
fout<<0<<endl;
return 0;
}
fout<<y<<endl;
return 0;
} |
from collections import OrderedDict
__author__ = 'adam'
from pytrademonster.constants import <API key>
from pytrademonster.objects import QuoteChain, QuoteOptionItem, QuoteItem
import xmltodict
class QuoteRequests(object):
'''
Create payload items for quote requests
'''
def <API key>(self, symbol):
xmlStr = <API key>.QuotesRequests.<API key>
xmlObj = xmltodict.parse(xmlStr)
xmlObj['getOptionChain']['symbol'] = symbol
return xmltodict.unparse(xmlObj)
def createQuotesPayload(self, symbolTypeDict):
xmlStr = <API key>.QuotesRequests.<API key>
xmlObj = xmltodict.parse(xmlStr)
itemObj = xmlObj['getQuotes']
itemObj['item'] = []
del itemObj['blank']
for symbol,instrumentType in symbolTypeDict.iteritems():
itemDict = OrderedDict()
itemDict['symbol'] = symbol
itemDict['instrumentType'] = instrumentType
itemObj['item'].append(itemDict)
return xmltodict.unparse(xmlObj)
class QuotesService(object):
def __init__(self, pyTradeMonster):
self.pyTradeMonster = pyTradeMonster
self.quoteRequests = QuoteRequests()
def getOptionChain(self, symbol):
url = <API key>.URLS.<API key>
payload = self.quoteRequests.<API key>(symbol)
return self.pyTradeMonster.doCall(url, payload)
def <API key>(self, strike, side):
option = QuoteOptionItem()
option.exchange = strike['exchange']
option.expiryDay = strike['instrument']['expireDayET']
option.expiryMonth = strike['instrument']['month']
option.expiryYear = strike['instrument']['year']
option.minTickValue = strike['minimumTickValue1']
option.multiplier = strike['multiplier']
option.opraRoot = strike['instrument']['opraCode']
option.reutersCode = strike['<API key>']
option.sharesPerContract = strike['sharesPerContract']
option.instrumentId = strike['instrumentId']
option.strike = strike['strikePrice']
option.symbol = strike['symbol']
option.side = side
option.tradeable = strike['instrument']['tradable']
return option
def <API key>(self, symbol):
'''
Return a list of option chains for various strikes/expirations for a given symbol
:param symbol:
:return:
'''
optionChainResponse = self.getOptionChain(symbol)
items = optionChainResponse[<API key>.ResponseRoots.<API key>]['item']
optionChain = []
for item in items:
quoteChain = QuoteChain()
quoteChain.rootTicker = symbol
quoteChain.daysToExpire = item['daysToExpire']
quoteChain.deliveryType = item['deliverableType']
quoteChain.exerciseStyle = item['exerciseStyle']
quoteChain.expirationType = item['expirationType']
quoteChain.expiryLabel = item['expiryLabel']
quoteChain.expiryType = item['expiryType']
allStrikes = item['option_Collection']
#iterate through each strike and append to the option dictionary
for strike in allStrikes:
strikeVal = strike['strike']
callOption = self.<API key>(strike['call'], <API key>.CALL_PUT.CALL)
putOption = self.<API key>(strike['put'], <API key>.CALL_PUT.PUT)
callKey = (strikeVal, <API key>.CALL_PUT.CALL)
putKey = (strikeVal, <API key>.CALL_PUT.PUT)
quoteChain.options[callKey] = callOption
quoteChain.options[putKey] = putOption
optionChain.append(quoteChain)
return optionChain
def getQuotes(self, symbolTypeDict):
'''
Retrieve multiple quotes from Trademonster
:param symbolTypeDict:
:return:
'''
url = <API key>.URLS.<API key>
payload = self.quoteRequests.createQuotesPayload(symbolTypeDict)
return self.pyTradeMonster.doCall(url, payload)
def <API key>(self, item):
'''
Helper for parsing quotes
:param item:
:return:
'''
quote = QuoteItem()
quote.symbol = item['symbol']
quote.askPrice = item['askPrice']['amount']
quote.askSize = item['askSize']
quote.bidPrice = item['bidPrice']['amount']
quote.bidSize = item['bidSize']
quote.closingMark = item['closingMark']['amount']
quote.currency = item['bidPrice']['currency']
quote.dividendType = item['divType'] if 'divType' in item else None
quote.dividend = item['dividend']['amount'] if 'dividend' in item else None
quote.dividendDate = item['dividendDate'] if 'dividendDate' in item else None
quote.highPrice = item['highPrice']['amount']
quote.impliedVolatility = item['impliedVolatility']
quote.instrumentType = item['instrumentType']
quote.lastTradedSize = item['lastSize']
quote.lastPrice = item['lastTradedPrice']['amount']
quote.lastTradedTimeMs = item['lastTradeTimeMillis'] if 'lastTradeTimeMillis' in item else None
quote.lowPrice = item['lastTradedPrice']
quote.openPrice = item['openPrice']['amount']
quote.previousClosePrice = item['previousClosePrice']['amount']
quote.volume = item['volume']
quote.yearHigh = item['yearHighPrice']['amount'] if 'yearHighPrice' in item else None
quote.yearLow = item['yearLowPrice']['amount'] if 'yearLowPrice' in item else None
return quote
def getParsedQuotes(self, symbolTypeDict):
'''
Convenience method for returning a dictionary of Quote Objects from various symbols
:param symbolTypeDict:
:return:
'''
quotesResponse = self.getQuotes(symbolTypeDict)
items = quotesResponse[<API key>.ResponseRoots.<API key>]['item']
quoteDict = {}
if isinstance(items, list):
for item in items:
quote = self.<API key>(item)
quoteDict[quote.symbol] = quote
else:
quote = self.<API key>(items)
quoteDict[quote.symbol] = quote
return quoteDict |
import { Component, TemplateRef, Input } from '@angular/core';
@Component( {
selector: 'tl-listbox-template',
template: `
<ng-container *ngTemplateOutlet="template; context: listContext"></ng-container>
`,
} )
export class TlListBoxTemplate {
@Input() template: TemplateRef<any>;
@Input() item: any;
@Input() index: boolean;
constructor() {}
get listContext() {
return { item: this.item, index: this.index };
}
} |
window.addEventListener('load', () => {
if ('serviceWorker' in navigator) {
navigator.serviceWorker.register('/service-worker.js');
} else {
console.warn('Service workers aren\'t supported in this browser.');
}
}); |
'use strict';
export const Words = new Mongo.Collection('Words');
if (Meteor.isServer) {
Meteor.publish('Words', () => {
return Words.find({});
});
} |
namespace EventImplementation.Models
{
using Contracts;
public delegate void <API key>(object sender, NameChangeEventArgs e);
public class Dispatcher : IDispatcher
{
private string name;
public event <API key> NameChange;
public string Name
{
get => this.name;
set
{
this.name = value;
this.OnNameChange(new NameChangeEventArgs(value));
}
}
private void OnNameChange(NameChangeEventArgs e)
{
this.NameChange?.Invoke(this, e);
}
}
} |
using FlaUI.Core.Input;
using FlaUI.Core.UITests.TestFramework;
using NUnit.Framework;
namespace FlaUI.Core.UITests.Elements
{
[TestFixture(AutomationType.UIA2, TestApplicationType.Wpf)]
[TestFixture(AutomationType.UIA3, TestApplicationType.Wpf)]
public class PopupTests : UITestBase
{
public PopupTests(AutomationType automationType, TestApplicationType appType)
: base(automationType, appType)
{
}
[Test]
public void CheckBoxInPopupTest()
{
var window = App.GetMainWindow(Automation);
var btn = window.FindFirstDescendant(cf => cf.ByAutomationId("PopupToggleButton1"));
btn.Click();
Wait.<API key>();
var popup = window.Popup;
Assert.That(popup, Is.Not.Null);
var popupChildren = popup.FindAllChildren();
Assert.That(popupChildren, Has.Length.EqualTo(1));
var check = popupChildren[0].AsCheckBox();
Assert.That(check.Text, Is.EqualTo("This is a popup"));
}
[Test]
public void MenuInPopupTest()
{
var window = App.GetMainWindow(Automation);
var btn = window.FindFirstDescendant(cf => cf.ByAutomationId("PopupToggleButton2"));
btn.Click();
Wait.<API key>();
var popup = window.Popup;
Assert.That(popup, Is.Not.Null);
var popupChildren = popup.FindAllChildren();
Assert.That(popupChildren, Has.Length.EqualTo(1));
var menu = popupChildren[0].AsMenu();
Assert.That(menu.Items, Has.Length.EqualTo(1));
var menuItem = menu.Items[0];
Assert.That(menuItem.Text, Is.EqualTo("Some MenuItem"));
}
}
} |
#!/usr/bin/perl
use warnings;
use strict;
open (FASTA, "/users/liype/maf/reference/HumanDB/hg18_knownGeneMrna.fa") or die "Error: cannot read from fastafile: $!\n";
my (%mrnaseq);
my ($curname, $curseq);
while (<FASTA>) {
s/[\r\n]+$
if (m/^>([\w\.]+)/) { #NEED TO CHECK THIS
if ($curseq) {
$mrnaseq{$curname} = $curseq;
}
$curname = $1;
$curseq = '';
} else {
$curseq .= $_;
}
$curseq and $mrnaseq{$curname} = $curseq; #process the last sequence
} |
package javax.lang.model.util;
import javax.annotation.processing.<API key>;
import javax.lang.model.SourceVersion;
import static javax.lang.model.SourceVersion.*;
/**
* A skeletal visitor of program elements with default behavior
* appropriate for the {@link SourceVersion#RELEASE_7 RELEASE_7}
* source version.
*
* <p> <b>WARNING:</b> The {@code ElementVisitor} interface
* implemented by this class may have methods added to it in the
* future to accommodate new, currently unknown, language structures
* added to future versions of the Java™ programming language.
* Therefore, methods whose names begin with {@code "visit"} may be
* added to this class in the future; to avoid incompatibilities,
* classes which extend this class should not declare any instance
* methods with names beginning with {@code "visit"}.
*
* <p>When such a new visit method is added, the default
* implementation in this class will be to call the {@link
* #visitUnknown visitUnknown} method. A new abstract element visitor
* class will also be introduced to correspond to the new language
* level; this visitor will have different default behavior for the
* visit method in question. When the new visitor is introduced, all
* or portions of this visitor may be deprecated.
*
* <p>Note that adding a default implementation of a new visit method
* in a visitor class will occur instead of adding a <em>default
* method</em> directly in the visitor interface since a Java SE 8
* language feature cannot be used to this version of the API since
* this version is required to be runnable on Java SE 7
* implementations. Future versions of the API that are only required
* to run on Java SE 8 and later may take advantage of default methods
* in this situation.
*
* @param <R> the return type of this visitor's methods. Use {@link
* Void} for visitors that do not need to return results.
* @param <P> the type of the additional parameter to this visitor's
* methods. Use {@code Void} for visitors that do not need an
* additional parameter.
*
* @see <API key>
* @see <API key>
* @since 1.7
*/
@<API key>(RELEASE_7)
public abstract class <API key><R, P> extends <API key><R, P> {
/**
* Constructor for concrete subclasses to call.
*/
protected <API key>(){
super();
}
} |
# NATS-Bench: Benchmarking NAS Algorithms for Architecture Topology and Size #
# The history of benchmark files are as follows, #
# where the format is (the name is NATS-tss-[version]-[md5].pickle.pbz2) #
# [2020.08.31] NATS-tss-v1_0-3ffb9.pickle.pbz2 #
# pylint: disable=line-too-long
"""The API for topology search space in NATS-Bench."""
import collections
import copy
import os
import random
from typing import Any, Dict, List, Optional, Text, Union
from nats_bench.api_utils import ArchResults
from nats_bench.api_utils import NASBenchMetaAPI
from nats_bench.api_utils import get_torch_home
from nats_bench.api_utils import nats_is_dir
from nats_bench.api_utils import nats_is_file
from nats_bench.api_utils import PICKLE_EXT
from nats_bench.api_utils import pickle_load
from nats_bench.api_utils import time_string
from nats_bench.genotype_utils import <API key>
ALL_BASE_NAMES = ["NATS-tss-v1_0-3ffb9"]
def print_information(information, extra_info=None, show=False):
"""print out the information of a given ArchResults."""
dataset_names = information.get_dataset_names()
strings = [
information.arch_str,
"datasets : {:}, extra-info : {:}".format(dataset_names, extra_info),
]
def metric2str(loss, acc):
return "loss = {:.3f} & top1 = {:.2f}%".format(loss, acc)
for dataset in dataset_names:
metric = information.get_compute_costs(dataset)
flop, param, latency = metric["flops"], metric["params"], metric["latency"]
str1 = "{:14s} FLOP={:6.2f} M, Params={:.3f} MB, latency={:} ms.".format(
dataset,
flop,
param,
"{:.2f}".format(latency * 1000)
if latency is not None and latency > 0
else None,
)
train_info = information.get_metrics(dataset, "train")
if dataset == "cifar10-valid":
valid_info = information.get_metrics(dataset, "x-valid")
str2 = "{:14s} train : [{:}], valid : [{:}]".format(
dataset,
metric2str(train_info["loss"], train_info["accuracy"]),
metric2str(valid_info["loss"], valid_info["accuracy"]),
)
elif dataset == "cifar10":
test__info = information.get_metrics(dataset, "ori-test")
str2 = "{:14s} train : [{:}], test : [{:}]".format(
dataset,
metric2str(train_info["loss"], train_info["accuracy"]),
metric2str(test__info["loss"], test__info["accuracy"]),
)
else:
valid_info = information.get_metrics(dataset, "x-valid")
test__info = information.get_metrics(dataset, "x-test")
str2 = "{:14s} train : [{:}], valid : [{:}], test : [{:}]".format(
dataset,
metric2str(train_info["loss"], train_info["accuracy"]),
metric2str(valid_info["loss"], valid_info["accuracy"]),
metric2str(test__info["loss"], test__info["accuracy"]),
)
strings += [str1, str2]
if show:
print("\n".join(strings))
return strings
class NATStopology(NASBenchMetaAPI):
"""This is the class for the API of topology search space in NATS-Bench."""
def __init__(
self,
file_path_or_dict: Optional[Union[Text, Dict[Text, Any]]] = None,
fast_mode: bool = False,
verbose: bool = True,
):
"""The initialization function that takes the dataset file path (or a dict loaded from that path) as input."""
self._all_base_names = ALL_BASE_NAMES
self.filename = None
self._search_space_name = "topology"
self._fast_mode = fast_mode
self._archive_dir = None
self._full_train_epochs = 200
self.reset_time()
if file_path_or_dict is None:
if self._fast_mode:
self._archive_dir = os.path.join(
get_torch_home(), "{:}-simple".format(ALL_BASE_NAMES[-1])
)
else:
file_path_or_dict = os.path.join(
get_torch_home(), "{:}.{:}".format(ALL_BASE_NAMES[-1], PICKLE_EXT)
)
print(
"{:} Try to use the default NATS-Bench (topology) path from "
"fast_mode={:} and path={:}.".format(
time_string(), self._fast_mode, file_path_or_dict
)
)
if isinstance(file_path_or_dict, str):
file_path_or_dict = str(file_path_or_dict)
if verbose:
print(
"{:} Try to create the NATS-Bench (topology) api "
"from {:} with fast_mode={:}".format(
time_string(), file_path_or_dict, fast_mode
)
)
if not nats_is_file(file_path_or_dict) and not nats_is_dir(
file_path_or_dict
):
raise ValueError(
"{:} is neither a file or a dir.".format(file_path_or_dict)
)
self.filename = os.path.basename(file_path_or_dict)
if fast_mode:
if nats_is_file(file_path_or_dict):
raise ValueError(
"fast_mode={:} must feed the path for directory "
": {:}".format(fast_mode, file_path_or_dict)
)
else:
self._archive_dir = file_path_or_dict
else:
if nats_is_dir(file_path_or_dict):
raise ValueError(
"fast_mode={:} must feed the path for file "
": {:}".format(fast_mode, file_path_or_dict)
)
else:
file_path_or_dict = pickle_load(file_path_or_dict)
elif isinstance(file_path_or_dict, dict):
file_path_or_dict = copy.deepcopy(file_path_or_dict)
self.verbose = verbose
if isinstance(file_path_or_dict, dict):
keys = ("meta_archs", "arch2infos", "evaluated_indexes")
for key in keys:
if key not in file_path_or_dict:
raise ValueError("Can not find key[{:}] in the dict".format(key))
self.meta_archs = copy.deepcopy(file_path_or_dict["meta_archs"])
# NOTE(xuanyidong): This is a dict mapping each architecture to a dict,
# where the key is #epochs and the value is ArchResults
self.arch2infos_dict = collections.OrderedDict()
self._avaliable_hps = set()
for xkey in sorted(list(file_path_or_dict["arch2infos"].keys())):
all_infos = file_path_or_dict["arch2infos"][xkey]
hp2archres = collections.OrderedDict()
for hp_key, results in all_infos.items():
hp2archres[hp_key] = ArchResults.<API key>(results)
self._avaliable_hps.add(
hp_key
) # save the avaliable hyper-parameter
self.arch2infos_dict[xkey] = hp2archres
self.evaluated_indexes = set(file_path_or_dict["evaluated_indexes"])
elif self.archive_dir is not None:
benchmark_meta = pickle_load(
"{:}/meta.{:}".format(self.archive_dir, PICKLE_EXT)
)
self.meta_archs = copy.deepcopy(benchmark_meta["meta_archs"])
self.arch2infos_dict = collections.OrderedDict()
self._avaliable_hps = set()
self.evaluated_indexes = set()
else:
raise ValueError(
"file_path_or_dict [{:}] must be a dict or archive_dir "
"must be set".format(type(file_path_or_dict))
)
self.archstr2index = {}
for idx, arch in enumerate(self.meta_archs):
if arch in self.archstr2index:
raise ValueError(
"This [{:}]-th arch {:} already in the "
"dict ({:}).".format(idx, arch, self.archstr2index[arch])
)
self.archstr2index[arch] = idx
if self.verbose:
print(
"{:} Create NATS-Bench (topology) done with {:}/{:} architectures "
"avaliable.".format(
time_string(), len(self.evaluated_indexes), len(self.meta_archs)
)
)
@property
def is_size(self):
return False
@property
def is_topology(self):
return True
@property
def <API key>(self):
return 200
def get_unique_str(self, arch):
"""Return a unique string for the isomorphism architectures.
Args:
arch: it can be an architecture index or an architecture string.
Returns:
the unique string.
"""
index = self.query_index_by_arch(
arch
) # To avoid the arch is a string or an instance of a arch object
arch_str = self.meta_archs[index]
structure = <API key>(arch_str)
return structure.to_unique_str(consider_zero=True)
def <API key>(self, arch, hp: Text = "12"):
"""Query the information of a specific architecture.
Args:
arch: it can be an architecture index or an architecture string.
hp: the hyperparamete indicator, could be 12 or 200. The difference
between these three configurations are the number of training epochs.
Returns:
ArchResults instance
"""
if self.verbose:
print(
"{:} Call <API key> with arch={:}"
"and hp={:}".format(time_string(), arch, hp)
)
return self.<API key>(arch, hp, print_information)
def get_more_info(
self, index, dataset, iepoch=None, hp: Text = "12", is_random: bool = True
):
"""Return the metric for the `index`-th architecture."""
if self.verbose:
print(
"{:} Call the get_more_info function with index={:}, dataset={:}, "
"iepoch={:}, hp={:}, and is_random={:}.".format(
time_string(), index, dataset, iepoch, hp, is_random
)
)
index = self.query_index_by_arch(
index
) # To avoid the input is a string or an instance of a arch object
self._prepare_info(index)
if index not in self.arch2infos_dict:
raise ValueError("Did not find {:} from arch2infos_dict.".format(index))
archresult = self.arch2infos_dict[index][str(hp)]
# if randomly select one trial, select the seed at first
if isinstance(is_random, bool) and is_random:
seeds = archresult.get_dataset_seeds(dataset)
is_random = random.choice(seeds)
# collect the training information
train_info = archresult.get_metrics(
dataset, "train", iepoch=iepoch, is_random=is_random
)
total = train_info["iepoch"] + 1
xinfo = {
"train-loss": train_info["loss"],
"train-accuracy": train_info["accuracy"],
"train-per-time": train_info["all_time"] / total
if train_info["all_time"] is not None
else None,
"train-all-time": train_info["all_time"],
}
# collect the evaluation information
if dataset == "cifar10-valid":
valid_info = archresult.get_metrics(
dataset, "x-valid", iepoch=iepoch, is_random=is_random
)
try:
test_info = archresult.get_metrics(
dataset, "ori-test", iepoch=iepoch, is_random=is_random
)
except Exception as unused_e: # pylint: disable=broad-except
test_info = None
valtest_info = None
xinfo[
"comment"
] = "In this dict, train-loss/accuracy/time is the metric on the train set of CIFAR-10. The test-loss/accuracy/time is the performance of the CIFAR-10 test set after training on the train set by {:} epochs. The per-time and total-time indicate the per epoch and total time costs, respectively.".format(
hp
)
else:
if dataset == "cifar10":
xinfo[
"comment"
] = "In this dict, train-loss/accuracy/time is the metric on the train+valid sets of CIFAR-10. The test-loss/accuracy/time is the performance of the CIFAR-10 test set after training on the train+valid sets by {:} epochs. The per-time and total-time indicate the per epoch and total time costs, respectively.".format(
hp
)
try: # collect results on the proposed test set
if dataset == "cifar10":
test_info = archresult.get_metrics(
dataset, "ori-test", iepoch=iepoch, is_random=is_random
)
else:
test_info = archresult.get_metrics(
dataset, "x-test", iepoch=iepoch, is_random=is_random
)
except Exception as unused_e: # pylint: disable=broad-except
test_info = None
try: # collect results on the proposed validation set
valid_info = archresult.get_metrics(
dataset, "x-valid", iepoch=iepoch, is_random=is_random
)
except Exception as unused_e: # pylint: disable=broad-except
valid_info = None
try:
if dataset != "cifar10":
valtest_info = archresult.get_metrics(
dataset, "ori-test", iepoch=iepoch, is_random=is_random
)
else:
valtest_info = None
except Exception as unused_e: # pylint: disable=broad-except
valtest_info = None
if valid_info is not None:
xinfo["valid-loss"] = valid_info["loss"]
xinfo["valid-accuracy"] = valid_info["accuracy"]
xinfo["valid-per-time"] = (
valid_info["all_time"] / total
if valid_info["all_time"] is not None
else None
)
xinfo["valid-all-time"] = valid_info["all_time"]
if test_info is not None:
xinfo["test-loss"] = test_info["loss"]
xinfo["test-accuracy"] = test_info["accuracy"]
xinfo["test-per-time"] = (
test_info["all_time"] / total
if test_info["all_time"] is not None
else None
)
xinfo["test-all-time"] = test_info["all_time"]
if valtest_info is not None:
xinfo["valtest-loss"] = valtest_info["loss"]
xinfo["valtest-accuracy"] = valtest_info["accuracy"]
xinfo["valtest-per-time"] = (
valtest_info["all_time"] / total
if valtest_info["all_time"] is not None
else None
)
xinfo["valtest-all-time"] = valtest_info["all_time"]
return xinfo
def show(self, index: int = -1) -> None:
"""This function will print the information of a specific (or all) architecture(s)."""
self._show(index, print_information)
@staticmethod
def str2lists(arch_str: Text) -> List[Any]:
"""Shows how to read the string-based architecture encoding.
Args:
arch_str: the input is a string indicates the architecture topology, such as
|nor_conv_1x1~0|+|none~0|none~1|+|none~0|none~1|skip_connect~2|
Returns:
a list of tuple, contains multiple (op, input_node_index) pairs.
[USAGE]
It is the same as the `str2structure` func in AutoDL-Projects:
`github.com/D-X-Y/AutoDL-Projects/lib/models/cell_searchs/genotypes.py`
arch = api.str2lists( '|nor_conv_1x1~0|+|none~0|none~1|+|none~0|none~1|skip_connect~2|' )
print ('there are {:} nodes in this arch'.format(len(arch)+1)) # arch is a list
for i, node in enumerate(arch):
print('the {:}-th node is the sum of these {:} nodes with op: {:}'.format(i+1, len(node), node))
"""
node_strs = arch_str.split("+")
genotypes = []
for unused_i, node_str in enumerate(node_strs):
inputs = list(
filter(lambda x: x != "", node_str.split("|"))
) # pylint: disable=<API key>
for xinput in inputs:
assert len(xinput.split("~")) == 2, "invalid input length : {:}".format(
xinput
)
inputs = (xi.split("~") for xi in inputs)
input_infos = tuple((op, int(idx)) for (op, idx) in inputs)
genotypes.append(input_infos)
return genotypes
@staticmethod
def str2matrix(
arch_str: Text,
search_space: List[Text] = (
"none",
"skip_connect",
"nor_conv_1x1",
"nor_conv_3x3",
"avg_pool_3x3",
),
):
import numpy as np
node_strs = arch_str.split("+")
num_nodes = len(node_strs) + 1
matrix = np.zeros((num_nodes, num_nodes))
for i, node_str in enumerate(node_strs):
inputs = list(
filter(lambda x: x != "", node_str.split("|"))
) # pylint: disable=<API key>
for xinput in inputs:
assert len(xinput.split("~")) == 2, "invalid input length : {:}".format(
xinput
)
for xi in inputs:
op, idx = xi.split("~")
if op not in search_space:
raise ValueError(
"this op ({:}) is not in {:}".format(op, search_space)
)
op_idx, node_idx = search_space.index(op), int(idx)
matrix[i + 1, node_idx] = op_idx
return matrix |
"use strict";
describe('Thermostat', function() {
var thermostat;
beforeEach(function() {
// $('body').append('<h1>hello</h1>');
thermostat = new Thermostat();
});
describe('by default', function() {
it('is set to 20 degrees', function() {
expect(thermostat.temperature).toEqual(20);
});
it('power saving mode will be on', function() {
expect(thermostat.isPowerSaverOn).toBe(true)
});
it('can increase the temperature by one degree', function() {
expect(thermostat.increaseTemperature()).toEqual(21);
});
it('can decrease the temperature by one degree', function() {
expect(thermostat.decreaseTemperature()).toEqual(19);
});
it('minimum temperature is set to 10 degrees', function() {
expect(thermostat.minTemperature).toEqual(10);
});
it('cannot go below minimum temperature', function() {
expect(thermostat.<API key>(11)).toEqual(10);
});
it('if power saving is on the maximum temperature is 25 degrees', function() {
expect(thermostat.<API key>(6)).toEqual(25);
});
it('if power saving is off maximum temperature is 32 degrees', function() {
thermostat.isPowerSaverOn = false;
expect(thermostat.<API key>(20)).toEqual(32);
});
it('thermostat can be reset to a default temperature', function() {
thermostat.increaseTemperature(5);
expect(thermostat.reset()).toEqual(20);
});
});
describe('custom options', function() {
it('can increase temperature by 2 degrees', function() {
expect(thermostat.<API key>(2)).toEqual(22);
});
it('can decrease temperature by 5', function() {
expect(thermostat.<API key>(5)).toEqual(15);
});
it('can turn on power saver', function() {
thermostat.turnOffPowerSaver();
thermostat.turnOnPowerSaver()
expect(thermostat.isPowerSaverOn).toBe(true);
});
it('can turn off power saver', function() {
thermostat.turnOffPowerSaver();
expect(thermostat.isPowerSaverOn).toBe(false);
});
});
}); |
mavis.Arrow = function(_axes, _params) {
this.axes = _axes;
this.start = new mavis.Vector(0, 0);
this.end = new mavis.Vector(1, 1);
this.count = 1; //Number of ticks
this.strokeStyle = "black";
this.lineWidth = 4;
this.strokeAlpha = 1;
for (var key in _params) this[key] = _params[key];
}
mavis.Arrow.prototype.draw = function(ctx) {
ctx.save();
this.axes.applyClip(ctx);
ctx.globalAlpha = this.strokeAlpha;
ctx.lineWidth = this.lineWidth;
ctx.strokeStyle = this.strokeStyle;
//Find the mid point of the line
var p1 = this.axes.toPixel(this.start);
var p2 = this.axes.toPixel(this.end);
var pmid = new mavis.Vector((p1.x+p2.x)/2, (p1.y+p2.y)/2);
//Find the unit vector in the direction of the line
var length = Math.sqrt((p1.x-p2.x)*(p1.x-p2.x) + (p1.y-p2.y)*(p1.y-p2.y));
var vector = new mavis.Vector((p1.x-p2.x)/length, (p1.y-p2.y)/length);
var pvector = new mavis.Vector(vector.y, -vector.x);
if (this.count==1) {
this.drawArrow(ctx, pmid, vector, pvector);
}
else if (this.count==2) {
this.drawArrow(ctx, new mavis.Vector(pmid.x - vector.x*this.lineWidth*1.5, pmid.y - vector.y*this.lineWidth*1.5), vector, pvector);
this.drawArrow(ctx, new mavis.Vector(pmid.x + vector.x*this.lineWidth*1.5, pmid.y + vector.y*this.lineWidth*1.5), vector, pvector);
} else {
this.drawArrow(ctx, new mavis.Vector(pmid.x - vector.x*this.lineWidth*3, pmid.y - vector.y*this.lineWidth*3), vector, pvector);
this.drawArrow(ctx, pmid, vector, pvector);
this.drawArrow(ctx, new mavis.Vector(pmid.x + vector.x*this.lineWidth*3, pmid.y + vector.y*this.lineWidth*3), vector, pvector);
}
ctx.restore();
}
mavis.Arrow.prototype.drawArrow = function(ctx, pt, v, pv) {
ctx.beginPath();
ctx.moveTo(pt.x+(3*v.x +3*pv.x)*this.lineWidth, pt.y+(3*v.y +3*pv.y)*this.lineWidth);
ctx.lineTo(pt.x, pt.y);
ctx.lineTo(pt.x+(3*v.x -3*pv.x)*this.lineWidth, pt.y+(3*v.y -3*pv.y)*this.lineWidth);
ctx.stroke();
} |
import { directive as vDragged } from 'v-dragged'
export default {
directives: {
dragged: vDragged
}
} |
<?php
echo "<table class='w3-table-all'>
<tr class='w3-blue'>
<th>Usuario</th>
<th>Materia</th>
<th>Nota</th>
<th>Fecha</th>
<th>Opciones</th>
</tr>";
foreach ($cursadas as $row){
echo "<tr>";
echo "<td>" . $alumno;
echo "<td>" . $row['nombre'];
echo "<td>" . '<input type="text" class="form-control" id="nota" name="nota" placeholder="'. $row['nota'] . '" onKeyPress="return validarNumeros(event);" onpaste="return false"/>';
echo "<td>" . $row['fecha'];
echo "<td>" . '<button type="submit" id="'. $row['id'] . '" onClick="aceptar(this.id, nota.value);"> Aceptar </button>';
echo "</tr>";
} |
require 'hadoop/bcftools/errors'
module Hadoop::Bcftools
# HdfsUploader uploads files from local to HDFS.
# @author Wei-Ming Wu
class HdfsUploader
include Errors
# Creates a HdfsUploader.
# @param [String] hadoop_cmd the path of Hadoop command
def initialize hadoop_cmd
@hadoop_cmd = hadoop_cmd
end
# Uploads files from local to HDFS.
# @param [String] local where local files are located
# @param [String] hdfs where files should be uploaded to HDFS
# @param [Array] files specified files to be uploaded
def upload_files local, hdfs, files
local_files = Dir[File.join local, '*'].map { |f| File.basename f }
remote_files = ls_remote(hdfs).map { |f| File.basename f }
unuploaded_files = files - remote_files
if (unuploaded_files - local_files).any?
raise <API key>,
"Files: #{unuploaded_files - local_files} " <<
"can't be found on either local or hdfs."
end
(files - (files - remote_files)).each { |f| puts "File: #{f} existed on HDFS." }
upload_hdfs hdfs, unuploaded_files.map { |f| File.join local, f }
end
private
def upload_hdfs hdfs, files
puts 'Uploading files to HDFS...'
files.each do |f|
puts "Uploading file:
system "#{@hadoop_cmd} fs -put #{f} #{File.join hdfs, File.basename(f)}"
end
puts 'Done.'
end
def ls_remote hdfs
result = `#{@hadoop_cmd} fs -ls #{hdfs}`
result.split("\n").drop(1).map { |line| line.split(/ /).slice_before(/^\//).to_a.last.join(' ') }
end
end
end |
#include "CEGUI/Window.h"
#include "CEGUI/Exceptions.h"
#include "CEGUI/WindowManager.h"
#include "CEGUI/System.h"
#include "CEGUI/FontManager.h"
#include "CEGUI/ImageManager.h"
#include "CEGUI/Cursor.h"
#include "CEGUI/CoordConverter.h"
#include "CEGUI/<API key>.h"
#include "CEGUI/<API key>.h"
#include "CEGUI/widgets/Tooltip.h"
#include "CEGUI/falagard/WidgetLookManager.h"
#include "CEGUI/falagard/WidgetLookFeel.h"
#include "CEGUI/falagard/WidgetComponent.h"
#include "CEGUI/GeometryBuffer.h"
#include "CEGUI/GUIContext.h"
#include "CEGUI/RenderingContext.h"
#include "CEGUI/RenderingWindow.h"
#include "CEGUI/GlobalEventSet.h"
#include "CEGUI/SharedStringStream.h"
#if defined (CEGUI_USE_FRIBIDI)
#include "CEGUI/<API key>.h"
#elif defined (CEGUI_USE_MINIBIDI)
#include "CEGUI/<API key>.h"
#endif
#if defined(CEGUI_USE_RAQM)
#include "CEGUI/RaqmTextData.h"
#endif
#include <algorithm>
#include <iterator>
#include <stdio.h>
#include <queue>
#if defined(_MSC_VER)
# pragma warning(push)
# pragma warning(disable : 4355)
#endif
// Start of CEGUI namespace section
namespace CEGUI
{
const String Window::AlphaPropertyName("Alpha");
const String Window::<API key>("AlwaysOnTop");
const String Window::<API key>("ClippedByParent");
const String Window::<API key>("DestroyedByParent");
const String Window::<API key>("Disabled");
const String Window::FontPropertyName("Font");
const String Window::IDPropertyName("ID");
const String Window::<API key>("InheritsAlpha");
const String Window::<API key>("CursorImage");
const String Window::VisiblePropertyName("Visible");
const String Window::ActivePropertyName("Active");
const String Window::<API key>("RestoreOldCapture");
const String Window::TextPropertyName("Text");
const String Window::<API key>("ZOrderingEnabled");
const String Window::<API key>("<API key>");
const String Window::<API key>("AutoRepeatDelay");
const String Window::<API key>("AutoRepeatRate");
const String Window::<API key>("<API key>");
const String Window::<API key>("TooltipType");
const String Window::<API key>("TooltipText");
const String Window::<API key>("InheritsTooltipText");
const String Window::<API key>("RiseOnClickEnabled");
const String Window::<API key>("<API key>");
const String Window::<API key>("DragDropTarget");
const String Window::<API key>("<API key>");
const String Window::<API key>("<API key>");
const String Window::<API key>("TextParsingEnabled");
const String Window::MarginPropertyName("MarginProperty");
const String Window::<API key>("UpdateMode");
const String Window::<API key>("<API key>");
const String Window::<API key>("AutoWindow");
const String Window::EventNamespace("Window");
const String Window::EventUpdated ("Updated");
const String Window::EventTextChanged("TextChanged");
const String Window::EventFontChanged("FontChanged");
const String Window::EventAlphaChanged("AlphaChanged");
const String Window::EventIDChanged("IDChanged");
const String Window::EventActivated("Activated");
const String Window::EventDeactivated("Deactivated");
const String Window::EventShown("Shown");
const String Window::EventHidden("Hidden");
const String Window::EventEnabled("Enabled");
const String Window::EventDisabled("Disabled");
const String Window::<API key>( "<API key>" );
const String Window::<API key>("<API key>");
const String Window::<API key>( "<API key>" );
const String Window::<API key>("AlwaysOnTopChanged");
const String Window::<API key>( "InputCaptureGained" );
const String Window::<API key>( "InputCaptureLost" );
const String Window::EventInvalidated( "Invalidated" );
const String Window::<API key>( "RenderingStarted" );
const String Window::EventRenderingEnded( "RenderingEnded" );
const String Window::<API key>( "DestructionStarted" );
const String Window::<API key>("DragDropItemEnters");
const String Window::<API key>("DragDropItemLeaves");
const String Window::<API key>("DragDropItemDropped");
const String Window::<API key>("<API key>");
const String Window::<API key>("<API key>");
const String Window::<API key>("TextParsingChanged");
const String Window::EventMarginChanged("MarginChanged");
const String Window::<API key>("CursorEntersArea");
const String Window::<API key>("CursorLeavesArea");
const String Window::<API key>("CursorEntersSurface");
const String Window::<API key>("CursorLeavesSurface");
const String Window::EventCursorMove("CursorMove");
const String Window::<API key>("CursorPressHold");
const String Window::EventCursorActivate("CursorActivate");
const String Window::EventCharacterKey("CharacterKey");
const String Window::EventScroll("Scroll");
const String Window::EventSemanticEvent("SemanticEvent");
// XML element and attribute names that relate to Window.
const String Window::<API key>("Window");
const String Window::<API key>("AutoWindow");
const String Window::<API key>("UserString");
const String Window::<API key>("type");
const String Window::<API key>("name");
const String Window::<API key>("namePath");
const String Window::<API key>("name");
const String Window::<API key>("value");
const String Window::TooltipNameSuffix("__auto_tooltip__");
<API key> Window::d_basicStringParser;
<API key> Window::<API key>;
Window::<API key> Window::<API key>;
Window::LookNFeelProperty Window::d_lookNFeelProperty;
Window::<API key>::<API key>() : TplWindowProperty<Window,String>(
"WindowRenderer",
"Property to get/set the assigned WindowRenderer object type. For "
"advanced use only. See the api reference for Window::setWindowRenderer "
"for more information. "
"Value is a string.",
"Window", &Window::setWindowRenderer,&Window::<API key>, "")
{}
void Window::<API key>::writeXMLToStream(const PropertyReceiver* receiver,
XMLSerializer& xml_stream) const
{
const Window* wnd = static_cast<const Window*>(receiver);
if (!<API key>::getSingleton().<API key>(wnd->getType()))
Property::writeXMLToStream(receiver, xml_stream);
}
Window::LookNFeelProperty::LookNFeelProperty() : TplWindowProperty<Window,String>(
"LookNFeel",
"Property to get/set the assigned look'n'feel. For advanced use only. See "
"the api reference for Window::setLookNFeel for more informaton. "
"Value is a string.",
"Window", &Window::setLookNFeel,&Window::getLookNFeel, "")
{}
void Window::LookNFeelProperty::writeXMLToStream(const PropertyReceiver* receiver,
XMLSerializer& xml_stream) const
{
const Window* wnd = static_cast<const Window*>(receiver);
if (!<API key>::getSingleton().<API key>(wnd->getType()))
Property::writeXMLToStream(receiver, xml_stream);
}
Window::Window(const String& type, const String& name):
NamedElement(name),
// basic types and initial window name
d_type(type),
d_autoWindow(false),
// basic state
d_initialising(false),
<API key>(false),
d_enabled(true),
d_visible(true),
d_active(false),
// parent related fields
d_destroyedByParent(true),
// clipping options
d_clippedByParent(true),
// rendering components and options
d_windowRenderer(nullptr),
d_surface(nullptr),
d_needsRedraw(true),
<API key>(false),
<API key>(false),
d_cursor(nullptr),
// alpha transparency set up
d_alpha(1.0f),
d_inheritsAlpha(true),
// cursor input capture set up
d_oldCapture(nullptr),
d_restoreOldCapture(false),
<API key>(false),
// text system set up
d_font(nullptr),
#if defined (CEGUI_USE_FRIBIDI)
d_bidiVisualMapping(new <API key>),
d_bidiDataValid(false),
#elif defined (CEGUI_USE_MINIBIDI)
d_bidiVisualMapping(new <API key>),
d_bidiDataValid(false),
#elif defined (CEGUI_BIDI_SUPPORT)
#error "BIDI Configuration is inconsistant, check your config!"
#endif
#ifdef CEGUI_USE_RAQM
d_raqmTextData(nullptr),
#endif
<API key>(false),
<API key>(nullptr),
<API key>(true),
// margin
d_margin(UBox(UDim(0, 0))),
// user specific data
d_ID(0),
d_userData(nullptr),
// z-order related options
d_alwaysOnTop(false),
<API key>(true),
d_zOrderingEnabled(true),
<API key>(false),
d_autoRepeat(false),
d_repeatDelay(0.3f),
d_repeatRate(0.06f),
<API key>(CursorInputSource::NotSpecified),
d_repeating(false),
d_repeatElapsed(0.0f),
// drag and drop
d_dragDropTarget(true),
// tool tip related
d_customTip(nullptr),
d_weOwnTip(false),
d_inheritsTipText(true),
// XML writing options
d_allowWriteXML(true),
// initialise area cache rects
d_outerRectClipper(0, 0, 0, 0),
d_innerRectClipper(0, 0, 0, 0),
d_hitTestRect(0, 0, 0, 0),
// cached pixel rect validity flags
<API key>(false),
<API key>(false),
d_hitTestRectValid(false),
// Initial update mode
d_updateMode(WindowUpdateMode::Visible),
// Don't propagate cursor inputs by default.
<API key>(false),
d_guiContext(nullptr),
d_containsPointer(false),
d_isFocused(false),
<API key>(
GlobalEventSet::getSingleton().subscribeEvent(
"Font/RenderSizeChanged",
Event::Subscriber(&Window::<API key>, this)))
{
#ifdef CEGUI_USE_RAQM
d_raqmTextData = new RaqmTextData();
#endif
// add properties
addWindowProperties();
}
Window::~Window(void)
{
// most cleanup actually happened earlier in Window::destroy.
<API key>();
#ifdef CEGUI_BIDI_SUPPORT
delete d_bidiVisualMapping;
#endif
}
const String& Window::getType(void) const
{
return d_falagardType.empty() ? d_type : d_falagardType;
}
bool Window::isDisabled() const
{
return !d_enabled;
}
bool Window::isEffectiveDisabled() const
{
const bool parent_disabled = !d_parent ? false : getParent()->isEffectiveDisabled();
return !d_enabled || parent_disabled;
}
bool Window::isVisible() const
{
return d_visible;
}
bool Window::isEffectiveVisible() const
{
const bool parent_visible = !d_parent ? true : getParent()->isEffectiveVisible();
return d_visible && parent_visible;
}
bool Window::isActive(void) const
{
const bool parent_active = !d_parent ? true : getParent()->isActive();
return d_active && parent_active;
}
bool Window::isChild(unsigned int ID) const
{
const size_t child_count = getChildCount();
for (size_t i = 0; i < child_count; ++i)
if (getChildAtIdx(i)->getID() == ID)
return true;
return false;
}
bool Window::isChildRecursive(unsigned int ID) const
{
const size_t child_count = getChildCount();
for (size_t i = 0; i < child_count; ++i)
if (getChildAtIdx(i)->getID() == ID || getChildAtIdx(i)->isChildRecursive(ID))
return true;
return false;
}
Window* Window::getChild(unsigned int ID) const
{
const size_t child_count = getChildCount();
for (size_t i = 0; i < child_count; ++i)
if (getChildAtIdx(i)->getID() == ID)
return getChildAtIdx(i);
std::stringstream& sstream = SharedStringstream::GetPreparedStream();
sstream << std::hex << ID << std::dec;
throw <API key>("A Window with ID: '" +
sstream.str() + "' is not attached to Window '" + d_name + "'.");
}
Window* Window::getChildRecursive(unsigned int ID) const
{
const size_t child_count = getChildCount();
std::queue<Element*> ElementsToSearch;
for (size_t i = 0; i < child_count; ++i) // load all children into the queue
{
Element* child = <API key>(i);
ElementsToSearch.push(child);
}
while (!ElementsToSearch.empty()) // breadth-first search for the child to find
{
Element* child = ElementsToSearch.front();
ElementsToSearch.pop();
Window* window = dynamic_cast<Window*>(child);
if (window)
{
if (window->getID() == ID)
{
return window;
}
}
const size_t element_child_count = child->getChildCount();
for(size_t i = 0; i < element_child_count; ++i)
{
ElementsToSearch.push(child-><API key>(i));
}
}
return nullptr;
}
Window* Window::getActiveChild(void)
{
return const_cast<Window*>(
static_cast<const Window*>(this)->getActiveChild());
}
const Window* Window::getActiveChild(void) const
{
// are children can't be active if we are not
if (!isActive())
return nullptr;
for (ChildDrawList::<API key> it = d_drawList.rbegin(); it != d_drawList.rend(); ++it)
{
// don't need full backward scan for activeness as we already know
// 'this' is active. NB: This uses the draw-ordered child list, as that
// should be quicker in most cases.
const Window* wnd = *it;
if (wnd->d_active)
return wnd->getActiveChild();
}
// no child was active, therefore we are the topmost active window
return this;
}
bool Window::isAncestor(unsigned int ID) const
{
// return false if we have no ancestor
if (!d_parent)
return false;
// check our immediate parent
if (getParent()->getID() == ID)
return true;
// not our parent, check back up the family line
return getParent()->isAncestor(ID);
}
const Font* Window::getFont(bool useDefault) const
{
if (!d_font)
return useDefault ? getGUIContext().getDefaultFont() : 0;
return d_font;
}
float Window::getEffectiveAlpha(void) const
{
if (!d_parent || !inheritsAlpha())
return d_alpha;
return d_alpha * getParent()->getEffectiveAlpha();
}
const Rectf& Window::getOuterRectClipper() const
{
if (!<API key>)
{
d_outerRectClipper = <API key>();
<API key> = true;
}
return d_outerRectClipper;
}
const Rectf& Window::getInnerRectClipper() const
{
if (!<API key>)
{
d_innerRectClipper = <API key>();
<API key> = true;
}
return d_innerRectClipper;
}
const Rectf& Window::getClipRect(const bool non_client) const
{
return non_client ? getOuterRectClipper() : getInnerRectClipper();
}
const Rectf& Window::getHitTestRect() const
{
if (!d_hitTestRectValid)
{
d_hitTestRect = getHitTestRect_impl();
d_hitTestRectValid = true;
}
return d_hitTestRect;
}
Rectf Window::<API key>(const Rectf& unclipped_area) const
{
return unclipped_area.getIntersection(
(d_parent && d_clippedByParent) ?
getParent()->getClipRect(isNonClient()) :
Rectf(glm::vec2(0, 0), <API key>()));
}
Rectf Window::<API key>(bool <API key>) const
{
// TODO: skip all pixel alignment!
return d_windowRenderer ? d_windowRenderer-><API key>() :
(<API key> ? <API key>().getFresh(true) : <API key>().get());
}
Rectf Window::<API key>() const
{
return (d_surface && d_surface->isRenderingWindow()) ?
<API key>().get() :
<API key>(<API key>().get());
}
Rectf Window::<API key>() const
{
return (d_surface && d_surface->isRenderingWindow()) ?
<API key>().get() :
<API key>(<API key>().get());
}
Rectf Window::getHitTestRect_impl() const
{
// if clipped by parent wnd, hit test area is the intersection of our
// outer rect with the parent's hit test area intersected with the
// parent's clipper.
if (d_parent && d_clippedByParent)
{
return <API key>().get().getIntersection(
getParent()->getHitTestRect().getIntersection(
getParent()->getClipRect(isNonClient())));
}
// not clipped to parent wnd, so get intersection with screen area.
else
{
return <API key>().get().getIntersection(
Rectf(glm::vec2(0, 0), <API key>()));
}
}
bool Window::isHit(const glm::vec2& position, const bool allow_disabled) const
{
// cannot be hit if we are disabled.
if (!allow_disabled && isEffectiveDisabled())
return false;
const Rectf test_area(getHitTestRect());
if ((test_area.getWidth() == 0.0f) || (test_area.getHeight() == 0.0f))
return false;
return test_area.isPointInRectf(position);
}
Window* Window::getChildAtPosition(const glm::vec2& position) const
{
return getChildAtPosition(position, &Window::isHit);
}
Window* Window::getChildAtPosition(const glm::vec2& position,
bool (Window::*hittestfunc)(const glm::vec2&, bool) const,
bool allow_disabled) const
{
glm::vec2 p;
// if the window has RenderingWindow backing
if (d_surface && d_surface->isRenderingWindow())
static_cast<RenderingWindow*>(d_surface)->unprojectPoint(position, p);
else
p = position;
const ChildDrawList::<API key> end = d_drawList.rend();
ChildDrawList::<API key> child;
for (child = d_drawList.rbegin(); child != end; ++child)
{
if ((*child)->isEffectiveVisible())
{
// recursively scan for hit on children of this child window...
if (Window* const wnd = (*child)->getChildAtPosition(p, hittestfunc, allow_disabled))
return wnd;
// see if this child is hit and return it's cursor if it is
else if (((*child)->*hittestfunc)(p, allow_disabled))
return *child;
}
}
// nothing hit
return nullptr;
}
Window* Window::<API key>(const glm::vec2& position,
const bool allow_disabled) const
{
return getChildAtPosition(position, &Window::isHitTargetWindow, allow_disabled);
}
bool Window::isHitTargetWindow(const glm::vec2& position, bool allow_disabled) const
{
return !<API key>() && isHit(position, allow_disabled);
}
void Window::setAlwaysOnTop(bool setting)
{
// only react to an actual change
if (isAlwaysOnTop() == setting)
return;
d_alwaysOnTop = setting;
// move us in front of sibling windows with the same 'always-on-top'
// setting as we have.
if (d_parent)
{
Window* const org_parent = getParent();
org_parent->removeChild_impl(this);
org_parent->addChild_impl(this);
onZChange_impl();
}
WindowEventArgs args(this);
<API key>(args);
}
void Window::setEnabled(bool enabled)
{
// only react if setting has changed
if (d_enabled == enabled)
return;
d_enabled = enabled;
WindowEventArgs args(this);
if (d_enabled)
{
// check to see if the window is actually enabled (which depends
// upon all ancestor windows being enabled) we do this so that
// events we fire give an accurate indication of the state of a
// window.
if ((d_parent && !getParent()->isDisabled()) || !d_parent)
onEnabled(args);
}
else
{
onDisabled(args);
}
getGUIContext().<API key>();
}
void Window::setVisible(bool setting)
{
// only react if setting has changed
if (d_visible == setting)
return;
d_visible = setting;
WindowEventArgs args(this);
d_visible ? onShown(args) : onHidden(args);
getGUIContext().<API key>();
}
void Window::setActive(bool setting)
{
if (isActive() == setting)
return;
if (setting)
activate();
else
deactivate();
}
void Window::activate(void)
{
// exit if the window is not visible, since a hidden window may not be the
// active window.
if (!isEffectiveVisible())
return;
// force complete release of input capture.
// NB: This is not done via releaseCapture() because that has
// different behaviour depending on the restoreOldCapture setting.
if (getCaptureWindow() && getCaptureWindow() != this)
{
Window* const tmpCapture = getCaptureWindow();
getGUIContext().<API key>(nullptr);
WindowEventArgs args(nullptr);
tmpCapture->onCaptureLost(args);
}
moveToFront();
}
void Window::deactivate()
{
if (isActive())
{
ActivationEventArgs args(this);
args.otherWindow = nullptr;
onDeactivated(args);
}
}
void Window::setClippedByParent(bool setting)
{
// only react if setting has changed
if (d_clippedByParent == setting)
return;
d_clippedByParent = setting;
WindowEventArgs args(this);
onClippingChanged(args);
}
void Window::setText(const String& text)
{
d_textLogical = text;
<API key> = false;
#ifdef CEGUI_BIDI_SUPPORT
d_bidiDataValid = false;
#endif
WindowEventArgs args(this);
onTextChanged(args);
}
void Window::setFont(const Font* font)
{
if (d_font == font)
return;
d_font = font;
<API key> = false;
WindowEventArgs args(this);
onFontChanged(args);
}
void Window::setFont(const String& name)
{
setFont(!name.empty() ? &FontManager::getSingleton().get(name) : 0);
}
void Window::removeChild(unsigned int ID)
{
const size_t child_count = getChildCount();
for (size_t i = 0; i < child_count; ++i)
{
if (getChildAtIdx(i)->getID() == ID)
{
removeChild(d_children[i]);
return;
}
}
}
Window* Window::createChild(const String& type, const String& name)
{
Window* ret = WindowManager::getSingleton().createWindow(type, name);
addChild(ret);
return ret;
}
void Window::destroyChild(Window* wnd)
{
assert(isChild(wnd) && "Window you are attempting to destroy is not a child!");
WindowManager::getSingleton().destroyWindow(wnd);
}
void Window::destroyChild(const String& name_path)
{
destroyChild(getChild(name_path));
}
void Window::moveToFront()
{
moveToFront_impl(false);
}
bool Window::moveToFront_impl(bool wasClicked)
{
bool took_action = false;
// if the window has no parent then we can have no siblings
if (!d_parent)
{
// perform initial activation if required.
if (!isActive())
{
took_action = true;
ActivationEventArgs args(this);
args.otherWindow = nullptr;
onActivated(args);
}
return took_action;
}
// bring parent window to front of it's siblings
took_action = getParent()->moveToFront_impl(wasClicked);
// get immediate child of parent that is currently active (if any)
Window* const activeWnd = getActiveSibling();
// if a change in active window has occurred
if (activeWnd != this)
{
took_action = true;
// notify ourselves that we have become active
ActivationEventArgs args(this);
args.otherWindow = activeWnd;
onActivated(args);
// notify any previously active window that it is no longer active
if (activeWnd)
{
args.window = activeWnd;
args.otherWindow = this;
args.handled = 0;
activeWnd->onDeactivated(args);
}
}
// bring us to the front of our siblings
if (d_zOrderingEnabled &&
(!wasClicked || <API key>) &&
!isTopOfZOrder())
{
took_action = true;
// remove us from our parent's draw list
getParent()-><API key>(*this);
// re-attach ourselves to our parent's draw list which will move us in
// front of sibling windows with the same 'always-on-top' setting as we
// have.
getParent()->addWindowToDrawList(*this);
// notify relevant windows about the z-order change.
onZChange_impl();
}
return took_action;
}
void Window::moveToBack()
{
// if the window is active, de-activate it.
if (isActive())
{
ActivationEventArgs args(this);
args.otherWindow = nullptr;
onDeactivated(args);
}
// we only proceed if we have a parent (otherwise we can have no siblings)
if (d_parent)
{
if (d_zOrderingEnabled)
{
// remove us from our parent's draw list
getParent()-><API key>(*this);
// re-attach ourselves to our parent's draw list which will move us
// in behind sibling windows with the same 'always-on-top' setting
// as we have.
getParent()->addWindowToDrawList(*this, true);
// notify relevant windows about the z-order change.
onZChange_impl();
}
getParent()->moveToBack();
}
}
bool Window::captureInput(void)
{
// we can only capture if we are the active window (LEAVE THIS ALONE!)
if (!isActive())
return false;
if (!isCapturedByThis())
{
Window* const current_capture = getCaptureWindow();
getGUIContext().<API key>(this);
WindowEventArgs args(this);
// inform window which previously had capture that it doesn't anymore.
if (current_capture && current_capture != this && !d_restoreOldCapture)
current_capture->onCaptureLost(args);
if (d_restoreOldCapture)
d_oldCapture = current_capture;
onCaptureGained(args);
}
return true;
}
void Window::releaseInput(void)
{
// if we are not the window that has capture, do nothing
if (!isCapturedByThis())
return;
// restore old captured window if that mode is set
if (d_restoreOldCapture)
{
getGUIContext().<API key>(d_oldCapture);
// check for case when there was no previously captured window
if (d_oldCapture)
{
d_oldCapture = nullptr;
getCaptureWindow()->moveToFront();
}
}
else
getGUIContext().<API key>(nullptr);
WindowEventArgs args(this);
onCaptureLost(args);
}
void Window::<API key>(bool setting)
{
d_restoreOldCapture = setting;
const size_t child_count = getChildCount();
for (size_t i = 0; i < child_count; ++i)
getChildAtIdx(i)-><API key>(setting);
}
void Window::setAlpha(const float alpha)
{
// clamp this to the valid range [0.0, 1.0]
float clampedAlpha = std::max(std::min(alpha, 1.0f), 0.0f);
// Ensure that the new alpha value is actually different from the currently set one
// to avoid unnecessary invalidating and re-caching of textures and children
if (d_alpha == clampedAlpha)
return;
d_alpha = clampedAlpha;
WindowEventArgs args(this);
onAlphaChanged(args);
}
void Window::setInheritsAlpha(bool setting)
{
if (d_inheritsAlpha != setting)
{
// store old effective alpha so we can test if alpha value changes due
// to new setting.
const float oldAlpha = getEffectiveAlpha();
// notify about the setting change.
d_inheritsAlpha = setting;
WindowEventArgs args(this);
<API key>(args);
// if effective alpha has changed fire notification about that too
if (oldAlpha != getEffectiveAlpha())
{
args.handled = 0;
onAlphaChanged(args);
}
}
}
void Window::invalidate(const bool recursive)
{
invalidate_impl(recursive);
getGUIContext().markAsDirty();
}
void Window::invalidate_impl(const bool recursive)
{
d_needsRedraw = true;
<API key>();
WindowEventArgs args(this);
onInvalidated(args);
if (recursive)
{
const size_t child_count = getChildCount();
for (size_t i = 0; i < child_count; ++i)
getChildAtIdx(i)->invalidate_impl(true);
}
}
void Window::draw()
{
// don't do anything if window is not visible
if (!isEffectiveVisible())
return;
// get rendering context
RenderingContext ctx;
getRenderingContext(ctx);
// clear geometry from surface if it's ours
if (ctx.owner == this)
ctx.surface->clearGeometry();
// redraw if no surface set, or if surface is invalidated
if (!d_surface || d_surface->isInvalidated())
{
// perform drawing for 'this' Window
drawSelf(ctx);
// render any child windows
for (ChildDrawList::iterator it = d_drawList.begin(); it != d_drawList.end(); ++it)
{
(*it)->draw();
}
}
// do final rendering for surface if it's ours
if (ctx.owner == this)
ctx.surface->draw();
}
void Window::drawSelf(const RenderingContext& ctx)
{
bufferGeometry(ctx);
queueGeometry(ctx);
}
void Window::bufferGeometry(const RenderingContext&)
{
if (d_needsRedraw)
{
// dispose of already cached geometry.
<API key>();
// signal rendering started
WindowEventArgs args(this);
onRenderingStarted(args);
// HACK: ensure our rendered string content is up to date
getRenderedString();
// get derived class or WindowRenderer to re-populate geometry buffer.
if (d_windowRenderer)
d_windowRenderer-><API key>();
else
<API key>();
<API key>();
<API key>();
// signal rendering ended
args.handled = 0;
onRenderingEnded(args);
// mark ourselves as no longer needed a redraw.
d_needsRedraw = false;
}
}
void Window::queueGeometry(const RenderingContext& ctx)
{
// add geometry so that it gets drawn to the target surface.
ctx.surface->addGeometryBuffers(ctx.queue, d_geometryBuffers);
}
void Window::setParent(Element* parent)
{
Element::setParent(parent);
syncTargetSurface();
}
void Window::syncTargetSurface()
{
// if we do not have a surface, xfer any surfaces from our children to
// whatever our target surface now is.
if (!d_surface)
<API key>();
// else, since we have a surface, child surfaces stay with us. Though we
// must now ensure /our/ surface is xferred if it is a RenderingWindow.
else if (d_surface->isRenderingWindow())
{
// target surface is eihter the parent's target, or the gui context.
RenderingSurface& tgt = d_parent ?
getParent()-><API key>() : getGUIContext();
tgt.<API key>(static_cast<RenderingWindow&>(*d_surface));
}
}
void Window::cleanupChildren(void)
{
while(getChildCount() != 0)
{
Window* wnd = static_cast<Window*>(d_children[0]);
// always remove child
removeChild(wnd);
// destroy child if that is required
if (wnd->isDestroyedByParent())
WindowManager::getSingleton().destroyWindow(wnd);
}
}
void Window::addChild_impl(Element* element)
{
Window* wnd = dynamic_cast<Window*>(element);
if (!wnd)
throw <API key>(
"Window can only have Elements of type Window added as children "
"(Window path: " + getNamePath() + ").");
// if the element is already a child of this Window, this is a NOOP
if (isChild(element))
return;
NamedElement::addChild_impl(wnd);
addWindowToDrawList(*wnd);
wnd->invalidate(true);
wnd->onZChange_impl();
}
void Window::removeChild_impl(Element* element)
{
Window* wnd = static_cast<Window*>(element);
Window* const capture_wnd = getCaptureWindow();
if ((capture_wnd && wnd) &&
(capture_wnd == wnd || capture_wnd->isAncestor(wnd)))
getCaptureWindow()->releaseInput();
// remove from draw list
<API key>(*wnd);
Element::removeChild_impl(wnd);
// find this window in the child list
const ChildList::iterator position =
std::find(d_children.begin(), d_children.end(), wnd);
// if the window was found in the child list
if (position != d_children.end())
{
// unban properties window could write as a root window
wnd-><API key>(<API key>);
}
wnd->onZChange_impl();
// Removed windows should not be active anymore (they are not attached
// to anything so this would not make sense)
if(wnd->isActive())
{
wnd->deactivate();
}
}
void Window::onZChange_impl(void)
{
if (!d_parent)
{
WindowEventArgs args(this);
onZChanged(args);
}
else
{
const size_t child_count = d_parent->getChildCount();
for (size_t i = 0; i < child_count; ++i)
{
WindowEventArgs args(getParent()->getChildAtIdx(i));
getParent()->getChildAtIdx(i)->onZChanged(args);
}
}
getGUIContext().<API key>();
}
const Image* Window::getCursor(bool useDefault) const
{
if (d_cursor)
return d_cursor;
else
return useDefault ? getGUIContext().getCursor().getDefaultImage() : 0;
}
void Window::setCursor(const String& name)
{
setCursor(
&ImageManager::getSingleton().get(name));
}
void Window::setCursor(const Image* image)
{
d_cursor = image;
if (getGUIContext().<API key>() == this)
getGUIContext().getCursor().setImage(image);
}
void Window::setID(unsigned int ID)
{
if (d_ID == ID)
return;
d_ID = ID;
WindowEventArgs args(this);
onIDChanged(args);
}
void Window::<API key>(bool setting)
{
if (d_destroyedByParent == setting)
return;
d_destroyedByParent = setting;
WindowEventArgs args(this);
<API key>(args);
}
void Window::<API key>(CursorInputSource source)
{
<API key> ciea(this);
ciea.position = <API key>(
getGUIContext().getCursor().getPosition());
ciea.moveDelta = glm::vec2(0, 0);
ciea.source = source;
ciea.scroll = 0;
onCursorPressHold(ciea);
}
void Window::addWindowProperties(void)
{
const String propertyOrigin("Window");
<API key>(Window, float,
AlphaPropertyName, "Property to get/set the alpha value of the Window. Value is floating point number.",
&Window::setAlpha, &Window::getAlpha, 1.0f
);
<API key>(Window, bool,
<API key>, "Property to get/set the 'always on top' setting for the Window. Value is either \"true\" or \"false\".",
&Window::setAlwaysOnTop, &Window::isAlwaysOnTop, false
);
<API key>(Window, bool,
<API key>, "Property to get/set the 'clipped by parent' setting for the Window. Value is either \"true\" or \"false\".",
&Window::setClippedByParent, &Window::isClippedByParent, true
);
<API key>(Window, bool,
<API key>, "Property to get/set the 'destroyed by parent' setting for the Window. Value is either \"true\" or \"false\".",
&Window::<API key>, &Window::isDestroyedByParent, true
);
<API key>(Window, bool,
<API key>, "Property to get/set the 'disabled state' setting for the Window. Value is either \"true\" or \"false\".",
&Window::setDisabled, &Window::isDisabled, false
);
<API key>(Window, Font*,
FontPropertyName,"Property to get/set the font for the Window. Value is the name of the font to use (must be loaded already).",
&Window::setFont, &Window::property_getFont, nullptr
);
<API key>(Window, unsigned int,
IDPropertyName, "Property to get/set the ID value of the Window. Value is an unsigned integer number.",
&Window::setID, &Window::getID, 0
);
<API key>(Window, bool,
<API key>, "Property to get/set the 'inherits alpha' setting for the Window. Value is either \"true\" or \"false\".",
&Window::setInheritsAlpha, &Window::inheritsAlpha, true
);
<API key>(Window, Image*,
<API key>,"Property to get/set the mouse cursor image for the Window. Value should be \"<image name>\".",
&Window::setCursor, &Window::property_getCursor, nullptr
);
<API key>(Window, bool,
VisiblePropertyName, "Property to get/set the 'visible state' setting for the Window. Value is either \"true\" or \"false\".",
&Window::setVisible, &Window::isVisible, true
);
<API key>(Window, bool,
ActivePropertyName, "Property to get/set the 'active' setting for the Window. Value is either \"true\" or \"false\".",
&Window::setActive, &Window::isActive, false
);
<API key>(Window, bool,
<API key>, "Property to get/set the 'restore old capture' setting for the Window. Value is either \"true\" or \"false\".",
&Window::<API key>, &Window::restoresOldCapture, false
);
<API key>(Window, String,
TextPropertyName, "Property to get/set the text / caption for the Window. Value is the text string to use. Meaning of this property heavily depends on the type of the Window.",
&Window::setText, &Window::getText, ""
);
<API key>(Window, bool,
<API key>, "Property to get/set the 'z-order changing enabled' setting for the Window. Value is either \"true\" or \"false\".",
&Window::setZOrderingEnabled, &Window::isZOrderingEnabled, true
);
<API key>(Window, bool,
<API key>, "Property to get/set whether the window will receive autorepeat cursor press events. Value is either \"true\" or \"false\".",
&Window::<API key>, &Window::<API key>, false
);
<API key>(Window, float,
<API key>, "Property to get/set the autorepeat delay. Value is a floating point number indicating the delay required in seconds.",
&Window::setAutoRepeatDelay, &Window::getAutoRepeatDelay, 0.3f
);
<API key>(Window, float,
<API key>, "Property to get/set the autorepeat rate. Value is a floating point number indicating the rate required in seconds.",
&Window::setAutoRepeatRate, &Window::getAutoRepeatRate, 0.06f
);
<API key>(Window, bool,
<API key>, "Property to get/set whether captured inputs are passed to child windows. Value is either \"true\" or \"false\".",
&Window::<API key>, &Window::<API key>, false
);
<API key>(Window, String,
<API key>, "Property to get/set the custom tooltip for the window. Value is the type name of the custom tooltip. If \"\", the default System tooltip is used.",
&Window::setTooltipType, &Window::getTooltipType, ""
);
<API key>(Window, String,
<API key>, "Property to get/set the tooltip text for the window. Value is the tooltip text for the window.",
&Window::setTooltipText, &Window::getTooltipText, ""
);
<API key>(Window, bool,
<API key>, "Property to get/set whether the window inherits its parents tooltip text when it has none of its own. Value is either \"true\" or \"false\".",
&Window::<API key>, &Window::inheritsTooltipText, true
);
<API key>(Window, bool,
<API key>, "Property to get/set whether the window will come to the top of the Z-order when clicked. Value is either \"true\" or \"false\".",
&Window::<API key>, &Window::<API key>, true
);
<API key>(Window, bool,
<API key>, "Property to get/set whether the window ignores cursor events and pass them through to any windows behind it. Value is either \"true\" or \"false\".",
&Window::<API key>, &Window::<API key>, false
);
addProperty(&<API key>);
addProperty(&d_lookNFeelProperty);
<API key>(Window, bool,
<API key>, "Property to get/set whether the Window will receive drag and drop related notifications. Value is either \"true\" or \"false\".",
&Window::setDragDropTarget, &Window::isDragDropTarget, true
);
<API key>(Window, bool,
<API key>, "Property to get/set whether the Window will automatically attempt to "
"use a full imagery caching RenderingSurface (if supported by the "
"renderer). Here, full imagery caching usually will mean caching a "
"window's representation onto a texture (although no such "
"implementation requirement is specified.)"
" Value is either \"true\" or \"false\".",
&Window::<API key>, &Window::<API key>, false /* TODO: Inconsistency*/
);
<API key>(Window, bool,
<API key>, "Property to get/set whether the Window's texture caching (if activated) "
"will have a stencil buffer attached. This may be required for proper rendering of SVG images and Custom Shapes."
" Value is either \"true\" or \"false\".",
&Window::<API key>, &Window::<API key>, false
);
<API key>(Window, bool,
<API key>, "Property to get/set the text parsing setting for the Window. "
"Value is either \"true\" or \"false\".",
&Window::<API key>, &Window::<API key>, true
);
<API key>(Window, UBox,
MarginPropertyName, "Property to get/set margin for the Window. Value format:"
"{top:{[tops],[topo]},left:{[lefts],[lefto]},bottom:{[bottoms],[bottomo]},right:{[rights],[righto]}}.",
&Window::setMargin, &Window::getMargin, UBox(UDim(0, 0))
);
<API key>(Window, WindowUpdateMode,
<API key>, "Property to get/set the window update mode setting. "
"Value is one of \"Always\", \"Never\" or \"Visible\".",
&Window::setUpdateMode,&Window::getUpdateMode, WindowUpdateMode::Visible
);
<API key>(Window, bool,
<API key>, "Property to get/set whether unhandled cursor inputs should be "
"propagated back to the Window's parent. "
"Value is either \"true\" or \"false\".",
&Window::<API key>, &Window::<API key>, false
);
<API key>(Window, bool,
<API key>, "Property to access whether the system considers this window to be an "
"automatically created sub-component window."
"Value is either \"true\" or \"false\".",
&Window::setAutoWindow, &Window::isAutoWindow, false
);
}
bool Window::isZOrderingEnabled(void) const
{
return d_zOrderingEnabled;
}
void Window::setZOrderingEnabled(bool setting)
{
d_zOrderingEnabled = setting;
}
bool Window::<API key>(void) const
{
return d_autoRepeat;
}
float Window::getAutoRepeatDelay(void) const
{
return d_repeatDelay;
}
float Window::getAutoRepeatRate(void) const
{
return d_repeatRate;
}
void Window::<API key>(bool setting)
{
if (d_autoRepeat == setting)
return;
d_autoRepeat = setting;
<API key> = CursorInputSource::NotSpecified;
// FIXME: There is a potential issue here if this setting is
// FIXME: changed _while_ the cursor is auto-repeating, and
// FIXME: the 'captured' state of input could get messed up.
// FIXME: The alternative is to always release here, but that
// FIXME: has a load of side effects too - so for now nothing
// FIXME: is done. This whole aspect of the system needs a
// FIXME: review an reworking - though such a change was
// FIXME: beyond the scope of the bug-fix that originated this
// FIXME: comment block. PDT - 30/10/06
}
void Window::setAutoRepeatDelay(float delay)
{
d_repeatDelay = delay;
}
void Window::setAutoRepeatRate(float rate)
{
d_repeatRate = rate;
}
void Window::update(float elapsed)
{
// perform update for 'this' Window
updateSelf(elapsed);
// update underlying RenderingWinodw if needed
if (d_surface && d_surface->isRenderingWindow())
static_cast<RenderingWindow*>(d_surface)->update(elapsed);
UpdateEventArgs e(this,elapsed);
fireEvent(EventUpdated,e,EventNamespace);
// update child windows
for (size_t i = 0; i < getChildCount(); ++i)
{
// update children based on their WindowUpdateMode setting.
if (getChildAtIdx(i)->d_updateMode == WindowUpdateMode::Always ||
(getChildAtIdx(i)->d_updateMode == WindowUpdateMode::Visible &&
getChildAtIdx(i)->isVisible()))
{
getChildAtIdx(i)->update(elapsed);
}
}
}
void Window::updateSelf(float elapsed)
{
// cursor autorepeat processing.
if (d_autoRepeat && <API key> != CursorInputSource::NotSpecified)
{
d_repeatElapsed += elapsed;
if (d_repeating)
{
if (d_repeatElapsed > d_repeatRate)
{
d_repeatElapsed -= d_repeatRate;
// trigger the repeated event
<API key>(<API key>);
}
}
else
{
if (d_repeatElapsed > d_repeatDelay)
{
d_repeatElapsed = 0;
d_repeating = true;
// trigger the repeated event
<API key>(<API key>);
}
}
}
// allow for updates within an assigned WindowRenderer
if (d_windowRenderer)
d_windowRenderer->update(elapsed);
}
bool Window::performCopy(Clipboard& /*clipboard*/)
{
// deny copying by default
return false;
}
bool Window::performCut(Clipboard& /*clipboard*/)
{
// deny cutting by default
return false;
}
bool Window::performPaste(Clipboard& /*clipboard*/)
{
// deny pasting by default
return false;
}
bool Window::performUndo()
{
// deny undo by default
return false;
}
bool Window::performRedo()
{
// deny redo by default
return false;
}
bool Window::<API key>(void) const
{
return <API key>;
}
void Window::<API key>(bool setting)
{
<API key> = setting;
}
void Window::<API key>(DragContainer* item)
{
if (!item)
return;
DragDropEventArgs args(this);
args.dragDropItem = item;
<API key>(args);
}
void Window::<API key>(DragContainer* item)
{
if (!item)
return;
DragDropEventArgs args(this);
args.dragDropItem = item;
<API key>(args);
}
void Window::<API key>(DragContainer* item)
{
if (!item)
return;
DragDropEventArgs args(this);
args.dragDropItem = item;
<API key>(args);
}
void Window::destroy(void)
{
// because we know that people do not read the API ref properly,
// here is some protection to ensure that WindowManager does the
// destruction and not anyone else.
WindowManager& wmgr = WindowManager::getSingleton();
if (wmgr.isAlive(this))
{
wmgr.destroyWindow(this);
// now return, the rest of what we need to do will happen
// once WindowManager re-calls this method.
return;
}
// signal our imminent destruction
WindowEventArgs args(this);
<API key>(args);
// Check we are detached from parent
if (d_parent)
d_parent->removeChild(this);
releaseInput();
// let go of the tooltip if we have it
Tooltip* const tip = getTooltip();
if (tip && tip->getTargetWindow()==this)
tip->setTargetWindow(nullptr);
// ensure custom tooltip is cleaned up
setTooltip(static_cast<Tooltip*>(nullptr));
// clean up looknfeel related things
if (!d_lookName.empty())
{
d_windowRenderer-><API key>();
WidgetLookManager::getSingleton().getWidgetLook(d_lookName).
cleanUpWidget(*this);
}
// free any assigned WindowRenderer
if (d_windowRenderer != nullptr)
{
d_windowRenderer->onDetach();
<API key>::getSingleton().
<API key>(d_windowRenderer);
d_windowRenderer = nullptr;
}
cleanupChildren();
<API key>();
invalidate();
}
bool Window::<API key>(void) const
{
return d_customTip == nullptr;
}
Tooltip* Window::getTooltip(void) const
{
return <API key>() ?
getGUIContext().<API key>(): d_customTip;
}
void Window::setTooltip(Tooltip* tooltip)
{
// destroy current custom tooltip if one exists and we created it
if (d_customTip && d_weOwnTip)
WindowManager::getSingleton().destroyWindow(d_customTip);
// set new custom tooltip
d_weOwnTip = false;
d_customTip = tooltip;
}
void Window::setTooltipType(const String& tooltipType)
{
// destroy current custom tooltip if one exists and we created it
if (d_customTip && d_weOwnTip)
WindowManager::getSingleton().destroyWindow(d_customTip);
if (tooltipType.empty())
{
d_customTip = nullptr;
d_weOwnTip = false;
}
else
{
try
{
d_customTip = static_cast<Tooltip*>(
WindowManager::getSingleton().createWindow(
tooltipType, getName() + TooltipNameSuffix));
d_customTip->setAutoWindow(true);
d_weOwnTip = true;
}
catch (<API key>&)
{
d_customTip = nullptr;
d_weOwnTip = false;
}
}
}
String Window::getTooltipType(void) const
{
return <API key>() ? String("") : d_customTip->getType();
}
void Window::setTooltipText(const String& tip)
{
d_tooltipText = tip;
Tooltip* const tooltip = getTooltip();
if (tooltip && tooltip->getTargetWindow() == this)
tooltip->setText(tip);
}
const String& Window::getTooltipText(void) const
{
return d_tooltipText;
}
const String& Window::<API key>(void) const
{
if (d_inheritsTipText && d_parent && d_tooltipText.empty())
return getParent()->getTooltipText();
else
return d_tooltipText;
}
bool Window::inheritsTooltipText(void) const
{
return d_inheritsTipText;
}
void Window::<API key>(bool setting)
{
d_inheritsTipText = setting;
}
void Window::setArea_impl(const UVector2& pos, const USize& size, bool topLeftSizing, bool fireEvents,
bool <API key>)
{
<API key>();
Element::setArea_impl(pos, size, topLeftSizing, fireEvents, <API key>);
//if (moved || sized)
// FIXME: This is potentially wasteful
getGUIContext().<API key>();
// update geometry position and clipping if nothing from above appears to
// have done so already (NB: may be occasionally wasteful, but fixes bugs!)
if (!<API key>.isCacheValid())
<API key>();
}
void Window::<API key>()
{
<API key> = false;
<API key> = false;
d_hitTestRectValid = false;
}
const String& Window::getLookNFeel() const
{
return d_lookName;
}
void Window::setLookNFeel(const String& look)
{
if (d_lookName == look)
return;
if (!d_windowRenderer)
throw NullObjectException("There must be a "
"window renderer assigned to the window '" + d_name +
"' to set its look'n'feel");
WidgetLookManager& wlMgr = WidgetLookManager::getSingleton();
if (!d_lookName.empty())
{
d_windowRenderer-><API key>();
const WidgetLookFeel& wlf = wlMgr.getWidgetLook(d_lookName);
wlf.cleanUpWidget(*this);
}
d_lookName = look;
Logger::getSingleton().logEvent("Assigning LookNFeel '" + look +
"' to window '" + d_name + "'.", LoggingLevel::Informative);
// Work to initialise the look and feel...
const WidgetLookFeel& wlf = wlMgr.getWidgetLook(look);
// Get look and feel to initialise the widget as it needs.
wlf.initialiseWidget(*this);
// do the necessary binding to the stuff added by the look and feel
<API key>();
// let the window renderer know about this
d_windowRenderer->onLookNFeelAssigned();
invalidate();
<API key>();
}
void Window::setModalState(bool state)
{
// do nothing if state isn't changing
if (getModalState() == state)
return;
// if going modal
if (state)
{
activate();
getGUIContext().setModalWindow(this);
}
// clear the modal target
else
getGUIContext().setModalWindow(nullptr);
}
void Window::<API key>(const bool <API key>,
const bool client_sized_hint)
{
const Sizef old_size(d_pixelSize);
d_pixelSize = calculatePixelSize();
<API key>();
const bool outer_changed = <API key> || d_pixelSize != old_size;
const bool inner_changed = client_sized_hint || <API key>();
<API key> &= !outer_changed;
<API key> &= !inner_changed;
if (d_windowRenderer)
d_windowRenderer-><API key>();
<API key>(outer_changed, inner_changed);
}
void Window::<API key>()
{
if (d_lookName.empty())
return;
try
{
WidgetLookManager::getSingleton().
getWidgetLook(d_lookName).layoutChildWidgets(*this);
}
catch (<API key>&)
{
Logger::getSingleton().logEvent(
"Window::<API key>: "
"WidgetLook '" + d_lookName + "' was not found.", LoggingLevel::Error);
}
}
const String& Window::getUserString(const String& name) const
{
UserStringMap::const_iterator iter = d_userStrings.find(name);
if (iter == d_userStrings.end())
throw <API key>(
"a user string named '" + name + "' is not defined for Window '" +
d_name + "'.");
return (*iter).second;
}
bool Window::isUserStringDefined(const String& name) const
{
return d_userStrings.find(name) != d_userStrings.end();
}
void Window::setUserString(const String& name, const String& value)
{
d_userStrings[name] = value;
}
void Window::writeXMLToStream(XMLSerializer& xml_stream) const
{
// just stop now if we are'nt allowed to write XML
if (!d_allowWriteXML)
return;
// output opening Window tag
xml_stream.openTag(<API key>)
.attribute(<API key>, getType());
// write name if not auto-generated
if (getName().compare(0, WindowManager::<API key>.length(),
WindowManager::<API key>) != 0)
{
xml_stream.attribute(<API key>, getName());
}
// write out properties.
writePropertiesXML(xml_stream);
// write out attached child windows.
<API key>(xml_stream);
// now ouput closing Window tag
xml_stream.closeTag();
}
int Window::writePropertiesXML(XMLSerializer& xml_stream) const
{
int propertiesWritten = 0;
PropertySet::PropertyIterator iter = getPropertyIterator();
while(!iter.isAtEnd())
{
// first we check to make sure the property is'nt banned from XML
if (!<API key>(iter.getCurrentValue()))
{
try
{
// only write property if it's not at the default state
if (!isPropertyAtDefault(iter.getCurrentValue()))
{
iter.getCurrentValue()->writeXMLToStream(this, xml_stream);
++propertiesWritten;
}
}
catch (<API key>&)
{
// This catches errors from the MultiLineColumnList for example
Logger::getSingleton().logEvent(
"Window::writePropertiesXML: property receiving failed. "
"Continuing...", LoggingLevel::Error);
}
}
++iter;
}
return propertiesWritten;
}
int Window::<API key>(XMLSerializer& xml_stream) const
{
int windowsWritten = 0;
for (unsigned int i = 0; i < getChildCount(); ++i)
{
const Window* const child = getChildAtIdx(i);
// conditional to ensure that auto created windows are handled
// seperately.
if (!child->isAutoWindow())
{
child->writeXMLToStream(xml_stream);
++windowsWritten;
}
// this is one of those auto created windows so we do some special
// handling
else if (child-><API key>(xml_stream))
{
++windowsWritten;
}
}
return windowsWritten;
}
bool Window::<API key>(XMLSerializer& xml_stream) const
{
// just stop now if we are'nt allowed to write XML
if (!d_allowWriteXML)
return false;
// we temporarily output to this string stream to see if have to do the tag
// at all. Make sure this stream does UTF-8
std::ostringstream ss;
XMLSerializer xml(ss);
xml.openTag(<API key>);
// Create the XML Child Tree
// write out properties.
writePropertiesXML(xml);
// write out attached child windows.
<API key>(xml);
xml.closeTag();
if (xml.getTagCount() <= 1)
return false;
// output opening AutoWindow tag
xml_stream.openTag(<API key>);
// write name suffix attribute
xml_stream.attribute(<API key>, getName());
// Inefficient : do the XML serialization again
// write out properties.
writePropertiesXML(xml_stream);
// write out attached child windows.
<API key>(xml_stream);
xml_stream.closeTag();
return true;
}
void Window::addWindowToDrawList(Window& wnd, bool at_back)
{
// add behind other windows in same group
if (at_back)
{
// calculate position where window should be added for drawing
ChildDrawList::iterator pos = d_drawList.begin();
if (wnd.isAlwaysOnTop())
{
// find first topmost window
while ((pos != d_drawList.end()) && (!(*pos)->isAlwaysOnTop()))
++pos;
}
// add window to draw list
d_drawList.insert(pos, &wnd);
}
// add in front of other windows in group
else
{
// calculate position where window should be added for drawing
ChildDrawList::reverse_iterator position = d_drawList.rbegin();
if (!wnd.isAlwaysOnTop())
{
// find last non-topmost window
while ((position != d_drawList.rend()) && ((*position)->isAlwaysOnTop()))
++position;
}
// add window to draw list
d_drawList.insert(position.base(), &wnd);
}
}
void Window::<API key>(const Window& wnd)
{
// if draw list is not empty
if (!d_drawList.empty())
{
// attempt to find the window in the draw list
const ChildDrawList::iterator position =
std::find(d_drawList.begin(), d_drawList.end(), &wnd);
// remove the window if it was found in the draw list
if (position != d_drawList.end())
d_drawList.erase(position);
}
}
Window* Window::getActiveSibling()
{
// initialise with this if we are active, else 0
Window* activeWnd = isActive() ? this : 0;
// if active window not already known, and we have a parent window
if (!activeWnd && d_parent)
{
// scan backwards through the draw list, as this will
// usually result in the fastest result.
for (ChildDrawList::reverse_iterator it = getParent()->d_drawList.rbegin(); it != getParent()->d_drawList.rend(); ++it)
{
Window* wnd = *it;
// if this child is active
if (wnd->isActive())
{
// set the return value
activeWnd = wnd;
// exit loop early, as we have found what we needed
break;
}
}
}
// return whatever we discovered
return activeWnd;
}
void Window::onSized_impl(ElementEventArgs& e)
{
/*
* Why are we not calling Element::onSized_impl? It's because that function
* always calls the onParentSized notification for all children - we really
* want that to be done via <API key> instead and we
* definitely don't want it done twice.
*
* (The other option was to add an Element::performChildLayout function -
* maybe we should consider that).
*/
// resize the underlying RenderingWindow if we're using such a thing
if (d_surface && d_surface->isRenderingWindow())
static_cast<RenderingWindow*>(d_surface)->setSize(getPixelSize());
// screen area changes when we're resized.
// NB: Called non-recursive since the <API key> call should
// have dealt more selectively with child Window cases.
<API key>(true);
<API key>(true, true);
invalidate();
fireEvent(EventSized, e, EventNamespace);
}
void Window::onMoved(ElementEventArgs& e)
{
Element::onMoved(e);
// handle invalidation of surfaces and trigger needed redraws
if (d_parent)
{
getParent()-><API key>();
// need to redraw some geometry if parent uses a caching surface
if (getParent()-><API key>().isRenderingWindow())
getGUIContext().markAsDirty();
}
}
void Window::onTextChanged(WindowEventArgs& e)
{
invalidate();
fireEvent(EventTextChanged, e, EventNamespace);
}
void Window::onFontChanged(WindowEventArgs& e)
{
// This was added to enable the Falagard FontDim to work
// properly. A better, more selective, solution would
// probably be to do something funky with events ;)
<API key>();
invalidate();
fireEvent(EventFontChanged, e, EventNamespace);
}
void Window::onAlphaChanged(WindowEventArgs& e)
{
// scan child list and call this method for all children that inherit alpha
const size_t child_count = getChildCount();
for (size_t i = 0; i < child_count; ++i)
{
if (getChildAtIdx(i)->inheritsAlpha())
{
WindowEventArgs args(getChildAtIdx(i));
getChildAtIdx(i)->onAlphaChanged(args);
}
}
<API key>();
<API key>();
getGUIContext().markAsDirty();
fireEvent(EventAlphaChanged, e, EventNamespace);
}
void Window::onIDChanged(WindowEventArgs& e)
{
fireEvent(EventIDChanged, e, EventNamespace);
}
void Window::onShown(WindowEventArgs& e)
{
invalidate();
fireEvent(EventShown, e, EventNamespace);
}
void Window::onHidden(WindowEventArgs& e)
{
// first deactivate window if it is the active window.
if (isActive())
deactivate();
invalidate();
fireEvent(EventHidden, e, EventNamespace);
}
void Window::onEnabled(WindowEventArgs& e)
{
// signal all non-disabled children that they are now enabled
// (via inherited state)
const size_t child_count = getChildCount();
for (size_t i = 0; i < child_count; ++i)
{
if (getChildAtIdx(i)->d_enabled)
{
WindowEventArgs args(getChildAtIdx(i));
getChildAtIdx(i)->onEnabled(args);
}
}
invalidate();
fireEvent(EventEnabled, e, EventNamespace);
}
void Window::onDisabled(WindowEventArgs& e)
{
// signal all non-disabled children that they are now disabled
// (via inherited state)
const size_t child_count = getChildCount();
for (size_t i = 0; i < child_count; ++i)
{
if (getChildAtIdx(i)->d_enabled)
{
WindowEventArgs args(getChildAtIdx(i));
getChildAtIdx(i)->onDisabled(args);
}
}
invalidate();
fireEvent(EventDisabled, e, EventNamespace);
}
void Window::onClippingChanged(WindowEventArgs& e)
{
invalidate();
<API key>();
fireEvent(<API key>, e, EventNamespace);
}
void Window::<API key>(WindowEventArgs& e)
{
fireEvent(<API key>, e, EventNamespace);
}
void Window::<API key>(WindowEventArgs& e)
{
invalidate();
fireEvent(<API key>, e, EventNamespace);
}
void Window::<API key>(WindowEventArgs& e)
{
// we no longer want a total redraw here, instead we just get each window
// to resubmit it's imagery to the Renderer.
getGUIContext().markAsDirty();
fireEvent(<API key>, e, EventNamespace);
}
void Window::onCaptureGained(WindowEventArgs& e)
{
fireEvent(<API key>, e, EventNamespace);
}
void Window::onCaptureLost(WindowEventArgs& e)
{
// reset auto-repeat state
<API key> = CursorInputSource::NotSpecified;
// handle restore of previous capture window as required.
if (d_restoreOldCapture && (d_oldCapture != nullptr)) {
d_oldCapture->onCaptureLost(e);
d_oldCapture = nullptr;
}
// handle case where cursor is now in a different window
// (this is a bit of a hack that uses the injection of a semantic event to handle
// this for us).
SemanticInputEvent moveEvent(SemanticValue::CursorMove);
const glm::vec2 cursorPosition = getGUIContext().getCursor().getPosition();
moveEvent.d_payload.array[0] = cursorPosition.x;
moveEvent.d_payload.array[1] = cursorPosition.y;
getGUIContext().injectInputEvent(moveEvent);
fireEvent(<API key>, e, EventNamespace);
}
void Window::onInvalidated(WindowEventArgs& e)
{
fireEvent(EventInvalidated, e, EventNamespace);
}
void Window::onRenderingStarted(WindowEventArgs& e)
{
fireEvent(<API key>, e, EventNamespace);
}
void Window::onRenderingEnded(WindowEventArgs& e)
{
fireEvent(EventRenderingEnded, e, EventNamespace);
}
void Window::onZChanged(WindowEventArgs& e)
{
// we no longer want a total redraw here, instead we just get each window
// to resubmit it's imagery to the Renderer.
getGUIContext().markAsDirty();
fireEvent(EventZOrderChanged, e, EventNamespace);
}
void Window::<API key>(WindowEventArgs& e)
{
<API key> = true;
fireEvent(<API key>, e, EventNamespace);
}
void Window::onActivated(ActivationEventArgs& e)
{
d_active = true;
invalidate();
fireEvent(EventActivated, e, EventNamespace);
}
void Window::onDeactivated(ActivationEventArgs& e)
{
// first de-activate all children
const size_t child_count = getChildCount();
for (size_t i = 0; i < child_count; ++i)
{
if (getChildAtIdx(i)->isActive())
{
// make sure the child gets itself as the .window member
ActivationEventArgs child_e(getChildAtIdx(i));
child_e.otherWindow = e.otherWindow;
getChildAtIdx(i)->onDeactivated(child_e);
}
}
d_active = false;
invalidate();
fireEvent(EventDeactivated, e, EventNamespace);
}
void Window::onParentSized(ElementEventArgs& e)
{
Element::onParentSized(e);
// if we were not moved or sized, do child layout anyway!
// URGENT FIXME
//if (!(moved || sized))
<API key>();
}
void Window::onChildAdded(ElementEventArgs& e)
{
// we no longer want a total redraw here, instead we just get each window
// to resubmit it's imagery to the Renderer.
getGUIContext().markAsDirty();
Element::onChildAdded(e);
}
void Window::onChildRemoved(ElementEventArgs& e)
{
// we no longer want a total redraw here, instead we just get each window
// to resubmit it's imagery to the Renderer.
getGUIContext().markAsDirty();
// Though we do need to invalidate the rendering surface!
<API key>().invalidate();
Element::onChildRemoved(e);
}
void Window::onCursorEntersArea(<API key>& e)
{
d_containsPointer = true;
fireEvent(<API key>, e, EventNamespace);
}
void Window::onCursorLeavesArea(<API key>& e)
{
d_containsPointer = false;
fireEvent(<API key>, e, EventNamespace);
}
void Window::onCursorEnters(<API key>& e)
{
// set the cursor
getGUIContext().getCursor().setImage(getCursor());
// perform tooltip control
Tooltip* const tip = getTooltip();
if (tip && !isAncestor(tip))
tip->setTargetWindow(this);
fireEvent(<API key>, e, EventNamespace);
}
void Window::onCursorLeaves(<API key>& e)
{
// perform tooltip control
const Window* const mw = getGUIContext().<API key>();
Tooltip* const tip = getTooltip();
if (tip && mw != tip && !(mw && mw->isAncestor(tip)))
tip->setTargetWindow(nullptr);
fireEvent(<API key>, e, EventNamespace);
}
void Window::onCursorMove(<API key>& e)
{
// perform tooltip control
Tooltip* const tip = getTooltip();
if (tip)
tip->resetTimer();
fireEvent(EventCursorMove, e, EventNamespace);
// optionally propagate to parent
if (!e.handled && <API key> &&
d_parent && this != getGUIContext().getModalWindow())
{
e.window = getParent();
getParent()->onCursorMove(e);
return;
}
// by default we now mark cursor events as handled
// (derived classes may override, of course!)
++e.handled;
}
void Window::onScroll(<API key>& e)
{
fireEvent(EventScroll, e, EventNamespace);
// optionally propagate to parent
if (!e.handled && <API key> &&
d_parent && this != getGUIContext().getModalWindow())
{
e.window = getParent();
getParent()->onScroll(e);
return;
}
// by default we now mark cursor events as handled
// (derived classes may override, of course!)
++e.handled;
}
void Window::onCursorPressHold(<API key>& e)
{
// perform tooltip control
Tooltip* const tip = getTooltip();
if (tip)
tip->setTargetWindow(nullptr);
if ((e.source == CursorInputSource::Left) && moveToFront_impl(true))
++e.handled;
// if auto repeat is enabled and we are not currently tracking
// the source that was just pushed (need this source check because
// it could be us that generated this event via auto-repeat).
if (d_autoRepeat)
{
if (<API key> == CursorInputSource::NotSpecified)
captureInput();
if ((<API key> != e.source) && isCapturedByThis())
{
<API key> = e.source;
d_repeatElapsed = 0;
d_repeating = false;
}
}
fireEvent(<API key>, e, EventNamespace);
// optionally propagate to parent
if (!e.handled && <API key> &&
d_parent && this != getGUIContext().getModalWindow())
{
e.window = getParent();
getParent()->onCursorPressHold(e);
return;
}
// by default we now mark cursor events as handled
// (derived classes may override, of course!)
++e.handled;
}
void Window::onCursorActivate(<API key>& e)
{
// reset auto-repeat state
if (d_autoRepeat && <API key> != CursorInputSource::NotSpecified)
{
releaseInput();
<API key> = CursorInputSource::NotSpecified;
}
fireEvent(EventCursorActivate, e, EventNamespace);
// optionally propagate to parent
if (!e.handled && <API key> &&
d_parent && this != getGUIContext().getModalWindow())
{
e.window = getParent();
getParent()->onCursorActivate(e);
}
}
void Window::onCharacter(TextEventArgs& e)
{
fireEvent(EventCharacterKey, e, EventNamespace);
// As of 0.7.0 CEGUI::System no longer does input event propogation, so by
// default we now do that here. Generally speaking key handling widgets
// may need to override this behaviour to halt further propagation.
if (!e.handled && d_parent &&
this != getGUIContext().getModalWindow())
{
e.window = getParent();
getParent()->onCharacter(e);
}
}
void Window::<API key>(SemanticEventArgs& e)
{
fireEvent(EventSemanticEvent, e, EventNamespace);
// optionally propagate to parent
if (!e.handled && d_parent && this != getGUIContext().getModalWindow())
{
e.window = getParent();
getParent()-><API key>(e);
}
}
void Window::<API key>(DragDropEventArgs& e)
{
fireEvent(<API key>, e, EventNamespace);
}
void Window::<API key>(DragDropEventArgs& e)
{
fireEvent(<API key>, e, EventNamespace);
}
void Window::<API key>(DragDropEventArgs& e)
{
fireEvent(<API key>, e, EventNamespace);
}
void Window::setWindowRenderer(const String& name)
{
if (d_windowRenderer && d_windowRenderer->getName() == name)
return;
<API key>& wrm = <API key>::getSingleton();
if (d_windowRenderer != nullptr)
{
// Allow reset of renderer
if (d_windowRenderer->getName() == name)
return;
WindowEventArgs e(this);
<API key>(e);
wrm.<API key>(d_windowRenderer);
}
if (!name.empty())
{
Logger::getSingleton().logEvent("Assigning the window renderer '" +
name + "' to the window '" + d_name + "'", LoggingLevel::Informative);
d_windowRenderer = wrm.<API key>(name);
WindowEventArgs e(this);
<API key>(e);
}
else
throw <API key>(
"Attempt to assign a 'null' window renderer to window '" +
d_name + "'.");
}
WindowRenderer* Window::getWindowRenderer(void) const
{
return d_windowRenderer;
}
void Window::<API key>(WindowEventArgs& e)
{
if (!<API key>(d_windowRenderer))
throw <API key>(
"The window renderer '" + d_windowRenderer->getName() + "' is not "
"compatible with this widget type (" + getType() + ")");
d_windowRenderer->d_window = this;
d_windowRenderer->onAttach();
fireEvent(<API key>, e, EventNamespace);
}
void Window::<API key>(WindowEventArgs& e)
{
d_windowRenderer->onDetach();
d_windowRenderer->d_window = nullptr;
fireEvent(<API key>, e, EventNamespace);
}
bool Window::<API key>(const WindowRenderer*) const
{
return true;
}
const String& Window::<API key>() const
{
if (d_windowRenderer)
return d_windowRenderer->getName();
static String empty("");
return empty;
}
void Window::banPropertyFromXML(const String& property_name)
{
Property* instance = getPropertyInstance(property_name);
if (!instance->isWritable())
{
Logger::getSingleton().logEvent("Property '" + property_name + "' "
"is not writable so it's implicitly banned from XML. No need "
"to ban it manually", LoggingLevel::Warning);
return;
}
// check if the insertion failed
if (!<API key>.insert(property_name).second)
// just log the incidence
CEGUI_LOGINSANE("Window::banPropertyFromXML: The property '" +
property_name + "' is already banned in window '" + d_name + "'");
}
void Window::<API key>(const String& property_name)
{
banPropertyFromXML(property_name);
const size_t childCount = getChildCount();
for(size_t i = 0; i < childCount; ++i)
{
getChildAtIdx(i)-><API key>(property_name);
}
}
void Window::<API key>(const String& property_name)
{
<API key>.erase(property_name);
}
void Window::<API key>(const String& property_name)
{
<API key>(property_name);
const size_t childCount = getChildCount();
for(size_t i = 0; i < childCount; ++i)
{
getChildAtIdx(i)-><API key>(property_name);
}
}
bool Window::<API key>(const String& property_name) const
{
const <API key>::const_iterator i =
<API key>.find(property_name);
// generally, there will always less banned properties than all properties,
// so it makes sense to check that first before querying the property instance
if (i != <API key>.end())
{
return true;
}
// properties that don't write any XML code are implicitly banned
// read-only properties are implicitly banned
// (such stored information wouldn't be of any value in the XML anyways,
// no way to apply it to the widget)
Property* instance = getPropertyInstance(property_name);
return (!instance->doesWriteXML() || !instance->isWritable());
}
void Window::banPropertyFromXML(const Property* property)
{
if (property)
banPropertyFromXML(property->getName());
}
void Window::<API key>(const Property* property)
{
if (property)
<API key>(property->getName());
}
bool Window::<API key>(const Property* property) const
{
if (property)
return <API key>(property->getName());
else
return false;
}
bool Window::isPropertyAtDefault(const Property* property) const
{
// if we have a looknfeel we examine it for defaults
if (!d_lookName.empty())
{
if (d_parent && !getParent()->getLookNFeel().empty())
{
const WidgetLookFeel& wlf =
WidgetLookManager::getSingleton().
getWidgetLook(getParent()->getLookNFeel());
// If this property is a target of a PropertyLink, we always report it as being at default.
WidgetLookFeel::StringSet propDefNames = wlf.<API key>(true);
if(propDefNames.find(property->getName()) != propDefNames.end())
return true;
// for an auto-window see if the property is is set via a Property
// tag within the WidgetComponent that defines it.
if (d_autoWindow)
{
// Check if a widget component with the name was added to the look
if(wlf.<API key>(getName()))
{
const WidgetComponent& widgetComp = wlf.getWidgetComponent(getName());
const PropertyInitialiser* const propInitialiser = widgetComp.<API key>(property->getName());
if (propInitialiser)
return (getProperty(property->getName()) == propInitialiser->getInitialiserValue());
}
}
}
// if the looknfeel has a new default for this property we compare
// against that
const WidgetLookFeel& wlf =
WidgetLookManager::getSingleton().getWidgetLook(d_lookName);
const PropertyInitialiser* const propinit =
wlf.<API key>(property->getName());
if (propinit)
return (getProperty(property->getName()) ==
propinit->getInitialiserValue());
}
// we don't have a looknfeel with a new value for this property so we rely
// on the hardcoded default
return property->isDefault(this);
}
void Window::<API key>(void)
{
<API key>();
// inform children that their clipped screen areas must be updated
const size_t num = d_children.size();
for (size_t i=0; i<num; ++i)
if (getChildAtIdx(i)->isClippedByParent())
getChildAtIdx(i)-><API key>();
}
void Window::<API key>(bool recursive /* = true */)
{
<API key>();
Element::<API key>(recursive);
<API key>();
}
void Window::<API key>()
{
RenderingContext ctx;
getRenderingContext(ctx);
// move the underlying RenderingWindow if we're using such a thing
if (ctx.owner == this && ctx.surface->isRenderingWindow())
{
static_cast<RenderingWindow*>(ctx.surface)->
setPosition(<API key>().get().getPosition());
updatePivot();
d_translation = glm::vec3(0, 0, 0);
}
// if we're not texture backed, update geometry position.
else
{
// position is the offset of the window on the dest surface.
const Rectf ucrect(<API key>().get());
d_translation = glm::vec3(ucrect.d_min.x - ctx.offset.x,
ucrect.d_min.y - ctx.offset.y,
0.0f);
}
initialiseClippers(ctx);
<API key>();
}
bool Window::isDragDropTarget() const
{
return d_dragDropTarget;
}
void Window::setDragDropTarget(bool setting)
{
d_dragDropTarget = setting;
}
void Window::setFalagardType(const String& type, const String& rendererType)
{
// Retrieve the new widget look
const String separator("/");
String::size_type pos = type.find(separator);
const String newLook(type, 0, pos);
// Check if old one is the same. If so, ignore since we don't need to do
// anything (type is already assigned)
pos = d_falagardType.find(separator);
String oldLook(d_falagardType, 0, pos);
if(oldLook == newLook)
return;
// Obtain widget kind
String widget(d_falagardType, pos + 1);
// Build new type (look/widget)
d_falagardType = newLook + separator + widget;
// Set new renderer
if(rendererType.length() > 0)
setWindowRenderer(rendererType);
// Apply the new look to the widget
setLookNFeel(type);
}
bool Window::isTopOfZOrder() const
{
// if not attached, then always on top!
if (!d_parent)
return true;
// get position of window at top of z-order in same group as this window
ChildDrawList::reverse_iterator pos = getParent()->d_drawList.rbegin();
if (!d_alwaysOnTop)
{
// find last non-topmost window
while ((pos != getParent()->d_drawList.rend()) && (*pos)->isAlwaysOnTop())
++pos;
}
// return whether the window at the top of the z order is us
return *pos == this;
}
void Window::insertText(const String& text, const String::size_type position)
{
d_textLogical.insert(position, text);
<API key> = false;
#ifdef CEGUI_BIDI_SUPPORT
d_bidiDataValid = false;
#endif
WindowEventArgs args(this);
onTextChanged(args);
}
void Window::appendText(const String& text)
{
d_textLogical.append(text);
<API key> = false;
#ifdef CEGUI_BIDI_SUPPORT
d_bidiDataValid = false;
#endif
WindowEventArgs args(this);
onTextChanged(args);
}
std::vector<GeometryBuffer*>& Window::getGeometryBuffers()
{
return d_geometryBuffers;
}
void Window::<API key>(std::vector<GeometryBuffer*>& geomBuffers)
{
d_geometryBuffers.insert(d_geometryBuffers.end(), geomBuffers.begin(),
geomBuffers.end());
}
void Window::getRenderingContext(RenderingContext& ctx) const
{
if (d_windowRenderer)
d_windowRenderer->getRenderingContext(ctx);
else
<API key>(ctx);
}
void Window::<API key>(RenderingContext& ctx) const
{
if (d_surface)
{
ctx.surface = d_surface;
ctx.owner = this;
ctx.offset = <API key>().get().getPosition();
ctx.queue = RenderQueueID::Base;
}
else if (d_parent)
{
getParent()->getRenderingContext(ctx);
}
else
{
ctx.surface = &getGUIContext();
ctx.owner = nullptr;
ctx.offset = glm::vec2(0, 0);
ctx.queue = RenderQueueID::Base;
}
}
RenderingSurface* Window::getRenderingSurface() const
{
return d_surface;
}
RenderingSurface& Window::<API key>() const
{
if (d_surface)
return *d_surface;
else if (d_parent)
return getParent()-><API key>();
else
return getGUIContext();
}
void Window::setRenderingSurface(RenderingSurface* surface)
{
if (d_surface == surface)
return;
if (<API key>)
<API key>(false);
d_surface = surface;
// transfer child surfaces to this new surface
if (d_surface)
{
<API key>();
<API key>();
}
}
void Window::<API key>()
{
// invalidate our surface chain if we have one
if (d_surface)
d_surface->invalidate();
// else look through the hierarchy for a surface chain to invalidate.
else if (d_parent)
getParent()-><API key>();
}
const Window* Window::getRootWindow() const
{
return d_parent ? getParent()->getRootWindow() : this;
}
Window* Window::getRootWindow()
{
return const_cast<Window*>(
static_cast<const Window*>(this)->getRootWindow());
}
bool Window::<API key>() const
{
return <API key>;
}
bool Window::<API key>() const
{
return <API key>;
}
void Window::<API key>(bool setting)
{
if (setting)
{
<API key>(<API key>);
}
else
{
<API key>();
// make sure we set this because <API key> won't do it
// unless the surface was already initialised
<API key> = setting;
}
// while the actual area on screen may not have changed, the arrangement of
// surfaces and geometry did...
<API key>();
}
void Window::<API key>(bool setting)
{
if (<API key> != setting)
{
<API key> = setting;
if (!<API key>)
return;
// We need to recreate the auto rendering window since we just changed a crucial setting for it
<API key>();
<API key>(setting);
<API key> = true;
// while the actual area on screen may not have changed, the arrangement of
// surfaces and geometry did...
<API key>();
}
}
void Window::<API key>(bool addStencilBuffer)
{
if (!<API key>)
{
<API key> = true;
TextureTarget* const t =
System::getSingleton().getRenderer()->createTextureTarget(addStencilBuffer);
// TextureTargets may not be available, so check that first.
if (!t)
{
Logger::getSingleton().logEvent("Window::<API key> - "
"Failed to create a suitable TextureTarget for use by Window '"
+ d_name + "'", LoggingLevel::Error);
d_surface = nullptr;
return;
}
d_surface = &<API key>().<API key>(*t);
<API key>();
// set size and position of RenderingWindow
static_cast<RenderingWindow*>(d_surface)->setSize(getPixelSize());
static_cast<RenderingWindow*>(d_surface)->
setPosition(<API key>().get().getPosition());
getGUIContext().markAsDirty();
}
}
void Window::<API key>()
{
if (<API key> && d_surface)
{
RenderingWindow* const old_surface =
static_cast<RenderingWindow*>(d_surface);
<API key> = false;
d_surface = nullptr;
// detach child surfaces prior to destroying the owning surface
<API key>();
// destroy surface and texture target it used
TextureTarget* tt = &old_surface->getTextureTarget();
old_surface->getOwner().<API key>(*old_surface);
System::getSingleton().getRenderer()-><API key>(tt);
getGUIContext().markAsDirty();
}
}
void Window::<API key>()
{
RenderingSurface& s = <API key>();
const size_t child_count = getChildCount();
for (size_t i = 0; i < child_count; ++i)
{
Window* const c = getChildAtIdx(i);
if (c->d_surface && c->d_surface->isRenderingWindow())
s.<API key>(
*static_cast<RenderingWindow*>(c->d_surface));
else
c-><API key>();
}
}
void Window::initialiseClippers(const RenderingContext& ctx)
{
if (ctx.surface->isRenderingWindow() && ctx.owner == this)
{
RenderingWindow* const rendering_window =
static_cast<RenderingWindow*>(ctx.surface);
if (d_clippedByParent && d_parent)
rendering_window->setClippingRegion(
getParent()->getClipRect(d_nonClient));
else
rendering_window->setClippingRegion(
Rectf(glm::vec2(0, 0), <API key>()));
d_clippingRegion = Rectf(glm::vec2(0, 0), d_pixelSize);
}
else
{
Rectf geo_clip(getOuterRectClipper());
if (geo_clip.getWidth() != 0.0f && geo_clip.getHeight() != 0.0f)
geo_clip.offset(-ctx.offset);
d_clippingRegion = Rectf(geo_clip);
}
}
void Window::onRotated(ElementEventArgs& e)
{
Element::onRotated(e);
// TODO: Checking quaternion for equality with IDENTITY is stupid,
// change this to something else, checking with tolerance.
if (d_rotation != glm::quat() && !d_surface)
{
// if we have no surface set and the rotation differs from identity,
// enable the auto surface
Logger::getSingleton().logEvent("Window::setRotation - "
"Activating <API key> on Window '" + d_name +
"' to enable rotation support.");
<API key>(true);
// still no surface? Renderer or HW must not support what we need :(
if (!d_surface)
{
Logger::getSingleton().logEvent("Window::setRotation - "
"Failed to obtain a suitable ReneringWindow surface for "
"Window '" + d_name + "'. Rotation will not be available.",
LoggingLevel::Error);
return;
}
}
if (d_surface)
{
// ensure surface we have is the right type
if (!d_surface->isRenderingWindow())
{
Logger::getSingleton().logEvent("Window::setRotation - "
"Window '" + d_name + "' has a manual RenderingSurface that is not "
"a RenderingWindow. Rotation will not be available.", LoggingLevel::Error);
return;
}
// Checks / setup complete! Now we can finally set the rotation.
static_cast<RenderingWindow*>(d_surface)->setRotation(d_rotation);
updatePivot();
}
}
const RenderedString& Window::getRenderedString() const
{
if (!<API key>)
{
d_renderedString = <API key>().parse(
getTextVisual(), nullptr, nullptr);
<API key> = true;
}
return d_renderedString;
}
<API key>* Window::<API key>() const
{
return <API key>;
}
void Window::<API key>(<API key>* parser)
{
<API key> = parser;
<API key> = false;
}
<API key>& Window::<API key>() const
{
// if parsing is disabled, we use a <API key> that creates
// a RenderedString to renderi the input text verbatim (i.e. no parsing).
if (!<API key>)
return <API key>;
// Next prefer a custom <API key> assigned to this Window.
if (<API key>)
return *<API key>;
// Next prefer any globally set <API key>.
<API key>* const global_parser =
CEGUI::System::getSingleton().<API key>();
if (global_parser)
return *global_parser;
// if parsing is enabled and no custom <API key> is set anywhere,
// use the system's <API key> to do the parsing.
return d_basicStringParser;
}
glm::vec2 Window::<API key>(const glm::vec2& pos) const
{
RenderingSurface* rs = &<API key>();
// if window is not backed by RenderingWindow, return same pos.
if (!rs->isRenderingWindow())
return pos;
// get first target RenderingWindow
RenderingWindow* rw = static_cast<RenderingWindow*>(rs);
// setup for loop
glm::vec2 out_pos(pos);
// while there are rendering windows
while (rw)
{
// unproject the point for the current rw
const glm::vec2 in_pos(out_pos);
rw->unprojectPoint(in_pos, out_pos);
// get next rendering window, if any
rw = (rs = &rw->getOwner())->isRenderingWindow() ?
static_cast<RenderingWindow*>(rs) : 0;
}
return out_pos;
}
const String& Window::getTextVisual() const
{
#if defined(CEGUI_BIDI_SUPPORT)
// no bidi support
if (!d_bidiVisualMapping)
return d_textLogical;
if (!d_bidiDataValid)
{
d_bidiVisualMapping->updateVisual(d_textLogical);
d_bidiDataValid = true;
}
return d_bidiVisualMapping->getTextVisual();
#else
return d_textLogical;
#endif
}
bool Window::<API key>() const
{
return <API key>;
}
void Window::<API key>(const bool setting)
{
<API key> = setting;
<API key> = false;
WindowEventArgs args(this);
<API key>(args);
}
void Window::setMargin(const UBox& margin)
{
d_margin = margin;
WindowEventArgs args(this);
onMarginChanged(args);
}
const UBox& Window::getMargin() const
{
return d_margin;
}
void Window::<API key>(WindowEventArgs& e)
{
fireEvent(<API key>, e, EventNamespace);
}
void Window::onMarginChanged(WindowEventArgs& e)
{
fireEvent(EventMarginChanged, e, EventNamespace);
}
void Window::moveInFront(const Window* const window)
{
if (!window || !window->d_parent || window->d_parent != d_parent ||
window == this || window->d_alwaysOnTop != d_alwaysOnTop ||
!d_zOrderingEnabled)
return;
// find our position in the parent child draw list
const ChildDrawList::iterator p(std::find(getParent()->d_drawList.begin(),
getParent()->d_drawList.end(),
this));
// sanity checK that we were attached to our parent.
assert(p != getParent()->d_drawList.end());
// erase us from our current position
getParent()->d_drawList.erase(p);
// find window we're to be moved in front of in parent's draw list
ChildDrawList::iterator i(std::find(getParent()->d_drawList.begin(),
getParent()->d_drawList.end(),
window));
// sanity check that target window was also attached to correct parent.
assert(i != getParent()->d_drawList.end());
// reinsert ourselves at the right location
getParent()->d_drawList.insert(++i, this);
// handle event notifications for affected windows.
onZChange_impl();
}
void Window::moveBehind(const Window* const window)
{
if (!window || !window->d_parent || window->d_parent != d_parent ||
window == this || window->d_alwaysOnTop != d_alwaysOnTop ||
!d_zOrderingEnabled)
return;
// find our position in the parent child draw list
const ChildDrawList::iterator p(std::find(getParent()->d_drawList.begin(),
getParent()->d_drawList.end(),
this));
// sanity checK that we were attached to our parent.
assert(p != getParent()->d_drawList.end());
// erase us from our current position
getParent()->d_drawList.erase(p);
// find window we're to be moved in front of in parent's draw list
const ChildDrawList::iterator i(std::find(getParent()->d_drawList.begin(),
getParent()->d_drawList.end(),
window));
// sanity check that target window was also attached to correct parent.
assert(i != getParent()->d_drawList.end());
// reinsert ourselves at the right location
getParent()->d_drawList.insert(i, this);
// handle event notifications for affected windows.
onZChange_impl();
}
void Window::setUpdateMode(const WindowUpdateMode mode)
{
d_updateMode = mode;
}
WindowUpdateMode Window::getUpdateMode() const
{
return d_updateMode;
}
void Window::<API key>(const bool enabled)
{
<API key> = enabled;
}
bool Window::<API key>() const
{
return <API key>;
}
Window* Window::clone(const bool deepCopy) const
{
Window* ret =
WindowManager::getSingleton().createWindow(getType(), getName());
// always copy properties
clonePropertiesTo(*ret);
// if user requested deep copy, we should copy children as well
if (deepCopy)
cloneChildWidgetsTo(*ret);
return ret;
}
void Window::clonePropertiesTo(Window& target) const
{
for (PropertySet::PropertyIterator propertyIt = getPropertyIterator();
!propertyIt.isAtEnd();
++propertyIt)
{
const String& propertyName = propertyIt.getCurrentKey();
const String propertyValue = getProperty(propertyName);
// we never copy stuff that doesn't get written into XML
if (<API key>(propertyName))
continue;
// some cases when propertyValue is "" could lead to exception throws
if (propertyValue.empty())
{
// special case, this causes exception throw when no window renderer
// is assigned to the window
if (propertyName == "LookNFeel")
continue;
// special case, this causes exception throw because we are setting
// 'null' window renderer
if (propertyName == "WindowRenderer")
continue;
}
target.setProperty(propertyName, propertyValue);
}
}
void Window::cloneChildWidgetsTo(Window& target) const
{
// todo: ChildWindowIterator?
for (size_t childI = 0; childI < getChildCount(); ++childI)
{
Window* child = getChildAtIdx(childI);
if (child->isAutoWindow())
{
// we skip auto windows, they are already created
// automatically
// note: some windows store non auto windows inside auto windows,
// standard solution is to copy these non-auto windows to
// the parent window
// If you need alternative behaviour, you have to override
// this method!
// so just copy it's child widgets
child->cloneChildWidgetsTo(target);
// and skip the auto widget
continue;
}
Window* newChild = child->clone(true);
target.addChild(newChild);
}
}
size_t Window::getZIndex() const
{
if (!d_parent)
return 0;
ChildDrawList::iterator i = std::find(
getParent()->d_drawList.begin(),
getParent()->d_drawList.end(),
this);
if (i == getParent()->d_drawList.end())
throw <API key>(
"Window is not in its parent's draw list.");
return std::distance(getParent()->d_drawList.begin(), i);
}
bool Window::isInFront(const Window& wnd) const
{
// children are always in front of their ancestors
if (isAncestor(&wnd))
return true;
// conversely, ancestors are always behind their children
if (wnd.isAncestor(this))
return false;
const Window* const w1 = <API key>(wnd);
// seems not to be in same window hierarchy
if (!w1)
return false;
const Window* const w2 = wnd.<API key>(*this);
// at this point, w1 and w2 share the same parent.
return w2->getZIndex() > w1->getZIndex();
}
const Window* Window::<API key>(const Window& wnd) const
{
const Window* w = &wnd;
const Window* tmp = w->getParent();
while (tmp)
{
if (isAncestor(tmp))
break;
w = tmp;
tmp = tmp->getParent();
}
return tmp ? w : 0;
}
bool Window::isBehind(const Window& wnd) const
{
return !isInFront(wnd);
}
const Font* Window::property_getFont() const
{
// This is changed behaviour when compared to 0.7, we return the Font set
// for this window but we don't return name of the default font when
// no font is set. This is IMO more practical. User can always use
// getFont() directly to get 0.7 behaviour.
return getFont(false);
}
const Image* Window::property_getCursor() const
{
return getCursor();
}
void Window::updatePivot()
{
static_cast<RenderingWindow*>(d_surface)->setPivot(
glm::vec3(CoordConverter::asAbsolute(d_pivot.d_x, d_pixelSize.d_width, false),
CoordConverter::asAbsolute(d_pivot.d_y, d_pixelSize.d_height, false),
CoordConverter::asAbsolute(d_pivot.d_z, 0, false)));
}
GUIContext& Window::getGUIContext() const
{
// GUIContext is always the one on the root window, we do not allow parts
// of a hierarchy to be drawn to separate contexts (which is not much of
// a limitation).
// ISSUE: if root has no GUIContext set for it, should we return 0 or
// System::<API key>? Come to IRC and argue about it!
if (getParent() != nullptr)
{
return getParent()->getGUIContext();
}
else
{
if (d_guiContext)
return *d_guiContext;
else
return System::getSingleton().<API key>();
}
}
void Window::setGUIContext(GUIContext* context)
{
if (d_guiContext == context)
return;
d_guiContext = context;
syncTargetSurface();
}
const Sizef& Window::<API key>() const
{
return getGUIContext().getSurfaceSize();
}
float Window::getContentWidth() const
{
if (getWindowRenderer())
return getWindowRenderer()->getContentWidth();
return Element::getContentWidth();
}
float Window::getContentHeight() const
{
if (getWindowRenderer())
return getWindowRenderer()->getContentHeight();
return Element::getContentHeight();
}
UDim Window::<API key>()
const
{
if (getWindowRenderer())
return getWindowRenderer()-><API key>();
return Element::<API key>();
}
UDim Window::<API key>()
const
{
if (getWindowRenderer())
return getWindowRenderer()-> <API key>();
return Element::<API key>();
}
void Window::adjustSizeToContent()
{
if (!<API key>())
return;
if (getWindowRenderer())
{
getWindowRenderer()->adjustSizeToContent();
return;
}
Element::adjustSizeToContent();
}
bool Window::<API key>(const Sizef& element_size) const
{
if (getWindowRenderer())
return getWindowRenderer()-><API key>(element_size);
return Element::<API key>(element_size);
}
bool Window::contentFits() const
{
if (getWindowRenderer())
return getWindowRenderer()->contentFits();
return Element::contentFits();
}
void Window::setAutoWindow(bool is_auto)
{
d_autoWindow = is_auto;
if (d_autoWindow)
<API key>();
}
void Window::<API key>()
{
banPropertyFromXML("AutoWindow");
banPropertyFromXML("DestroyedByParent");
banPropertyFromXML("VerticalAlignment");
banPropertyFromXML("HorizontalAlignment");
banPropertyFromXML("Area");
banPropertyFromXML("Position");
banPropertyFromXML("Size");
banPropertyFromXML("MinSize");
banPropertyFromXML("MaxSize");
banPropertyFromXML(&<API key>);
banPropertyFromXML(&d_lookNFeelProperty);
}
bool Window::<API key>(const EventArgs& args)
{
if (!d_windowRenderer)
return false;
return d_windowRenderer-><API key>(
static_cast<const FontEventArgs&>(args).font);
}
bool Window::<API key>() const
{
return d_containsPointer;
}
bool Window::isFocused() const
{
return d_isFocused;
}
void Window::focus()
{
if (isDisabled())
return;
d_isFocused = true;
ActivationEventArgs event_args(this);
onActivated(event_args);
}
void Window::unfocus()
{
d_isFocused = false;
if (d_active)
{
ActivationEventArgs event_args(this);
onDeactivated(event_args);
}
}
bool Window::canFocus()
{
// by default all widgets can be focused if they are not disabled
return !isDisabled();
}
void Window::<API key>()
{
const size_t geom_buffer_count = d_geometryBuffers.size();
for (size_t i = 0; i < geom_buffer_count; ++i)
System::getSingleton().getRenderer()-><API key>(*d_geometryBuffers.at(i));
d_geometryBuffers.clear();
}
void Window::<API key>()
{
const size_t geom_buffer_count = d_geometryBuffers.size();
for (size_t i = 0; i < geom_buffer_count; ++i)
{
CEGUI::GeometryBuffer*& currentBuffer = d_geometryBuffers[i];
currentBuffer->setTranslation(d_translation);
currentBuffer->setClippingRegion(d_clippingRegion);
}
}
void Window::<API key>()
{
float final_alpha = getEffectiveAlpha();
const size_t geom_buffer_count = d_geometryBuffers.size();
for (size_t i = 0; i < geom_buffer_count; ++i)
{
CEGUI::GeometryBuffer*& currentBuffer = d_geometryBuffers[i];
currentBuffer->setAlpha(final_alpha);
}
}
#if defined(_MSC_VER)
# pragma warning(pop)
#endif
} // End of CEGUI namespace section |
<API key>
====================
Angular directive for validating UTF-8 full names on text inputs
## Usage
js
angular.module('yourapp', ['nameValidation']).controller('InYourController', ['nameValidation', function(nameValidation){
this.valid = nameValidation('\u1920\u8212 \u8211');
}]);
html
<form name="ctrl.form">
<input type="text" name-validation ng-model="ctrl.name" name="name">
<div ng-show="ctrl.form.name.$error.fullname">
Please fill in a valid full name
</div>
</form>
if invalid, the `fullname` key will be added to the `$error` object on the `ngModel` |
# SOAP API Node Js connector
This project demotrates how to connect to the Mystifly OnePoint SOAP API server with Node Js
## End points
Create Session
WIP
## To-do
1. use LowFareSearchGZip instead
2. Evaluate AirRevalidate |
#!/bin/bash
set -e
INPUT="$1"
if [ ! -f "${INPUT}" ]; then
echo "input file not exist"
exit 1
fi
virt-sparsify --check-tmpdir continue --convert qcow2 ${INPUT} ${INPUT}.sparsify
qemu-img convert -c -p -f qcow2 -O qcow2 ${INPUT}.sparsify ${INPUT}
rm -vf ${INPUT}.sparsify
chmod 0640 ${INPUT} |
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Class BarcodeMSI | TPS Broadcast</title>
<link rel="stylesheet" href="resources/style.css?<SHA1-like>">
</head>
<body>
<div id="left">
<div id="menu">
<a href="index.html" title="Overview"><span>Overview</span></a>
<div id="groups">
<h3>Namespaces</h3>
<ul>
<li class="active">
<a href="namespace-None.html">
None </a>
</li>
<li>
<a href="namespace-PHP.html">
PHP </a>
</li>
<li>
<a href="namespace-TPS.html">
TPS </a>
</li>
</ul>
</div>
<hr>
<div id="elements">
<h3>Classes</h3>
<ul>
<li><a href="class-Barcode.html" class="invalid">Barcode</a></li>
<li><a href="class-Barcode11.html" class="invalid">Barcode11</a></li>
<li><a href="class-Barcode128.html" class="invalid">Barcode128</a></li>
<li><a href="class-Barcode39.html" class="invalid">Barcode39</a></li>
<li><a href="class-Barcode93.html" class="invalid">Barcode93</a></li>
<li><a href="<API key>.html" class="invalid">BarcodeCodabar</a></li>
<li><a href="<API key>.html" class="invalid">BarcodeDatamatrix</a></li>
<li><a href="class-BarcodeEAN.html" class="invalid">BarcodeEAN</a></li>
<li><a href="class-BarcodeI25.html" class="invalid">BarcodeI25</a></li>
<li class="active"><a href="class-BarcodeMSI.html" class="invalid">BarcodeMSI</a></li>
<li><a href="class-BarcodeUPC.html" class="invalid">BarcodeUPC</a></li>
<li><a href="class-BCGBarcode.html">BCGBarcode</a></li>
<li><a href="class-BCGBarcode1D.html">BCGBarcode1D</a></li>
<li><a href="class-BCGcodabar.html">BCGcodabar</a></li>
<li><a href="class-BCGcode11.html">BCGcode11</a></li>
<li><a href="class-BCGcode128.html">BCGcode128</a></li>
<li><a href="class-BCGcode39.html">BCGcode39</a></li>
<li><a href="<API key>.html">BCGcode39extended</a></li>
<li><a href="class-BCGcode93.html">BCGcode93</a></li>
<li><a href="class-BCGColor.html">BCGColor</a></li>
<li><a href="class-BCGDraw.html">BCGDraw</a></li>
<li><a href="class-BCGDrawing.html">BCGDrawing</a></li>
<li><a href="class-BCGDrawJPG.html">BCGDrawJPG</a></li>
<li><a href="class-BCGDrawPNG.html">BCGDrawPNG</a></li>
<li><a href="class-BCGean13.html">BCGean13</a></li>
<li><a href="class-BCGean8.html">BCGean8</a></li>
<li><a href="class-BCGFontFile.html">BCGFontFile</a></li>
<li><a href="class-BCGFontPhp.html">BCGFontPhp</a></li>
<li><a href="class-BCGgs1128.html">BCGgs1128</a></li>
<li><a href="class-BCGi25.html">BCGi25</a></li>
<li><a href="<API key>.html">BCGintelligentmail</a></li>
<li><a href="class-BCGisbn.html">BCGisbn</a></li>
<li><a href="class-BCGLabel.html">BCGLabel</a></li>
<li><a href="class-BCGmsi.html">BCGmsi</a></li>
<li><a href="class-BCGothercode.html">BCGothercode</a></li>
<li><a href="class-BCGpostnet.html">BCGpostnet</a></li>
<li><a href="class-BCGs25.html">BCGs25</a></li>
<li><a href="class-BCGupca.html">BCGupca</a></li>
<li><a href="class-BCGupce.html">BCGupce</a></li>
<li><a href="class-BCGupcext2.html">BCGupcext2</a></li>
<li><a href="class-BCGupcext5.html">BCGupcext5</a></li>
<li><a href="class-JoinDraw.html">JoinDraw</a></li>
<li><a href="class-LibraryAPI.html">LibraryAPI</a></li>
<li><a href="class-playing.html">playing</a></li>
<li><a href="<API key>.html">standardResult</a></li>
<li><a href="class-TPS_Cron.html">TPS_Cron</a></li>
</ul>
<h3>Interfaces</h3>
<ul>
<li><a href="class-BCGFont.html">BCGFont</a></li>
</ul>
<h3>Exceptions</h3>
<ul>
<li><a href="<API key>.html"><API key></a></li>
<li><a href="<API key>.html">BCGDrawException</a></li>
<li><a href="<API key>.html">BCGParseException</a></li>
</ul>
<h3>Functions</h3>
<ul>
<li><a href="<API key>.html">absolute_include</a></li>
<li><a href="<API key>.html">ApplyUpdate</a></li>
<li><a href="<API key>.html">baseCustomSetup</a></li>
<li><a href="function-checkbrute.html">checkbrute</a></li>
<li><a href="<API key>.html">CheckStorage</a></li>
<li><a href="function-CheckTTF.html" class="invalid">CheckTTF</a></li>
<li><a href="<API key>.html">CheckUpdate</a></li>
<li><a href="<API key>.html">CheckUpdateStatus</a></li>
<li><a href="<API key>.html" class="invalid">convertTime</a></li>
<li><a href="<API key>.html" class="invalid">customSetup</a></li>
<li><a href="<API key>.html">DatabaseUpdateApply</a></li>
<li><a href="<API key>.html">DatabaseUpdateCheck</a></li>
<li><a href="function-DB_Auth.html">DB_Auth</a></li>
<li><a href="function-db_close.html">db_close</a></li>
<li><a href="function-db_conn.html">db_conn</a></li>
<li><a href="function-decrypt.html">decrypt</a></li>
<li><a href="function-drawCross.html" class="invalid">drawCross</a></li>
<li><a href="function-easy_crypt.html">easy_crypt</a></li>
<li><a href="<API key>.html">easy_decrypt</a></li>
<li><a href="function-encrypt.html">encrypt</a></li>
<li><a href="function-esc_url.html">esc_url</a></li>
<li><a href="function-Extensions.html">Extensions</a></li>
<li><a href="<API key>.html" class="invalid">file_put_contents</a></li>
<li><a href="function-findHOME.html">findHOME</a></li>
<li><a href="function-findLocal.html">findLocal</a></li>
<li><a href="<API key>.html">findValueFromKey</a></li>
<li><a href="<API key>.html"><API key></a></li>
<li><a href="function-getBrowser.html" class="invalid">getBrowser</a></li>
<li><a href="function-getButton.html">getButton</a></li>
<li><a href="<API key>.html">getCheckboxHtml</a></li>
<li><a href="<API key>.html">getElementHtml</a></li>
<li><a href="<API key>.html">getImageKeys</a></li>
<li><a href="<API key>.html">getInputTextHtml</a></li>
<li><a href="<API key>.html" class="deprecated">GetLabelbyId</a></li>
<li><a href="<API key>.html" class="deprecated">GetLibraryfull</a></li>
<li><a href="<API key>.html" class="deprecated">GetLibraryRefcode</a></li>
<li><a href="<API key>.html">getOptionGroup</a></li>
<li><a href="<API key>.html">getOptionHtml</a></li>
<li><a href="<API key>.html" class="invalid">getRealIpAddr</a></li>
<li><a href="<API key>.html">GetResponse</a></li>
<li><a href="<API key>.html">getSelectHtml</a></li>
<li><a href="<API key>.html" class="deprecated"><API key></a></li>
<li><a href="<API key>.html">is_session_started</a></li>
<li><a href="function-LDAP_AUTH.html">LDAP_AUTH</a></li>
<li><a href="<API key>.html">listbarcodes</a></li>
<li><a href="function-listfonts.html">listfonts</a></li>
<li><a href="<API key>.html" class="deprecated">ListLibrary</a></li>
<li><a href="<API key>.html">LoadStorage</a></li>
<li><a href="function-login.html">login</a></li>
<li><a href="<API key>.html">login_check</a></li>
<li><a href="function-MakeFont.html" class="invalid">MakeFont</a></li>
<li><a href="<API key>.html" class="invalid">MakeFontDescriptor</a></li>
<li><a href="<API key>.html" class="invalid">MakeFontEncoding</a></li>
<li><a href="<API key>.html" class="invalid">MakeWidthArray</a></li>
<li><a href="function-ReadAFM.html" class="invalid">ReadAFM</a></li>
<li><a href="function-ReadLong.html" class="invalid">ReadLong</a></li>
<li><a href="function-ReadMap.html" class="invalid">ReadMap</a></li>
<li><a href="function-ReadShort.html" class="invalid">ReadShort</a></li>
<li><a href="<API key>.html">registerImageKey</a></li>
<li><a href="<API key>.html">remove_utf8_bom</a></li>
<li><a href="<API key>.html">SaveStorage</a></li>
<li><a href="function-SaveToFile.html" class="invalid">SaveToFile</a></li>
<li><a href="<API key>.html">SearchLibrary</a></li>
<li><a href="<API key>.html">sec_session_start</a></li>
<li><a href="<API key>.html">set_db_params</a></li>
<li><a href="function-showError.html">showError</a></li>
<li><a href="function-to12hour.html" class="invalid">to12hour</a></li>
<li><a href="function-to24hour.html" class="invalid">to24hour</a></li>
<li><a href="<API key>.html">track_can_play</a></li>
<li><a href="<API key>.html">UPCAbarcode</a></li>
<li><a href="function-UpdateMeta.html">UpdateMeta</a></li>
<li><a href="<API key>.html"><API key></a></li>
<li><a href="<API key>.html"><API key></a></li>
<li><a href="function-Versions.html">Versions</a></li>
</ul>
</div>
</div>
</div>
<div id="splitter"></div>
<div id="right">
<div id="rightInner">
<form id="search">
<input type="hidden" name="cx" value="">
<input type="hidden" name="ie" value="UTF-8">
<input type="text" name="q" class="text" placeholder="Search">
</form>
<div id="navigation">
<ul>
<li>
<a href="index.html" title="Overview"><span>Overview</span></a>
</li>
<li>
<a href="namespace-None.html" title="Summary of None"><span>Namespace</span></a>
</li>
<li class="active">
<span>Class</span> </li>
</ul>
<ul>
<li>
<a href="tree.html" title="Tree view of classes, interfaces, traits and exceptions"><span>Tree</span></a>
</li>
<li>
<a href="<API key>.html" title="List of elements with todo annotation">
<span>Todo</span>
</a>
</li>
</ul>
<ul>
</ul>
</div>
<div id="content" class="class">
<h1>Class BarcodeMSI</h1>
<div class="invalid">
<p>
Documentation of this class could not be generated.
</p>
<p>
Class was originally declared in oep/EPV3/PHP/php-barcode.php and is invalid because of:
</p>
<ul>
</ul>
</div>
</div>
<div id="footer">
TPS Broadcast API documentation generated by <a href="http://apigen.org">ApiGen</a>
</div>
</div>
</div>
<script src="resources/combined.js"></script>
<script src="elementlist.js"></script>
</body>
</html> |
/* eslint-disable */
// !!! DO NOT EDIT THIS FILE !!! //
// This file is auto-generated by scripts/<API key>.sh in the repository. //
// Please refer to the script code to learn how to update the source data. //
import { WebAPICallResult } from '../WebClient';
export type CallsInfoResponse = WebAPICallResult & {
ok?: boolean;
call?: Call;
error?: string;
needed?: string;
provided?: string;
};
export interface Call {
id?: string;
date_start?: number;
external_unique_id?: string;
join_url?: string;
channels?: string[];
external_display_id?: string;
title?: string;
<API key>?: string;
users?: User[];
}
export interface User {
external_id?: string;
avatar_url?: string;
display_name?: string;
slack_id?: string;
} |
import {Issue} from "../issue";
import {ABAPRule} from "./_abap_rule";
import * as Statements from "../abap/2_statements/statements";
import * as Expressions from "../abap/2_statements/expressions";
import * as Structures from "../abap/3_structures/structures";
import {BasicRuleConfig} from "./_basic_rule_config";
import {IRuleMetadata, RuleTag} from "./_irule";
import {ABAPFile} from "../abap/abap_file";
export class ShortCaseConf extends BasicRuleConfig {
/** The smallest number of WHEN branches which will trigger a violation.
* Example: if length = 1, at least 2 branches are required
*/
public length: number = 1;
/** List of inputs for CASE which are allowed
* @uniqueItems true
*/
public allow: string[] = [];
}
export class ShortCase extends ABAPRule {
private conf = new ShortCaseConf();
public getMetadata(): IRuleMetadata {
return {
key: "short_case",
title: "Short CASE",
shortDescription: `Checks for CASE statements which have fewer than the specified number of branches`,
tags: [RuleTag.SingleFile],
};
}
private getMessage(): string {
return "CASE construct too short, it must have a minimum of " + (this.conf.length + 1) + " WHEN branches";
}
public getConfig() {
return this.conf;
}
public setConfig(conf: ShortCaseConf) {
this.conf = conf;
}
public runParsed(file: ABAPFile) {
const issues: Issue[] = [];
const struc = file.getStructure();
if (struc === undefined) {
return [];
}
for (const c of struc.findAllStructures(Structures.Case)) {
const clist = c.<API key>(Statements.Case);
if (clist.length > 0 && this.conf.allow && this.conf.allow.find((e) => { return e === clist[0].getTokens()[1].getStr(); })) {
continue;
}
if (c.<API key>(Structures.When).length <= this.conf.length) {
if (c.findAllExpressions(Expressions.Or).length > 0) {
continue;
}
const issue = Issue.atToken(file, c.getFirstToken(), this.getMessage(), this.getMetadata().key, this.conf.severity);
issues.push(issue);
}
}
return issues;
}
} |
<!DOCTYPE html>
<html lang="en">
<head prefix="og: http://ogp.me/ns
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1">
<meta name="description" content="">
<meta property="og:title" content="Running Cron in Windows ">
<meta property="og:type" content="article">
<meta property="article:published_time" content="2013-11-20">
<meta property="og:description" content="">
<meta property="og:url" content="http://purusothaman.me/<API key>/">
<meta property="og:site_name" content="Purusothaman Ramanujam">
<meta name="generator" content="Hugo 0.21" />
<title>Running Cron in Windows · Purusothaman Ramanujam</title>
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="http://purusothaman.me/css/style.css">
<link href="http://purusothaman.me/index.xml" rel="alternate" type="application/rss+xml" title="Purusothaman Ramanujam" />
<link rel="icon" href="http://purusothaman.me/favicon.ico" />
</head>
<body>
<nav class="navbar navbar-default navbar-fixed-top visible-xs">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#<API key>">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="http://purusothaman.me/">Purusothaman Ramanujam</a>
</div>
<div class="collapse navbar-collapse" id="<API key>">
<ul class="nav navbar-nav">
</ul>
</div>
</div>
</nav>
<div class="container-fluid">
<div class="row">
<div id="menu" class="hidden-xs col-sm-4 col-md-3">
<div id="menu-content" class="vertical-align">
<h1 class="text-center"><a href="http://purusothaman.me/">Purusothaman Ramanujam</a></h1>
<small class="text-center center-block">My Personal Flavour</small>
<img id="profile-pic" src="http://purusothaman.me//img/avatar.jpg" alt="My Picture" class="img-circle center-block">
<div id="social" class="text-center">
<a href="https://github.com/purus"><i class="fa fa-github fa-2x"></i></a>
<a href="mailto:purushoth.r@gmail.com"><i class="fa fa-envelope-o fa-2x"></i></a>
</div>
<div id="links" class="text-center">
</div>
</div>
</div>
<div id="content" class="col-xs-12 col-sm-8 col-md-9">
<div class="row">
<div id="post" class="col-sm-offset-1 col-sm-10 col-md-10 col-lg-8">
<main>
<header>
<h1>Running Cron in Windows </h1>
</header>
<article>
<p>We all would have heard of Cron jobs, if you are involved in website management, development or working on Linux/Unix machines.</p>
<p><strong>What’s a cron?</strong></p>
<blockquote>
<p>Cron is nothing but an demon job running in the background without any user intervention. It gets executed automatically based on the predefined time interval.</p>
</blockquote>
<p>Generally cron jobs are used to perform some maintenance activities in the server. For example, if you run a very popular blog, you can use the cron job to send out a weekly mail to all the users about the new blog posts. Or even removing any unwanted file uploads once a month. It’s not very unusual to link cron to *nix machines.</p>
<p>But coming to the reality, not all web developers(like me) work on *nix machines. I use WAMP stack for development and testing of my PHP projects. I often need to setup a cron for some important activities related to my applications. There is no direct way of setting up cron in your XAMP or XAMPP installation in Microsoft Windows.</p>
<p>Microsoft has included a tiny command line utility called “Task Scheduler” in its Windows Operating Systems. We invoke that utility by running schtasks.exe command.</p>
<p><strong>Listing all current scheduled tasks</strong></p>
<blockquote>
<p>In your Windows command prompt, type “schtasks” (without quotes) and press the Enter key. You can see the list of scheduled tasks in your machine.</p>
</blockquote>
<p><a href="/uploads/schtasks-status.png"><img src="/uploads/schtasks-status.png"></a></p>
<p><strong>Adding a new scheduled task</strong></p>
<p>To add a new task, you can use “schtasks /create” command. For example the below command, makes the scheduler to run the php file “run.php” every 1 minute.</p>
<blockquote>
<p>schtasks /create /sc minute /mo 1 /tn “My Cron” /tr “php -f C:\wamp\www\oxwall\ow_cron\run.php”</p>
</blockquote>
<p><a href="/uploads/schtasks-add.png"><img src="/uploads/schtasks-add.png"></a></p>
<blockquote>
<p>It might ask for your windows password if necessary.</p>
</blockquote>
<p>The breakup of the above command are provided below.</p>
<ul>
<li>/sc - defines the schedule type. Possible values are MINUTE, HOURLY, DAILY, WEEKLY, MONTHLY, ONCE, ONSTART, ONLOGON, ONIDLE</li>
<li>/mo - defines how often the task runs within its schedule type (Example : every minute, every day, or weekly once).</li>
<li>/tn - gives your task a name to easily identify</li>
<li>/tr - command or utility to be ran</li>
</ul>
<p>Once you are done, you could see the command prompt opening and closing for every minute as I set my cron for 1 minute. If you list down the tasks, you could see the new task added to the list.</p>
<p><strong>Deleting an existing task</strong>
To delete the task you can follow the below example.</p>
<blockquote>
<p>schtasks /delete /TN “My Cron”</p>
</blockquote>
<p>I have tested in my Windows machine and this should work for all other advanced versions too. For advanced options on modifiers please refer to <a href="http:
<hr />
</article>
</main>
<div id="bottom-nav" class="text-center center-block">
<a href=" http://purusothaman.me/" class="btn btn-default"><i class="fa fa-home"></i> Home</a>
</div>
<div id="disqus_thread"></div>
<script type="text/javascript">
var disqus_shortname = '<API key>';
var disqus_identifier = 'http:\/\/purusothaman.me\/<API key>\/';
var disqus_title = 'Running Cron in Windows ';
var disqus_url = 'http:\/\/purusothaman.me\/<API key>\/';
(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
(document.<API key>('head')[0] || document.<API key>('body')[0]).appendChild(dsq);
})();
</script>
<noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
<a href="http://disqus.com" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
(function(i,s,o,g,r,a,m){i['<API key>']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.<API key>(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','
ga('create', 'UA-42031335-1', 'auto');
ga('send', 'pageview');
window.baseURL = "http:\/\/purusothaman.me\/";
</script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/<TwitterConsumerkey>/3.3.2/js/bootstrap.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/topojson/1.6.9/topojson.min.js"></script>
<script src="http://purusothaman.me//js/App.js"></script>
</body>
</html> |
using UnityEngine;
using System.Collections;
public class CreatureUtils : MonoBehaviour {
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
}
//Keep creature inside world boundries
public void KeepWithinBoundries(GameObject creature) {
World worldScript = GameObject.Find("World").GetComponent<World> ();
float worldX = worldScript.xBoundry;
float worldY = worldScript.yBoundry;
float newX = 0;
float newY = 0;
if (creature.transform.position.x > worldX)
newX = worldX;
else if (creature.transform.position.x < -worldX)
newX = -worldX;
if (creature.transform.position.y > worldY)
newY = worldY;
else if (creature.transform.position.y < -worldY)
newY = -worldY;
if (newX != 0 && newY != 0) creature.transform.position = new Vector2 (newX, newY);
else if (newX != 0 && newY == 0) creature.transform.position = new Vector2 (newX, creature.transform.position.y);
else if (newX == 0 && newY != 0) creature.transform.position = new Vector2 (creature.transform.position.x, newY);
}
//Teleport to other side if leaving boundries
public void tpToOtherSide(GameObject creature) {
GameObject world = GameObject.Find("World");
World worldScript = world.GetComponent<World> ();
float newX = 0;
float newY = 0;
if(creature.transform.position.x > worldScript.xBoundry)
newX = -worldScript.xBoundry;
else if(creature.transform.position.x < -worldScript.xBoundry)
newX = worldScript.xBoundry;
if (creature.transform.position.y > worldScript.yBoundry)
newY = -worldScript.yBoundry;
else if (creature.transform.position.y < -worldScript.yBoundry)
newY = worldScript.yBoundry;
if (newX != 0 && newY != 0) creature.transform.position = new Vector2 (newX, newY);
else if (newX != 0 && newY == 0) creature.transform.position = new Vector2 (newX, creature.transform.position.y);
else if (newX == 0 && newY != 0) creature.transform.position = new Vector2 (creature.transform.position.x, newY);
}
} |
'use strict';
var assert = require('assert');
var fill = require('./');
it('should fill the elements in the array to the specified length.', function () {
assert.deepEqual(fill(['a', 'b', 'c'], 10), ['a','b','c','a','b','c','a','b','c','a']);
assert.deepEqual(fill(['ab', 'cd'], 3), ['ab', 'cd', 'ab']);
assert.deepEqual(fill(['ab', 'cd'], 4), ['ab', 'cd', 'ab', 'cd']);
assert.deepEqual(fill(['ab', 'cd'], 5), ['ab', 'cd', 'ab', 'cd', 'ab']);
assert.deepEqual(fill(['ab', 'cd'], 6), ['ab', 'cd', 'ab', 'cd', 'ab', 'cd']);
});
it('should return the array when the given length is shorter than the array.', function () {
assert.deepEqual(fill(['ab', 'cd'], 1), ['ab', 'cd']);
});
it('should return the array when the given length is equal to the array length.', function () {
assert.deepEqual(fill(['a', 'b', 'c'], 3), ['a', 'b', 'c']);
assert.deepEqual(fill(['ab', 'cd'], 2), ['ab', 'cd']);
}); |
#ifndef SCENE_H
#define SCENE_H
#include "Exporter/Definitions/Model.h"
#include <string>
#include <vector>
class Scene {
public:
Scene();
~Scene();
std::string name;
std::vector<Model*>* models;
Model* GetModelByModelName(std::string name);
void <API key>();
private:
};
#endif // SCENE_H |
#include "k_points_util.h"
#include <algorithm>
#include <boost/functional/hash.hpp>
#include <cmath>
#include <exception>
#include <unordered_set>
#include "../array_math.h"
int KPointsUtil::get_n_k_points(const double rcut) {
int count = 0;
const int n_max = std::floor(static_cast<float>(rcut));
double rcut_square = rcut * rcut;
for (int i = -n_max; i <= n_max; i++) {
for (int j = -n_max; j <= n_max; j++) {
for (int k = -n_max; k <= n_max; k++) {
if (i * i + j * j + k * k > rcut_square) continue;
count++;
}
}
}
return count;
}
std::vector<std::array<int8_t, 3>> KPointsUtil::generate_k_points(
const double rcut) {
std::vector<std::array<int8_t, 3>> k_points;
const int n_max = std::floor(static_cast<float>(rcut));
assert(n_max < 127);
double rcut_square = rcut * rcut;
for (int i = -n_max; i <= n_max; i++) {
for (int j = -n_max; j <= n_max; j++) {
for (int k = -n_max; k <= n_max; k++) {
if (i * i + j * j + k * k > rcut_square) continue;
k_points.push_back(std::array<int8_t, 3>({static_cast<int8_t>(i),
static_cast<int8_t>(j),
static_cast<int8_t>(k)}));
}
}
}
std::stable_sort(
k_points.begin(),
k_points.end(),
[](const auto& a, const auto& b) -> bool {
return squared_norm(a) < squared_norm(b);
});
return k_points;
}
std::vector<std::array<int8_t, 3>> KPointsUtil::get_k_diffs(
const std::vector<std::array<int8_t, 3>>& k_points) {
// Generate all possible differences between two different k points.
std::unordered_set<std::array<int8_t, 3>, boost::hash<std::array<int8_t, 3>>>
k_diffs_set;
std::vector<std::array<int8_t, 3>> k_diffs;
const int n_k_points = k_points.size();
for (int p = 0; p < n_k_points; p++) {
for (int q = 0; q < n_k_points; q++) {
if (p == q) continue;
const auto& diff_pq = k_points[q] - k_points[p];
if (k_diffs_set.count(diff_pq) == 1) continue;
k_diffs.push_back(diff_pq);
k_diffs_set.insert(diff_pq);
}
}
// Sort k_diffs into ascending order so that later sorting hci queue will be
// faster.
std::stable_sort(
k_diffs.begin(), k_diffs.end(), [](const auto& a, const auto& b) -> bool {
return squared_norm(a) < squared_norm(b);
});
return k_diffs;
} |
(function(g,b){b.useDefaults();ltoptions.debug?b.setLevel(b.Debug):b.setLevel(b.WARN);g.onerror=function(a,d,e,f,c){if(e||d)a=a+"\nurl: "+d+"\non line "+e,f&&(a=a+" symbol "+f),c&&"stack"in c&&(a=a+"\n"+c.stack),b.error(a)}})(window,Logger); |
package coremock
import (
"net"
"github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/ipfs/go-datastore"
syncds "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/ipfs/go-datastore/sync"
context "gx/ipfs/<API key>/go-net/context"
commands "github.com/ipfs/go-ipfs/commands"
core "github.com/ipfs/go-ipfs/core"
"github.com/ipfs/go-ipfs/repo"
config "github.com/ipfs/go-ipfs/repo/config"
ds2 "github.com/ipfs/go-ipfs/thirdparty/datastore2"
testutil "github.com/ipfs/go-ipfs/thirdparty/testutil"
host "gx/ipfs/<API key>/go-libp2p/p2p/host"
metrics "gx/ipfs/<API key>/go-libp2p/p2p/metrics"
mocknet "gx/ipfs/<API key>/go-libp2p/p2p/net/mock"
peer "gx/ipfs/<API key>/go-libp2p/p2p/peer"
)
// NewMockNode constructs an IpfsNode for use in tests.
func NewMockNode() (*core.IpfsNode, error) {
ctx := context.Background()
// effectively offline, only peer in its network
return core.NewNode(ctx, &core.BuildCfg{
Online: true,
Host: MockHostOption(mocknet.New(ctx)),
})
}
func MockHostOption(mn mocknet.Mocknet) core.HostOption {
return func(ctx context.Context, id peer.ID, ps peer.Peerstore, bwr metrics.Reporter, fs []*net.IPNet) (host.Host, error) {
return mn.<API key>(id, ps)
}
}
func MockCmdsCtx() (commands.Context, error) {
// Generate Identity
ident, err := testutil.RandIdentity()
if err != nil {
return commands.Context{}, err
}
p := ident.ID()
conf := config.Config{
Identity: config.Identity{
PeerID: p.String(),
},
}
r := &repo.Mock{
D: ds2.CloserWrap(syncds.MutexWrap(datastore.NewMapDatastore())),
C: conf,
}
node, err := core.NewNode(context.Background(), &core.BuildCfg{
Repo: r,
})
if err != nil {
return commands.Context{}, err
}
return commands.Context{
Online: true,
ConfigRoot: "/tmp/.mockipfsconfig",
LoadConfig: func(path string) (*config.Config, error) {
return &conf, nil
},
ConstructNode: func() (*core.IpfsNode, error) {
return node, nil
},
}, nil
} |
.tt-hint {
display: none;
}
.tt-menu {
width: 332px;
margin: 8px 0;
background-color: #fff;
border: 1px solid #ccc;
border: 1px solid rgba(0, 0, 0, 0.2);
-<API key>: 8px;
-moz-border-radius: 8px;
border-radius: 8px;
-webkit-box-shadow: 0 5px 10px rgba(0,0,0,.2);
-moz-box-shadow: 0 5px 10px rgba(0,0,0,.2);
box-shadow: 0 5px 10px rgba(0,0,0,.2);
}
.tt-suggestion {
width: 312px;
display: block;
padding: 3px 10px;
font-size: 13px;
line-height: 1.5;
border-bottom: 1px solid #CCC;
color: #4F4F4F;
}
.tt-suggestion:first-child {
-<API key>: 8px 8px 0 0;
-moz-border-radius: 8px 8px 0 0;
border-radius: 8px 8px 0 0;
}
.tt-suggestion:last-child {
-<API key>: 0 0 8px 8px;
-moz-border-radius: 0 0 8px 8px;
border-radius: 0 0 8px 8px;
border-bottom: none;
}
.tt-suggestion:hover {
cursor: pointer;
color: #fff;
border-color: #0097cf;
background-color: #0097cf;
}
.tt-suggestion.tt-cursor {
color: #fff;
background-color: #0097cf;
}
.tt-suggestion p {
font-size: 12px;
} |
module.exports = require('./lib').default;
module.exports.default = module.exports;
module.exports.NextButton = require('./lib').NextButton;
module.exports.PreviousButton = require('./lib').PreviousButton;
module.exports.PagingDots = require('./lib').PagingDots; |
#pragma once
#include "Position.h"
#include "Action.h"
#include "PlayerState.h"
#define GUARD_RADIUS 4.5f
#define GUARD_LINE 2.5f
#define DIRECTION_TOLERANCE 0.1f
#define <API key> 15.0f
#define <API key> 0.25f
#define <API key> 1.2f
#define <API key> 2.0f
#define <API key> 11.0f
#define <API key> 20.0
#define <API key> 20
struct CCapability{
float kickingAbility_;
float runningAbility_;
float ballControlAbility_;
float tacklingAbility_;
};
class CPitch;
class CBall;
class CPlayer
{
public:
typedef vector<CPlayer> Vec;
typedef shared_ptr<CPlayer> Ptr;
typedef vector<Ptr> PtrVec;
enum ePlayerType{
eNonGoalKeeper = -1,
eGoalKeeper = 0,
eLeftDefender,
eCentreDefender,
eRightDefender,
eLeftStriker,
eRightStriker
};
enum eMarkingPlayerType
{
eNotMarking = -1
};
CPlayer();
virtual ~CPlayer();
inline void SetNumber(int number) { playerNumber_ = number; }
inline int GetNumber() { return playerNumber_; }
inline void SetType(int type) { playerType_ = type; }
inline int GetType() { return playerType_; }
inline float GetKickOffDirection() { return kickOffDirection_; }
inline Position& GetKickOffPosition() { return kickOffPos_; }
inline float GetHomeDirection() { return homeDirection_; }
inline Position& GetHomePosition() { return homePos_; }
inline float GetAttackDirection() { return attackDirection_; }
inline Position& GetAttackPosition() { return attackPos_; }
inline void SetHomeDirection(float direction) { homeDirection_ = direction; }
inline void SetHomePosition(const Position& pos) { homePos_ = pos; }
inline void SetKickOffDirection(float direction) { kickOffDirection_ = direction; }
inline void SetKickOffPosition(const Position& pos) { kickOffPos_ = pos; }
inline void SetAttackDirection(float direction) { attackDirection_ = direction; }
inline void SetAttackPosition(const Position& pos) { attackPos_ = pos; }
void SetTeamNumber(int teamNumber) { teamNumber_ = teamNumber; }
int GetTeamNumber() { return teamNumber_; }
bool IsOurTeamMember(); //using team number to identify team.
bool IsTheirTeamMember();
inline CCapability& GetCapability() { return capability_; }
inline CAction& GetAction() { return action_; }
inline Position& GetPosition() { return pos_; }
inline CPlayerState* GetState() { return pState_; }
inline float GetDirection() { return direction_; }
inline bool HasBall() { return hasBall_;}
void ChangeState(int type);
int ProcessStaticState(const Value& staticState);
int ProcessDynamicState(const Value& dynamicState);
// update action
void MoveTo(const Position& destination);
void TurnTo(float direction);
void TakePossession();
void Kick(const Position& destination, float speed);
void <API key>(const Position& hittingAt);
float CalculateTimeToTurn(float direction);
float <API key>(const Position& pos);
float PredictDirection();
void MoveToGuardGoal(); //called by goalkeeper
void <API key>();
void <API key>();
void <API key>();
void <API key>();
void <API key>();
void MoveForBall(); // this should handle all condtion for ball interception,chase_ball
void KickShort(float power);
void KickShort_Striker();
void Kick_Defender();
void Kick_GoalKeeper();
bool <API key>(int playerNumber);
void SelectMarkedPlayer();
inline void <API key>(int playerNumber) { markedPlayerNumber_ = playerNumber; }
inline int <API key>() { return markedPlayerNumber_; }
bool IsTheirPlayerNear(float distance);
bool <API key>(float max_distance);
bool <API key>();
inline void SetShootCache(const Position& shootAt) { shootAt_ = shootAt; isShootCached_ = true; }
inline bool GetShootCache(Position& shootAt) { if (isShootCached_) { shootAt = shootAt_;} return isShootCached_; }
inline void ResetShootCache() {isShootCached_ = false;}
Position <API key>();
//only for goalkeeper.
inline void <API key>() { <API key>++; }
inline int <API key>() { return <API key>;}
inline void <API key>() { <API key> = 0;}
inline int <API key>() { return <API key>; }
inline void <API key>(int playerNumber) { <API key> = playerNumber; }
inline void <API key>() { <API key> = -1; }
Position <API key>();
bool IsKickDirectionSafe(float direction, float speed, float limitDistance);
void <API key>(float& direction, float& speed, float limitDistance); |
require 'spec_helper'
require 'puppet_spec/compiler'
describe "Two step scoping for variables" do
include PuppetSpec::Compiler
def <API key>(message, node = Puppet::Node.new('the node'))
catalog = compile_to_catalog(yield, node)
catalog.resource('Notify', 'something')[:message].should == message
end
before :each do
Puppet.expects(:deprecation_warning).never
end
describe "fully qualified variable names" do
it "keeps nodescope separate from topscope" do
<API key>('topscope') do <<-MANIFEST
$c = "topscope"
node default {
$c = "nodescope"
notify { 'something': message => $::c }
}
MANIFEST
end
end
end
describe "when colliding class and variable names" do
it "finds a topscope variable with the same name as a class" do
<API key>('topscope') do <<-MANIFEST
$c = "topscope"
class c { }
node default {
include c
notify { 'something': message => $c }
}
MANIFEST
end
end
it "finds a node scope variable with the same name as a class" do
<API key>('nodescope') do <<-MANIFEST
class c { }
node default {
$c = "nodescope"
include c
notify { 'something': message => $c }
}
MANIFEST
end
end
it "finds a class variable when the class collides with a nodescope variable" do
<API key>('class') do <<-MANIFEST
class c { $b = "class" }
node default {
$c = "nodescope"
include c
notify { 'something': message => $c::b }
}
MANIFEST
end
end
it "finds a class variable when the class collides with a topscope variable" do
<API key>('class') do <<-MANIFEST
$c = "topscope"
class c { $b = "class" }
node default {
include c
notify { 'something': message => $::c::b }
}
MANIFEST
end
end
end
describe "when using shadowing and inheritance" do
it "finds value define in the inherited node" do
<API key>('parent_msg') do <<-MANIFEST
$var = "top_msg"
node parent {
$var = "parent_msg"
}
node default inherits parent {
include foo
}
class foo {
notify { 'something': message => $var, }
}
MANIFEST
end
end
it "finds top scope when the class is included before the node defines the var" do
<API key>('top_msg') do <<-MANIFEST
$var = "top_msg"
node parent {
include foo
}
node default inherits parent {
$var = "default_msg"
}
class foo {
notify { 'something': message => $var, }
}
MANIFEST
end
end
it "finds top scope when the class is included before the node defines the var" do
<API key>('top_msg') do <<-MANIFEST
$var = "top_msg"
node parent {
include foo
}
node default inherits parent {
$var = "default_msg"
}
class foo {
notify { 'something': message => $var, }
}
MANIFEST
end
end
it "finds values in its local scope" do
<API key>('local_msg') do <<-MANIFEST
node default {
include baz
}
class foo {
}
class bar inherits foo {
$var = "local_msg"
notify { 'something': message => $var, }
}
class baz {
include bar
}
MANIFEST
end
end
it "finds values in its inherited scope" do
<API key>('foo_msg') do <<-MANIFEST
node default {
include baz
}
class foo {
$var = "foo_msg"
}
class bar inherits foo {
notify { 'something': message => $var, }
}
class baz {
include bar
}
MANIFEST
end
end
it "prefers values in its local scope over values in the inherited scope" do
<API key>('local_msg') do <<-MANIFEST
include bar
class foo {
$var = "inherited"
}
class bar inherits foo {
$var = "local_msg"
notify { 'something': message => $var, }
}
MANIFEST
end
end
it "finds a qualified variable by following parent scopes of the specified scope" do
<API key>("from node") do <<-MANIFEST
class c {
notify { 'something': message => "$a::b" }
}
class a { }
node default {
$b = "from node"
include a
include c
}
MANIFEST
end
end
it "finds values in its inherited scope when the inherited class is qualified to the top" do
<API key>('foo_msg') do <<-MANIFEST
node default {
include baz
}
class foo {
$var = "foo_msg"
}
class bar inherits ::foo {
notify { 'something': message => $var, }
}
class baz {
include bar
}
MANIFEST
end
end
it "prefers values in its local scope over values in the inherited scope when the inherited class is fully qualified" do
<API key>('local_msg') do <<-MANIFEST
include bar
class foo {
$var = "inherited"
}
class bar inherits ::foo {
$var = "local_msg"
notify { 'something': message => $var, }
}
MANIFEST
end
end
it "finds values in top scope when the inherited class is qualified to the top" do
<API key>('top msg') do <<-MANIFEST
$var = "top msg"
class foo {
}
class bar inherits ::foo {
notify { 'something': message => $var, }
}
include bar
MANIFEST
end
end
it "finds values in its inherited scope when the inherited class is a nested class that shadows another class at the top" do
<API key>('inner baz') do <<-MANIFEST
node default {
include foo::bar
}
class baz {
$var = "top baz"
}
class foo {
class baz {
$var = "inner baz"
}
class bar inherits baz {
notify { 'something': message => $var, }
}
}
MANIFEST
end
end
it "finds values in its inherited scope when the inherited class is qualified to a nested class and qualified to the top" do
<API key>('top baz') do <<-MANIFEST
node default {
include foo::bar
}
class baz {
$var = "top baz"
}
class foo {
class baz {
$var = "inner baz"
}
class bar inherits ::baz {
notify { 'something': message => $var, }
}
}
MANIFEST
end
end
it "finds values in its inherited scope when the inherited class is qualified" do
<API key>('foo_msg') do <<-MANIFEST
node default {
include bar
}
class foo {
class baz {
$var = "foo_msg"
}
}
class bar inherits foo::baz {
notify { 'something': message => $var, }
}
MANIFEST
end
end
it "prefers values in its inherited scope over those in the node (with intermediate inclusion)" do
<API key>('foo_msg') do <<-MANIFEST
node default {
$var = "node_msg"
include baz
}
class foo {
$var = "foo_msg"
}
class bar inherits foo {
notify { 'something': message => $var, }
}
class baz {
include bar
}
MANIFEST
end
end
it "prefers values in its inherited scope over those in the node (without intermediate inclusion)" do
<API key>('foo_msg') do <<-MANIFEST
node default {
$var = "node_msg"
include bar
}
class foo {
$var = "foo_msg"
}
class bar inherits foo {
notify { 'something': message => $var, }
}
MANIFEST
end
end
it "prefers values in its inherited scope over those from where it is included" do
<API key>('foo_msg') do <<-MANIFEST
node default {
include baz
}
class foo {
$var = "foo_msg"
}
class bar inherits foo {
notify { 'something': message => $var, }
}
class baz {
$var = "baz_msg"
include bar
}
MANIFEST
end
end
it "does not used variables from classes included in the inherited scope" do
<API key>('node_msg') do <<-MANIFEST
node default {
$var = "node_msg"
include bar
}
class quux {
$var = "quux_msg"
}
class foo inherits quux {
}
class baz {
include foo
}
class bar inherits baz {
notify { 'something': message => $var, }
}
MANIFEST
end
end
it "does not use a variable from a scope lexically enclosing it" do
<API key>('node_msg') do <<-MANIFEST
node default {
$var = "node_msg"
include other::bar
}
class other {
$var = "other_msg"
class bar {
notify { 'something': message => $var, }
}
}
MANIFEST
end
end
it "finds values in its node scope" do
<API key>('node_msg') do <<-MANIFEST
node default {
$var = "node_msg"
include baz
}
class foo {
}
class bar inherits foo {
notify { 'something': message => $var, }
}
class baz {
include bar
}
MANIFEST
end
end
it "finds values in its top scope" do
<API key>('top_msg') do <<-MANIFEST
$var = "top_msg"
node default {
include baz
}
class foo {
}
class bar inherits foo {
notify { 'something': message => $var, }
}
class baz {
include bar
}
MANIFEST
end
end
it "prefers variables from the node over those in the top scope" do
<API key>('node_msg') do <<-MANIFEST
$var = "top_msg"
node default {
$var = "node_msg"
include foo
}
class foo {
notify { 'something': message => $var, }
}
MANIFEST
end
end
it "finds top scope variables referenced inside a defined type" do
<API key>('top_msg') do <<-MANIFEST
$var = "top_msg"
node default {
foo { "testing": }
}
define foo() {
notify { 'something': message => $var, }
}
MANIFEST
end
end
it "finds node scope variables referenced inside a defined type" do
<API key>('node_msg') do <<-MANIFEST
$var = "top_msg"
node default {
$var = "node_msg"
foo { "testing": }
}
define foo() {
notify { 'something': message => $var, }
}
MANIFEST
end
end
end
describe "in situations that used to have dynamic lookup" do
it "ignores the dynamic value of the var" do
<API key>('node_msg') do <<-MANIFEST
node default {
$var = "node_msg"
include foo
}
class baz {
$var = "baz_msg"
include bar
}
class foo inherits baz {
}
class bar {
notify { 'something': message => $var, }
}
MANIFEST
end
end
it "finds nil when the only set variable is in the dynamic scope" do
<API key>(nil) do <<-MANIFEST
node default {
include baz
}
class foo {
}
class bar inherits foo {
notify { 'something': message => $var, }
}
class baz {
$var = "baz_msg"
include bar
}
MANIFEST
end
end
it "ignores the value in the dynamic scope for a defined type" do
<API key>('node_msg') do <<-MANIFEST
node default {
$var = "node_msg"
include foo
}
class foo {
$var = "foo_msg"
bar { "testing": }
}
define bar() {
notify { 'something': message => $var, }
}
MANIFEST
end
end
end
describe "using plussignment to change in a new scope" do
it "does not change a string in the parent scope" do
<API key>('top_msg') do <<-MANIFEST
$var = "top_msg"
class override {
$var += "override"
include foo
}
class foo {
notify { 'something': message => $var, }
}
include override
MANIFEST
end
end
it "does not change an array in the parent scope" do
<API key>('top_msg') do <<-MANIFEST
$var = ["top_msg"]
class override {
$var += ["override"]
include foo
}
class foo {
notify { 'something': message => $var, }
}
include override
MANIFEST
end
end
it "concatenates two arrays" do
<API key>(['top_msg', 'override']) do <<-MANIFEST
$var = ["top_msg"]
class override {
$var += ["override"]
notify { 'something': message => $var, }
}
include override
MANIFEST
end
end
it "leaves an array of arrays unflattened" do
<API key>([['top_msg'], ['override']]) do <<-MANIFEST
$var = [["top_msg"]]
class override {
$var += [["override"]]
notify { 'something': message => $var, }
}
include override
MANIFEST
end
end
it "does not change a hash in the parent scope" do
<API key>({"key"=>"top_msg"}) do <<-MANIFEST
$var = { "key" => "top_msg" }
class override {
$var += { "other" => "override" }
include foo
}
class foo {
notify { 'something': message => $var, }
}
include override
MANIFEST
end
end
it "replaces a value of a key in the hash instead of merging the values" do
<API key>({"key"=>"override"}) do <<-MANIFEST
$var = { "key" => "top_msg" }
class override {
$var += { "key" => "override" }
notify { 'something': message => $var, }
}
include override
MANIFEST
end
end
end
describe "when using an enc" do
it "places enc parameters in top scope" do
enc_node = Puppet::Node.new("the node", { :parameters => { "var" => 'from_enc' } })
<API key>('from_enc', enc_node) do <<-MANIFEST
notify { 'something': message => $var, }
MANIFEST
end
end
it "does not allow the enc to specify an existing top scope var" do
enc_node = Puppet::Node.new("the_node", { :parameters => { "var" => 'from_enc' } })
expect {
compile_to_catalog("$var = 'top scope'", enc_node)
}.to raise_error(
Puppet::Error,
"Cannot reassign variable var at line 1 on node the_node"
)
end
it "evaluates enc classes in top scope when there is no node" do
enc_node = Puppet::Node.new("the node", { :classes => ['foo'], :parameters => { "var" => 'from_enc' } })
<API key>('from_enc', enc_node) do <<-MANIFEST
class foo {
notify { 'something': message => $var, }
}
MANIFEST
end
end
it "evaluates enc classes in the node scope when there is a matching node" do
enc_node = Puppet::Node.new("the_node", { :classes => ['foo'] })
<API key>('from matching node', enc_node) do <<-MANIFEST
node inherited {
$var = "from inherited"
}
node the_node inherits inherited {
$var = "from matching node"
}
class foo {
notify { 'something': message => $var, }
}
MANIFEST
end
end
end
end |
<?php
namespace haqqi\metronic\controllers;
use haqqi\metronic\base\MetronicController;
class PortletController extends MetronicController
{
public function actionSolid() {
return $this->render('solid');
}
} |
<!DOCTYPE html PUBLIC "-
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
<link rel="stylesheet" type="text/css" href="http://db.cec.gov.tw/votehist.css">
<script type="text/javascript">
function AddToFaves_hp() {
var is_4up = parseInt(navigator.appVersion);
var is_mac = navigator.userAgent.toLowerCase().indexOf("mac")!=-1;
var is_ie = navigator.userAgent.toLowerCase().indexOf("msie")!=-1;
var thePage = location.href;
if (thePage.lastIndexOf('
thePage = thePage.substring(0,thePage.lastIndexOf('
if (is_ie && is_4up && !is_mac)
window.external.AddFavorite(thePage,document.title);
else if (is_ie || document.images)
booker_hp = window.open(thePage,'booker_','menubar,width=325,height=100,left=140,top=60');
//booker_hp.focus();
}
</script>
</head>
<body class="frame">
<!DOCTYPE html PUBLIC "-
<div style="width: 100%; height: 56px; margin: 0px 0px 0px 0px; border-style: solid; border-width: 0px 0px 1px 0px; border-color: black;">
<div style="float: left;">
<img src="http://db.cec.gov.tw/images/main_title.gif" />
</div>
<div style="width: 100%; height: 48px;">
<div style="text-align: center;">
<img src="http://db.cec.gov.tw/images/small_ghost.gif" /> <span
style="height: 30px; font-size: 20px;"> <a href="http:
style="text-decoration: none;"></a>
</span>
</div>
</div>
<div style="width: 100%; height: 8px; background-color: #fde501;">
</div>
</div>
<!DOCTYPE html PUBLIC "-
<div
style="width: 100%; height: 29px; background-image: url('http://db.cec.gov.tw/images/tab_background.gif'); background-repeat: repeat-x;">
<div style="text-align: center;">
<a href="histMain.jsp"><img border="0" src="http://db.cec.gov.tw/images/tab_01.gif" /></a>
<a href="histCand.jsp"><img border="0" src="http://db.cec.gov.tw/images/tab_02.gif" /></a>
<!-- <a href=""><img border="0" src="images/tab_03.gif" /></a> -->
<!-- <a href=""><img border="0" src="images/tab_04.gif" /></a> -->
<a href="histQuery.jsp?voteCode=20120101T1A2&qryType=ctks&prvCode=03&cityCode=000&areaCode=04&deptCode=016&liCode=0315
<a href="mailto:info@cec.gov.tw;ytlin@cec.gov.tw"><img border="0" src="http://db.cec.gov.tw/images/tab_06.gif" /></a>
</div>
</div>
<div
style="width: 100%; height: 22px; background-image: url('http://db.cec.gov.tw/images/tab_separator.gif'); background-repeat: repeat-x;">
</div>
<div class="query">
<!DOCTYPE html PUBLIC "-
<!DOCTYPE html PUBLIC "-
<div class="titlebox">
<div class="title">
<div class="head"> 08 </div>
<div class="date">1010114</div>
<div class="separator"></div>
</div>
</div>
<!DOCTYPE html PUBLIC "-
<link rel="stylesheet" type="text/css" href="http://db.cec.gov.tw/qryCtks.css" />
<table class="ctks" width="950" height="22" border=1 cellpadding="0" cellspacing="0" >
<tr class="title">
<td nowrap align="center"></td>
<td nowrap align="center"></td>
<td nowrap align="center"></td>
<td nowrap align="center"></td>
<td nowrap align="center"></td>
</tr>
<tr class="data">
<td nowrap rowspan=4 align=center>040643</td>
<td nowrap align="center"></td>
<td nowrap align="center">1</td>
<td nowrap align="right">302</td>
<td nowrap align="right"> 38.61%</td>
</tr>
<tr class="data">
<td nowrap align="center"></td>
<td nowrap align="center">2</td>
<td nowrap align="right">466</td>
<td nowrap align="right"> 59.59%</td>
</tr>
<tr class="data">
<td nowrap align="center"></td>
<td nowrap align="center">3</td>
<td nowrap align="right">6</td>
<td nowrap align="right"> 0.76%</td>
</tr>
<tr class="data">
<td nowrap align="center"></td>
<td nowrap align="center">4</td>
<td nowrap align="right">8</td>
<td nowrap align="right"> 1.02%</td>
</tr>
<tr class="data">
<td nowrap rowspan=4 align=center>040644</td>
<td nowrap align="center"></td>
<td nowrap align="center">1</td>
<td nowrap align="right">361</td>
<td nowrap align="right"> 45.63%</td>
</tr>
<tr class="data">
<td nowrap align="center"></td>
<td nowrap align="center">2</td>
<td nowrap align="right">410</td>
<td nowrap align="right"> 51.83%</td>
</tr>
<tr class="data">
<td nowrap align="center"></td>
<td nowrap align="center">3</td>
<td nowrap align="right">7</td>
<td nowrap align="right"> 0.88%</td>
</tr>
<tr class="data">
<td nowrap align="center"></td>
<td nowrap align="center">4</td>
<td nowrap align="right">13</td>
<td nowrap align="right"> 1.64%</td>
</tr>
</table>
<!DOCTYPE html PUBLIC "-
<div style="width: 100%; height: 20px; margin: 30px 0px 0px 0px; text-align: center; ">
<span>
<img src="http://db.cec.gov.tw/images/leave_arrow_left.gif" />
</span>
<span style="margin: 0px 10px 0px 10px; ">
<a style="text-decoration: none; font-size: 15px; " href="histPrint"></a>
</span>
<span>
<img src="http://db.cec.gov.tw/images/leave_arrow_right.gif" />
</span>
<span style="margin-right: 100px;"> </span>
<span>
<img src="http://db.cec.gov.tw/images/leave_arrow_left.gif" />
</span>
<span style="margin: 0px 10px 0px 10px; ">
<a style="text-decoration: none; font-size: 15px; " href="histMain.jsp"></a>
</span>
<span>
<img src="http://db.cec.gov.tw/images/leave_arrow_right.gif" />
</span>
</div>
</div>
</body>
</html> |
<?php
namespace Ecommit\JavascriptBundle\Overlay;
class JQueryPopupOverlay extends AbstractOverlay
{
public function __construct($useBootstrap)
{
$this->useBootstrap = $useBootstrap;
}
public function <API key>($modalId, $options = array())
{
$modalId = str_replace(' ', '', $modalId);
$options = $this-><API key>($options);
$jsModal = \sprintf("$('#%s').popup({setzindex: false, scrolllock: true, autoopen: false", $modalId);
$jsModal .= empty($options['js_on_open']) ? '' : sprintf(" ,onopen: function() { %s }", $options['js_on_open']);
$jsModal .= empty($options['js_on_close']) ? '' : sprintf(" ,onclose: function() { %s }", $options['js_on_close']);
$jsModal .= empty($options['close_div_class']) ? '' : sprintf(" ,closeelement: '.%s'", $options['close_div_class']);
$jsModal .= '}); ';
return $jsModal;
}
public function openModal($modalId)
{
return \sprintf("$('#%s').parents('.popup_wrapper:first').animate({scrollTop: 0}); $('#%s').popup('show');", $modalId, $modalId);
}
public function closeModal($modalId)
{
return \sprintf("$('#%s').popup('hide');", $modalId);
}
} |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'form_ui.ui'
# Created: Fri Apr 01 21:42:03 2016
# by: PyQt4 UI code generator 4.11.2
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
def _fromUtf8(s):
return s
try:
_encoding = QtGui.QApplication.UnicodeUTF8
def _translate(context, text, disambig):
return QtGui.QApplication.translate(context, text, disambig, _encoding)
except AttributeError:
def _translate(context, text, disambig):
return QtGui.QApplication.translate(context, text, disambig)
class Ui_Form(object):
def setupUi(self, Form):
Form.setObjectName(_fromUtf8("Form"))
Form.resize(500, 350)
self.label = QtGui.QLabel(Form)
self.label.setGeometry(QtCore.QRect(40, 40, 121, 16))
font = QtGui.QFont()
font.setPointSize(12)
font.setBold(True)
font.setWeight(75)
self.label.setFont(font)
self.label.setObjectName(_fromUtf8("label"))
self.lcdNumber_temp = QtGui.QLCDNumber(Form)
self.lcdNumber_temp.setGeometry(QtCore.QRect(10, 60, 181, 61))
font = QtGui.QFont()
font.setFamily(_fromUtf8("MS Serif"))
font.setPointSize(12)
font.setBold(True)
font.setWeight(75)
self.lcdNumber_temp.setFont(font)
self.lcdNumber_temp.setFrameShape(QtGui.QFrame.Panel)
self.lcdNumber_temp.setLineWidth(1)
self.lcdNumber_temp.setNumDigits(7)
self.lcdNumber_temp.setSegmentStyle(QtGui.QLCDNumber.Flat)
self.lcdNumber_temp.setProperty("value", 0.0)
self.lcdNumber_temp.setObjectName(_fromUtf8("lcdNumber_temp"))
self.label_2 = QtGui.QLabel(Form)
self.label_2.setGeometry(QtCore.QRect(210, 40, 101, 16))
font = QtGui.QFont()
font.setPointSize(12)
font.setBold(True)
font.setWeight(75)
self.label_2.setFont(font)
self.label_2.setObjectName(_fromUtf8("label_2"))
self.lcdNumber_hum = QtGui.QLCDNumber(Form)
self.lcdNumber_hum.setGeometry(QtCore.QRect(210, 60, 101, 61))
font = QtGui.QFont()
font.setPointSize(12)
font.setBold(True)
font.setWeight(75)
self.lcdNumber_hum.setFont(font)
self.lcdNumber_hum.setFrameShape(QtGui.QFrame.Panel)
self.lcdNumber_hum.setNumDigits(4)
self.lcdNumber_hum.setSegmentStyle(QtGui.QLCDNumber.Flat)
self.lcdNumber_hum.setProperty("value", 0.0)
self.lcdNumber_hum.setObjectName(_fromUtf8("lcdNumber_hum"))
self.label_3 = QtGui.QLabel(Form)
self.label_3.setGeometry(QtCore.QRect(10, 10, 141, 16))
font = QtGui.QFont()
font.setPointSize(12)
font.setBold(True)
font.setWeight(75)
self.label_3.setFont(font)
self.label_3.setObjectName(_fromUtf8("label_3"))
self.dateTimeEdit_time = QtGui.QDateTimeEdit(Form)
self.dateTimeEdit_time.setEnabled(True)
self.dateTimeEdit_time.setGeometry(QtCore.QRect(150, 10, 201, 22))
font = QtGui.QFont()
font.setPointSize(12)
font.setBold(True)
font.setWeight(75)
self.dateTimeEdit_time.setFont(font)
self.dateTimeEdit_time.setFocusPolicy(QtCore.Qt.NoFocus)
self.dateTimeEdit_time.<API key>(QtCore.Qt.NoContextMenu)
self.dateTimeEdit_time.setFrame(True)
self.dateTimeEdit_time.setReadOnly(True)
self.dateTimeEdit_time.setKeyboardTracking(False)
self.dateTimeEdit_time.setObjectName(_fromUtf8("dateTimeEdit_time"))
self.label_4 = QtGui.QLabel(Form)
self.label_4.setGeometry(QtCore.QRect(10, 200, 71, 20))
font = QtGui.QFont()
font.setPointSize(12)
font.setBold(True)
font.setWeight(75)
self.label_4.setFont(font)
self.label_4.setObjectName(_fromUtf8("label_4"))
self.label_5 = QtGui.QLabel(Form)
self.label_5.setGeometry(QtCore.QRect(10, 265, 71, 21))
font = QtGui.QFont()
font.setPointSize(12)
font.setBold(True)
font.setWeight(75)
self.label_5.setFont(font)
self.label_5.setObjectName(_fromUtf8("label_5"))
self.label_6 = QtGui.QLabel(Form)
self.label_6.setGeometry(QtCore.QRect(10, 236, 111, 20))
font = QtGui.QFont()
font.setPointSize(12)
font.setBold(True)
font.setWeight(75)
self.label_6.setFont(font)
self.label_6.setObjectName(_fromUtf8("label_6"))
self.label_cloud_text = QtGui.QLabel(Form)
self.label_cloud_text.setGeometry(QtCore.QRect(130, 235, 111, 21))
font = QtGui.QFont()
font.setPointSize(12)
font.setBold(True)
font.setWeight(75)
self.label_cloud_text.setFont(font)
self.label_cloud_text.setObjectName(_fromUtf8("label_cloud_text"))
self.label_9 = QtGui.QLabel(Form)
self.label_9.setGeometry(QtCore.QRect(360, 40, 101, 16))
font = QtGui.QFont()
font.setPointSize(12)
font.setBold(True)
font.setWeight(75)
self.label_9.setFont(font)
self.label_9.setObjectName(_fromUtf8("label_9"))
self.lcdNumber_pres = QtGui.QLCDNumber(Form)
self.lcdNumber_pres.setGeometry(QtCore.QRect(330, 60, 141, 61))
font = QtGui.QFont()
font.setPointSize(12)
font.setBold(True)
font.setWeight(75)
self.lcdNumber_pres.setFont(font)
self.lcdNumber_pres.setFrameShape(QtGui.QFrame.Panel)
self.lcdNumber_pres.setNumDigits(5)
self.lcdNumber_pres.setSegmentStyle(QtGui.QLCDNumber.Flat)
self.lcdNumber_pres.setProperty("value", 0.0)
self.lcdNumber_pres.setObjectName(_fromUtf8("lcdNumber_pres"))
self.<API key> = QtGui.QLabel(Form)
self.<API key>.setGeometry(QtCore.QRect(80, 265, 71, 21))
font = QtGui.QFont()
font.setPointSize(12)
font.setBold(True)
font.setWeight(75)
self.<API key>.setFont(font)
self.<API key>.setObjectName(_fromUtf8("<API key>"))
self.<API key> = QtGui.QLabel(Form)
self.<API key>.setGeometry(QtCore.QRect(150, 266, 71, 20))
font = QtGui.QFont()
font.setPointSize(12)
font.setBold(True)
font.setWeight(75)
self.<API key>.setFont(font)
self.<API key>.setObjectName(_fromUtf8("<API key>"))
self.<API key> = QtGui.QLabel(Form)
self.<API key>.setGeometry(QtCore.QRect(90, 200, 101, 21))
font = QtGui.QFont()
font.setPointSize(12)
font.setBold(True)
font.setWeight(75)
self.<API key>.setFont(font)
self.<API key>.setObjectName(_fromUtf8("<API key>"))
self.label_7 = QtGui.QLabel(Form)
self.label_7.setGeometry(QtCore.QRect(10, 320, 141, 21))
font = QtGui.QFont()
font.setPointSize(12)
font.setBold(True)
font.setWeight(75)
self.label_7.setFont(font)
self.label_7.setObjectName(_fromUtf8("label_7"))
self.label_time_date = QtGui.QLabel(Form)
self.label_time_date.setGeometry(QtCore.QRect(150, 320, 341, 19))
font = QtGui.QFont()
font.setPointSize(12)
font.setBold(True)
font.setWeight(75)
self.label_time_date.setFont(font)
self.label_time_date.setObjectName(_fromUtf8("label_time_date"))
self.retranslateUi(Form)
QtCore.QMetaObject.connectSlotsByName(Form)
def retranslateUi(self, Form):
Form.setWindowTitle(_translate("Form", "rpi weather", None))
self.label.setText(_translate("Form", "Температура", None))
self.label_2.setText(_translate("Form", "Влажность", None))
self.label_3.setText(_translate("Form", "Текущее время", None))
self.label_4.setText(_translate("Form", "Погода:", None))
self.label_5.setText(_translate("Form", "Ветер:", None))
self.label_6.setText(_translate("Form", "Облачность:", None))
self.label_cloud_text.setText(_translate("Form", "clouds text", None))
self.label_9.setText(_translate("Form", "Давление", None))
self.<API key>.setText(_translate("Form", "wind speed", None))
self.<API key>.setText(_translate("Form", "wind direction", None))
self.<API key>.setText(_translate("Form", "weather text", None))
self.label_7.setText(_translate("Form", "Время данных:", None))
self.label_time_date.setText(_translate("Form", "data time", None)) |
<?php
if(isset($_POST['email'])) {
// CHANGE THE TWO LINES BELOW
$email_to = "cparks0225@gmail.com";
$email_subject = "website html form submissions";
function died($error) {
// your error code can go here
echo "We are very sorry, but there were error(s) found with the form you submitted. ";
echo "These errors appear below.<br /><br />";
echo $error."<br /><br />";
echo "Please go back and fix these errors.<br /><br />";
die();
}
// validation expected data exists
if(!isset($_POST['first_name']) ||
!isset($_POST['last_name']) ||
!isset($_POST['email']) ||
!isset($_POST['telephone']) ||
!isset($_POST['comments'])) {
died('We are sorry, but there appears to be a problem with the form you submitted.');
}
$first_name = $_POST['first_name']; // required
$last_name = $_POST['last_name']; // required
$email_from = $_POST['email']; // required
$telephone = $_POST['telephone']; // not required
$comments = $_POST['comments']; // required
$error_message = "";
$email_exp = '/^[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/';
if(!preg_match($email_exp,$email_from)) {
$error_message .= 'The Email Address you entered does not appear to be valid.<br />';
}
$string_exp = "/^[A-Za-z .'-]+$/";
if(!preg_match($string_exp,$first_name)) {
$error_message .= 'The First Name you entered does not appear to be valid.<br />';
}
if(!preg_match($string_exp,$last_name)) {
$error_message .= 'The Last Name you entered does not appear to be valid.<br />';
}
if(strlen($comments) < 2) {
$error_message .= 'The Comments you entered do not appear to be valid.<br />';
}
if(strlen($error_message) > 0) {
died($error_message);
}
$email_message = "Form details below.\n\n";
function clean_string($string) {
$bad = array("content-type","bcc:","to:","cc:","href");
return str_replace($bad,"",$string);
}
$email_message .= "First Name: ".clean_string($first_name)."\n";
$email_message .= "Last Name: ".clean_string($last_name)."\n";
$email_message .= "Email: ".clean_string($email_from)."\n";
$email_message .= "Telephone: ".clean_string($telephone)."\n";
$email_message .= "Comments: ".clean_string($comments)."\n";
// create email headers
$headers = 'From: '.$email_from."\r\n".
'Reply-To: '.$email_from."\r\n" .
'X-Mailer: PHP/' . phpversion();
@mail($email_to, $email_subject, $email_message, $headers);
?>
<!-- place your own success html below -->
Thank you for contacting us. We will be in touch with you very soon.
<?php
}
die();
?> |
#include "unitTests.h"
#include "boost/date_time/posix_time/posix_time.hpp"
//#include <thrust\complex.h>
#define sizeSmall 4
#define sizeLarge 1024
/ minor
// float type
void test_minor_float_1()
{
Array<float> m( 2, 2 );
m( 0, 0 ) = 0;
m( 0, 1 ) = 0.1f;
m( 1, 0 ) = 0.2f;
m( 1, 1 ) = 0.3f;
Array<float> control( 1, 1 );
control( 0, 0 ) = m( 0, 1 );
TEST_CALL( m.minor(1,0), control, <API key> );
}
void test_minor_float_2()
{
Array<float> m( 3, 5 );
for( int i = 0; i < m.GetDescriptor().GetDim(0); i++ )
{
for( int j = 0; j < m.GetDescriptor().GetDim(1); j++ )
m( i, j ) = (float)(j + i*m.GetDescriptor().GetDim(1))/10;
}
Array<float> control( 2, 4 );
for( int i = 0; i < control.GetDescriptor().GetDim(0); i++ )
{
for( int j = 0; j < control.GetDescriptor().GetDim(1); j++ )
control( i, j ) = (float)(j + 1 + 2.5*i*control.GetDescriptor().GetDim(1))/10;
}
TEST_CALL( m.minor(1,0), control, <API key> );
}
// double type
void test_minor_double_1()
{
Array<double> m( 2, 2 );
m( 0, 0 ) = 0;
m( 0, 1 ) = 0.1;
m( 1, 0 ) = 0.2;
m( 1, 1 ) = 0.3;
Array<double> control( 1, 1 );
control( 0, 0 ) = m( 0, 1 );
TEST_CALL( m.minor(1,0), control, <API key> );
}
void test_minor_double_2()
{
Array<double> m( 3, 5 );
for( int i = 0; i < m.GetDescriptor().GetDim(0); i++ )
{
for( int j = 0; j < m.GetDescriptor().GetDim(1); j++ )
m( i, j ) = (double)(j + i*m.GetDescriptor().GetDim(1))/10;
}
Array<double> control( 2, 4 );
for( int i = 0; i < control.GetDescriptor().GetDim(0); i++ )
{
for( int j = 0; j < control.GetDescriptor().GetDim(1); j++ )
control( i, j ) = (double)(j + 1 + 2.5*i*control.GetDescriptor().GetDim(1))/10;
}
TEST_CALL( m.minor(1,0), control, <API key> );
}
// complex type
void <API key>()
{
Array<Complex> m( 2, 2 );
m( 0, 0 ) = Complex(0,0);
m( 0, 1 ) = Complex(0,1);
m( 1, 0 ) = Complex(1,0);
m( 1, 1 ) = Complex(1,1);
Array<Complex> control( 1, 1 );
control( 0, 0 ) = m( 0, 1 );
TEST_CALL( m.minor(1,0), control, <API key> );
}
void <API key>()
{
Array<Complex> m( 3, 5 );
for( int i = 0; i < m.GetDescriptor().GetDim(0); i++ )
{
for( int j = 0; j < m.GetDescriptor().GetDim(1); j++ )
m( i, j ) = Complex((double)(j + i*m.GetDescriptor().GetDim(1))/10,(double)(j + i*m.GetDescriptor().GetDim(1))/10);
}
Array<Complex> control( 2, 4 );
for( int i = 0; i < control.GetDescriptor().GetDim(0); i++ )
{
for( int j = 0; j < control.GetDescriptor().GetDim(1); j++ )
control( i, j ) = Complex((double)(j + 1 + 2.5*i*control.GetDescriptor().GetDim(1))/10,(double)(j + 1 + 2.5*i*control.GetDescriptor().GetDim(1))/10);
}
TEST_CALL( m.minor(1,0), control, <API key> );
}
/ norm
// float type
void test_norm_float_1()
{
Array<float> m( sizeSmall );
m( 0 ) = 0;
m( 1 ) = 3.0;
m( 2 ) = 4.0;
m( 3 ) = 12.0;
float control = 13.0f;
TEST_CALL( m.norm(), control, <API key> );
}
// double type
void test_norm_double_1()
{
Array<double> m( sizeSmall );
m( 0 ) = 0;
m( 1 ) = 3.0;
m( 2 ) = 4.0;
m( 3 ) = 12.0;
double control = 13.0;
TEST_CALL( m.norm(), control, <API key> );
}
// complex type
void test_norm_complex_1()
{
Array<Complex> m( sizeSmall );
m( 0 ) = 0;
m( 1 ) = Complex( 3.0, 4.0);
m( 2 ) = Complex( 6.0, 8.0);
m( 3 ) = Complex( 6.0, 8.0);
Complex control( 15.0, 0 );
TEST_CALL( m.norm(), control, <API key> );
}
/ eye
// float type
void test_eye_float_1()
{
Array<float> m = eye<float>( sizeSmall );
Array<float> control( sizeSmall, sizeSmall );
for( int i = 0; i < sizeSmall; i++ ) {
for( int j = i; j < i + 1; j++ )
control(i,j) = i == j;
}
TEST_CALL( m, control, <API key> );
}
void test_eye_float_2()
{
Array<float> m = eye<float>( sizeLarge );
Array<float> control( sizeLarge, sizeLarge );
for( int i = 0; i < sizeLarge; i++ ) {
for( int j = i; j < i + 1; j++ )
control(i,j) = i == j;
}
TEST_CALL( m, control, <API key> );
}
// double type
void test_eye_double_1()
{
Array<double> m = eye<double>( sizeSmall );
Array<double> control( sizeSmall, sizeSmall );
for( int i = 0; i < sizeSmall; i++ ) {
for( int j = i; j < i + 1; j++ )
control(i,j) = i == j;
}
TEST_CALL( m, control, <API key> );
}
void test_eye_double_2()
{
Array<double> m = eye<double>( sizeLarge );
Array<double> control( sizeLarge, sizeLarge );
for( int i = 0; i < sizeLarge; i++ ) {
for( int j = i; j < i + 1; j++ )
control(i,j) = i == j;
}
TEST_CALL( m, control, <API key> );
}
// complex type
void test_eye_complex_1()
{
Array<Complex> m = eye<Complex>( sizeSmall );
Array<Complex> control( sizeSmall, sizeSmall );
for( int i = 0; i < sizeSmall; i++ ) {
for( int j = i; j < i + 1; j++ )
control(i,j) = Complex(i == j,0);
}
TEST_CALL( m, control, <API key> );
}
void test_eye_complex_2()
{
Array<Complex> m = eye<Complex>( sizeLarge );
Array<Complex> control( sizeLarge, sizeLarge );
for( int i = 0; i < sizeLarge; i++ ) {
for( int j = i; j < i + 1; j++ )
control(i,j) = Complex(i == j,0);
}
TEST_CALL( m, control, <API key> );
}
void <API key>() {}
void <API key>()
{
float a = 1.5;
Array<float> v( 10,30 );
for( int i = 0; i < v.GetDescriptor().GetDim(0); i++ ) {
for( int j = 0; j < v.GetDescriptor().GetDim(1); j++ )
v( i, j ) = 1;
}
Array<float> control( 10,30 );
for( int i = 0; i < control.GetDescriptor().GetDim(0); i++ ) {
for( int j = 0; j < control.GetDescriptor().GetDim(1); j++ )
control( i, j ) = 1*a;
}
v = v*a;
TEST_CALL( v, control, <API key> );
}
void <API key>()
{
double a = 1.5;
Array<double> v( 10,30 );
for( int i = 0; i < v.GetDescriptor().GetDim(0); i++ ) {
for( int j = 0; j < v.GetDescriptor().GetDim(1); j++ )
v( i, j ) = 1;
}
Array<double> control( 10,30 );
for( int i = 0; i < control.GetDescriptor().GetDim(0); i++ ) {
for( int j = 0; j < control.GetDescriptor().GetDim(1); j++ )
control( i, j ) = 1*a;
}
v = v*a;
TEST_CALL( v, control, <API key> );
}
void <API key>()
{
Complex a(1.5,2);
Array<Complex> v( 10,30 );
for( int i = 0; i < v.GetDescriptor().GetDim(0); i++ ) {
for( int j = 0; j < v.GetDescriptor().GetDim(1); j++ )
v( i, j ) = 1;
}
Array<Complex> control( 10,30 );
for( int i = 0; i < control.GetDescriptor().GetDim(0); i++ ) {
for( int j = 0; j < control.GetDescriptor().GetDim(1); j++ )
control( i, j ) = a;
}
v = v*a;
TEST_CALL( v, control, <API key> );
} |
using System.Collections.Generic;
using UnityEngine;
/**
* Base class for everything that can be attacked (buildings, units, minions, heroes).
* Requires an Animator an will pass the following parameters to the animator:
* - UnitStatus
* - NrEnemies
* Requires a trigger collider to detect enemies within its radius.
*/
[RequireComponent(typeof(Animator))]
public abstract class MOBAUnit : MonoBehaviour
{
public enum UnitStatus { IDLE, WALKING, RUNNING, ATTACKRUNNING, ATTACKING, HEARTHSTONE, ABILITY1, ABILITY2, DEATH }
public enum DamageType { MELEE, FIRE, PIERCE, MAGIC, CRUSH }
public enum Alliance { NEUTRAL, BLUE, RED }
[SerializeField]
private UnitStatus _status;
[SerializeField]
private DamageType _damage;
[SerializeField]
private Alliance _camp;
[SerializeField]
private float _maxHealth;
[SerializeField]
private float _curHealth;
//references
private Animator _animator;
virtual protected void Start()
{
_curHealth = _maxHealth;
SetStatus(UnitStatus.IDLE);
_animator = GetComponent<Animator>();
}
public void Update()
{
//we force the transition to DEATH, but everything else is defined in subclasses
if (_curHealth < 0) SetStatus(UnitStatus.DEATH);
switch (_status)
{
case UnitStatus.IDLE:
UpdateIdle();
break;
case UnitStatus.WALKING:
UpdateWalking();
break;
case UnitStatus.RUNNING:
UpdateRunning();
break;
case UnitStatus.ATTACKING:
UpdateAttacking();
break;
case UnitStatus.ATTACKRUNNING:
UpdateAttackRunning();
break;
case UnitStatus.HEARTHSTONE:
UpdateHearthStone();
break;
case UnitStatus.ABILITY1:
UpdateAbility1();
break;
case UnitStatus.ABILITY2:
UpdateAbility2();
break;
case UnitStatus.DEATH:
UpdateDeath();
break;
default:
Debug.LogError("unknown state " + _status.ToString());
break;
}
_animator.SetInteger("UnitStatus", (int)_status);
}
abstract protected void UpdateIdle();
abstract protected void UpdateWalking();
abstract protected void UpdateRunning();
abstract protected void UpdateAttacking();
abstract protected void UpdateAttackRunning();
abstract protected void UpdateHearthStone();
abstract protected void UpdateAbility1();
abstract protected void UpdateAbility2();
abstract protected void UpdateDeath();
/**
* different types of units may choose to react differently to certain types of damage
*/
virtual public bool ReceiveDamage(DamageType t, float damage)
{
_curHealth -= damage;
return (_curHealth < 0);
}
protected Animator <API key>()
{
return _animator;
}
public float GetMaxHealth()
{
return _maxHealth;
}
public float GetCurrentHealth()
{
return _curHealth;
}
public Alliance GetAlliance()
{
return this._camp;
}
virtual public void ChooseSides(Alliance newAlliance)
{
this._camp = newAlliance;
this.gameObject.BroadcastMessage("SetAlliance", newAlliance, SendMessageOptions.DontRequireReceiver);
}
public DamageType GetDamageType()
{
return this._damage;
}
public UnitStatus GetStatus()
{
return this._status;
}
public void SetStatus(UnitStatus newstatus)
{
this._status = newstatus;
}
private static bool isNull(MOBAUnit u)
{
return u == null;
}
} |
The MIT License (MIT)
Copyright (c) 2014 Simon Reimler <saimon@devdactic.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE. |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="robots" content="index, follow, all" />
<title>Index | Hayttp API</title>
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="css/bootstrap-theme.min.css">
<link rel="stylesheet" type="text/css" href="css/sami.css">
<script src="js/jquery-1.11.1.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/typeahead.min.js"></script>
<script src="sami.js"></script>
<meta name="MobileOptimized" content="width">
<meta name="HandheldFriendly" content="true">
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1">
</head>
<body id="doc-index" data-name="" data-root-path="">
<div id="content">
<div id="left-column">
<div id="control-panel">
<form action="#" method="GET">
<select id="version-switcher" name="version">
<option value="../1.0.0/index.html" data-version="1.0.0">1.0.0</option>
<option value="../1.0.1/index.html" data-version="1.0.1">1.0.1</option>
<option value="../master/index.html" data-version="master">master dev branch</option>
</select>
</form>
<script>
$('option[data-version="'+window.projectVersion+'"]').prop('selected', true);
</script>
<form id="search-form" action="search.html" method="GET">
<span class="glyphicon glyphicon-search"></span>
<input name="search"
class="typeahead form-control"
type="search"
placeholder="Search">
</form>
</div>
<div id="api-tree"></div>
</div>
<div id="right-column">
<nav id="site-nav" class="navbar navbar-default" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar-elements">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="index.html">Hayttp API</a>
</div>
<div class="collapse navbar-collapse" id="navbar-elements">
<ul class="nav navbar-nav">
<li><a href="classes.html">Classes</a></li>
<li><a href="namespaces.html">Namespaces</a></li>
<li><a href="interfaces.html">Interfaces</a></li>
<li><a href="traits.html">Traits</a></li>
<li><a href="doc-index.html">Index</a></li>
<li><a href="search.html">Search</a></li>
</ul>
</div>
</div>
</nav>
<div id="page-content">
<div class="page-header">
<h1>Index</h1>
</div>
<ul class="pagination">
<li><a href="#letterA">A</a></li>
<li><a href="#letterB">B</a></li>
<li><a href="#letterC">C</a></li>
<li><a href="#letterD">D</a></li>
<li><a href="#letterE">E</a></li>
<li class="disabled"><a href="#letterF">F</a></li>
<li><a href="#letterG">G</a></li>
<li><a href="#letterH">H</a></li>
<li><a href="#letterI">I</a></li>
<li><a href="#letterJ">J</a></li>
<li class="disabled"><a href="#letterK">K</a></li>
<li class="disabled"><a href="#letterL">L</a></li>
<li><a href="#letterM">M</a></li>
<li><a href="#letterN">N</a></li>
<li><a href="#letterO">O</a></li>
<li><a href="#letterP">P</a></li>
<li class="disabled"><a href="#letterQ">Q</a></li>
<li><a href="#letterR">R</a></li>
<li><a href="#letterS">S</a></li>
<li><a href="#letterT">T</a></li>
<li><a href="#letterU">U</a></li>
<li class="disabled"><a href="#letterV">V</a></li>
<li><a href="#letterW">W</a></li>
<li><a href="#letterX">X</a></li>
<li class="disabled"><a href="#letterY">Y</a></li>
<li class="disabled"><a href="#letterZ">Z</a></li>
</ul>
<h2 id="letterA">A</h2>
<dl id="index"><dt><a href="Hayttp/Contracts/Request.html#<API key>"><abbr title="Hayttp\Contracts\Request">Request</abbr>::addMultipartField</a>() — <em>Method in class <a href="Hayttp/Contracts/Request.html"><abbr title="Hayttp\Contracts\Request">Request</abbr></a></em></dt>
<dd>Add a multipart entry.</dd><dt><a href="Hayttp/Contracts/Request.html#method_addFile"><abbr title="Hayttp\Contracts\Request">Request</abbr>::addFile</a>() — <em>Method in class <a href="Hayttp/Contracts/Request.html"><abbr title="Hayttp\Contracts\Request">Request</abbr></a></em></dt>
<dd>Add a file to the multipart body.</dd><dt><a href="Hayttp/Contracts/Request.html#method_addBlob"><abbr title="Hayttp\Contracts\Request">Request</abbr>::addBlob</a>() — <em>Method in class <a href="Hayttp/Contracts/Request.html"><abbr title="Hayttp\Contracts\Request">Request</abbr></a></em></dt>
<dd>Add a data field to the multipart body.</dd><dt><a href="Hayttp/Contracts/Response.html#method_apply"><abbr title="Hayttp\Contracts\Response">Response</abbr>::apply</a>() — <em>Method in class <a href="Hayttp/Contracts/Response.html"><abbr title="Hayttp\Contracts\Response">Response</abbr></a></em></dt>
<dd>Execute a callback.</dd><dt><a href="Hayttp/Traits/<API key>.html#<API key>"><abbr title="Hayttp\Traits\<API key>"><API key></abbr>::addMultipartField</a>() — <em>Method in class <a href="Hayttp/Traits/<API key>.html"><abbr title="Hayttp\Traits\<API key>"><API key></abbr></a></em></dt>
<dd>Add a multipart entry.</dd><dt><a href="Hayttp/Traits/<API key>.html#method_addFile"><abbr title="Hayttp\Traits\<API key>"><API key></abbr>::addFile</a>() — <em>Method in class <a href="Hayttp/Traits/<API key>.html"><abbr title="Hayttp\Traits\<API key>"><API key></abbr></a></em></dt>
<dd>Add a file to the multipart payload.</dd><dt><a href="Hayttp/Traits/<API key>.html#method_addBlob"><abbr title="Hayttp\Traits\<API key>"><API key></abbr>::addBlob</a>() — <em>Method in class <a href="Hayttp/Traits/<API key>.html"><abbr title="Hayttp\Traits\<API key>"><API key></abbr></a></em></dt>
<dd>Add a data field to the multipart payload.</dd><dt><a href="Hayttp/Traits/HasCallbacks.html#method_apply"><abbr title="Hayttp\Traits\HasCallbacks">HasCallbacks</abbr>::apply</a>() — <em>Method in class <a href="Hayttp/Traits/HasCallbacks.html"><abbr title="Hayttp\Traits\HasCallbacks">HasCallbacks</abbr></a></em></dt>
<dd>Execute a callback.</dd><dt><a href="Hayttp/Util.html#<API key>"><abbr title="Hayttp\Util">Util</abbr>::applyMountPoint</a>() — <em>Method in class <a href="Hayttp/Util.html"><abbr title="Hayttp\Util">Util</abbr></a></em></dt>
<dd>Make a url, possibly prefixing a mount point.</dd> </dl><h2 id="letterB">B</h2>
<dl id="index"><dt><a href="Hayttp/Contracts/Response.html#method_body"><abbr title="Hayttp\Contracts\Response">Response</abbr>::body</a>() — <em>Method in class <a href="Hayttp/Contracts/Response.html"><abbr title="Hayttp\Contracts\Response">Response</abbr></a></em></dt>
<dd>Get the response body.</dd><dt><a href="Hayttp/Engines/CurlEngine.html#method_buildHandle"><abbr title="Hayttp\Engines\CurlEngine">CurlEngine</abbr>::buildHandle</a>() — <em>Method in class <a href="Hayttp/Engines/CurlEngine.html"><abbr title="Hayttp\Engines\CurlEngine">CurlEngine</abbr></a></em></dt>
<dd></dd><dt><a href="Hayttp/Engines/NativeEngine.html#method_buildContext"><abbr title="Hayttp\Engines\NativeEngine">NativeEngine</abbr>::buildContext</a>() — <em>Method in class <a href="Hayttp/Engines/NativeEngine.html"><abbr title="Hayttp\Engines\NativeEngine">NativeEngine</abbr></a></em></dt>
<dd></dd><dt>$<a href="Hayttp/Payloads/MultipartPayload.html#property_boundary"><abbr title="Hayttp\Payloads\MultipartPayload">MultipartPayload</abbr></a> — <em>Property in class <a href="Hayttp/Payloads/MultipartPayload.html"><abbr title="Hayttp\Payloads\MultipartPayload">MultipartPayload</abbr></a></em></dt>
<dd></dd><dt><a href="Hayttp/Payloads/MultipartPayload.html#method_boundary"><abbr title="Hayttp\Payloads\MultipartPayload">MultipartPayload</abbr>::boundary</a>() — <em>Method in class <a href="Hayttp/Payloads/MultipartPayload.html"><abbr title="Hayttp\Payloads\MultipartPayload">MultipartPayload</abbr></a></em></dt>
<dd>get the field boundary for this message.</dd><dt>$<a href="Hayttp/Response.html#property_body"><abbr title="Hayttp\Response">Response</abbr></a> — <em>Property in class <a href="Hayttp/Response.html"><abbr title="Hayttp\Response">Response</abbr></a></em></dt>
<dd></dd><dt><a href="Hayttp/Response.html#method_body"><abbr title="Hayttp\Response">Response</abbr>::body</a>() — <em>Method in class <a href="Hayttp/Response.html"><abbr title="Hayttp\Response">Response</abbr></a></em></dt>
<dd>Get the response body.</dd><dt><a href="Hayttp/Traits/HasRequestAccessors.html#method_body"><abbr title="Hayttp\Traits\HasRequestAccessors">HasRequestAccessors</abbr>::body</a>() — <em>Method in class <a href="Hayttp/Traits/HasRequestAccessors.html"><abbr title="Hayttp\Traits\HasRequestAccessors">HasRequestAccessors</abbr></a></em></dt>
<dd>The request body.</dd> </dl><h2 id="letterC">C</h2>
<dl id="index"><dt><a href="Hayttp/Contracts/Payload.html#method_contentType"><abbr title="Hayttp\Contracts\Payload">Payload</abbr>::contentType</a>() — <em>Method in class <a href="Hayttp/Contracts/Payload.html"><abbr title="Hayttp\Contracts\Payload">Payload</abbr></a></em></dt>
<dd>The Content-Type header to use when sending this payload.</dd><dt><a href="Hayttp/Contracts/Request.html#method_cryptoMethod"><abbr title="Hayttp\Contracts\Request">Request</abbr>::cryptoMethod</a>() — <em>Method in class <a href="Hayttp/Contracts/Request.html"><abbr title="Hayttp\Contracts\Request">Request</abbr></a></em></dt>
<dd>Cryptographic transport method.</dd><dt><a href="Hayttp/Contracts/Response.html#method_contentType"><abbr title="Hayttp\Contracts\Response">Response</abbr>::contentType</a>() — <em>Method in class <a href="Hayttp/Contracts/Response.html"><abbr title="Hayttp\Contracts\Response">Response</abbr></a></em></dt>
<dd>Get the contents of the Content-Type header.</dd><dt><a href="Hayttp/Contracts/Response.html#<API key>"><abbr title="Hayttp\Contracts\Response">Response</abbr>::<API key></a>() — <em>Method in class <a href="Hayttp/Contracts/Response.html"><abbr title="Hayttp\Contracts\Response">Response</abbr></a></em></dt>
<dd>Get the content type, but remove anything after the first semi-colon.</dd><dt><a href="Hayttp/Engines/CurlEngine.html"><abbr title="Hayttp\Engines\CurlEngine">CurlEngine</abbr></a> — <em>Class in namespace <a href="Hayttp/Engines.html">Hayttp\Engines</a></em></dt>
<dd></dd><dt><a href="Hayttp/Engines/CurlEngine.html#<API key>"><abbr title="Hayttp\Engines\CurlEngine">CurlEngine</abbr>::curlCryptoMethod</a>() — <em>Method in class <a href="Hayttp/Engines/CurlEngine.html"><abbr title="Hayttp\Engines\CurlEngine">CurlEngine</abbr></a></em></dt>
<dd></dd><dt>$<a href="Hayttp/Engines/NativeEngine.html#property_cryptoMap"><abbr title="Hayttp\Engines\NativeEngine">NativeEngine</abbr></a> — <em>Property in class <a href="Hayttp/Engines/NativeEngine.html"><abbr title="Hayttp\Engines\NativeEngine">NativeEngine</abbr></a></em></dt>
<dd></dd><dt><a href="Hayttp/Exceptions/<API key>.html"><abbr title="Hayttp\Exceptions\<API key>"><API key></abbr></a> — <em>Class in namespace <a href="Hayttp/Exceptions.html">Hayttp\Exceptions</a></em></dt>
<dd>Http connection exception.</dd><dt><a href="Hayttp/Exceptions/Response/ContentException.html"><abbr title="Hayttp\Exceptions\Response\ContentException">ContentException</abbr></a> — <em>Class in namespace <a href="Hayttp/Exceptions/Response.html">Hayttp\Exceptions\Response</a></em></dt>
<dd>Http connection exception.</dd><dt><a href="Hayttp/Exceptions/Response/<API key>.html"><abbr title="Hayttp\Exceptions\Response\<API key>"><API key></abbr></a> — <em>Class in namespace <a href="Hayttp/Exceptions/Response.html">Hayttp\Exceptions\Response</a></em></dt>
<dd>Http connection exception.</dd><dt><a href="Hayttp/Hayttp.html#<API key>"><abbr title="Hayttp\Hayttp">Hayttp</abbr>::createRequest</a>() — <em>Method in class <a href="Hayttp/Hayttp.html"><abbr title="Hayttp\Hayttp">Hayttp</abbr></a></em></dt>
<dd>Factory.</dd><dt><a href="Hayttp/Hayttp.html#<API key>"><abbr title="Hayttp\Hayttp">Hayttp</abbr>::createMockResponse</a>() — <em>Method in class <a href="Hayttp/Hayttp.html"><abbr title="Hayttp\Hayttp">Hayttp</abbr></a></em></dt>
<dd>Create a mock response via a request and a route</dd><dt>$<a href="Hayttp/Payloads/JsonPayload.html#property_contents"><abbr title="Hayttp\Payloads\JsonPayload">JsonPayload</abbr></a> — <em>Property in class <a href="Hayttp/Payloads/JsonPayload.html"><abbr title="Hayttp\Payloads\JsonPayload">JsonPayload</abbr></a></em></dt>
<dd></dd><dt>$<a href="Hayttp/Payloads/JsonPayload.html#<API key>"><abbr title="Hayttp\Payloads\JsonPayload">JsonPayload</abbr></a> — <em>Property in class <a href="Hayttp/Payloads/JsonPayload.html"><abbr title="Hayttp\Payloads\JsonPayload">JsonPayload</abbr></a></em></dt>
<dd></dd><dt><a href="Hayttp/Payloads/JsonPayload.html#method_contentType"><abbr title="Hayttp\Payloads\JsonPayload">JsonPayload</abbr>::contentType</a>() — <em>Method in class <a href="Hayttp/Payloads/JsonPayload.html"><abbr title="Hayttp\Payloads\JsonPayload">JsonPayload</abbr></a></em></dt>
<dd>The Content-Type header to use when sending this payload.</dd><dt><a href="Hayttp/Payloads/MultipartPayload.html#method_contentType"><abbr title="Hayttp\Payloads\MultipartPayload">MultipartPayload</abbr>::contentType</a>() — <em>Method in class <a href="Hayttp/Payloads/MultipartPayload.html"><abbr title="Hayttp\Payloads\MultipartPayload">MultipartPayload</abbr></a></em></dt>
<dd>The Content-Type header to use when sending this payload.</dd><dt>$<a href="Hayttp/Payloads/RawPayload.html#property_contents"><abbr title="Hayttp\Payloads\RawPayload">RawPayload</abbr></a> — <em>Property in class <a href="Hayttp/Payloads/RawPayload.html"><abbr title="Hayttp\Payloads\RawPayload">RawPayload</abbr></a></em></dt>
<dd></dd><dt>$<a href="Hayttp/Payloads/RawPayload.html#<API key>"><abbr title="Hayttp\Payloads\RawPayload">RawPayload</abbr></a> — <em>Property in class <a href="Hayttp/Payloads/RawPayload.html"><abbr title="Hayttp\Payloads\RawPayload">RawPayload</abbr></a></em></dt>
<dd></dd><dt><a href="Hayttp/Payloads/RawPayload.html#method_contentType"><abbr title="Hayttp\Payloads\RawPayload">RawPayload</abbr>::contentType</a>() — <em>Method in class <a href="Hayttp/Payloads/RawPayload.html"><abbr title="Hayttp\Payloads\RawPayload">RawPayload</abbr></a></em></dt>
<dd>The Content-Type header to use when sending this payload.</dd><dt>$<a href="Hayttp/Request.html#<API key>"><abbr title="Hayttp\Request">Request</abbr></a> — <em>Property in class <a href="Hayttp/Request.html"><abbr title="Hayttp\Request">Request</abbr></a></em></dt>
<dd></dd><dt><a href="Hayttp/Response.html#method_contentType"><abbr title="Hayttp\Response">Response</abbr>::contentType</a>() — <em>Method in class <a href="Hayttp/Response.html"><abbr title="Hayttp\Response">Response</abbr></a></em></dt>
<dd>Get the contents of the Content-Type header.</dd><dt><a href="Hayttp/Response.html#<API key>"><abbr title="Hayttp\Response">Response</abbr>::<API key></a>() — <em>Method in class <a href="Hayttp/Response.html"><abbr title="Hayttp\Response">Response</abbr></a></em></dt>
<dd>Get the content type, but remove anything after the first semi-colon.</dd><dt><a href="Hayttp/Traits/CreatesRequests.html"><abbr title="Hayttp\Traits\CreatesRequests">CreatesRequests</abbr></a> — <em>Class in namespace <a href="Hayttp/Traits.html">Hayttp\Traits</a></em></dt>
<dd></dd><dt><a href="Hayttp/Traits/HasRequestAccessors.html#method_cryptoMethod"><abbr title="Hayttp\Traits\HasRequestAccessors">HasRequestAccessors</abbr>::cryptoMethod</a>() — <em>Method in class <a href="Hayttp/Traits/HasRequestAccessors.html"><abbr title="Hayttp\Traits\HasRequestAccessors">HasRequestAccessors</abbr></a></em></dt>
<dd>Cryptographic transport method.</dd><dt><a href="Hayttp/Traits/HasRequestAccessors.html#method_contentType"><abbr title="Hayttp\Traits\HasRequestAccessors">HasRequestAccessors</abbr>::contentType</a>() — <em>Method in class <a href="Hayttp/Traits/HasRequestAccessors.html"><abbr title="Hayttp\Traits\HasRequestAccessors">HasRequestAccessors</abbr></a></em></dt>
<dd>Get the contents of the Content-Type header.</dd> </dl><h2 id="letterD">D</h2>
<dl id="index"><dt>$<a href="Hayttp/Hayttp.html#<API key>"><abbr title="Hayttp\Hayttp">Hayttp</abbr></a> — <em>Property in class <a href="Hayttp/Hayttp.html"><abbr title="Hayttp\Hayttp">Hayttp</abbr></a></em></dt>
<dd></dd><dt>$<a href="Hayttp/Hayttp.html#<API key>"><abbr title="Hayttp\Hayttp">Hayttp</abbr></a> — <em>Property in class <a href="Hayttp/Hayttp.html"><abbr title="Hayttp\Hayttp">Hayttp</abbr></a></em></dt>
<dd></dd><dt><a href="Hayttp/Hayttp.html#method_delete"><abbr title="Hayttp\Hayttp">Hayttp</abbr>::delete</a>() — <em>Method in class <a href="Hayttp/Hayttp.html"><abbr title="Hayttp\Hayttp">Hayttp</abbr></a></em></dt>
<dd>Create a DELETE request</dd><dt><a href="Hayttp/Response.html#method_decoded"><abbr title="Hayttp\Response">Response</abbr>::decoded</a>() — <em>Method in class <a href="Hayttp/Response.html"><abbr title="Hayttp\Response">Response</abbr></a></em></dt>
<dd>Get the parsed body of the response.</dd><dt><a href="Hayttp/Traits/CreatesRequests.html#method_delete"><abbr title="Hayttp\Traits\CreatesRequests">CreatesRequests</abbr>::delete</a>() — <em>Method in class <a href="Hayttp/Traits/CreatesRequests.html"><abbr title="Hayttp\Traits\CreatesRequests">CreatesRequests</abbr></a></em></dt>
<dd>Factory.</dd><dt><a href="Hayttp/Traits/<API key>.html"><abbr title="Hayttp\Traits\<API key>"><API key></abbr></a> — <em>Class in namespace <a href="Hayttp/Traits.html">Hayttp\Traits</a></em></dt>
<dd></dd> </dl><h2 id="letterE">E</h2>
<dl id="index"><dt><a href="Hayttp/Contracts/Engine.html"><abbr title="Hayttp\Contracts\Engine">Engine</abbr></a> — <em>Class in namespace <a href="Hayttp/Contracts.html">Hayttp\Contracts</a></em></dt>
<dd></dd><dt><a href="Hayttp/Contracts/Request.html#method_expects"><abbr title="Hayttp\Contracts\Request">Request</abbr>::expects</a>() — <em>Method in class <a href="Hayttp/Contracts/Request.html"><abbr title="Hayttp\Contracts\Request">Request</abbr></a></em></dt>
<dd>Add Accept header.</dd><dt><a href="Hayttp/Contracts/Request.html#method_expectsMany"><abbr title="Hayttp\Contracts\Request">Request</abbr>::expectsMany</a>() — <em>Method in class <a href="Hayttp/Contracts/Request.html"><abbr title="Hayttp\Contracts\Request">Request</abbr></a></em></dt>
<dd>Add Accept header with many types.</dd><dt><a href="Hayttp/Contracts/Request.html#method_expectsJson"><abbr title="Hayttp\Contracts\Request">Request</abbr>::expectsJson</a>() — <em>Method in class <a href="Hayttp/Contracts/Request.html"><abbr title="Hayttp\Contracts\Request">Request</abbr></a></em></dt>
<dd>Accept application/json.</dd><dt><a href="Hayttp/Contracts/Request.html#method_expectsXml"><abbr title="Hayttp\Contracts\Request">Request</abbr>::expectsXml</a>() — <em>Method in class <a href="Hayttp/Contracts/Request.html"><abbr title="Hayttp\Contracts\Request">Request</abbr></a></em></dt>
<dd>Accept application/xml.</dd><dt><a href="Hayttp/Contracts/Request.html#method_expectsAny"><abbr title="Hayttp\Contracts\Request">Request</abbr>::expectsAny</a>() — <em>Method in class <a href="Hayttp/Contracts/Request.html"><abbr title="Hayttp\Contracts\Request">Request</abbr></a></em></dt>
<dd><ul>
<li>Accept * / *.</li>
</ul>
</dd><dt><a href="Hayttp/Contracts/Request.html#method_engine"><abbr title="Hayttp\Contracts\Request">Request</abbr>::engine</a>() — <em>Method in class <a href="Hayttp/Contracts/Request.html"><abbr title="Hayttp\Contracts\Request">Request</abbr></a></em></dt>
<dd>The request engine.</dd><dt><a href="Hayttp/Contracts/Request.html#method_events"><abbr title="Hayttp\Contracts\Request">Request</abbr>::events</a>() — <em>Method in class <a href="Hayttp/Contracts/Request.html"><abbr title="Hayttp\Contracts\Request">Request</abbr></a></em></dt>
<dd>All registered event hooks.</dd><dt><a href="Hayttp/Contracts/Response.html#<API key>"><abbr title="Hayttp\Contracts\Response">Response</abbr>::ensureStatusInRange</a>() — <em>Method in class <a href="Hayttp/Contracts/Response.html"><abbr title="Hayttp\Contracts\Response">Response</abbr></a></em></dt>
<dd>Ensure that status code is in a given range.</dd><dt><a href="Hayttp/Contracts/Response.html#<API key>"><abbr title="Hayttp\Contracts\Response">Response</abbr>::ensureStatusIn</a>() — <em>Method in class <a href="Hayttp/Contracts/Response.html"><abbr title="Hayttp\Contracts\Response">Response</abbr></a></em></dt>
<dd>Ensure that the status code is in a given et of codes.</dd><dt><a href="Hayttp/Contracts/Response.html#method_ensureStatus"><abbr title="Hayttp\Contracts\Response">Response</abbr>::ensureStatus</a>() — <em>Method in class <a href="Hayttp/Contracts/Response.html"><abbr title="Hayttp\Contracts\Response">Response</abbr></a></em></dt>
<dd>Ensure that the status code equals $validCode.</dd><dt><a href="Hayttp/Contracts/Response.html#method_ensure2xx"><abbr title="Hayttp\Contracts\Response">Response</abbr>::ensure2xx</a>() — <em>Method in class <a href="Hayttp/Contracts/Response.html"><abbr title="Hayttp\Contracts\Response">Response</abbr></a></em></dt>
<dd>Ensure that the status code is in the range [200.</dd><dt><a href="Hayttp/Contracts/Response.html#method_ensure200"><abbr title="Hayttp\Contracts\Response">Response</abbr>::ensure200</a>() — <em>Method in class <a href="Hayttp/Contracts/Response.html"><abbr title="Hayttp\Contracts\Response">Response</abbr></a></em></dt>
<dd>Ensure that the status code is 200.</dd><dt><a href="Hayttp/Contracts/Response.html#method_ensure201"><abbr title="Hayttp\Contracts\Response">Response</abbr>::ensure201</a>() — <em>Method in class <a href="Hayttp/Contracts/Response.html"><abbr title="Hayttp\Contracts\Response">Response</abbr></a></em></dt>
<dd>Ensure that the status code is 201.</dd><dt><a href="Hayttp/Contracts/Response.html#method_ensure204"><abbr title="Hayttp\Contracts\Response">Response</abbr>::ensure204</a>() — <em>Method in class <a href="Hayttp/Contracts/Response.html"><abbr title="Hayttp\Contracts\Response">Response</abbr></a></em></dt>
<dd>Ensure that the status code is 204.</dd><dt><a href="Hayttp/Contracts/Response.html#method_ensure301"><abbr title="Hayttp\Contracts\Response">Response</abbr>::ensure301</a>() — <em>Method in class <a href="Hayttp/Contracts/Response.html"><abbr title="Hayttp\Contracts\Response">Response</abbr></a></em></dt>
<dd>Ensure that the status code is 301.</dd><dt><a href="Hayttp/Contracts/Response.html#method_ensure302"><abbr title="Hayttp\Contracts\Response">Response</abbr>::ensure302</a>() — <em>Method in class <a href="Hayttp/Contracts/Response.html"><abbr title="Hayttp\Contracts\Response">Response</abbr></a></em></dt>
<dd>Ensure that the status code is 302.</dd><dt><a href="Hayttp/Contracts/Response.html#method_ensureJson"><abbr title="Hayttp\Contracts\Response">Response</abbr>::ensureJson</a>() — <em>Method in class <a href="Hayttp/Contracts/Response.html"><abbr title="Hayttp\Contracts\Response">Response</abbr></a></em></dt>
<dd>Ensure that the content type is application/json.</dd><dt><a href="Hayttp/Contracts/Response.html#method_ensureXml"><abbr title="Hayttp\Contracts\Response">Response</abbr>::ensureXml</a>() — <em>Method in class <a href="Hayttp/Contracts/Response.html"><abbr title="Hayttp\Contracts\Response">Response</abbr></a></em></dt>
<dd>Ensure that the content type is application/xml.</dd><dt><a href="Hayttp/Contracts/Response.html#<API key>"><abbr title="Hayttp\Contracts\Response">Response</abbr>::ensureContentType</a>() — <em>Method in class <a href="Hayttp/Contracts/Response.html"><abbr title="Hayttp\Contracts\Response">Response</abbr></a></em></dt>
<dd>Ensure that the response has a given content type</dd><dt><a href="Hayttp/Mock/Endpoint.html"><abbr title="Hayttp\Mock\Endpoint">Endpoint</abbr></a> — <em>Class in namespace <a href="Hayttp/Mock.html">Hayttp\Mock</a></em></dt>
<dd>Mock Endpoint.</dd><dt><a href="Hayttp/Mock/Route.html#method_ensureHas"><abbr title="Hayttp\Mock\Route">Route</abbr>::ensureHas</a>() — <em>Method in class <a href="Hayttp/Mock/Route.html"><abbr title="Hayttp\Mock\Route">Route</abbr></a></em></dt>
<dd>Throw an exception if the given parameter does not exist.</dd><dt>$<a href="Hayttp/Payloads/MultipartPayload.html#property_entries"><abbr title="Hayttp\Payloads\MultipartPayload">MultipartPayload</abbr></a> — <em>Property in class <a href="Hayttp/Payloads/MultipartPayload.html"><abbr title="Hayttp\Payloads\MultipartPayload">MultipartPayload</abbr></a></em></dt>
<dd></dd><dt>$<a href="Hayttp/Request.html#property_engine"><abbr title="Hayttp\Request">Request</abbr></a> — <em>Property in class <a href="Hayttp/Request.html"><abbr title="Hayttp\Request">Request</abbr></a></em></dt>
<dd></dd><dt><a href="Hayttp/Request.html#method_expects"><abbr title="Hayttp\Request">Request</abbr>::expects</a>() — <em>Method in class <a href="Hayttp/Request.html"><abbr title="Hayttp\Request">Request</abbr></a></em></dt>
<dd>Add Accept header.</dd><dt><a href="Hayttp/Request.html#method_expectsMany"><abbr title="Hayttp\Request">Request</abbr>::expectsMany</a>() — <em>Method in class <a href="Hayttp/Request.html"><abbr title="Hayttp\Request">Request</abbr></a></em></dt>
<dd>Add Accept header with many types.</dd><dt><a href="Hayttp/Response.html#<API key>"><abbr title="Hayttp\Response">Response</abbr>::extraDebugInfo</a>() — <em>Method in class <a href="Hayttp/Response.html"><abbr title="Hayttp\Response">Response</abbr></a></em></dt>
<dd></dd><dt><a href="Hayttp/Traits/<API key>.html"><abbr title="Hayttp\Traits\<API key>"><API key></abbr></a> — <em>Class in namespace <a href="Hayttp/Traits.html">Hayttp\Traits</a></em></dt>
<dd></dd><dt><a href="Hayttp/Traits/<API key>.html#method_expectsJson"><abbr title="Hayttp\Traits\<API key>"><API key></abbr>::expectsJson</a>() — <em>Method in class <a href="Hayttp/Traits/<API key>.html"><abbr title="Hayttp\Traits\<API key>"><API key></abbr></a></em></dt>
<dd>Accept application/json.</dd><dt><a href="Hayttp/Traits/<API key>.html#method_expectsXml"><abbr title="Hayttp\Traits\<API key>"><API key></abbr>::expectsXml</a>() — <em>Method in class <a href="Hayttp/Traits/<API key>.html"><abbr title="Hayttp\Traits\<API key>"><API key></abbr></a></em></dt>
<dd>Accept application/xml.</dd><dt><a href="Hayttp/Traits/<API key>.html#method_expectsAny"><abbr title="Hayttp\Traits\<API key>"><API key></abbr>::expectsAny</a>() — <em>Method in class <a href="Hayttp/Traits/<API key>.html"><abbr title="Hayttp\Traits\<API key>"><API key></abbr></a></em></dt>
<dd><ul>
<li>Accept * / *.</li>
</ul>
</dd><dt><a href="Hayttp/Traits/<API key>.html#method_ensureJson"><abbr title="Hayttp\Traits\<API key>"><API key></abbr>::ensureJson</a>() — <em>Method in class <a href="Hayttp/Traits/<API key>.html"><abbr title="Hayttp\Traits\<API key>"><API key></abbr></a></em></dt>
<dd>Expect json response type and throw an exception if json is not returned.</dd><dt><a href="Hayttp/Traits/<API key>.html#method_ensureXml"><abbr title="Hayttp\Traits\<API key>"><API key></abbr>::ensureXml</a>() — <em>Method in class <a href="Hayttp/Traits/<API key>.html"><abbr title="Hayttp\Traits\<API key>"><API key></abbr></a></em></dt>
<dd>Expect json response type and throw an exception if json is not returned.</dd><dt><a href="Hayttp/Traits/Extendable.html"><abbr title="Hayttp\Traits\Extendable">Extendable</abbr></a> — <em>Class in namespace <a href="Hayttp/Traits.html">Hayttp\Traits</a></em></dt>
<dd>Make a class dynamically extendable.</dd><dt>$<a href="Hayttp/Traits/Extendable.html#property_extensions"><abbr title="Hayttp\Traits\Extendable">Extendable</abbr></a> — <em>Property in class <a href="Hayttp/Traits/Extendable.html"><abbr title="Hayttp\Traits\Extendable">Extendable</abbr></a></em></dt>
<dd></dd><dt><a href="Hayttp/Traits/Extendable.html#method_extend"><abbr title="Hayttp\Traits\Extendable">Extendable</abbr>::extend</a>() — <em>Method in class <a href="Hayttp/Traits/Extendable.html"><abbr title="Hayttp\Traits\Extendable">Extendable</abbr></a></em></dt>
<dd>Add a method to the class.</dd><dt><a href="Hayttp/Traits/Extendable.html#<API key>"><abbr title="Hayttp\Traits\Extendable">Extendable</abbr>::execDynamicCallable</a>() — <em>Method in class <a href="Hayttp/Traits/Extendable.html"><abbr title="Hayttp\Traits\Extendable">Extendable</abbr></a></em></dt>
<dd>Execute a static call with the correct class scope.</dd><dt><a href="Hayttp/Traits/Extendable.html#<API key>"><abbr title="Hayttp\Traits\Extendable">Extendable</abbr>::execStaticCallable</a>() — <em>Method in class <a href="Hayttp/Traits/Extendable.html"><abbr title="Hayttp\Traits\Extendable">Extendable</abbr></a></em></dt>
<dd>Execute a static call with the correct class scope.</dd><dt><a href="Hayttp/Traits/HasRequestAccessors.html#method_engine"><abbr title="Hayttp\Traits\HasRequestAccessors">HasRequestAccessors</abbr>::engine</a>() — <em>Method in class <a href="Hayttp/Traits/HasRequestAccessors.html"><abbr title="Hayttp\Traits\HasRequestAccessors">HasRequestAccessors</abbr></a></em></dt>
<dd>The request engine.</dd><dt><a href="Hayttp/Traits/HasRequestAccessors.html#method_events"><abbr title="Hayttp\Traits\HasRequestAccessors">HasRequestAccessors</abbr>::events</a>() — <em>Method in class <a href="Hayttp/Traits/HasRequestAccessors.html"><abbr title="Hayttp\Traits\HasRequestAccessors">HasRequestAccessors</abbr></a></em></dt>
<dd>All registered event hooks.</dd><dt><a href="Hayttp/Traits/<API key>.html#method_ensure"><abbr title="Hayttp\Traits\<API key>"><API key></abbr>::ensure</a>() — <em>Method in class <a href="Hayttp/Traits/<API key>.html"><abbr title="Hayttp\Traits\<API key>"><API key></abbr></a></em></dt>
<dd>Throw a ResponseException if $success is false.</dd><dt><a href="Hayttp/Traits/<API key>.html#<API key>"><abbr title="Hayttp\Traits\<API key>"><API key></abbr>::ensureStatusInRange</a>() — <em>Method in class <a href="Hayttp/Traits/<API key>.html"><abbr title="Hayttp\Traits\<API key>"><API key></abbr></a></em></dt>
<dd>Ensure that status code is in a given range.</dd><dt><a href="Hayttp/Traits/<API key>.html#<API key>"><abbr title="Hayttp\Traits\<API key>"><API key></abbr>::ensureStatusIn</a>() — <em>Method in class <a href="Hayttp/Traits/<API key>.html"><abbr title="Hayttp\Traits\<API key>"><API key></abbr></a></em></dt>
<dd>Ensure that the status code is in a given et of codes.</dd><dt><a href="Hayttp/Traits/<API key>.html#method_ensureStatus"><abbr title="Hayttp\Traits\<API key>"><API key></abbr>::ensureStatus</a>() — <em>Method in class <a href="Hayttp/Traits/<API key>.html"><abbr title="Hayttp\Traits\<API key>"><API key></abbr></a></em></dt>
<dd>Ensure that the status code equals $validCode.</dd><dt><a href="Hayttp/Traits/<API key>.html#method_ensure2xx"><abbr title="Hayttp\Traits\<API key>"><API key></abbr>::ensure2xx</a>() — <em>Method in class <a href="Hayttp/Traits/<API key>.html"><abbr title="Hayttp\Traits\<API key>"><API key></abbr></a></em></dt>
<dd>Ensure that the status code is in the range [200.</dd><dt><a href="Hayttp/Traits/<API key>.html#method_ensure200"><abbr title="Hayttp\Traits\<API key>"><API key></abbr>::ensure200</a>() — <em>Method in class <a href="Hayttp/Traits/<API key>.html"><abbr title="Hayttp\Traits\<API key>"><API key></abbr></a></em></dt>
<dd>Ensure that the status code is 200.</dd><dt><a href="Hayttp/Traits/<API key>.html#method_ensure201"><abbr title="Hayttp\Traits\<API key>"><API key></abbr>::ensure201</a>() — <em>Method in class <a href="Hayttp/Traits/<API key>.html"><abbr title="Hayttp\Traits\<API key>"><API key></abbr></a></em></dt>
<dd>Ensure that the status code is 201.</dd><dt><a href="Hayttp/Traits/<API key>.html#method_ensure204"><abbr title="Hayttp\Traits\<API key>"><API key></abbr>::ensure204</a>() — <em>Method in class <a href="Hayttp/Traits/<API key>.html"><abbr title="Hayttp\Traits\<API key>"><API key></abbr></a></em></dt>
<dd>Ensure that the status code is 204.</dd><dt><a href="Hayttp/Traits/<API key>.html#method_ensure301"><abbr title="Hayttp\Traits\<API key>"><API key></abbr>::ensure301</a>() — <em>Method in class <a href="Hayttp/Traits/<API key>.html"><abbr title="Hayttp\Traits\<API key>"><API key></abbr></a></em></dt>
<dd>Ensure that the status code is 301.</dd><dt><a href="Hayttp/Traits/<API key>.html#method_ensure302"><abbr title="Hayttp\Traits\<API key>"><API key></abbr>::ensure302</a>() — <em>Method in class <a href="Hayttp/Traits/<API key>.html"><abbr title="Hayttp\Traits\<API key>"><API key></abbr></a></em></dt>
<dd>Ensure that the status code is 302.</dd><dt><a href="Hayttp/Traits/<API key>.html#method_ensureJson"><abbr title="Hayttp\Traits\<API key>"><API key></abbr>::ensureJson</a>() — <em>Method in class <a href="Hayttp/Traits/<API key>.html"><abbr title="Hayttp\Traits\<API key>"><API key></abbr></a></em></dt>
<dd>Ensure that the content type is application/json.</dd><dt><a href="Hayttp/Traits/<API key>.html#method_ensureXml"><abbr title="Hayttp\Traits\<API key>"><API key></abbr>::ensureXml</a>() — <em>Method in class <a href="Hayttp/Traits/<API key>.html"><abbr title="Hayttp\Traits\<API key>"><API key></abbr></a></em></dt>
<dd>Ensure that the content type is application/xml.</dd><dt><a href="Hayttp/Traits/<API key>.html#<API key>"><abbr title="Hayttp\Traits\<API key>"><API key></abbr>::ensureContentType</a>() — <em>Method in class <a href="Hayttp/Traits/<API key>.html"><abbr title="Hayttp\Traits\<API key>"><API key></abbr></a></em></dt>
<dd>Ensure that the response has a given content type.</dd><dt><a href="Hayttp/Traits/<API key>.html#<API key>"><abbr title="Hayttp\Traits\<API key>"><API key></abbr>::ensureSuccess</a>() — <em>Method in class <a href="Hayttp/Traits/<API key>.html"><abbr title="Hayttp\Traits\<API key>"><API key></abbr></a></em></dt>
<dd>Ensure that the status code is in the range [200.</dd><dt><a href="Hayttp/Traits/<API key>.html#<API key>"><abbr title="Hayttp\Traits\<API key>"><API key></abbr>::ensureRedirect</a>() — <em>Method in class <a href="Hayttp/Traits/<API key>.html"><abbr title="Hayttp\Traits\<API key>"><API key></abbr></a></em></dt>
<dd>Assert whether the response is redirecting to a given URI.</dd><dt><a href="Hayttp/Traits/<API key>.html#<API key>"><abbr title="Hayttp\Traits\<API key>"><API key></abbr>::ensureHasHeader</a>() — <em>Method in class <a href="Hayttp/Traits/<API key>.html"><abbr title="Hayttp\Traits\<API key>"><API key></abbr></a></em></dt>
<dd>Asserts that the response contains the given header and equals the optional value.</dd><dt><a href="Hayttp/Traits/<API key>.html#<API key>"><abbr title="Hayttp\Traits\<API key>"><API key></abbr>::ensureContains</a>() — <em>Method in class <a href="Hayttp/Traits/<API key>.html"><abbr title="Hayttp\Traits\<API key>"><API key></abbr></a></em></dt>
<dd>Assert that the given string is contained within the response.</dd><dt><a href="Hayttp/Util.html#<API key>"><abbr title="Hayttp\Util">Util</abbr>::ensureValidUrl</a>() — <em>Method in class <a href="Hayttp/Util.html"><abbr title="Hayttp\Util">Util</abbr></a></em></dt>
<dd>Ensure that a url is valid.</dd> </dl><h2 id="letterG">G</h2>
<dl id="index"><dt><a href="Hayttp/Exceptions/<API key>.html#method_getRequest"><abbr title="Hayttp\Exceptions\<API key>"><API key></abbr>::getRequest</a>() — <em>Method in class <a href="Hayttp/Exceptions/<API key>.html"><abbr title="Hayttp\Exceptions\<API key>"><API key></abbr></a></em></dt>
<dd>Get the request that couldn't connect.</dd><dt><a href="Hayttp/Exceptions/ResponseException.html#method_getRequest"><abbr title="Hayttp\Exceptions\ResponseException">ResponseException</abbr>::getRequest</a>() — <em>Method in class <a href="Hayttp/Exceptions/ResponseException.html"><abbr title="Hayttp\Exceptions\ResponseException">ResponseException</abbr></a></em></dt>
<dd>Get the request that caused the bad response.</dd><dt><a href="Hayttp/Exceptions/ResponseException.html#method_getResponse"><abbr title="Hayttp\Exceptions\ResponseException">ResponseException</abbr>::getResponse</a>() — <em>Method in class <a href="Hayttp/Exceptions/ResponseException.html"><abbr title="Hayttp\Exceptions\ResponseException">ResponseException</abbr></a></em></dt>
<dd>Get the response that couldn't connect.</dd><dt><a href="Hayttp/Exceptions/RouteException.html#method_getRoute"><abbr title="Hayttp\Exceptions\RouteException">RouteException</abbr>::getRoute</a>() — <em>Method in class <a href="Hayttp/Exceptions/RouteException.html"><abbr title="Hayttp\Exceptions\RouteException">RouteException</abbr></a></em></dt>
<dd>Get the route.</dd><dt><a href="Hayttp/Hayttp.html#method_get"><abbr title="Hayttp\Hayttp">Hayttp</abbr>::get</a>() — <em>Method in class <a href="Hayttp/Hayttp.html"><abbr title="Hayttp\Hayttp">Hayttp</abbr></a></em></dt>
<dd>Create a GET request</dd><dt><a href="Hayttp/Mock/Route.html#method_get"><abbr title="Hayttp\Mock\Route">Route</abbr>::get</a>() — <em>Method in class <a href="Hayttp/Mock/Route.html"><abbr title="Hayttp\Mock\Route">Route</abbr></a></em></dt>
<dd>Get a parameter.</dd><dt><a href="Hayttp/Traits/CreatesRequests.html#method_get"><abbr title="Hayttp\Traits\CreatesRequests">CreatesRequests</abbr>::get</a>() — <em>Method in class <a href="Hayttp/Traits/CreatesRequests.html"><abbr title="Hayttp\Traits\CreatesRequests">CreatesRequests</abbr></a></em></dt>
<dd>Factory.</dd> </dl><h2 id="letterH">H</h2>
<dl id="index"><dt><a href="Hayttp/Contracts/Request.html#method_headers"><abbr title="Hayttp\Contracts\Request">Request</abbr>::headers</a>() — <em>Method in class <a href="Hayttp/Contracts/Request.html"><abbr title="Hayttp\Contracts\Request">Request</abbr></a></em></dt>
<dd></dd><dt><a href="Hayttp/Contracts/Response.html#method_headers"><abbr title="Hayttp\Contracts\Response">Response</abbr>::headers</a>() — <em>Method in class <a href="Hayttp/Contracts/Response.html"><abbr title="Hayttp\Contracts\Response">Response</abbr></a></em></dt>
<dd>Get the headers.</dd><dt><a href="Hayttp/Contracts/Response.html#<API key>"><abbr title="Hayttp\Contracts\Response">Response</abbr>::hasContentType</a>() — <em>Method in class <a href="Hayttp/Contracts/Response.html"><abbr title="Hayttp\Contracts\Response">Response</abbr></a></em></dt>
<dd>Does the response have a given content type.</dd><dt><a href="Hayttp/Exceptions/Response/HeaderException.html"><abbr title="Hayttp\Exceptions\Response\HeaderException">HeaderException</abbr></a> — <em>Class in namespace <a href="Hayttp/Exceptions/Response.html">Hayttp\Exceptions\Response</a></em></dt>
<dd>Http connection exception.</dd><dt><a href="Hayttp/Hayttp.html"><abbr title="Hayttp\Hayttp">Hayttp</abbr></a> — <em>Class in namespace <a href="Hayttp.html">Hayttp</a></em></dt>
<dd>Request creation facade.</dd><dt><a href="Hayttp/Hayttp.html#method_head"><abbr title="Hayttp\Hayttp">Hayttp</abbr>::head</a>() — <em>Method in class <a href="Hayttp/Hayttp.html"><abbr title="Hayttp\Hayttp">Hayttp</abbr></a></em></dt>
<dd>Create a HEAD request</dd><dt><a href="Hayttp/Mock/Endpoint.html#method_handles"><abbr title="Hayttp\Mock\Endpoint">Endpoint</abbr>::handles</a>() — <em>Method in class <a href="Hayttp/Mock/Endpoint.html"><abbr title="Hayttp\Mock\Endpoint">Endpoint</abbr></a></em></dt>
<dd>Does this mock endpoint handle a given request ?</dd><dt><a href="Hayttp/Mock/Endpoint.html#method_handle"><abbr title="Hayttp\Mock\Endpoint">Endpoint</abbr>::handle</a>() — <em>Method in class <a href="Hayttp/Mock/Endpoint.html"><abbr title="Hayttp\Mock\Endpoint">Endpoint</abbr></a></em></dt>
<dd>Handle/mock a request.</dd><dt><a href="Hayttp/Mock/Route.html#method_has"><abbr title="Hayttp\Mock\Route">Route</abbr>::has</a>() — <em>Method in class <a href="Hayttp/Mock/Route.html"><abbr title="Hayttp\Mock\Route">Route</abbr></a></em></dt>
<dd>Does the given parameter exist.</dd><dt>$<a href="Hayttp/Request.html#property_headers"><abbr title="Hayttp\Request">Request</abbr></a> — <em>Property in class <a href="Hayttp/Request.html"><abbr title="Hayttp\Request">Request</abbr></a></em></dt>
<dd></dd><dt>$<a href="Hayttp/Response.html#property_headers"><abbr title="Hayttp\Response">Response</abbr></a> — <em>Property in class <a href="Hayttp/Response.html"><abbr title="Hayttp\Response">Response</abbr></a></em></dt>
<dd></dd><dt><a href="Hayttp/Response.html#method_headers"><abbr title="Hayttp\Response">Response</abbr>::headers</a>() — <em>Method in class <a href="Hayttp/Response.html"><abbr title="Hayttp\Response">Response</abbr></a></em></dt>
<dd>Get the headers.</dd><dt><a href="Hayttp/Response.html#method_header"><abbr title="Hayttp\Response">Response</abbr>::header</a>() — <em>Method in class <a href="Hayttp/Response.html"><abbr title="Hayttp\Response">Response</abbr></a></em></dt>
<dd>Get the contents of a given header.</dd><dt><a href="Hayttp/Response.html#<API key>"><abbr title="Hayttp\Response">Response</abbr>::hasContentType</a>() — <em>Method in class <a href="Hayttp/Response.html"><abbr title="Hayttp\Response">Response</abbr></a></em></dt>
<dd>Does the response have a given content type.</dd><dt><a href="Hayttp/Traits/CreatesRequests.html#method_head"><abbr title="Hayttp\Traits\CreatesRequests">CreatesRequests</abbr>::head</a>() — <em>Method in class <a href="Hayttp/Traits/CreatesRequests.html"><abbr title="Hayttp\Traits\CreatesRequests">CreatesRequests</abbr></a></em></dt>
<dd>Factory.</dd><dt><a href="Hayttp/Traits/Extendable.html#method_hasExtension"><abbr title="Hayttp\Traits\Extendable">Extendable</abbr>::hasExtension</a>() — <em>Method in class <a href="Hayttp/Traits/Extendable.html"><abbr title="Hayttp\Traits\Extendable">Extendable</abbr></a></em></dt>
<dd></dd><dt><a href="Hayttp/Traits/<API key>.html"><abbr title="Hayttp\Traits\<API key>"><API key></abbr></a> — <em>Class in namespace <a href="Hayttp/Traits.html">Hayttp\Traits</a></em></dt>
<dd></dd><dt><a href="Hayttp/Traits/HasCallbacks.html"><abbr title="Hayttp\Traits\HasCallbacks">HasCallbacks</abbr></a> — <em>Class in namespace <a href="Hayttp/Traits.html">Hayttp\Traits</a></em></dt>
<dd></dd><dt><a href="Hayttp/Traits/<API key>.html"><abbr title="Hayttp\Traits\<API key>"><API key></abbr></a> — <em>Class in namespace <a href="Hayttp/Traits.html">Hayttp\Traits</a></em></dt>
<dd>Add __debugInfo support.</dd><dt><a href="Hayttp/Traits/HasRequestAccessors.html"><abbr title="Hayttp\Traits\HasRequestAccessors">HasRequestAccessors</abbr></a> — <em>Class in namespace <a href="Hayttp/Traits.html">Hayttp\Traits</a></em></dt>
<dd></dd><dt><a href="Hayttp/Traits/HasRequestAccessors.html#method_headers"><abbr title="Hayttp\Traits\HasRequestAccessors">HasRequestAccessors</abbr>::headers</a>() — <em>Method in class <a href="Hayttp/Traits/HasRequestAccessors.html"><abbr title="Hayttp\Traits\HasRequestAccessors">HasRequestAccessors</abbr></a></em></dt>
<dd></dd><dt><a href="Hayttp/Traits/HasRequestAccessors.html#method_header"><abbr title="Hayttp\Traits\HasRequestAccessors">HasRequestAccessors</abbr>::header</a>() — <em>Method in class <a href="Hayttp/Traits/HasRequestAccessors.html"><abbr title="Hayttp\Traits\HasRequestAccessors">HasRequestAccessors</abbr></a></em></dt>
<dd>Get the contents of a given header.</dd><dt><a href="Hayttp/Traits/HasStatusHelpers.html"><abbr title="Hayttp\Traits\HasStatusHelpers">HasStatusHelpers</abbr></a> — <em>Class in namespace <a href="Hayttp/Traits.html">Hayttp\Traits</a></em></dt>
<dd></dd><dt><a href="Hayttp/Traits/HasWithMethods.html"><abbr title="Hayttp\Traits\HasWithMethods">HasWithMethods</abbr></a> — <em>Class in namespace <a href="Hayttp/Traits.html">Hayttp\Traits</a></em></dt>
<dd></dd> </dl><h2 id="letterI">I</h2>
<dl id="index"><dt><a href="Hayttp/Contracts/Response.html#method_is2xx"><abbr title="Hayttp\Contracts\Response">Response</abbr>::is2xx</a>() — <em>Method in class <a href="Hayttp/Contracts/Response.html"><abbr title="Hayttp\Contracts\Response">Response</abbr></a></em></dt>
<dd>Is the status code 2xx ?</dd><dt><a href="Hayttp/Contracts/Response.html#method_is3xx"><abbr title="Hayttp\Contracts\Response">Response</abbr>::is3xx</a>() — <em>Method in class <a href="Hayttp/Contracts/Response.html"><abbr title="Hayttp\Contracts\Response">Response</abbr></a></em></dt>
<dd>Is the status code 3xx ?</dd><dt><a href="Hayttp/Contracts/Response.html#method_is4xx"><abbr title="Hayttp\Contracts\Response">Response</abbr>::is4xx</a>() — <em>Method in class <a href="Hayttp/Contracts/Response.html"><abbr title="Hayttp\Contracts\Response">Response</abbr></a></em></dt>
<dd>Is the status code 3xx ?</dd><dt><a href="Hayttp/Contracts/Response.html#method_is5xx"><abbr title="Hayttp\Contracts\Response">Response</abbr>::is5xx</a>() — <em>Method in class <a href="Hayttp/Contracts/Response.html"><abbr title="Hayttp\Contracts\Response">Response</abbr></a></em></dt>
<dd>Is the status code 5xx ?</dd><dt><a href="Hayttp/Contracts/Response.html#method_isSuccess"><abbr title="Hayttp\Contracts\Response">Response</abbr>::isSuccess</a>() — <em>Method in class <a href="Hayttp/Contracts/Response.html"><abbr title="Hayttp\Contracts\Response">Response</abbr></a></em></dt>
<dd>Is this request a success? (i.e. a 2xx status code).</dd><dt><a href="Hayttp/Contracts/Response.html#method_isRedirect"><abbr title="Hayttp\Contracts\Response">Response</abbr>::isRedirect</a>() — <em>Method in class <a href="Hayttp/Contracts/Response.html"><abbr title="Hayttp\Contracts\Response">Response</abbr></a></em></dt>
<dd>Is this request a redirect? (i.e. a 3xx status code).</dd><dt><a href="Hayttp/Contracts/Response.html#method_isError"><abbr title="Hayttp\Contracts\Response">Response</abbr>::isError</a>() — <em>Method in class <a href="Hayttp/Contracts/Response.html"><abbr title="Hayttp\Contracts\Response">Response</abbr></a></em></dt>
<dd>Is this request a failure? (i.e. a 4xx or 5xx status code).</dd><dt><a href="Hayttp/Contracts/Response.html#method_isJson"><abbr title="Hayttp\Contracts\Response">Response</abbr>::isJson</a>() — <em>Method in class <a href="Hayttp/Contracts/Response.html"><abbr title="Hayttp\Contracts\Response">Response</abbr></a></em></dt>
<dd>Is this a json response.</dd><dt><a href="Hayttp/Contracts/Response.html#method_isXml"><abbr title="Hayttp\Contracts\Response">Response</abbr>::isXml</a>() — <em>Method in class <a href="Hayttp/Contracts/Response.html"><abbr title="Hayttp\Contracts\Response">Response</abbr></a></em></dt>
<dd>Is this an xml response.</dd><dt><a href="Hayttp/Contracts/Response.html#method_isPlainText"><abbr title="Hayttp\Contracts\Response">Response</abbr>::isPlainText</a>() — <em>Method in class <a href="Hayttp/Contracts/Response.html"><abbr title="Hayttp\Contracts\Response">Response</abbr></a></em></dt>
<dd>Is the response text/plain.</dd><dt><a href="Hayttp/Contracts/Response.html#method_isText"><abbr title="Hayttp\Contracts\Response">Response</abbr>::isText</a>() — <em>Method in class <a href="Hayttp/Contracts/Response.html"><abbr title="Hayttp\Contracts\Response">Response</abbr></a></em></dt>
<dd>Is this a text response.</dd><dt><a href="Hayttp/Contracts/Response.html#method_isUrlEncoded"><abbr title="Hayttp\Contracts\Response">Response</abbr>::isUrlEncoded</a>() — <em>Method in class <a href="Hayttp/Contracts/Response.html"><abbr title="Hayttp\Contracts\Response">Response</abbr></a></em></dt>
<dd>Is this an url-encoded response.</dd><dt><a href="Hayttp/Hayttp.html#method_instance"><abbr title="Hayttp\Hayttp">Hayttp</abbr>::instance</a>() — <em>Method in class <a href="Hayttp/Hayttp.html"><abbr title="Hayttp\Hayttp">Hayttp</abbr></a></em></dt>
<dd>Get the default/global instance.</dd><dt><a href="Hayttp/Response.html#method_isJson"><abbr title="Hayttp\Response">Response</abbr>::isJson</a>() — <em>Method in class <a href="Hayttp/Response.html"><abbr title="Hayttp\Response">Response</abbr></a></em></dt>
<dd>Is this a json response.</dd><dt><a href="Hayttp/Response.html#method_isXml"><abbr title="Hayttp\Response">Response</abbr>::isXml</a>() — <em>Method in class <a href="Hayttp/Response.html"><abbr title="Hayttp\Response">Response</abbr></a></em></dt>
<dd>Is this an xml response.</dd><dt><a href="Hayttp/Response.html#method_isPlainText"><abbr title="Hayttp\Response">Response</abbr>::isPlainText</a>() — <em>Method in class <a href="Hayttp/Response.html"><abbr title="Hayttp\Response">Response</abbr></a></em></dt>
<dd>Is the response text/plain.</dd><dt><a href="Hayttp/Response.html#method_isText"><abbr title="Hayttp\Response">Response</abbr>::isText</a>() — <em>Method in class <a href="Hayttp/Response.html"><abbr title="Hayttp\Response">Response</abbr></a></em></dt>
<dd>Is this a text response.</dd><dt><a href="Hayttp/Response.html#method_isUrlEncoded"><abbr title="Hayttp\Response">Response</abbr>::isUrlEncoded</a>() — <em>Method in class <a href="Hayttp/Response.html"><abbr title="Hayttp\Response">Response</abbr></a></em></dt>
<dd>Is this an url-encoded response.</dd><dt><a href="Hayttp/Traits/HasCallbacks.html#method_isRedirect"><abbr title="Hayttp\Traits\HasCallbacks">HasCallbacks</abbr>::isRedirect</a>() — <em>Method in class <a href="Hayttp/Traits/HasCallbacks.html"><abbr title="Hayttp\Traits\HasCallbacks">HasCallbacks</abbr></a></em></dt>
<dd></dd><dt><a href="Hayttp/Traits/HasCallbacks.html#method_isSuccess"><abbr title="Hayttp\Traits\HasCallbacks">HasCallbacks</abbr>::isSuccess</a>() — <em>Method in class <a href="Hayttp/Traits/HasCallbacks.html"><abbr title="Hayttp\Traits\HasCallbacks">HasCallbacks</abbr></a></em></dt>
<dd></dd><dt><a href="Hayttp/Traits/HasCallbacks.html#method_isError"><abbr title="Hayttp\Traits\HasCallbacks">HasCallbacks</abbr>::isError</a>() — <em>Method in class <a href="Hayttp/Traits/HasCallbacks.html"><abbr title="Hayttp\Traits\HasCallbacks">HasCallbacks</abbr></a></em></dt>
<dd></dd><dt><a href="Hayttp/Traits/HasCallbacks.html#method_is2xx"><abbr title="Hayttp\Traits\HasCallbacks">HasCallbacks</abbr>::is2xx</a>() — <em>Method in class <a href="Hayttp/Traits/HasCallbacks.html"><abbr title="Hayttp\Traits\HasCallbacks">HasCallbacks</abbr></a></em></dt>
<dd></dd><dt><a href="Hayttp/Traits/HasCallbacks.html#method_is3xx"><abbr title="Hayttp\Traits\HasCallbacks">HasCallbacks</abbr>::is3xx</a>() — <em>Method in class <a href="Hayttp/Traits/HasCallbacks.html"><abbr title="Hayttp\Traits\HasCallbacks">HasCallbacks</abbr></a></em></dt>
<dd></dd><dt><a href="Hayttp/Traits/HasCallbacks.html#method_is4xx"><abbr title="Hayttp\Traits\HasCallbacks">HasCallbacks</abbr>::is4xx</a>() — <em>Method in class <a href="Hayttp/Traits/HasCallbacks.html"><abbr title="Hayttp\Traits\HasCallbacks">HasCallbacks</abbr></a></em></dt>
<dd></dd><dt><a href="Hayttp/Traits/HasCallbacks.html#method_is5xx"><abbr title="Hayttp\Traits\HasCallbacks">HasCallbacks</abbr>::is5xx</a>() — <em>Method in class <a href="Hayttp/Traits/HasCallbacks.html"><abbr title="Hayttp\Traits\HasCallbacks">HasCallbacks</abbr></a></em></dt>
<dd></dd><dt><a href="Hayttp/Traits/<API key>.html#<API key>"><abbr title="Hayttp\Traits\<API key>"><API key></abbr>::instanceVariables</a>() — <em>Method in class <a href="Hayttp/Traits/<API key>.html"><abbr title="Hayttp\Traits\<API key>"><API key></abbr></a></em></dt>
<dd>Public accessor for all instance variables.</dd><dt><a href="Hayttp/Traits/HasStatusHelpers.html#method_is2xx"><abbr title="Hayttp\Traits\HasStatusHelpers">HasStatusHelpers</abbr>::is2xx</a>() — <em>Method in class <a href="Hayttp/Traits/HasStatusHelpers.html"><abbr title="Hayttp\Traits\HasStatusHelpers">HasStatusHelpers</abbr></a></em></dt>
<dd>Is the status code 2xx ?</dd><dt><a href="Hayttp/Traits/HasStatusHelpers.html#method_is3xx"><abbr title="Hayttp\Traits\HasStatusHelpers">HasStatusHelpers</abbr>::is3xx</a>() — <em>Method in class <a href="Hayttp/Traits/HasStatusHelpers.html"><abbr title="Hayttp\Traits\HasStatusHelpers">HasStatusHelpers</abbr></a></em></dt>
<dd>Is the status code 3xx ?</dd><dt><a href="Hayttp/Traits/HasStatusHelpers.html#method_is4xx"><abbr title="Hayttp\Traits\HasStatusHelpers">HasStatusHelpers</abbr>::is4xx</a>() — <em>Method in class <a href="Hayttp/Traits/HasStatusHelpers.html"><abbr title="Hayttp\Traits\HasStatusHelpers">HasStatusHelpers</abbr></a></em></dt>
<dd>Is the status code 3xx ?</dd><dt><a href="Hayttp/Traits/HasStatusHelpers.html#method_is5xx"><abbr title="Hayttp\Traits\HasStatusHelpers">HasStatusHelpers</abbr>::is5xx</a>() — <em>Method in class <a href="Hayttp/Traits/HasStatusHelpers.html"><abbr title="Hayttp\Traits\HasStatusHelpers">HasStatusHelpers</abbr></a></em></dt>
<dd>Is the status code 5xx ?</dd><dt><a href="Hayttp/Traits/HasStatusHelpers.html#method_isSuccess"><abbr title="Hayttp\Traits\HasStatusHelpers">HasStatusHelpers</abbr>::isSuccess</a>() — <em>Method in class <a href="Hayttp/Traits/HasStatusHelpers.html"><abbr title="Hayttp\Traits\HasStatusHelpers">HasStatusHelpers</abbr></a></em></dt>
<dd>Is this request a success? (i.e. a 2xx status code).</dd><dt><a href="Hayttp/Traits/HasStatusHelpers.html#method_isRedirect"><abbr title="Hayttp\Traits\HasStatusHelpers">HasStatusHelpers</abbr>::isRedirect</a>() — <em>Method in class <a href="Hayttp/Traits/HasStatusHelpers.html"><abbr title="Hayttp\Traits\HasStatusHelpers">HasStatusHelpers</abbr></a></em></dt>
<dd>Is this request a redirect? (i.e. a 3xx status code).</dd><dt><a href="Hayttp/Traits/HasStatusHelpers.html#method_isError"><abbr title="Hayttp\Traits\HasStatusHelpers">HasStatusHelpers</abbr>::isError</a>() — <em>Method in class <a href="Hayttp/Traits/HasStatusHelpers.html"><abbr title="Hayttp\Traits\HasStatusHelpers">HasStatusHelpers</abbr></a></em></dt>
<dd>Is this request a failure? (i.e. a 4xx or 5xx status code).</dd> </dl><h2 id="letterJ">J</h2>
<dl id="index"><dt><a href="Hayttp/Contracts/Response.html#method_jsonDecoded"><abbr title="Hayttp\Contracts\Response">Response</abbr>::jsonDecoded</a>() — <em>Method in class <a href="Hayttp/Contracts/Response.html"><abbr title="Hayttp\Contracts\Response">Response</abbr></a></em></dt>
<dd>Parse the body as json and return it as a PHP value.</dd><dt><a href="Hayttp/Payloads/JsonPayload.html"><abbr title="Hayttp\Payloads\JsonPayload">JsonPayload</abbr></a> — <em>Class in namespace <a href="Hayttp/Payloads.html">Hayttp\Payloads</a></em></dt>
<dd>Raw (string) body Helper.</dd><dt><a href="Hayttp/Response.html#method_jsonDecoded"><abbr title="Hayttp\Response">Response</abbr>::jsonDecoded</a>() — <em>Method in class <a href="Hayttp/Response.html"><abbr title="Hayttp\Response">Response</abbr></a></em></dt>
<dd>Parse the body as json and return it as a PHP value.</dd> </dl><h2 id="letterM">M</h2>
<dl id="index"><dt><a href="Hayttp/Contracts/Request.html#method_method"><abbr title="Hayttp\Contracts\Request">Request</abbr>::method</a>() — <em>Method in class <a href="Hayttp/Contracts/Request.html"><abbr title="Hayttp\Contracts\Request">Request</abbr></a></em></dt>
<dd>The http method.</dd><dt><a href="Hayttp/Contracts/Response.html#method_metadata"><abbr title="Hayttp\Contracts\Response">Response</abbr>::metadata</a>() — <em>Method in class <a href="Hayttp/Contracts/Response.html"><abbr title="Hayttp\Contracts\Response">Response</abbr></a></em></dt>
<dd>Get the (raw) metadata.</dd><dt>$<a href="Hayttp/Exceptions/<API key>.html#property_metadata"><abbr title="Hayttp\Exceptions\<API key>"><API key></abbr></a> — <em>Property in class <a href="Hayttp/Exceptions/<API key>.html"><abbr title="Hayttp\Exceptions\<API key>"><API key></abbr></a></em></dt>
<dd></dd><dt><a href="Hayttp/Exceptions/<API key>.html#method_metadata"><abbr title="Hayttp\Exceptions\<API key>"><API key></abbr>::metadata</a>() — <em>Method in class <a href="Hayttp/Exceptions/<API key>.html"><abbr title="Hayttp\Exceptions\<API key>"><API key></abbr></a></em></dt>
<dd>Get the metadata for this request.</dd><dt>$<a href="Hayttp/Hayttp.html#property_mountPoint"><abbr title="Hayttp\Hayttp">Hayttp</abbr></a> — <em>Property in class <a href="Hayttp/Hayttp.html"><abbr title="Hayttp\Hayttp">Hayttp</abbr></a></em></dt>
<dd></dd><dt><a href="Hayttp/Hayttp.html#method_mockEndpoint"><abbr title="Hayttp\Hayttp">Hayttp</abbr>::mockEndpoint</a>() — <em>Method in class <a href="Hayttp/Hayttp.html"><abbr title="Hayttp\Hayttp">Hayttp</abbr></a></em></dt>
<dd>Add a mocked end point to all requests created by the global Hayttp facade.</dd><dt><a href="Hayttp/Mock/Endpoint.html#method_makeUrlRegex"><abbr title="Hayttp\Mock\Endpoint">Endpoint</abbr>::makeUrlRegex</a>() — <em>Method in class <a href="Hayttp/Mock/Endpoint.html"><abbr title="Hayttp\Mock\Endpoint">Endpoint</abbr></a></em></dt>
<dd>Convert a url pattern into a regular expression.</dd><dt><a href="Hayttp/Mock/MockResponse.html"><abbr title="Hayttp\Mock\MockResponse">MockResponse</abbr></a> — <em>Class in namespace <a href="Hayttp/Mock.html">Hayttp\Mock</a></em></dt>
<dd>Mock Request.</dd><dt><a href="Hayttp/Payloads/MultipartPayload.html"><abbr title="Hayttp\Payloads\MultipartPayload">MultipartPayload</abbr></a> — <em>Class in namespace <a href="Hayttp/Payloads.html">Hayttp\Payloads</a></em></dt>
<dd>Multipart Body Helper.</dd><dt>$<a href="Hayttp/Request.html#property_method"><abbr title="Hayttp\Request">Request</abbr></a> — <em>Property in class <a href="Hayttp/Request.html"><abbr title="Hayttp\Request">Request</abbr></a></em></dt>
<dd></dd><dt>$<a href="Hayttp/Request.html#<API key>"><abbr title="Hayttp\Request">Request</abbr></a> — <em>Property in class <a href="Hayttp/Request.html"><abbr title="Hayttp\Request">Request</abbr></a></em></dt>
<dd></dd><dt>$<a href="Hayttp/Response.html#property_metadata"><abbr title="Hayttp\Response">Response</abbr></a> — <em>Property in class <a href="Hayttp/Response.html"><abbr title="Hayttp\Response">Response</abbr></a></em></dt>
<dd></dd><dt><a href="Hayttp/Response.html#method_metadata"><abbr title="Hayttp\Response">Response</abbr>::metadata</a>() — <em>Method in class <a href="Hayttp/Response.html"><abbr title="Hayttp\Response">Response</abbr></a></em></dt>
<dd>Get the (raw) metadata.</dd><dt><a href="Hayttp/Traits/Extendable.html#method_mixin"><abbr title="Hayttp\Traits\Extendable">Extendable</abbr>::mixin</a>() — <em>Method in class <a href="Hayttp/Traits/Extendable.html"><abbr title="Hayttp\Traits\Extendable">Extendable</abbr></a></em></dt>
<dd>Mix in all the public methods of an object.</dd><dt><a href="Hayttp/Traits/HasRequestAccessors.html#method_method"><abbr title="Hayttp\Traits\HasRequestAccessors">HasRequestAccessors</abbr>::method</a>() — <em>Method in class <a href="Hayttp/Traits/HasRequestAccessors.html"><abbr title="Hayttp\Traits\HasRequestAccessors">HasRequestAccessors</abbr></a></em></dt>
<dd>The http method.</dd><dt><a href="Hayttp/Traits/<API key>.html"><abbr title="Hayttp\Traits\<API key>"><API key></abbr></a> — <em>Class in namespace <a href="Hayttp/Traits.html">Hayttp\Traits</a></em></dt>
<dd></dd><dt><a href="Hayttp/Util.html#<API key>"><abbr title="Hayttp\Util">Util</abbr>::<API key></a>() — <em>Method in class <a href="Hayttp/Util.html"><abbr title="Hayttp\Util">Util</abbr></a></em></dt>
<dd>Create an assertion/expectation message for assertions.</dd> </dl><h2 id="letterN">N</h2>
<dl id="index"><dt><a href="Hayttp/Engines/NativeEngine.html"><abbr title="Hayttp\Engines\NativeEngine">NativeEngine</abbr></a> — <em>Class in namespace <a href="Hayttp/Engines.html">Hayttp\Engines</a></em></dt>
<dd></dd><dt><a href="Hayttp/Mock/MockResponse.html#method_new"><abbr title="Hayttp\Mock\MockResponse">MockResponse</abbr>::new</a>() — <em>Method in class <a href="Hayttp/Mock/MockResponse.html"><abbr title="Hayttp\Mock\MockResponse">MockResponse</abbr></a></em></dt>
<dd>Factory.</dd><dt><a href="Hayttp/Util.html#<API key>"><abbr title="Hayttp\Util">Util</abbr>::normalizeHeaders</a>() — <em>Method in class <a href="Hayttp/Util.html"><abbr title="Hayttp\Util">Util</abbr></a></em></dt>
<dd>Normalize an array of headers.</dd><dt><a href="Hayttp/Util.html#<API key>"><abbr title="Hayttp\Util">Util</abbr>::normalizeHeaderName</a>() — <em>Method in class <a href="Hayttp/Util.html"><abbr title="Hayttp\Util">Util</abbr></a></em></dt>
<dd>Normalize a header name.</dd> </dl><h2 id="letterO">O</h2>
<dl id="index"><dt><a href="Hayttp/Contracts/Response.html#method_on5xx"><abbr title="Hayttp\Contracts\Response">Response</abbr>::on5xx</a>() — <em>Method in class <a href="Hayttp/Contracts/Response.html"><abbr title="Hayttp\Contracts\Response">Response</abbr></a></em></dt>
<dd>Execute a callback if statusCode is 5xx.</dd><dt><a href="Hayttp/Contracts/Response.html#method_on4xx"><abbr title="Hayttp\Contracts\Response">Response</abbr>::on4xx</a>() — <em>Method in class <a href="Hayttp/Contracts/Response.html"><abbr title="Hayttp\Contracts\Response">Response</abbr></a></em></dt>
<dd>Execute a callback if statusCode is 4xx.</dd><dt><a href="Hayttp/Contracts/Response.html#method_on3xx"><abbr title="Hayttp\Contracts\Response">Response</abbr>::on3xx</a>() — <em>Method in class <a href="Hayttp/Contracts/Response.html"><abbr title="Hayttp\Contracts\Response">Response</abbr></a></em></dt>
<dd>Execute a callback if statusCode is 3xx.</dd><dt><a href="Hayttp/Contracts/Response.html#method_on2xx"><abbr title="Hayttp\Contracts\Response">Response</abbr>::on2xx</a>() — <em>Method in class <a href="Hayttp/Contracts/Response.html"><abbr title="Hayttp\Contracts\Response">Response</abbr></a></em></dt>
<dd>Execute a callback if status code is 2xx.</dd><dt><a href="Hayttp/Contracts/Response.html#method_onError"><abbr title="Hayttp\Contracts\Response">Response</abbr>::onError</a>() — <em>Method in class <a href="Hayttp/Contracts/Response.html"><abbr title="Hayttp\Contracts\Response">Response</abbr></a></em></dt>
<dd>Execute a callback if status code is 4xx or 5xx.</dd><dt><a href="Hayttp/Contracts/Response.html#method_onSuccess"><abbr title="Hayttp\Contracts\Response">Response</abbr>::onSuccess</a>() — <em>Method in class <a href="Hayttp/Contracts/Response.html"><abbr title="Hayttp\Contracts\Response">Response</abbr></a></em></dt>
<dd>Execute a callback if status code indicates a success.</dd><dt><a href="Hayttp/Contracts/Response.html#method_onStatusCode"><abbr title="Hayttp\Contracts\Response">Response</abbr>::onStatusCode</a>() — <em>Method in class <a href="Hayttp/Contracts/Response.html"><abbr title="Hayttp\Contracts\Response">Response</abbr></a></em></dt>
<dd>Execute a callback if status code === $statusCode.</dd><dt><a href="Hayttp/Hayttp.html#method_options"><abbr title="Hayttp\Hayttp">Hayttp</abbr>::options</a>() — <em>Method in class <a href="Hayttp/Hayttp.html"><abbr title="Hayttp\Hayttp">Hayttp</abbr></a></em></dt>
<dd>Create a OPTIONS request</dd><dt><a href="Hayttp/Traits/CreatesRequests.html#method_options"><abbr title="Hayttp\Traits\CreatesRequests">CreatesRequests</abbr>::options</a>() — <em>Method in class <a href="Hayttp/Traits/CreatesRequests.html"><abbr title="Hayttp\Traits\CreatesRequests">CreatesRequests</abbr></a></em></dt>
<dd>Factory.</dd><dt><a href="Hayttp/Traits/HasCallbacks.html#method_on5xx"><abbr title="Hayttp\Traits\HasCallbacks">HasCallbacks</abbr>::on5xx</a>() — <em>Method in class <a href="Hayttp/Traits/HasCallbacks.html"><abbr title="Hayttp\Traits\HasCallbacks">HasCallbacks</abbr></a></em></dt>
<dd>Execute a callback if statusCode is 5xx.</dd><dt><a href="Hayttp/Traits/HasCallbacks.html#method_on4xx"><abbr title="Hayttp\Traits\HasCallbacks">HasCallbacks</abbr>::on4xx</a>() — <em>Method in class <a href="Hayttp/Traits/HasCallbacks.html"><abbr title="Hayttp\Traits\HasCallbacks">HasCallbacks</abbr></a></em></dt>
<dd>Execute a callback if statusCode is 4xx.</dd><dt><a href="Hayttp/Traits/HasCallbacks.html#method_on3xx"><abbr title="Hayttp\Traits\HasCallbacks">HasCallbacks</abbr>::on3xx</a>() — <em>Method in class <a href="Hayttp/Traits/HasCallbacks.html"><abbr title="Hayttp\Traits\HasCallbacks">HasCallbacks</abbr></a></em></dt>
<dd>Execute a callback if statusCode is 3xx.</dd><dt><a href="Hayttp/Traits/HasCallbacks.html#method_on2xx"><abbr title="Hayttp\Traits\HasCallbacks">HasCallbacks</abbr>::on2xx</a>() — <em>Method in class <a href="Hayttp/Traits/HasCallbacks.html"><abbr title="Hayttp\Traits\HasCallbacks">HasCallbacks</abbr></a></em></dt>
<dd>Execute a callback if status code is 2xx.</dd><dt><a href="Hayttp/Traits/HasCallbacks.html#method_onError"><abbr title="Hayttp\Traits\HasCallbacks">HasCallbacks</abbr>::onError</a>() — <em>Method in class <a href="Hayttp/Traits/HasCallbacks.html"><abbr title="Hayttp\Traits\HasCallbacks">HasCallbacks</abbr></a></em></dt>
<dd>Execute a callback if status code is 4xx or 5xx.</dd><dt><a href="Hayttp/Traits/HasCallbacks.html#method_onRedirect"><abbr title="Hayttp\Traits\HasCallbacks">HasCallbacks</abbr>::onRedirect</a>() — <em>Method in class <a href="Hayttp/Traits/HasCallbacks.html"><abbr title="Hayttp\Traits\HasCallbacks">HasCallbacks</abbr></a></em></dt>
<dd>Execute a callback if status code is 3xx.</dd><dt><a href="Hayttp/Traits/HasCallbacks.html#method_onSuccess"><abbr title="Hayttp\Traits\HasCallbacks">HasCallbacks</abbr>::onSuccess</a>() — <em>Method in class <a href="Hayttp/Traits/HasCallbacks.html"><abbr title="Hayttp\Traits\HasCallbacks">HasCallbacks</abbr></a></em></dt>
<dd>Execute a callback if status code indicates a success.</dd><dt><a href="Hayttp/Traits/HasCallbacks.html#method_onStatusCode"><abbr title="Hayttp\Traits\HasCallbacks">HasCallbacks</abbr>::onStatusCode</a>() — <em>Method in class <a href="Hayttp/Traits/HasCallbacks.html"><abbr title="Hayttp\Traits\HasCallbacks">HasCallbacks</abbr></a></em></dt>
<dd>Execute a callback if status code === $statusCode.</dd> </dl><h2 id="letterP">P</h2>
<dl id="index"><dt><a href="Hayttp/Contracts/Payload.html"><abbr title="Hayttp\Contracts\Payload">Payload</abbr></a> — <em>Class in namespace <a href="Hayttp/Contracts.html">Hayttp\Contracts</a></em></dt>
<dd></dd><dt><a href="Hayttp/Contracts/Request.html#<API key>"><abbr title="Hayttp\Contracts\Request">Request</abbr>::preparedHeaders</a>() — <em>Method in class <a href="Hayttp/Contracts/Request.html"><abbr title="Hayttp\Contracts\Request">Request</abbr></a></em></dt>
<dd>Format headers.</dd><dt><a href="Hayttp/Contracts/Request.html#method_payload"><abbr title="Hayttp\Contracts\Request">Request</abbr>::payload</a>() — <em>Method in class <a href="Hayttp/Contracts/Request.html"><abbr title="Hayttp\Contracts\Request">Request</abbr></a></em></dt>
<dd>The request payload.</dd><dt><a href="Hayttp/Contracts/Request.html#method_proxy"><abbr title="Hayttp\Contracts\Request">Request</abbr>::proxy</a>() — <em>Method in class <a href="Hayttp/Contracts/Request.html"><abbr title="Hayttp\Contracts\Request">Request</abbr></a></em></dt>
<dd>The proxy to use.</dd><dt><a href="Hayttp/Hayttp.html#method_post"><abbr title="Hayttp\Hayttp">Hayttp</abbr>::post</a>() — <em>Method in class <a href="Hayttp/Hayttp.html"><abbr title="Hayttp\Hayttp">Hayttp</abbr></a></em></dt>
<dd>Create a POST request</dd><dt><a href="Hayttp/Hayttp.html#method_put"><abbr title="Hayttp\Hayttp">Hayttp</abbr>::put</a>() — <em>Method in class <a href="Hayttp/Hayttp.html"><abbr title="Hayttp\Hayttp">Hayttp</abbr></a></em></dt>
<dd>Create a PUT request</dd><dt><a href="Hayttp/Hayttp.html#method_patch"><abbr title="Hayttp\Hayttp">Hayttp</abbr>::patch</a>() — <em>Method in class <a href="Hayttp/Hayttp.html"><abbr title="Hayttp\Hayttp">Hayttp</abbr></a></em></dt>
<dd>Create a PATCH request</dd><dt>$<a href="Hayttp/Mock/Route.html#property_params"><abbr title="Hayttp\Mock\Route">Route</abbr></a> — <em>Property in class <a href="Hayttp/Mock/Route.html"><abbr title="Hayttp\Mock\Route">Route</abbr></a></em></dt>
<dd></dd><dt><a href="Hayttp/Mock/Route.html#method_params"><abbr title="Hayttp\Mock\Route">Route</abbr>::params</a>() — <em>Method in class <a href="Hayttp/Mock/Route.html"><abbr title="Hayttp\Mock\Route">Route</abbr></a></em></dt>
<dd>Get all parameters.</dd><dt>$<a href="Hayttp/Request.html#property_payload"><abbr title="Hayttp\Request">Request</abbr></a> — <em>Property in class <a href="Hayttp/Request.html"><abbr title="Hayttp\Request">Request</abbr></a></em></dt>
<dd></dd><dt>$<a href="Hayttp/Request.html#property_proxy"><abbr title="Hayttp\Request">Request</abbr></a> — <em>Property in class <a href="Hayttp/Request.html"><abbr title="Hayttp\Request">Request</abbr></a></em></dt>
<dd></dd><dt><a href="Hayttp/Request.html#<API key>"><abbr title="Hayttp\Request">Request</abbr>::preparedHeaders</a>() — <em>Method in class <a href="Hayttp/Request.html"><abbr title="Hayttp\Request">Request</abbr></a></em></dt>
<dd>Format headers.</dd><dt><a href="Hayttp/Response.html#<API key>"><abbr title="Hayttp\Response">Response</abbr>::parseStatusLine</a>() — <em>Method in class <a href="Hayttp/Response.html"><abbr title="Hayttp\Response">Response</abbr></a></em></dt>
<dd>Return the status line of the response.</dd><dt><a href="Hayttp/Traits/CreatesRequests.html#method_patch"><abbr title="Hayttp\Traits\CreatesRequests">CreatesRequests</abbr>::patch</a>() — <em>Method in class <a href="Hayttp/Traits/CreatesRequests.html"><abbr title="Hayttp\Traits\CreatesRequests">CreatesRequests</abbr></a></em></dt>
<dd>Factory.</dd><dt><a href="Hayttp/Traits/CreatesRequests.html#method_post"><abbr title="Hayttp\Traits\CreatesRequests">CreatesRequests</abbr>::post</a>() — <em>Method in class <a href="Hayttp/Traits/CreatesRequests.html"><abbr title="Hayttp\Traits\CreatesRequests">CreatesRequests</abbr></a></em></dt>
<dd>Factory.</dd><dt><a href="Hayttp/Traits/CreatesRequests.html#method_put"><abbr title="Hayttp\Traits\CreatesRequests">CreatesRequests</abbr>::put</a>() — <em>Method in class <a href="Hayttp/Traits/CreatesRequests.html"><abbr title="Hayttp\Traits\CreatesRequests">CreatesRequests</abbr></a></em></dt>
<dd>Factory.</dd><dt><a href="Hayttp/Traits/HasRequestAccessors.html#method_payload"><abbr title="Hayttp\Traits\HasRequestAccessors">HasRequestAccessors</abbr>::payload</a>() — <em>Method in class <a href="Hayttp/Traits/HasRequestAccessors.html"><abbr title="Hayttp\Traits\HasRequestAccessors">HasRequestAccessors</abbr></a></em></dt>
<dd>The request payload.</dd><dt><a href="Hayttp/Traits/HasRequestAccessors.html#method_proxy"><abbr title="Hayttp\Traits\HasRequestAccessors">HasRequestAccessors</abbr>::proxy</a>() — <em>Method in class <a href="Hayttp/Traits/HasRequestAccessors.html"><abbr title="Hayttp\Traits\HasRequestAccessors">HasRequestAccessors</abbr></a></em></dt>
<dd>The proxy to use.</dd> </dl><h2 id="letterR">R</h2>
<dl id="index"><dt><a href="Hayttp/Contracts/Request.html"><abbr title="Hayttp\Contracts\Request">Request</abbr></a> — <em>Class in namespace <a href="Hayttp/Contracts.html">Hayttp\Contracts</a></em></dt>
<dd>Http Request.</dd><dt><a href="Hayttp/Contracts/Request.html#<API key>"><abbr title="Hayttp\Contracts\Request">Request</abbr>::responseCalls</a>() — <em>Method in class <a href="Hayttp/Contracts/Request.html"><abbr title="Hayttp\Contracts\Request">Request</abbr></a></em></dt>
<dd>Get the calls that are to be executed on the response
as soon as we have one.</dd><dt><a href="Hayttp/Contracts/Response.html"><abbr title="Hayttp\Contracts\Response">Response</abbr></a> — <em>Class in namespace <a href="Hayttp/Contracts.html">Hayttp\Contracts</a></em></dt>
<dd></dd><dt><a href="Hayttp/Contracts/Response.html#method_request"><abbr title="Hayttp\Contracts\Response">Response</abbr>::request</a>() — <em>Method in class <a href="Hayttp/Contracts/Response.html"><abbr title="Hayttp\Contracts\Response">Response</abbr></a></em></dt>
<dd>Get the request that produced this response.</dd><dt><a href="Hayttp/Contracts/Response.html#method_reasonPhrase"><abbr title="Hayttp\Contracts\Response">Response</abbr>::reasonPhrase</a>() — <em>Method in class <a href="Hayttp/Contracts/Response.html"><abbr title="Hayttp\Contracts\Response">Response</abbr></a></em></dt>
<dd>Get the http reason phrase.</dd><dt><a href="Hayttp/Contracts/Response.html#method_render"><abbr title="Hayttp\Contracts\Response">Response</abbr>::render</a>() — <em>Method in class <a href="Hayttp/Contracts/Response.html"><abbr title="Hayttp\Contracts\Response">Response</abbr></a></em></dt>
<dd>Get the entire response, including headers, as a string.</dd><dt>$<a href="Hayttp/Exceptions/<API key>.html#property_request"><abbr title="Hayttp\Exceptions\<API key>"><API key></abbr></a> — <em>Property in class <a href="Hayttp/Exceptions/<API key>.html"><abbr title="Hayttp\Exceptions\<API key>"><API key></abbr></a></em></dt>
<dd></dd><dt><a href="Hayttp/Exceptions/ResponseException.html"><abbr title="Hayttp\Exceptions\ResponseException">ResponseException</abbr></a> — <em>Class in namespace <a href="Hayttp/Exceptions.html">Hayttp\Exceptions</a></em></dt>
<dd>Http connection exception.</dd><dt>$<a href="Hayttp/Exceptions/ResponseException.html#property_response"><abbr title="Hayttp\Exceptions\ResponseException">ResponseException</abbr></a> — <em>Property in class <a href="Hayttp/Exceptions/ResponseException.html"><abbr title="Hayttp\Exceptions\ResponseException">ResponseException</abbr></a></em></dt>
<dd></dd><dt><a href="Hayttp/Exceptions/RouteException.html"><abbr title="Hayttp\Exceptions\RouteException">RouteException</abbr></a> — <em>Class in namespace <a href="Hayttp/Exceptions.html">Hayttp\Exceptions</a></em></dt>
<dd>Http connection exception.</dd><dt>$<a href="Hayttp/Exceptions/RouteException.html#property_route"><abbr title="Hayttp\Exceptions\RouteException">RouteException</abbr></a> — <em>Property in class <a href="Hayttp/Exceptions/RouteException.html"><abbr title="Hayttp\Exceptions\RouteException">RouteException</abbr></a></em></dt>
<dd></dd><dt>$<a href="Hayttp/Hayttp.html#<API key>"><abbr title="Hayttp\Hayttp">Hayttp</abbr></a> — <em>Property in class <a href="Hayttp/Hayttp.html"><abbr title="Hayttp\Hayttp">Hayttp</abbr></a></em></dt>
<dd></dd><dt><a href="Hayttp/Mock/Route.html"><abbr title="Hayttp\Mock\Route">Route</abbr></a> — <em>Class in namespace <a href="Hayttp/Mock.html">Hayttp\Mock</a></em></dt>
<dd>HTTP Mock server.</dd><dt><a href="Hayttp/Payloads/JsonPayload.html#method_render"><abbr title="Hayttp\Payloads\JsonPayload">JsonPayload</abbr>::render</a>() — <em>Method in class <a href="Hayttp/Payloads/JsonPayload.html"><abbr title="Hayttp\Payloads\JsonPayload">JsonPayload</abbr></a></em></dt>
<dd>Render into a http request body.</dd><dt><a href="Hayttp/Payloads/MultipartPayload.html#method_render"><abbr title="Hayttp\Payloads\MultipartPayload">MultipartPayload</abbr>::render</a>() — <em>Method in class <a href="Hayttp/Payloads/MultipartPayload.html"><abbr title="Hayttp\Payloads\MultipartPayload">MultipartPayload</abbr></a></em></dt>
<dd>Render into a http request body.</dd><dt><a href="Hayttp/Payloads/RawPayload.html"><abbr title="Hayttp\Payloads\RawPayload">RawPayload</abbr></a> — <em>Class in namespace <a href="Hayttp/Payloads.html">Hayttp\Payloads</a></em></dt>
<dd>Raw (string) body Helper.</dd><dt><a href="Hayttp/Payloads/RawPayload.html#method_render"><abbr title="Hayttp\Payloads\RawPayload">RawPayload</abbr>::render</a>() — <em>Method in class <a href="Hayttp/Payloads/RawPayload.html"><abbr title="Hayttp\Payloads\RawPayload">RawPayload</abbr></a></em></dt>
<dd>Render into a http request body.</dd><dt><a href="Hayttp/Request.html"><abbr title="Hayttp\Request">Request</abbr></a> — <em>Class in namespace <a href="Hayttp.html">Hayttp</a></em></dt>
<dd>HTTP Request class.</dd><dt>$<a href="Hayttp/Request.html#<API key>"><abbr title="Hayttp\Request">Request</abbr></a> — <em>Property in class <a href="Hayttp/Request.html"><abbr title="Hayttp\Request">Request</abbr></a></em></dt>
<dd></dd><dt><a href="Hayttp/Request.html#method_render"><abbr title="Hayttp\Request">Request</abbr>::render</a>() — <em>Method in class <a href="Hayttp/Request.html"><abbr title="Hayttp\Request">Request</abbr></a></em></dt>
<dd>Return the request as a string.</dd><dt><a href="Hayttp/Request.html#<API key>"><abbr title="Hayttp\Request">Request</abbr>::responseCalls</a>() — <em>Method in class <a href="Hayttp/Request.html"><abbr title="Hayttp\Request">Request</abbr></a></em></dt>
<dd>Get the calls that are to be executed on the response
as soon as we have one.</dd><dt><a href="Hayttp/Response.html"><abbr title="Hayttp\Response">Response</abbr></a> — <em>Class in namespace <a href="Hayttp.html">Hayttp</a></em></dt>
<dd></dd><dt>$<a href="Hayttp/Response.html#property_request"><abbr title="Hayttp\Response">Response</abbr></a> — <em>Property in class <a href="Hayttp/Response.html"><abbr title="Hayttp\Response">Response</abbr></a></em></dt>
<dd></dd><dt><a href="Hayttp/Response.html#method_request"><abbr title="Hayttp\Response">Response</abbr>::request</a>() — <em>Method in class <a href="Hayttp/Response.html"><abbr title="Hayttp\Response">Response</abbr></a></em></dt>
<dd>Get the request that produced this response.</dd><dt><a href="Hayttp/Response.html#method_reasonPhrase"><abbr title="Hayttp\Response">Response</abbr>::reasonPhrase</a>() — <em>Method in class <a href="Hayttp/Response.html"><abbr title="Hayttp\Response">Response</abbr></a></em></dt>
<dd>Get the http reason phrase.</dd><dt><a href="Hayttp/Response.html#method_render"><abbr title="Hayttp\Response">Response</abbr>::render</a>() — <em>Method in class <a href="Hayttp/Response.html"><abbr title="Hayttp\Response">Response</abbr></a></em></dt>
<dd>Get the entire response, including headers, as a string.</dd><dt><a href="Hayttp/Response.html#<API key>"><abbr title="Hayttp\Response">Response</abbr>::renderHeaders</a>() — <em>Method in class <a href="Hayttp/Response.html"><abbr title="Hayttp\Response">Response</abbr></a></em></dt>
<dd>Render headers in to a well-formatted string.</dd><dt><a href="Hayttp/Util.html#<API key>"><abbr title="Hayttp\Util">Util</abbr>::recursiveArraySort</a>() — <em>Method in class <a href="Hayttp/Util.html"><abbr title="Hayttp\Util">Util</abbr></a></em></dt>
<dd>Recursive array sort (sort by keys if possible, otherwise sort by values).</dd> </dl><h2 id="letterS">S</h2>
<dl id="index"><dt><a href="Hayttp/Contracts/Engine.html#method_send"><abbr title="Hayttp\Contracts\Engine">Engine</abbr>::send</a>() — <em>Method in class <a href="Hayttp/Contracts/Engine.html"><abbr title="Hayttp\Contracts\Engine">Engine</abbr></a></em></dt>
<dd></dd><dt><a href="Hayttp/Contracts/Request.html#method_send"><abbr title="Hayttp\Contracts\Request">Request</abbr>::send</a>() — <em>Method in class <a href="Hayttp/Contracts/Request.html"><abbr title="Hayttp\Contracts\Request">Request</abbr></a></em></dt>
<dd>Send/execute the request.</dd><dt><a href="Hayttp/Contracts/Request.html#method_secureSsl"><abbr title="Hayttp\Contracts\Request">Request</abbr>::secureSsl</a>() — <em>Method in class <a href="Hayttp/Contracts/Request.html"><abbr title="Hayttp\Contracts\Request">Request</abbr></a></em></dt>
<dd>Are we doing strict SSL checking?</dd><dt><a href="Hayttp/Contracts/Response.html#method_statusCode"><abbr title="Hayttp\Contracts\Response">Response</abbr>::statusCode</a>() — <em>Method in class <a href="Hayttp/Contracts/Response.html"><abbr title="Hayttp\Contracts\Response">Response</abbr></a></em></dt>
<dd>Get the HTTP Response Code.</dd><dt><a href="Hayttp/Engines/CurlEngine.html#method_send"><abbr title="Hayttp\Engines\CurlEngine">CurlEngine</abbr>::send</a>() — <em>Method in class <a href="Hayttp/Engines/CurlEngine.html"><abbr title="Hayttp\Engines\CurlEngine">CurlEngine</abbr></a></em></dt>
<dd>Send/execute the request.</dd><dt><a href="Hayttp/Engines/NativeEngine.html#method_send"><abbr title="Hayttp\Engines\NativeEngine">NativeEngine</abbr>::send</a>() — <em>Method in class <a href="Hayttp/Engines/NativeEngine.html"><abbr title="Hayttp\Engines\NativeEngine">NativeEngine</abbr></a></em></dt>
<dd>Send/execute the request.</dd><dt><a href="Hayttp/Exceptions/Response/StatusCodeException.html"><abbr title="Hayttp\Exceptions\Response\StatusCodeException">StatusCodeException</abbr></a> — <em>Class in namespace <a href="Hayttp/Exceptions/Response.html">Hayttp\Exceptions\Response</a></em></dt>
<dd>Http connection exception.</dd><dt><a href="Hayttp/Hayttp.html#method_setAsGlobal"><abbr title="Hayttp\Hayttp">Hayttp</abbr>::setAsGlobal</a>() — <em>Method in class <a href="Hayttp/Hayttp.html"><abbr title="Hayttp\Hayttp">Hayttp</abbr></a></em></dt>
<dd>Set this instance as the default global instance.</dd><dt>$<a href="Hayttp/Request.html#property_secureSsl"><abbr title="Hayttp\Request">Request</abbr></a> — <em>Property in class <a href="Hayttp/Request.html"><abbr title="Hayttp\Request">Request</abbr></a></em></dt>
<dd></dd><dt><a href="Hayttp/Response.html#method_statusCode"><abbr title="Hayttp\Response">Response</abbr>::statusCode</a>() — <em>Method in class <a href="Hayttp/Response.html"><abbr title="Hayttp\Response">Response</abbr></a></em></dt>
<dd>Get the HTTP Response Code.</dd><dt><a href="Hayttp/Traits/<API key>.html#method_sendsRaw"><abbr title="Hayttp\Traits\<API key>"><API key></abbr>::sendsRaw</a>() — <em>Method in class <a href="Hayttp/Traits/<API key>.html"><abbr title="Hayttp\Traits\<API key>"><API key></abbr></a></em></dt>
<dd>Set the raw payload of the request.</dd><dt><a href="Hayttp/Traits/<API key>.html#method_sendsJson"><abbr title="Hayttp\Traits\<API key>"><API key></abbr>::sendsJson</a>() — <em>Method in class <a href="Hayttp/Traits/<API key>.html"><abbr title="Hayttp\Traits\<API key>"><API key></abbr></a></em></dt>
<dd>Set a JSON payload.</dd><dt><a href="Hayttp/Traits/<API key>.html#method_sendsXml"><abbr title="Hayttp\Traits\<API key>"><API key></abbr>::sendsXml</a>() — <em>Method in class <a href="Hayttp/Traits/<API key>.html"><abbr title="Hayttp\Traits\<API key>"><API key></abbr></a></em></dt>
<dd>Set a XML payload.</dd><dt><a href="Hayttp/Traits/<API key>.html#method_sends"><abbr title="Hayttp\Traits\<API key>"><API key></abbr>::sends</a>() — <em>Method in class <a href="Hayttp/Traits/<API key>.html"><abbr title="Hayttp\Traits\<API key>"><API key></abbr></a></em></dt>
<dd>Set a URL-encoded payload.</dd><dt><a href="Hayttp/Traits/HasCallbacks.html#method_statusCode"><abbr title="Hayttp\Traits\HasCallbacks">HasCallbacks</abbr>::statusCode</a>() — <em>Method in class <a href="Hayttp/Traits/HasCallbacks.html"><abbr title="Hayttp\Traits\HasCallbacks">HasCallbacks</abbr></a></em></dt>
<dd></dd><dt><a href="Hayttp/Traits/HasRequestAccessors.html#method_secureSsl"><abbr title="Hayttp\Traits\HasRequestAccessors">HasRequestAccessors</abbr>::secureSsl</a>() — <em>Method in class <a href="Hayttp/Traits/HasRequestAccessors.html"><abbr title="Hayttp\Traits\HasRequestAccessors">HasRequestAccessors</abbr></a></em></dt>
<dd>Are we doing strict SSL checking?</dd><dt><a href="Hayttp/Traits/HasStatusHelpers.html#method_statusCode"><abbr title="Hayttp\Traits\HasStatusHelpers">HasStatusHelpers</abbr>::statusCode</a>() — <em>Method in class <a href="Hayttp/Traits/HasStatusHelpers.html"><abbr title="Hayttp\Traits\HasStatusHelpers">HasStatusHelpers</abbr></a></em></dt>
<dd></dd><dt><a href="Hayttp/Traits/SendsRequest.html"><abbr title="Hayttp\Traits\SendsRequest">SendsRequest</abbr></a> — <em>Class in namespace <a href="Hayttp/Traits.html">Hayttp\Traits</a></em></dt>
<dd></dd><dt><a href="Hayttp/Traits/SendsRequest.html#method_send"><abbr title="Hayttp\Traits\SendsRequest">SendsRequest</abbr>::send</a>() — <em>Method in class <a href="Hayttp/Traits/SendsRequest.html"><abbr title="Hayttp\Traits\SendsRequest">SendsRequest</abbr></a></em></dt>
<dd>Send/execute the request.</dd><dt><a href="Hayttp/Traits/SendsRequest.html#method_sendRaw"><abbr title="Hayttp\Traits\SendsRequest">SendsRequest</abbr>::sendRaw</a>() — <em>Method in class <a href="Hayttp/Traits/SendsRequest.html"><abbr title="Hayttp\Traits\SendsRequest">SendsRequest</abbr></a></em></dt>
<dd>Set the raw payload of the request and send/execute the request.</dd><dt><a href="Hayttp/Traits/SendsRequest.html#method_sendJson"><abbr title="Hayttp\Traits\SendsRequest">SendsRequest</abbr>::sendJson</a>() — <em>Method in class <a href="Hayttp/Traits/SendsRequest.html"><abbr title="Hayttp\Traits\SendsRequest">SendsRequest</abbr></a></em></dt>
<dd>Set a JSON payload and send/execute the request.</dd><dt><a href="Hayttp/Traits/SendsRequest.html#method_sendXml"><abbr title="Hayttp\Traits\SendsRequest">SendsRequest</abbr>::sendXml</a>() — <em>Method in class <a href="Hayttp/Traits/SendsRequest.html"><abbr title="Hayttp\Traits\SendsRequest">SendsRequest</abbr></a></em></dt>
<dd>Set an XML payload and send/execute the request.</dd><dt><a href="Hayttp/Traits/SendsRequest.html#method_sendFormData"><abbr title="Hayttp\Traits\SendsRequest">SendsRequest</abbr>::sendFormData</a>() — <em>Method in class <a href="Hayttp/Traits/SendsRequest.html"><abbr title="Hayttp\Traits\SendsRequest">SendsRequest</abbr></a></em></dt>
<dd>Set a URL-encoded payload and send/execute the request.</dd> </dl><h2 id="letterT">T</h2>
<dl id="index"><dt><a href="Hayttp/Contracts/Request.html#method_timeout"><abbr title="Hayttp\Contracts\Request">Request</abbr>::timeout</a>() — <em>Method in class <a href="Hayttp/Contracts/Request.html"><abbr title="Hayttp\Contracts\Request">Request</abbr></a></em></dt>
<dd>Timeout in seconds.</dd><dt><a href="Hayttp/Contracts/Response.html#method_transform"><abbr title="Hayttp\Contracts\Response">Response</abbr>::transform</a>() — <em>Method in class <a href="Hayttp/Contracts/Response.html"><abbr title="Hayttp\Contracts\Response">Response</abbr></a></em></dt>
<dd>Transform this response into something else.</dd><dt>$<a href="Hayttp/Request.html#property_timeout"><abbr title="Hayttp\Request">Request</abbr></a> — <em>Property in class <a href="Hayttp/Request.html"><abbr title="Hayttp\Request">Request</abbr></a></em></dt>
<dd></dd><dt><a href="Hayttp/Traits/HasCallbacks.html#method_transform"><abbr title="Hayttp\Traits\HasCallbacks">HasCallbacks</abbr>::transform</a>() — <em>Method in class <a href="Hayttp/Traits/HasCallbacks.html"><abbr title="Hayttp\Traits\HasCallbacks">HasCallbacks</abbr></a></em></dt>
<dd>Transform this response into something else.</dd><dt><a href="Hayttp/Traits/HasRequestAccessors.html#method_timeout"><abbr title="Hayttp\Traits\HasRequestAccessors">HasRequestAccessors</abbr>::timeout</a>() — <em>Method in class <a href="Hayttp/Traits/HasRequestAccessors.html"><abbr title="Hayttp\Traits\HasRequestAccessors">HasRequestAccessors</abbr></a></em></dt>
<dd>Timeout in seconds.</dd><dt><a href="Hayttp/Util.html#method_toJson"><abbr title="Hayttp\Util">Util</abbr>::toJson</a>() — <em>Method in class <a href="Hayttp/Util.html"><abbr title="Hayttp\Util">Util</abbr></a></em></dt>
<dd>Json stringify some data.</dd><dt><a href="Hayttp/Util.html#method_toPrettyJson"><abbr title="Hayttp\Util">Util</abbr>::toPrettyJson</a>() — <em>Method in class <a href="Hayttp/Util.html"><abbr title="Hayttp\Util">Util</abbr></a></em></dt>
<dd>Json stringify some data.</dd> </dl><h2 id="letterU">U</h2>
<dl id="index"><dt><a href="Hayttp/Contracts/Request.html#method_userAgent"><abbr title="Hayttp\Contracts\Request">Request</abbr>::userAgent</a>() — <em>Method in class <a href="Hayttp/Contracts/Request.html"><abbr title="Hayttp\Contracts\Request">Request</abbr></a></em></dt>
<dd>The user agent string.</dd><dt><a href="Hayttp/Contracts/Request.html#method_url"><abbr title="Hayttp\Contracts\Request">Request</abbr>::url</a>() — <em>Method in class <a href="Hayttp/Contracts/Request.html"><abbr title="Hayttp\Contracts\Request">Request</abbr></a></em></dt>
<dd>The target url.</dd><dt><a href="Hayttp/Contracts/Response.html#method_urlDecoded"><abbr title="Hayttp\Contracts\Response">Response</abbr>::urlDecoded</a>() — <em>Method in class <a href="Hayttp/Contracts/Response.html"><abbr title="Hayttp\Contracts\Response">Response</abbr></a></em></dt>
<dd>Parse the response as url-encoded and return the parsed array.</dd><dt>$<a href="Hayttp/Request.html#property_userAgent"><abbr title="Hayttp\Request">Request</abbr></a> — <em>Property in class <a href="Hayttp/Request.html"><abbr title="Hayttp\Request">Request</abbr></a></em></dt>
<dd></dd><dt>$<a href="Hayttp/Request.html#property_url"><abbr title="Hayttp\Request">Request</abbr></a> — <em>Property in class <a href="Hayttp/Request.html"><abbr title="Hayttp\Request">Request</abbr></a></em></dt>
<dd></dd><dt><a href="Hayttp/Response.html#method_urlDecoded"><abbr title="Hayttp\Response">Response</abbr>::urlDecoded</a>() — <em>Method in class <a href="Hayttp/Response.html"><abbr title="Hayttp\Response">Response</abbr></a></em></dt>
<dd>Parse the response as url-encoded and return the parsed array.</dd><dt><a href="Hayttp/Traits/HasRequestAccessors.html#method_userAgent"><abbr title="Hayttp\Traits\HasRequestAccessors">HasRequestAccessors</abbr>::userAgent</a>() — <em>Method in class <a href="Hayttp/Traits/HasRequestAccessors.html"><abbr title="Hayttp\Traits\HasRequestAccessors">HasRequestAccessors</abbr></a></em></dt>
<dd>The user agent string.</dd><dt><a href="Hayttp/Traits/HasRequestAccessors.html#method_url"><abbr title="Hayttp\Traits\HasRequestAccessors">HasRequestAccessors</abbr>::url</a>() — <em>Method in class <a href="Hayttp/Traits/HasRequestAccessors.html"><abbr title="Hayttp\Traits\HasRequestAccessors">HasRequestAccessors</abbr></a></em></dt>
<dd>The target url.</dd><dt><a href="Hayttp/Util.html"><abbr title="Hayttp\Util">Util</abbr></a> — <em>Class in namespace <a href="Hayttp.html">Hayttp</a></em></dt>
<dd>Utility class.</dd> </dl><h2 id="letterW">W</h2>
<dl id="index"><dt><a href="Hayttp/Contracts/Request.html#<API key>"><abbr title="Hayttp\Contracts\Request">Request</abbr>::withCryptoMethod</a>() — <em>Method in class <a href="Hayttp/Contracts/Request.html"><abbr title="Hayttp\Contracts\Request">Request</abbr></a></em></dt>
<dd>Set the allowed crypto method.</dd><dt><a href="Hayttp/Contracts/Request.html#method_withHeaders"><abbr title="Hayttp\Contracts\Request">Request</abbr>::withHeaders</a>() — <em>Method in class <a href="Hayttp/Contracts/Request.html"><abbr title="Hayttp\Contracts\Request">Request</abbr></a></em></dt>
<dd>Set all headers.</dd><dt><a href="Hayttp/Contracts/Request.html#<API key>"><abbr title="Hayttp\Contracts\Request">Request</abbr>::<API key></a>() — <em>Method in class <a href="Hayttp/Contracts/Request.html"><abbr title="Hayttp\Contracts\Request">Request</abbr></a></em></dt>
<dd>Add an array of headers.</dd><dt><a href="Hayttp/Contracts/Request.html#method_withProxy"><abbr title="Hayttp\Contracts\Request">Request</abbr>::withProxy</a>() — <em>Method in class <a href="Hayttp/Contracts/Request.html"><abbr title="Hayttp\Contracts\Request">Request</abbr></a></em></dt>
<dd>Set the proxy server.</dd><dt><a href="Hayttp/Contracts/Request.html#method_withHeader"><abbr title="Hayttp\Contracts\Request">Request</abbr>::withHeader</a>() — <em>Method in class <a href="Hayttp/Contracts/Request.html"><abbr title="Hayttp\Contracts\Request">Request</abbr></a></em></dt>
<dd>Add a header to the request.</dd><dt><a href="Hayttp/Contracts/Request.html#<API key>"><abbr title="Hayttp\Contracts\Request">Request</abbr>::withInsecureSsl</a>() — <em>Method in class <a href="Hayttp/Contracts/Request.html"><abbr title="Hayttp\Contracts\Request">Request</abbr></a></em></dt>
<dd>Disable all SSL certificate checks.</dd><dt><a href="Hayttp/Contracts/Request.html#method_withEngine"><abbr title="Hayttp\Contracts\Request">Request</abbr>::withEngine</a>() — <em>Method in class <a href="Hayttp/Contracts/Request.html"><abbr title="Hayttp\Contracts\Request">Request</abbr></a></em></dt>
<dd>Set the transfer engine.</dd><dt><a href="Hayttp/Contracts/Request.html#<API key>"><abbr title="Hayttp\Contracts\Request">Request</abbr>::withRawPayload</a>() — <em>Method in class <a href="Hayttp/Contracts/Request.html"><abbr title="Hayttp\Contracts\Request">Request</abbr></a></em></dt>
<dd>Set the raw body of the request.</dd><dt><a href="Hayttp/Contracts/Request.html#<API key>"><abbr title="Hayttp\Contracts\Request">Request</abbr>::withJsonPayload</a>() — <em>Method in class <a href="Hayttp/Contracts/Request.html"><abbr title="Hayttp\Contracts\Request">Request</abbr></a></em></dt>
<dd>Set a JSON payload.</dd><dt><a href="Hayttp/Contracts/Request.html#<API key>"><abbr title="Hayttp\Contracts\Request">Request</abbr>::withXmlPayload</a>() — <em>Method in class <a href="Hayttp/Contracts/Request.html"><abbr title="Hayttp\Contracts\Request">Request</abbr></a></em></dt>
<dd>Set a XML payload.</dd><dt><a href="Hayttp/Contracts/Request.html#<API key>"><abbr title="Hayttp\Contracts\Request">Request</abbr>::withFormDataPayload</a>() — <em>Method in class <a href="Hayttp/Contracts/Request.html"><abbr title="Hayttp\Contracts\Request">Request</abbr></a></em></dt>
<dd>Set a URL-encoded payload.</dd><dt><a href="Hayttp/Contracts/Request.html#<API key>"><abbr title="Hayttp\Contracts\Request">Request</abbr>::withResponseCall</a>() — <em>Method in class <a href="Hayttp/Contracts/Request.html"><abbr title="Hayttp\Contracts\Request">Request</abbr></a></em></dt>
<dd>Execute the $response->$methodName(.</dd><dt><a href="Hayttp/Hayttp.html#method_with"><abbr title="Hayttp\Hayttp">Hayttp</abbr>::with</a>() — <em>Method in class <a href="Hayttp/Hayttp.html"><abbr title="Hayttp\Hayttp">Hayttp</abbr></a></em></dt>
<dd>Clone object with a new property value.</dd><dt><a href="Hayttp/Hayttp.html#<API key>"><abbr title="Hayttp\Hayttp">Hayttp</abbr>::withDeferredCall</a>() — <em>Method in class <a href="Hayttp/Hayttp.html"><abbr title="Hayttp\Hayttp">Hayttp</abbr></a></em></dt>
<dd>Having created a request, apply these calls to the.</dd><dt><a href="Hayttp/Hayttp.html#<API key>"><abbr title="Hayttp\Hayttp">Hayttp</abbr>::withMockedEndpoint</a>() — <em>Method in class <a href="Hayttp/Hayttp.html"><abbr title="Hayttp\Hayttp">Hayttp</abbr></a></em></dt>
<dd>Add a mocked end point to all requests created.</dd><dt><a href="Hayttp/Hayttp.html#<API key>"><abbr title="Hayttp\Hayttp">Hayttp</abbr>::withMountPoint</a>() — <em>Method in class <a href="Hayttp/Hayttp.html"><abbr title="Hayttp\Hayttp">Hayttp</abbr></a></em></dt>
<dd>All requests will have this mount point prepended to their url.</dd><dt><a href="Hayttp/Hayttp.html#method_withTimeout"><abbr title="Hayttp\Hayttp">Hayttp</abbr>::withTimeout</a>() — <em>Method in class <a href="Hayttp/Hayttp.html"><abbr title="Hayttp\Hayttp">Hayttp</abbr></a></em></dt>
<dd>All requests will have this timeout.</dd><dt><a href="Hayttp/Hayttp.html#<API key>"><abbr title="Hayttp\Hayttp">Hayttp</abbr>::withUserAgent</a>() — <em>Method in class <a href="Hayttp/Hayttp.html"><abbr title="Hayttp\Hayttp">Hayttp</abbr></a></em></dt>
<dd>Set the user agent header.</dd><dt><a href="Hayttp/Hayttp.html#<API key>"><abbr title="Hayttp\Hayttp">Hayttp</abbr>::withCryptoMethod</a>() — <em>Method in class <a href="Hayttp/Hayttp.html"><abbr title="Hayttp\Hayttp">Hayttp</abbr></a></em></dt>
<dd>Set the allowed crypto method.</dd><dt><a href="Hayttp/Hayttp.html#<API key>"><abbr title="Hayttp\Hayttp">Hayttp</abbr>::withInsecureSsl</a>() — <em>Method in class <a href="Hayttp/Hayttp.html"><abbr title="Hayttp\Hayttp">Hayttp</abbr></a></em></dt>
<dd>Disable all SSL certificate checks.</dd><dt><a href="Hayttp/Hayttp.html#method_withEngine"><abbr title="Hayttp\Hayttp">Hayttp</abbr>::withEngine</a>() — <em>Method in class <a href="Hayttp/Hayttp.html"><abbr title="Hayttp\Hayttp">Hayttp</abbr></a></em></dt>
<dd>Set the transfer engine.</dd><dt><a href="Hayttp/Hayttp.html#method_withHeaders"><abbr title="Hayttp\Hayttp">Hayttp</abbr>::withHeaders</a>() — <em>Method in class <a href="Hayttp/Hayttp.html"><abbr title="Hayttp\Hayttp">Hayttp</abbr></a></em></dt>
<dd>Set all headers.</dd><dt><a href="Hayttp/Hayttp.html#<API key>"><abbr title="Hayttp\Hayttp">Hayttp</abbr>::<API key></a>() — <em>Method in class <a href="Hayttp/Hayttp.html"><abbr title="Hayttp\Hayttp">Hayttp</abbr></a></em></dt>
<dd>Add an array of headers.</dd><dt><a href="Hayttp/Hayttp.html#method_withProxy"><abbr title="Hayttp\Hayttp">Hayttp</abbr>::withProxy</a>() — <em>Method in class <a href="Hayttp/Hayttp.html"><abbr title="Hayttp\Hayttp">Hayttp</abbr></a></em></dt>
<dd>Set the proxy server.</dd><dt><a href="Hayttp/Hayttp.html#method_withHeader"><abbr title="Hayttp\Hayttp">Hayttp</abbr>::withHeader</a>() — <em>Method in class <a href="Hayttp/Hayttp.html"><abbr title="Hayttp\Hayttp">Hayttp</abbr></a></em></dt>
<dd>Add a header to the request.</dd><dt><a href="Hayttp/Hayttp.html#method_withTls"><abbr title="Hayttp\Hayttp">Hayttp</abbr>::withTls</a>() — <em>Method in class <a href="Hayttp/Hayttp.html"><abbr title="Hayttp\Hayttp">Hayttp</abbr></a></em></dt>
<dd>Set the TLS version.</dd><dt><a href="Hayttp/Hayttp.html#<API key>"><abbr title="Hayttp\Hayttp">Hayttp</abbr>::withBasicAuth</a>() — <em>Method in class <a href="Hayttp/Hayttp.html"><abbr title="Hayttp\Hayttp">Hayttp</abbr></a></em></dt>
<dd>Add a basic authorization (which is actually an authenticaation) header.</dd><dt><a href="Hayttp/Mock/MockResponse.html#method_with"><abbr title="Hayttp\Mock\MockResponse">MockResponse</abbr>::with</a>() — <em>Method in class <a href="Hayttp/Mock/MockResponse.html"><abbr title="Hayttp\Mock\MockResponse">MockResponse</abbr></a></em></dt>
<dd>Clone object with a new property value.</dd><dt><a href="Hayttp/Mock/MockResponse.html#method_withStatus"><abbr title="Hayttp\Mock\MockResponse">MockResponse</abbr>::withStatus</a>() — <em>Method in class <a href="Hayttp/Mock/MockResponse.html"><abbr title="Hayttp\Mock\MockResponse">MockResponse</abbr></a></em></dt>
<dd>Set the status code and reason phrase of the http response.</dd><dt><a href="Hayttp/Mock/MockResponse.html#method_withHeaders"><abbr title="Hayttp\Mock\MockResponse">MockResponse</abbr>::withHeaders</a>() — <em>Method in class <a href="Hayttp/Mock/MockResponse.html"><abbr title="Hayttp\Mock\MockResponse">MockResponse</abbr></a></em></dt>
<dd>Set headers on the mock response.</dd><dt><a href="Hayttp/Mock/MockResponse.html#<API key>"><abbr title="Hayttp\Mock\MockResponse">MockResponse</abbr>::<API key></a>() — <em>Method in class <a href="Hayttp/Mock/MockResponse.html"><abbr title="Hayttp\Mock\MockResponse">MockResponse</abbr></a></em></dt>
<dd>Add headers to the mock response.</dd><dt><a href="Hayttp/Mock/MockResponse.html#<API key>"><abbr title="Hayttp\Mock\MockResponse">MockResponse</abbr>::withContentType</a>() — <em>Method in class <a href="Hayttp/Mock/MockResponse.html"><abbr title="Hayttp\Mock\MockResponse">MockResponse</abbr></a></em></dt>
<dd>Set the content type.</dd><dt><a href="Hayttp/Mock/MockResponse.html#method_withHeader"><abbr title="Hayttp\Mock\MockResponse">MockResponse</abbr>::withHeader</a>() — <em>Method in class <a href="Hayttp/Mock/MockResponse.html"><abbr title="Hayttp\Mock\MockResponse">MockResponse</abbr></a></em></dt>
<dd>Add a header to the response.</dd><dt><a href="Hayttp/Mock/MockResponse.html#method_withBody"><abbr title="Hayttp\Mock\MockResponse">MockResponse</abbr>::withBody</a>() — <em>Method in class <a href="Hayttp/Mock/MockResponse.html"><abbr title="Hayttp\Mock\MockResponse">MockResponse</abbr></a></em></dt>
<dd>Set the body of the response.</dd><dt><a href="Hayttp/Mock/MockResponse.html#method_withJsonBody"><abbr title="Hayttp\Mock\MockResponse">MockResponse</abbr>::withJsonBody</a>() — <em>Method in class <a href="Hayttp/Mock/MockResponse.html"><abbr title="Hayttp\Mock\MockResponse">MockResponse</abbr></a></em></dt>
<dd>Set the a json body.</dd><dt><a href="Hayttp/Mock/MockResponse.html#method_withXmlBody"><abbr title="Hayttp\Mock\MockResponse">MockResponse</abbr>::withXmlBody</a>() — <em>Method in class <a href="Hayttp/Mock/MockResponse.html"><abbr title="Hayttp\Mock\MockResponse">MockResponse</abbr></a></em></dt>
<dd>Set the a json body.</dd><dt><a href="Hayttp/Mock/MockResponse.html#method_withRoute"><abbr title="Hayttp\Mock\MockResponse">MockResponse</abbr>::withRoute</a>() — <em>Method in class <a href="Hayttp/Mock/MockResponse.html"><abbr title="Hayttp\Mock\MockResponse">MockResponse</abbr></a></em></dt>
<dd>Add information about the route to the response</dd><dt><a href="Hayttp/Payloads/MultipartPayload.html#method_withField"><abbr title="Hayttp\Payloads\MultipartPayload">MultipartPayload</abbr>::withField</a>() — <em>Method in class <a href="Hayttp/Payloads/MultipartPayload.html"><abbr title="Hayttp\Payloads\MultipartPayload">MultipartPayload</abbr></a></em></dt>
<dd>Add a multipart entry.</dd><dt><a href="Hayttp/Request.html#method_with"><abbr title="Hayttp\Request">Request</abbr>::with</a>() — <em>Method in class <a href="Hayttp/Request.html"><abbr title="Hayttp\Request">Request</abbr></a></em></dt>
<dd>Clone object with a new property value.</dd><dt><a href="Hayttp/Request.html#<API key>"><abbr title="Hayttp\Request">Request</abbr>::withMockedEndpoint</a>() — <em>Method in class <a href="Hayttp/Request.html"><abbr title="Hayttp\Request">Request</abbr></a></em></dt>
<dd>Mock an end point.</dd><dt><a href="Hayttp/Traits/HasWithMethods.html#method_with"><abbr title="Hayttp\Traits\HasWithMethods">HasWithMethods</abbr>::with</a>() — <em>Method in class <a href="Hayttp/Traits/HasWithMethods.html"><abbr title="Hayttp\Traits\HasWithMethods">HasWithMethods</abbr></a></em></dt>
<dd>Clone object with a new property value.</dd><dt><a href="Hayttp/Traits/HasWithMethods.html#method_withTimeout"><abbr title="Hayttp\Traits\HasWithMethods">HasWithMethods</abbr>::withTimeout</a>() — <em>Method in class <a href="Hayttp/Traits/HasWithMethods.html"><abbr title="Hayttp\Traits\HasWithMethods">HasWithMethods</abbr></a></em></dt>
<dd>Set the timeout.</dd><dt><a href="Hayttp/Traits/HasWithMethods.html#<API key>"><abbr title="Hayttp\Traits\HasWithMethods">HasWithMethods</abbr>::withUserAgent</a>() — <em>Method in class <a href="Hayttp/Traits/HasWithMethods.html"><abbr title="Hayttp\Traits\HasWithMethods">HasWithMethods</abbr></a></em></dt>
<dd>Set the user agent header.</dd><dt><a href="Hayttp/Traits/HasWithMethods.html#<API key>"><abbr title="Hayttp\Traits\HasWithMethods">HasWithMethods</abbr>::withCryptoMethod</a>() — <em>Method in class <a href="Hayttp/Traits/HasWithMethods.html"><abbr title="Hayttp\Traits\HasWithMethods">HasWithMethods</abbr></a></em></dt>
<dd>Set the allowed crypto method.</dd><dt><a href="Hayttp/Traits/HasWithMethods.html#<API key>"><abbr title="Hayttp\Traits\HasWithMethods">HasWithMethods</abbr>::withInsecureSsl</a>() — <em>Method in class <a href="Hayttp/Traits/HasWithMethods.html"><abbr title="Hayttp\Traits\HasWithMethods">HasWithMethods</abbr></a></em></dt>
<dd>Disable all SSL certificate checks.</dd><dt><a href="Hayttp/Traits/HasWithMethods.html#method_withEngine"><abbr title="Hayttp\Traits\HasWithMethods">HasWithMethods</abbr>::withEngine</a>() — <em>Method in class <a href="Hayttp/Traits/HasWithMethods.html"><abbr title="Hayttp\Traits\HasWithMethods">HasWithMethods</abbr></a></em></dt>
<dd>Set the transfer engine.</dd><dt><a href="Hayttp/Traits/HasWithMethods.html#method_withHeaders"><abbr title="Hayttp\Traits\HasWithMethods">HasWithMethods</abbr>::withHeaders</a>() — <em>Method in class <a href="Hayttp/Traits/HasWithMethods.html"><abbr title="Hayttp\Traits\HasWithMethods">HasWithMethods</abbr></a></em></dt>
<dd>Set all headers.</dd><dt><a href="Hayttp/Traits/HasWithMethods.html#<API key>"><abbr title="Hayttp\Traits\HasWithMethods">HasWithMethods</abbr>::<API key></a>() — <em>Method in class <a href="Hayttp/Traits/HasWithMethods.html"><abbr title="Hayttp\Traits\HasWithMethods">HasWithMethods</abbr></a></em></dt>
<dd>Add an array of headers.</dd><dt><a href="Hayttp/Traits/HasWithMethods.html#method_withProxy"><abbr title="Hayttp\Traits\HasWithMethods">HasWithMethods</abbr>::withProxy</a>() — <em>Method in class <a href="Hayttp/Traits/HasWithMethods.html"><abbr title="Hayttp\Traits\HasWithMethods">HasWithMethods</abbr></a></em></dt>
<dd>Set the proxy server.</dd><dt><a href="Hayttp/Traits/HasWithMethods.html#method_withHeader"><abbr title="Hayttp\Traits\HasWithMethods">HasWithMethods</abbr>::withHeader</a>() — <em>Method in class <a href="Hayttp/Traits/HasWithMethods.html"><abbr title="Hayttp\Traits\HasWithMethods">HasWithMethods</abbr></a></em></dt>
<dd>Add a header to the request.</dd><dt><a href="Hayttp/Traits/HasWithMethods.html#method_withTls"><abbr title="Hayttp\Traits\HasWithMethods">HasWithMethods</abbr>::withTls</a>() — <em>Method in class <a href="Hayttp/Traits/HasWithMethods.html"><abbr title="Hayttp\Traits\HasWithMethods">HasWithMethods</abbr></a></em></dt>
<dd>Set the TLS version.</dd><dt><a href="Hayttp/Traits/HasWithMethods.html#<API key>"><abbr title="Hayttp\Traits\HasWithMethods">HasWithMethods</abbr>::withBasicAuth</a>() — <em>Method in class <a href="Hayttp/Traits/HasWithMethods.html"><abbr title="Hayttp\Traits\HasWithMethods">HasWithMethods</abbr></a></em></dt>
<dd>Add a basic authorization (which is actually an authenticaation) header.</dd><dt><a href="Hayttp/Traits/HasWithMethods.html#method_withPayload"><abbr title="Hayttp\Traits\HasWithMethods">HasWithMethods</abbr>::withPayload</a>() — <em>Method in class <a href="Hayttp/Traits/HasWithMethods.html"><abbr title="Hayttp\Traits\HasWithMethods">HasWithMethods</abbr></a></em></dt>
<dd>Set the payload of the request.</dd><dt><a href="Hayttp/Traits/HasWithMethods.html#<API key>"><abbr title="Hayttp\Traits\HasWithMethods">HasWithMethods</abbr>::withResponseCall</a>() — <em>Method in class <a href="Hayttp/Traits/HasWithMethods.html"><abbr title="Hayttp\Traits\HasWithMethods">HasWithMethods</abbr></a></em></dt>
<dd>Execute the $response->$methodName(.</dd><dt><a href="Hayttp/Traits/HasWithMethods.html#<API key>"><abbr title="Hayttp\Traits\HasWithMethods">HasWithMethods</abbr>::withRawPayload</a>() — <em>Method in class <a href="Hayttp/Traits/HasWithMethods.html"><abbr title="Hayttp\Traits\HasWithMethods">HasWithMethods</abbr></a></em></dt>
<dd>Set the raw payload of the request.</dd><dt><a href="Hayttp/Traits/HasWithMethods.html#<API key>"><abbr title="Hayttp\Traits\HasWithMethods">HasWithMethods</abbr>::withJsonPayload</a>() — <em>Method in class <a href="Hayttp/Traits/HasWithMethods.html"><abbr title="Hayttp\Traits\HasWithMethods">HasWithMethods</abbr></a></em></dt>
<dd>Set a JSON payload.</dd><dt><a href="Hayttp/Traits/HasWithMethods.html#<API key>"><abbr title="Hayttp\Traits\HasWithMethods">HasWithMethods</abbr>::withXmlPayload</a>() — <em>Method in class <a href="Hayttp/Traits/HasWithMethods.html"><abbr title="Hayttp\Traits\HasWithMethods">HasWithMethods</abbr></a></em></dt>
<dd>Set an XML payload.</dd><dt><a href="Hayttp/Traits/HasWithMethods.html#<API key>"><abbr title="Hayttp\Traits\HasWithMethods">HasWithMethods</abbr>::withFormDataPayload</a>() — <em>Method in class <a href="Hayttp/Traits/HasWithMethods.html"><abbr title="Hayttp\Traits\HasWithMethods">HasWithMethods</abbr></a></em></dt>
<dd>Set a URL-encoded payload.</dd> </dl><h2 id="letterX">X</h2>
<dl id="index"><dt><a href="Hayttp/Contracts/Response.html#method_xmlDecoded"><abbr title="Hayttp\Contracts\Response">Response</abbr>::xmlDecoded</a>() — <em>Method in class <a href="Hayttp/Contracts/Response.html"><abbr title="Hayttp\Contracts\Response">Response</abbr></a></em></dt>
<dd>Parse the body as xml and return it as a SimpleXmlElement.</dd><dt><a href="Hayttp/Response.html#method_xmlDecoded"><abbr title="Hayttp\Response">Response</abbr>::xmlDecoded</a>() — <em>Method in class <a href="Hayttp/Response.html"><abbr title="Hayttp\Response">Response</abbr></a></em></dt>
<dd>Parse the body as xml and return it as a SimpleXmlElement.</dd> </dl><h2 id="letter_">_</h2>
<dl id="index"><dt><a href="Hayttp/Contracts/Payload.html
<dd>Render the body of the payload.</dd><dt><a href="Hayttp/Contracts/Request.html
<dd>Return the request as a string.</dd><dt><a href="Hayttp/Contracts/Response.html
<dd>Cast to string.</dd><dt><a href="Hayttp/Exceptions/<API key>.html
<dd>Constructor.</dd><dt><a href="Hayttp/Exceptions/ResponseException.html
<dd>Constructor.</dd><dt><a href="Hayttp/Exceptions/RouteException.html
<dd>Constructor.</dd><dt><a href="Hayttp/Hayttp.html
<dd>Constructor.</dd><dt><a href="Hayttp/Hayttp.html
<dd>Easy request construction.</dd><dt><a href="Hayttp/Hayttp.html
<dd>Forward calls to default instance.</dd><dt><a href="Hayttp/Mock/Endpoint.html
<dd>Constructor.</dd><dt><a href="Hayttp/Mock/Route.html
<dd>Constructor.</dd><dt><a href="Hayttp/Payloads/JsonPayload.html
<dd>Constructor.</dd><dt><a href="Hayttp/Payloads/JsonPayload.html
<dd>Render the body of the payload.</dd><dt><a href="Hayttp/Payloads/MultipartPayload.html
<dd>Constructor.</dd><dt><a href="Hayttp/Payloads/MultipartPayload.html
<dd>Render the body of the payload.</dd><dt><a href="Hayttp/Payloads/RawPayload.html
<dd>Constructor.</dd><dt><a href="Hayttp/Payloads/RawPayload.html
<dd>Render the body of the payload.</dd><dt><a href="Hayttp/Request.html
<dd>Constructor.</dd><dt><a href="Hayttp/Request.html
<dd>Return the request as a string.</dd><dt><a href="Hayttp/Request.html
<dd>Setter.</dd><dt><a href="Hayttp/Request.html
<dd>Magic Method for dynamic method names.</dd><dt><a href="Hayttp/Response.html
<dd>Constructor.</dd><dt><a href="Hayttp/Response.html
<dd>Cast to string.</dd><dt><a href="Hayttp/Traits/Extendable.html
<dd>Magic Method for dynamic method names.</dd><dt><a href="Hayttp/Traits/Extendable.html
<dd>Magic Method for dynamic names of static methods.</dd><dt><a href="Hayttp/Traits/<API key>.html
<dd>Return debug info for var_dump, et al.</dd> </dl> </div>
<div id="footer">
Generated by <a href="http://sami.sensiolabs.org/">Sami, the API Documentation Generator</a>.
</div>
</div>
</div>
</body>
</html> |
// flow-typed signature: <API key>
declare module 'utm' {
declare module.exports: any;
}
/**
* We include stubs for each file inside this npm package in case you need to
* require those files directly. Feel free to delete any files that aren't
* needed.
*/
declare module 'utm/index.es' {
declare module.exports: any;
}
declare module 'utm/test' {
declare module.exports: any;
}
// Filename aliases
declare module 'utm/index.es.js' {
declare module.exports: $Exports<'utm/index.es'>;
}
declare module 'utm/index' {
declare module.exports: $Exports<'utm'>;
}
declare module 'utm/index.js' {
declare module.exports: $Exports<'utm'>;
}
declare module 'utm/test.js' {
declare module.exports: $Exports<'utm/test'>;
} |
<?php
namespace Riverline\WorkerBundle\Provider;
class PRedis implements ProviderInterface
{
protected $predis;
public function __construct($predisConfiguration)
{
if (!class_exists('Predis\Client')) {
throw new \LogicException("Can't find PRedis lib");
}
$this->predis = new \Predis\Client($predisConfiguration);
}
public function put($queueName, $workload)
{
$this->predis->lpush($queueName, serialize($workload));
}
public function get($queueName, $timeout = null)
{
$result = $this->predis->brpop($queueName, $timeout);
if (empty($result)) {
return null;
} else {
return unserialize($result[1]);
}
}
public function count($queueName)
{
return $this->predis->llen($queueName);
}
} |
// of this software and associated documentation files (the "Software"),
// to deal in the Software without restriction, including without limitation
// and/or sell copies of the Software, and to permit persons to whom
// the Software is furnished to do so, subject to the following conditions:
// all copies or substantial portions of the Software.
// EXPRESS OR IMPLIED, 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 SOFTWARE
// OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#ifndef <API key>
#define <API key>
#include "<API key>.hpp"
namespace Nene
{
/**
* @brief Exception for signaling WAVE image format errors.
*/
class <API key>
: public <API key>
{
public:
/**
* @brief Constructor.
*/
using <API key>::<API key>;
/**
* @brief Destructor.
*/
virtual ~<API key>() =default;
};
}
#endif // #ifndef <API key> |
<layout>
<div class="container" ng-controller="BlockDetailPageCtrl as detail">
<div class="row">
<div class="col-md-8 col-md-offset-2">
<h1>Block {{detail.block.hash | removeLeadingZeros}}</h1>
<button type="button" class="btn btn-default" ng-click="detail.verifyBlock()">Verify</button><span>Verification status: {{ detail.verificationStatus }}</span>
<h2>Header</h2>
<table class="table">
<tr><td>Hash</td><td>{{detail.block.hash}}</td></tr>
<tr><td>Previous Block</td><td>{{detail.block.prev_block}}</td></tr>
<tr><td>Time</td><td>{{detail.block.time}}</td></tr>
<tr><td>Difficulty</td><td>{{detail.block.bits}}</td></tr>
<tr><td>Transactions</td><td>{{detail.block.tx.length}}</td></tr>
<tr><td>Total BTC</td><td>xxx</td></tr>
<tr><td>Size</td><td>{{detail.block.size}}</td></tr>
<tr><td>Merkle Root</td><td>{{detail.block.mrkl_root}}</td></tr>
<tr><td>Nonce</td><td>{{detail.block.nonce}}</td></tr>
</table>
<h2>Transactions</h2>
<transaction-browser transactions="detail.block.tx" visualisation-hash="detail.rootHash"></transaction-browser>
<svg visualisation root-hash="detail.rootHash"></svg>
</div>
</div>
</div>
</div>
</layout> |
'use strict';
var JSONRPCFactory = require('../../lib');
var Names = {
v1: 'JSONRPC_V1',
v2: 'JSONRPC_V2'
};
describe('JSONRPCFactory (lib/jsonrpc-factory.js)', function () {
it('v1 method should gives ' + Names.v1 + ' object', function () {
expect(JSONRPCFactory.v1().constructor.name).toBe(Names.v1);
});
it(Names.v1 + ' should be singleton', function () {
expect(JSONRPCFactory.v1()).toBe(JSONRPCFactory.v1());
});
it('v2 method should gives ' + Names.v2 + ' object', function () {
expect(JSONRPCFactory.v2().constructor.name).toBe(Names.v2);
});
it(Names.v2 + ' should be singleton', function () {
expect(JSONRPCFactory.v2()).toBe(JSONRPCFactory.v2());
});
}); |
<?php
namespace Phormium\Exception;
/**
* Thrown when a Model class is not valid, e.g. has invalid $_meta.
*/
class <API key> extends OrmException
{
} |
# koa-context [![NPM version][npm-image]][npm-url] [![build status][travis-image]][travis-url] [![Test coverage][coveralls-image]][coveralls-url]
> Extend koa context
## Installation
npm install --save koa-context
## Usage
With file `context/csrf.js`
module.exports = {
csrf: function() {
// blanblanblan
},
assertCSRF: function() {
// blanblanblan
},
};
We can't extend context by
var app = require('koa')();
var context = require('koa-context');
context(app, __dirname + '/context');
app.use(function* () {
this.csrf();
});
MIT
[npm-image]: https://img.shields.io/npm/v/koa-context.svg?style=flat
[npm-url]: https://npmjs.org/package/koa-context
[travis-image]: https://img.shields.io/travis/CatTail/koa-context.svg?style=flat
[travis-url]: https://travis-ci.org/CatTail/koa-context
[coveralls-image]: https://img.shields.io/coveralls/CatTail/koa-context.svg?style=flat
[coveralls-url]: https://coveralls.io/r/CatTail/koa-context?branch=master |
require "format_fallback/version"
module ActionView
class PathSet < Array
def <API key>(path, prefix = nil, partial = false, details = {}, key = nil)
if prefix == "layouts"
# Layouts have their own way of managing fallback, better leave them alone
<API key>(path, prefix, partial, details, key)
else
begin
<API key>(path, prefix, partial, details, key)
rescue MissingTemplate => e
raise e if details[:formats] == [:html]
html_details = details.dup.merge(:formats => [:html])
<API key>(path, prefix, partial, html_details, key)
end
end
end
alias_method_chain :find, :default_template
end
class Resolver
def cached(key, prefix, name, partial)
return yield unless key && caching?
cache_content = yield
if cache_content.empty?
[]
else
@cached[key][prefix][name][partial] ||= cache_content
end
end
end
end |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("<API key>", "eHA.settings")
from django.core.management import <API key>
<API key>(sys.argv) |
<p><img src="/img/daria.jpg" class="img-responsive" alt="Daria Multipurpose Three-Column Bootstrap Theme" /></p> |
from pale.fields.string import StringField
class TimestampField(StringField):
"""A field for timestamp strings."""
value_type = 'timestamp'
# TODO - timestamp field rendering |
// AppDelegate.h
// 01-ImageDisplay
#import <UIKit/UIKit.h>
@interface AppDelegate : UIResponder <<API key>>
@property (strong, nonatomic) UIWindow *window;
@end |
package openisetl.runtime._val
object UndefinedVal {
val undefined = new UndefinedVal
}
class UndefinedVal private extends BaseVal {
override def typeName = "Undefined"
override def toString = typeName
} |
import AcTypes from '../configs/types';
import { Record,Map } from 'immutable';
const {
QUERY_BY_ID
} = AcTypes;
const InitialState = Record({
article:Map({})
});
const initialState = new InitialState();
export default function BLogDetailReducer(state = initialState, action = {}) {
switch (action.type) {
case QUERY_BY_ID:
return state.setIn(['article'],Map(action.payload))
}
return state
} |
package auth
import (
"encoding/json"
"net/http"
"time"
"github.com/l10n-center/api/src/config"
"github.com/l10n-center/api/src/errs"
"github.com/l10n-center/api/src/middleware"
"github.com/l10n-center/api/src/model"
"github.com/l10n-center/api/src/tracing"
"github.com/asaskevich/govalidator"
"github.com/pkg/errors"
"github.com/pressly/chi"
"go.uber.org/zap"
"golang.org/x/crypto/bcrypt"
)
// Router return auth section router
func Router(cfg *config.Config, store Store) func(chi.Router) {
return func(r chi.Router) {
r.Use(WithClaims(cfg, false, false))
r.Use(middleware.JSONOnly)
r.Get("/", Root(cfg, store))
r.Post("/init", Init(cfg, store))
r.Post("/login", Login(cfg, store))
// r.Post("/forgot")
// r.Post("/reset")
}
}
// Root check login availability and update jwt if present valid
func Root(cfg *config.Config, store Store) http.HandlerFunc {
// Check login availability and update jwt if present valid
fn := func(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
l := tracing.Logger(ctx)
userCount, err := store.GetUserCount(ctx)
if err != nil {
l.Error(err.Error(), errs.ZapStack(err))
http.Error(w, errs.InternalServerError, http.<API key>)
return
}
if userCount == 0 {
l.Warn("users not found")
http.Error(w, "users not found", http.StatusNotFound)
return
}
c, ok := ClaimsFromContext(ctx)
if !ok {
l.Debug("no claims found")
http.Error(w, "login required", http.StatusUnauthorized)
return
}
u, err := store.GetUserByID(ctx, c.UserID)
if err != nil {
if errors.Cause(err) == errs.ModelNotFound {
l.Debug("login required", zap.Error(err))
http.Error(w, "login required", http.StatusUnauthorized)
return
}
l.Error(err.Error(), errs.ZapStack(err))
http.Error(w, errs.InternalServerError, http.<API key>)
return
}
st, err := CreateToken(ctx, cfg.Secret, u)
if err != nil {
l.Error(err.Error(), errs.ZapStack(err))
http.Error(w, errs.InternalServerError, http.<API key>)
return
}
http.Error(w, st, http.StatusOK)
}
return http.HandlerFunc(fn)
}
// Login with email/password credentials
func Login(cfg *config.Config, store Store) http.HandlerFunc {
// Login with email/password credentials
fn := func(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
l := tracing.Logger(ctx)
jd := json.NewDecoder(r.Body)
rd := &struct {
Email string `json:"email" valid:"email,required"`
Password string `json:"password" valid:"required"`
}{}
if err := errors.WithMessage(jd.Decode(&rd), "unmarshal"); err != nil {
l.Debug(err.Error())
http.Error(w, err.Error(), http.StatusBadRequest)
return
}
if ok, err := govalidator.ValidateStruct(rd); !ok {
l.Debug(err.Error())
http.Error(w, errors.WithMessage(err, "validate").Error(), http.StatusBadRequest)
return
}
u, err := store.GetUserByEmail(ctx, rd.Email)
if errors.Cause(err) == errs.ModelNotFound {
l.Debug(err.Error(), zap.Error(err))
http.Error(w, "invalid email or password", http.StatusUnauthorized)
return
} else if err != nil {
l.Error(err.Error(), errs.ZapStack(err))
http.Error(w, errs.InternalServerError, http.<API key>)
return
}
if err = bcrypt.<API key>(u.Passhash, []byte(rd.Password)); err != nil {
l.Debug("invalid password", zap.Error(err))
http.Error(w, "invalid email or password", http.StatusUnauthorized)
return
}
st, err := CreateToken(ctx, cfg.Secret, u)
if err != nil {
l.Error(err.Error(), errs.ZapStack(err))
http.Error(w, errs.InternalServerError, http.<API key>)
return
}
l.Sugar().Infof("user <%s> is logined", rd.Email)
http.Error(w, st, http.StatusOK)
}
return http.HandlerFunc(fn)
}
// Init create admin user
func Init(_ *config.Config, store Store) http.HandlerFunc {
// Create admin user
fn := func(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
l := tracing.Logger(ctx)
jd := json.NewDecoder(r.Body)
rd := &struct {
Email string `json:"email" valid:"email,required"`
Password string `json:"password" valid:"required"`
}{}
if err := errors.Wrap(jd.Decode(&rd), "unmarshal"); err != nil {
l.Debug(err.Error())
http.Error(w, err.Error(), http.StatusBadRequest)
return
}
if ok, err := govalidator.ValidateStruct(rd); !ok {
l.Debug(err.Error())
http.Error(w, errors.Wrap(err, "validate").Error(), http.StatusBadRequest)
return
}
passhash, err := bcrypt.<API key>([]byte(rd.Password), bcrypt.DefaultCost)
if err != nil {
l.Error(err.Error())
http.Error(w, errs.InternalServerError, http.<API key>)
return
}
userCount, err := store.GetUserCount(ctx)
if err != nil {
l.Error(err.Error(), errs.ZapStack(err))
http.Error(w, errs.InternalServerError, http.<API key>)
return
}
if userCount > 0 {
l.Warn("users already exists")
http.Error(w, "users already exists", http.StatusForbidden)
return
}
err = store.CreateUser(ctx, &model.User{
Email: rd.Email,
Passhash: passhash,
IsAdmin: true,
Permission: model.CanEverything,
CreatedAt: time.Now(),
UpdatedAt: time.Now(),
})
if err != nil {
l.Error(err.Error(), errs.ZapStack(err))
http.Error(w, errs.InternalServerError, http.<API key>)
return
}
l.Sugar().Infof("admin created with email <%s>", rd.Email)
http.Error(w, "admin created", http.StatusCreated)
}
return http.HandlerFunc(fn)
} |
[
* [CCQ](https://github.com/ccqpein)
* [Yixuan](https://github.com/YixuanBurnett)
:
-
- ?
-
- ,:
+ ? ? ? ?
+ ? ? !?
+ / /? /? ?
+ ?????
+ ....
- , `0->1` ,,...
~ ,,,...
> [Q&A:issues](https://github.com/OpenMindClub/OMOOC.py/issues)
[](https://github.com/OpenMindClub/OMOOC.py/wiki)
test sync |
using System;
using System.Linq;
using System.Xml;
using JetBrains.Annotations;
namespace Corelicious.Extensions {
public static class XmlNodeExtensions {
[NotNull]
public static XmlElement[] SelectElements([NotNull] this XmlNode node, [NotNull] String xpath) {
if (node == null) throw new <API key>("node");
if (xpath == null) throw new <API key>("xpath");
var nodes = node.SelectNodes(xpath);
if (nodes == null)
return new XmlElement[0];
return nodes.OfType<XmlElement>().ToArray();
}
[CanBeNull]
public static XmlElement SelectSingleElement([NotNull] this XmlNode node, [NotNull] String xpath) {
if (node == null) throw new <API key>("node");
if (xpath == null) throw new <API key>("xpath");
return SelectElements(node, xpath).FirstOrDefault();
}
}
} |
<?php
// This file exist in purpose to uniting all style tag we load in every page (header)
?>
<link href="<?= asset_url(); ?>css/bootstrap.min.css" rel="stylesheet">
<link href="<?= asset_url(); ?>css/<API key>.min.css" rel="stylesheet">
<!-- disabling responsiveness -->
<style>
.container{
width: 970px !important;
}
.carousel-inner{
width:100%;
max-height: 200px !important;
}
</style> |
package org.kaerdan.mvp_navigation.example1_activities;
import org.kaerdan.mvp_navigation.R;
import org.kaerdan.mvp_navigation.core.ui.favorite_list.<API key>;
import org.kaerdan.mvp_navigation.core.ui.favorite_list.<API key>;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v7.app.AppCompatActivity;
import android.view.MenuItem;
public class <API key> extends AppCompatActivity implements <API key>.NavigatorProvider {
@Override
protected void onCreate(final Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.<API key>);
if (savedInstanceState == null) {
<API key>().beginTransaction().add(R.id.content_frame, new <API key>(), null)
.commit();
}
getSupportActionBar().<API key>(true);
getSupportActionBar().<API key>(true);
}
@Override
public boolean <API key>(final MenuItem item) {
if (item.getItemId() == android.R.id.home) {
onBackPressed();
return true;
}
return super.<API key>(item);
}
@NonNull
@Override
public <API key>.Navigator getNavigator(final <API key>.Presenter presenter) {
return new <API key>(this);
}
} |
'use strict';
function create(value) {
return /* BasicCameraView */{
_0: value
};
}
function value(basicCameraView) {
return basicCameraView._0;
}
exports.create = create;
exports.value = value;
/* No side effect */ |
/** @define rbDatetimeControl; use strict */
/**
* The `.rbDatetimeControl` component...
*/
:root {
--<API key>: var();
}
/**
* 1. Comment
*/
.DatetimeControl {
}
@font-face {
font-family: 'Glyphicons Halflings';
src: url('./fonts/<API key>.eot');
src: url('./fonts/<API key>.eot?#iefix') format('embedded-opentype'), url('./fonts/<API key>.woff2') format('woff2'), url('./fonts/<API key>.woff') format('woff'), url('./fonts/<API key>.ttf') format('truetype'), url('./fonts/<API key>.svg#<API key>') format('svg');
}
.glyphicon {
position: relative;
top: 1px;
display: inline-block;
font-family: 'Glyphicons Halflings';
font-style: normal;
font-weight: normal;
line-height: 1;
-<API key>: antialiased;
-<API key>: grayscale;
}
.<API key>:before {
content: "\e079";
}
.<API key>:before {
content: "\e080";
}
.<API key>:before {
content: "\e113";
}
.<API key>:before {
content: "\e114";
}
.btn {
display: inline-block;
margin-bottom: 0;
font-weight: normal;
text-align: center;
vertical-align: middle;
-ms-touch-action: manipulation;
touch-action: manipulation;
cursor: pointer;
background-image: none;
border: 1px solid transparent;
white-space: nowrap;
padding: 6px 12px;
font-size: 14px;
line-height: 1.42857143;
border-radius: 4px;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.btn:focus,
.btn:active:focus,
.btn.active:focus,
.btn.focus,
.btn:active.focus,
.btn.active.focus {
outline: thin dotted;
outline: 5px auto -<API key>;
outline-offset: -2px;
}
.btn:hover,
.btn:focus,
.btn.focus {
color: #333333;
text-decoration: none;
}
.btn:active,
.btn.active {
outline: 0;
background-image: none;
-webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
}
.btn.disabled,
.btn[disabled],
fieldset[disabled] .btn {
cursor: not-allowed;
pointer-events: none;
opacity: 0.65;
filter: alpha(opacity=65);
-webkit-box-shadow: none;
box-shadow: none;
}
.btn-default {
color: #333333;
background-color: #ffffff;
border-color: #cccccc;
}
.btn-default:hover,
.btn-default:focus,
.btn-default.focus,
.btn-default:active,
.btn-default.active,
.open > .dropdown-toggle.btn-default {
color: #333333;
background-color: #e6e6e6;
border-color: #adadad;
}
.btn-default:active,
.btn-default.active,
.open > .dropdown-toggle.btn-default {
background-image: none;
}
.btn-default.disabled,
.btn-default[disabled],
fieldset[disabled] .btn-default,
.btn-default.disabled:hover,
.btn-default[disabled]:hover,
fieldset[disabled] .btn-default:hover,
.btn-default.disabled:focus,
.btn-default[disabled]:focus,
fieldset[disabled] .btn-default:focus,
.btn-default.disabled.focus,
.btn-default[disabled].focus,
fieldset[disabled] .btn-default.focus,
.btn-default.disabled:active,
.btn-default[disabled]:active,
fieldset[disabled] .btn-default:active,
.btn-default.disabled.active,
.btn-default[disabled].active,
fieldset[disabled] .btn-default.active {
background-color: #ffffff;
border-color: #cccccc;
}
.btn-default .badge {
color: #ffffff;
background-color: #333333;
}
.btn-primary {
color: #ffffff;
background-color: #337ab7;
border-color: #2e6da4;
}
.btn-primary:hover,
.btn-primary:focus,
.btn-primary.focus,
.btn-primary:active,
.btn-primary.active,
.open > .dropdown-toggle.btn-primary {
color: #ffffff;
background-color: #286090;
border-color: #204d74;
}
.btn-primary:active,
.btn-primary.active,
.open > .dropdown-toggle.btn-primary {
background-image: none;
}
.btn-primary.disabled,
.btn-primary[disabled],
fieldset[disabled] .btn-primary,
.btn-primary.disabled:hover,
.btn-primary[disabled]:hover,
fieldset[disabled] .btn-primary:hover,
.btn-primary.disabled:focus,
.btn-primary[disabled]:focus,
fieldset[disabled] .btn-primary:focus,
.btn-primary.disabled.focus,
.btn-primary[disabled].focus,
fieldset[disabled] .btn-primary.focus,
.btn-primary.disabled:active,
.btn-primary[disabled]:active,
fieldset[disabled] .btn-primary:active,
.btn-primary.disabled.active,
.btn-primary[disabled].active,
fieldset[disabled] .btn-primary.active {
background-color: #337ab7;
border-color: #2e6da4;
}
.btn-primary .badge {
color: #337ab7;
background-color: #ffffff;
}
.btn-success {
color: #ffffff;
background-color: #5cb85c;
border-color: #4cae4c;
}
.btn-success:hover,
.btn-success:focus,
.btn-success.focus,
.btn-success:active,
.btn-success.active,
.open > .dropdown-toggle.btn-success {
color: #ffffff;
background-color: #449d44;
border-color: #398439;
}
.btn-success:active,
.btn-success.active,
.open > .dropdown-toggle.btn-success {
background-image: none;
}
.btn-success.disabled,
.btn-success[disabled],
fieldset[disabled] .btn-success,
.btn-success.disabled:hover,
.btn-success[disabled]:hover,
fieldset[disabled] .btn-success:hover,
.btn-success.disabled:focus,
.btn-success[disabled]:focus,
fieldset[disabled] .btn-success:focus,
.btn-success.disabled.focus,
.btn-success[disabled].focus,
fieldset[disabled] .btn-success.focus,
.btn-success.disabled:active,
.btn-success[disabled]:active,
fieldset[disabled] .btn-success:active,
.btn-success.disabled.active,
.btn-success[disabled].active,
fieldset[disabled] .btn-success.active {
background-color: #5cb85c;
border-color: #4cae4c;
}
.btn-success .badge {
color: #5cb85c;
background-color: #ffffff;
}
.btn-info {
color: #ffffff;
background-color: #5bc0de;
border-color: #46b8da;
}
.btn-info:hover,
.btn-info:focus,
.btn-info.focus,
.btn-info:active,
.btn-info.active,
.open > .dropdown-toggle.btn-info {
color: #ffffff;
background-color: #31b0d5;
border-color: #269abc;
}
.btn-info:active,
.btn-info.active,
.open > .dropdown-toggle.btn-info {
background-image: none;
}
.btn-info.disabled,
.btn-info[disabled],
fieldset[disabled] .btn-info,
.btn-info.disabled:hover,
.btn-info[disabled]:hover,
fieldset[disabled] .btn-info:hover,
.btn-info.disabled:focus,
.btn-info[disabled]:focus,
fieldset[disabled] .btn-info:focus,
.btn-info.disabled.focus,
.btn-info[disabled].focus,
fieldset[disabled] .btn-info.focus,
.btn-info.disabled:active,
.btn-info[disabled]:active,
fieldset[disabled] .btn-info:active,
.btn-info.disabled.active,
.btn-info[disabled].active,
fieldset[disabled] .btn-info.active {
background-color: #5bc0de;
border-color: #46b8da;
}
.btn-info .badge {
color: #5bc0de;
background-color: #ffffff;
}
.btn-warning {
color: #ffffff;
background-color: #f0ad4e;
border-color: #eea236;
}
.btn-warning:hover,
.btn-warning:focus,
.btn-warning.focus,
.btn-warning:active,
.btn-warning.active,
.open > .dropdown-toggle.btn-warning {
color: #ffffff;
background-color: #ec971f;
border-color: #d58512;
}
.btn-warning:active,
.btn-warning.active,
.open > .dropdown-toggle.btn-warning {
background-image: none;
}
.btn-warning.disabled,
.btn-warning[disabled],
fieldset[disabled] .btn-warning,
.btn-warning.disabled:hover,
.btn-warning[disabled]:hover,
fieldset[disabled] .btn-warning:hover,
.btn-warning.disabled:focus,
.btn-warning[disabled]:focus,
fieldset[disabled] .btn-warning:focus,
.btn-warning.disabled.focus,
.btn-warning[disabled].focus,
fieldset[disabled] .btn-warning.focus,
.btn-warning.disabled:active,
.btn-warning[disabled]:active,
fieldset[disabled] .btn-warning:active,
.btn-warning.disabled.active,
.btn-warning[disabled].active,
fieldset[disabled] .btn-warning.active {
background-color: #f0ad4e;
border-color: #eea236;
}
.btn-warning .badge {
color: #f0ad4e;
background-color: #ffffff;
}
.btn-danger {
color: #ffffff;
background-color: #d9534f;
border-color: #d43f3a;
}
.btn-danger:hover,
.btn-danger:focus,
.btn-danger.focus,
.btn-danger:active,
.btn-danger.active,
.open > .dropdown-toggle.btn-danger {
color: #ffffff;
background-color: #c9302c;
border-color: #ac2925;
}
.btn-danger:active,
.btn-danger.active,
.open > .dropdown-toggle.btn-danger {
background-image: none;
}
.btn-danger.disabled,
.btn-danger[disabled],
fieldset[disabled] .btn-danger,
.btn-danger.disabled:hover,
.btn-danger[disabled]:hover,
fieldset[disabled] .btn-danger:hover,
.btn-danger.disabled:focus,
.btn-danger[disabled]:focus,
fieldset[disabled] .btn-danger:focus,
.btn-danger.disabled.focus,
.btn-danger[disabled].focus,
fieldset[disabled] .btn-danger.focus,
.btn-danger.disabled:active,
.btn-danger[disabled]:active,
fieldset[disabled] .btn-danger:active,
.btn-danger.disabled.active,
.btn-danger[disabled].active,
fieldset[disabled] .btn-danger.active {
background-color: #d9534f;
border-color: #d43f3a;
}
.btn-danger .badge {
color: #d9534f;
background-color: #ffffff;
}
.btn-link {
color: #337ab7;
font-weight: normal;
border-radius: 0;
}
.btn-link,
.btn-link:active,
.btn-link.active,
.btn-link[disabled],
fieldset[disabled] .btn-link {
background-color: transparent;
-webkit-box-shadow: none;
box-shadow: none;
}
.btn-link,
.btn-link:hover,
.btn-link:focus,
.btn-link:active {
border-color: transparent;
}
.btn-link:hover,
.btn-link:focus {
color: #23527c;
text-decoration: underline;
background-color: transparent;
}
.btn-link[disabled]:hover,
fieldset[disabled] .btn-link:hover,
.btn-link[disabled]:focus,
fieldset[disabled] .btn-link:focus {
color: #777777;
text-decoration: none;
}
.btn-lg {
padding: 10px 16px;
font-size: 18px;
line-height: 1.3333333;
border-radius: 6px;
}
.btn-sm {
padding: 5px 10px;
font-size: 12px;
line-height: 1.5;
border-radius: 3px;
}
.btn-xs {
padding: 1px 5px;
font-size: 12px;
line-height: 1.5;
border-radius: 3px;
}
.btn-block {
display: block;
width: 100%;
}
.btn-block + .btn-block {
margin-top: 5px;
}
input[type="submit"].btn-block,
input[type="reset"].btn-block,
input[type="button"].btn-block {
width: 100%;
}
.caret {
display: inline-block;
width: 0;
height: 0;
margin-left: 2px;
vertical-align: middle;
border-top: 4px dashed;
border-right: 4px solid transparent;
border-left: 4px solid transparent;
}
.dropup,
.dropdown {
position: relative;
}
.dropdown-toggle:focus {
outline: 0;
}
.dropdown-menu {
position: absolute;
top: 100%;
left: 0;
z-index: 1000;
display: none;
float: left;
min-width: 160px;
padding: 5px 0;
margin: 2px 0 0;
list-style: none;
font-size: 14px;
text-align: left;
background-color: #ffffff;
border: 1px solid #cccccc;
border: 1px solid rgba(0, 0, 0, 0.15);
border-radius: 4px;
-webkit-box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
-<API key>: padding-box;
background-clip: padding-box;
}
.dropdown-menu.pull-right {
right: 0;
left: auto;
}
.dropdown-menu .divider {
height: 1px;
margin: 9px 0;
overflow: hidden;
background-color: #e5e5e5;
}
.dropdown-menu > li > a {
display: block;
padding: 3px 20px;
clear: both;
font-weight: normal;
line-height: 1.42857143;
color: #333333;
white-space: nowrap;
}
.dropdown-menu > li > a:hover,
.dropdown-menu > li > a:focus {
text-decoration: none;
color: #262626;
background-color: #f5f5f5;
}
.dropdown-menu > .active > a,
.dropdown-menu > .active > a:hover,
.dropdown-menu > .active > a:focus {
color: #ffffff;
text-decoration: none;
outline: 0;
background-color: #337ab7;
}
.dropdown-menu > .disabled > a,
.dropdown-menu > .disabled > a:hover,
.dropdown-menu > .disabled > a:focus {
color: #777777;
}
.dropdown-menu > .disabled > a:hover,
.dropdown-menu > .disabled > a:focus {
text-decoration: none;
background-color: transparent;
background-image: none;
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
cursor: not-allowed;
}
.open > .dropdown-menu {
display: block;
}
.open > a {
outline: 0;
}
.dropdown-menu-right {
left: auto;
right: 0;
}
.dropdown-menu-left {
left: 0;
right: auto;
}
.dropdown-header {
display: block;
padding: 3px 20px;
font-size: 12px;
line-height: 1.42857143;
color: #777777;
white-space: nowrap;
}
.dropdown-backdrop {
position: fixed;
left: 0;
right: 0;
bottom: 0;
top: 0;
z-index: 990;
}
.pull-right > .dropdown-menu {
right: 0;
left: auto;
}
.dropup .caret,
.navbar-fixed-bottom .dropdown .caret {
border-top: 0;
border-bottom: 4px solid;
content: "";
}
.dropup .dropdown-menu,
.navbar-fixed-bottom .dropdown .dropdown-menu {
top: auto;
bottom: 100%;
margin-bottom: 2px;
}
@media (min-width: 768px) {
.navbar-right .dropdown-menu {
left: auto;
right: 0;
}
.navbar-right .dropdown-menu-left {
left: 0;
right: auto;
}
}
.clearfix:before,
.clearfix:after {
content: " ";
display: table;
}
.clearfix:after {
clear: both;
}
.center-block {
display: block;
margin-left: auto;
margin-right: auto;
}
.pull-right {
float: right !important;
}
.pull-left {
float: left !important;
}
/*
* Datepicker element
*/
.datepicker.dropdown-menu {
width: 250px;
height: 270px;
}
.datepicker.dropdown-menu button {
outline: none;
border: 0px;
}
.datepicker.dropdown-menu tbody {
height: 180px;
}
.datepicker.dropdown-menu tbody button {
padding: 6px;
}
.datepicker.dropdown-menu.datepicker-mode-1 tbody button,
.datepicker.dropdown-menu.datepicker-mode-2 tbody button {
height: 65px;
} |
<?php
<API key>(array('Faker', 'autoload'));
/**
* A fake text generator.
*
* @todo document API
*/
class Faker {
static function autoload($classname) {
$classpath = dirname(__FILE__) . '/' . str_replace('_', '/', $classname) . '.php';
if (file_exists($classpath)) {
require_once $classpath;
} else {
throw new Exception();
}
}
public function __get($property) {
return new Faker_Invoker($property);
}
/**
* Command line runner. Generates fake data from method specified by arguments.
*
* @param array $arguments
*/
static public function main($arguments) {
if (!isset($arguments[1]) || $arguments[1] == '--help' || $arguments[1] == '-h') {
echo "Faker {{version}}\nA fake data generator.\nEg:\n $ faker person.name\n $ faker color.hex\n\n";
return;
}
$targets = explode('.', $arguments[1]);
$method = array_pop($targets);
$fake = 'Fake_' . implode('_', array_map('ucfirst', $targets));
try {
$faker = new $fake();
if (is_callable(array($faker, $method))) {
echo <API key>(array($faker, $method), array_slice($arguments, 2));
} else {
echo $method . " is not part of " . implode('.', $targets) . "\n\n";
}
} catch(Exception $error) {
echo $arguments[1] . " not found.\n\n";
}
return;
}
} |
export class Message {
constructor(
){}
} |
<?php
return [
'name' => 'Increnta',
'description' => 'Enable some features like send email alerts on campaigns',
'version' => '1.0',
'author' => 'Fernando Rubio',
'services' => array(
'events' => array(
'plugin.increnta.campaignbundle.subscriber' => array(
'class' => 'MauticPlugin\IncrentaBundle\EventListener\CampaignSubscriber',
'arguments' => [
'mautic.lead.model.lead',
'mautic.email.model.email',
'mautic.campaign.model.event',
'mautic.channel.model.queue',
'mautic.helper.mailer'
]
)
),
'forms' => array(
'increnta.campaign.form.sendalert' => array(
'class' => 'MauticPlugin\IncrentaBundle\Form\Type\SendAlert',
'arguments' => 'mautic.factory',
'alias' => 'sendalert'
)
)
)
]; |
(function () {
'use strict';
angular.module('profile')
.component('profileAboutBlock', {
templateUrl: 'partials/profile-about-block.html',
controller: profileAboutBlock,
controllerAs: 'vm',
bindings: {
profile: '<'
}
});
profileAboutBlock.$inject = [];
function profileAboutBlock() {
const vm = this;
vm.$onInit = function () {
};
}
})(); |
/**
* Interface definition for UI service tier.
*/
package net.bolbat.kit.service.ui; |
<?php
namespace Tempo\Bundle\AppBundle\Form\Type;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\RepeatedType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\Extension\Core\Type\PasswordType;
use Symfony\Component\Form\Extension\Core\Type\CollectionType;
use Symfony\Component\Form\<API key>;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Form\FormEvents;
use Symfony\Component\Form\FormEvent;
class RegisterType extends AbstractType
{
public function buildForm(<API key> $builder, array $options)
{
$builder
->add('username', TextType::class, array(
'required' => true,
'label' => 'tempo.security.login.username',
))
->add('password', RepeatedType::class, array(
'type' => PasswordType::class,
'invalid_message' => 'The password fields must match.',
'options' => array('attr' => array('class' => 'password-field')),
'required' => true,
'first_options' => array('label' => 'tempo.security.login.password'),
'second_options' => array('label' => 'tempo.security.resetting.password_again'),
))
->add('emails', CollectionType::class, array(
'entry_type' => UserEmailType::class,
'entry_options' => [
'label' => false,
],
'required' => true,
))
->addEventListener(FormEvents::PRE_SET_DATA, function (FormEvent $event) {
$data = $event->getData();
$form = $event->getForm();
if ($data->getEmails()->first() !== null) {
$form->add('emails', CollectionType::class, array(
'entry_type' => UserEmailType::class,
'entry_options' => [
'label' => false,
'attr' => array('readonly' => 'readonly')
],
'required' => true,
));
}
});
}
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults(
array(
'data_class' => 'Tempo\Bundle\AppBundle\Model\User',
'csrf_protection' => false,
)
);
}
/**
* {@inheritdoc}
*/
public function getBlockPrefix()
{
return 'register';
}
} |
var chai = require('chai');
var util = require('util');
var path = require('path');
var poplar = require('poplar');
var ApiBuilder = poplar.ApiBuilder;
var glue = require('../');
glue.autoload('myLoaders', path.join(__dirname, './loaders'));
var SampleApp = require('./sample_app');
var expect = chai.expect;
describe('glue', function() {
it('should have specific functions', function() {
expect(glue).to.respondTo('init');
expect(glue).to.respondTo('<API key>');
expect(glue).to.respondTo('loadApiBuilders');
});
it('should load autoload paths', function() {
expect(poplar.get('myLoaders')).to.have.property('middlewares');
expect(poplar.get('myLoaders')).to.have.property('config');
expect(poplar.get('myLoaders')).to.have.property('controllers');
expect(poplar.get('myLoaders')).to.have.property('entities');
expect(poplar.get('myLoaders')).to.have.property('environments');
expect(poplar.get('myLoaders')).to.have.property('initializers');
});
it('should have loggers', function() {
expect(poplar.get('logger')).to.have.property('access');
expect(poplar.get('logger')).to.have.property('error');
expect(poplar.get('logger')).to.have.property('debug').to.be.a('function');
expect(poplar.get('logger').debug()).to.be.a('function');
});
it('should have envs', function() {
expect(poplar.get('env')).to.have.property('NODE_ENV', 'development');
expect(poplar.get('env')).to.have.property('isDevelopment');
expect(poplar.get('env')).to.have.property('isProduction');
expect(poplar.get('env')).to.have.property('isTest');
});
it('should have config', function() {
expect(poplar.get('config')).to.have.property('sample', true);
expect(poplar.get('config')).to.have.property('database').eql({});
});
it('shoule be poplar instances', function() {
expect(SampleApp.apiV1).to.be.instanceOf(poplar);
});
it('shoule be ApiBuilder instances', function() {
expect(SampleApp.apiV1._apiBuilders.users).to.be.instanceOf(ApiBuilder);
expect(SampleApp.apiV1._apiBuilders.roles).to.be.instanceOf(ApiBuilder);
});
}); |
namespace AIBots
{
partial class NetworkForm<World, Bot, Settings>
{
<summary>
Required designer variable.
</summary>
private System.ComponentModel.IContainer components = null;
<summary>
Clean up any resources being used.
</summary>
<param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
<summary>
Required method for Designer support - do not modify
the contents of this method with the code editor.
</summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.tmr = new System.Windows.Forms.Timer(this.components);
this.SuspendLayout();
// tmr
this.tmr.Enabled = true;
this.tmr.Tick += new System.EventHandler(this.tmr_Tick);
// NetworkForm
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(284, 262);
this.Name = "NetworkForm";
this.Text = "Network";
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Timer tmr;
}
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.