answer stringlengths 15 1.25M |
|---|
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Open Source Oracle</title>
<meta name="description" content="Open Source Oracle">
<meta name="author" content="Martin Giffy D'Souza">
<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="reveal.js/css/reveal.css">
<link rel="stylesheet" href="reveal.js/css/theme/serif.css" id="theme">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">
<!-- Redundant local copy of FA for local dev -->
<link rel="stylesheet" href="Font-Awesome/css/font-awesome.min.css">
<link rel="stylesheet" href="www/css/custom.css">
<!-- Code syntax highlighting -->
<link rel="stylesheet" href="reveal.js/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 ) ? 'reveal.js/css/print/pdf.css' : 'reveal.js/css/print/paper.css';
document.<API key>( 'head' )[0].appendChild( link );
</script>
<!--[if lt IE 9]>
<script src="reveal.js/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 id="themes">
<h2>Themes</h2>
<p>
reveal.js comes with a few themes built in: <br>
<a href="#" onclick="document.getElementById('theme').setAttribute('href','reveal.js/css/theme/black.css'); return false;">Black (default)</a> -
<a href="#" onclick="document.getElementById('theme').setAttribute('href','reveal.js/css/theme/white.css'); return false;">White</a> -
<a href="#" onclick="document.getElementById('theme').setAttribute('href','reveal.js/css/theme/league.css'); return false;">League</a> -
<a href="#" onclick="document.getElementById('theme').setAttribute('href','reveal.js/css/theme/sky.css'); return false;">Sky</a> -
<a href="#" onclick="document.getElementById('theme').setAttribute('href','reveal.js/css/theme/beige.css'); return false;">Beige</a> -
<a href="#" onclick="document.getElementById('theme').setAttribute('href','reveal.js/css/theme/simple.css'); return false;">Simple</a> <br>
<a href="#" onclick="document.getElementById('theme').setAttribute('href','reveal.js/css/theme/serif.css'); return false;">Serif</a> -
<a href="#" onclick="document.getElementById('theme').setAttribute('href','reveal.js/css/theme/blood.css'); return false;">Blood</a> -
<a href="#" onclick="document.getElementById('theme').setAttribute('href','reveal.js/css/theme/night.css'); return false;">Night</a> -
<a href="#" onclick="document.getElementById('theme').setAttribute('href','reveal.js/css/theme/moon.css'); return false;">Moon</a> -
<a href="#" onclick="document.getElementById('theme').setAttribute('href','reveal.js/css/theme/solarized.css'); return false;">Solarized</a>
</p>
</section>
<section
data-markdown="slides/intro.md"
data-separator="^new-slide$"
<API key>="^new-slide-vertical$"
<API key>="^Notes?:"
>
</section>
<section
data-markdown="slides/about.md"
data-separator="^new-slide$"
<API key>="^new-slide-vertical$"
<API key>="^Notes?:"
>
</section>
<section
data-markdown="slides/os-projects.md"
data-separator="^new-slide$"
<API key>="^new-slide-vertical$"
<API key>="^Notes?:"
>
</section>
<section
data-markdown="slides/git.md"
data-separator="^new-slide$"
<API key>="^new-slide-vertical$"
<API key>="^Notes?:"
>
</section>
<section
data-markdown="slides/os-considerations.md"
data-separator="^new-slide$"
<API key>="^new-slide-vertical$"
<API key>="^Notes?:"
>
</section>
<section
data-markdown="slides/conclusion.md"
data-separator="^new-slide$"
<API key>="^new-slide-vertical$"
<API key>="^Notes?:"
>
</section>
</div>
</div>
<script src="reveal.js/lib/js/head.min.js"></script>
<script src="reveal.js/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,
showNotes: true,
transition: 'convex', // none/fade/slide/convex/concave/zoom
// Optional reveal.js plugins
dependencies: [
{ src: 'reveal.js/lib/js/classList.js', condition: function() { return !document.body.classList; } },
{ src: 'reveal.js/plugin/markdown/marked.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
{ src: 'reveal.js/plugin/markdown/markdown.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
{ src: 'reveal.js/plugin/highlight/highlight.js', async: true, condition: function() { return !!document.querySelector( 'pre code' ); }, callback: function() { hljs.<API key>(); } },
{ src: 'reveal.js/plugin/zoom-js/zoom.js', async: true },
{ src: 'reveal.js/plugin/notes/notes.js', async: true }
]
});
</script>
</body>
</html> |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<meta name="author" content="">
<title>Реєстрація</title>
<!-- Bootstrap core CSS -->
<link href="../vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<!-- Custom styles for this template -->
<link href="../css/styles.css" rel="stylesheet">
</head>
<body>
<div class="wrapper">
<form class="form-horizontal" method="post" action="addUserAction.php">
<div class="form-group">
<label class="control-label col-sm-2" for="first">Firstname:</label>
<div class="col-sm-10">
<input type="text" name="first_name" id="first" class="form-control" required>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2" for="last">Lastname:</label>
<div class="col-sm-10">
<input type="text" name="last_name" id="last" class="form-control" required>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2" for="patronymic">Patronymic:</label>
<div class="col-sm-10">
<input type="text" name="patronymic" id="patronymic" class="form-control" required>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2" for="pass">Password:</label>
<div class="col-sm-10">
<input type="password" name="pass" id="pass" class="form-control" required>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2" for="sex">Sex:</label>
<div class="col-sm-10">
<input type="radio" name="sex" value="male"> Male
<input type="radio" name="sex" value="female"> Female
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<button type="submit" class="btn btn-primary" class="form-control">Submit</button>
</div>
</div>
</form>
</div> |
import React from 'react';
import PropTypes from 'prop-types';
import Styled from 'rsg-components/Styled';
import SectionHeading from 'rsg-components/SectionHeading';
import Markdown from 'rsg-components/Markdown';
const styles = ({ space }) => ({
root: {
marginBottom: space[4],
},
});
export function SectionRenderer(allProps) {
const {
classes,
name,
slug,
content,
components,
sections,
depth,
description,
pagePerSection,
} = allProps;
return (
<section className={classes.root}>
{name && (
<SectionHeading
depth={depth}
id={slug}
slotName="sectionToolbar"
pagePerSection={pagePerSection}
slotProps={allProps}
>
{name}
</SectionHeading>
)}
{description && <Markdown text={description} />}
{content}
{sections}
{components}
</section>
);
}
SectionRenderer.propTypes = {
classes: PropTypes.object.isRequired,
name: PropTypes.string,
description: PropTypes.string,
slug: PropTypes.string,
filepath: PropTypes.string,
content: PropTypes.node,
components: PropTypes.node,
sections: PropTypes.node,
isolated: PropTypes.bool,
depth: PropTypes.number.isRequired,
pagePerSection: PropTypes.bool,
};
export default Styled(styles)(SectionRenderer); |
package org.snf4j.core;
import java.io.BufferedReader;
import java.io.<API key>;
import java.io.InputStreamReader;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.nio.ByteBuffer;
import java.nio.channels.ServerSocketChannel;
import java.nio.channels.SocketChannel;
import javax.net.ssl.SSLEngine;
import org.snf4j.core.factory.<API key>;
import org.snf4j.core.handler.<API key>;
import org.snf4j.core.handler.IStreamHandler;
import org.snf4j.core.handler.SessionEvent;
import org.snf4j.core.session.<API key>;
import org.snf4j.core.session.ISessionConfig;
import org.snf4j.core.session.<API key>;
public class HttpProxy {
final int port;
volatile SelectorLoop loop;
volatile StreamSession client;
volatile StreamSession server;
volatile String status = "200 Connection established";
volatile boolean skipConnection;
volatile Packet appendPacket;
StringBuilder trace = new StringBuilder();
public HttpProxy(int port) {
this.port = port;
}
public String getTrace() {
String s;
synchronized (trace) {
s = trace.toString();
trace.setLength(0);
}
return s;
}
void trace(String s) {
synchronized(trace) {
trace.append(s);
trace.append('|');
}
}
public void start(long millis) throws Exception {
start(millis, false);
}
public void start(long millis, boolean ssl) throws Exception {
loop = new SelectorLoop();
loop.start();
ServerSocketChannel ssc = ServerSocketChannel.open();
ssc.configureBlocking(false);
ssc.socket().bind(new InetSocketAddress(port));
loop.register(ssc, new SessionFactory(ssl)).sync(millis);
}
public void stop(long millis) throws <API key> {
loop.stop();
loop.join(millis);
if (loop.thread != null) {
throw new <API key>();
}
}
class ServerHandler extends <API key> {
final boolean proxy;
ServerHandler(boolean proxy) {
this.proxy = proxy;
}
@Override
public ISessionConfig getConfig() {
<API key> config = new <API key>() {
@Override
public SSLEngine createSSLEngine(boolean clientMode) throws <API key> {
return Server.createSSLEngine(null, clientMode);
}
};
config.<API key>(true);
return config;
}
@Override
public void read(Object msg) {
if (client != null) {
client.writenf(msg);
return;
}
if (skipConnection) {
return;
}
BufferedReader in = new BufferedReader(new InputStreamReader(new <API key>((byte[])msg)));
try {
String l = in.readLine();
trace(l);
if (l == null) {
throw new Exception();
}
String[] items = l.split(" ");
if (items.length != 3) {
throw new Exception();
}
if (!items[0].equalsIgnoreCase("CONNECT") || !items[2].equalsIgnoreCase("HTTP/1.1")) {
throw new Exception();
}
items = items[1].split(":");
if (items.length != 2) {
throw new Exception();
}
while ((l = in.readLine()) != null) {
trace(l);
if (l.isEmpty()) {
if (in.readLine() != null) {
throw new Exception();
}
break;
}
}
SocketChannel sc = SocketChannel.open();
sc.configureBlocking(false);
sc.connect(new InetSocketAddress(InetAddress.getByName(items[0]), Integer.parseInt(items[1])));
loop.register(sc, new ClientHandler());
}
catch (Exception e) {
String s = "HTTP/1.1 400 Bad Request\r\n\r\n";
trace(s.trim());
trace("");
getSession().writenf(s.getBytes());
getSession().close();
}
}
public void event(SessionEvent event) {
switch (event) {
case READY:
server = (StreamSession) getSession();
break;
case ENDING:
if (!proxy && client != null) {
client.close();
client = null;
}
break;
default:
}
}
}
class ClientHandler extends <API key> {
@Override
public void read(Object msg) {
server.writenf(msg);
}
public void event(SessionEvent event) {
switch (event) {
case READY:
client = (StreamSession) getSession();
String s = "HTTP/1.1 "+status+"\r\n\r\n";
trace(s.trim());
trace("");
if (appendPacket != null) {
ByteBuffer buf = ByteBuffer.allocate(100);
buf.put(s.getBytes());
buf.put(appendPacket.toBytes());
buf.flip();
server.writenf(buf);
}
else {
server.writenf(s.getBytes());
}
server.close();
break;
case ENDING:
if (server != null) {
server.getPipeline().close();
server = null;
}
break;
default:
}
}
}
class SessionFactory extends <API key> {
final boolean ssl;
SessionFactory(boolean ssl) {
this.ssl = ssl;
}
@Override
public StreamSession create(SocketChannel channel) throws Exception {
StreamSession s = super.create(channel);
if (ssl) {
s.getPipeline().add("proxy", new SSLSession("P", new ServerHandler(true), false));
}
else {
s.getPipeline().add("proxy", new StreamSession("P", new ServerHandler(true)));
}
return s;
}
@Override
protected IStreamHandler createHandler(SocketChannel channel) {
return new ServerHandler(false);
}
}
} |
class Node {
constructor(key, val) {
this.key = key
this.val = val
this.lft = null
this.rgt = null
}
}
class BinarySearchTree {
constructor() {
this.root = null
}
<API key>(key) {
let [node, parent] = [this.root, null]
while (node) {
if (key === node.key) {
return [node, parent]
}
if (key < node.key) {
[node, parent] = [node.lft, node]
} else {
[node, parent] = [node.rgt, node]
}
}
return [null, parent]
}
get(key) {
let [node, ] = this.<API key>(key)
return node === null ? null : node.val
}
put(key, val) {
let [node, parent] = this.<API key>(key)
if (node === null && parent === null) {
this.root = new Node(key, val)
} else if (node === null) {
if (key < parent.key) {
parent.lft = new Node(key, val)
} else {
parent.rgt = new Node(key, val)
}
} else {
node.val = val
}
}
remove(key) {
let [node, parent] = this.<API key>(key)
if (node === null) return
let heir = null
if (node.lft !== null && node.rgy !== null) {
[heir, parent] = [node.lft, node]
while (heir.rgt) {
[heir, parent] = [heir.rgt, node]
}
if (parent === node) {
parent.lft = heir.lft
} else {
parent.rgt = heir.lft
}
[node.key, node.val] = [heir.key, heir.val]
} else if (node.lft !== null) {
heir = node.lft
node.key = heir.key
node.val = heir.val
node.lft = heir.lft
node.rgt = heir.rgt
} else if (node.rgt !== null) {
heir = node.rgt
node.key = heir.key
node.val = heir.val
node.lft = heir.lft
node.rgt = heir.rgt
} else {
if (node === this.root) {
this.root = null
} else {
if (node === parent.lft) {
parent.lft = null
} else {
parent.rgt = null
}
}
heir = node
}
heir.key = null
heir.val = null
heir.lft = null
heir.rgt = null
}
}
exports.BinarySearchTree = BinarySearchTree |
import convertToMarkdown from './convert-to-markdown';
import resolveApiSpec from './resolve-api-spec';
const api = {
convertToMarkdown,
resolveApiSpec,
};
export default api; |
Style
===========================
Constraints:
- Existence of an abstraction to which all functions can be converted. This
main abstraction provides an interface to (1) wrap around values, so that they
become the abstraction; and (2) bind wrapped values to functions, so
to establish sequences of functions.
- Larger problem is solved as a pipeline of functions bound together
by the single interface that chains them.
Possible names:
- The One
- Monadic Identity
- The wrapper of all things
- Imperative functional style |
/*
284 Peeking Iterator
Given an Iterator class interface with methods: next() and hasNext(), design and implement a PeekingIterator that support the peek() operation -- it essentially peek() at the element that will be returned by the next call to next().
Here is an example. Assume that the iterator is initialized to the beginning of the list: [1, 2, 3].
Call next() gets you 1, the first element in the list.
Now you call peek() and it returns 2, the next element. Calling next() after that still return 2.
You call next() the final time and it returns 3, the last element. Calling hasNext() after that should return false.
Hint:
Think of "looking ahead". You want to cache the next element.
Is one variable sufficient? Why or why not?
Test your design with call order of peek() before next() vs next() before peek().
For a clean implementation, check out Google's guava library source code.
*/
//cache the next element. If next is null, there is no more elements in iterator.
class PeekingIterator implements Iterator<Integer> {
private Integer next = null;
private Iterator<Integer> iter;
public PeekingIterator(Iterator<Integer> iterator) {
// initialize any member here.
iter = iterator;
/*
if (iter.hasNext())
next = iter.next();
*/
next();
}
// Returns the next element in the iteration without advancing the iterator.
public Integer peek() {
return next;
}
// hasNext() and next() should behave the same as in the Iterator interface.
// Override them if needed.
@Override
public Integer next() {
Integer res = next;
next = iter.hasNext() ? iter.next() : null;
return res;
}
@Override
public boolean hasNext() {
return next != null;
}
} |
<h4>Welcome to the e2e demos for Angular <a href="https://getmdl.io/" target="_blank">Material Design Lite!</a></h4>
<h6>Checkout the <a href="https://github.com/mseemann/angular2-mdl">GitHub</a> project on
how to install and use the angular-mdl package.</h6>
<h5>News:</h5>
<p>
This package contains only components that are provided by material design lite.<br/> But there are lot of
possible components that will be needed too!<br/>To keep this package clean and small the package
<a href="/angular2-mdl-ext">angular2-mdl-ext</a>
is under development to match these needs.
</p>
<h5>Features:</h5>
<ul>
<li>Angular components for Material Design Lite</li>
<li>Suports Angular 2 (angular2-mdl) and Angular 4 and up (@angular-mdl/core)</li>
<ul>
<li>change the properties and the components changes their behavior</li>
<li>add and remove components on the fly (for example menu items)</li>
</ul>
<li>Components instead of css classes.</li>
<ul>
<li>This will provide less errors and a better tool support.</li>
<li>The html code is shorter.</li>
</ul>
<li>Include only the code that you really use in your production files.</li>
<li>For sure this demo and docu has been created with angular2-mdl!</li>
<li>Ready for Angular Reactive Forms.</li>
</ul>
<h5>NPM Packages</h5>
<p>Use the npm packages <i>@angular-mdl/core</i> for Angular 4 and up and <i>angular2-mdl</i> for Angular 2.</p>
<div>
A side effect is that you don’t need to write a lot of css classes and html structures to create material design lite
components.
Instead of
<pre demoPrism>
<![CDATA[
<div class="mdl-textfield mdl-js-textfield <API key>">
<label class="mdl-button mdl-js-button mdl-button--icon" for="sample6">
<i class="material-icons">search</i>
</label>
<div class="<API key>">
<input class="<API key>" id="sample6" type="text">
</div>
</div>
]]>
</pre>
you just write:
<pre demoPrism>
<![CDATA[
<mdl-textfield [(ngModel)]="theText" icon="search" type="text"></mdl-textfield>
]]>
</pre>
<p>
to create an expandle text field and get two-way-databindig for free!
</p>
<p>
Still not convinced? With this package you can mix original material design lite features
and angular web apps within one website. <a href="https:
uses material deisgn lite for the content related pages and angular-mdl for the tour planner.
But the user will not notice this because both parts look and behave the same.
</p>
<p>
<mdl-textfield [(ngModel)]="theText" icon="search" type="text"></mdl-textfield>
</p>
</div>
<!-- just a checkbox to check the mask background in e2e - avoid the redirect for saucelab :( -->
<mdl-checkbox [ngModel]="true"></mdl-checkbox> |
package org.codehaus.xfire.gen.jsr181;
import java.net.<API key>;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import javax.xml.namespace.QName;
import org.codehaus.xfire.<API key>;
import org.codehaus.xfire.annotations.<API key>;
import org.codehaus.xfire.annotations.jsr181.<API key>;
import org.codehaus.xfire.client.XFireProxyFactory;
import org.codehaus.xfire.gen.GenerationContext;
import org.codehaus.xfire.gen.GeneratorPlugin;
import org.codehaus.xfire.service.Binding;
import org.codehaus.xfire.service.Endpoint;
import org.codehaus.xfire.service.Service;
import org.codehaus.xfire.soap.AbstractSoapBinding;
import org.codehaus.xfire.soap.Soap11Binding;
import org.codehaus.xfire.soap.Soap12Binding;
import org.codehaus.xfire.soap.SoapTransport;
import org.codehaus.xfire.transport.TransportManager;
import org.codehaus.xfire.transport.local.LocalTransport;
import com.sun.codemodel.JBlock;
import com.sun.codemodel.JCatchBlock;
import com.sun.codemodel.JClass;
import com.sun.codemodel.JCodeModel;
import com.sun.codemodel.JDefinedClass;
import com.sun.codemodel.JExpr;
import com.sun.codemodel.JFieldVar;
import com.sun.codemodel.JInvocation;
import com.sun.codemodel.JMethod;
import com.sun.codemodel.JMod;
import com.sun.codemodel.JTryBlock;
import com.sun.codemodel.JType;
import com.sun.codemodel.JVar;
public class PortGenerator
extends AbstractPlugin
implements GeneratorPlugin
{
private JFieldVar pfVar;
private JFieldVar endpointsVar;
private JMethod getEndpoint;
private JMethod constructor;
public void generate(GenerationContext context)
throws Exception
{
for (Iterator itr = context.getServices().entrySet().iterator(); itr.hasNext();)
{
Map.Entry entry = (Map.Entry) itr.next();
generate(context, (QName) entry.getKey(), (List) entry.getValue());
}
}
public void generate(GenerationContext context, QName name, List services)
throws Exception
{
String local = name.getLocalPart();
String ns = name.getNamespaceURI();
JCodeModel model = context.getCodeModel();
// Create the Client class
String portName = getPackage(name, context) + "." + javify(name.getLocalPart()) + "Client";
// portName = portName;
JDefinedClass servCls = model._class(portName);
/**
* Constructor
*/
constructor = servCls.constructor(JMod.PUBLIC);
JType pfType = model._ref(XFireProxyFactory.class);
pfVar = servCls.field(JMod.STATIC + JMod.PRIVATE, pfType, "proxyFactory", JExpr._new(pfType));
JType hashMapType = model._ref(HashMap.class);
endpointsVar = servCls.field(JMod.PRIVATE, hashMapType, "endpoints", JExpr._new(hashMapType));
/**
* getEndpoint(Endpoint)
*/
JClass objectType = model.ref(Object.class);
getEndpoint = servCls.method(JMod.PUBLIC, objectType, "getEndpoint");
JVar epVar = getEndpoint.param(Endpoint.class, "endpoint");
JBlock geBody = getEndpoint.body();
JTryBlock tryBlock = geBody._try();
JInvocation createProxy = pfVar.invoke("create");
createProxy.arg(JExpr.direct(epVar.name()).invoke("getBinding"));
createProxy.arg(JExpr.direct(epVar.name()).invoke("getUrl"));
tryBlock.body()._return(createProxy);
JCatchBlock catchBlock = tryBlock._catch(model.ref(<API key>.class));
JType xreType = model._ref(<API key>.class);
JInvocation xreThrow = JExpr._new(xreType);
xreThrow.arg("Invalid URL");
xreThrow.arg(catchBlock.param("e"));
catchBlock.body()._throw(xreThrow);
/**
* T getEndpoint(QName)
*/
JMethod getEndpointByName = servCls.method(JMod.PUBLIC, objectType, "getEndpoint");
JVar epname = getEndpointByName.param(QName.class, "name");
geBody = getEndpointByName.body();
// Endpoint endpoint = (Endpoint) service.getEndpoint(name);
JType endpointType = model._ref(Endpoint.class);
JInvocation getEndpointInv = endpointsVar.invoke("get");
getEndpointInv.arg(JExpr.direct(epname.name()));
epVar = geBody.decl(endpointType, "endpoint", JExpr.cast(endpointType, getEndpointInv));
// if (endpoint == null)
JBlock noEPBlock = geBody._if(JExpr.direct(epVar.name()).eq(JExpr._null()))._then();
// throw <API key>
JType iseType = model._ref(<API key>.class);
JInvocation iseThrow = JExpr._new(iseType);
iseThrow.arg("No such endpoint!");
noEPBlock._throw(iseThrow);
// return endpoint
JInvocation geInvoke = JExpr.invoke(getEndpoint);
geInvoke.arg(JExpr.direct(epVar.name()));
geBody._return(geInvoke);
/**
* Collection getEndpoints()
*/
JType collectionType = model.ref(Collection.class);
JMethod getEndpoints = servCls.method(JMod.PUBLIC, collectionType, "getEndpoints");
geBody = getEndpoints.body();
geBody._return(endpointsVar.invoke("values"));
// Create a Service for each Binding
for (int i = 0; i < services.size(); i++)
{
Service service = (Service) services.get(i);
if (service.getEndpoints().size() == 0) continue;
// Add a local binding.
// TODO: We should have a switch for this...
String ptName = service.getServiceInfo().getPortType().getLocalPart();
Soap11Binding localBind = new Soap11Binding(new QName(ns, ptName + "LocalBinding"),
LocalTransport.BINDING_ID,
service);
service.addBinding(localBind);
service.addEndpoint(new QName(ns, ptName + "LocalEndpoint"), localBind, "xfire.local://" + local);
JVar serviceVar = generateService(context, servCls, constructor, service, i);
// Add each endpoint to the Client class
Collection endpoints = service.getEndpoints();
for (Iterator eitr = endpoints.iterator(); eitr.hasNext(); )
{
Endpoint enp = (Endpoint) eitr.next();
generate(context, servCls, service, serviceVar, enp);
}
}
}
protected JVar generateService(GenerationContext context, JDefinedClass servCls,
JMethod constructor, Service service, int number)
{
JCodeModel model = context.getCodeModel();
JVar serviceVar = servCls.field(JMod.PRIVATE, Service.class, "service" + number);
JClass serviceIntf = (JClass) service.getProperty(<API key>.SERVICE_INTERFACE);
/**
* createService()
*/
JMethod create = servCls.method(JMod.PRIVATE, void.class, "create" + number);
JType asfType = model._ref(<API key>.class);
JType jsr181Type = model._ref(<API key>.class);
JType tmType = model._ref(TransportManager.class);
JType abSoapBindingType = model._ref(AbstractSoapBinding.class);
JType qnameType = model._ref(QName.class);
JType soapTransType = model._ref(SoapTransport.class);
JType hashMapType = model._ref(HashMap.class);
JVar tmVar = create.body().decl(tmType, "tm", JExpr.direct("org.codehaus.xfire.XFireFactory.newInstance().getXFire().getTransportManager()"));
JInvocation asfCons = JExpr._new(asfType);
asfCons.arg(JExpr._new(jsr181Type));
asfCons.arg(tmVar);
asfCons.arg(context.getSchemaGenerator().<API key>(context));
JVar propsVar = create.body().decl(hashMapType, "props", JExpr._new(hashMapType));
create.body().add(propsVar.invoke("put").arg("annotations.allow.interface").arg(JExpr.TRUE));
JVar asfVar = create.body().decl(asfType, "asf", asfCons);
JInvocation createInvoke = asfVar.invoke("create");
createInvoke.arg(JExpr.direct(serviceIntf.fullName() + ".class"));
createInvoke.arg(propsVar);
JInvocation bindingCreation = asfVar.invoke("<API key>");
bindingCreation.arg(JExpr.lit(false));
create.body().add(bindingCreation);
JType serviceType = model._ref(Service.class);
create.body().assign(serviceVar, createInvoke);
for (Iterator itr = service.getBindings().iterator(); itr.hasNext();)
{
Binding binding = (Binding) itr.next();
if (!(binding instanceof AbstractSoapBinding)) continue;
AbstractSoapBinding soapBinding = (AbstractSoapBinding) binding;
JBlock block = create.body().block();
JInvocation createBinding;
if (soapBinding instanceof Soap12Binding)
{
createBinding = asfVar.invoke("createSoap12Binding");
}
else
{
createBinding = asfVar.invoke("createSoap11Binding");
}
createBinding.arg(serviceVar);
JInvocation newQN = JExpr._new(qnameType);
newQN.arg(soapBinding.getName().getNamespaceURI());
newQN.arg(soapBinding.getName().getLocalPart());
createBinding.arg(newQN);
createBinding.arg(soapBinding.getBindingId());
JVar sbVar = block.decl(abSoapBindingType, "soapBinding", createBinding);
}
constructor.body().invoke(create);
return serviceVar;
}
protected void generate(GenerationContext context, JDefinedClass servCls,
Service service, JVar serviceVar, Endpoint endpoint)
throws Exception
{
String name = service.getSimpleName();
String ns = service.getTargetNamespace();
JCodeModel model = context.getCodeModel();
/*
* Add endpoints to constructor
*/
JBlock consBody = constructor.body();
JType qnameType = model.ref(QName.class);
JDefinedClass serviceIntf = (JDefinedClass) service.getProperty(<API key>.SERVICE_INTERFACE);
JInvocation addEndpointInv = serviceVar.invoke("addEndpoint");
JInvocation newQN = JExpr._new(qnameType);
newQN.arg(endpoint.getName().getNamespaceURI());
newQN.arg(endpoint.getName().getLocalPart());
JInvocation bindingQN = JExpr._new(qnameType);
bindingQN.arg(endpoint.getBinding().getName().getNamespaceURI());
bindingQN.arg(endpoint.getBinding().getName().getLocalPart());
addEndpointInv.arg(newQN);
addEndpointInv.arg(bindingQN);
addEndpointInv.arg(endpoint.getUrl());
JType endpointType = model.ref(Endpoint.class);
JVar epVar = consBody.decl(endpointType, javify(endpoint.getName().getLocalPart()) + "EP", addEndpointInv);
JInvocation addEndpoint = endpointsVar.invoke("put").arg(newQN).arg(epVar);
consBody.add(addEndpoint);
// Add a <API key>
JMethod getFooEndpoint = servCls.method(JMod.PUBLIC, serviceIntf, "get"
+ javify(endpoint.getName().getLocalPart()));
JBlock geBody = getFooEndpoint.body();
geBody._return(JExpr.cast(serviceIntf, JExpr.direct("this").invoke(getEndpoint).arg(newQN)));
JMethod getFooEndpoint1 = servCls.method(JMod.PUBLIC, serviceIntf, "get"
+ javify(endpoint.getName().getLocalPart()));
getFooEndpoint1.param(String.class,"url");
JBlock geBody1 = getFooEndpoint1.body();
JInvocation getEndp = JExpr.invoke(getFooEndpoint);
JVar tpe = geBody1.decl(serviceIntf, "var", getEndp );
geBody1.directStatement("org.codehaus.xfire.client.Client.getInstance(var).setUrl(url);");
geBody1._return(tpe);
}
} |
#!/bin/bash
set -ex
if [ "$(uname -s)" = "Darwin" ]; then
download_url="https://github.com/koalaman/shellcheck/releases/download/v0.8.0/shellcheck-v0.8.0.darwin.x86_64.tar.xz"
expect_hash="<SHA256-like>"
elif [[ "$(lsb_release -i)" == *"Ubuntu"* ]]; then
download_url="https://github.com/koalaman/shellcheck/releases/download/v0.8.0/shellcheck-v0.8.0.linux.x86_64.tar.xz"
expect_hash="<SHA256-like>"
fi
tmpfile=$(mktemp)
# shellcheck disable=SC2064
trap "rm -rf ${tmpfile}" EXIT
curl -Lo "${tmpfile}" "${download_url}"
actual_hash="$(shasum -a 256 "${tmpfile}" | cut -d' ' -f 1)"
if [[ "$expect_hash" != "$actual_hash" ]]; then
echo "shasum mismatch for shellcheck. Aborting."
exit 1
fi
mkdir -p ~/.shellcheck
tar -C ~/.shellcheck --extract -J -f "${tmpfile}" --strip-components 1 |
<?php
/**
* This is just a proxy to detect if we can use the "fast" Pagination
* or if we use the "safe" variant by Doctrine2.
*/
namespace ZfcDatagrid\DataSource\Doctrine2;
use Doctrine\ORM\QueryBuilder;
use Doctrine\ORM\Tools\Pagination\Paginator as Doctrine2Paginator;
use Zend\Paginator\Adapter\AdapterInterface;
use ZfcDatagrid\DataSource\Doctrine2\PaginatorFast as <API key>;
class Paginator implements AdapterInterface
{
/**
* @var QueryBuilder
*/
protected $qb = null;
/**
* Total item count.
*
* @var int
*/
protected $rowCount = null;
/**
* @var \Doctrine\ORM\Tools\Pagination\Paginator
*/
private $paginator;
/**
* @param QueryBuilder $qb
*/
public function __construct(QueryBuilder $qb)
{
$this->qb = $qb;
}
/**
* @return \Doctrine\ORM\QueryBuilder
*/
public function getQueryBuilder()
{
return $this->qb;
}
/**
* Test which pagination solution to use.
*
* @return bool
*/
private function useCustomPaginator()
{
$qb = $this->getQueryBuilder();
$parts = $qb->getDQLParts();
if ($parts['having'] !== null || true === $parts['distinct']) {
// never tried having in such queries...
return false;
}
// @todo maybe more detection needed :-/
return true;
}
/**
* @return Doctrine2Paginator|<API key>
*/
private function getPaginator()
{
if ($this->paginator !== null) {
return $this->paginator;
}
if ($this->useCustomPaginator() === true) {
$this->paginator = new <API key>($this->getQueryBuilder());
} else {
// Doctrine2Paginator as fallback...they are using 3 queries
$this->paginator = new Doctrine2Paginator($this->getQueryBuilder());
}
return $this->paginator;
}
/**
* Returns an array of items for a page.
*
* @param int $offset
* @param int $itemCountPerPage
*
* @return array
*/
public function getItems($offset, $itemCountPerPage)
{
$paginator = $this->getPaginator();
if ($paginator instanceof Doctrine2Paginator) {
$this->getQueryBuilder()
->setFirstResult($offset)
->setMaxResults($itemCountPerPage);
return $paginator->getIterator()->getArrayCopy();
} else {
return $paginator->getItems($offset, $itemCountPerPage);
}
}
/**
* Returns the total number of rows in the result set.
*
* @return int
*/
public function count()
{
return $this->getPaginator()->count();
}
} |
<!DOCTYPE html>
<html xmlns="http:
<head>
<meta content="text/html; charset=ISO-8859-1" http-equiv="content-type"/>
<title>JA++ Getting Started With A Server</title>
<link href="styles.css" rel="stylesheet" />
</head>
<body onload="init_bar();">
<h1>Getting Started With A JA++ Server</h1>
<hr />
<div id="pagewrap">
<p>This tutorial assumes you're running Windows and are looking at migrating from JA+ to JA++</p>
<hr />
<h2>General</h2>
<p>JA++ is designed as a replacement for JA+, and will mimic many things JA+ does for various reasons.</p>
<p>First off, JA separates mods into separate directories next to <span class="code">GameData/base/</span>, and they are loaded by setting the <span class="code">fs_game</span> cvar.<br />
When a client connects to a server, they will automatically set their <span class="code">fs_game</span> value to the same as the server.<br />
This is how mods are automatically loaded when you join a server.</p>
<p>JA++ makes use of this to make it easier for clients to play on JA++ servers with their existing JA+ installation.<br />
Instead of JA++ having its own mod directory, it stays in <span class="code">GameData/japlus/</span> so JA++ client can be used on JA+ servers, and so JA+ clients can connect to JA++ servers.</p>
<p>JA++ also does some <em>version sniffing</em> to enable/disable some features, so JA++ will mimic JA+ in these cases (e.g. client-side <span class="code">cjp_client</span> cvar or server-side <span class="code">v</span> and <span class="code">gamename</span> cvars.<br />
The way to check your JA++ version is by checking the <span class="code">japp_version</span> cvar.</p>
<h2>Admin System</h2>
<p>One of the drawbacks to JA+'s ingame admin system is the limit of admin <em>accounts</em> (i.e. Council, Knight, Instructor). This does not suit every server.<br />
Instead, JA++ has a user+password account system, with no limit on the amount of accounts.</p>
<p>Each account has its own login message, and privileges.<br />
You can login to an account with <span class="code">amlogin user password</span></p>
<p>Admin users can be added, removed, listed and modified with these server/RCon commands:<br />
<div class="term">adminadd <user> <pass> <privileges> <rank> <login message>
admindel <user>
adminlist
adminreload</div></p>
<p>To work out what privileges value you want, use the <a href="calculator.html">bit-value calculator</a>.<br />
All login data is stored on disk in <span class="code">japlus/admins.json</span> which is a human-readable <a href="https://en.wikipedia.org/wiki/JSON#Data_types.<API key>">JSON</a> file</p>
</div>
<script async src="http://assets.jkhub.org/bar/jkhub_bar.js"></script>
</body>
</html> |
from repreader import RepReader
from operator import itemgetter
from displayer import Displayer
from optparse import OptionParser
import sys
usage = "Usage: %prog -u <USERNAME> -p <PASSWORD> -n <USERNUMBER TO DISPLAY>"
parser = OptionParser(usage)
parser.add_option(
"-u",
"--username",
dest="user",
help="Needs a username to login with",
default=None)
parser.add_option(
"-p",
"--password",
dest="pw",
help="Need the password to login user",
default=None)
parser.add_option(
"-n",
"--number",
dest="usernum",
help="The user number to look up",
type="int",
default=2)
if not len(sys.argv) == 7:
parser.print_help()
sys.exit()
(options, args) = parser.parse_args()
test = RepReader(options.user,options.pw)
display = Displayer()
allrep = sorted(test.receivedrep(options.usernum),key=itemgetter(1),reverse=True)
display.displayAllRep(allrep)
print("\n")
mostrep = test.mostrepped(options.usernum)
display.displayMostRepped(mostrep) |
using AutoRest.Core;
using AutoRest.Core.Utilities;
using System.Linq;
using System.Reflection;
using System.Threading.Tasks;
using Microsoft.CodeAnalysis;
using Xunit;
using Xunit.Abstractions;
using static AutoRest.Core.Utilities.DependencyInjection;
namespace AutoRest.CSharp.Unit.Tests
{
public class ServerCodeSimpleGet : BugTest
{
public ServerCodeSimpleGet(ITestOutputHelper output) : base(output)
{
}
<summary>
Server code that returns a simple model.
</summary>
[Fact]
public async Task <API key>()
{
using (NewContext)
{
MemoryFileSystem fileSystem = <API key>();
var settings = new Settings
{
Modeler = "Swagger",
CodeGenerator = "CSharp",
FileSystem = fileSystem,
OutputDirectory = "GeneratedCode",
Namespace = "Test",
CodeGenerationMode = "rest-server"
};
using (fileSystem = $"{GetType().Name}".GenerateCodeInto(fileSystem, settings))
{
var result = await Compile(fileSystem);
// filter the warnings
var warnings = result.Messages.Where(
each => each.Severity == DiagnosticSeverity.Warning
&& !SuppressWarnings.Contains(each.Id)).ToArray();
// use this to dump the files to disk for examination
// fileSystem.SaveFilesToTemp($"{GetType().Name}");
// filter the errors
var errors = result.Messages.Where(each => each.Severity == DiagnosticSeverity.Error).ToArray();
Write(warnings, fileSystem);
Write(errors, fileSystem);
// use this to write out all the messages, even hidden ones.
// Write(result.Messages, fileSystem);
// Don't proceed unless we have zero Warnings.
Assert.Empty(warnings);
// Don't proceed unless we have zero Errors.
Assert.Empty(errors);
// Load and reflect on the assembly
var asm = Assembly.Load(result.Output.GetBuffer());
Assert.NotNull(asm);
// Verify the server controller
var simpleApi = asm.ExportedTypes.FirstOrDefault(each => each.FullName == "Test.ValueController");
Assert.NotNull(simpleApi);
Assert.NotNull(simpleApi.GetMethod("Get"));
Assert.Equal(simpleApi.GetMethod("Get").ReturnType.Name, "SimpleModel");
Assert.NotEmpty(simpleApi.GetMethod("Get").CustomAttributes.Where(a => a.AttributeType.Name == "HttpGetAttribute"));
// Verify the model
var simpleModel = asm.ExportedTypes.FirstOrDefault(each => each.FullName == "Test.Models.SimpleModel");
Assert.NotNull(simpleModel);
}
}
}
}
} |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title><API key>: 14 s </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.13.1 / <API key> - 1.1.0</a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href="../..">« Up</a>
<h1>
<API key>
<small>
1.1.0
<span class="label label-success">14 s </span>
</small>
</h1>
<p> <em><script>document.write(moment("2022-02-28 11:08:17 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-02-28 11:08:17 UTC)</em><p>
<h2>Context</h2>
<pre># Packages matching: installed
# Name # Installed # Synopsis
base-bigarray base
base-threads base
base-unix base
conf-findutils 1 Virtual package relying on findutils
conf-gmp 4 Virtual package relying on a GMP lib system installation
coq 8.13.1 Formal proof management system
num 1.4 The legacy Num library for arbitrary-precision integer and rational arithmetic
ocaml 4.06.1 The OCaml compiler (virtual package)
ocaml-base-compiler 4.06.1 Official 4.06.1 release
ocaml-config 1 OCaml Switch Configuration
ocamlfind 1.9.3 A library manager for OCaml
zarith 1.12 Implements arithmetic and logical operations over arbitrary-precision integers
# opam file:
opam-version: "2.0"
name: "<API key>"
version: "dev"
maintainer: "Enrico Tassi <enrico.tassi@inria.fr>"
authors: [ "Cyril Cohen" "Kazuhiko Sakaguchi" "Enrico Tassi" ]
license: "MIT"
homepage: "https://github.com/math-comp/hierarchy-builder"
bug-reports: "https://github.com/math-comp/hierarchy-builder/issues"
dev-repo: "git+https://github.com/math-comp/hierarchy-builder"
build: [ make "-C" "shim" "build" ]
install: [ make "-C" "shim" "install" ]
conflicts: [ "<API key>" ]
depends: [ "coq" {>= "8.10"} ]
synopsis: "Shim package for HB"
description: """
This package provide the support constants one can use to compile files
generated by HB.
"""
tags: [ "logpath:HB" ]
url {
src: "https://github.com/math-comp/hierarchy-builder/archive/v1.1.0.tar.gz"
checksum: "sha256=<SHA256-like>"
}
</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 <API key>.1.1.0 coq.8.13.1</code></dd>
<dt>Return code</dt>
<dd>0</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>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Install dependencies</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam list; echo; ulimit -Sv 4000000; timeout 4h opam install -y --deps-only <API key>.1.1.0 coq.8.13.1</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>9 s</dd>
</dl>
<h2>Install </h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam list; echo; ulimit -Sv 16000000; timeout 4h opam install -y -v <API key>.1.1.0 coq.8.13.1</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>14 s</dd>
</dl>
<h2>Installation size</h2>
<p>Total: 18 K</p>
<ul>
<li>16 K <code>../ocaml-base-compiler.4.06.1/lib/coq/user-contrib/HB/structures.vo</code></li>
<li>1 K <code>../ocaml-base-compiler.4.06.1/lib/coq/user-contrib/HB/structures.glob</code></li>
<li>1 K <code>../ocaml-base-compiler.4.06.1/lib/coq/user-contrib/HB/structures.v</code></li>
</ul>
<h2>Uninstall 🧹</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam remove -y <API key>.1.1.0</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> |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>dep-map: 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.13.1 / dep-map - 8.8.0</a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href="../..">« Up</a>
<h1>
dep-map
<small>
8.8.0
<span class="label label-info">Not compatible </span>
</small>
</h1>
<p> <em><script>document.write(moment("2022-02-04 18:52:19 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-02-04 18:52:19 UTC)</em><p>
<h2>Context</h2>
<pre># Packages matching: installed
# Name # Installed # Synopsis
base-bigarray base
base-threads base
base-unix base
conf-findutils 1 Virtual package relying on findutils
conf-gmp 4 Virtual package relying on a GMP lib system installation
coq 8.13.1 Formal proof management system
num 1.4 The legacy Num library for arbitrary-precision integer and rational arithmetic
ocaml 4.07.1 The OCaml compiler (virtual package)
ocaml-base-compiler 4.07.1 Official release 4.07.1
ocaml-config 1 OCaml Switch Configuration
ocamlfind 1.9.3 A library manager for OCaml
zarith 1.12 Implements arithmetic and logical operations over arbitrary-precision integers
# opam file:
opam-version: "2.0"
maintainer: "Hugo.Herbelin@inria.fr"
homepage: "https://github.com/coq-contribs/dep-map"
license: "CeCILL-B"
build: [make "-j%{jobs}%"]
install: [make "install"]
remove: ["rm" "-R" "%{lib}%/coq/user-contrib/DepMap"]
depends: [
"ocaml"
"coq" {>= "8.8" & < "8.9~"}
]
tags: [
"keyword: maps"
"keyword: dependent maps"
"category: Computer Science/Data Types and Data Structures"
]
authors: [ "Lionel Rieg <lionel.rieg@college-de-france.fr>" ]
bug-reports: "https://github.com/coq-contribs/dep-map/issues"
dev-repo: "git+https://github.com/coq-contribs/dep-map.git"
synopsis: "Dependent Maps"
description:
"A rudimentary library for dependent maps that contain their domain in the type."
flags: light-uninstall
url {
src: "https://github.com/coq-contribs/dep-map/archive/v8.8.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-dep-map.8.8.0 coq.8.13.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.13.1).
The following dependencies couldn't be met:
- coq-dep-map -> coq < 8.9~ -> ocaml < 4.06.0
base of this switch (use `--unlock-base' to force)
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-dep-map.8.8.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> |
<!DOCTYPE HTML PUBLIC "-
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc -->
<title>UiTextInterpreter (GWT Javadoc)</title>
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="UiTextInterpreter (GWT Javadoc)";
}
}
catch(err) {
}
var methods = {"i0":10,"i1":10,"i2":10};
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<div class="topNav"><a name="navbar.top">
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/UiTextInterpreter.html">Use</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
<div class="aboutLanguage">GWT 2.8.0-rc1</div>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../com/google/gwt/uibinder/elementparsers/<API key>.html" title="class in com.google.gwt.uibinder.elementparsers"><span class="typeNameLink">Prev Class</span></a></li>
<li><a href="../../../../../com/google/gwt/uibinder/elementparsers/UiTextInterpreter.Delegate.html" title="class in com.google.gwt.uibinder.elementparsers"><span class="typeNameLink">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?com/google/gwt/uibinder/elementparsers/UiTextInterpreter.html" target="_top">Frames</a></li>
<li><a href="UiTextInterpreter.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="<API key>">
<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!
allClassesLink = document.getElementById("<API key>");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary: </li>
<li><a href="#nested.class.summary">Nested</a> | </li>
<li><a href="#field.summary">Field</a> | </li>
<li><a href="#constructor.summary">Constr</a> | </li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li><a href="#field.detail">Field</a> | </li>
<li><a href="#constructor.detail">Constr</a> | </li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.top">
</a></div>
<div class="header">
<div class="subTitle">com.google.gwt.uibinder.elementparsers</div>
<h2 title="Class UiTextInterpreter" class="title">Class UiTextInterpreter</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object</li>
<li>
<ul class="inheritance">
<li>com.google.gwt.uibinder.elementparsers.UiTextInterpreter</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Implemented Interfaces:</dt>
<dd>com.google.gwt.uibinder.rebind.XMLElement.Interpreter<java.lang.String></dd>
</dl>
<dl>
<dt>Direct Known Subclasses:</dt>
<dd><a href="../../../../../com/google/gwt/uibinder/elementparsers/<API key>.html" title="class in com.google.gwt.uibinder.elementparsers"><API key></a></dd>
</dl>
<hr>
<br>
<pre>public class <span class="typeNameLabel">UiTextInterpreter</span>
extends java.lang.Object
implements com.google.gwt.uibinder.rebind.XMLElement.Interpreter<java.lang.String></pre>
<div class="block">Interprets generic message tags like:
<b><ui:text from="{myMsg.message}" /></b>. It's called in both text
and HTML contexts.</div>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<ul class="blockList">
<li class="blockList"><a name="nested.class.summary">
</a>
<h3>Nested Class Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Nested Class Summary table, listing nested classes, and an explanation">
<caption><span>Nested Classes</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Class and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected class </code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../com/google/gwt/uibinder/elementparsers/UiTextInterpreter.Delegate.html" title="class in com.google.gwt.uibinder.elementparsers">UiTextInterpreter.Delegate</a></span></code>
<div class="block">Used in <a href="../../../../../com/google/gwt/uibinder/elementparsers/<API key>.html#<API key>.google.gwt.uibinder.rebind.XMLElement-"><code><API key>.interpretElement(com.google.gwt.uibinder.rebind.XMLElement)</code></a> to invoke the <a href="../../../../../com/google/gwt/uibinder/elementparsers/<API key>.html" title="class in com.google.gwt.uibinder.elementparsers"><code><API key></code></a>.</div>
</td>
</tr>
</table>
</li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="field.summary">
</a>
<h3>Field Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation">
<caption><span>Fields</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Field and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected <a href="../../../../../com/google/gwt/uibinder/elementparsers/<API key>.html" title="class in com.google.gwt.uibinder.elementparsers"><API key></a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../com/google/gwt/uibinder/elementparsers/UiTextInterpreter.html#<API key>"><API key></a></span></code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>protected com.google.gwt.uibinder.rebind.UiBinderWriter</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../com/google/gwt/uibinder/elementparsers/UiTextInterpreter.html#writer">writer</a></span></code> </td>
</tr>
</table>
</li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="constructor.summary">
</a>
<h3>Constructor Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../../../../com/google/gwt/uibinder/elementparsers/UiTextInterpreter.html#<API key>.google.gwt.uibinder.rebind.UiBinderWriter-">UiTextInterpreter</a></span>(com.google.gwt.uibinder.rebind.UiBinderWriter writer)</code> </td>
</tr>
</table>
</li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="method.summary">
</a>
<h3>Method Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd"> </span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd"> </span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd"> </span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code>protected <a href="../../../../../com/google/gwt/uibinder/elementparsers/<API key>.html" title="class in com.google.gwt.uibinder.elementparsers"><API key></a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../com/google/gwt/uibinder/elementparsers/UiTextInterpreter.html#<API key>--"><API key></a></span>()</code> </td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>protected java.lang.String</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../com/google/gwt/uibinder/elementparsers/UiTextInterpreter.html#getLocalName--">getLocalName</a></span>()</code> </td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>java.lang.String</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../com/google/gwt/uibinder/elementparsers/UiTextInterpreter.html#<API key>.google.gwt.uibinder.rebind.XMLElement-">interpretElement</a></span>(com.google.gwt.uibinder.rebind.XMLElement elem)</code>
<div class="block">Given an XMLElement, return its filtered value.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.java.lang.Object">
</a>
<h3>Methods inherited from class java.lang.Object</h3>
<code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<ul class="blockList">
<li class="blockList"><a name="field.detail">
</a>
<h3>Field Detail</h3>
<a name="writer">
</a>
<ul class="blockList">
<li class="blockList">
<h4>writer</h4>
<pre>protected final com.google.gwt.uibinder.rebind.UiBinderWriter writer</pre>
</li>
</ul>
<a name="<API key>">
</a>
<ul class="blockListLast">
<li class="blockList">
<h4><API key></h4>
<pre>protected final <a href="../../../../../com/google/gwt/uibinder/elementparsers/<API key>.html" title="class in com.google.gwt.uibinder.elementparsers"><API key></a> <API key></pre>
</li>
</ul>
</li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="constructor.detail">
</a>
<h3>Constructor Detail</h3>
<a name="<API key>.google.gwt.uibinder.rebind.UiBinderWriter-">
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>UiTextInterpreter</h4>
<pre>public UiTextInterpreter(com.google.gwt.uibinder.rebind.UiBinderWriter writer)</pre>
</li>
</ul>
</li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="method.detail">
</a>
<h3>Method Detail</h3>
<a name="<API key>.google.gwt.uibinder.rebind.XMLElement-">
</a>
<ul class="blockList">
<li class="blockList">
<h4>interpretElement</h4>
<pre>public java.lang.String interpretElement(com.google.gwt.uibinder.rebind.XMLElement elem)
throws <a href="../../../../../com/google/gwt/core/ext/<API key>.html" title="class in com.google.gwt.core.ext"><API key></a></pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from interface: <code>com.google.gwt.uibinder.rebind.XMLElement.Interpreter</code></span></div>
<div class="block">Given an XMLElement, return its filtered value.</div>
<dl>
<dt><span class="<API key>">Specified by:</span></dt>
<dd><code>interpretElement</code> in interface <code>com.google.gwt.uibinder.rebind.XMLElement.Interpreter<java.lang.String></code></dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../../../com/google/gwt/core/ext/<API key>.html" title="class in com.google.gwt.core.ext"><API key></a></code> - on error</dd>
</dl>
</li>
</ul>
<a name="<API key>
</a>
<ul class="blockList">
<li class="blockList">
<h4><API key></h4>
<pre>protected <a href="../../../../../com/google/gwt/uibinder/elementparsers/<API key>.html" title="class in com.google.gwt.uibinder.elementparsers"><API key></a> <API key>()</pre>
</li>
</ul>
<a name="getLocalName
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>getLocalName</h4>
<pre>protected java.lang.String getLocalName()</pre>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<div class="bottomNav"><a name="navbar.bottom">
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/UiTextInterpreter.html">Use</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
<div class="aboutLanguage">GWT 2.8.0-rc1</div>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../com/google/gwt/uibinder/elementparsers/<API key>.html" title="class in com.google.gwt.uibinder.elementparsers"><span class="typeNameLink">Prev Class</span></a></li>
<li><a href="../../../../../com/google/gwt/uibinder/elementparsers/UiTextInterpreter.Delegate.html" title="class in com.google.gwt.uibinder.elementparsers"><span class="typeNameLink">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?com/google/gwt/uibinder/elementparsers/UiTextInterpreter.html" target="_top">Frames</a></li>
<li><a href="UiTextInterpreter.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="<API key>">
<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!
allClassesLink = document.getElementById("<API key>");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary: </li>
<li><a href="#nested.class.summary">Nested</a> | </li>
<li><a href="#field.summary">Field</a> | </li>
<li><a href="#constructor.summary">Constr</a> | </li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li><a href="#field.detail">Field</a> | </li>
<li><a href="#constructor.detail">Constr</a> | </li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.bottom">
</a></div>
</body>
</html> |
<!DOCTYPE html>
<html xmlns:msxsl="urn:<API key>:xslt">
<head>
<meta content="en-us" http-equiv="Content-Language" />
<meta content="text/html; charset=utf-16" http-equiv="Content-Type" />
<title _locid="<API key>">.NET Portability Report</title>
<style>
/* Body style, for the entire document */
body {
background: #F3F3F4;
color: #1E1E1F;
font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
padding: 0;
margin: 0;
}
/* Header1 style, used for the main title */
h1 {
padding: 10px 0px 10px 10px;
font-size: 21pt;
background-color: #E2E2E2;
border-bottom: 1px #C1C1C2 solid;
color: #201F20;
margin: 0;
font-weight: normal;
}
/* Header2 style, used for "Overview" and other sections */
h2 {
font-size: 18pt;
font-weight: normal;
padding: 15px 0 5px 0;
margin: 0;
}
/* Header3 style, used for sub-sections, such as project name */
h3 {
font-weight: normal;
font-size: 15pt;
margin: 0;
padding: 15px 0 5px 0;
background-color: transparent;
}
h4 {
font-weight: normal;
font-size: 12pt;
margin: 0;
padding: 0 0 0 0;
background-color: transparent;
}
/* Color all hyperlinks one color */
a {
color: #1382CE;
}
/* Paragraph text (for longer informational messages) */
p {
font-size: 10pt;
}
/* Table styles */
table {
border-spacing: 0 0;
border-collapse: collapse;
font-size: 10pt;
}
table th {
background: #E7E7E8;
text-align: left;
text-decoration: none;
font-weight: normal;
padding: 3px 6px 3px 6px;
}
table td {
vertical-align: top;
padding: 3px 6px 5px 5px;
margin: 0px;
border: 1px solid #E7E7E8;
background: #F7F7F8;
}
.NoBreakingChanges {
color: darkgreen;
font-weight:bold;
}
.FewBreakingChanges {
color: orange;
font-weight:bold;
}
.ManyBreakingChanges {
color: red;
font-weight:bold;
}
.BreakDetails {
margin-left: 30px;
}
.CompatMessage {
font-style: italic;
font-size: 10pt;
}
.GoodMessage {
color: darkgreen;
}
/* Local link is a style for hyperlinks that link to file:/// content, there are lots so color them as 'normal' text until the user mouse overs */
.localLink {
color: #1E1E1F;
background: #EEEEED;
text-decoration: none;
}
.localLink:hover {
color: #1382CE;
background: #FFFF99;
text-decoration: none;
}
/* Center text, used in the over views cells that contain message level counts */
.textCentered {
text-align: center;
}
/* The message cells in message tables should take up all avaliable space */
.messageCell {
width: 100%;
}
/* Padding around the content after the h1 */
#content {
padding: 0px 12px 12px 12px;
}
/* The overview table expands to width, with a max width of 97% */
#overview table {
width: auto;
max-width: 75%;
}
/* The messages tables are always 97% width */
#messages table {
width: 97%;
}
/* All Icons */
.IconSuccessEncoded, .IconInfoEncoded, .IconWarningEncoded, .IconErrorEncoded {
min-width: 18px;
min-height: 18px;
background-repeat: no-repeat;
background-position: center;
}
/* Success icon encoded */
.IconSuccessEncoded {
/* Note: Do not delete the comment below. It is used to verify the correctness of the encoded image resource below before the product is released */
background-image: url(data:image/png;base64,<API key>/9hAAABPElEQVR4Xp1Tv0vDUBi8FqeA4NpBcBLcWnQSApncOnTo4FSnjP0DsnXpH5CxiwbHDg4Zuj4oOEXiJgiC4FDcCkLWmIMc1Pfw+<API key>/H5+sHpZwYfxyRjTs+<API key>/13u3Fjrs/EdhsdDFHGB/<API key>+m3tVe/t97D52CB/ziG0nIgD/<API key>/<API key>/<API key>+zk7s8czeges//s5C5+CwqrR4/gw+AAAAABJRU5ErkJggg==);
}
/* Information icon encoded */
.IconInfoEncoded {
/* Note: Do not delete the comment below. It is used to verify the correctness of the encoded image resource below before the product is released */
background-image: url(data:image/png;base64,<API key>/<API key>+QvdsXa/QHBbcXC7W0CamWTQnclFutceIQJwwaWNLlwm5k5d94M76mmaeCrrmsLYOocY12FcxZFUeozCqKqqgYA8uevv1H6VuPxcwlfk5N92KHBxfFeCSAxxswlYAW/Xr989x/<API key>/HF1RsMXq+<API key>/<API key>+<API key>/<API key>=);
}
/* Warning icon encoded */
.IconWarningEncoded {
/* Note: Do not delete the comment below. It is used to verify the correctness of the encoded image resource below before the product is released */
background-image: url(data:image/png;base64,<API key>/9hAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAx0lEQVR4XpWSMQ7CMAxFf4xAyBMLCxMrO8dhaBcuwdCJS3RJBw7SA/<API key>+wVDSyyzFoJjfz9NB+pAF+<API key>/<API key>/eW1KvFeH4e8khT6+gm5B+t3juyDt7n0jpe+CANTd+oTUjN/U3yVaABnSUjFz/<API key>==);
}
/* Error icon encoded */
.IconErrorEncoded {
/* Note: Do not delete the comment below. It is used to verify the correctness of the encoded image resource below before the product is released */
background-image: url(data:image/png;base64,<API key>/<API key>/AxEQQT8HF/3G/oGGnEUGuoNnd6qoZuqltyKEsyzVJq5I6rnUp6SjGeGhESikzzlc1eL7opfuVbrqbU1Zw9NCgtQMaZpY0eNnaaL2fHusvTK5vKu7sjSS1Y4y3QUA6K3e3Mau5UFDyMP7tYF9o8cAHZv68vipoIJg971PZIZ5HiwdvYGGvFVFHmGmZ2MxwmQYPXubPl9Up0tfoMQGetXd6mRbvhBw+boZ6WF7Mbv1+<API key>/<API key>/<API key>=);
}
</style>
</head>
<body>
<h1 _locid="PortabilityReport">.NET Portability Report</h1>
<div id="content">
<div id="submissionId" style="font-size:8pt;">
<p>
<i>
Submission Id
<API key>
</i>
</p>
</div>
<h2 _locid="SummaryTitle">
<a name="Portability Summary"></a>Portability Summary
</h2>
<div id="summary">
<table>
<tbody>
<tr>
<th>Assembly</th>
<th>ASP.NET 5,Version=v1.0</th>
<th>Windows,Version=v8.1</th>
<th>.NET Framework,Version=v4.6</th>
<th>Windows Phone,Version=v8.1</th>
</tr>
<tr>
<td><strong><a href="#EnsureThat">EnsureThat</a></strong></td>
<td class="text-center">100.00 %</td>
<td class="text-center">100.00 %</td>
<td class="text-center">100.00 %</td>
<td class="text-center">100.00 %</td>
</tr>
</tbody>
</table>
</div>
<div id="details">
</div>
</div>
</body>
</html> |
<h3 id="structure" class="page-header">
Module Structure <a class="permalink" href="
<small>Cleverstacks's Architecture has been designed to be simple and intiutive to use and extend.</small>
</h3>
<ol class="breadcrumb">
<li><a href="/documentation">Documentation</a></li>
<li><a href="/documentation/backend">Backend</a></li>
<li><a href="/documentation/backend/modules">Modules</a></li>
<li class="active">Module Structure</li>
</ol>
{% highlight bash %}
example-module/
bin/ # module scripts & binaries
classes/ # module classes
config/ # module specific configs and setting overrides
controllers/ # module controllers
exceptions/ # module custom exceptions
models/ # module models
schema/ # your schema is stored in here
seedData.json/ # seed data is used to populate your database tables
services/ # module services
tests/
e2e/ # module end to end tests
unit/ # module unit tests
utils/ # module utils
Gruntfile.js # module grunt tasks
module.js # main module class
package.json # module npm dependencies
routes.js # module routes
{% endhighlight %}<br>
<div style="padding-left: 30px;">
<h4>Important files and folders</h5>
<h5 id="<API key>">config/</h5>
<ul>
<li>Like the applications config folder this module config folder allows you to provide configuration on a per module basis.</li>
<li><a href="#<API key>"><module>/config/default.json</a></li>
<li><a href="#<API key>"><module>/config/global.json</a></li><br>
<li><span class="label label-danger">Important</span> Every module's json config files must contain (if they exist on disk) an object that has all configuration objects nested in an object under one key which needs to be named the same as your <module>.</li>
{% highlight json %}
{
"moduleName": {
"config": "here",
"another": "as well"
}
}
{% endhighlight %}
</ul>
<h5>tests/</h5>
<ul>
<li>Two folders for testing, e2e/ and unit/</li>
<li>This allows each module to define it's own tests for the functionality (code) that is provided within each module.</li>
</ul>
<h5>package.json</h5>
<ul>
<li>Defines the modules basic information including name, version and scripts.</li>
<li>Defines the modules NPM dependencies.</li>
</ul>
<h5>Gruntfile.js</h5>
<ul>
<li>A specially formatted Gruntfile which can be used to modify the applications gruntConfig and register grunt tasks.</li>
</ul>
<h5>module.js</h5>
<ul>
<li>Must export a Module Class which will be imported by the moduleLoader.</li>
</ul>
<div class="bs-callout bs-callout-info">
<h4>Lifecycle Hooks</h4>
<p>Modules have lifecycle <a href="#<API key>">hooks</a> for every situation, like loading, routing, shutdown etc.</p>
</div>
<div class="bs-callout bs-callout-danger">
<h4>File name may change per module</h4>
<p>This presumes you have { "main": "module.js" } in your modules <a href="https://github.com/CleverStack/<API key>/blob/master/package.json#L22">package.json</a>, otherwise it is named what you want OR if not set at all this file will be called index.js. (As per standard NPM Modules)</p>
</div>
<p>Here is an example of a module.js file</p>
{% highlight javascript %}
// Example module.js
var Module = require( 'classes' ).Module;
module.exports = Module.extend({
preSetup: function() {
console.log( 'Hello, this module is about to be setup by the moduleLoader' )
}
});
{% endhighlight %}
<h5>routes.js</h5>
<ul>
<li>This is where you define what routes your module will handle.</li>
</ul>
</div> |
// pion: a Boost C++ framework for building lightweight HTTP interfaces
#ifndef <API key>
#define <API key>
#include <pion/http/plugin_service.hpp>
namespace pion { // begin namespace pion
namespace plugins { // begin namespace plugins
HelloService: web service that responds with "Hello World"
class HelloService :
public pion::http::plugin_service
{
public:
HelloService(void) {}
virtual ~HelloService() {}
virtual void operator()(pion::http::request_ptr& http_request_ptr,
pion::tcp::connection_ptr& tcp_conn);
};
} // end namespace plugins
} // end namespace pion
#endif |
/* eslint-env mocha */
'use strict'
const { expect } = require('interface-ipfs-core/src/utils/mocha')
const platform = require('<API key>')
const f = require('./utils/factory')()
describe('.diag', function () {
this.timeout(50 * 1000)
// go-ipfs does not support these on Windows
if (platform === 'win32') { return }
let ipfs
before(async () => {
ipfs = (await f.spawn()).api
})
after(() => f.clean())
describe('api API', () => {
// Disabled in go-ipfs 0.4.10
it.skip('.diag.net', async () => {
const res = await ipfs.diag.net()
expect(res).to.exist()
})
it('.diag.sys', async () => {
const res = await ipfs.diag.sys()
expect(res).to.exist()
expect(res).to.have.a.property('memory')
expect(res).to.have.a.property('diskinfo')
})
it('.diag.cmds', async () => {
const res = await ipfs.diag.cmds()
expect(res).to.exist()
})
})
}) |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="generator" content="rustdoc">
<meta name="description" content="API documentation for the Rust `FACILITY_SHELL` constant in crate `hresult`.">
<meta name="keywords" content="rust, rustlang, rust-lang, FACILITY_SHELL">
<title>hresult::facility::FACILITY_SHELL - Rust</title>
<link rel="stylesheet" type="text/css" href="../../rustdoc.css">
<link rel="stylesheet" type="text/css" href="../../main.css">
</head>
<body class="rustdoc">
<!--[if lte IE 8]>
<div class="warning">
This old browser is unsupported and will most likely display funky
things.
</div>
<![endif]
<nav class="sidebar">
<p class='location'><a href='../index.html'>hresult</a>::<wbr><a href='index.html'>facility</a></p><script>window.sidebarCurrent = {name: 'FACILITY_SHELL', ty: 'constant', relpath: ''};</script><script defer src="sidebar-items.js"></script>
</nav>
<nav class="sub">
<form class="search-form js-only">
<div class="search-container">
<input class="search-input" name="search"
autocomplete="off"
placeholder="Click or press ‘S’ to search, ‘?’ for more options…"
type="search">
</div>
</form>
</nav>
<section id='main' class="content constant">
<h1 class='fqn'><span class='in-band'><a href='../index.html'>hresult</a>::<wbr><a href='index.html'>facility</a>::<wbr><a class='constant' href=''>FACILITY_SHELL</a></span><span class='out-of-band'><span id='render-detail'>
<a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
[<span class='inner'>−</span>]
</a>
</span><a id='src-73' class='srclink' href='../../src/hresult/src/facility.rs.html#61' title='goto source code'>[src]</a></span></h1>
<pre class='rust const'>pub const FACILITY_SHELL: <a class='struct' href='../../hresult/facility/struct.Facility.html' title='hresult::facility::Facility'>Facility</a><code> = </code><code>Facility(39)</code></pre></section>
<section id='search' class="content hidden"></section>
<section class="footer"></section>
<aside id="help" class="hidden">
<div>
<h1 class="hidden">Help</h1>
<div class="shortcuts">
<h2>Keyboard Shortcuts</h2>
<dl>
<dt>?</dt>
<dd>Show this help dialog</dd>
<dt>S</dt>
<dd>Focus the search field</dd>
<dt>⇤</dt>
<dd>Move up in search results</dd>
<dt>⇥</dt>
<dd>Move down in search results</dd>
<dt>⏎</dt>
<dd>Go to active search result</dd>
<dt>+</dt>
<dd>Collapse/expand all sections</dd>
</dl>
</div>
<div class="infos">
<h2>Search Tricks</h2>
<p>
Prefix searches with a type followed by a colon (e.g.
<code>fn:</code>) to restrict the search to a given type.
</p>
<p>
Accepted types are: <code>fn</code>, <code>mod</code>,
<code>struct</code>, <code>enum</code>,
<code>trait</code>, <code>type</code>, <code>macro</code>,
and <code>const</code>.
</p>
<p>
Search functions by type signature (e.g.
<code>vec -> usize</code> or <code>* -> vec</code>)
</p>
</div>
</div>
</aside>
<script>
window.rootPath = "../../";
window.currentCrate = "hresult";
window.playgroundUrl = "";
</script>
<script src="../../jquery.js"></script>
<script src="../../main.js"></script>
<script defer src="../../search-index.js"></script>
</body>
</html> |
# Change Log
[Full Changelog](https://github.com/jage/elk/compare/v0.6.0...v0.6.1)
**Merged pull requests:**
- Remove deprecated has\_rdoc= from gemspec [\
[Full Changelog](https://github.com/jage/elk/compare/v0.5.1...v0.6.0)
**Implemented enhancements:**
- Ruby 2.3, 2.4 and 2.5 support [\
**Fixed bugs:**
- "undefined method" error with mime-types 3.1 / rest-client 1.6.7 [\
**Closed issues:**
- Changelog [\
[Full Changelog](https://github.com/jage/elk/compare/v0.5.0...v0.5.1)
**Implemented enhancements:**
- Drop Ruby 1.9 support [\
**Fixed bugs:**
- Flashsms argument not working [\
**Merged pull requests:**
- grammarfix [\
[Full Changelog](https://github.com/jage/elk/compare/v0.0.13...v0.5.0)
**Implemented enhancements:**
- Drop multi\_json [\
**Closed issues:**
- Dynamically set username and password [\
**Merged pull requests:**
- Implement Elk::Client [\
[Full Changelog](https://github.com/jage/elk/compare/0.0.12...v0.0.13)
[Full Changelog](https://github.com/jage/elk/compare/0.0.11...0.0.12)
**Merged pull requests:**
- Support for better flashsms. [\
[Full Changelog](https://github.com/jage/elk/compare/0.0.10...0.0.11)
**Closed issues:**
- Not valid gemspec. [\
- Add support for sending to multiple recipients [\
**Merged pull requests:**
- Add support for sending to multiple recipients [\
[Full Changelog](https://github.com/jage/elk/compare/0.0.9...0.0.10)
**Closed issues:**
- Sent/Received attribute to Elk::SMS [\
**Merged pull requests:**
- Add direction & status to Elk::SMS. [\
[Full Changelog](https://github.com/jage/elk/compare/0.0.8...0.0.9)
**Fixed bugs:**
- Breaks rails to\_json [\
**Merged pull requests:**
- Bump multi\_json to 1.5.0 [\
[Full Changelog](https://github.com/jage/elk/compare/v0.0.7...0.0.8)
[Full Changelog](https://github.com/jage/elk/compare/0.0.6...v0.0.7)
[Full Changelog](https://github.com/jage/elk/compare/0.0.5...0.0.6)
[Full Changelog](https://github.com/jage/elk/compare/0.0.4...0.0.5)
[Full Changelog](https://github.com/jage/elk/compare/0.0.3...0.0.4)
\* *This Change Log was automatically generated by [<API key>](https://github.com/skywinder/<API key>)* |
// FishLampDataTypeID.h
// FishLamp
#import "FishLampCore.h"
#import "<API key>.h"
@class FLBase64Data;
@protocol FLStringEncoding <NSObject>
- (NSString*) stringFromObject:(id) object;
- (id) objectFromString:(NSString*) string;
- (NSArray*) encodingKeys;
@end
@interface NSObject (FLEncodingSelectors)
+ (NSString*) stringEncodingKey;
@end
@interface FLStringEncoder : NSObject<FLStringEncoding>
+ (id) stringEncoder;
@end
@interface <API key> : <API key><FLStringEncoding>
+ (id) dateStringEncoder;
@end
@interface FLURLStringEncoder : NSObject<FLStringEncoding>
+ (id) urlStringEncoder;
@end
@interface <API key> : NSNumberFormatter<FLStringEncoding>
+ (id) numberStringEncoder;
@end
@interface <API key> : NSObject<FLStringEncoding>
+ (id) <API key>;
@end
@interface FLBoolStringEncoder : NSObject<FLStringEncoding>
+ (id) boolStringEncoder;
@end
@interface <API key> : NSObject<FLStringEncoding> {
@private
id<FLStringEncoding> _stringEncoder;
}
+ (id) <API key>:(id<FLStringEncoding>) stringEncoder;
@end |
module HypothesisClient
module Helpers
module Text
class Any
attr_accessor :can_match, :error, :text
def initialize(a_content)
@can_match = true
@content = a_content
@text = "#{@content}"
# strip leading and trailing spaces
@text.sub!(/^[\n|\s]+/,'',)
@text.sub!(/^[\n|\s]+$/,'')
end
end
end
end
end |
var http = require('http');
var fs = require('fs')
var url = require('url')
var webpack = require("webpack")
var path = require('path')
build('test.web', function() { // build tests, then...
startTestServer()
})
function startTestServer() {
var port = 8100
var server = http.createServer(function (request, res) {
try {
var requestUrl = url.parse(request.url)
var path = requestUrl.pathname
if(path !== '/favicon.ico') {
console.log("Test request: "+path)
if(path === '/') {
path = '/test.html'
}
res.writeHead(200)
res.write(fs.readFileSync(__dirname+path))
} else {
res.writeHead(400)
}
} catch(e) {
console.log(e.stack)
res.writeHead(400)
} finally {
res.end()
}
})
server.listen(port)
console.log('Test server listening on port '+port)
}
function build(entrypoint, done) {
var webpackConfig = {
context: __dirname,
entry: "./"+entrypoint,
output: {
path: path.join(__dirname, path.dirname(entrypoint)),
filename: path.basename(entrypoint)+".bundle.js",
pathinfo: true // do not use this in production
},
plugins: [
new webpack.optimize.<API key>(/*preferEntry=*/true), // does .. something, and makes the entry chunk smaller (at the cost of making later chunks bigger)
new webpack.optimize.DedupePlugin() // removes duplicate files
],
cache: true,
devtool: "source-map",
watch: false
}
webpack(webpackConfig, function(err, stats) {
if(err) {
console.error(err)
} else {
var jsonStats = stats.toJson();
if(jsonStats.warnings.length > 0)
jsonStats.warnings.forEach(function(w) {
console.log(w)
})
if(jsonStats.errors.length > 0)
jsonStats.errors.forEach(function(e) {
console.error(e)
})
else {
console.error('Completed building bundle!')
done()
}
}
})
} |
<!DOCTYPE html PUBLIC "-
<html xmlns="http:
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.9.1"/>
<title>V8 API Reference Guide for node.js v0.11.9: v8::HeapStatistics Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">V8 API Reference Guide for node.js v0.11.9
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.9.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main Page</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
<li><a href="examples.html"><span>Examples</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="annotated.html"><span>Class List</span></a></li>
<li><a href="classes.html"><span>Class Index</span></a></li>
<li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class Members</span></a></li>
</ul>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="<API key>">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="namespacev8.html">v8</a></li><li class="navelem"><a class="el" href="<API key>.html">HeapStatistics</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> |
<a href="#friends">Friends</a> |
<a href="<API key>.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">v8::HeapStatistics Class Reference</div> </div>
</div><!--header
<div class="contents">
<p><code>#include <<a class="el" href="v8_8h_source.html">v8.h</a>></code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:<API key>"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="<API key>"></a>
size_t </td><td class="memItemRight" valign="bottom"><b>total_heap_size</b> ()</td></tr>
<tr class="separator:<API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key>"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="<API key>"></a>
size_t </td><td class="memItemRight" valign="bottom"><b><API key></b> ()</td></tr>
<tr class="separator:<API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key>"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="<API key>"></a>
size_t </td><td class="memItemRight" valign="bottom"><b>total_physical_size</b> ()</td></tr>
<tr class="separator:<API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key>"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="<API key>"></a>
size_t </td><td class="memItemRight" valign="bottom"><b>used_heap_size</b> ()</td></tr>
<tr class="separator:<API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key>"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="<API key>"></a>
size_t </td><td class="memItemRight" valign="bottom"><b>heap_size_limit</b> ()</td></tr>
<tr class="separator:<API key>"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="friends"></a>
Friends</h2></td></tr>
<tr class="memitem:<API key>"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="<API key>"></a>
class </td><td class="memItemRight" valign="bottom"><b>V8</b></td></tr>
<tr class="separator:<API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key>"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="<API key>"></a>
class </td><td class="memItemRight" valign="bottom"><b>Isolate</b></td></tr>
<tr class="separator:<API key>"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Collection of <a class="el" href="classv8_1_1_v8.html">V8</a> heap information.</p>
<p>Instances of this class can be passed to v8::V8::HeapStatistics to get heap statistics from <a class="el" href="classv8_1_1_v8.html">V8</a>. </p>
</div><hr/>The documentation for this class was generated from the following file:<ul>
<li>deps/v8/include/<a class="el" href="v8_8h_source.html">v8.h</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Tue Aug 11 2015 23:46:15 for V8 API Reference Guide for node.js v0.11.9 by &
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.9.1
</small></address>
</body>
</html> |
<!DOCTYPE html PUBLIC "-
<html xmlns="http:
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>V8 API Reference Guide for node.js v7.8.0: Member List</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">V8 API Reference Guide for node.js v7.8.0
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main Page</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
<li><a href="examples.html"><span>Examples</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="annotated.html"><span>Class List</span></a></li>
<li><a href="classes.html"><span>Class Index</span></a></li>
<li><a href="inherits.html"><span>Class Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class Members</span></a></li>
</ul>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="<API key>">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="namespacev8.html">v8</a></li><li class="navelem"><a class="el" href="<API key>.html">ValueDeserializer</a></li><li class="navelem"><a class="el" href="<API key>.html">Delegate</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">v8::ValueDeserializer::Delegate Member List</div> </div>
</div><!--header
<div class="contents">
<p>This is the complete list of members for <a class="el" href="<API key>.html">v8::ValueDeserializer::Delegate</a>, including all inherited members.</p>
<table class="directory">
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>ReadHostObject</b>(Isolate *isolate) (defined in <a class="el" href="<API key>.html">v8::ValueDeserializer::Delegate</a>)</td><td class="entry"><a class="el" href="<API key>.html">v8::ValueDeserializer::Delegate</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>~Delegate</b>() (defined in <a class="el" href="<API key>.html">v8::ValueDeserializer::Delegate</a>)</td><td class="entry"><a class="el" href="<API key>.html">v8::ValueDeserializer::Delegate</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">virtual</span></td></tr>
</table></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.11
</small></address>
</body>
</html> |
require('babel-core/register')({
presets: ['es2015', 'react']
});
var express = require('express');
var path = require("path");
var bodyParser = require('body-parser');
var React = require('react');
var ReactDOMServer = require('react-dom/server')
var exphbs = require('express-handlebars');
var RRouter = require('react-router');
var morgan = require('morgan');
var jwt = require('jsonwebtoken');
var database = require('./datafunctions/index');
var searchengine = require('./datafunctions/searchengine');
var routes = require('./components/Routes.jsx');
var User = require('./database/user');
var app = express();
app.use(bodyParser.urlencoded({extended: false}));
app.use(bodyParser.json());
app.engine('handlebars', exphbs({defaultLayout: 'main', layoutsDir: './views/layouts/'}));
app.set('view engine', 'handlebars');
app.set('views', __dirname + "/views");
app.use(morgan('dev'));
app.use(express.static('public'));
app.get('/api/getarticles', function(req, res) {
var articles = database.articles.slice(0);
var filtered = articles.filter(function(obj) {
if (obj.EChoice == false) {
return true;
} else {
return false;
}
})
res.json(filtered);
});
app.get('/api/findonearticle', function(req, res) {
database.findonearticlebyid(req.query.query, (article) => {
res.json(article);
});
});
app.get('/api/getauthor', function(req, res) {
database.findUserByID(req.query.query, (author) => {
res.json(author);
})
})
app.get('/api/getaccountarticle', function(req, res) {
database.<API key>(req.query.email, (user) => {
var userarticles = user.articles;
database.<API key>(userarticles, (article) => {
res.json(article);
});
});
});
app.get('/api/increaseViews', function(req, res) {
database.increaseViews(req.query.query);
res.end();
})
app.get('/api/setfname', function(req, res) {
database.savefname(req.query.query.fname, req.query.query.email, (fname) => {
res.json(fname);
});
});
app.get('/api/setlname', function(req, res) {
database.savelname(req.query.query.lname, req.query.query.email, (lname) => {
res.json(lname);
});
});
app.get('/api/setemail', function(req, res) {
database.saveemail(req.query.query.nemail, req.query.query.email, (nemail) => {
res.json(nemail);
});
});
app.get('/api/getArticleViews', function(req, res) {
database.getArticleViews(req.query.query, (ViewArray) => {
res.json(ViewArray);
});
});
app.get('/api/getechoicearticles', function(req, res) {
var echoice = database.articles.slice(0);
var efiltered = echoice.filter(function(obj) {
if (obj.EChoice == true) {
return true;
} else {
return false;
}
});
res.json(efiltered);
});
app.get('/api/<API key>', function(req, res) {
var query = req.query.query;
searchengine.findallarticles(query, (articlecontainer) => {
res.json(articlecontainer);
});
});
app.get('/api/getlatestarticles', function(req, res) {
var data = database.articles.slice(0);
data.sort(function(a, b) {
a = new Date(a.Date);
b = new Date(b.Date);
return b - a;
});
var efiltered = data.filter(function(obj) {
if (obj.EChoice == false) {
return true;
} else {
return false;
}
});
res.json(efiltered);
});
app.get('/api/<API key>', function(req, res) {
var query = req.query.query;
searchengine.findallarticles(query, (articlecontainer) => {
res.json(articlecontainer);
});
});
app.get('/api/<API key>', function(req, res) {
var query = req.query.query;
searchengine.findallarticles(query, (articlecontainer) => {
res.json(articlecontainer);
});
});
app.get('/api/<API key>', function(req, res) {
var query = req.query.query;
searchengine.findallarticles(query, (articlecontainer) => {
var sortarticles = articlecontainer.splice(0);
sortarticles.sort(function(a, b) {
return b.article.Views - a.article.Views;
});
res.json(sortarticles);
});
});
app.get('/api/<API key>', function(req, res) {
var query = req.query.query;
searchengine.findallarticles(query, (articlecontainer) => {
var sortarticles = articlecontainer.splice(0);
sortarticles.sort(function(a, b) {
a = new Date(a.article.Date);
b = new Date(b.article.Date);
return b - a;
});
res.json(sortarticles);
});
});
app.get('/api/checktoken', function(req, res) {
var token = req.query.token;
var decoded = jwt.verify(token, 'secret');
database.checktoken(decoded, (data) => {
res.json(data);
});
});
app.get('*', function(req, res) {
var match = RRouter.match;
var RouterContext = React.createFactory(RRouter.RouterContext);
match({
routes: routes,
location: req.url
}, function(error, redirectLocation, renderProps) {
if (error) {
res.status(500).send(error.message)
} else if (redirectLocation) {
res.redirect(302, redirectLocation.pathname + redirectLocation.search)
} else if (renderProps) {
res.render('index', {
react: ReactDOMServer.renderToString(RouterContext(renderProps))
});
} else {
res.status(404).send('Not found')
}
})
});
app.post('/api/authorise', function(req, res) {
database.authorise(req.body.email, req.body.Password, (user) => {
var data = {
proceed: true,
fname: user.fname,
lname: user.lname,
email: user.email,
profileimage: user.profileimage,
accountID: user.accountID,
isEditor: user.isEditor
};
var token = database.generateToken(user);
res.json({
data: data,
token: token
});
});
});
app.post('/api/setpass', function(req, res) {
database.matchpasswords(req.body.email, req.body.cpassword, req.body.npassword, (bool) => {
console.log(bool);
if (bool === false) {
res.json('false');
} else if (bool === true) {
database.savenewpass(req.body.email, req.body.npassword, () => {
res.json('true');
});
}
});
});
app.post('/api/submitarticle', function(req, res) {
var date = new Date();
var fname = req.body.fname;
var lname = req.body.lname;
var author = fname + ' ' + lname;
var author_lower = fname.toLowerCase() + ' ' + lname.toLowerCase();
database.savenewarticle(req.body.title, req.body.articlebody, req.body["article_tags[]"], req.body["article_keywords[]"], req.body.articleID, req.body.accountID, date, req.body.isEditor, author_lower, author, (articleID) => {
res.json(articleID);
});
});
app.post('/api/<API key>', function(req, res) {
database.updatearticle(req.body, (articleID) => {
res.json(articleID);
});
});
app.post('/api/register', function(req, res) {
var RandomID = Math.random() * 100000000000000000;
database.createhashpassword(req.body.password).then(function(passobject) {
var user1 = new User({
fname: req.body.forename,
lname: req.body.surname,
password: passobject.pass.toString('hex'),
email: req.body.email,
salt: passobject.salt,
AccountID: RandomID,
profileimage: req.body.profileimage
});
database.savenewuser(user1, () => {
var data = {
proceed: true
};
res.json(data);
});
});
});
app.post('/api/imageupdate', function(req, res) {
database.saveprofileimage(req.body['data[img]'], req.body['data[email]'], (image) => {
res.json(image);
});
});
app.post('/api/articleimageupdate', function(req, res) {
database.savearticleImage(req.body['data[img]'], req.body['data[id]'], req.body['data[type]'], (image) => {
console.log(image);
res.json(image);
});
});
app.listen(3000, function() {
console.log("Started listening on port", 3000);
}); |
var utils = require('./test-utils');
var assert = require('chai').assert;
var fs = require('fs');
var Domain = require('../lib/database').Domain;
suite('Search API', function() {
var server;
var context;
var temporaryDatabase;
setup(function() {
temporaryDatabase = utils.<API key>();
context = temporaryDatabase.get();
server = utils.setupServer(context);
});
teardown(function() {
temporaryDatabase.teardown();
temporaryDatabase = undefined;
server.close();
});
function testSearch(path, message, host) {
var setup, callback;
var callbacks = Array.prototype.slice.call(arguments, 3);
if (callbacks.length > 1) {
setup = callbacks[0];
callback = callbacks[1];
} else {
callback = callbacks[0];
}
test('GET ' + path + ' ' + message, function(done) {
if (setup) setup();
var options = {
host: 'localhost',
port: utils.testPort,
path: path,
headers: { Host: host }
};
utils
.get(path, { Host: host })
.next(function(response) {
var normalizedBody = <API key>(response.body);
try {
normalizedBody = JSON.parse(normalizedBody);
} catch(error) {
console.log(normalizedBody);
throw error;
}
callback({
statusCode: response.statusCode,
body: response.body,
normalizedBody: normalizedBody
});
done();
})
.error(function(error) {
done(error);
});
});
}
function <API key>(searchResult) {
return searchResult.replace(/"time-ms":\s*(?:[1-9]\d*|0)([,\}])/, '"time-ms":0$1');
}
suite('with fixture loaded', function() {
setup(function() {
utils.loadDumpFile(context, __dirname + '/fixture/companies/ddl.grn');
utils.loadDumpFile(context, __dirname + '/fixture/companies/configurations.grn');
utils.loadDumpFile(context, __dirname + '/fixture/companies/data.grn');
});
testSearch('/2011-02-01/search?q=Hongo',
'should hit one entry',
'<API key>.localhost',
function(response) {
var expected = { // FIXME
rank: '-text_relevance',
'match-expr': "(label 'Hongo')",
hits: {
found: 1,
start: 0,
hit: [
{ id: 'id3' }
]
},
info: {
rid: '<API key>',
'time-ms': 0, // always 0
'cpu-time-ms': 0
}
};
assert.deepEqual(response.normalizedBody, expected);
}
);
testSearch('/2011-02-01/search?q=Tokyo',
'should hit three entries',
'<API key>.localhost',
function(response) {
var expected = {
rank: '-text_relevance',
'match-expr': "(label 'Tokyo')",
hits: {
found: 3,
start: 0,
hit: [
{ id: 'id1' },
{ id: 'id3' },
{ id: 'id9' }
]
},
info: {
rid: '<API key>',
'time-ms': 0, // always 0
'cpu-time-ms': 0
}
};
assert.deepEqual(response.normalizedBody, expected);
}
);
testSearch('/2011-02-01/search?q=Hongo&' +
'return-fields=address,description,name,age,product,unknown',
'should return field values of result returnable fields ' +
'in the list of return-fields',
'<API key>.localhost',
function(response) {
var expected = { // FIXME
rank: '-text_relevance',
'match-expr': "(label 'Hongo')",
hits: {
found: 1,
start: 0,
hit: [{
id: 'id3',
data: {
address: ['Hongo, Tokyo, Japan'],
description: [''],
name: ['ClearCode Inc.'],
age: [3],
product: ['groonga']
// unknown (missing) field is simply ignored.
}
}]
},
info: {
rid: '<API key>',
'time-ms': 0, // always 0
'cpu-time-ms': 0
}
};
assert.deepEqual(response.normalizedBody, expected);
}
);
testSearch('/2011-02-01/search?q=Hongo&' +
'return-fields=unknown1,unknown2',
'should return blank "data" by return-fields filled by unexisting fields',
'<API key>.localhost',
function(response) {
var expected = { // FIXME
rank: '-text_relevance',
'match-expr': "(label 'Hongo')",
hits: {
found: 1,
start: 0,
hit: [{
id: 'id3',
data: {}
}]
},
info: {
rid: '<API key>',
'time-ms': 0, // always 0
'cpu-time-ms': 0
}
};
assert.deepEqual(response.normalizedBody, expected);
}
);
testSearch('/2011-02-01/search?bq=unknown:\'Foo\'',
'should be 400 error for search query with unexisting field',
'<API key>.localhost',
function(response) {
var expected = {
error: 'info',
rid: '<API key>',
'time-ms': 0,
'cpu-time-ms': 0,
messages: [
{ severity: 'fatal',
code: '<API key>',
message: 'Field \'unknown\' is not defined in the metadata ' +
'for this collection. All fields used in the match ' +
'expression must be defined in the metadata.' }
]
};
assert.deepEqual(response.normalizedBody, expected);
}
);
testSearch('/2011-02-01/search?q=Tokyo&facet=product',
'with facet "domain"',
'<API key>.localhost',
function(response) {
var expected = {
rank: '-text_relevance',
'match-expr': "(label 'Tokyo')",
hits: {
found: 3,
start: 0,
hit: [
{ id: 'id1' },
{ id: 'id3' },
{ id: 'id9' }
]
},
facets: {
product: {
constraints: [
{ value: 'groonga', count: 2 },
{ value: 'tyrant', count: 1 }
]
}
},
info: {
rid: '<API key>',
'time-ms': 0, // always 0
'cpu-time-ms': 0
}
};
assert.deepEqual(response.normalizedBody, expected);
}
);
testSearch('/2011-02-01/search?q=Tokyo&size=2',
'should return two hit entries',
'<API key>.localhost',
function(response) {
var expected = {
rank: '-text_relevance',
'match-expr': "(label 'Tokyo')",
hits: {
found: 3,
start: 0,
hit: [
{ id: 'id1' },
{ id: 'id3' }
]
},
info: {
rid: '<API key>',
'time-ms': 0, // always 0
'cpu-time-ms': 0
}
};
assert.deepEqual(response.normalizedBody, expected);
}
);
testSearch('/2011-02-01/search?q=Tokyo&start=1',
'should return offseted hit result',
'<API key>.localhost',
function(response) {
var expected = {
rank: '-text_relevance',
'match-expr': "(label 'Tokyo')",
hits: {
found: 3,
start: 1,
hit: [
{ id: 'id3' },
{ id: 'id9' }
]
},
info: {
rid: '<API key>',
'time-ms': 0, // always 0
'cpu-time-ms': 0
}
};
assert.deepEqual(response.normalizedBody, expected);
}
);
testSearch('/2011-02-01/search?q=Tokio',
'should not match with any entry',
'<API key>.localhost',
function(response) {
var expected = {
rank: '-text_relevance',
'match-expr': "(label 'Tokio')",
hits: {
found: 0,
start: 0,
hit: [
]
},
info: {
rid: '<API key>',
'time-ms': 0, // always 0
'cpu-time-ms': 0
}
};
assert.deepEqual(response.normalizedBody, expected);
}
);
});
suite('with fixture and synonyms loaded', function() {
setup(function() {
utils.loadDumpFile(context, __dirname + '/fixture/companies/ddl.grn');
utils.loadDumpFile(context, __dirname + '/fixture/companies/configurations.grn');
utils.loadDumpFile(context, __dirname + '/fixture/companies/data.grn');
utils.loadDumpFile(context, __dirname + '/fixture/companies/synonyms.grn');
});
testSearch('/2011-02-01/search?q=Tokio',
'should match with using synonyms',
'<API key>.localhost',
function(response) {
var expected = {
rank: '-text_relevance',
'match-expr': "(label 'Tokio')",
hits: {
found: 3,
start: 0,
hit: [
{ id: 'id1' },
{ id: 'id3' },
{ id: 'id9' }
]
},
info: {
rid: '<API key>',
'time-ms': 0, // always 0
'cpu-time-ms': 0
}
};
assert.deepEqual(response.normalizedBody, expected);
}
);
});
suite('search options', function() {
var domain;
setup(function() {
domain = new Domain({ name: 'people', context: context })
.setId('<API key>').saveSync();
domain.getIndexField('realname').setType('text')
.setResultEnabled(true).saveSync();
domain.getIndexField('nickname').setType('text')
.setResultEnabled(true).saveSync();
domain.getIndexField('type').setType('literal')
.setSearchEnabled(true).setResultEnabled(true)
.saveSync();
domain.getIndexField('job').setType('literal')
.setSearchEnabled(true).setResultEnabled(true)
.saveSync();
domain.getIndexField('age').setType('uint')
.saveSync();
domain.getIndexField('followers').setType('uint')
.saveSync();
domain.loadSync([
{ id: 'id1', realname: 'Jack Sparrow',
nickname: 'Captain',
type: 'human',
job: 'pirate',
age: 40,
followers: 100 },
{ id: 'id2', realname: 'Pumpkin Man',
nickname: 'Jack-o\'-Lantern',
type: 'ghost',
job: 'nothing',
age: 9999,
followers: 0 }
]);
});
testSearch('/2011-02-01/search?q=Jack',
'should match both records',
'<API key>.localhost',
function(response) {
var expected = {
rank: '-text_relevance',
'match-expr': "(label 'Jack')",
hits: {
found: 2,
start: 0,
hit: [
{ id: 'id2' },
{ id: 'id1' }
]
},
info: {
rid: '<API key>',
'time-ms': 0, // always 0
'cpu-time-ms': 0
}
};
assert.deepEqual(response.normalizedBody, expected);
}
);
testSearch('/2011-02-01/search?q=Jack',
'should match only realname, by default search field',
'<API key>.localhost',
function() {
domain.defaultSearchField = 'realname';
},
function(response) {
var expected = {
rank: '-text_relevance',
'match-expr': "(label 'Jack')",
hits: {
found: 1,
start: 0,
hit: [
{ id: 'id1' }
]
},
info: {
rid: '<API key>',
'time-ms': 0, // always 0
'cpu-time-ms': 0
}
};
assert.deepEqual(response.normalizedBody, expected);
}
);
testSearch('/2011-02-01/search?bq=type:\'human\'',
'should return result, for search query about "search" field',
'<API key>.localhost',
function(response) {
var expected = {
rank: '-text_relevance',
'match-expr': "type:'human'",
hits: {
found: 1,
start: 0,
hit: [
{ id: 'id1' }
]
},
info: {
rid: '<API key>',
'time-ms': 0, // always 0
'cpu-time-ms': 0
}
};
assert.deepEqual(response.normalizedBody, expected);
}
);
testSearch('/2011-02-01/search?bq=type:\'human\'',
'should return empty result, for search query about "nosearch" field',
'<API key>.localhost',
function() {
domain.getIndexField('type').setSearchEnabled(false).saveSync();
},
function(response) {
var expected = {
rank: '-text_relevance',
'match-expr': "type:'human'",
hits: {
found: 0,
start: 0,
hit: []
},
info: {
rid: '<API key>',
'time-ms': 0, // always 0
'cpu-time-ms': 0
}
};
assert.deepEqual(response.normalizedBody, expected);
}
);
testSearch('/2011-02-01/search?q=Jack&return-fields=realname,nickname,type,unknown',
'should return only "realname" field, ' +
'and return empty value for "noresult" fields',
'<API key>.localhost',
function() {
domain.getIndexField('nickname').setResultEnabled(false).saveSync();
domain.getIndexField('type').setResultEnabled(false).saveSync();
},
function(response) {
var expected = {
rank: '-text_relevance',
'match-expr': "(label 'Jack')",
hits: {
found: 2,
start: 0,
hit: [
{
id: 'id2',
data: {
// "noresult" field retuened as an empty array
realname: ['Pumpkin Man'],
nickname: [],
type: []
// unknown field is simply ignored.
}
},
{
id: 'id1',
data: {
realname: ['Jack Sparrow'],
nickname: [],
type: []
}
}
]
},
info: {
rid: '<API key>',
'time-ms': 0, // always 0
'cpu-time-ms': 0
}
};
assert.deepEqual(response.normalizedBody, expected);
}
);
testSearch('/2011-02-01/search?q=Jack&facet=realname,nickname,type,unknown',
'should return only "type" field as facet, ' +
'and return blank results for "nofacet" fields',
'<API key>.localhost',
function() {
domain.getIndexField('realname').setFacetEnabled(false).saveSync();
domain.getIndexField('nickname').setFacetEnabled(false).saveSync();
domain.getIndexField('type')
.setResultEnabled(false).setFacetEnabled(true).saveSync();
},
function(response) {
var expected = {
rank: '-text_relevance',
'match-expr': "(label 'Jack')",
hits: {
found: 2,
start: 0,
hit: [
{ id: 'id2' },
{ id: 'id1' }
]
},
facets: {
type: {
constraints: [
{ value: 'ghost', count: 1 },
{ value: 'human', count: 1 }
]
},
// "nofacet" field retuened as an empty hash
realname: {},
nickname: {}
// and, unknown field is simply ignored.
},
info: {
rid: '<API key>',
'time-ms': 0, // always 0
'cpu-time-ms': 0
}
};
assert.deepEqual(response.normalizedBody, expected);
}
);
testSearch('/2011-02-01/search?q=Jack&rank=realname',
'should return results sorted by text field (aschending)',
'<API key>.localhost',
function(response) {
var expected = {
rank: 'realname',
'match-expr': "(label 'Jack')",
hits: {
found: 2,
start: 0,
hit: [
{ id: 'id1' },
{ id: 'id2' }
]
},
info: {
rid: '<API key>',
'time-ms': 0, // always 0
'cpu-time-ms': 0
}
};
assert.deepEqual(response.normalizedBody, expected);
}
);
testSearch('/2011-02-01/search?q=Jack&rank=-realname',
'should return results sorted by text field (descending)',
'<API key>.localhost',
function(response) {
var expected = {
rank: '-realname',
'match-expr': "(label 'Jack')",
hits: {
found: 2,
start: 0,
hit: [
{ id: 'id2' },
{ id: 'id1' }
]
},
info: {
rid: '<API key>',
'time-ms': 0, // always 0
'cpu-time-ms': 0
}
};
assert.deepEqual(response.normalizedBody, expected);
}
);
testSearch('/2011-02-01/search?q=Jack&rank=followers',
'should return results sorted by uint field (aschending)',
'<API key>.localhost',
function(response) {
var expected = {
rank: 'followers',
'match-expr': "(label 'Jack')",
hits: {
found: 2,
start: 0,
hit: [
{ id: 'id2' },
{ id: 'id1' }
]
},
info: {
rid: '<API key>',
'time-ms': 0, // always 0
'cpu-time-ms': 0
}
};
assert.deepEqual(response.normalizedBody, expected);
}
);
testSearch('/2011-02-01/search?q=Jack&rank=-followers',
'should return results sorted by uint field (descending)',
'<API key>.localhost',
function(response) {
var expected = {
rank: '-followers',
'match-expr': "(label 'Jack')",
hits: {
found: 2,
start: 0,
hit: [
{ id: 'id1' },
{ id: 'id2' }
]
},
info: {
rid: '<API key>',
'time-ms': 0, // always 0
'cpu-time-ms': 0
}
};
assert.deepEqual(response.normalizedBody, expected);
}
);
testSearch('/2011-02-01/search?q=Jack&rank=job',
'should return results sorted by literal field (aschending)',
'<API key>.localhost',
function(response) {
var expected = {
rank: 'job',
'match-expr': "(label 'Jack')",
hits: {
found: 2,
start: 0,
hit: [
{ id: 'id2' },
{ id: 'id1' }
]
},
info: {
rid: '<API key>',
'time-ms': 0, // always 0
'cpu-time-ms': 0
}
};
assert.deepEqual(response.normalizedBody, expected);
}
);
testSearch('/2011-02-01/search?q=Jack&rank=-job',
'should return results sorted by literal field (descending)',
'<API key>.localhost',
function(response) {
var expected = {
rank: '-job',
'match-expr': "(label 'Jack')",
hits: {
found: 2,
start: 0,
hit: [
{ id: 'id1' },
{ id: 'id2' }
]
},
info: {
rid: '<API key>',
'time-ms': 0, // always 0
'cpu-time-ms': 0
}
};
assert.deepEqual(response.normalizedBody, expected);
}
);
});
}); |
import {AbstractObject} from "./_abstract_object";
export class SAPScriptStyle extends AbstractObject {
public getType(): string {
return "STYL";
}
public getAllowedNaming() {
return {
maxLength: 30,
allowNamespace: true,
};
}
public getDescription(): string | undefined {
// todo
return undefined;
}
} |
* MOCK framework for Moai
* Copyright (C) 2012 Tommo Zhou(tommo.zhou@gmail.com). All rights reserved.
*
* 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.
]]
require 'mock.asset.ParticleHelper'
local mt1={__newindex=function(t,k,v)
assert(type(v)=='function')
rawset(t,k,function(...) setfenv(v,getfenv(2)) return v(...) end)
end
}
local proc=setmetatable({p=setmetatable({},mt1),sp=setmetatable({},mt1)},mt1)
local setfenv,getfenv=setfenv,getfenv
local math=math
function proc.p.moveAlong(ax,ay)
p.x=p.x+p.dx
p.y=p.y+p.dy
if ax then p.dx=p.dx+ax end
if ay then p.dy=p.dy+ay end
end
function proc.p.slowDown(rate)
p.dx=p.dx*rate
p.dy=p.dy*rate
end
function proc.p.moveBack()
p.x=p.x-p.dx
p.y=p.y-p.dy
end
function proc.p.shake(v)
p.x=p.x+rand(0-v,v)
p.y=p.y+rand(0-v,v)
end
function proc.p.moveWave()
p.x=p.x+p.dy*20
p.y=p.y+p.dx*10
end
function proc.sp.simple()
end
function proc.sp.align( offset )
sp.rot = vecAngle(p.dy,p.dx)
if offset then
sp.rot = sp.rot + offset
end
end
function proc.sp.transform(option)
if option.x then sp.x=sp.x+option.x end
if option.y then sp.y=sp.x+option.y end
if option.sx then sp.sx=sp.sx*option.sx end
if option.sy then sp.sy=sp.sy*option.sy end
end
function proc.sp.fadeout()
sp.opacity=ease(1,0,EaseType.EASE_OUT)
end
function proc.sp.turn(v,offset)
sp.rot=offset and time*v+offset or time*v
end
function proc.sp.color(r,g,b,a)
if r then sp.r=r end
if g then sp.g=g end
if b then sp.b=b end
if a then sp.opacity = a end
end
local hexcolor = hexcolor
function proc.sp.hexcolor( h, a )
assert( type(h) == 'string' )
local r,g,b = hexcolor( h )
sp.r = r
sp.g = g
sp.b = b
if a then sp.opacity = a end
end
function proc.sp.tweenColor(c1,c2,easetype)
local r, g, b, a = c1[1] or 1, c1[2] or 1, c1[3] or 1, c1[4] or 1
local r1, g1, b1, a1 = c2[1], c2[2], c2[3], c2[4]
easetype = easetype or EaseType.EASE_OUT
if r1 then sp.r=ease(r,r1,easetype) end
if g1 then sp.g=ease(g,g1,easetype) end
if b1 then sp.b=ease(b,b1,easetype) end
if a1 then sp.opacity=ease(a,a1,easetype) end
end
function proc.sp.spin(radius,speed,offset)
now=time*(speed/180*math.pi)+(offset or 0)
sp.x=p.x+cos(now)*radius
sp.y=p.y+sin(now)*radius
sp.rot=now*(180/math.pi)
end
function proc.wave(freq,min,max)
min=min or 0
max=max or 1
freq=freq or 1
if freq==1 then
return sin(time*3.141593)*(max-min)+min
else
return ((sin(time*3.141593*freq/2)*0.5+0.5)*(max-min)+min)
end
end
function proc.sp.flipbook( from, to, fps )
fps = fps or 30
sp.idx = wrap( age * fps, from, to )
end
<API key>('proc',proc) |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title></title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]
<link href="../../assets/css/vendor/morris.css" rel="stylesheet">
<link href="../../assets/css/vendor/bootstrap-3.0.0-wip.css" rel="stylesheet">
<link href="../../assets/css/vendor/font-awesome.css" rel="stylesheet">
<link href="../../assets/css/vendor/font-awesome-ie7.css" rel="stylesheet">
<link href="../../assets/css/vendor/codemirror.css" rel="stylesheet">
<link href="../../assets/css/plato.css" rel="stylesheet">
<link href="../../assets/css/plato-file.css" rel="stylesheet">
</head>
<body>
<div class="navbar navbar-fixed-top">
<div class="container">
<a class="brand" href="http://github.com/jsoverson/plato">Plato on Github</a>
<ul class="nav">
<li>
<a href="../../index.html">Report Home</a>
</li>
</ul>
</div>
</div>
<div class="jumbotron">
<div class="container">
<h1>lib/commands/frame.js</h1>
</div>
</div>
<div class="container aggregate-stats">
<div class="row">
<div class="span6">
<h2 class="header">Maintainability <a href="http://blogs.msdn.com/b/codeanalysis/archive/2007/11/20/<API key>.aspx"><i class="icon icon-info-sign" rel="popover" data-placement="top" data-trigger="hover" data-content="A value between 0 and 100 that represents the relative ease of maintaining the code. A high value means better maintainability." data-original-title="Maintainability Index"></i></a></h2>
<p class="stat">66.60</p>
</div>
<div class="span6">
<h2 class="header">Lines of code <i class="icon icon-info-sign" rel="popover" data-placement="top" data-trigger="hover" data-content="Source Lines of Code / Logical Lines of Code" data-original-title="SLOC/LSLOC"></i></h2>
<p class="stat">31</p>
</div>
</div>
<div class="row historical">
<div class="span6">
<p id="<API key>" class="chart"></p>
</div>
<div class="span6">
<p id="<API key>" class="chart"></p>
</div>
</div>
<div class="row">
<div class="span6">
<h2 class="header">Difficulty <a href="http://en.wikipedia.org/wiki/<API key>"><i class="icon icon-info-sign" rel="popover" data-placement="top" data-trigger="hover" data-content="The difficulty measure is related to the difficulty of the program to write or understand." data-original-title="Difficulty"></i></a></h2>
<p class="stat">10.50</p>
</div>
<div class="span6">
<h2 class="header">Estimated Errors <a href="http://en.wikipedia.org/wiki/<API key>"><i class="icon icon-info-sign" rel="popover" data-placement="top" data-trigger="hover" data-content="Halstead's delivered bugs is an estimate for the number of errors in the implementation." data-original-title="Delivered Bugs"></i></a></h2>
<p class="stat">0.13</p>
</div>
</div>
</div>
<div class="container charts">
<div class="row">
<h2 class="header">Function weight</h2>
</div>
<div class="row">
<div class="span6">
<h3 class="chart-header">By Complexity <a href="http://en.wikipedia.org/wiki/<API key>"><i class="icon icon-info-sign" rel="popover" data-placement="top" data-trigger="hover" data-content="This metric counts the number of distinct paths through a block of code. Lower values are better." data-original-title="Cyclomatic Complexity"></i></a></h3>
<div id="fn-by-complexity" class="stat"></div>
</div>
<div class="span6">
<h3 class="chart-header">By SLOC <i class="icon icon-info-sign" rel="popover" data-placement="top" data-trigger="hover" data-content="Source Lines of Code / Logical Lines of Code" data-original-title="SLOC/LSLOC"></i></h3>
<div id="fn-by-sloc" class="stat"></div>
</div>
</div>
</div>
<div class="container">
<div class="row">
/**
* Frame execution related Webdriver endpoints
*
* @param {Dalek.Internal.Webdriver} Driver Webdriver client instance
* @return {Dalek.Internal.Webdriver} Driver Webdriver client instance
*/
module.exports = function (Driver) {
'use strict';
Driver.addCommand({
name: 'frame',
url: '/session/:sessionId/frame',
method: 'POST',
params: ['id'],
onRequest: function (elementRaw) {
var id = null;
try {
var element = JSON.parse(elementRaw.id);
id = (element.value && element.value.ELEMENT) ? element.value : null;
} catch (e) {
id = null;
}
return {id: id};
}
});
};</textarea>
</div>
</div>
<footer class="footer">
<div class="container">
<p>.</p>
</div>
</footer>
<script type="text/html" id="<API key>">
<div class="complexity-notice">
Complexity : {{ complexity.cyclomatic }} <br>
Length : {{ complexity.halstead.length }} <br>
Difficulty : {{ complexity.halstead.difficulty.toFixed(2) }} <br>
Est # bugs : {{ complexity.halstead.bugs.toFixed(2) }}<br>
</div>
</script>
<script type="text/javascript" src="../../assets/scripts/bundles/core-bundle.js"></script>
<script type="text/javascript" src="../../assets/scripts/bundles/codemirror.js"></script>
<script type="text/javascript" src="../../assets/scripts/codemirror.markpopovertext.js"></script>
<script type="text/javascript" src="report.js"></script>
<script type="text/javascript" src="report.history.js"></script>
<script type="text/javascript" src="../../assets/scripts/plato-file.js"></script>
</body>
</html> |
define(['router/index'], function(Router){
function User(data){
for (var k in data) {
this[k] = data[k];
}
}
User.prototype.showPath = function(path){
return Router.generate('users/' + this.id);
};
User.prototype.editPath = function(path){
return Router.generate('users/' + this.id + '/edit');
};
User.prototype.projectsPath = function(path){
return Router.generate('users/' + this.id + '/projects');
};
User.all = function(){
return users;
};
User.find = function(id){
for (var i = 0, _len = users.length; i < _len; i++) {
if (users[i].id.toString() === id.toString()) return users[i];
}
return null;
};
var users = [];
var fixtures = [
{
id: 1,
name: 'Jon Doe',
email: 'jon@doe.com',
address: 'random address',
cv: 'Integer posuere erat a ante venenatis dapibus posuere velit aliquet. Donec id elit non mi porta gravida at eget metus.',
projects: [1, 2]
},
{
id: 2,
name: 'Jane',
email: 'jane@doe.com',
address: '404',
cv: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed posuere consectetur est at lobortis.',
projects: []
}
];
for (var i = 0, _len = fixtures.length; i < _len; i++) {
users.push(new User(fixtures[i]));
}
return User;
}); |
<?php
/**
* postModel
*/
class postNewsModel extends appModel
{
private $sysRoot;
private $dbh;
private $id;
private $postData;
function __construct($s, $i)
{
$this->sysRoot = $s;
$this->id = $i;
$this->postData = $_POST;
$this->dbh = $this->connectDB();
}
function run() {
$checkNewsId = 'select max(news_id) as id from news;';
$results = $this->fetch($this->dbh, $checkNewsId, array());
$id = $results[0]['id'];
if($id != null) {
// news
$id += 1;
}
else {
$id = 1;
}
$updir = $this->sysRoot . '/public' . NEWS_IMAGE_PATH;
$imageName = array();
for($i = 0; $i < $this->postData['images']; $i++) {
// the class to get the filename extension
//$info = new SplFileInfo($_FILES['image1']['name']);
//for php5.2
$path_parts = pathinfo($_FILES['image' . (string)((int)$i + 1)]['name']);
// split for php5.2
$imageName[$i] = '';
//$imageName[$i] .= $year;
//$imageName[$i] .= '-';
$imageName[$i] .= $id;
$imageName[$i] .= '-';
$imageName[$i] .= (string)((int)$i + 1);
// 2016/04/25 extensioncross domain
//$imageName[$i] .= '.';
//$imageName[$i] .= $path_parts['extension'];
// define the image name according to its news_id.
//$imageName[$i] = $year . '-' . $id . '-' . ((int)$i + 1) . '.' . $info->getExtension();
// public/news_images/save
//move_uploaded_file($_FILES['image' . (string)((int)$i + 1)]['tmp_name'], $updir . $imageName[$i]);
// update the image using ftp
$this->ftpUpload($_FILES['image' . (string)((int)$i + 1)]['tmp_name'], $imageName[$i]);
}
//$sql = 'insert into news(news_id, title, content, author, created, images, image_src1, image_src2, image_alt1, image_alt2) values(:news_id, :title, :content, :author, :created, :images, :image_src1, :image_src2, :image_alt1, :image_alt2)';
$sql = 'insert into news(news_id, title, content, author, created) values(:news_id, :title, :content, :author, :created)';
$values = array(
':news_id'=> $id,
':title'=> $this->postData['title'],
':content'=> $this->postData['content'],
':author'=> $this->postData['author'],
':created'=> $this->postData['created']
);
/*
$values = array(
':news_id'=> $id,
':title'=> $this->postData['title'],
':content'=> $this->postData['content'],
':author'=> $this->postData['author'],
'created'=> $this->postData['created'],
':images'=> $this->postData['images'],
':image_src1'=> isset($imageName[0]) == true ? $imageName[0] : '',
':image_src2'=> isset($imageName[1]) == true ? $imageName[1] : '',
':image_alt1'=> $this->postData['image_alt1'],
':image_alt2'=> $this->postData['image_alt2']
);
*/
if($this->postData['images'] != 0) {
$imageSql = '';
// 1database
if($this->postData['images'] >= 1) {
$imageSql = 'insert into images(news_id, image_src, image_alt) values';
}
// placeholderSQL
for($i = 0; $i < $this->postData['images']; $i++) {
if(0 < $i) {
$imageSql .= ', ';
}
$imageSql .= '(:news_id, :image_src' . $i . ', :image_alt' . $i . ')';
}
$imageValues = array(':news_id'=> $id);
// databind
for($i = 0; $i < $this->postData['images']; $i++) {
$imageValues['image_src' . $i] = isset($imageName[$i]) == true ? $imageName[$i] : '';
$imageValues['image_alt' . $i] = $this->postData['image_alt' . ($i + 1)];
}
}
else {
$result2 = true;
}
// 2insert
$result1 = $this->insert($this->dbh, $sql, $values);
if($this->postData['images'] != 0) {
$result2 = $this->insert($this->dbh, $imageSql, $imageValues);
}
$result = $result1 && $result2;
return array('result'=> $result);
}
} |
FROM robbertkl/base
MAINTAINER Robbert Klarenbeek <robbertkl@renbeek.nl>
# Install services
RUN cleaninstall \
cron \
rsyslog
# Install s6-overlay
RUN VERSION=`latestversion just-containers/s6-overlay` \
&& curl -sSL "https://github.com/just-containers/s6-overlay/releases/download/v${VERSION}/s6-overlay-amd64.tar.gz" \
| tar xzf - -C /
RUN sed -i "s/s6-nuke -th/s6-nuke -t/" /etc/s6/init/init-stage3
# Copy own stuff
COPY bin /usr/bin
COPY etc /etc
# Configure services
RUN touch /var/log/messages \
&& chmod 600 /etc/crontab \
&& rm -f /etc/cron.daily/apt /etc/cron.daily/dpkg /etc/cron.daily/passwd
# Run s6 service supervisor (not as entrypoint!)
CMD [ "/init" ] |
import FileField from 'ember-uploader/components/file-field';
import Uploader from 'ember-uploader/uploaders/uploader';
import { computed } from '@ember/object';
import { inject as service } from '@ember/service';
import { isEmpty } from '@ember/utils';
import readableFileSize from 'ilios/utils/readable-file-size';
import { task, timeout } from 'ember-concurrency';
const <API key> = 3;
let IliosUploader = Uploader.extend({
iliosHeaders: null,
ajaxSettings: computed('iliosHeaders.[]', function() {
return {
headers: this.iliosHeaders
};
})
});
export default FileField.extend({
iliosConfig: service(),
intl: service(),
session: service(),
url: '',
headers: computed('session.isAuthenticated', function() {
const session = this.session;
const { jwt } = session.data.authenticated;
let headers = {};
if (jwt) {
headers['X-JWT-Authorization'] = `Token ${jwt}`;
}
return headers;
}),
filesDidChange(files) {
if (isEmpty(files)) {
return;
}
const file = files[0];
const iliosConfig = this.iliosConfig;
iliosConfig.get('maxUploadSize').then(maxUploadSize => {
if (file.size > maxUploadSize) {
const intl = this.intl;
const maxSize = readableFileSize(maxUploadSize);
this.setErrorMessage(intl.t('general.fileSizeError', {maxSize}));
} else {
this.startUploading();
const uploadUrl = this.url;
const uploader = IliosUploader.create({
url: uploadUrl,
iliosHeaders: this.headers
});
uploader.on('didUpload', (e) => {
this.finishedUploading(e);
});
uploader.on('progress', (e) => {
this.setUploadPercentage(e.percent);
});
return this.upload.perform(uploader, file, 0);
}
});
},
upload: task(function* (uploader, file, attempt) {
try {
let data = yield uploader.upload(file);
return data;
} catch (error) {
this.setUploadPercentage(0);
yield timeout(attempt * 1000);
if (attempt < <API key>) {
this.upload.perform(uploader, file, attempt+1);
} else {
const intl = this.intl;
throw new Error(intl.t('general.fileUploadError'));
}
}
}).restartable()
}); |
[tangle](https://github.com/tanglejs/tangle) is a set of tools
for building web applications.
`module` implements the `module` subcommand for
[tangle](https://github.com/tanglejs/tangle). |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using LiveToLift.Data;
using LiveToLift.Web.Infrastructure.Models;
using LiveToLift.Models;
using AutoMapper.QueryableExtensions;
namespace LiveToLift.Services
{
public class ExerciseService : CommonService, IExerciseService
{
public ExerciseService(IUowData data) : base(data)
{
}
public List<ExerciseVeiwModel> GetExerciseByName(string name, int skip = 0, int take = 10)
{
List<ExerciseVeiwModel> exercise = this.data.Exercises.All().Where(e => e.Name.Contains(name)).OrderBy(e => e.CreatedOn).Skip(skip).Take(take)
.Project().To<ExerciseVeiwModel>().ToList();
return exercise;
}
public List<<API key>> <API key>(int exerciseId)
{
List<<API key>> exInstances = this.data.ExerciseInstances.All().Where(e => e.ExerciseId == exerciseId)
.Project().To<<API key>>().ToList();
return exInstances;
}
}
} |
require 'spec_helper'
describe 'NbaStats' do
describe 'client' do
client = NbaStats::Client.new
describe '.player_career_stats' do
player_career_stats = client.player_career_stats(201609)
it 'should return a player_career_stats resource' do
expect(player_career_stats).to be_a NbaStats::Resources::PlayerCareerStats
end
it 'should be named player_career_stats' do
expect(player_career_stats.name).to eq 'playercareerstats'
end
NbaStats::Resources::PlayerCareerStats::VALID_RESULT_SETS.each do |valid_result_set|
describe ".#{valid_result_set}" do
it 'should return an Array' do
expect(player_career_stats.send(valid_result_set)).to be_a Array
end
end
end
it 'should return the same player id as requested' do
expect(player_career_stats.<API key>[0][:player_id]).to eq 201609
end
end # .player_career_stats
end # client
end |
package com.iotake.suller.sullerj.binder.value;
import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkNotNull;
import java.lang.reflect.Field;
public abstract class <API key> implements
<API key> {
protected static final class Anything {
private Anything() {
}
};
private Class<?> targetRequiredType;
public <API key>(Class<?> targetRequiredType) {
checkNotNull(targetRequiredType, "Target required type cannot be null.");
this.targetRequiredType = targetRequiredType;
}
public ValueConverter create(Class<?> targetType, Class<?> documentClass,
Field field, String path, String slotNameSeparator) {
checkNotNull(targetType, "Target type cannot be null.");
checkNotNull(documentClass, "Document class cannot be null.");
checkNotNull(field, "Field cannot be null.");
checkNotNull(path, "Path cannot be null.");
checkNotNull(slotNameSeparator, "Slot name separator cannot be null.");
checkArgument(
targetRequiredType == Anything.class
|| targetRequiredType.isAssignableFrom(targetType),
"Target type "
+ targetType.getName()
+ " must be "
+ targetRequiredType.getName()
+ " or an extending subclass class or or implementing interface of "
+ targetRequiredType.getName() + ".");
return doCreate(targetType, documentClass, field, path, slotNameSeparator);
}
protected abstract ValueConverter doCreate(Class<?> targetType,
Class<?> documentClass, Field field, String slotName,
String slotNameSeparator);
} |
class Ey::Core::Client
class Real
def <API key>(params = {})
id = params.delete("id")
request(
:method => :put,
:path => "/<API key>/
:body => { "auto_scaling_policy" => params.fetch("auto_scaling_policy") },
)
end
end
class Mock
def <API key>(params = {})
resource_id = params.delete("id")
now = Time.now
resource = find(:<API key>, resource_id)
.merge(params["auto_scaling_policy"])
.merge("updated_at" => now)
resource.merge!(params)
request = {
"id" => self.uuid,
"type" => "<API key>",
"successful" => true,
"created_at" => now - 5,
"updated_at" => now,
"started_at" => now - 3,
"finished_at" => now,
"message" => nil,
"read_channel" => nil,
"resource" => [:<API key>, resource_id, resource],
"resource_url" => url_for("/<API key>/#{resource_id}")
}
self.data[:requests][request["id"]] = request
response(
body: { "request" => request },
status: 200
)
end
end
end |
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include "guicommon.h"
#include "<API key>.h"
#include "measurementplotview.h"
#include "pwmoutputplotview.h"
namespace Ui {
class MainWindow;
}
class QLabel;
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
signals:
void shouldOpenInterface(QString path);
void <API key>(double gateTime);
void <API key>(unsigned int numPeriods, bool withPhase);
void <API key>(Edge edgeA, Edge edgeB);
void <API key>(unsigned int periods);
void <API key>(MeasurementOptions opts);
void <API key>(AllDgenOptions options);
public slots:
void onInstrumentIsAlive();
private slots:
void <API key>(InstrumentInfo info);
void <API key>(QString text);
void <API key>();
void <API key>(double frequency, double frequencyError, double period, double periodError);
void <API key>(double channelAFrequency, double channelAPeriod, double interval, double phase);
void <API key>(double frequency, double frequencyError, double period, double periodError, double duty);
void <API key>(double freqRatio, double freqRatioError);
void <API key>();
void <API key>(QAction* action);
void <API key>(AllDgenOptions options);
void <API key>();
void <API key>(bool checked);
void <API key>(bool checked);
void <API key>(bool checked);
void <API key>(bool checked);
void <API key>();
void <API key>(double arg1);
void <API key>(int value);
void <API key>(int value);
void <API key>(int value);
void <API key>(bool checked);
void <API key>(bool checked);
void <API key>(double arg1);
void <API key>();
void <API key>();
void <API key>(bool checked);
void <API key>(int index);
void <API key>();
void <API key>(int index);
void <API key>(bool checked);
void <API key>();
void <API key>();
void <API key>(int index);
void <API key>();
void <API key>();
void <API key>(int index);
void <API key>();
void <API key>();
private:
double <API key>();
int <API key>();
void afterMeasurement();
void fade(QLabel* label);
void unfade(QLabel* label, const QString& text);
void <API key>();
void onOptionsUpdated();
void <API key>(bool enabled);
void <API key>(double frequency, double frequencyError, double period, double periodError, double duty);
void <API key>();
void <API key>(double channelAFrequency, double channelAPeriod, double interval, double phase);
void <API key>(double freqRatio, double freqRatioError);
void <API key>();
void <API key>(double freq);
void statusString(QString text);
void <API key>();
void loadIpm(QString boardName);
void loadOptions(QString fileName);
void saveOptions(QString fileName);
void updatePwm1();
void updatePwm2();
Ui::MainWindow *ui;
<API key> ipm;
QHash<QString, QString> options;
<API key>* <API key>;
QThread* <API key>;
bool <API key> = false;
int f_cpu = -1;
PwmOutputPlotView pwmOutputPlotView;
std::unique_ptr<MeasurementPlotView> measurementPlotView;
Parameter<AllDgenOptions> dgen;
AllDgenOptions dgenActual;
};
#endif // MAINWINDOW_H |
#!/usr/bin/env bash
curl --socks5 127.0.01:9050 http://checkip.amazonaws.com/
(echo authenticate '"rentonggeji"'; echo signal newnym; echo quit) | nc localhost 9051
sleep 3
curl --socks5 127.0.01:9050 http://checkip.amazonaws.com/ |
'use strict';
var express = require('express');
var bodyParser = require('body-parser');
var cookieParser = require('cookie-parser');
var stylus = require('stylus');
var nib = require('nib');
var config = require('./server/config.json');
var Logger = require('./server/common/Logger');
var app = express();
var server = require('http').Server(app);
var io = require('socket.io')(server);
var logger = new Logger();
app.set('port', process.env.PORT || config.app.dev.port);
app.set('views', __dirname + '/client/views');
app.set('view engine', 'jade');
function compile(str, path) {
return stylus(str)
.set('filename', path)
.use(nib());
}
app.use(cookieParser());
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: false }));
app.use(express.static(__dirname + '/client/public'));
app.use(stylus.middleware({ src: __dirname + '/client/public/css',
compile: compile
}));
server.listen(app.get('port'), function () {
logger.info('Express server listening on port: ' + app.get('port'));
});
require('./server/routes/public')(app);
require('./server/routes/private')(app);
require('./server/routes/odata')(app);
require('./server/routes/socket')(io);
app.use(function (req, res) {
res.send(404);
}); |
/**
* Customize the displayed name of a useState, useReducer or useRef hook
* in the devtools panel.
*
* @param value Wrapped native hook.
* @param name Custom name
*/
export function addHookName<T>(value: T, name: string): T; |
import { guidFor, OWNER } from 'ember-utils';
import { Cache, assert, warn, runInDebug, isFeatureEnabled } from 'ember-metal';
import {
lookupPartial,
hasPartial,
lookupComponent,
STYLE_WARNING
} from 'ember-views';
import {
Environment as GlimmerEnvironment,
AttributeManager,
isSafeString,
compileLayout,
getDynamicVar
} from 'glimmer-runtime';
import {
<API key>,
<API key>
} from './syntax/curly-component';
import { findSyntaxBuilder } from './syntax';
import { <API key> } from './syntax/dynamic-component';
import createIterable from './utils/iterable';
import {
<API key>,
<API key>,
<API key>
} from './utils/references';
import DebugStack from './utils/debug-stack';
import {
inlineIf,
inlineUnless
} from './helpers/if-unless';
import { <API key> } from './utils/bindings';
import { default as action } from './helpers/action';
import { default as componentHelper } from './helpers/component';
import { default as concat } from './helpers/concat';
import { default as debuggerHelper } from './helpers/debugger';
import { default as get } from './helpers/get';
import { default as hash } from './helpers/hash';
import { default as loc } from './helpers/loc';
import { default as log } from './helpers/log';
import { default as mut } from './helpers/mut';
import { default as readonly } from './helpers/readonly';
import { default as unbound } from './helpers/unbound';
import { default as classHelper } from './helpers/-class';
import { default as inputTypeHelper } from './helpers/-input-type';
import { default as queryParams } from './helpers/query-param';
import { default as eachIn } from './helpers/each-in';
import { default as <API key> } from './helpers/-normalize-class';
import { default as htmlSafeHelper } from './helpers/-html-safe';
import <API key> from './protocol-for-url';
import { FACTORY_FOR } from 'container';
const builtInComponents = {
textarea: '-text-area'
};
import { default as <API key> } from './modifiers/action';
export default class Environment extends GlimmerEnvironment {
static create(options) {
return new Environment(options);
}
constructor({ [OWNER]: owner }) {
super(...arguments);
this.owner = owner;
this.isInteractive = owner.lookup('-environment:main').isInteractive;
this.destroyedComponents = undefined;
<API key>(this);
this._definitionCache = new Cache(2000, ({ name, source, owner }) => {
let { component: componentFactory, layout } = lookupComponent(owner, name, { source });
if (componentFactory || layout) {
return new <API key>(name, componentFactory, layout);
}
}, ({ name, source, owner }) => {
let expandedName = source && owner.<API key>(name, source) || name;
let ownerGuid = guidFor(owner);
return ownerGuid + '|' + expandedName;
});
this._templateCache = new Cache(1000, ({ Template, owner }) => {
if (Template.create) {
// we received a factory
return Template.create({ env: this, [OWNER]: owner });
} else {
// we were provided an instance already
return Template;
}
}, ({ Template, owner }) => guidFor(owner) + '|' + Template.id);
this._compilerCache = new Cache(10, Compiler => {
return new Cache(2000, (template) => {
let compilable = new Compiler(template);
return compileLayout(compilable, this);
}, (template)=> {
let owner = template.meta.owner;
return guidFor(owner) + '|' + template.id;
});
}, Compiler => Compiler.id);
this.builtInModifiers = {
action: new <API key>()
};
this.builtInHelpers = {
if: inlineIf,
action,
component: componentHelper,
concat,
debugger: debuggerHelper,
get,
hash,
loc,
log,
mut,
'query-params': queryParams,
readonly,
unbound,
unless: inlineUnless,
'-class': classHelper,
'-each-in': eachIn,
'-input-type': inputTypeHelper,
'-normalize-class': <API key>,
'-html-safe': htmlSafeHelper,
'-get-dynamic-var': getDynamicVar
};
runInDebug(() => this.debugStack = new DebugStack());
}
// Hello future traveler, welcome to the world of syntax refinement.
// The method below is called by Glimmer's runtime compiler to allow
// us to take generic statement syntax and refine it to more meaniful
// syntax for Ember's use case. This on the fly switch-a-roo sounds fine
// and dandy, however Ember has precedence on statement refinement that you
// need to be aware of. The presendence for language constructs is as follows:
// Native & Built-in Syntax
// User-land components
// User-land helpers
// The one caveat here is that Ember also allows for dashed references that are
// not a component or helper:
// export default Component.extend({
// 'foo-bar': 'LAME'
// {{foo-bar}}
// The heuristic for the above situation is a dashed "key" in inline form
// that does not resolve to a defintion. In this case refine statement simply
// isn't going to return any syntax and the Glimmer engine knows how to handle
// this case.
refineStatement(statement, symbolTable) {
let nativeSyntax = super.refineStatement(statement, symbolTable);
if (nativeSyntax) {
return nativeSyntax;
}
let {
appendType,
isSimple,
isInline,
isBlock,
isModifier,
key,
path,
args
} = statement;
assert(`You attempted to overwrite the built-in helper "${key}" which is not allowed. Please rename the helper.`, !(this.builtInHelpers[key] && this.owner.hasRegistration(`helper:${key}`)));
if (isSimple && (isInline || isBlock) && appendType !== 'get') {
// 2. built-in syntax
let RefinedSyntax = findSyntaxBuilder(key);
if (RefinedSyntax) {
return RefinedSyntax.create(this, args, symbolTable);
}
let internalKey = builtInComponents[key];
let definition = null;
if (internalKey) {
definition = this.<API key>([internalKey], symbolTable);
} else if (key.indexOf('-') >= 0) {
definition = this.<API key>(path, symbolTable);
}
if (definition) {
<API key>(args);
return new <API key>(args, definition, symbolTable);
}
assert(`A component or helper named "${key}" could not be found`, !isBlock || this.hasHelper(path, symbolTable));
}
if (isInline && !isSimple && appendType !== 'helper') {
return statement.original.deopt();
}
if (!isSimple && path) {
return <API key>.fromPath(this, path, args, symbolTable);
}
assert(`Helpers may not be used in the block form, for example {{#${key}}}{{/${key}}}. Please use a component, or alternatively use the helper in combination with a built-in Ember helper, for example {{#if (${key})}}{{/if}}.`, !isBlock || !this.hasHelper(path, symbolTable));
assert(`Helpers may not be used in the element form.`, (() => {
if (nativeSyntax) { return true; }
if (!key) { return true; }
if (isModifier && !this.hasModifier(path, symbolTable) && this.hasHelper(path, symbolTable)) {
return false;
}
return true;
})());
}
<API key>() {
return false;
}
<API key>(path, symbolTable) {
let name = path[0];
let blockMeta = symbolTable.getMeta();
let owner = blockMeta.owner;
let source = blockMeta.moduleName && `template:${blockMeta.moduleName}`;
return this._definitionCache.get({ name, source, owner });
}
// normally templates should be exported at the proper module name
// and cached in the container, but this cache supports templates
// that have been set directly on the component's layout property
getTemplate(Template, owner) {
return this._templateCache.get({ Template, owner });
}
// a Compiler can wrap the template so it needs its own cache
getCompiledBlock(Compiler, template) {
let compilerCache = this._compilerCache.get(Compiler);
return compilerCache.get(template);
}
hasPartial(name, symbolTable) {
let { owner } = symbolTable.getMeta();
return hasPartial(name, owner);
}
lookupPartial(name, symbolTable) {
let { owner } = symbolTable.getMeta();
let partial = {
template: lookupPartial(name, owner)
};
if (partial.template) {
return partial;
} else {
throw new Error(`${name} is not a partial`);
}
}
hasHelper(nameParts, symbolTable) {
assert('The first argument passed into `hasHelper` should be an array', Array.isArray(nameParts));
// helpers are not allowed to include a dot in their invocation
if (nameParts.length > 1) {
return false;
}
let name = nameParts[0];
if (this.builtInHelpers[name]) {
return true;
}
let blockMeta = symbolTable.getMeta();
let owner = blockMeta.owner;
let options = { source: `template:${blockMeta.moduleName}` };
return owner.hasRegistration(`helper:${name}`, options) ||
owner.hasRegistration(`helper:${name}`);
}
lookupHelper(nameParts, symbolTable) {
assert('The first argument passed into `lookupHelper` should be an array', Array.isArray(nameParts));
let name = nameParts[0];
let helper = this.builtInHelpers[name];
if (helper) {
return helper;
}
let blockMeta = symbolTable.getMeta();
let owner = blockMeta.owner;
let options = blockMeta.moduleName && { source: `template:${blockMeta.moduleName}` } || {};
if (isFeatureEnabled('ember-factory-for')) {
let helperFactory = owner[FACTORY_FOR](`helper:${name}`, options) || owner[FACTORY_FOR](`helper:${name}`);
// TODO: try to unify this into a consistent protocol to avoid wasteful closure allocations
if (helperFactory.class.isHelperInstance) {
return (vm, args) => <API key>.create(helperFactory.class.compute, args);
} else if (helperFactory.class.isHelperFactory) {
if (!isFeatureEnabled('<API key>')) {
helperFactory = helperFactory.create();
}
return (vm, args) => <API key>.create(helperFactory, vm, args);
} else {
throw new Error(`${nameParts} is not a helper`);
}
} else {
let helperFactory = owner.lookup(`helper:${name}`, options) || owner.lookup(`helper:${name}`);
// TODO: try to unify this into a consistent protocol to avoid wasteful closure allocations
if (helperFactory.isHelperInstance) {
return (vm, args) => <API key>.create(helperFactory.compute, args);
} else if (helperFactory.isHelperFactory) {
return (vm, args) => <API key>.create(helperFactory, vm, args);
} else {
throw new Error(`${nameParts} is not a helper`);
}
}
}
hasModifier(nameParts) {
assert('The first argument passed into `hasModifier` should be an array', Array.isArray(nameParts));
// modifiers are not allowed to include a dot in their invocation
if (nameParts.length > 1) {
return false;
}
return !!this.builtInModifiers[nameParts[0]];
}
lookupModifier(nameParts) {
assert('The first argument passed into `lookupModifier` should be an array', Array.isArray(nameParts));
let modifier = this.builtInModifiers[nameParts[0]];
if (modifier) {
return modifier;
} else {
throw new Error(`${nameParts} is not a modifier`);
}
}
<API key>(reference) {
return <API key>.create(reference);
}
iterableFor(ref, args) {
let keyPath = args.named.get('key').value();
return createIterable(ref, keyPath);
}
<API key>() {
if (this.isInteractive) {
super.<API key>(...arguments);
}
}
<API key>() {
if (this.isInteractive) {
super.<API key>(...arguments);
}
}
didDestroy(destroyable) {
destroyable.destroy();
}
begin() {
this.inTransaction = true;
super.begin();
this.destroyedComponents = [];
}
commit() {
// components queued for destruction must be destroyed before firing
// `didCreate` to prevent errors when removing and adding a component
// with the same name (would throw an error when added to view registry)
for (let i = 0; i < this.destroyedComponents.length; i++) {
this.destroyedComponents[i].destroy();
}
super.commit();
this.inTransaction = false;
}
}
runInDebug(() => {
class <API key> extends AttributeManager {
setAttribute(dom, element, value) {
warn(STYLE_WARNING, (() => {
if (value === null || value === undefined || isSafeString(value)) {
return true;
}
return false;
})(), { id: 'ember-htmlbars.style-xss-warning' });
super.setAttribute(...arguments);
}
updateAttribute(dom, element, value) {
warn(STYLE_WARNING, (() => {
if (value === null || value === undefined || isSafeString(value)) {
return true;
}
return false;
})(), { id: 'ember-htmlbars.style-xss-warning' });
super.updateAttribute(...arguments);
}
}
let <API key> = new <API key>('style');
Environment.prototype.attributeFor = function(element, attribute, isTrusting, namespace) {
if (attribute === 'style' && !isTrusting) {
return <API key>;
}
return GlimmerEnvironment.prototype.attributeFor.call(this, element, attribute, isTrusting);
};
}); |
require 'test_helper'
require 'lotus/action/request'
describe Lotus::Action::Request do
def build_request(attributes = {})
url = 'http://example.com/foo?q=bar'
env = Rack::MockRequest.env_for(url, attributes)
Lotus::Action::Request.new(env)
end
describe '#body' do
it 'exposes the raw body of the request' do
body = build_request(input: 'This is the body').body
content = body.read
content.must_equal('This is the body')
end
end
describe '#script_name' do
it 'gets the script name of a mounted app' do
build_request(script_name: '/app').script_name.must_equal('/app')
end
end
describe '#path_info' do
it 'gets the requested path' do
build_request.path_info.must_equal('/foo')
end
end
describe '#request_method' do
it 'gets the request method' do
build_request.request_method.must_equal('GET')
end
end
describe '#query_string' do
it 'gets the raw query string' do
build_request.query_string.must_equal('q=bar')
end
end
describe '#content_length' do
it 'gets the length of the body' do
build_request(input: '123').content_length.must_equal('3')
end
end
describe '#scheme' do
it 'gets the request scheme' do
build_request.scheme.must_equal('http')
end
end
describe '#ssl?' do
it 'answers if ssl is used' do
build_request.ssl?.must_equal false
end
end
describe '#host_with_port' do
it 'gets host and port' do
build_request.host_with_port.must_equal('example.com:80')
end
end
describe '#port' do
it 'gets the port' do
build_request.port.must_equal(80)
end
end
describe '#host' do
it 'gets the host' do
build_request.host.must_equal('example.com')
end
end
describe 'request method boolean methods' do
it 'answers correctly' do
request = build_request
%i(delete? head? options? patch? post? put? trace?).each do |method|
request.send(method).must_equal(false)
end
request.get?.must_equal(true)
end
end
describe '#referer' do
it 'gets the HTTP_REFERER' do
request = build_request('HTTP_REFERER' => 'http://host.com/path')
request.referer.must_equal('http://host.com/path')
end
end
describe '#user_agent' do
it 'gets the value of HTTP_USER_AGENT' do
request = build_request('HTTP_USER_AGENT' => 'Chrome')
request.user_agent.must_equal('Chrome')
end
end
describe '#base_url' do
it 'gets the base url' do
build_request.base_url.must_equal('http://example.com')
end
end
describe '#url' do
it 'gets the full request url' do
build_request.url.must_equal('http://example.com/foo?q=bar')
end
end
describe '#path' do
it 'gets the request path' do
build_request.path.must_equal('/foo')
end
end
describe '#fuilpath' do
it 'gets the path and query' do
build_request.fullpath.must_equal('/foo?q=bar')
end
end
describe '#accept_encoding' do
it 'gets the value and quality of accepted encodings' do
request = build_request('<API key>' => 'gzip, deflate;q=0.6')
request.accept_encoding.must_equal([['gzip', 1], ['deflate', 0.6]])
end
end
describe '#accept_language' do
it 'gets the value and quality of accepted languages' do
request = build_request('<API key>' => 'da, en;q=0.6')
request.accept_language.must_equal([['da', 1], ['en', 0.6]])
end
end
describe '#ip' do
it 'gets the request ip' do
request = build_request('REMOTE_ADDR' => '123.123.123.123')
request.ip.must_equal('123.123.123.123')
end
end
describe 'request methods that are implemented elsewhere' do
it 'should reject with a NotImplementedError' do
methods = %i(
content_type
session
cookies
params
update_param
delete_param
[]
[]=
values_at
)
request = Lotus::Action::Request.new({})
methods.each do |method|
proc { request.send(method) }.must_raise(NotImplementedError)
end
end
end
end |
Author(s):
* Mike Conley <mconley@mozilla.com> |
<?php
namespace Metrique\Building\Repositories\Contracts;
interface <API key>
{
public function hook($pointer);
} |
describe "stack_memory_file" do
moneta_build do
tempdir = self.tempdir
Moneta.build do
use(:Stack) do
add { adapter :Memory }
add { adapter :File, dir: File.join(tempdir, "stack_memory_file") }
end
end
end
moneta_specs ADAPTER_SPECS.returnsame
end |
using System;
using NUnit.Framework;
namespace HermaFx.DataAnnotations
{
[TestFixture]
public class <API key>
{
private class DateModel : ModelBase<<API key>>
{
public DateTime? Value1 { get; set; }
[GreaterThan("Value1")]
public DateTime? Value2 { get; set; }
}
private class <API key> : ModelBase<<API key>>
{
public DateTime? Value1 { get; set; }
[GreaterThan("Value1", PassOnNull = true)]
public DateTime? Value2 { get; set; }
}
private class Int16Model : ModelBase<<API key>>
{
public Int16 Value1 { get; set; }
[GreaterThan("Value1")]
public Int16 Value2 { get; set; }
}
[Test]
public void DateIsValid()
{
var model = new DateModel() { Value1 = DateTime.Now, Value2 = DateTime.Now.AddDays(1) };
Assert.IsTrue(model.IsValid("Value2"));
}
[Test]
public void DateIsNotValid()
{
var model = new DateModel() { Value1 = DateTime.Now, Value2 = DateTime.Now.AddDays(-1) };
Assert.IsFalse(model.IsValid("Value2"));
}
[Test]
public void <API key>()
{
var model = new DateModel() { };
Assert.IsFalse(model.IsValid("Value2"));
}
[Test]
public void <API key>()
{
var model = new DateModel() { Value2 = DateTime.Now };
Assert.IsFalse(model.IsValid("Value2"));
}
[Test]
public void <API key>()
{
var model = new DateModel() { Value1 = DateTime.Now };
Assert.IsFalse(model.IsValid("Value2"));
}
[Test]
public void <API key>()
{
var model = new <API key>() { Value2 = DateTime.Now };
Assert.IsTrue(model.IsValid("Value2"));
}
[Test]
public void <API key>()
{
var model = new <API key>() { Value1 = DateTime.Now };
Assert.IsTrue(model.IsValid("Value2"));
}
[Test]
public void Int16IsValid()
{
var model = new Int16Model() { Value1 = 12, Value2 = 120 };
Assert.IsTrue(model.IsValid("Value2"));
}
[Test]
public void Int16IsNotValid()
{
var model = new Int16Model() { Value1 = 120, Value2 = 12 };
Assert.IsFalse(model.IsValid("Value2"));
}
}
} |
#import <iWorkImport/GQDTGroupingCell.h>
@interface GQDTGroupingCell (Private)
- (int)readAttributes:(struct _xmlTextReader *)arg1;
- (void)setProcessorBundle:(struct __CFBundle *)arg1;
- (int)readRootFormat:(struct _xmlTextReader *)arg1;
- (int)readElement:(struct _xmlTextReader *)arg1;
- (int)readValue:(struct _xmlTextReader *)arg1;
@end |
# this just exports all the keys to forward them from GLFW to the user.
KEY_ESC = GLFW.KEY_ESC
export KEY_ESC |
var Sequelize = require('sequelize');
module.exports = function(url) {
return new Sequelize(url, {
native: true,
dialect: "postgres"
});
} |
<?php
namespace Damedia\<API key>\Form\Type;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\OptionsResolver\<API key>;
use Doctrine\ORM\EntityRepository;
class NewsSelectType extends AbstractType {
private $pageId;
public function __construct($pageId) {
$this->pageId = $pageId;
}
public function getParent() {
return 'entity';
}
public function getName() {
return '<API key>';
}
public function setDefaultOptions(<API key> $resolver) {
$pageId = $this->pageId;
$resolver->setDefaults(array(
'attr' => array('class' => 'chzn-select <API key>'),
'multiple' => true,
'class' => 'Armd\NewsBundle\Entity\News',
'query_builder' => function(EntityRepository $er) use ($pageId) {
return $er->createQueryBuilder('g')
->innerJoin('g.projects', 'p')
->where('p.id = :id')
->setParameter('id', $pageId);
}));
}
}
?> |
<?
include("../admin/function/db.php");
include("payments_settings.php");
if($_POST)
{
try
{
$api_key=$site_mollie_account;
include "../admin/plugins/mollie/examples/initialize.php";
$payment = $mollie->payments->get($_POST["id"]);
$order_id = $payment->metadata->order_id;
if ($payment->isPaid() == TRUE)
{
$mass=explode("-",$order_id);
$product_type=$mass[0];
$id=(int)$mass[1];
$transaction_id=transaction_add("mollie","",result($product_type),$id);
if($product_type=="credits")
{
credits_approve($id,$transaction_id);
send_notification('credits_to_user',$id);
send_notification('credits_to_admin',$id);
}
if($product_type=="subscription")
{
<API key>($id);
send_notification('<API key>',$id);
send_notification('<API key>',$id);
}
if($product_type=="order")
{
order_approve($id);
commission_add($id);
coupons_add(order_user($id));
send_notification('neworder_to_user',$id);
send_notification('neworder_to_admin',$id);
}
}
}
catch (<API key> $e)
{
echo "API call failed: " . htmlspecialchars($e->getMessage());
}
}
$db->close();
?> |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>pi-agm: 3 m 3 s </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 / pi-agm - 1.2.1</a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href="../..">« Up</a>
<h1>
pi-agm
<small>
1.2.1
<span class="label label-success">3 m 3 s </span>
</small>
</h1>
<p> <em><script>document.write(moment("2021-12-05 19:37:45 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2021-12-05 19:37:45 UTC)</em><p>
<h2>Context</h2>
<pre># Packages matching: installed
# Name # Installed # Synopsis
base-bigarray base
base-num base Num library distributed with the OCaml compiler
base-threads base
base-unix base
camlp5 7.14 <API key> of OCaml
conf-findutils 1 Virtual package relying on findutils
conf-perl 1 Virtual package relying on perl
coq 8.7.1 Formal proof management system
num 0 The Num library for arbitrary-precision integer and rational arithmetic
ocaml 4.03.0 The OCaml compiler (virtual package)
ocaml-base-compiler 4.03.0 Official 4.03.0 release
ocaml-config 1 OCaml Switch Configuration
ocamlfind 1.9.1 A library manager for OCaml
# opam file:
opam-version: "2.0"
maintainer: "yves.bertot@inria.fr"
homepage: "http://www-sop.inria.fr/members/Yves.Bertot/"
bug-reports: "yves.bertot@inria.fr"
license: "CeCILL-B"
build: [["coq_makefile" "-f" "_CoqProject" "-o" "Makefile" ]
[ make "-j" "%{jobs}%" ]]
install: [ make "install" "DEST='%{lib}%/coq/user-contrib/pi_agm'" ]
depends: [
"ocaml"
"coq" {>= "8.7" & < "8.8~"}
"coq-coquelicot" {>= "3" & < "4~"}
"coq-flocq" {< "3"}
"coq-interval" {>= "3.1"}
]
tags: [ "keyword:real analysis" "keyword:pi" "category:Mathematics/Real Calculus and Topology" ]
authors: [ "Yves Bertot <yves.bertot@inria.fr>" ]
synopsis:
"Computing thousands or millions of digits of PI with <API key> means"
description: """
This is a proof of correctness for two algorithms to compute PI to high
precision using <API key> means. A first file contains
the calculus-based proofs for an abstract view of the algorithm, where all
numbers are real numbers. A second file describes how to approximate all
computations using large integers. Other files describe the second algorithm
which is close to the one used in mpfr, for instance.
The whole development can be used to produce mathematically proved and
formally verified approximations of PI."""
url {
src: "https://github.com/ybertot/pi-agm/archive/v1.1.10.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-pi-agm.1.2.1 coq.8.7.1</code></dd>
<dt>Return code</dt>
<dd>0</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>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Install dependencies</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam list; echo; ulimit -Sv 4000000; timeout 4h opam install -y --deps-only coq-pi-agm.1.2.1 coq.8.7.1</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>14 m 13 s</dd>
</dl>
<h2>Install </h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam list; echo; ulimit -Sv 16000000; timeout 4h opam install -y -v coq-pi-agm.1.2.1 coq.8.7.1</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>3 m 3 s</dd>
</dl>
<h2>Installation size</h2>
<p>Total: 5 M</p>
<ul>
<li>853 K <code>../ocaml-base-compiler.4.03.0/lib/coq/user-contrib/agm/rounding_correct.glob</code></li>
<li>627 K <code>../ocaml-base-compiler.4.03.0/lib/coq/user-contrib/agm/agmpi.glob</code></li>
<li>519 K <code>../ocaml-base-compiler.4.03.0/lib/coq/user-contrib/agm/agmpi.vo</code></li>
<li>502 K <code>../ocaml-base-compiler.4.03.0/lib/coq/user-contrib/agm/rounding_correct.vo</code></li>
<li>403 K <code>../ocaml-base-compiler.4.03.0/lib/coq/user-contrib/agm/rounding2.glob</code></li>
<li>300 K <code>../ocaml-base-compiler.4.03.0/lib/coq/user-contrib/agm/rounding2.vo</code></li>
<li>229 K <code>../ocaml-base-compiler.4.03.0/lib/coq/user-contrib/agm/elliptic_integral.glob</code></li>
<li>218 K <code>../ocaml-base-compiler.4.03.0/lib/coq/user-contrib/agm/alg2.vo</code></li>
<li>199 K <code>../ocaml-base-compiler.4.03.0/lib/coq/user-contrib/agm/elliptic_integral.vo</code></li>
<li>195 K <code>../ocaml-base-compiler.4.03.0/lib/coq/user-contrib/agm/generalities.vo</code></li>
<li>183 K <code>../ocaml-base-compiler.4.03.0/lib/coq/user-contrib/agm/alg2.glob</code></li>
<li>168 K <code>../ocaml-base-compiler.4.03.0/lib/coq/user-contrib/agm/filter_Rlt.vo</code></li>
<li>149 K <code>../ocaml-base-compiler.4.03.0/lib/coq/user-contrib/agm/generalities.glob</code></li>
<li>109 K <code>../ocaml-base-compiler.4.03.0/lib/coq/user-contrib/agm/rounding_correct.v</code></li>
<li>104 K <code>../ocaml-base-compiler.4.03.0/lib/coq/user-contrib/agm/filter_Rlt.glob</code></li>
<li>90 K <code>../ocaml-base-compiler.4.03.0/lib/coq/user-contrib/agm/agmpi.v</code></li>
<li>81 K <code>../ocaml-base-compiler.4.03.0/lib/coq/user-contrib/agm/<API key>.vo</code></li>
<li>76 K <code>../ocaml-base-compiler.4.03.0/lib/coq/user-contrib/agm/arcsinh.vo</code></li>
<li>54 K <code>../ocaml-base-compiler.4.03.0/lib/coq/user-contrib/agm/arcsinh.glob</code></li>
<li>47 K <code>../ocaml-base-compiler.4.03.0/lib/coq/user-contrib/agm/rounding_big.vo</code></li>
<li>45 K <code>../ocaml-base-compiler.4.03.0/lib/coq/user-contrib/agm/<API key>.glob</code></li>
<li>44 K <code>../ocaml-base-compiler.4.03.0/lib/coq/user-contrib/agm/rounding2.v</code></li>
<li>36 K <code>../ocaml-base-compiler.4.03.0/lib/coq/user-contrib/agm/elliptic_integral.v</code></li>
<li>33 K <code>../ocaml-base-compiler.4.03.0/lib/coq/user-contrib/agm/computing.vo</code></li>
<li>27 K <code>../ocaml-base-compiler.4.03.0/lib/coq/user-contrib/agm/generalities.v</code></li>
<li>26 K <code>../ocaml-base-compiler.4.03.0/lib/coq/user-contrib/agm/alg2.v</code></li>
<li>23 K <code>../ocaml-base-compiler.4.03.0/lib/coq/user-contrib/agm/filter_Rlt.v</code></li>
<li>16 K <code>../ocaml-base-compiler.4.03.0/lib/coq/user-contrib/agm/rounding_big.glob</code></li>
<li>7 K <code>../ocaml-base-compiler.4.03.0/lib/coq/user-contrib/agm/arcsinh.v</code></li>
<li>7 K <code>../ocaml-base-compiler.4.03.0/lib/coq/user-contrib/agm/<API key>.v</code></li>
<li>4 K <code>../ocaml-base-compiler.4.03.0/lib/coq/user-contrib/agm/rounding_big.v</code></li>
<li>1 K <code>../ocaml-base-compiler.4.03.0/lib/coq/user-contrib/agm/computing.v</code></li>
<li>1 K <code>../ocaml-base-compiler.4.03.0/lib/coq/user-contrib/agm/computing.glob</code></li>
</ul>
<h2>Uninstall 🧹</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam remove -y coq-pi-agm.1.2.1</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
*/
namespace ShiftTest\Unit\ShiftContentNew\Type\Field;
use Mockery;
use ShiftTest\TestCase;
use ShiftContentNew\Type\Field\Field;
/**
* Type field test
* This holds unit tests for content type field functionality.
*
* @category Projectshift
* @package ShiftContentNew
* @subpackage Tests
*
* @group unit
*/
class FieldTest extends TestCase
{
/**
* Test data to populate item
* @var array
*/
protected $data = array();
/**
* Set up environment to run our tests
*/
public function setUp()
{
parent::setUp();
//prepare data for testing
$this->data = array(
'name' => 'Example field',
'property' => 'example',
'fieldType' => 'file'
);
}
/**
* Test that we can instantiate content type field.
* @test
*/
public function canInstantiateField()
{
$field = new Field;
$this->assertInstanceOf('ShiftContentNew\Type\Field\Field', $field);
}
/**
* Test that we can populate field from array upon instantiation.
* @test
*/
public function <API key>()
{
$data = $this->data;
$field = new Field($data);
$this->assertEquals($data['name'], $field->getName());
$this->assertEquals($data['property'], $field->getProperty());
$this->assertEquals($data['fieldType'], $field->getFieldType());
}
/**
* Test that we are able to access an array representation of field.
* @test
*/
public function canGetFieldAsArray()
{
$field = new Field;
$field = $field->toArray();
$this->assertTrue(array_key_exists('name', $field));
$this->assertTrue(array_key_exists('property', $field));
$this->assertTrue(array_key_exists('fieldType', $field));
$this->assertTrue(array_key_exists('settings', $field));
$this->assertTrue(array_key_exists('filters', $field));
$this->assertTrue(array_key_exists('validators', $field));
}
/**
* Test that we are able to get field id.
* @test
*/
public function canGetId()
{
$field = new Field;
$this->assertNull($field->getId());
}
/**
* Test that we are able to set parent type for the field.
* @test
*/
public function canSetType()
{
$type = Mockery::mock('ShiftContentNew\Type\Type');
$field = new Field;
$field->setType($type);
$this->assertEquals($type, $field->getType());
}
/**
* Test that we are able to set field name.
* @test
*/
public function canSetName()
{
$name = $this->data['name'];
$field = new Field;
$field->setName($name);
$this->assertEquals($name, $field->getName());
}
/**
* Test that we are able to set field property name.
* @test
*/
public function canSetProperty()
{
$property = $this->data['property'];
$field = new Field;
$field->setProperty($property);
$this->assertEquals($property, $field->getProperty());
}
/**
* Test that we are able to set field type.
* @test
*/
public function canSetFieldType()
{
$type = $this->data['fieldType'];
$field = new Field;
$field->setFieldType($type);
$this->assertEquals($type, $field->getFieldType());
}
/**
* Test that we are able to set field settings.
* @test
*/
public function canSetSettings()
{
$settings = Mockery::mock('ShiftContentNew\FieldType\AbstractSettings');
$settings->shouldReceive('setField');
$field = new Field;
$field->setSettings($settings);
$this->assertEquals($settings, $field->getSettings());
}
/**
* Test that we are able to get field attributes.
* @test
*/
public function <API key>()
{
$field = new Field;
$attributes = $field->getAttributes();
$this->assertTrue(is_array($attributes));
$this->assertTrue(empty($attributes));
}
/**
* Test that we are able to get field filters.
* @test
*/
public function canGetFieldFilters()
{
$field = new Field;
$filters = $field->getFilters();
$this->assertTrue(is_array($filters));
$this->assertTrue(empty($filters));
}
/**
* Test that we are able to add filter to field.
* @test
*/
public function canAddFilter()
{
$attribute = 'ShiftContentNew\Type\Field\Attribute\Attribute';
$filter = Mockery::mock($attribute);
$filter->shouldReceive('getType')->andReturn('filter');
$filter->shouldReceive('setField');
$field = new Field;
$field->addFilter($filter);
$this->assertContains($filter, $field->getFilters());
}
/**
* Test that we throw proper exception when adding filter of bad type
* to field filters collection.
*
* @test
* @expectedException \ShiftContentNew\Exception\DomainException
* @<API key> This is not a filter
*/
public function <API key>()
{
$attribute = 'ShiftContentNew\Type\Field\Attribute\Attribute';
$filter = Mockery::mock($attribute);
$filter->shouldReceive('getType')->andReturn('validator');
$field = new Field;
$field->addFilter($filter);
}
/**
* Test that we are able to remove filter from content field.
* @test
*/
public function canRemoveFilter()
{
$attribute = 'ShiftContentNew\Type\Field\Attribute\Attribute';
$filter = Mockery::mock($attribute);
$filter->shouldReceive('getType')->andReturn('filter');
$filter->shouldReceive('setField');
//add first
$field = new Field;
$field->addFilter($filter);
$this->assertContains($filter, $field->getFilters());
//now remove
$field->removeFilter($filter);
$filters = $field->getFilters();
$this->assertTrue(empty($filters));
}
/**
* Test that we are able to add validator to field.
* @test
*/
public function canAddValidator()
{
$attribute = 'ShiftContentNew\Type\Field\Attribute\Attribute';
$validator = Mockery::mock($attribute);
$validator->shouldReceive('getType')->andReturn('validator');
$validator->shouldReceive('setField');
$field = new Field;
$field->addValidator($validator);
$this->assertContains($validator, $field->getValidators());
}
/**
* Test that we throw proper exception when adding validator of bad type
* to field validators collection.
*
* @test
* @expectedException \ShiftContentNew\Exception\DomainException
* @<API key> This is not a validator
*/
public function <API key>()
{
$attribute = 'ShiftContentNew\Type\Field\Attribute\Attribute';
$validator = Mockery::mock($attribute);
$validator->shouldReceive('getType')->andReturn('filter');
$field = new Field;
$field->addValidator($validator);
}
/**
* Test that we are able to remove validator from content field.
* @test
*/
public function canRemoveValidator()
{
$attribute = 'ShiftContentNew\Type\Field\Attribute\Attribute';
$validator = Mockery::mock($attribute);
$validator->shouldReceive('getType')->andReturn('validator');
$validator->shouldReceive('setField');
//add first
$field = new Field;
$field->addValidator($validator);
$this->assertContains($validator, $field->getValidators());
//now remove
$field->removeValidator($validator);
$validators = $field->getValidators();
$this->assertTrue(empty($validators));
}
}//class ends here |
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;
namespace Spektra.Editor
{
<summary>
Interaction logic for App.xaml
</summary>
public partial class App : Application
{
}
} |
<?php
/**
* namespace definition and usage
*/
namespace PizzaRead\Controller;
use PizzaRead\Repository\<API key>;
use Zend\ServiceManager\FactoryInterface;
use Zend\ServiceManager\<API key>;
/**
* Pizza controller factory
*
* Factory to create the controller for pizzas
*
* @package PizzaRead
*/
class <API key> implements FactoryInterface
{
/**
* Create Service Factory
*
* @param <API key> $controllerManager
*
* @return ToppingController
*/
public function createService(<API key> $controllerManager)
{
$serviceLocator = $controllerManager->getServiceLocator();
/** @var $toppingRepository <API key> */
$toppingRepository = $serviceLocator->get(
'PizzaRead\Repository\Topping'
);
$controller = new ToppingController();
$controller-><API key>($toppingRepository);
return $controller;
}
} |
-- vtab6.test
-- execsql {
-- SELECT * FROM t1 LEFT JOIN t2 ON t1.a=t2.d
SELECT * FROM t1 LEFT JOIN t2 ON t1.a=t2.d |
package oe.item;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.relauncher.Side;
import net.minecraft.block.Block;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
import net.minecraftforge.event.entity.player.PlayerInteractEvent.Action;
import oe.api.OEItemInterface;
import oe.api.OEItemMode;
import oe.api.lib.OEType;
import oe.core.Debug;
import oe.core.Log;
import oe.core.data.<API key>;
import oe.core.util.ConfigUtil;
import oe.core.util.NetworkUtil;
import oe.core.util.NetworkUtil.Channel;
import oe.core.util.NetworkUtil.PacketProcessor;
import oe.core.util.Util;
import oe.qmc.QMC;
import java.util.List;
public class <API key> extends Item implements OEItemInterface, OEItemMode, PacketProcessor {
public <API key>() {
super();
setTextureName(OEItems.Texture(this.getClass().getSimpleName().substring(4).trim()));
setUnlocalizedName(this.getClass().getSimpleName());
setCreativeTab(CreativeTabs.tabTools);
setMaxStackSize(1);
}
@SubscribeEvent
public void <API key>(PlayerInteractEvent event) {
if (Util.isClientSide()) {
if (event.action != Action.RIGHT_CLICK_BLOCK) {
return;
}
EntityPlayer player = event.entityPlayer;
if (player == null) {
return;
}
if (player.getHeldItem() == null || !(player.getHeldItem().getItem() instanceof <API key>) || player.getHeldItem().stackTagCompound == null || !(player.getHeldItem().getItem() instanceof OEItemInterface)) {
return;
}
NBTTagCompound nbt = new NBTTagCompound();
nbt.setInteger("x", event.x);
nbt.setInteger("y", event.y);
nbt.setInteger("z", event.z);
nbt.setInteger("face", event.face);// Bottom = 0, Top = 1, Sides = 2-5
NetworkUtil.sendToServer(Channel.BlockManipulater, nbt);
event.setCanceled(true);
}
}
@Override
public void handlePacket(NBTTagCompound nbt, EntityPlayer player, Side side) {
int x = nbt.getInteger("x");
int y = nbt.getInteger("y");
int z = nbt.getInteger("z");
int blockFace = nbt.getInteger("face");
try {
World world = player.worldObj;
if (player.getHeldItem() == null || !(player.getHeldItem().getItem() instanceof <API key>) || player.getHeldItem().stackTagCompound == null) {
return;
}
if (!player.getHeldItem().stackTagCompound.getBoolean("hasBlock")) {
boolean move = player.getHeldItem().stackTagCompound.getCompoundTag("mode").getBoolean("move");
double cost;
String id = world.getBlock(x, y, z).getUnlocalizedName();
int meta = world.getBlockMetadata(x, y, z);
OEItemInterface oe = (OEItemInterface) player.getHeldItem().getItem();
if (move) {
cost = ConfigUtil.other("item", "<API key>", 0);
if (oe.getQMC(player.getHeldItem()) < cost && !player.capabilities.isCreativeMode) {
return;
}
} else {
cost = ConfigUtil.other("item", "<API key>", 0);
double blockCost = QMC.getQMC(new ItemStack(world.getBlock(x, y, z), 1, meta));
if (blockCost < 0) {
return;
}
cost += blockCost;
}
if (!player.capabilities.isCreativeMode) {
oe.decreaseQMC(cost, player.getHeldItem());
}
if (<API key>.isBlackListed(world.getBlock(x, y, z))) {
return;
}
if (oe.getQMC(player.getHeldItem()) < cost && !player.capabilities.isCreativeMode) {
return;
}
NBTTagCompound block = new NBTTagCompound();
block.setString("id", id);
block.setInteger("meta", meta);
TileEntity te = world.getTileEntity(x, y, z);
if (te != null && move) {
NBTTagCompound nbtTE = new NBTTagCompound();
te.writeToNBT(nbtTE);
block.setTag("tile", nbtTE);
}
player.getHeldItem().stackTagCompound.setTag("block", nbt);
player.getHeldItem().stackTagCompound.setBoolean("hasBlock", true);
player.getHeldItem().setItemDamage(1); // To stop them having values while storing a
// block
if (move) {
if (te != null) {
TileEntity toSet = world.getBlock(x, y, z).createTileEntity(world, world.getBlockMetadata(x, y, z));
world.setTileEntity(x, y, z, toSet);
}
world.setBlockToAir(x, y, z);
}
} else {
if (blockFace == 0) {
y
} else if (blockFace == 1) {
y++;
} else if (blockFace == 2) {
z
} else if (blockFace == 3) {
z++;
} else if (blockFace == 4) {
x
} else if (blockFace == 5) {
x++;
}
NBTTagCompound block = player.getHeldItem().stackTagCompound.getCompoundTag("block");
String id = block.getString("id");
int meta = block.getInteger("meta");
Block b = Block.getBlockFromName(id);
if (!b.canPlaceBlockAt(world, x, y, z) || !world.isAirBlock(x, y, z)) {
return; // Not valid pos
}
world.setBlock(x, y, z, b, meta, 3);
world.setTileEntity(x, y, z, b.createTileEntity(world, meta));
if (block.hasKey("tile")) {
NBTTagCompound tile = block.getCompoundTag("tile");
tile.setInteger("x", x);
tile.setInteger("y", y);
tile.setInteger("z", z);
world.getTileEntity(x, y, z).readFromNBT(tile);
}
player.getHeldItem().stackTagCompound.removeTag("block");
player.getHeldItem().stackTagCompound.setBoolean("hasBlock", false);
player.getHeldItem().setItemDamage(0);
}
} catch (Exception e) {
Log.severe("Error occurred while moving block at X:" + x + " Y:" + y + " Z:" + z);
Debug.handleException(e);
}
}
@Override
public void onUpdate(ItemStack itemstack, World world, Entity entity, int par4, boolean par5) {
checkNBT(itemstack);
}
private void checkNBT(ItemStack itemstack) {
if (itemstack.getTagCompound() == null) {
itemstack.setTagCompound(new NBTTagCompound());
itemstack.stackTagCompound.setTag("mode", new NBTTagCompound());
itemstack.stackTagCompound.getCompoundTag("mode").setBoolean("copy", true);
itemstack.stackTagCompound.setBoolean("Enabled", false);
}
}
@Override
@SuppressWarnings({"rawtypes", "unchecked"})
public void addInformation(ItemStack itemStack, EntityPlayer player, List list, boolean par4) {
if (itemStack.getTagCompound() != null) {
// list.add(QMC.name + ": " + itemStack.stackTagCompound.getDouble("Value")); Because Charging
// currently does nothing
if (itemStack.stackTagCompound.getBoolean("hasBlock")) {
NBTTagCompound nbtBlock = itemStack.stackTagCompound.getCompoundTag("block");
if (nbtBlock != null) {
Block block = Block.getBlockFromName(nbtBlock.getString("id"));
list.add("Currently Holding: " + block.getLocalizedName());
}
}
}
}
@Override
public double getQMC(ItemStack stack) {
if (stack.getTagCompound() != null) {
return stack.getTagCompound().getDouble("Value");
} else {
return -1;
}
}
@Override
public void setQMC(double qmc, ItemStack stack) {
if (stack.getTagCompound() != null) {
stack.getTagCompound().setDouble("Value", qmc);
}
}
@Override
public void increaseQMC(double value, ItemStack stack) {
if (stack.getTagCompound() != null) {
double current = stack.getTagCompound().getDouble("Value");
if (current + value > getMaxQMC(stack)) {
current = getMaxQMC(stack);
} else {
current = current + value;
}
stack.getTagCompound().setDouble("Value", current);
}
}
@Override
public void decreaseQMC(double value, ItemStack stack) {
if (stack.getTagCompound() != null) {
double current = stack.getTagCompound().getDouble("Value");
if (current - value < 0) {
current = 0;
} else {
current = current - value;
}
stack.getTagCompound().setDouble("Value", current);
}
}
@Override
public double getMaxQMC(ItemStack itemstack) {
return 50000;
}
@Override
public int getTier(ItemStack itemstack) {
return 2;
}
@Override
public OEType getType(ItemStack itemstack) {
return OEType.Consumer;
}
@Override
public String getMode(ItemStack itemstack) {
checkNBT(itemstack);
if (itemstack.stackTagCompound.getCompoundTag("mode").getBoolean("copy")) {
return "Copy";
} else {
return "Move";
}
}
@Override
public String switchMode(ItemStack itemstack) {
checkNBT(itemstack);
if (itemstack.stackTagCompound.getCompoundTag("mode").getBoolean("copy")) {
itemstack.stackTagCompound.getCompoundTag("mode").removeTag("copy");
itemstack.stackTagCompound.getCompoundTag("mode").setBoolean("move", true);
} else {
itemstack.stackTagCompound.getCompoundTag("mode").removeTag("move");
itemstack.stackTagCompound.getCompoundTag("mode").setBoolean("copy", true);
}
return getMode(itemstack);
}
} |
import { Routes } from '@angular/router';
import { CourseListComponent } from './courses/course-list';
import { LoginPageComponent } from './login-page';
import { NoContentComponent } from './no-content';
export const ROUTES: Routes = [
{ path: '', component: CourseListComponent },
{ path: 'login', component: LoginPageComponent },
{ path: 'courses', component: CourseListComponent },
{ path: '**', component: NoContentComponent }
]; |
#!/usr/bin/python
import time
import serial
import sys
import json
def ftdi232h_cmd(thePort, theBaud, theCommand):
ser = serial.Serial(
port=thePort, # /dev/ttyUSB0
baudrate=theBaud, # 9600
parity=serial.PARITY_NONE,
stopbits=serial.STOPBITS_ONE,
bytesize=serial.EIGHTBITS,
xonxoff=0, rtscts=0, dsrdtr=0,
)
ser.isOpen()
ser.write(theCommand+"\n")
endtime = time.time()+1 #0.2 # wait 0.2 sec
result = ""
while time.time() < endtime:
while ser.inWaiting() > 0:
#result=result+ser.read(1)
result=result+ser.read()
#result=ser.read()
ser.close()
#return result
return 'callback: ['+result.rstrip('\n')+']'
if len(sys.argv)!=4:
print "USAGE: <API key>.py "+'"'+"<port> <baud> <serial message>"+'"'
exit(1)
print ftdi232h_cmd(sys.argv[1], sys.argv[2], sys.argv[3]).strip()
'''
import time
import serial
import sys
import json
ser = serial.Serial(
port='/dev/ttyUSB0', # or /dev/ttyAMA0 for serial on the Raspberry Pi
baudrate=9600,
parity=serial.PARITY_NONE,
stopbits=serial.STOPBITS_ONE,
bytesize=serial.EIGHTBITS,
xonxoff=0, rtscts=0, dsrdtr=0,
)
ser.isOpen()
result = ""
ser.write("1"+"\n")
while ser.inWaiting() > 0:
result=result+ser.read()
result
''' |
// UIPopoverController+HLSExtensions.h
// CoconutKit
@interface UIViewController (<API key>)
/**
* Return the popover controller which displays the receiver, or nil if none
*/
@property (nonatomic, readonly, weak) UIPopoverController *popoverController;
@end |
<?php
namespace Bware\SymphoBee\Routing\UriMatcher;
/**
* UriMatcherInterface
* @author Lingtalfi
* 2015-06-02
*
*/
interface UriMatcherInterface
{
/**
* @param string $pattern , its syntax depends on the concrete class
* @param string $uri , the request uri to match the pattern against
* @return false|array, the patternVars
*/
public function match($pattern, $uri);
} |
# Student Spotlight
> Here we're going to be showcasing our Spring 2015 graduating students from the CS department at HU.
> Please note, however, that only students who voluntarily shared their information are showcased here.
> If you want to contact them, just click their name to be redirected to their LinkedIn account.








 |
module.exports = {
name: 'highcharts',
description: '',
example_data: '{ "chart":{ "type":"bar" }, "series":[ { "data":[ 1, 0, 4 ], "name":"Jane" }, { "data":[ 5, 7, 3 ], "name":"John" } ], "title":{ "text":"Fruit Consumption" }, "xAxis":{ "categories":[ "Apples", "Bananas", "Oranges" ] }, "yAxis":{ "title":{ "text":"Fruit eaten 5" } } }'
}; |
# Naio
Build system for node.js native addons
***This will only build c/c++ files in `src` directory.***
# Install
`npm i --save naio nan`
# Example
[naio-test](https://github.com/wilhelmmatilainen/naio-test)
# How to use
***Check out the example above***
1. Install
2. Add to package.json
1. "libraries": ["v8", "<API key>"]
2. "scripts": {"build": "make -f node_modules/naio/makefile", "postinstall": "npm run build"}
3. Execute `npm run build`
4. Now you can require/import like this
1. var mylibrary = require('./build/debug.node') // or release.node
2. import mylibrary from './build/debug.node'; // or release.node |
<!DOCTYPE HTML PUBLIC "-
<!-- NewPage -->
<html lang="nl">
<head>
<!-- Generated by javadoc (1.8.0_74) on Fri Feb 12 21:52:20 CET 2016 -->
<title>DigitalOutputTest</title>
<meta name="date" content="2016-02-12">
<link rel="stylesheet" type="text/css" href="../stylesheet.css" title="Style">
<script type="text/javascript" src="../script.js"></script>
</head>
<body>
<script type="text/javascript"><!
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="DigitalOutputTest";
}
}
catch(err) {
}
var methods = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10,"i8":10,"i9":10,"i10":10};
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<div class="topNav"><a name="navbar.top">
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
</a>
<ul class="navList" title="Navigation">
<li><a href="../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../deprecated-list.html">Deprecated</a></li>
<li><a href="../index-files/index-1.html">Index</a></li>
<li><a href="../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../output/AnalogOutputTest.html" title="class in output"><span class="typeNameLink">Prev Class</span></a></li>
<li>Next Class</li>
</ul>
<ul class="navList">
<li><a href="../index.html?output/DigitalOutputTest.html" target="_top">Frames</a></li>
<li><a href="DigitalOutputTest.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="<API key>">
<li><a href="../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!
allClassesLink = document.getElementById("<API key>");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary: </li>
<li>Nested | </li>
<li>Field | </li>
<li><a href="#constructor.summary">Constr</a> | </li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li>Field | </li>
<li><a href="#constructor.detail">Constr</a> | </li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.top">
</a></div>
<div class="header">
<div class="subTitle">output</div>
<h2 title="Class DigitalOutputTest" class="title">Class DigitalOutputTest</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object</li>
<li>
<ul class="inheritance">
<li>output.DigitalOutputTest</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<br>
<pre>public class <span class="typeNameLabel">DigitalOutputTest</span>
extends java.lang.Object</pre>
<dl>
<dt><span class="simpleTagLabel">Author:</span></dt>
<dd>Pieter De Clercq</dd>
</dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<ul class="blockList">
<li class="blockList"><a name="constructor.summary">
</a>
<h3>Constructor Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../output/DigitalOutputTest.html#DigitalOutputTest--">DigitalOutputTest</a></span>()</code> </td>
</tr>
</table>
</li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="method.summary">
</a>
<h3>Method Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd"> </span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd"> </span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd"> </span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../output/DigitalOutputTest.html#setUp--">setUp</a></span>()</code> </td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../output/DigitalOutputTest.html#tearDown--">tearDown</a></span>()</code> </td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../output/DigitalOutputTest.html#<API key>--"><API key></a></span>()</code> </td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../output/DigitalOutputTest.html#testChannel--">testChannel</a></span>()</code> </td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../output/DigitalOutputTest.html#testClear--">testClear</a></span>()</code> </td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../output/DigitalOutputTest.html#testClearAll--">testClearAll</a></span>()</code> </td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../output/DigitalOutputTest.html#<API key>--"><API key></a></span>()</code> </td>
</tr>
<tr id="i7" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../output/DigitalOutputTest.html#<API key>--"><API key></a></span>()</code> </td>
</tr>
<tr id="i8" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../output/DigitalOutputTest.html#testOn--">testOn</a></span>()</code> </td>
</tr>
<tr id="i9" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../output/DigitalOutputTest.html#testOnNotConnected--">testOnNotConnected</a></span>()</code> </td>
</tr>
<tr id="i10" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../output/DigitalOutputTest.html#testSetOnAll--">testSetOnAll</a></span>()</code> </td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.java.lang.Object">
</a>
<h3>Methods inherited from class java.lang.Object</h3>
<code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<ul class="blockList">
<li class="blockList"><a name="constructor.detail">
</a>
<h3>Constructor Detail</h3>
<a name="DigitalOutputTest
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>DigitalOutputTest</h4>
<pre>public DigitalOutputTest()</pre>
</li>
</ul>
</li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="method.detail">
</a>
<h3>Method Detail</h3>
<a name="setUp
</a>
<ul class="blockList">
<li class="blockList">
<h4>setUp</h4>
<pre>public void setUp()</pre>
</li>
</ul>
<a name="tearDown
</a>
<ul class="blockList">
<li class="blockList">
<h4>tearDown</h4>
<pre>public void tearDown()
throws java.lang.Exception</pre>
<dl>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.Exception</code></dd>
</dl>
</li>
</ul>
<a name="testClear
</a>
<ul class="blockList">
<li class="blockList">
<h4>testClear</h4>
<pre>public void testClear()</pre>
</li>
</ul>
<a name="<API key>
</a>
<ul class="blockList">
<li class="blockList">
<h4><API key></h4>
<pre>public void <API key>()</pre>
</li>
</ul>
<a name="testClearAll
</a>
<ul class="blockList">
<li class="blockList">
<h4>testClearAll</h4>
<pre>public void testClearAll()</pre>
</li>
</ul>
<a name="testOn
</a>
<ul class="blockList">
<li class="blockList">
<h4>testOn</h4>
<pre>public void testOn()</pre>
</li>
</ul>
<a name="testOnNotConnected
</a>
<ul class="blockList">
<li class="blockList">
<h4>testOnNotConnected</h4>
<pre>public void testOnNotConnected()</pre>
</li>
</ul>
<a name="testSetOnAll
</a>
<ul class="blockList">
<li class="blockList">
<h4>testSetOnAll</h4>
<pre>public void testSetOnAll()</pre>
</li>
</ul>
<a name="<API key>
</a>
<ul class="blockList">
<li class="blockList">
<h4><API key></h4>
<pre>public void <API key>()</pre>
</li>
</ul>
<a name="testChannel
</a>
<ul class="blockList">
<li class="blockList">
<h4>testChannel</h4>
<pre>public void testChannel()</pre>
</li>
</ul>
<a name="<API key>
</a>
<ul class="blockListLast">
<li class="blockList">
<h4><API key></h4>
<pre>public void <API key>()</pre>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<div class="bottomNav"><a name="navbar.bottom">
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
</a>
<ul class="navList" title="Navigation">
<li><a href="../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../deprecated-list.html">Deprecated</a></li>
<li><a href="../index-files/index-1.html">Index</a></li>
<li><a href="../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../output/AnalogOutputTest.html" title="class in output"><span class="typeNameLink">Prev Class</span></a></li>
<li>Next Class</li>
</ul>
<ul class="navList">
<li><a href="../index.html?output/DigitalOutputTest.html" target="_top">Frames</a></li>
<li><a href="DigitalOutputTest.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="<API key>">
<li><a href="../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!
allClassesLink = document.getElementById("<API key>");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary: </li>
<li>Nested | </li>
<li>Field | </li>
<li><a href="#constructor.summary">Constr</a> | </li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li>Field | </li>
<li><a href="#constructor.detail">Constr</a> | </li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.bottom">
</a></div>
</body>
</html> |
package com.github.bleuzen.blizcord;
import java.awt.Desktop;
import java.io.File;
import java.net.URI;
import java.util.concurrent.TimeUnit;
import com.github.bleuzen.blizcord.bot.Bot;
import com.github.bleuzen.blizcord.gui.GUI_Main;
import com.sedmelluq.discord.lavaplayer.track.AudioTrack;
import com.sedmelluq.discord.lavaplayer.track.AudioTrackInfo;
import net.dv8tion.jda.api.entities.Guild;
import net.dv8tion.jda.api.entities.Role;
import net.dv8tion.jda.api.entities.User;
public class Utils {
private static String OS;
public static String getOS() {
if(OS != null) {
return OS;
}
String tmp = System.getProperty("os.name").toLowerCase();
if(tmp.equals(Values.OS_LINUX)) {
return (OS = Values.OS_LINUX);
} else if(tmp.startsWith(Values.OS_WINDOWS)) {
return (OS = Values.OS_WINDOWS);
} else {
return (OS = Values.UNKNOWN_OS);
}
}
public static boolean isUnknownOS() {
return getOS().equals(Values.UNKNOWN_OS);
}
public static long timeToMS(int hours, int minutes, int seconds) {
if(seconds > 59 || seconds < 0) {
return -1;
}
if(minutes > 59 || minutes < 0) {
return -1;
}
long s = (seconds + (60 * (minutes + (hours * 60))));
return TimeUnit.SECONDS.toMillis(s);
}
public static String <API key>(long duration) {
TimeUnit scale = TimeUnit.MILLISECONDS;
long days = scale.toDays(duration);
duration -= TimeUnit.DAYS.toMillis(days);
long hours = scale.toHours(duration);
duration -= TimeUnit.HOURS.toMillis(hours);
long minutes = scale.toMinutes(duration);
duration -= TimeUnit.MINUTES.toMillis(minutes);
long seconds = scale.toSeconds(duration);
return String.format("%d days, %d hours, %d minutes, %d seconds", days, hours, minutes, seconds);
}
public static String <API key>(long duration) {
TimeUnit scale = TimeUnit.MILLISECONDS;
long minutes = scale.toMinutes(duration);
duration -= TimeUnit.MINUTES.toMillis(minutes);
long seconds = scale.toSeconds(duration);
return String.format("%d:%s", minutes, String.format("%02d", seconds));
}
public static String getTrackName(AudioTrack track) {
String sourceName = track.getSourceManager().getSourceName();
if(sourceName.equals("local")) {
AudioTrackInfo info = track.getInfo();
String author = info.author;
String title = info.title;
if(!author.equals("Unknown artist") && !title.equals("Unknown title")) {
return author + " - " + title;
} else {
return new File(track.getInfo().uri).getName();
}
} else if(sourceName.equals("http")) {
return track.getIdentifier();
} else {
return track.getInfo().title;
}
}
public static boolean isAdmin(User user) {
Guild guild = Bot.getGuild();
Role adminRole = Bot.getAdminRole();
return user.getId().equals(guild.getOwner().getUser().getId()) || (adminRole != null && guild.getMember(user).getRoles().contains(adminRole));
}
public static void openInBrowser(String link) {
try {
Desktop.getDesktop().browse(new URI(link));
} catch (Exception e) {
GUI_Main.showErrMsgBox(e.getMessage());
errExit();
}
}
static void errExit() {
errExit(null);
}
public static void errExit(String msg) {
errExit(msg, 1);
}
public static void errExit(String msg, int exitCode) {
if(a.isGui()) {
GUI_Main.onErrExit(msg);
} else {
Log.error("Crash! Reason:");
System.err.println(msg == null ? "Unknown" : msg);
try {
Thread.sleep(5000);
} catch (<API key> e) {
//e.printStackTrace();
}
}
if(exitCode >= 1 && exitCode <= 127) {
System.exit(exitCode);
} else {
System.exit(0);
}
}
public static void handleError(String m) {
Utils.errExit(m);
}
// "NCG" = "Not Crash GUI"
// this is the same as handleError(m) but does not crash if GUI
public static void handleErrorNCG(String m) {
if(a.isGui()) {
// Only show Error message box, but don't exit
GUI_Main.showErrMsgBox(m);
} else {
// If not using GUI -> The old way: crash
//TODO: double checks if a.isGui() (again in errExit()), Write better method?
Utils.errExit(m);
}
}
public static void handleException(Exception e) {
if(a.isDebug()) {
e.printStackTrace();
}
handleError(e.getMessage());
}
// "NCG" = "Not Crash GUI"
public static void handleExceptionNCG(Exception e) {
if(a.isDebug()) {
e.printStackTrace();
}
handleErrorNCG(e.getMessage());
}
public static void printException(Exception e) {
if(a.isDebug()) {
e.printStackTrace();
}
}
public static class ArgumentUtils {
public static int getArgIndex(String[] args, String arg) {
int ir = -1; // return -1 if args does not contain the argument
for(int in = 0; in < args.length; in++) {
if(args[in].equalsIgnoreCase(arg)) {
ir = in;
break;
}
}
return ir;
}
public static boolean containsArg(String[] args, String arg) {
return getArgIndex(args, arg) != -1;
}
// returns the value behind an argument or null
public static String getArg(String[] args, String arg) {
int i = getArgIndex(args, arg);
if(i != -1) {
try {
String result = args[i + 1];
if(!result.startsWith("
return result;
}
} catch(<API key> e) {
Log.debug("Invalid argument value: {}", arg);
}
}
return null;
}
}
} |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>ptsf: 34 s </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.10.1 / ptsf - 8.10.0</a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href="../..">« Up</a>
<h1>
ptsf
<small>
8.10.0
<span class="label label-success">34 s </span>
</small>
</h1>
<p> <em><script>document.write(moment("2021-10-27 08:55:36 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2021-10-27 08:55:36 UTC)</em><p>
<h2>Context</h2>
<pre># Packages matching: installed
# Name # Installed # Synopsis
base-bigarray base
base-threads base
base-unix base
conf-findutils 1 Virtual package relying on findutils
coq 8.10.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.1 A library manager for OCaml
# opam file:
opam-version: "2.0"
maintainer: "Hugo.Herbelin@inria.fr"
homepage: "http:
license: "BSD"
build: [make "-j%{jobs}%"]
install: [make "install"]
remove: ["rm" "-R" "%{lib}%/coq/user-contrib/PTSF"]
depends: [
"ocaml"
"coq" {>= "8.10" & < "8.11~"}
"coq-ptsatr" {>= "8.10" & < "8.11~"}
]
tags: [
"keyword: pure type systems"
"keyword: judgmental equality"
"keyword: explicit equality proofs"
"keyword: proof relevance"
"category: Mathematics/Logic/Type theory"
]
authors: [
"Floris van Doorn <fpv@andrew.cmu.edu> [http:
"Herman Geuvers <herman@cs.ru.nl> [http:
"Freek Wiedijk <freek@cs.ru.nl> [http:
]
bug-reports: "https://github.com/coq-contribs/ptsf/issues"
dev-repo: "git+https://github.com/coq-contribs/ptsf.git"
synopsis: "Explicit Convertibility Proofs in Pure Type Systems"
description: """
Formalization of the proof that PTS and PTS with explicit convertibility proofs (PTSf) are equivalent."""
flags: light-uninstall
url {
src: "https://github.com/coq-contribs/ptsf/archive/v8.10.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-ptsf.8.10.0 coq.8.10.1</code></dd>
<dt>Return code</dt>
<dd>0</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>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Install dependencies</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam list; echo; ulimit -Sv 4000000; timeout 4h opam install -y --deps-only coq-ptsf.8.10.0 coq.8.10.1</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>1 m 6 s</dd>
</dl>
<h2>Install </h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam list; echo; ulimit -Sv 16000000; timeout 4h opam install -y -v coq-ptsf.8.10.0 coq.8.10.1</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>34 s</dd>
</dl>
<h2>Installation size</h2>
<p>Total: 3 M</p>
<ul>
<li>1 M <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/PTSF/f_equivalence.vo</code></li>
<li>822 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/PTSF/f_typ2.vo</code></li>
<li>358 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/PTSF/f_typ.vo</code></li>
<li>212 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/PTSF/f_typ2.glob</code></li>
<li>162 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/PTSF/f_term.vo</code></li>
<li>139 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/PTSF/f_term.glob</code></li>
<li>127 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/PTSF/f_typ.glob</code></li>
<li>101 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/PTSF/f_env.vo</code></li>
<li>74 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/PTSF/f_equivalence.glob</code></li>
<li>41 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/PTSF/f_typ2.v</code></li>
<li>29 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/PTSF/f_env.glob</code></li>
<li>21 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/PTSF/f_term.v</code></li>
<li>20 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/PTSF/f_typ.v</code></li>
<li>17 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/PTSF/f_equivalence.v</code></li>
<li>8 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/PTSF/f_env.v</code></li>
</ul>
<h2>Uninstall 🧹</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam remove -y coq-ptsf.8.10.0</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> |
<!DOCTYPE html PUBLIC "-
<html xmlns="http:
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.9.1"/>
<title>V8 API Reference Guide for node.js v0.9.3: v8::HeapStatsUpdate Struct Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">V8 API Reference Guide for node.js v0.9.3
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.9.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main Page</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
<li><a href="examples.html"><span>Examples</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="annotated.html"><span>Class List</span></a></li>
<li><a href="classes.html"><span>Class Index</span></a></li>
<li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class Members</span></a></li>
</ul>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="<API key>">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="namespacev8.html">v8</a></li><li class="navelem"><a class="el" href="<API key>.html">HeapStatsUpdate</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> |
<a href="#pub-attribs">Public Attributes</a> |
<a href="<API key>.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">v8::HeapStatsUpdate Struct Reference</div> </div>
</div><!--header
<div class="contents">
<p><code>#include <<a class="el" href="<API key>.html">v8-profiler.h</a>></code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:<API key>"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="<API key>"></a>
 </td><td class="memItemRight" valign="bottom"><b>HeapStatsUpdate</b> (uint32_t index, uint32_t count, uint32_t size)</td></tr>
<tr class="separator:<API key>"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-attribs"></a>
Public Attributes</h2></td></tr>
<tr class="memitem:<API key>"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="<API key>"></a>
uint32_t </td><td class="memItemRight" valign="bottom"><b>index</b></td></tr>
<tr class="separator:<API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key>"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="<API key>"></a>
uint32_t </td><td class="memItemRight" valign="bottom"><b>count</b></td></tr>
<tr class="separator:<API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key>"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="<API key>"></a>
uint32_t </td><td class="memItemRight" valign="bottom"><b>size</b></td></tr>
<tr class="separator:<API key>"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>A struct for exporting HeapStats data from <a class="el" href="classv8_1_1_v8.html">V8</a>, using "push" model. See <a class="el" href="<API key>.html#<API key>">HeapProfiler::<API key></a>. </p>
</div><hr/>The documentation for this struct was generated from the following file:<ul>
<li>deps/v8/include/<a class="el" href="<API key>.html">v8-profiler.h</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Tue Aug 11 2015 23:48:54 for V8 API Reference Guide for node.js v0.9.3 by &
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.9.1
</small></address>
</body>
</html> |
package com.varunvats.practice.array
import com.varunvats.practice.sorting.UnitSpec
class LongestCycleSpec extends UnitSpec {
val theArrayContains = afterWord("the array contains")
"The longest cycle" when theArrayContains {
"no elements" should {
"be empty" in {
LongestCycle.get(IndexedSeq.empty) shouldBe Nil
}
}
"one element that does not point to itself" should {
"be empty" in {
LongestCycle.get(IndexedSeq(101)) shouldBe Nil
}
}
"one element that points to itself" should {
"contain only that element" in {
LongestCycle.get(IndexedSeq(0)) shouldBe Seq(0)
}
}
"two elements that don't form a cycle" should {
"be empty" in {
LongestCycle.get(IndexedSeq(1, 2)) shouldBe Nil
}
}
"two elements that both are in one cycle" should {
"contain both the elements" in {
LongestCycle.get(IndexedSeq(1, 0)) shouldBe Seq(1, 0)
}
}
"three elements that are all part of the cycle (cycle direction is anti-clockwise in array)" should {
"contain all the three elements in the correct order" in {
val arr = IndexedSeq(2, 0, 1)
LongestCycle.get(arr) shouldBe Seq(2, 1, 0)
}
}
"three elements that are all part of the cycle (cycle direction is clockwise in array)" should {
"contain all the three elements in the correct order" in {
val arr = IndexedSeq(1, 2, 0)
LongestCycle.get(arr) shouldBe Seq(1, 2, 0)
}
}
"four elements that are all part of the cycle (cycle direction is random in array)" should {
"contain all the four elements in the correct order" in {
val arr = IndexedSeq(2, 3, 1, 0)
LongestCycle.get(arr) shouldBe Seq(2, 1, 3, 0)
}
}
"a cycle that starts in the middle of the array" should {
"contain all the elements in the cycle in the correct order" in {
val arr = IndexedSeq(99, 0, 4, 2, 3, 21, 63)
LongestCycle.get(arr) shouldBe Seq(4, 3, 2)
}
}
"two cycles of the same length" should {
"be the one encountered first from the left" in {
val arr = IndexedSeq(2, 6, 11, 10, 1, 0, 3, 8, 7, 5, 4, 9)
val expectedCycle = Seq(2, 11, 9, 5, 0)
LongestCycle.get(arr) shouldBe expectedCycle
}
}
"two cycles of different lengths" should {
"the one with more elements" in {
val arr = IndexedSeq(99, 6, 11, 10, 1, 2, 3, 8, 7, 5, 4, 9)
val expectedCycle = Seq(6, 3, 10, 4, 1)
LongestCycle.get(arr) shouldBe expectedCycle
}
}
"a cycle that has more than one element that points to an element in the cycle" should {
"contain only the elements from the cycle in the correct order" in {
val arr = IndexedSeq(5, 9, 11, 2, 2, 4, 7, 2, 11, 7, 3, 9)
val expectedCycle = Seq(2, 11, 9, 7)
LongestCycle.get(arr) shouldBe expectedCycle
}
}
}
} |
<?php
/**
* sfValidatorBase allows you to apply constraints to user entered parameters.
*
* WARNING: This class is deprecated and will be removed in symfony 1.2.
*
* @package symfony
* @subpackage validator
* @author Fabien Potencier <fabien.potencier@symfony-project.com>
* @author Sean Kerr <sean@code-box.org>
* @version SVN: $Id$
* @deprecated Deprecated since symfony 1.1
*/
abstract class sfValidator
{
protected
$parameterHolder = null,
$context = null;
/**
* Class constructor.
*
* @see initialize()
*/
public function __construct($context, $parameters = array())
{
$this->initialize($context, $parameters);
}
/**
* Initializes this validator.
*
* @param sfContext The current application context
* @param array An associative array of initialization parameters
*
* @return bool true, if initialization completes successfully, otherwise false
*/
public function initialize($context, $parameters = array())
{
$this->context = $context;
$this->parameterHolder = new sfParameterHolder();
$this->parameterHolder->add($parameters);
return true;
}
/**
* Executes this validator.
*
* @param mixed A file or parameter value/array
* @param string An error message reference
*
* @return bool true, if this validator executes successfully, otherwise false
*/
abstract function execute(&$value, &$error);
/**
* Retrieves the current application context.
*
* @return sfContext The current sfContext instance
*/
public final function getContext()
{
return $this->context;
}
/**
* Retrieves the parameters from the validator.
*
* @return sfParameterHolder List of parameters
*/
public function getParameterHolder()
{
return $this->parameterHolder;
}
/**
* Retrieves a parameter from the validator.
*
* @param string Parameter name
* @param mixed A default parameter value
*
* @return mixed A parameter value
*/
public function getParameter($name, $default = null)
{
return $this->parameterHolder->get($name, $default);
}
/**
* Indicates whether or not a parameter exist for the validator.
*
* @param string A parameter name
*
* @return boolean true, if parameter exists, otherwise false
*/
public function hasParameter($name)
{
return $this->parameterHolder->has($name);
}
/**
* Sets a parameter for the validator.
*
* @param string A parameter name
* @param mixed A parameter value
*/
public function setParameter($name, $value)
{
$this->parameterHolder->set($name, $value);
}
} |
#!/bin/bash
# this function is the unit test
python <API key>.py |
<!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=06&cityCode=005&areaCode=04&deptCode=021&liCode=0448
<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=2 align=center>040644</td>
<td nowrap align="center"></td>
<td nowrap align="center">1</td>
<td nowrap align="right">359</td>
<td nowrap align="right"> 48.71%</td>
</tr>
<tr class="data">
<td nowrap align="center"></td>
<td nowrap align="center">2</td>
<td nowrap align="right">378</td>
<td nowrap align="right"> 51.28%</td>
</tr>
<tr class="data">
<td nowrap rowspan=2 align=center>040645</td>
<td nowrap align="center"></td>
<td nowrap align="center">1</td>
<td nowrap align="right">334</td>
<td nowrap align="right"> 53.18%</td>
</tr>
<tr class="data">
<td nowrap align="center"></td>
<td nowrap align="center">2</td>
<td nowrap align="right">294</td>
<td nowrap align="right"> 46.81%</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> |
<!DOCTYPE html PUBLIC "-
<html xmlns="http:
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.9.1"/>
<title>V8 API Reference Guide for node.js v0.10.32 - v0.10.33: v8::StringObject Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">V8 API Reference Guide for node.js v0.10.32 - v0.10.33
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.9.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main Page</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
<li><a href="examples.html"><span>Examples</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="annotated.html"><span>Class List</span></a></li>
<li><a href="classes.html"><span>Class Index</span></a></li>
<li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class Members</span></a></li>
</ul>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="<API key>">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="namespacev8.html">v8</a></li><li class="navelem"><a class="el" href="<API key>.html">StringObject</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> |
<a href="#pub-static-methods">Static Public Member Functions</a> |
<a href="<API key>.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">v8::StringObject Class Reference</div> </div>
</div><!--header
<div class="contents">
<p><code>#include <<a class="el" href="v8_8h_source.html">v8.h</a>></code></p>
<div class="dynheader">
Inheritance diagram for v8::StringObject:</div>
<div class="dyncontent">
<div class="center">
<img src="<API key>.png" usemap="#v8::StringObject_map" alt=""/>
<map id="v8::StringObject_map" name="v8::StringObject_map">
<area href="classv8_1_1_object.html" alt="v8::Object" shape="rect" coords="0,112,102,136"/>
<area href="classv8_1_1_value.html" alt="v8::Value" shape="rect" coords="0,56,102,80"/>
<area href="classv8_1_1_data.html" alt="v8::Data" shape="rect" coords="0,0,102,24"/>
</map>
</div></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:<API key>"><td class="memItemLeft" align="right" valign="top">V8EXPORT <a class="el" href="classv8_1_1_local.html">Local</a>< <a class="el" href="classv8_1_1_string.html">String</a> > </td><td class="memItemRight" valign="bottom"><a class="el" href="<API key>.html#<API key>">StringValue</a> () const </td></tr>
<tr class="separator:<API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="inherit_header <API key>"><td colspan="2" onclick="javascript:toggleInherit('<API key>')"><img src="closed.png" alt="-"/> Public Member Functions inherited from <a class="el" href="classv8_1_1_object.html">v8::Object</a></td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="<API key>"></a>
V8EXPORT bool </td><td class="memItemRight" valign="bottom"><b>Set</b> (<a class="el" href="classv8_1_1_handle.html">Handle</a>< <a class="el" href="classv8_1_1_value.html">Value</a> > key, <a class="el" href="classv8_1_1_handle.html">Handle</a>< <a class="el" href="classv8_1_1_value.html">Value</a> > value, PropertyAttribute attribs=None)</td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="<API key>"></a>
V8EXPORT bool </td><td class="memItemRight" valign="bottom"><b>Set</b> (uint32_t index, <a class="el" href="classv8_1_1_handle.html">Handle</a>< <a class="el" href="classv8_1_1_value.html">Value</a> > value)</td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="<API key>"></a>
V8EXPORT bool </td><td class="memItemRight" valign="bottom"><b>ForceSet</b> (<a class="el" href="classv8_1_1_handle.html">Handle</a>< <a class="el" href="classv8_1_1_value.html">Value</a> > key, <a class="el" href="classv8_1_1_handle.html">Handle</a>< <a class="el" href="classv8_1_1_value.html">Value</a> > value, PropertyAttribute attribs=None)</td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="<API key>"></a>
V8EXPORT <a class="el" href="classv8_1_1_local.html">Local</a>< <a class="el" href="classv8_1_1_value.html">Value</a> > </td><td class="memItemRight" valign="bottom"><b>Get</b> (<a class="el" href="classv8_1_1_handle.html">Handle</a>< <a class="el" href="classv8_1_1_value.html">Value</a> > key)</td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="<API key>"></a>
V8EXPORT <a class="el" href="classv8_1_1_local.html">Local</a>< <a class="el" href="classv8_1_1_value.html">Value</a> > </td><td class="memItemRight" valign="bottom"><b>Get</b> (uint32_t index)</td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top">V8EXPORT PropertyAttribute </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1_object.html#<API key>"><API key></a> (<a class="el" href="classv8_1_1_handle.html">Handle</a>< <a class="el" href="classv8_1_1_value.html">Value</a> > key)</td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="<API key>"></a>
V8EXPORT bool </td><td class="memItemRight" valign="bottom"><b>Has</b> (<a class="el" href="classv8_1_1_handle.html">Handle</a>< <a class="el" href="classv8_1_1_string.html">String</a> > key)</td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="<API key>"></a>
V8EXPORT bool </td><td class="memItemRight" valign="bottom"><b>Delete</b> (<a class="el" href="classv8_1_1_handle.html">Handle</a>< <a class="el" href="classv8_1_1_string.html">String</a> > key)</td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="<API key>"></a>
V8EXPORT bool </td><td class="memItemRight" valign="bottom"><b>ForceDelete</b> (<a class="el" href="classv8_1_1_handle.html">Handle</a>< <a class="el" href="classv8_1_1_value.html">Value</a> > key)</td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="<API key>"></a>
V8EXPORT bool </td><td class="memItemRight" valign="bottom"><b>Has</b> (uint32_t index)</td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="<API key>"></a>
V8EXPORT bool </td><td class="memItemRight" valign="bottom"><b>Delete</b> (uint32_t index)</td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="<API key>"></a>
V8EXPORT bool </td><td class="memItemRight" valign="bottom"><b>SetAccessor</b> (<a class="el" href="classv8_1_1_handle.html">Handle</a>< <a class="el" href="classv8_1_1_string.html">String</a> > name, <a class="el" href="namespacev8.html#<API key>">AccessorGetter</a> getter, AccessorSetter setter=0, <a class="el" href="classv8_1_1_handle.html">Handle</a>< <a class="el" href="classv8_1_1_value.html">Value</a> > data=<a class="el" href="classv8_1_1_handle.html">Handle</a>< <a class="el" href="classv8_1_1_value.html">Value</a> >(), <a class="el" href="namespacev8.html#<API key>">AccessControl</a> settings=DEFAULT, PropertyAttribute attribute=None)</td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top">V8EXPORT <a class="el" href="classv8_1_1_local.html">Local</a>< <a class="el" href="classv8_1_1_array.html">Array</a> > </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1_object.html#<API key>">GetPropertyNames</a> ()</td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top">V8EXPORT <a class="el" href="classv8_1_1_local.html">Local</a>< <a class="el" href="classv8_1_1_array.html">Array</a> > </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1_object.html#<API key>">GetOwnPropertyNames</a> ()</td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top">V8EXPORT <a class="el" href="classv8_1_1_local.html">Local</a>< <a class="el" href="classv8_1_1_value.html">Value</a> > </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1_object.html#<API key>">GetPrototype</a> ()</td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top">V8EXPORT bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1_object.html#<API key>">SetPrototype</a> (<a class="el" href="classv8_1_1_handle.html">Handle</a>< <a class="el" href="classv8_1_1_value.html">Value</a> > prototype)</td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top">V8EXPORT <a class="el" href="classv8_1_1_local.html">Local</a>< <a class="el" href="classv8_1_1_object.html">Object</a> > </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1_object.html#<API key>"><API key></a> (<a class="el" href="classv8_1_1_handle.html">Handle</a>< <a class="el" href="<API key>.html">FunctionTemplate</a> > tmpl)</td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top">V8EXPORT <a class="el" href="classv8_1_1_local.html">Local</a>< <a class="el" href="classv8_1_1_string.html">String</a> > </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1_object.html#<API key>">ObjectProtoToString</a> ()</td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top">V8EXPORT <a class="el" href="classv8_1_1_local.html">Local</a>< <a class="el" href="classv8_1_1_value.html">Value</a> > </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1_object.html#<API key>">GetConstructor</a> ()</td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top">V8EXPORT <a class="el" href="classv8_1_1_local.html">Local</a>< <a class="el" href="classv8_1_1_string.html">String</a> > </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1_object.html#<API key>">GetConstructorName</a> ()</td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top">V8EXPORT int </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1_object.html#<API key>">InternalFieldCount</a> ()</td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classv8_1_1_local.html">Local</a>< <a class="el" href="classv8_1_1_value.html">Value</a> > </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1_object.html#<API key>">GetInternalField</a> (int index)</td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top">V8EXPORT void </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1_object.html#<API key>">SetInternalField</a> (int index, <a class="el" href="classv8_1_1_handle.html">Handle</a>< <a class="el" href="classv8_1_1_value.html">Value</a> > value)</td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top">void * </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1_object.html#<API key>"><API key></a> (int index)</td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top">V8EXPORT void </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1_object.html#<API key>"><API key></a> (int index, void *value)</td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="<API key>"></a>
V8EXPORT bool </td><td class="memItemRight" valign="bottom"><b>HasOwnProperty</b> (<a class="el" href="classv8_1_1_handle.html">Handle</a>< <a class="el" href="classv8_1_1_string.html">String</a> > key)</td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="<API key>"></a>
V8EXPORT bool </td><td class="memItemRight" valign="bottom"><b><API key></b> (<a class="el" href="classv8_1_1_handle.html">Handle</a>< <a class="el" href="classv8_1_1_string.html">String</a> > key)</td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="<API key>"></a>
V8EXPORT bool </td><td class="memItemRight" valign="bottom"><b><API key></b> (uint32_t index)</td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="<API key>"></a>
V8EXPORT bool </td><td class="memItemRight" valign="bottom"><b><API key></b> (<a class="el" href="classv8_1_1_handle.html">Handle</a>< <a class="el" href="classv8_1_1_string.html">String</a> > key)</td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top">V8EXPORT <a class="el" href="classv8_1_1_local.html">Local</a>< <a class="el" href="classv8_1_1_value.html">Value</a> > </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1_object.html#<API key>"><API key></a> (<a class="el" href="classv8_1_1_handle.html">Handle</a>< <a class="el" href="classv8_1_1_string.html">String</a> > key)</td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top">V8EXPORT <a class="el" href="classv8_1_1_local.html">Local</a>< <a class="el" href="classv8_1_1_value.html">Value</a> > </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1_object.html#<API key>"><API key></a> (<a class="el" href="classv8_1_1_handle.html">Handle</a>< <a class="el" href="classv8_1_1_string.html">String</a> > key)</td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top">V8EXPORT bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1_object.html#<API key>"><API key></a> ()</td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top">V8EXPORT bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1_object.html#<API key>"><API key></a> ()</td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top">V8EXPORT void </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1_object.html#<API key>">TurnOnAccessCheck</a> ()</td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top">V8EXPORT int </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1_object.html#<API key>">GetIdentityHash</a> ()</td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top">V8EXPORT bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1_object.html#<API key>">SetHiddenValue</a> (<a class="el" href="classv8_1_1_handle.html">Handle</a>< <a class="el" href="classv8_1_1_string.html">String</a> > key, <a class="el" href="classv8_1_1_handle.html">Handle</a>< <a class="el" href="classv8_1_1_value.html">Value</a> > value)</td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="<API key>"></a>
V8EXPORT <a class="el" href="classv8_1_1_local.html">Local</a>< <a class="el" href="classv8_1_1_value.html">Value</a> > </td><td class="memItemRight" valign="bottom"><b>GetHiddenValue</b> (<a class="el" href="classv8_1_1_handle.html">Handle</a>< <a class="el" href="classv8_1_1_string.html">String</a> > key)</td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="<API key>"></a>
V8EXPORT bool </td><td class="memItemRight" valign="bottom"><b>DeleteHiddenValue</b> (<a class="el" href="classv8_1_1_handle.html">Handle</a>< <a class="el" href="classv8_1_1_string.html">String</a> > key)</td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top">V8EXPORT bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1_object.html#<API key>">IsDirty</a> ()</td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top">V8EXPORT <a class="el" href="classv8_1_1_local.html">Local</a>< <a class="el" href="classv8_1_1_object.html">Object</a> > </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1_object.html#<API key>">Clone</a> ()</td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top">V8EXPORT <a class="el" href="classv8_1_1_local.html">Local</a>< <a class="el" href="classv8_1_1_context.html">Context</a> > </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1_object.html#<API key>">CreationContext</a> ()</td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top">V8EXPORT void </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1_object.html#<API key>"><API key></a> (uint8_t *data, int length)</td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="<API key>"></a>
V8EXPORT bool </td><td class="memItemRight" valign="bottom"><b><API key></b> ()</td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="<API key>"></a>
V8EXPORT uint8_t * </td><td class="memItemRight" valign="bottom"><b><API key></b> ()</td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="<API key>"></a>
V8EXPORT int </td><td class="memItemRight" valign="bottom"><b><API key></b> ()</td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top">V8EXPORT void </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1_object.html#<API key>"><API key></a> (void *data, ExternalArrayType array_type, int number_of_elements)</td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="<API key>"></a>
V8EXPORT bool </td><td class="memItemRight" valign="bottom"><b><API key></b> ()</td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="<API key>"></a>
V8EXPORT void * </td><td class="memItemRight" valign="bottom"><b><API key></b> ()</td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="<API key>"></a>
V8EXPORT ExternalArrayType </td><td class="memItemRight" valign="bottom"><b><API key></b> ()</td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="<API key>"></a>
V8EXPORT int </td><td class="memItemRight" valign="bottom"><b><API key></b> ()</td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top">V8EXPORT bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1_object.html#<API key>">IsCallable</a> ()</td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top">V8EXPORT <a class="el" href="classv8_1_1_local.html">Local</a>< <a class="el" href="classv8_1_1_value.html">Value</a> > </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1_object.html#<API key>">CallAsFunction</a> (<a class="el" href="classv8_1_1_handle.html">Handle</a>< <a class="el" href="classv8_1_1_object.html">Object</a> > recv, int argc, <a class="el" href="classv8_1_1_handle.html">Handle</a>< <a class="el" href="classv8_1_1_value.html">Value</a> > argv[])</td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top">V8EXPORT <a class="el" href="classv8_1_1_local.html">Local</a>< <a class="el" href="classv8_1_1_value.html">Value</a> > </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1_object.html#<API key>">CallAsConstructor</a> (int argc, <a class="el" href="classv8_1_1_handle.html">Handle</a>< <a class="el" href="classv8_1_1_value.html">Value</a> > argv[])</td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="inherit_header <API key>"><td colspan="2" onclick="javascript:toggleInherit('<API key>')"><img src="closed.png" alt="-"/> Public Member Functions inherited from <a class="el" href="classv8_1_1_value.html">v8::Value</a></td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1_value.html#<API key>">IsUndefined</a> () const </td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1_value.html#<API key>">IsNull</a> () const </td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top">V8EXPORT bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1_value.html#<API key>">IsTrue</a> () const </td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top">V8EXPORT bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1_value.html#<API key>">IsFalse</a> () const </td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1_value.html#<API key>">IsString</a> () const </td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top">V8EXPORT bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1_value.html#<API key>">IsFunction</a> () const </td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top">V8EXPORT bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1_value.html#<API key>">IsArray</a> () const </td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top">V8EXPORT bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1_value.html#<API key>">IsObject</a> () const </td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top">V8EXPORT bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1_value.html#<API key>">IsBoolean</a> () const </td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top">V8EXPORT bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1_value.html#<API key>">IsNumber</a> () const </td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top">V8EXPORT bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1_value.html#<API key>">IsExternal</a> () const </td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top">V8EXPORT bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1_value.html#<API key>">IsInt32</a> () const </td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top">V8EXPORT bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1_value.html#<API key>">IsUint32</a> () const </td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top">V8EXPORT bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1_value.html#<API key>">IsDate</a> () const </td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top">V8EXPORT bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1_value.html#<API key>">IsBooleanObject</a> () const </td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top">V8EXPORT bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1_value.html#<API key>">IsNumberObject</a> () const </td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top">V8EXPORT bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1_value.html#<API key>">IsStringObject</a> () const </td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top">V8EXPORT bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1_value.html#<API key>">IsNativeError</a> () const </td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top">V8EXPORT bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1_value.html#<API key>">IsRegExp</a> () const </td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="<API key>"></a>
V8EXPORT <a class="el" href="classv8_1_1_local.html">Local</a>< <a class="el" href="classv8_1_1_boolean.html">Boolean</a> > </td><td class="memItemRight" valign="bottom"><b>ToBoolean</b> () const </td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="<API key>"></a>
V8EXPORT <a class="el" href="classv8_1_1_local.html">Local</a>< <a class="el" href="classv8_1_1_number.html">Number</a> > </td><td class="memItemRight" valign="bottom"><b>ToNumber</b> () const </td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="<API key>"></a>
V8EXPORT <a class="el" href="classv8_1_1_local.html">Local</a>< <a class="el" href="classv8_1_1_string.html">String</a> > </td><td class="memItemRight" valign="bottom"><b>ToString</b> () const </td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="<API key>"></a>
V8EXPORT <a class="el" href="classv8_1_1_local.html">Local</a>< <a class="el" href="classv8_1_1_string.html">String</a> > </td><td class="memItemRight" valign="bottom"><b>ToDetailString</b> () const </td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="<API key>"></a>
V8EXPORT <a class="el" href="classv8_1_1_local.html">Local</a>< <a class="el" href="classv8_1_1_object.html">Object</a> > </td><td class="memItemRight" valign="bottom"><b>ToObject</b> () const </td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="<API key>"></a>
V8EXPORT <a class="el" href="classv8_1_1_local.html">Local</a>< <a class="el" href="classv8_1_1_integer.html">Integer</a> > </td><td class="memItemRight" valign="bottom"><b>ToInteger</b> () const </td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="<API key>"></a>
V8EXPORT <a class="el" href="classv8_1_1_local.html">Local</a>< <a class="el" href="classv8_1_1_uint32.html">Uint32</a> > </td><td class="memItemRight" valign="bottom"><b>ToUint32</b> () const </td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="<API key>"></a>
V8EXPORT <a class="el" href="classv8_1_1_local.html">Local</a>< <a class="el" href="classv8_1_1_int32.html">Int32</a> > </td><td class="memItemRight" valign="bottom"><b>ToInt32</b> () const </td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top">V8EXPORT <a class="el" href="classv8_1_1_local.html">Local</a>< <a class="el" href="classv8_1_1_uint32.html">Uint32</a> > </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1_value.html#<API key>">ToArrayIndex</a> () const </td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="<API key>"></a>
V8EXPORT bool </td><td class="memItemRight" valign="bottom"><b>BooleanValue</b> () const </td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="<API key>"></a>
V8EXPORT double </td><td class="memItemRight" valign="bottom"><b>NumberValue</b> () const </td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="<API key>"></a>
V8EXPORT int64_t </td><td class="memItemRight" valign="bottom"><b>IntegerValue</b> () const </td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="<API key>"></a>
V8EXPORT uint32_t </td><td class="memItemRight" valign="bottom"><b>Uint32Value</b> () const </td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="<API key>"></a>
V8EXPORT int32_t </td><td class="memItemRight" valign="bottom"><b>Int32Value</b> () const </td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top">V8EXPORT bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1_value.html#<API key>">Equals</a> (<a class="el" href="classv8_1_1_handle.html">Handle</a>< <a class="el" href="classv8_1_1_value.html">Value</a> > that) const </td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="<API key>"></a>
V8EXPORT bool </td><td class="memItemRight" valign="bottom"><b>StrictEquals</b> (<a class="el" href="classv8_1_1_handle.html">Handle</a>< <a class="el" href="classv8_1_1_value.html">Value</a> > that) const </td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr class="memitem:<API key>"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="<API key>"></a>
static V8EXPORT <a class="el" href="classv8_1_1_local.html">Local</a>< <a class="el" href="classv8_1_1_value.html">Value</a> > </td><td class="memItemRight" valign="bottom"><b>New</b> (<a class="el" href="classv8_1_1_handle.html">Handle</a>< <a class="el" href="classv8_1_1_string.html">String</a> > value)</td></tr>
<tr class="separator:<API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key>"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="<API key>"></a>
static <a class="el" href="<API key>.html">StringObject</a> * </td><td class="memItemRight" valign="bottom"><b>Cast</b> (<a class="el" href="classv8_1_1_value.html">v8::Value</a> *obj)</td></tr>
<tr class="separator:<API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="inherit_header <API key>"><td colspan="2" onclick="javascript:toggleInherit('<API key>')"><img src="closed.png" alt="-"/> Static Public Member Functions inherited from <a class="el" href="classv8_1_1_object.html">v8::Object</a></td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="<API key>"></a>
static V8EXPORT <a class="el" href="classv8_1_1_local.html">Local</a>< <a class="el" href="classv8_1_1_object.html">Object</a> > </td><td class="memItemRight" valign="bottom"><b>New</b> ()</td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="<API key>"></a>
static <a class="el" href="classv8_1_1_object.html">Object</a> * </td><td class="memItemRight" valign="bottom"><b>Cast</b> (<a class="el" href="classv8_1_1_value.html">Value</a> *obj)</td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>A <a class="el" href="classv8_1_1_string.html">String</a> object (ECMA-262, 4.3.18). </p>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="<API key>"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">V8EXPORT <a class="el" href="classv8_1_1_local.html">Local</a><<a class="el" href="classv8_1_1_string.html">String</a>> v8::StringObject::StringValue </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns the <a class="el" href="classv8_1_1_string.html">String</a> held by the object. </p>
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>deps/v8/include/<a class="el" href="v8_8h_source.html">v8.h</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Tue Aug 11 2015 23:45:21 for V8 API Reference Guide for node.js v0.10.32 - v0.10.33 by &
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.9.1
</small></address>
</body>
</html> |
import React /* { Component } */ from "react"
import { Link } from "gatsby"
import Img from "gatsby-image"
import FaExtLink from "react-icons/lib/fa/external-link"
import FaGithub from "react-icons/lib/fa/github"
import FaClipboard from "react-icons/lib/fa/clipboard"
import { /* options, rhythm, */ scale, rhythm } from "../../utils/typography"
import presets, { colors } from "../../utils/presets"
import copyToClipboard from "../../utils/copy-to-clipboard"
import styles from "../shared/styles"
const ShowcaseList = ({ urlState, items, imgs, count, sortRecent }) => {
if (!items.length) {
// empty state!
const emptyStateReason =
urlState.s !== ``
? urlState.s // if theres a search term
: urlState.d && !Array.isArray(urlState.d)
? urlState.d // if theres a single dependency
: `matching` // if no search term or single dependency
return (
<div
css={{
display: `grid`,
height: `80%`,
alignItems: `center`,
justifyContent: `center`,
textAlign: `center`,
}}
>
<h1>
No {`${emptyStateReason}`} starters found!
<div css={{ color: colors.gatsby }}>
<small>
Maybe you should write one and
{` `}
<a href="https://github.com/gatsbyjs/gatsby/issues/new?template=feature_request.md">
submit it
</a>
?
</small>
</div>
</h1>
</div>
)
}
if (count) items = items.sort(sortingFunction(sortRecent)).slice(0, count)
return (
<div
css={{
display: `flex`,
flexWrap: `wrap`,
padding: rhythm(3 / 4),
justifyContent: `center`,
[presets.Desktop]: {
justifyContent: `flex-start`,
},
}}
>
{items.map(({ node }) => {
const {
githubData,
description,
stars,
githubFullName,
stub,
gatsbyDependencies,
} = node.fields.starterShowcase
const gatsbyVersion = gatsbyDependencies.find(
([k, v]) => k === `gatsby`
)[1]
const match = gatsbyVersion.match(/([0-9]+)([.])([0-9]+)/) // we just want x.x
const minorVersion = match ? match[0] : gatsbyVersion // default to version if no match
const <API key> = !/(2..+|next|latest)/g.test(minorVersion) // either 2.x or next or latest
const imgsharp = imgsFilter(imgs, stub)
const repo = githubData.repoMetadata
const { pushed_at } = repo
return (
node.fields && ( // have to filter out null fields from bad data
<div
key={node.id}
css={{
margin: rhythm(3 / 4),
width: 280,
}}
{...styles.withTitleHover}
>
<Link
to={`/starters/${stub}`}
state={{ isModal: true }}
css={{
"&&": {
borderBottom: `none`,
boxShadow: `none`,
transition: `all ${presets.animation.speedDefault} ${
presets.animation.curveDefault
}`,
"&:hover": {
styles.screenshotHover,
// manual patch for hover
boxShadow: `0 8px 20px rgba(157,124,191,0.5)`,
transform: `translateY(-3px)`,
},
},
}}
>
<div
className="<API key>"
css={{
transition: `all ${presets.animation.speedDefault} ${
presets.animation.curveDefault
}`,
}}
>
{imgsharp ? (
<Img
fluid={imgsharp.childImageSharp.fluid}
alt={`Screenshot of ${imgsharp.name}`}
css={{
styles.screenshot,
marginBottom: 0,
}}
/>
) : (
<div
css={{
// height: 230,
width: 320,
backgroundColor: `#d999e7`,
}}
>
missing
</div>
)}
</div>
</Link>
<div
css={{
scale(-2 / 5),
color: `#9B9B9B`,
fontWeight: `normal`,
}}
>
<div css={{ display: `flex`, justifyContent: `space-between` }}>
{repo.owner && repo.owner.login} /
<span>
<a
href="#copy-to-clipboard"
onClick={() =>
copyToClipboard(`https://github.com/${githubFullName}`)
}
css={{ ...styles.noLinkUnderline }}
>
<FaClipboard />
{` `}
</a>
<a
href={node.frontmatter.demo}
target="_blank"
rel="noopener noreferrer"
css={{ ...styles.noLinkUnderline }}
>
<FaExtLink />
{` `}
</a>
<a
href={`https://github.com/${githubFullName}`}
target="_blank"
rel="noopener noreferrer"
css={{ ...styles.noLinkUnderline }}
>
<FaGithub />
{` `}
</a>
</span>
</div>
<div>
<span className="title">
<h5 css={{ margin: 0 }}>
<strong>{repo.name}</strong>
</h5>
</span>
</div>
<div
css={{
textOverflow: `ellipsis`,
overflow: `hidden`,
whiteSpace: `nowrap`,
}}
>
{description || `No description`}
</div>
<div css={{ display: `flex`, justifyContent: `space-between` }}>
<div css={{ display: `inline-block` }}>
<span role="img" aria-label="star">
</span>
{stars}
</div>
<div css={{ display: `inline-block` }}>
Updated {new Date(pushed_at).toLocaleDateString()}
</div>
</div>
</div>
</div>
)
)
})}
</div>
)
}
export default ShowcaseList
function imgsFilter(imgs, stub) {
const result = imgs.filter(img => img.node.name === stub)
return result.length ? result[0].node : null
}
function sortingFunction(sortRecent) {
return function({ node: nodeA }, { node: nodeB }) {
const safewrap = obj =>
sortRecent
? new Date(obj.githubData.repoMetadata.pushed_at)
: obj[`stars`]
const metricA = safewrap(nodeA.fields.starterShowcase)
const metricB = safewrap(nodeB.fields.starterShowcase)
return metricB - metricA
}
} |
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { By } from '@angular/platform-browser';
import { DebugElement } from '@angular/core';
import { ModeComponent } from './mode.component';
export function main() {
describe('ModeComponent (inline template)', () => {
let comp: ModeComponent;
let fixture: ComponentFixture<ModeComponent>;
let de: DebugElement;
let el: HTMLElement;
beforeEach(() => {
TestBed.<API key>({
declarations: [ ModeComponent ], // declare the test component
});
fixture = TestBed.createComponent(ModeComponent);
comp = fixture.componentInstance; // BannerComponent test instance
// query for the title <h1> by CSS element selector
de = fixture.debugElement.query(By.css('h1'));
el = de.nativeElement;
});
});
} |
'use strict';
function <API key>($scope, $modalInstance, franklinAPIService,
franklinReposModel) {
const dmc = this;
dmc.showLoader = false;
dmc.showLoaders = new Array($scope.deployableRepos.length);
dmc.showLoaders.map((x) => x = false);
const functions = {
registerRepo,
cancel,
solve,
error
};
Object.assign(dmc, functions);
function cancel() {
$modalInstance.dismiss('cancel');
dmc.showLoader = false;
};
function error(data) {
$modalInstance.dismiss(data);
dmc.showLoader = false;
}
function solve(data) {
dmc.showLoaders.map((x) => x = false);
$modalInstance.close(data);
dmc.showLoader = false;
}
function registerRepo(repo, index) {
dmc.showLoader = true;
dmc.showLoaders[index] = true;
//create POST payload
let payload = {
github: `${repo.full_name}`
}
//register repo in Franklin API
let response =
franklinAPIService.userRepos.registerRepo(payload);
response.$promise.then(dmc.solve, dmc.error);
}
}
export {
<API key>
} |
package com.facebook.android;
public final class R {
public static final class attr {
}
public static final class drawable {
public static final int black=0x7f0200a3;
public static final int border=0x7f020000;
public static final int <API key>=0x7f020001;
public static final int <API key>=0x7f020002;
public static final int <API key>=0x7f020003;
public static final int <API key>=0x7f020004;
public static final int <API key>=0x7f020005;
public static final int <API key>=0x7f020006;
public static final int <API key>=0x7f020007;
public static final int <API key>=0x7f020008;
public static final int channel_1russ=0x7f020009;
public static final int channel_afro=0x7f02000a;
public static final int channel_aljaz=0x7f02000b;
public static final int channel_artv=0x7f02000c;
public static final int channel_axbhd=0x7f02000d;
public static final int channel_axn=0x7f02000e;
public static final int channel_axnbl=0x7f02000f;
public static final int channel_axnhd=0x7f020010;
public static final int channel_baby=0x7f020011;
public static final int channel_barca=0x7f020012;
public static final int channel_bbc=0x7f020013;
public static final int channel_bbcw=0x7f020014;
public static final int channel_biog=0x7f020015;
public static final int channel_bloom=0x7f020016;
public static final int channel_bnt=0x7f020017;
public static final int channel_bvahd=0x7f020018;
public static final int channel_cart=0x7f020019;
public static final int channel_cclub=0x7f02001a;
public static final int channel_chels=0x7f02001b;
public static final int channel_cmus=0x7f02001c;
public static final int channel_cnbc=0x7f02001d;
public static final int channel_cnn=0x7f02001e;
public static final int channel_cubav=0x7f02001f;
public static final int channel_demo=0x7f020020;
public static final int channel_discv=0x7f020021;
public static final int channel_disny=0x7f020022;
public static final int channel_dwtv=0x7f020023;
public static final int channel_e=0x7f020024;
public static final int channel_espn=0x7f020025;
public static final int channel_espna=0x7f020026;
public static final int channel_etv=0x7f020027;
public static final int channel_etvhd=0x7f020028;
public static final int channel_eurch=0x7f020029;
public static final int channel_eurhd=0x7f02002a;
public static final int channel_eurn=0x7f02002b;
public static final int channel_eurs2=0x7f02002c;
public static final int channel_eursn=0x7f02002d;
public static final int channel_eursp=0x7f02002e;
public static final int channel_fash=0x7f02002f;
public static final int channel_flife=0x7f020030;
public static final int channel_fln=0x7f020031;
public static final int channel_fnews=0x7f020032;
public static final int channel_fnext=0x7f020033;
public static final int channel_food=0x7f020034;
public static final int channel_foodh=0x7f020035;
public static final int channel_fox=0x7f020036;
public static final int channel_foxcr=0x7f020037;
public static final int channel_foxhd=0x7f020038;
public static final int channel_fr24f=0x7f020039;
public static final int channel_fr24i=0x7f02003a;
public static final int channel_fuel=0x7f02003b;
public static final int channel_fx=0x7f02003c;
public static final int channel_globo=0x7f02003d;
public static final int channel_gvis=0x7f02003e;
public static final int channel_hist=0x7f02003f;
public static final int channel_hollw=0x7f020040;
public static final int channel_hot=0x7f020041;
public static final int channel_inter=0x7f020042;
public static final int channel_jjam=0x7f020043;
public static final int channel_juke=0x7f020044;
public static final int channel_ksic=0x7f020045;
public static final int channel_luxhd=0x7f020046;
public static final int channel_luxsd=0x7f020047;
public static final int channel_m6=0x7f020048;
public static final int channel_max=0x7f020049;
public static final int channel_mcmp=0x7f02004a;
public static final int channel_mcmt=0x7f02004b;
public static final int channel_mezhd=0x7f02004c;
public static final int channel_mezzo=0x7f02004d;
public static final int channel_mgm=0x7f02004e;
public static final int channel_motor=0x7f02004f;
public static final int channel_mtv=0x7f020050;
public static final int channel_mutv=0x7f020051;
public static final int channel_ngc=0x7f020052;
public static final int channel_nghd=0x7f020053;
public static final int channel_ngmus=0x7f020054;
public static final int channel_ngwil=0x7f020055;
public static final int channel_odiss=0x7f020056;
public static final int channel_panda=0x7f020057;
public static final int channel_pfc=0x7f020058;
public static final int channel_phcne=0x7f020059;
public static final int channel_play=0x7f02005a;
public static final int channel_poker=0x7f02005b;
public static final int channel_porto=0x7f02005c;
public static final int channel_protv=0x7f02005d;
public static final int channel_q=0x7f02005e;
public static final int channel_rmtv=0x7f02005f;
public static final int channel_rtp1=0x7f020060;
public static final int channel_rtp1hd=0x7f020061;
public static final int channel_rtp2=0x7f020062;
public static final int channel_rtpa=0x7f020063;
public static final int channel_rtpac=0x7f020064;
public static final int channel_rtpm=0x7f020065;
public static final int channel_rtpmd=0x7f020066;
public static final int channel_rtpn=0x7f020067;
public static final int channel_russt=0x7f020068;
public static final int channel_sabtv=0x7f020069;
public static final int channel_sail=0x7f02006a;
public static final int channel_setas=0x7f02006b;
public static final int channel_sic=0x7f02006c;
public static final int channel_sicm=0x7f02006d;
public static final int channel_sicn=0x7f02006e;
public static final int channel_sicr=0x7f02006f;
public static final int channel_skyn=0x7f020070;
public static final int channel_slb=0x7f020071;
public static final int channel_sony=0x7f020072;
public static final int channel_spihd=0x7f020073;
public static final int channel_sptgh=0x7f020074;
public static final int channel_spthd=0x7f020075;
public static final int channel_sptv1=0x7f020076;
public static final int channel_sptv2=0x7f020077;
public static final int channel_sptv3=0x7f020078;
public static final int channel_sptvg=0x7f020079;
public static final int channel_style=0x7f02007a;
public static final int channel_syfhd=0x7f02007b;
public static final int channel_syfy=0x7f02007c;
public static final int channel_tampl=0x7f02007d;
public static final int channel_tbrav=0x7f02007e;
public static final int channel_tcm=0x7f02007f;
public static final int channel_tpa=0x7f020080;
public static final int channel_trace=0x7f020081;
public static final int channel_trail=0x7f020082;
public static final int channel_trav=0x7f020083;
public static final int channel_trvhd=0x7f020084;
public static final int channel_tv=0x7f020085;
public static final int channel_tv5=0x7f020086;
public static final int channel_tvbra=0x7f020087;
public static final int channel_tvc1=0x7f020088;
public static final int channel_tvc2=0x7f020089;
public static final int channel_tvc3=0x7f02008a;
public static final int channel_tve24=0x7f02008b;
public static final int channel_tvei=0x7f02008c;
public static final int channel_tvgal=0x7f02008d;
public static final int channel_tvi=0x7f02008e;
public static final int channel_tvi24=0x7f02008f;
public static final int channel_tvrec=0x7f020090;
public static final int channel_venus=0x7f020091;
public static final int channel_vh1=0x7f020092;
public static final int channel_zoner=0x7f020093;
public static final int facebook_icon=0x7f020094;
public static final int gps=0x7f020095;
public static final int home=0x7f020096;
public static final int icon=0x7f020097;
public static final int login=0x7f020098;
public static final int login_button=0x7f020099;
public static final int login_down=0x7f02009a;
public static final int logout=0x7f02009b;
public static final int logout_button=0x7f02009c;
public static final int logout_down=0x7f02009d;
public static final int maps=0x7f02009e;
public static final int ratingbar_full=0x7f02009f;
public static final int <API key>=0x7f0200a0;
public static final int <API key>=0x7f0200a1;
public static final int white=0x7f0200a2;
}
public static final class id {
public static final int btnCancel=0x7f080001;
public static final int btnOk=0x7f080002;
public static final int editsearch=0x7f080005;
public static final int groupConfig=0x7f080023;
public static final int groupGPS=0x7f08001d;
public static final int groupView=0x7f080020;
public static final int idImageView=0x7f080007;
public static final int idTextView=0x7f080009;
public static final int idTextViewDate=0x7f08001a;
public static final int idTextViewDay=0x7f080019;
public static final int idTextViewHour=0x7f08000a;
public static final int itemDesligarGPS=0x7f08001f;
public static final int itemEstrada=0x7f080022;
public static final int itemFavoritos=0x7f080025;
public static final int itemHome=0x7f080024;
public static final int itemInfo=0x7f08001c;
public static final int itemLigarGps=0x7f08001e;
public static final int itemSatelite=0x7f080021;
public static final int listFavourites=0x7f08000f;
public static final int listPrograms=0x7f080016;
public static final int login=0x7f080003;
public static final int lstMeochannels=0x7f080006;
public static final int main_casa=0x7f080011;
public static final int main_program=0x7f080012;
public static final int mapa_gps=0x7f080014;
public static final int mapa_maps_conf=0x7f080015;
public static final int mapview=0x7f080013;
public static final int next_program=0x7f08001b;
public static final int prev_program=0x7f080017;
public static final int <API key>=0x7f080018;
public static final int programfooter=0x7f080010;
public static final int ratingfavourite=0x7f080008;
public static final int txt=0x7f080004;
public static final int txtDialog=0x7f080000;
public static final int txtInfoDescription=0x7f08000e;
public static final int txtInfoEnd=0x7f08000d;
public static final int txtInfoName=0x7f08000b;
public static final int txtInfoStart=0x7f08000c;
}
public static final class integer {
/** every 10 minutes
*/
public static final int <API key>=0x7f040001;
public static final int gpsUpdatesMinTime=0x7f040000;
/** 2 hours
*/
public static final int <API key>=0x7f040004;
/** 5 minutes
*/
public static final int maxNotificationTime=0x7f040003;
/** every 100 meters
*/
public static final int minNotificationTime=0x7f040002;
}
public static final class layout {
public static final int dialog=0x7f030000;
public static final int facebook=0x7f030001;
public static final int favouritechannels=0x7f030002;
public static final int imagetext=0x7f030003;
public static final int imagetexthome=0x7f030004;
public static final int imagetextprograms=0x7f030005;
public static final int information=0x7f030006;
public static final int main=0x7f030007;
public static final int map=0x7f030008;
public static final int programs=0x7f030009;
}
public static final class menu {
public static final int contextmenu=0x7f070000;
public static final int mapagps=0x7f070001;
public static final int mapamenu=0x7f070002;
public static final int menus=0x7f070003;
}
public static final class string {
public static final int Canais=0x7f050010;
public static final int Casa=0x7f05000c;
public static final int GPS=0x7f05000d;
public static final int HelloCasa=0x7f05000f;
public static final int IDescricao=0x7f050014;
public static final int IFim=0x7f050013;
public static final int IInicio=0x7f050012;
public static final int IName=0x7f050011;
public static final int Maps=0x7f05000e;
public static final int app_name=0x7f050000;
public static final int home=0x7f050001;
public static final int homefavourite=0x7f050003;
public static final int next_action=0x7f050005;
public static final int <API key>=0x7f05000b;
public static final int <API key>=0x7f050009;
public static final int <API key>=0x7f05000a;
public static final int post=0x7f050008;
public static final int prev_action=0x7f050007;
public static final int programs_home=0x7f050006;
public static final int selectfavourite=0x7f050002;
public static final int setup_footer=0x7f050004;
}
public static final class style {
public static final int smallRatingBar=0x7f060000;
}
} |
#include <VBE/system/Storage.hpp>
#include <VBE/system/StorageImpl.hpp>
// static
std::unique_ptr<std::istream> Storage::openAsset(const std::string& filename) {
return StorageImpl::openAsset(filename);
}
// static
std::string Storage::readToString(std::unique_ptr<std::istream> file){
// get length of file
file->seekg(0, std::ios::end);
int length = (int) file->tellg();
file->seekg(0, std::ios::beg);
// allocate memory
std::string s(length, 0);
// read data as a block
file->read(&s[0], length);
return s;
}
// static
void Storage::setAssetPath(std::string path) {
StorageImpl::setAssetPath(path);
} |
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Single Page Apps for GitHub Pages</title>
<script type="text/javascript">
// Single Page Apps for GitHub Pages
// This script takes the current url and converts the path and query
// string into just a query string, and then redirects the browser
// to the new url with only a query string and hash fragment,
// e.g. http://www.foo.tld/one/two?a=b&c=d#qwe, becomes
// http://www.foo.tld/?p=/one/two&q=a=b~and~c=d#qwe
// Note: this 404.html file must be at least 512 bytes for it to work
// with Internet Explorer (it is currently > 512 bytes)
// If you're creating a Project Pages site and NOT using a custom domain,
// then set segmentCount to 1 (enterprise users may need to set it to > 1).
// This way the code will only replace the route part of the path, and not
// the real directory in which the app resides, for example:
// https://username.github.io/repo-name/one/two?a=b&c=d#qwe becomes
// https://username.github.io/repo-name/?p=/one/two&q=a=b~and~c=d#qwe
// Otherwise, leave segmentCount as 0.
var segmentCount = 1;
var l = window.location;
l.replace(
l.protocol + '//' + l.hostname + (l.port ? ':' + l.port : '') +
l.pathname.split('/').slice(0, 1 + segmentCount).join('/') + '/?p=/' +
l.pathname.slice(1).split('/').slice(segmentCount).join('/').replace(/&/g, '~and~') +
(l.search ? '&q=' + l.search.slice(1).replace(/&/g, '~and~') : '') +
l.hash
);
</script>
</head>
<body>
</body>
</html> |
(function () {
var app = angular.module('contactApp');
app.controller('contactController', contactController);
function contactController($scope, $http, $routeParams, filterFilter, contactFactory) {
vm = this
vm.dclocation = $routeParams.siteId
vm.selectedUserEmail = [];
vm.<API key> = <API key>;
function <API key>(user) {
vm.selectedUserEmail = user
}
contactFactory.getData().then(display)
function display(response) {
vm.dccontacts = filterFilter(response.data, { name: vm.dclocation });
}
}
})(); |
# Tumblfetch
Fetch images from tumblr.
## Installation
$ gem install tumblfetch
## Usage
$ cd ~/path/to/download
$ tumblfetch init
$ vi .fetch
$ tumblfetch
## Contributing
1. Fork it ( https://github.com/senosa/tumblfetch/fork )
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request |
<pre>
There was a server error: <br>
<?php print_r((array)$error_message) ?>
</pre>
<script language="javascript" type="text/javascript">
var error_message = '<?php echo json_encode((array)$error_message) ?>';
window.top.window.showError(error_message);
</script>
<?php require_once dirname(__FILE__).'/../../../templates/ga-tracking.php' ?> |
import React from 'react';
import PropTypes from 'prop-types';
import cx from 'classnames';
const FormElementLabel = (props) => {
const {
className,
hideLabel,
id,
label,
legend,
readOnly,
required,
rest
} = props;
const renderRequired = () => {
if (required) {
return (<abbr className="slds-required" title="required">*</abbr>);
}
return null;
};
let Tag = 'label';
if (readOnly) {
Tag = 'span';
} else if (legend) {
Tag = 'legend';
}
const sldsClasses = [
'<API key>',
{ '<API key>': !!legend },
{ 'slds-assistive-text': hideLabel },
className
];
return (
<Tag {...rest} className={cx(sldsClasses)} htmlFor={readOnly || legend ? null : id}>
{renderRequired()}
{label}
</Tag>
);
};
FormElementLabel.defaultProps = {
className: null,
hideLabel: false,
legend: false,
readOnly: false,
required: false,
};
FormElementLabel.propTypes = {
/**
* class name
*/
className: PropTypes.string,
/**
* id of the corresponding input tag element
*/
id: PropTypes.string.isRequired,
/**
* sets the label to render as assistive text
*/
hideLabel: PropTypes.bool,
/**
* label content
*/
label: PropTypes.node.isRequired,
/**
* Renders as a html5 legend
*/
legend: PropTypes.bool,
/**
* renders the label as a span-tag instead of a label-tag
*/
readOnly: PropTypes.bool,
/**
* label for required inputs
*/
required: PropTypes.bool,
};
export default FormElementLabel; |
import time
import numpy as np
import pandas as pd
from sklearn import linear_model
from sklearn.metrics import mean_squared_error
from sklearn.neural_network import MLPRegressor
from sklearn.ensemble import <API key>
import matplotlib.pyplot as plt
from prepare.prepare_lin import PrepareDataLin
from prepare.prepare_wang import PrepareDataWang
from util.optimizer import Optimizer
def eval_model(model, train_x, train_y, test_x, test_y, name, prepare):
start_time = time.time()
model.fit(train_x, train_y)
print
print 'Training model %s in %.3f seconds.' % (name, time.time() - start_time)
train_pred = model.predict(train_x)
train_mse = mean_squared_error(train_y, train_pred)
test_pred = model.predict(test_x)
test_mse = mean_squared_error(test_y, test_pred)
print '%s:\n\ttrain_mse: %f\n\ttest_mse: %f' % (name, train_mse, test_mse)
return {'train_mse': train_mse, 'test_mse': test_mse}
def loss_curve(model, param_name, param_values, title):
def get_mse(v):
model.set_params(**{param_name: v})
return eval_model(model, train_x, train_y, test_x, test_y, title, prepare)
result = map(get_mse, param_values)
train_mses = map(lambda x: x['train_mse'], result)
test_mses = map(lambda x: x['test_mse'], result)
plt.plot(param_values, train_mses, 'b-', param_values, test_mses, 'g-')
plt.xlabel(param_name)
plt.ylabel('MSE')
plt.title(title)
plt.show()
prepare = PrepareDataWang()
# prepare = PrepareDataLin()
all_data = prepare.get_data()
np.random.shuffle(all_data)
test_size = int(0.2 * len(all_data))
train_x = [d['x'] for d in all_data[test_size:]]
train_y = [d['y'] for d in all_data[test_size:]]
test_x = [d['x'] for d in all_data[:test_size]]
test_y = [d['y'] for d in all_data[:test_size]]
print 'Data size: %d training, %d testing' % (len(train_x), len(test_x))
regr = linear_model.LinearRegression(n_jobs=4)
mlp = MLPRegressor(solver='adam',
alpha=0.0001,
hidden_layer_sizes=(15, 15, 15),
random_state=1,
activation="relu",
max_iter=500)
gbrt = <API key>(max_depth=5,
n_estimators=500)
print '=============================='
eval_model(regr, train_x, train_y, test_x, test_y, 'Linear', prepare)
eval_model(gbrt, train_x, train_y, test_x, test_y, 'Boosting', prepare)
eval_model(mlp, train_x, train_y, test_x, test_y, 'MLP', prepare)
print '=============================='
mlp_optimizer = Optimizer(mlp)
alpha_values = [0.0001, 0.0003, 0.001, 0.003]
layer_values = [(5, 5), (10, 10), (15, 15), (20, 20)]
# layer_values = [(15, 15, 15)]
# loss_curve(mlp, 'hidden_layer_sizes', layer_values, 'MLP')
n_est_number = [100, 150, 200, 300]
l_rate_values = [0.01, 0.03, 0.1]
# loss_curve(gbrt, 'n_estimators', n_est_number, 'Boosting')
loss_curve(gbrt, 'learning_rate', l_rate_values, 'Boosting')
def get_score(model):
model.fit(train_x, train_y)
test_pred = model.predict(test_x)
test_mse = mean_squared_error(test_y, test_pred)
return test_mse
# score = mlp_optimizer.step('alpha', alpha_values).step('hidden_layer_sizes', layer_values).solve(get_score)
# print 'BEST score: ', score
# print 'BEST: ', mlp_optimizer.params
# eval_model(regr, training_data, test_data, 'Linear', prepare)
# eval_model(mlp, training_data, test_data, 'MLP', prepare)
# alpha_values = range(1, 10, 2)
# alpha_values = map(lambda x: 0.0001 * x, alpha_values)
# loss_curve(mlp, 'alpha', alpha_values, 'MLP')
# iter_values = range(500, 1000, 100)
# loss_curve(mlp, 'max_iter', iter_values, 'MLP')
# 200 best
(200, 200, 200)
# layer_values = range(50, 150, 10)
# layer_values = map(lambda x: (x, x, x), layer_values)
# loss_curve(mlp, 'hidden_layer_sizes', layer_values, 'MLP') |
using HomeWork.Services;
using HomeWork.ViewModels;
using Microsoft.AspNet.Identity;
using Microsoft.AspNet.Identity.Owin;
using Newtonsoft.Json;
using Microsoft.Practices.Unity;
using System.Web;
using System.Web.Mvc;
using HomeWork.Model;
using System.Collections.Generic;
using System.Dynamic;
namespace HomeWork.Controllers
{
public class HomeController : Controller
{
public HomeController()
{
//vm = new HomeWorkViewModel(
// new Dal.<API key>(),
// UserManager.FindById(User.Identity.GetUserId())
}
public ActionResult Index()
{
if (Request.IsAuthenticated)
return Redirect("/Home/UserHome");
return View();
}
[Authorize()]
public ActionResult UserHome()
{
IUnityContainer unityContainer = UnityConfig.<API key>();
Data.IHomeWorkContext context = unityContainer.Resolve<Data.IHomeWorkContext>();
HomeWorkService service = new HomeWorkService(context);
ViewBag.Semester = service.GetCurrentSemester(User.Identity.GetUserId());
ViewBag.Assignments = service.<API key>(ViewBag.Semester);
ViewBag.Courses = service.<API key>(ViewBag.Semester);
return View();
}
public ContentResult Assignments()
{
// need to not use unity here, just testing
var unityContainer = UnityConfig.<API key>();
Data.IHomeWorkContext context = unityContainer.Resolve<Data.IHomeWorkContext>();
HomeWorkService service = new HomeWorkService(context);
ISemester semester = service.GetCurrentSemester(User.Identity.GetUserId());
IList<ICourse> courses = service.<API key>(semester);
IList<IAssignment> assignments = service.<API key>(semester);
dynamic data = new ExpandoObject();
data.Semester = semester;
data.Courses = courses;
data.Assignments = assignments;
string converted = JsonConvert.SerializeObject(
data,
Formatting.Indented,
new <API key> { <API key> = <API key>.Objects });
return Content(converted, "application/json");
}
public ContentResult CurrentCourses()
{
// need to not use unity here, just testing
var unityContainer = UnityConfig.<API key>();
Data.IHomeWorkContext context = unityContainer.Resolve<Data.IHomeWorkContext>();
HomeWorkService service = new HomeWorkService(context);
ISemester semester = service.GetCurrentSemester(User.Identity.GetUserId());
string converted = JsonConvert.SerializeObject(
service.<API key>(semester),
Formatting.Indented,
new <API key> { <API key> = <API key>.Objects });
return Content(converted, "application/json");
}
public ContentResult CurrentAssignments()
{
// need to not use unity here, just testing
var unityContainer = UnityConfig.<API key>();
Data.IHomeWorkContext context = unityContainer.Resolve<Data.IHomeWorkContext>();
HomeWorkService service = new HomeWorkService(context);
ISemester semester = service.GetCurrentSemester(User.Identity.GetUserId());
string converted = JsonConvert.SerializeObject(
service.<API key>(semester),
Formatting.Indented,
new <API key> { <API key> = <API key>.Objects });
return Content(converted, "application/json");
}
public ContentResult CurrentSemester()
{
// need to not use unity here, just testing
var unityContainer = UnityConfig.<API key>();
Data.IHomeWorkContext context = unityContainer.Resolve<Data.IHomeWorkContext>();
HomeWorkService service = new HomeWorkService(context);
//var json = GlobalConfiguration.Configuration.Formatters.JsonFormatter;
//json.SerializerSettings.<API key> = Newtonsoft.Json.<API key>.Objects;
Model.IUser user = new Model.User { Id = User.Identity.GetUserId(), Email = UserManager.FindById(User.Identity.GetUserId()).Email};
HomeWorkViewModel vm = new HomeWorkViewModel(service, user);
//<API key> settings = new <API key>
// <API key> = <API key>.Objects
string converted = JsonConvert.SerializeObject(vm.CurrentSemester, Formatting.Indented,
new <API key> { <API key> = <API key>.Objects });
//string converted = JsonConvert.SerializeObject(vm.GetCurrentSemester(User.Identity.GetUserId()));
return Content(converted, "application/json");
}
private <API key> UserManager
{
get
{
return HttpContext.GetOwinContext().GetUserManager<<API key>>();
}
}
}
} |
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.IO;
using System.Runtime.InteropServices;
using System.Text;
namespace PowerArgs
{
<summary>
Used for internal implementation, but marked public for testing, please do not use. This is basically a wrapper around the system console.
</summary>
public class StdConsoleProvider : IConsoleProvider
{
const int STD_OUTPUT_HANDLE = -11;
private ConsoleColor fg = Console.ForegroundColor;
<summary>
Gets or sets the console foreground color
</summary>
public ConsoleColor ForegroundColor
{
get
{
return fg;
}
set
{
if (fg == value) return;
Console.ForegroundColor = value;
fg = value;
}
}
private ConsoleColor bg = Console.BackgroundColor;
<summary>
Gets or sets the console background color
</summary>
public ConsoleColor BackgroundColor
{
get
{
return bg;
}
set
{
if (bg == value) return;
Console.BackgroundColor = value;
bg = value;
}
}
<summary>
Used for internal implementation, but marked public for testing, please do not use.
</summary>
public int CursorLeft
{
get
{
return Console.CursorLeft;
}
set
{
Console.CursorLeft = value;
}
}
<summary>
Used for internal implementation, but marked public for testing, please do not use.
</summary>
public int CursorTop
{
get
{
return Console.CursorTop;
}
set
{
Console.CursorTop = value;
}
}
<summary>
Used for internal implementation, but marked public for testing, please do not use.
</summary>
public int BufferWidth
{
get
{
try
{
return Console.BufferWidth;
}
catch (IOException)
{
return 80;
}
}
set { Console.BufferWidth = value; }
}
<summary>
Gets and sets Console.WindowHeight
</summary>
public int WindowHeight
{
get { return Console.WindowHeight; }
set { Console.WindowHeight = Math.Min(Console.LargestWindowHeight, value); }
}
<summary>
Gets and sets WindowWidth
</summary>
public int WindowWidth
{
get { return Console.WindowWidth; }
set { Console.WindowWidth = Math.Min(Console.LargestWindowWidth, value); }
}
<summary>
returns Console.KeyAvailable
</summary>
public bool KeyAvailable => Console.KeyAvailable;
<summary>
Used for internal implementation, but marked public for testing, please do not use.
</summary>
<returns>Used for internal implementation, but marked public for testing, please do not use.</returns>
public ConsoleKeyInfo ReadKey()
{
return Console.ReadKey(true);
}
<summary>
Used for internal implementation, but marked public for testing, please do not use.
</summary>
<param name="output">Used for internal implementation, but marked public for testing, please do not use.</param>
public void Write(object output)
{
Console.Write(output);
}
<summary>
Used for internal implementation, but marked public for testing, please do not use.
</summary>
<param name="output">Used for internal implementation, but marked public for testing, please do not use.</param>
public void WriteLine(object output)
{
Console.WriteLine(output);
}
<summary>
Used for internal implementation, but marked public for testing, please do not use.
</summary>
public void WriteLine()
{
Console.WriteLine();
}
[DllImport("Kernel32", SetLastError = true)]
static extern IntPtr GetStdHandle(int nStdHandle);
[DllImport("Kernel32", SetLastError = true)]
static extern bool <API key>(IntPtr hConsoleOutput,
[Out] StringBuilder lpCharacter, uint nLength, COORD dwReadCoord,
out uint lpNumberOfCharsRead);
[StructLayout(LayoutKind.Sequential)]
struct COORD
{
public short X;
public short Y;
}
<summary>
Used for internal implementation, but marked public for testing, please do not use.
</summary>
<param name="y">Used for internal implementation, but marked public for testing, please do not use.</param>
<returns>Used for internal implementation, but marked public for testing, please do not use.</returns>
public static string <API key>(int y)
{
if (y < 0)
{
return null;
}
IntPtr stdout = GetStdHandle(STD_OUTPUT_HANDLE);
uint nLength = (uint)Console.WindowWidth;
StringBuilder lpCharacter = new StringBuilder((int)nLength);
// read from the first character of the first line (0, 0).
COORD dwReadCoord;
dwReadCoord.X = 0;
dwReadCoord.Y = (short)y;
uint lpNumberOfCharsRead = 0;
if (!<API key>(stdout, lpCharacter, nLength, dwReadCoord, out lpNumberOfCharsRead))
throw new Win32Exception();
var str = lpCharacter.ToString();
str = str.Substring(0, str.Length - 1).Trim();
return str;
}
<summary>
Clears the console
</summary>
public void Clear()
{
var bg = Console.BackgroundColor;
try
{
Console.BackgroundColor = ConsoleString.<API key>;
Console.Clear();
}
catch(Exception ex)
{
}
finally
{
Console.BackgroundColor = bg;
}
}
<summary>
Reads the next character of input from the console
</summary>
<returns>the char or -1 if there is no more input</returns>
public int Read()
{
return Console.Read();
}
<summary>
Reads a key from the console
</summary>
<param name="intercept">if true, intercept the key before it is shown on the console</param>
<returns>info about the key that was pressed</returns>
public ConsoleKeyInfo ReadKey(bool intercept)
{
if (ConsoleInDriver.Instance.IsAttached)
{
var c = (char)ConsoleInDriver.Instance.Read();
ConsoleKeyInfo key;
if(KeyMap.TryGetValue(c, out key) == false)
{
key = new ConsoleKeyInfo(c, ConsoleKey.NoName, false, false, false);
}
return key;
}
else
{
return Console.ReadKey(intercept);
}
}
<summary>
Reads a line of text from the console
</summary>
<returns>a line of text that was read from the console</returns>
public string ReadLine()
{
throw new <API key>();
}
<summary>
Writes the given string to the console
</summary>
<param name="consoleString">the string to write</param>
public void Write(ConsoleString consoleString)
{
var existing = ConsoleString.ConsoleProvider;
try
{
ConsoleString.ConsoleProvider = this;
consoleString.Write();
}
finally
{
ConsoleString.ConsoleProvider = existing;
}
}
<summary>
Writes the given string to the console, followed by a newline
</summary>
<param name="consoleString">the string to write</param>
public void WriteLine(ConsoleString consoleString)
{
var existing = ConsoleString.ConsoleProvider;
try
{
ConsoleString.ConsoleProvider = this;
consoleString.WriteLine();
}
finally
{
ConsoleString.ConsoleProvider = existing;
}
}
<summary>
Writes the given character to the console
</summary>
<param name="consoleCharacter">the character to write</param>
public void Write(in ConsoleCharacter consoleCharacter)
{
var existing = ConsoleString.ConsoleProvider;
try
{
ConsoleString.ConsoleProvider = this;
consoleCharacter.Write();
}
finally
{
ConsoleString.ConsoleProvider = existing;
}
}
private static Dictionary<char, ConsoleKeyInfo> KeyMap = CreateKeyMap();
private static Dictionary<char, ConsoleKeyInfo> CreateKeyMap()
{
Dictionary<char, ConsoleKeyInfo> ret = new Dictionary<char, ConsoleKeyInfo>();
for(int i = (int)'a'; i <= 'z'; i++)
{
var c = (char)i;
var enumKey = Char.ToUpperInvariant(c)+"";
var enumValue = (ConsoleKey)Enum.Parse(typeof(ConsoleKey), enumKey);
ret.Add(c, new ConsoleKeyInfo(c, enumValue, false, false, false));
}
for (int i = (int)'A'; i <= 'Z'; i++)
{
var c = (char)i;
var enumKey = c + "";
var enumValue = (ConsoleKey)Enum.Parse(typeof(ConsoleKey), enumKey);
ret.Add(c, new ConsoleKeyInfo(c, enumValue, true, false, false));
}
for (int i = (int)'0'; i <= '9'; i++)
{
var c = (char)i;
var enumKey = "D"+c;
var enumValue = (ConsoleKey)Enum.Parse(typeof(ConsoleKey), enumKey);
ret.Add(c, new ConsoleKeyInfo(c, enumValue, false, false, false));
}
ret.Add('!', new ConsoleKeyInfo('!', ConsoleKey.D1, true, false, false));
ret.Add('@', new ConsoleKeyInfo('@', ConsoleKey.D2, true, false, false));
ret.Add('#', new ConsoleKeyInfo('#', ConsoleKey.D3, true, false, false));
ret.Add('$', new ConsoleKeyInfo('$', ConsoleKey.D4, true, false, false));
ret.Add('%', new ConsoleKeyInfo('%', ConsoleKey.D5, true, false, false));
ret.Add('^', new ConsoleKeyInfo('^', ConsoleKey.D6, true, false, false));
ret.Add('&', new ConsoleKeyInfo('&', ConsoleKey.D7, true, false, false));
ret.Add('*', new ConsoleKeyInfo('*', ConsoleKey.D8, true, false, false));
ret.Add('(', new ConsoleKeyInfo('(', ConsoleKey.D9, true, false, false));
ret.Add(')', new ConsoleKeyInfo(')', ConsoleKey.D0, true, false, false));
ret.Add(' ', new ConsoleKeyInfo(' ', ConsoleKey.Spacebar, false, false, false));
ret.Add('-', new ConsoleKeyInfo('-', ConsoleKey.OemMinus, false, false, false));
ret.Add('_', new ConsoleKeyInfo('_', ConsoleKey.OemMinus, true, false, false));
ret.Add('=', new ConsoleKeyInfo('=', ConsoleKey.OemPlus, false, false, false));
ret.Add('+', new ConsoleKeyInfo('+', ConsoleKey.OemPlus, true, false, false));
ret.Add('.', new ConsoleKeyInfo('.', ConsoleKey.OemPeriod, false, false, false));
ret.Add('>', new ConsoleKeyInfo('>', ConsoleKey.OemPeriod, true, false, false));
ret.Add(',', new ConsoleKeyInfo(',', ConsoleKey.OemComma, false, false, false));
ret.Add('<', new ConsoleKeyInfo('<', ConsoleKey.OemComma, true, false, false));
ret.Add('\r', new ConsoleKeyInfo('\r', ConsoleKey.Enter, false, false, false));
ret.Add('\n', new ConsoleKeyInfo('\n', ConsoleKey.Enter, false, false, false));
return ret;
}
public void Write(char[] buffer, int length)
{
Console.Write(buffer, 0, length);
}
}
} |
Namespace Data
Public Class WatcherTimer
Implements IWatcher
Public Event Changed() Implements IWatcher.Changed
Private WithEvents tmrRefresh As System.Timers.Timer = Nothing
Public Sub New(dInterval As Double)
tmrRefresh = New System.Timers.Timer
tmrRefresh.Stop()
tmrRefresh.Interval = dInterval
End Sub
Public Sub Start() Implements IWatcher.Start
OnChanged()
End Sub
Public Sub [Stop]() Implements IWatcher.Stop
tmrRefresh.Stop()
End Sub
Private Sub tmrRefresh_Elapsed(sender As Object, e As System.Timers.ElapsedEventArgs) Handles tmrRefresh.Elapsed
OnChanged()
End Sub
Private Sub OnChanged()
tmrRefresh.Stop()
RaiseEvent Changed()
tmrRefresh.Start()
End Sub
#Region " IDisposable "
Private _Disposed As Boolean = False
Protected Overridable Sub Dispose(disposing As Boolean)
If Not Me._Disposed Then
If disposing Then
Me.Stop()
End If
End If
Me._Disposed = True
End Sub
Public Sub Dispose() Implements IWatcher.Dispose
Dispose(True)
GC.SuppressFinalize(Me)
End Sub
#End Region
End Class
End Namespace |
#include "terrainview_p.h"
#include <QtConcurrent>
#include <cmath>
#include <smmintrin.h>
#include "terrain.h"
#include "cpu.h"
#if defined(__APPLE__)
# define memset std::memset
#endif
static void transposeImage(quint32 *dest, QSize size, const quint32 *src)
{
Q_ASSUME((size.width() & 3) == 0);
Q_ASSUME((size.height() & 3) == 0);
const int width = size.width();
const int height = size.height();
QtConcurrent::blockingMap(RangeIterator(0), RangeIterator(height >> 2), [=](int block) {
int y = block << 2;
{
auto *destptr = reinterpret_cast<float *>(dest + y * width);
auto *srcptr = reinterpret_cast<const float *>(src + y);
for (int x = 0; x < width; x += 4) {
auto p1 = _mm_loadu_ps(srcptr); srcptr += height;
auto p2 = _mm_loadu_ps(srcptr); srcptr += height;
auto p3 = _mm_loadu_ps(srcptr); srcptr += height;
auto p4 = _mm_loadu_ps(srcptr); srcptr += height;
_MM_TRANSPOSE4_PS(p1, p2, p3, p4);
auto *destptr2 = destptr;
_mm_storeu_ps(destptr2, p1); destptr2 += width;
_mm_storeu_ps(destptr2, p2); destptr2 += width;
_mm_storeu_ps(destptr2, p3); destptr2 += width;
_mm_storeu_ps(destptr2, p4); destptr2 += width;
destptr += 4;
}
}
});
}
static bool pushToBoundary(QVector2D &v, const QVector2D &rayDir, const QVector2D &lineNormal, float linePos, bool &first)
{
float d = QVector2D::dotProduct(v, lineNormal) - linePos;
float dt = QVector2D::dotProduct(rayDir, lineNormal);
Q_ASSUME(dt != 0.f);
bool always = first;
first = false;
if (d < 0.f || always) {
v -= rayDir * (d / dt);
// error correction
v -= lineNormal * (QVector2D::dotProduct(v, lineNormal) - linePos);
return true;
} else {
return false;
}
}
template <class Colorizer>
void TerrainView::TerrainViewPrivate::renderLandform1(Colorizer&& colorizer)
{
if (viewOptions.ambientOcclusion)
renderLandform<Colorizer, true>(std::move(colorizer));
else
renderLandform<Colorizer, false>(std::move(colorizer));
}
template <class Colorizer, bool WriteHeight>
void TerrainView::TerrainViewPrivate::renderLandform(Colorizer&& colorizer)
{
struct RayDirectionMask
{
unsigned char mask;
RayDirectionMask(const QVector2D &r)
: mask(0){
if (r.x() > 0.f) mask |= 1;
if (r.x() < 0.f) mask |= 2;
if (r.y() > 0.f) mask |= 4;
if (r.y() < 0.f) mask |= 8;
}
bool positiveX() const { return mask & 1; }
bool positiveY() const { return mask & 4; }
bool negativeX() const { return mask & 2; }
bool negativeY() const { return mask & 8; }
bool anyX() const { return mask & 3; }
bool anyY() const { return mask & 12; }
};
quint32 *colorOutput = transposedImage_.data();
float *depthOutput = depthImage_.data();
float *heightOutput = WriteHeight ? heightImage_.data() : nullptr;
enum class Wall
{
PositiveX,
NegativeX,
PositiveY,
NegativeY
};
const int imgWidth = image_->size().width();
QtConcurrent::blockingMap(RangeIterator(0), RangeIterator((imgWidth + 63) >> 6), [=](int block) {
const int imgWidth = image_->size().width();
const int imgHeight = image_->size().height();
const QVector3D sideIncl = rightVector * sceneDef.viewWidth / imgWidth;
const QVector2D rayDir = cameraDir2D;
RayDirectionMask rayDirMask(rayDir);
const float *landform_ = terrain_->landformData();
const quint32 *color_ = terrain_->colorData();
int tWidth = terrain_->size().width();
int tHeight = terrain_->size().height();
Q_ASSUME(tWidth == 512);
Q_ASSUME(tHeight == 512);
tWidth = tHeight = 512;
int minX = block << 6;
int maxX = std::min(minX + 64, imgWidth);
for (int x = minX; x < maxX; ++x) {
quint32 *lineColorOutput = colorOutput + x * imgHeight;
float *lineDepthOutput = depthOutput + x * imgHeight;
float *lineHeightOutput = WriteHeight ? heightOutput + x * imgHeight : nullptr;
const float *landform = landform_;
const quint32 *color = color_;
const QVector3D rayStart = sceneDef.eye + sideIncl * (x - (imgWidth >> 1));
QVector2D scanStart(rayStart.x(), rayStart.y());
bool first = true;
Wall wall = Wall::PositiveX;
if (rayDirMask.negativeX()) {
if (pushToBoundary(scanStart, rayDir, QVector2D(-1, 0), -tWidth, first))
wall = Wall::PositiveX;
} else if (rayDirMask.positiveX()) {
if (pushToBoundary(scanStart, rayDir, QVector2D(1, 0), 0, first))
wall = Wall::NegativeX;
}
if (rayDirMask.negativeY()) {
if (pushToBoundary(scanStart, rayDir, QVector2D(0, -1), -tHeight, first))
wall = Wall::PositiveY;
} else if (rayDirMask.positiveY()) {
if (pushToBoundary(scanStart, rayDir, QVector2D(0, 1), 0, first))
wall = Wall::NegativeY;
}
memset(lineColorOutput, 0xf, imgHeight * 4);
std::fill(lineDepthOutput, lineDepthOutput + imgHeight, 1.e+4f);
if (WriteHeight)
std::fill(lineHeightOutput, lineHeightOutput + imgHeight, 1.e+4f);
// draw background
// FIXME: reduce overdraw
{
QVector3D bgScanStart(rayStart.x(), rayStart.y(), sceneDef.eye.z());
float floorLevel = 64.f;
bgScanStart += sceneDef.cameraDir * ((floorLevel - bgScanStart.z()) / sceneDef.cameraDir.z());
QVector3D bgScanDelta = QVector3D(rayDir.x(), rayDir.y(), 0) *
-(sceneDef.viewHeight / imgHeight / sceneDef.cameraDir.z());
bgScanStart -= bgScanDelta * (imgHeight >> 1);
bgScanStart *= .5f; bgScanDelta *= .5f;
bgScanStart += QVector3D(0.25f, 0.25f, 0);
// compute coefs for antialiasing
float contrastX = 1.f / std::abs(bgScanDelta.x());
float contrastY = 1.f / std::abs(bgScanDelta.y());
float offsetX = contrastX * -.25f + .5f;
float offsetY = contrastY * -.25f + .5f;
auto contrastX4 = _mm_set1_ps(contrastX);
auto contrastY4 = _mm_set1_ps(contrastY);
auto offsetX4 = _mm_set1_ps(offsetX);
auto offsetY4 = _mm_set1_ps(offsetY);
auto bgScanPosX = _mm_setr_ps(
bgScanStart.x(),
bgScanStart.x() + bgScanDelta.x(),
bgScanStart.x() + bgScanDelta.x() * 2,
bgScanStart.x() + bgScanDelta.x() * 3);
auto bgScanPosY = _mm_setr_ps(
bgScanStart.y(),
bgScanStart.y() + bgScanDelta.y(),
bgScanStart.y() + bgScanDelta.y() * 2,
bgScanStart.y() + bgScanDelta.y() * 3);
auto bgScanDeltaX = _mm_set1_ps(bgScanDelta.x() * 4);
auto bgScanDeltaY = _mm_set1_ps(bgScanDelta.y() * 4);
auto mm_abs_ps = [](__m128 m) {
return _mm_castsi128_ps(_mm_srli_epi32(_mm_slli_epi32(_mm_castps_si128(m), 1), 1));
};
<API key> roundingModeScope(_MM_ROUND_DOWN);
(void) roundingModeScope;
for (int y = 0; y < imgHeight; y += 4) {
auto fracX = _mm_sub_ps(bgScanPosX, _mm_cvtepi32_ps(_mm_cvtps_epi32(bgScanPosX)));
auto fracY = _mm_sub_ps(bgScanPosY, _mm_cvtepi32_ps(_mm_cvtps_epi32(bgScanPosY)));
fracX = mm_abs_ps(_mm_sub_ps(fracX, _mm_set1_ps(0.5f)));
fracY = mm_abs_ps(_mm_sub_ps(fracY, _mm_set1_ps(0.5f)));
fracX = _mm_add_ps(offsetX4, _mm_mul_ps(fracX, contrastX4));
fracY = _mm_add_ps(offsetY4, _mm_mul_ps(fracY, contrastY4));
fracX = _mm_max_ps(fracX, _mm_set1_ps(0.f));
fracY = _mm_max_ps(fracY, _mm_set1_ps(0.f));
fracX = _mm_min_ps(fracX, _mm_set1_ps(1.f));
fracY = _mm_min_ps(fracY, _mm_set1_ps(1.f));
auto pat1 = _mm_mul_ps(fracX, fracY);
auto pat2 = _mm_sub_ps(_mm_set1_ps(1.f), fracX);
auto pat3 = _mm_sub_ps(_mm_set1_ps(1.f), fracY);
auto pat = _mm_add_ps(pat1, _mm_mul_ps(pat2, pat3));
// generate color
pat = _mm_mul_ps(pat, _mm_set1_ps(504.f));
pat = _mm_add_ps(_mm_set1_ps(500.f), pat);
// gamma correction
pat = _mm_mul_ps(pat, _mm_rsqrt_ps(pat));
auto patI = _mm_cvtps_epi32(pat);
patI = _mm_or_si128(patI, _mm_slli_epi32(patI, 16));
patI = _mm_or_si128(patI, _mm_slli_epi32(patI, 8));
_mm_storeu_si128(reinterpret_cast<__m128i*>(lineColorOutput + y), patI);
bgScanPosX = _mm_add_ps(bgScanPosX, bgScanDeltaX);
bgScanPosY = _mm_add_ps(bgScanPosY, bgScanDeltaY);
}
}
if (scanStart.x() < 0.f || scanStart.y() < 0.f ||
scanStart.x() > tWidth || scanStart.y() > tHeight) {
// Ray doesn't enter the terrain area
continue;
}
// Compute local Z -> screen Y transformation
float zScale = static_cast<float>(imgHeight) / sceneDef.viewHeight *
upVector.z();
float zOffset = static_cast<float>(imgHeight * 0.5f) - sceneDef.eye.z() * zScale;
float zOffsetPerTravel = static_cast<float>(imgHeight) / sceneDef.viewHeight *
-std::sqrt(1.f - upVector.z() * upVector.z());
QVector2D rayPos = scanStart;
std::int_fast16_t rayCellX = static_cast<std::int_fast16_t>(std::floor(rayPos.x()));
std::int_fast16_t rayCellY = static_cast<std::int_fast16_t>(std::floor(rayPos.y()));
std::int_fast16_t nextRayCellX = rayCellX;
std::int_fast16_t nextRayCellY = rayCellY;
if (rayDirMask.positiveX()) ++nextRayCellX;
if (rayDirMask.positiveY()) ++nextRayCellY;
switch (wall) {
case Wall::PositiveX:
//--rayCellX; --nextRayCellX;
break;
case Wall::NegativeX:
--rayCellX; --nextRayCellX;
break;
case Wall::PositiveY:
//--rayCellY; --nextRayCellY;
break;
case Wall::NegativeY:
--rayCellY; --nextRayCellY;
break;
}
const float invRayDirX = 1.f / rayDir.x();
const float invRayDirY = 1.f / rayDir.y();
zOffset += QVector2D::dotProduct((scanStart - QVector2D(sceneDef.eye.x(), sceneDef.eye.y())), rayDir)
* zOffsetPerTravel;
float lastHeight = 64.f;
float lastImageFY = zOffset + zScale * lastHeight;
std::int_fast16_t lastImageY = static_cast<std::int_fast16_t>
(std::min<float>(lastImageFY, imgHeight));
quint32 lastColor = 0x7f0000;
auto startImageY = lastImageY;
float travelDistance = 0.f;
float travelDistanceDelta = -1.f / zOffsetPerTravel;
auto fillWall = [&](std::int_fast16_t y) {
y = std::max<std::int_fast16_t>(y, 0);
while(lastImageY > y) {
--lastImageY;
lineColorOutput[lastImageY] = lastColor;
lineDepthOutput[lastImageY] = travelDistance;
if (WriteHeight) lineHeightOutput[lastImageY] = lastHeight;
}
};
auto fillFloor = [&](std::int_fast16_t y) {
y = std::max<std::int_fast16_t>(y, 0);
if (lastImageY > y) {
float depth = travelDistance;
depth += (lastImageFY - (lastImageY + 1)) * travelDistanceDelta;
do {
--lastImageY;
lineColorOutput[lastImageY] = lastColor;
lineDepthOutput[lastImageY] = depth;
if (WriteHeight) lineHeightOutput[lastImageY] = lastHeight;
depth += travelDistanceDelta;
} while (lastImageY > y);
}
};
int prefetchIndex = (rayDirMask.positiveY() ? 1 : -1) * tWidth;
char enteredScreen = 0;
landform += rayCellX + rayCellY * tWidth;
color += rayCellX + rayCellY * tWidth;
float xHitTime;
float yHitTime;
switch (wall) {
case Wall::PositiveX:
case Wall::NegativeX:
xHitTime = (static_cast<float>(nextRayCellX) - rayPos.x()) * invRayDirX;
goto hitXWall;
case Wall::PositiveY:
case Wall::NegativeY:
yHitTime = (static_cast<float>(nextRayCellY) - rayPos.y()) * invRayDirY;
goto hitYWall;
}
while (true) {
xHitTime = 114514.f;
{
_mm_prefetch(reinterpret_cast<char const *>(landform + prefetchIndex), _MM_HINT_T0);
_mm_prefetch(reinterpret_cast<char const *>(color + prefetchIndex), _MM_HINT_T0);
}
if (rayDirMask.anyX()) {
xHitTime = (static_cast<float>(nextRayCellX) - rayPos.x()) * invRayDirX;
}
if (rayDirMask.anyY() &&
(yHitTime = (static_cast<float>(nextRayCellY) - rayPos.y()) * invRayDirY) < xHitTime) {
// Hit Y wall
hitYWall:
float offs = yHitTime * zOffsetPerTravel;
zOffset += offs;
rayPos.setX(rayPos.x() + rayDir.x() * yHitTime);
rayPos.setY(nextRayCellY);
// floor
float nextImgFY = lastImageFY + offs;
auto nextImgY = static_cast<std::int_fast16_t>(nextImgFY);
fillFloor(nextImgY);
lastImageFY = nextImgFY;
// move to next cell
if (rayDirMask.positiveY()) {
++rayCellY; ++nextRayCellY;
if (rayCellY >= tHeight) {
break;
}
landform += tWidth; color += tWidth;
} else {
--rayCellY; --nextRayCellY;
if (rayCellY < 0) {
break;
}
landform -= tWidth; color -= tWidth;
}
travelDistance += yHitTime;
} else {
// Hit X wall
hitXWall:
float offs = xHitTime * zOffsetPerTravel;
zOffset += offs;
rayPos.setY(rayPos.y() + rayDir.y() * xHitTime);
rayPos.setX(nextRayCellX);
// floor
float nextImgFY = lastImageFY + offs;
auto nextImgY = static_cast<std::int_fast16_t>(nextImgFY);
fillFloor(nextImgY);
lastImageFY = nextImgFY;
// move to next cell
if (rayDirMask.positiveX()) {
++rayCellX; ++nextRayCellX;
if (rayCellX >= tWidth) {
break;
}
++landform; ++color;
} else {
--rayCellX; --nextRayCellX;
if (rayCellX < 0) {
break;
}
--landform; --color;
}
travelDistance += xHitTime;
}
auto darken = [](__m128i c) -> quint32 {
auto c2 = _mm_avg_epu8(c, _mm_setzero_si128());
c2 = _mm_avg_epu8(c, c2);
return _mm_cvtsi128_si32(c2);
};
if (enteredScreen || zOffset < imgHeight) { // map fragment visible on screen?
// sample
Q_ASSERT(rayCellX >= 0 && rayCellY >= 0 && rayCellX < tWidth && rayCellY < tHeight);
float land = *landform;
__m128i col = _mm_castps_si128(_mm_load_ss(reinterpret_cast<const float *>(color)));
col = colorizer(col, land);
// draw wall
lastColor = darken(col);
float nextImgFY = land * zScale + zOffset;
auto nextImgY = static_cast<std::int_fast16_t>(nextImgFY);
fillWall(nextImgY);
// prepare for next floor drawing
lastColor = _mm_cvtsi128_si32(col);
lastImageFY = nextImgFY;
lastHeight = land;
enteredScreen = 1;
}
if (lastImageY <= 0) {
// screen is filled; early out
break;
}
}
// fix the depth
float fixAmt = QVector2D::dotProduct(rayDir, scanStart) + zBias;
fixAmt += depthBufferBias; // intentionally add bias to prevent flickering
auto fixAmt4 = _mm_set1_ps(fixAmt);
{
int y = lastImageY;
int endY = startImageY;
while (y < endY && (y & 3)) {
lineDepthOutput[y] += fixAmt; ++y;
}
int endYAligned = endY - 3;
while (y < endYAligned) {
auto m = _mm_loadu_ps(lineDepthOutput + y);
m = _mm_add_ps(m, fixAmt4);
_mm_storeu_ps(lineDepthOutput + y, m);
y += 4;
}
while (y < endY) {
lineDepthOutput[y] += fixAmt; ++y;
}
}
}
});
}
void TerrainView::TerrainViewPrivate::<API key>()
{
const int imgWidth = image_->size().width();
const int imgHeight = image_->size().height();
quint32 *colorOutput = transposedImage_.data();
float *depthInput = depthImage_.data();
Q_ASSUME(imgHeight >= 8);
QtConcurrent::blockingMap(RangeIterator(0), RangeIterator((imgWidth + 63) >> 6), [=](int block) {
int minX = block << 6;
int maxX = std::min(minX + 64, imgWidth);
for (int x = minX; x < maxX; ++x) {
quint32 *lineColorOutput = colorOutput + x * imgHeight;
float *lineDepthInput1 = depthInput + x * imgHeight;
float *lineDepthInput2 = depthInput + (x == 0 ? x : x - 1) * imgHeight;
float *lineDepthInput3 = depthInput + (x + 1 == imgWidth ? x : x + 1) * imgHeight;
auto processSpan = [&](quint32 *color, __m128 depth1, float *depth2, float *depth3,
__m128 depth4, __m128 depth5) {
auto t = depth1;
t = _mm_mul_ps(t, _mm_set1_ps(4.f));
t = _mm_sub_ps(t, _mm_loadu_ps(depth2));
t = _mm_sub_ps(t, _mm_loadu_ps(depth3));
t = _mm_sub_ps(t, depth4);
t = _mm_sub_ps(t, depth5);
t = _mm_max_ps(t, _mm_set1_ps(-.5f));
t = _mm_min_ps(t, _mm_set1_ps(1.5f));
// calculate color coef
auto coeff = _mm_mul_ps(t, _mm_set1_ps(-16.f)); // f32 * 4
coeff = _mm_add_ps(coeff, _mm_set1_ps(64.5f)); // f32 * 4
auto coeffI = _mm_cvttps_epi32(coeff); // i32 * 4
coeffI = _mm_packs_epi32(coeffI, coeffI); // i16 * 4 + pad
coeffI = _mm_unpacklo_epi16(coeffI, coeffI); // i16 [c1, c1, c2, c2, c3, c3, c4, c4]
// load color
auto col = _mm_loadu_si128(reinterpret_cast<__m128i*>(color));
auto colLo = _mm_unpacklo_epi8(col, _mm_setzero_si128());
colLo = _mm_srai_epi16(_mm_mullo_epi16(colLo, _mm_unpacklo_epi16(coeffI, coeffI)), 6);
auto colHi = _mm_unpackhi_epi8(col, _mm_setzero_si128());
colHi = _mm_srai_epi16(_mm_mullo_epi16(colHi, _mm_unpackhi_epi16(coeffI, coeffI)), 6);
col = _mm_packus_epi16(colLo, colHi);
_mm_storeu_si128(reinterpret_cast<__m128i*>(color), col);
};
{
auto depth = _mm_loadu_ps(lineDepthInput1);
processSpan(lineColorOutput, depth,
lineDepthInput2,
lineDepthInput3,
_mm_shuffle_ps(depth, depth, 0x90),
_mm_loadu_ps(lineDepthInput1 + 1));
}
{
auto depth = _mm_loadu_ps(lineDepthInput1 + imgHeight - 4);
processSpan(lineColorOutput + imgHeight - 4, depth,
lineDepthInput2 + imgHeight - 4,
lineDepthInput3 + imgHeight - 4,
_mm_loadu_ps(lineDepthInput1 + imgHeight - 5),
_mm_shuffle_ps(depth, depth, 0xf9));
}
lineColorOutput += 4;
lineDepthInput1 += 4;
lineDepthInput2 += 4;
lineDepthInput3 += 4;
for (int y = 4; y < imgHeight - 4; y += 4) {
processSpan(lineColorOutput,
_mm_loadu_ps(lineDepthInput1),
lineDepthInput2, lineDepthInput3,
_mm_loadu_ps(lineDepthInput1 - 1),
_mm_loadu_ps(lineDepthInput1 + 1));
lineColorOutput += 4;
lineDepthInput1 += 4;
lineDepthInput2 += 4;
lineDepthInput3 += 4;
}
}
});
}
QPointF TerrainView::TerrainViewPrivate::<API key>(const QPoint &pt)
{
const int imgWidth = image_->size().width();
const int imgHeight = image_->size().height();
Q_ASSERT(pt.x() >= 0); Q_ASSERT(pt.y() >= 0);
Q_ASSERT(pt.x() < imgWidth); Q_ASSERT(pt.y() < imgHeight);
const QVector3D sideIncl = rightVector * sceneDef.viewWidth / imgWidth;
const QVector2D rayDir = cameraDir2D;
float depth = depthImage_[pt.x() * imgHeight + pt.y()];
const QVector3D rayStart = sceneDef.eye + sideIncl * (pt.x() - (imgWidth >> 1));
QVector2D scanPos(rayStart.x(), rayStart.y());
scanPos += rayDir * (depth - zBias - QVector2D::dotProduct(scanPos, rayDir));
return QPointF(scanPos.x(), scanPos.y());
}
QImage &TerrainView::TerrainViewPrivate::render(QSize size, const SceneDefinition &def)
{
Q_Q(TerrainView);
if (size.isEmpty()) {
size = QSize(1, 1);
}
size = QSize((size.width() + 3) & ~3, (size.height() + 3) & ~3);
if (!image_ || image_->size() != size) {
// Regenerate image
image_.reset(new QImage(size, QImage::Format_RGB32));
depthImage_.resize(size.width() * size.height());
heightImage_.resize(size.width() * size.height());
transposedImage_.resize(size.width() * size.height());
}
sceneDef = def;
sceneDef.cameraDir.normalize();
zBias = terrain_->size().width() + terrain_->size().height();
QVector3D up(0, 0, -1);
rightVector = QVector3D::crossProduct(sceneDef.cameraDir, up).normalized();
upVector = QVector3D::crossProduct(sceneDef.cameraDir, rightVector);
cameraDir2D = QVector2D(sceneDef.cameraDir.x(), sceneDef.cameraDir.y()).normalized();
if (viewOptions.colorizeAltitude)
renderLandform1([](__m128i color, float alt) -> __m128i {
(void) color;
if (alt >= 62.5f) {
return _mm_setr_epi32(0x102040, 0, 0, 0);
}
auto m = _mm_set1_ps(alt);
auto k = _mm_setr_ps(63.f, 43.f, 23.f, 3.f);
m = _mm_max_ps(_mm_sub_ps(m, k), _mm_sub_ps(k, m));
m = _mm_sub_ps(_mm_set1_ps(20.f), m);
//m = _mm_max_ps(_mm_set1_ps(0.f), m);
m = _mm_mul_ps(m, _mm_set1_ps(255.f / 10.f));
auto mI = _mm_cvttps_epi32(m);
mI = _mm_packs_epi32(mI, _mm_setzero_si128());
mI = _mm_packus_epi16(mI, mI);
mI = _mm_or_si128(mI, _mm_srli_epi64(mI, 24));
return mI;
});
else
renderLandform1([](__m128i color, float alt) -> __m128i { return color; });
if (viewOptions.showEdges)
<API key>();
if (viewOptions.ambientOcclusion)
<API key>();
emitTerrainPaint();
transposeImage(reinterpret_cast<quint32 *>(image_->bits()), size, transposedImage_.data());
return *image_;
}
void TerrainView::TerrainViewPrivate::terrainUpdate(const QRect &bounds)
{
if (!aoMapDirtyRect_.isNull())
aoMapDirtyRect_ = aoMapDirtyRect_.united(bounds);
else
aoMapDirtyRect_ = bounds;
} |
<html><body>
<p>
About this time a revelation was given for the Church to move to the state of
XXSTATE. Therefore, all preparations were made for emigrating to the West.
Several of the brethren went in the fall before and during the winter; but in
the Spring, myself, my mother, and some of the family went on board of a
canal-boat to Buffalo. We then shipped aboard of a steam-boat, and after a
long and tedious passage, facing many storms, cold winds and rains, we at
length arrived at Fairport, about eleven miles distant from the settlement of
the brethren. I started on foot with Bro. J. Salisbury, to find them. We soon
discovered their place of residence, and with great joy in our hearts we again
conversed with them face to face; while they on their part very gladly
received us and bade us welcome.
</p>
<p>
Here I found brother Joseph, father and Samuel, who had removed during the
previous winter. Soon after our arrival a conference was held in which the
elders expected to receive additional powers to go forth and preach the
gospel; and of a truth they did receive more strength and were encouraged
through the promises given to them by the prophet. That God would begin from
that very hour to bless them if faithful, with glory, wisdom, dominion and
power.
</p>
<p>
The Church was now being established according to the pattern as taught by
Christ and his apostles in the New Testament Scriptures, the same blessings
promised by the Savior to his apostles of old, to heal the sick; cast out
devils; to speak in new tongues, and to lay on hands for the reception of the
Holy Spirit, were vouchsafed to all who became the true and faithful followers
of Christ.
</p>
<p>
The Elders were then scattered and labored in the different parts of the
Lord's vineyard, and the Saints rejoiced much concerning the great work of God
in the last days. Sometime after this, another conference was held in Orange,
where the Elders, Priests, Teachers and Deacons received some general
instructions from the leaders of the Church concerning the priesthood of
Melchizedek, to which they had not as yet been ordained; for they had not
attained to all the power of their mission, or ministry. At this conference I
was ordained a Priest. I had been exclusively engaged in the business of my
office, attending the numerous conferences and visiting the branches to see
that the members were all faithful and that there was no quarreling, or
backbiting among the brethren. During this time my faith was increased and my
resolution to serve the Lord and assist in rolling on his work strengthened,
and I felt determined to devote my time, talents, and energies in furthering
the purposes of God, and spreading his gospel throughout all nations. My
license was as follows:
</p>
<p>
This made me feel more and more importance of my mission and the necessity of
being up and doing while the day lasts, and of magnifying my office. I felt
deeply the responsibility which rested upon me of being a faithful watchman
upon the walls of Zion, and of warning all men of the approach of the Savior.
I accordingly made several circuits into the country round about, in order to
declare unto them the truths of the gospel. I took one mission with my brother
Samuel, into an adjoining county. Also, another one with Don Carlos, my
brother, among some of my friends from York State; besides several other
missions into different parts of the country. Some were aroused to the
necessity of preparing for another world, and repenting of their sins, were
baptized into the Church. I labored in the state of XXSTATE as the Spirit
directed me, until the fall of XXYEAR, when I took a mission with my brother
XXFIRSTNAME, into the western part of XXSTATE, in Elk Creek township, where I
became acquainted with a young lady by the name of Caroline Grant, and after a
short acquaintance married her on the 14th of XXMONTH, XXYEAR. I then returned
to XXCITY and attended the School of the Prophets during the remainder of the
winter.
</p>
</body></html> |
<?php
namespace MZ\Proxy\Tests;
use MZ\Proxy;
use MZ\Proxy\Shortcuts;
class ShortcutsTest extends \<API key>
{
public function testWraps()
{
$data = array();
$data[] = array(
'shortcut' => function ($subject) {
return Shortcuts\wrapWithMemoryProxy($subject);
},
'behavior_class' => 'MZ\Proxy\Behaviors\Caching\CachingBehavior',
'subject_types' => array('object', 'callable'),
);
if (class_exists('\Memcache')) {
$data[] = array(
'shortcut' => function ($subject) {
return Shortcuts\<API key>($subject);
},
'behavior_class' => 'MZ\Proxy\Behaviors\Caching\CachingBehavior',
'subject_types' => array('object', 'callable'),
);
}
$data[] = array(
'shortcut' => function ($subject) {
return Shortcuts\createLazyInitProxy(function () use ($subject) {
return $subject;
});
},
'behavior_class' => 'MZ\Proxy\Behaviors\LazyInit\LazyInitBehavior',
'subject_types' => array('object'),
);
foreach ($data as $test_data) {
if (in_array('object', $test_data['subject_types'])) {
$subject = new \stdClass();
$proxy = $test_data['shortcut']($subject);
$this->assertInstanceOf('MZ\Proxy\ObjectProxy', $proxy);
$this->assertInstanceOf($test_data['behavior_class'], $proxy->proxyGetBehavior());
}
if (in_array('callable', $test_data['subject_types'])) {
$subject = function () {
return 'ok';
};
$proxy = $test_data['shortcut']($subject);
$this->assertInstanceOf('MZ\Proxy\CallableProxy', $proxy);
$this->assertInstanceOf($test_data['behavior_class'], $proxy->getBehavior());
}
}
}
/**
* @@expectedException \<API key>
*/
public function <API key>()
{
$proxy = Shortcuts\wrapWithMemoryProxy('test');
}
/**
* @@expectedException \<API key>
*/
public function <API key>()
{
$proxy = Shortcuts\wrapWithMemoryProxy(123);
}
/**
* @@expectedException \<API key>
*/
public function <API key>()
{
$proxy = Shortcuts\wrapWithMemoryProxy(array(1, 2, 3));
}
} |
<?php
/**
* <API key> class file.
*
* @author Anastaszor
*/
class <API key>
extends CachalotObject implements <API key>
{
/**
* (non-PHPdoc)
* @see IDataTypeStatement::toDataType()
*/
public function toDataType()
{
return new MediumblobDataType();
}
/**
* (non-PHPdoc)
* @see IDataTypeStatement::getDefaultValue()
*/
public function getDefaultValue()
{
return null;
}
/**
* (non-PHPdoc)
* @see IStatement::validate()
*/
public function validate()
{
return true;
}
/**
* (non-PHPdoc)
* @see IStatement::toSQL()
*/
public function toSQL(IDialect $dialect)
{
return 'MEDIUMBLOB';
}
} |
;(function () {
function ResizeHandler(el) {
el.remember('_resizeHandler', this);
this.el = el;
this.parameters = {};
this.lastUpdateCall = null;
this.p = el.doc().node.createSVGPoint();
}
ResizeHandler.prototype.transformPoint = function(x, y, m){
this.p.x = x - (this.offset.x - window.pageXOffset);
this.p.y = y - (this.offset.y - window.pageYOffset);
return this.p.matrixTransform(m || this.m);
};
ResizeHandler.prototype.init = function (options) {
var _this = this;
this.stop();
if (options === 'stop') {
return;
}
this.options = {};
// Merge options and defaults
for (var i in this.el.resize.defaults) {
this.options[i] = this.el.resize.defaults[i];
if (typeof options[i] !== 'undefined') {
this.options[i] = options[i];
}
}
// We listen to all these events which are specifying different edges
this.el.on('lt.resize', function(e){ _this.resize(e || window.event); }); // Left-Top
this.el.on('rt.resize', function(e){ _this.resize(e || window.event); }); // Right-Top
this.el.on('rb.resize', function(e){ _this.resize(e || window.event); }); // Right-Bottom
this.el.on('lb.resize', function(e){ _this.resize(e || window.event); }); // Left-Bottom
this.el.on('t.resize', function(e){ _this.resize(e || window.event); }); // Top
this.el.on('r.resize', function(e){ _this.resize(e || window.event); }); // Right
this.el.on('b.resize', function(e){ _this.resize(e || window.event); }); // Bottom
this.el.on('l.resize', function(e){ _this.resize(e || window.event); }); // Left
this.el.on('rot.resize', function(e){ _this.resize(e || window.event); }); // Rotation
this.el.on('point.resize', function(e){ _this.resize(e || window.event); }); // Point-Moving
// This call ensures, that the plugin reacts to a change of snapToGrid immediately
this.update();
};
ResizeHandler.prototype.stop = function(){
this.el.off('lt.resize');
this.el.off('rt.resize');
this.el.off('rb.resize');
this.el.off('lb.resize');
this.el.off('t.resize');
this.el.off('r.resize');
this.el.off('b.resize');
this.el.off('l.resize');
this.el.off('rot.resize');
this.el.off('point.resize');
return this;
};
ResizeHandler.prototype.resize = function (event) {
var _this = this;
this.m = this.el.node.getScreenCTM().inverse();
this.offset = { x: window.pageXOffset, y: window.pageYOffset };
this.parameters = {
p: this.transformPoint(event.detail.event.clientX,event.detail.event.clientY),
x: event.detail.x, // x-position of the mouse when resizing started
y: event.detail.y, // y-position of the mouse when resizing started
box: this.el.bbox(), // The bounding-box of the element
rotation: this.el.transform().rotation // The current rotation of the element
};
// the i-param in the event holds the index of the point which is moved, when using `deepSelect`
if (event.detail.i !== undefined) {
// get the point array
var array = this.el.array().valueOf();
// Save the index and the point which is moved
this.parameters.i = event.detail.i;
this.parameters.pointCoords = [array[event.detail.i][0], array[event.detail.i][1]];
}
// Lets check which edge of the bounding-box was clicked and resize the this.el according to this
switch (event.type) {
// Left-Top-Edge
case 'lt':
// We build a calculating function for every case which gives us the new position of the this.el
this.calc = function (diffX, diffY) {
// The procedure is always the same
// First we snap the edge to the given grid (snapping to 1px grid is normal resizing)
var snap = this.snapToGrid(diffX, diffY);
// Now we check if the new height and width still valid (> 0)
if (this.parameters.box.width - snap[0] > 0 && this.parameters.box.height - snap[1] > 0) {
// ...if valid, we resize the this.el (which can include moving because the coord-system starts at the left-top and this edge is moving sometimes when resized)
this.el.move(this.parameters.box.x + snap[0], this.parameters.box.y + snap[1]).size(this.parameters.box.width - snap[0], this.parameters.box.height - snap[1]);
}
};
break;
// Right-Top
case 'rt':
this.calc = function (diffX, diffY) {
var snap = this.snapToGrid(diffX, diffY, 1 << 1);
if (this.parameters.box.width + snap[0] > 0 && this.parameters.box.height - snap[1] > 0) {
this.el.move(this.parameters.box.x, this.parameters.box.y + snap[1]).size(this.parameters.box.width + snap[0], this.parameters.box.height - snap[1]);
}
};
break;
// Right-Bottom
case 'rb':
this.calc = function (diffX, diffY) {
var snap = this.snapToGrid(diffX, diffY, 0);
if (this.parameters.box.width + snap[0] > 0 && this.parameters.box.height + snap[1] > 0) {
this.el.move(this.parameters.box.x, this.parameters.box.y).size(this.parameters.box.width + snap[0], this.parameters.box.height + snap[1]);
}
};
break;
// Left-Bottom
case 'lb':
this.calc = function (diffX, diffY) {
var snap = this.snapToGrid(diffX, diffY, 1);
if (this.parameters.box.width - snap[0] > 0 && this.parameters.box.height + snap[1] > 0) {
this.el.move(this.parameters.box.x + snap[0], this.parameters.box.y).size(this.parameters.box.width - snap[0], this.parameters.box.height + snap[1]);
}
};
break;
// Top
case 't':
this.calc = function (diffX, diffY) {
var snap = this.snapToGrid(diffX, diffY, 1 << 1);
if (this.parameters.box.height - snap[1] > 0) {
this.el.move(this.parameters.box.x, this.parameters.box.y + snap[1]).height(this.parameters.box.height - snap[1]);
}
};
break;
// Right
case 'r':
this.calc = function (diffX, diffY) {
var snap = this.snapToGrid(diffX, diffY, 0);
if (this.parameters.box.width + snap[0] > 0) {
this.el.move(this.parameters.box.x, this.parameters.box.y).width(this.parameters.box.width + snap[0]);
}
};
break;
// Bottom
case 'b':
this.calc = function (diffX, diffY) {
var snap = this.snapToGrid(diffX, diffY, 0);
if (this.parameters.box.height + snap[1] > 0) {
this.el.move(this.parameters.box.x, this.parameters.box.y).height(this.parameters.box.height + snap[1]);
}
};
break;
// Left
case 'l':
this.calc = function (diffX, diffY) {
var snap = this.snapToGrid(diffX, diffY, 1);
if (this.parameters.box.width - snap[0] > 0) {
this.el.move(this.parameters.box.x + snap[0], this.parameters.box.y).width(this.parameters.box.width - snap[0]);
}
};
break;
// Rotation
case 'rot':
this.calc = function (diffX, diffY) {
// yes this is kinda stupid but we need the mouse coords back...
var current = {x: diffX + this.parameters.p.x, y: diffY + this.parameters.p.y};
// start minus middle
var sAngle = Math.atan2((this.parameters.p.y - this.parameters.box.y - this.parameters.box.height / 2), (this.parameters.p.x - this.parameters.box.x - this.parameters.box.width / 2));
// end minus middle
var pAngle = Math.atan2((current.y - this.parameters.box.y - this.parameters.box.height / 2), (current.x - this.parameters.box.x - this.parameters.box.width / 2));
var angle = (pAngle - sAngle) * 180 / Math.PI;
// We have to move the element to the center of the box first and change the rotation afterwards
// because rotation always works around a rotation-center, which is changed when moving the element
// We also set the new rotation center to the center of the box.
this.el.center(this.parameters.box.cx, this.parameters.box.cy).rotate(this.parameters.rotation + angle - angle % this.options.snapToAngle, this.parameters.box.cx, this.parameters.box.cy);
};
break;
// Moving one single Point (needed when an element is deepSelected which means you can move every single point of the object)
case 'point':
this.calc = function (diffX, diffY) {
// Snapping the point to the grid
var snap = this.snapToGrid(diffX, diffY, this.parameters.pointCoords[0], this.parameters.pointCoords[1]);
// Get the point array
var array = this.el.array().valueOf();
// Changing the moved point in the array
array[this.parameters.i][0] = this.parameters.pointCoords[0] + snap[0];
array[this.parameters.i][1] = this.parameters.pointCoords[1] + snap[1];
// And plot the new this.el
this.el.plot(array);
};
}
// When resizing started, we have to register events for...
SVG.on(window, 'mousemove.resize', function (e) {
_this.update(e || window.event);
}); // mousemove to keep track of the changes and...
SVG.on(window, 'mouseup.resize', function () {
_this.done();
}); // mouseup to know when resizing stops
};
// The update-function redraws the element every time the mouse is moving
ResizeHandler.prototype.update = function (event) {
if (!event) {
if (this.lastUpdateCall) {
this.calc(this.lastUpdateCall[0], this.lastUpdateCall[1]);
}
return;
}
// Calculate the difference between the mouseposition at start and now
var p = this.transformPoint(event.clientX, event.clientY);
var diffX = p.x - this.parameters.p.x,
diffY = p.y - this.parameters.p.y;
this.lastUpdateCall = [diffX, diffY];
// Calculate the new position and height / width of the element
this.calc(diffX, diffY);
};
// Is called on mouseup.
// Removes the update-function from the mousemove event
ResizeHandler.prototype.done = function () {
this.lastUpdateCall = null;
SVG.off(window, 'mousemove.resize');
SVG.off(window, 'mouseup.resize');
this.el.fire('resizedone');
};
// The flag is used to determine whether the resizing is used with a left-Point (first bit) and top-point (second bit)
// In this cases the temp-values are calculated differently
ResizeHandler.prototype.snapToGrid = function (diffX, diffY, flag, pointCoordsY) {
var temp;
// If `pointCoordsY` is given, a single Point has to be snapped (deepSelect). That's why we need a different temp-value
if (pointCoordsY) {
// Note that flag = pointCoordsX in this case
temp = [(flag + diffX) % this.options.snapToGrid, (pointCoordsY + diffY) % this.options.snapToGrid];
} else {
// We check if the flag is set and if not we set a default-value (both bits set - which means upper-left-edge)
flag = flag == null ? 1 | 1 << 1 : flag;
temp = [(this.parameters.box.x + diffX + (flag & 1 ? 0 : this.parameters.box.width)) % this.options.snapToGrid, (this.parameters.box.y + diffY + (flag & (1 << 1) ? 0 : this.parameters.box.height)) % this.options.snapToGrid];
}
diffX -= (Math.abs(temp[0]) < this.options.snapToGrid / 2 ? temp[0] : temp[0] - this.options.snapToGrid) + (temp[0] < 0 ? this.options.snapToGrid : 0);
diffY -= (Math.abs(temp[1]) < this.options.snapToGrid / 2 ? temp[1] : temp[1] - this.options.snapToGrid) + (temp[1] < 0 ? this.options.snapToGrid : 0);
return [diffX, diffY];
};
SVG.extend(SVG.Element, {
// Resize element with mouse
resize: function (options) {
(this.remember('_resizeHandler') || new ResizeHandler(this)).init(options || {});
return this;
}
});
SVG.Element.prototype.resize.defaults = {
snapToAngle: 0.1, // Specifies the speed the rotation is happening when moving the mouse
snapToGrid: 1 // Snaps to a grid of `snapToGrid` Pixels
};
}).call(this); |
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" >
<link rel="stylesheet" href="../src/<API key>.css">
<style>
body{
background-color:#666;
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
margin:0px;
padding:0px;
}
</style>
</head>
<body>
<script type="text/javascript" src="../src/ga-cnil-cookies.js"></script>
<script type="text/javascript">
cnilGA.dev=true;
cnilGA.start('XX-XXXXXXXX-X');// your google analytics UA-ID
</script>
</body>
</html> |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.