code
stringlengths
3
1.05M
repo_name
stringlengths
4
116
path
stringlengths
3
942
language
stringclasses
30 values
license
stringclasses
15 values
size
int32
3
1.05M
import React from 'react'; import PropTypes from 'prop-types'; import RaisedButton from 'material-ui/RaisedButton'; import { withRouter } from 'react-router'; import qs from 'qs-lite'; const getLabel = (keyword) => { let label = keyword.title || keyword.wordpressId; if (keyword.isMentionedInLemma) label = `[ ${label} ]`; return label; }; const goToSearchTerm = (keyword, history) => { const queryParams = qs.parse(window.location.search.replace('?', '')); queryParams.page = 0; queryParams.keywords = keyword.slug; // update route const urlParams = qs.stringify(queryParams); history.push(`/commentary/?${urlParams}`); }; const CommentKeywordsContainer = props => ( <div className="comment-keywords-container"> {props.keywords.map((keyword, i) => ( <RaisedButton key={`${i}-${keyword._id}`} className="comment-keyword paper-shadow" onClick={goToSearchTerm.bind(this, keyword, props.history)} data-id={keyword._id} label={getLabel(keyword)} /> ))} </div> ); CommentKeywordsContainer.propTypes = { keywords: PropTypes.arrayOf(PropTypes.shape({ _id: PropTypes.string.isRequired, title: PropTypes.string, wordpressId: PropTypes.number, })).isRequired, }; export default withRouter(CommentKeywordsContainer);
CtrHellenicStudies/Commentary
src/modules/comments/components/CommentDetail/CommentKeywords/CommentKeywords.js
JavaScript
bsd-3-clause
1,262
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (1.8.0_181) on Sat Mar 13 19:41:11 EST 2021 --> <title>Java8Parser.StatementExpressionContext</title> <meta name="date" content="2021-03-13"> <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="Java8Parser.StatementExpressionContext"; } } catch(err) { } //--> var methods = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10}; var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]}; var altColor = "altColor"; var rowColor = "rowColor"; var tableTab = "tableTab"; var activeTableTab = "activeTableTab"; </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar.top"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.top.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../index-all.html">Index</a></li> <li><a href="../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../com/binghamton/jhelp/antlr/Java8Parser.StatementContext.html" title="class in com.binghamton.jhelp.antlr"><span class="typeNameLink">Prev&nbsp;Class</span></a></li> <li><a href="../../../../com/binghamton/jhelp/antlr/Java8Parser.StatementExpressionListContext.html" title="class in com.binghamton.jhelp.antlr"><span class="typeNameLink">Next&nbsp;Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../index.html?com/binghamton/jhelp/antlr/Java8Parser.StatementExpressionContext.html" target="_top">Frames</a></li> <li><a href="Java8Parser.StatementExpressionContext.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li><a href="#field.summary">Field</a>&nbsp;|&nbsp;</li> <li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#method.summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li><a href="#field.detail">Field</a>&nbsp;|&nbsp;</li> <li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#method.detail">Method</a></li> </ul> </div> <a name="skip.navbar.top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <!-- ======== START OF CLASS DATA ======== --> <div class="header"> <div class="subTitle">com.binghamton.jhelp.antlr</div> <h2 title="Class Java8Parser.StatementExpressionContext" class="title">Class Java8Parser.StatementExpressionContext</h2> </div> <div class="contentContainer"> <ul class="inheritance"> <li>java.lang.Object</li> <li> <ul class="inheritance"> <li>org.antlr.v4.runtime.RuleContext</li> <li> <ul class="inheritance"> <li>org.antlr.v4.runtime.ParserRuleContext</li> <li> <ul class="inheritance"> <li>com.binghamton.jhelp.antlr.Java8Parser.StatementExpressionContext</li> </ul> </li> </ul> </li> </ul> </li> </ul> <div class="description"> <ul class="blockList"> <li class="blockList"> <dl> <dt>All Implemented Interfaces:</dt> <dd>org.antlr.v4.runtime.tree.ParseTree, org.antlr.v4.runtime.tree.RuleNode, org.antlr.v4.runtime.tree.SyntaxTree, org.antlr.v4.runtime.tree.Tree</dd> </dl> <dl> <dt>Enclosing class:</dt> <dd><a href="../../../../com/binghamton/jhelp/antlr/Java8Parser.html" title="class in com.binghamton.jhelp.antlr">Java8Parser</a></dd> </dl> <hr> <br> <pre>public static class <span class="typeNameLabel">Java8Parser.StatementExpressionContext</span> extends org.antlr.v4.runtime.ParserRuleContext</pre> </li> </ul> </div> <div class="summary"> <ul class="blockList"> <li class="blockList"> <!-- =========== FIELD SUMMARY =========== --> <ul class="blockList"> <li class="blockList"><a name="field.summary"> <!-- --> </a> <h3>Field Summary</h3> <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation"> <caption><span>Fields</span><span class="tabEnd">&nbsp;</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><a href="../../../../com/binghamton/jhelp/antlr/Java8Parser.AssignmentContext.html" title="class in com.binghamton.jhelp.antlr">Java8Parser.AssignmentContext</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/binghamton/jhelp/antlr/Java8Parser.StatementExpressionContext.html#a">a</a></span></code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><code><a href="../../../../com/binghamton/jhelp/antlr/Java8Parser.PreIncrementExpressionContext.html" title="class in com.binghamton.jhelp.antlr">Java8Parser.PreIncrementExpressionContext</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/binghamton/jhelp/antlr/Java8Parser.StatementExpressionContext.html#b">b</a></span></code>&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><code><a href="../../../../com/binghamton/jhelp/antlr/Java8Parser.PreDecrementExpressionContext.html" title="class in com.binghamton.jhelp.antlr">Java8Parser.PreDecrementExpressionContext</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/binghamton/jhelp/antlr/Java8Parser.StatementExpressionContext.html#c">c</a></span></code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><code><a href="../../../../com/binghamton/jhelp/antlr/Java8Parser.PostIncrementExpressionContext.html" title="class in com.binghamton.jhelp.antlr">Java8Parser.PostIncrementExpressionContext</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/binghamton/jhelp/antlr/Java8Parser.StatementExpressionContext.html#d">d</a></span></code>&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><code><a href="../../../../com/binghamton/jhelp/antlr/Java8Parser.PostDecrementExpressionContext.html" title="class in com.binghamton.jhelp.antlr">Java8Parser.PostDecrementExpressionContext</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/binghamton/jhelp/antlr/Java8Parser.StatementExpressionContext.html#f">f</a></span></code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><code><a href="../../../../com/binghamton/jhelp/antlr/Java8Parser.MethodInvocationContext.html" title="class in com.binghamton.jhelp.antlr">Java8Parser.MethodInvocationContext</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/binghamton/jhelp/antlr/Java8Parser.StatementExpressionContext.html#g">g</a></span></code>&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><code><a href="../../../../com/binghamton/jhelp/antlr/Java8Parser.ClassInstanceCreationExpressionContext.html" title="class in com.binghamton.jhelp.antlr">Java8Parser.ClassInstanceCreationExpressionContext</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/binghamton/jhelp/antlr/Java8Parser.StatementExpressionContext.html#h">h</a></span></code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><code><a href="../../../../com/binghamton/jhelp/ast/Expression.html" title="class in com.binghamton.jhelp.ast">Expression</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/binghamton/jhelp/antlr/Java8Parser.StatementExpressionContext.html#ret">ret</a></span></code>&nbsp;</td> </tr> </table> <ul class="blockList"> <li class="blockList"><a name="fields.inherited.from.class.org.antlr.v4.runtime.ParserRuleContext"> <!-- --> </a> <h3>Fields inherited from class&nbsp;org.antlr.v4.runtime.ParserRuleContext</h3> <code>children, exception, start, stop</code></li> </ul> <ul class="blockList"> <li class="blockList"><a name="fields.inherited.from.class.org.antlr.v4.runtime.RuleContext"> <!-- --> </a> <h3>Fields inherited from class&nbsp;org.antlr.v4.runtime.RuleContext</h3> <code>EMPTY, invokingState, parent</code></li> </ul> </li> </ul> <!-- ======== CONSTRUCTOR SUMMARY ======== --> <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">&nbsp;</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/binghamton/jhelp/antlr/Java8Parser.StatementExpressionContext.html#StatementExpressionContext-org.antlr.v4.runtime.ParserRuleContext-int-">StatementExpressionContext</a></span>(org.antlr.v4.runtime.ParserRuleContext&nbsp;parent, int&nbsp;invokingState)</code>&nbsp;</td> </tr> </table> </li> </ul> <!-- ========== METHOD SUMMARY =========== --> <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">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd">&nbsp;</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><a href="../../../../com/binghamton/jhelp/antlr/Java8Parser.AssignmentContext.html" title="class in com.binghamton.jhelp.antlr">Java8Parser.AssignmentContext</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/binghamton/jhelp/antlr/Java8Parser.StatementExpressionContext.html#assignment--">assignment</a></span>()</code>&nbsp;</td> </tr> <tr id="i1" class="rowColor"> <td class="colFirst"><code><a href="../../../../com/binghamton/jhelp/antlr/Java8Parser.ClassInstanceCreationExpressionContext.html" title="class in com.binghamton.jhelp.antlr">Java8Parser.ClassInstanceCreationExpressionContext</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/binghamton/jhelp/antlr/Java8Parser.StatementExpressionContext.html#classInstanceCreationExpression--">classInstanceCreationExpression</a></span>()</code>&nbsp;</td> </tr> <tr id="i2" class="altColor"> <td class="colFirst"><code>int</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/binghamton/jhelp/antlr/Java8Parser.StatementExpressionContext.html#getRuleIndex--">getRuleIndex</a></span>()</code>&nbsp;</td> </tr> <tr id="i3" class="rowColor"> <td class="colFirst"><code><a href="../../../../com/binghamton/jhelp/antlr/Java8Parser.MethodInvocationContext.html" title="class in com.binghamton.jhelp.antlr">Java8Parser.MethodInvocationContext</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/binghamton/jhelp/antlr/Java8Parser.StatementExpressionContext.html#methodInvocation--">methodInvocation</a></span>()</code>&nbsp;</td> </tr> <tr id="i4" class="altColor"> <td class="colFirst"><code><a href="../../../../com/binghamton/jhelp/antlr/Java8Parser.PostDecrementExpressionContext.html" title="class in com.binghamton.jhelp.antlr">Java8Parser.PostDecrementExpressionContext</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/binghamton/jhelp/antlr/Java8Parser.StatementExpressionContext.html#postDecrementExpression--">postDecrementExpression</a></span>()</code>&nbsp;</td> </tr> <tr id="i5" class="rowColor"> <td class="colFirst"><code><a href="../../../../com/binghamton/jhelp/antlr/Java8Parser.PostIncrementExpressionContext.html" title="class in com.binghamton.jhelp.antlr">Java8Parser.PostIncrementExpressionContext</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/binghamton/jhelp/antlr/Java8Parser.StatementExpressionContext.html#postIncrementExpression--">postIncrementExpression</a></span>()</code>&nbsp;</td> </tr> <tr id="i6" class="altColor"> <td class="colFirst"><code><a href="../../../../com/binghamton/jhelp/antlr/Java8Parser.PreDecrementExpressionContext.html" title="class in com.binghamton.jhelp.antlr">Java8Parser.PreDecrementExpressionContext</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/binghamton/jhelp/antlr/Java8Parser.StatementExpressionContext.html#preDecrementExpression--">preDecrementExpression</a></span>()</code>&nbsp;</td> </tr> <tr id="i7" class="rowColor"> <td class="colFirst"><code><a href="../../../../com/binghamton/jhelp/antlr/Java8Parser.PreIncrementExpressionContext.html" title="class in com.binghamton.jhelp.antlr">Java8Parser.PreIncrementExpressionContext</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/binghamton/jhelp/antlr/Java8Parser.StatementExpressionContext.html#preIncrementExpression--">preIncrementExpression</a></span>()</code>&nbsp;</td> </tr> </table> <ul class="blockList"> <li class="blockList"><a name="methods.inherited.from.class.org.antlr.v4.runtime.ParserRuleContext"> <!-- --> </a> <h3>Methods inherited from class&nbsp;org.antlr.v4.runtime.ParserRuleContext</h3> <code>addChild, addChild, addChild, addErrorNode, copyFrom, enterRule, exitRule, getChild, getChild, getChildCount, getParent, getRuleContext, getRuleContexts, getSourceInterval, getStart, getStop, getToken, getTokens, removeLastChild, toInfoString</code></li> </ul> <ul class="blockList"> <li class="blockList"><a name="methods.inherited.from.class.org.antlr.v4.runtime.RuleContext"> <!-- --> </a> <h3>Methods inherited from class&nbsp;org.antlr.v4.runtime.RuleContext</h3> <code>accept, depth, getAltNumber, getPayload, getRuleContext, getText, isEmpty, setAltNumber, toString, toString, toString, toString, toString, toStringTree, toStringTree, toStringTree</code></li> </ul> <ul class="blockList"> <li class="blockList"><a name="methods.inherited.from.class.java.lang.Object"> <!-- --> </a> <h3>Methods inherited from class&nbsp;java.lang.Object</h3> <code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait</code></li> </ul> </li> </ul> </li> </ul> </div> <div class="details"> <ul class="blockList"> <li class="blockList"> <!-- ============ FIELD DETAIL =========== --> <ul class="blockList"> <li class="blockList"><a name="field.detail"> <!-- --> </a> <h3>Field Detail</h3> <a name="ret"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>ret</h4> <pre>public&nbsp;<a href="../../../../com/binghamton/jhelp/ast/Expression.html" title="class in com.binghamton.jhelp.ast">Expression</a> ret</pre> </li> </ul> <a name="a"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>a</h4> <pre>public&nbsp;<a href="../../../../com/binghamton/jhelp/antlr/Java8Parser.AssignmentContext.html" title="class in com.binghamton.jhelp.antlr">Java8Parser.AssignmentContext</a> a</pre> </li> </ul> <a name="b"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>b</h4> <pre>public&nbsp;<a href="../../../../com/binghamton/jhelp/antlr/Java8Parser.PreIncrementExpressionContext.html" title="class in com.binghamton.jhelp.antlr">Java8Parser.PreIncrementExpressionContext</a> b</pre> </li> </ul> <a name="c"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>c</h4> <pre>public&nbsp;<a href="../../../../com/binghamton/jhelp/antlr/Java8Parser.PreDecrementExpressionContext.html" title="class in com.binghamton.jhelp.antlr">Java8Parser.PreDecrementExpressionContext</a> c</pre> </li> </ul> <a name="d"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>d</h4> <pre>public&nbsp;<a href="../../../../com/binghamton/jhelp/antlr/Java8Parser.PostIncrementExpressionContext.html" title="class in com.binghamton.jhelp.antlr">Java8Parser.PostIncrementExpressionContext</a> d</pre> </li> </ul> <a name="f"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>f</h4> <pre>public&nbsp;<a href="../../../../com/binghamton/jhelp/antlr/Java8Parser.PostDecrementExpressionContext.html" title="class in com.binghamton.jhelp.antlr">Java8Parser.PostDecrementExpressionContext</a> f</pre> </li> </ul> <a name="g"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>g</h4> <pre>public&nbsp;<a href="../../../../com/binghamton/jhelp/antlr/Java8Parser.MethodInvocationContext.html" title="class in com.binghamton.jhelp.antlr">Java8Parser.MethodInvocationContext</a> g</pre> </li> </ul> <a name="h"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>h</h4> <pre>public&nbsp;<a href="../../../../com/binghamton/jhelp/antlr/Java8Parser.ClassInstanceCreationExpressionContext.html" title="class in com.binghamton.jhelp.antlr">Java8Parser.ClassInstanceCreationExpressionContext</a> h</pre> </li> </ul> </li> </ul> <!-- ========= CONSTRUCTOR DETAIL ======== --> <ul class="blockList"> <li class="blockList"><a name="constructor.detail"> <!-- --> </a> <h3>Constructor Detail</h3> <a name="StatementExpressionContext-org.antlr.v4.runtime.ParserRuleContext-int-"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>StatementExpressionContext</h4> <pre>public&nbsp;StatementExpressionContext(org.antlr.v4.runtime.ParserRuleContext&nbsp;parent, int&nbsp;invokingState)</pre> </li> </ul> </li> </ul> <!-- ============ METHOD DETAIL ========== --> <ul class="blockList"> <li class="blockList"><a name="method.detail"> <!-- --> </a> <h3>Method Detail</h3> <a name="assignment--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>assignment</h4> <pre>public&nbsp;<a href="../../../../com/binghamton/jhelp/antlr/Java8Parser.AssignmentContext.html" title="class in com.binghamton.jhelp.antlr">Java8Parser.AssignmentContext</a>&nbsp;assignment()</pre> </li> </ul> <a name="preIncrementExpression--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>preIncrementExpression</h4> <pre>public&nbsp;<a href="../../../../com/binghamton/jhelp/antlr/Java8Parser.PreIncrementExpressionContext.html" title="class in com.binghamton.jhelp.antlr">Java8Parser.PreIncrementExpressionContext</a>&nbsp;preIncrementExpression()</pre> </li> </ul> <a name="preDecrementExpression--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>preDecrementExpression</h4> <pre>public&nbsp;<a href="../../../../com/binghamton/jhelp/antlr/Java8Parser.PreDecrementExpressionContext.html" title="class in com.binghamton.jhelp.antlr">Java8Parser.PreDecrementExpressionContext</a>&nbsp;preDecrementExpression()</pre> </li> </ul> <a name="postIncrementExpression--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>postIncrementExpression</h4> <pre>public&nbsp;<a href="../../../../com/binghamton/jhelp/antlr/Java8Parser.PostIncrementExpressionContext.html" title="class in com.binghamton.jhelp.antlr">Java8Parser.PostIncrementExpressionContext</a>&nbsp;postIncrementExpression()</pre> </li> </ul> <a name="postDecrementExpression--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>postDecrementExpression</h4> <pre>public&nbsp;<a href="../../../../com/binghamton/jhelp/antlr/Java8Parser.PostDecrementExpressionContext.html" title="class in com.binghamton.jhelp.antlr">Java8Parser.PostDecrementExpressionContext</a>&nbsp;postDecrementExpression()</pre> </li> </ul> <a name="methodInvocation--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>methodInvocation</h4> <pre>public&nbsp;<a href="../../../../com/binghamton/jhelp/antlr/Java8Parser.MethodInvocationContext.html" title="class in com.binghamton.jhelp.antlr">Java8Parser.MethodInvocationContext</a>&nbsp;methodInvocation()</pre> </li> </ul> <a name="classInstanceCreationExpression--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>classInstanceCreationExpression</h4> <pre>public&nbsp;<a href="../../../../com/binghamton/jhelp/antlr/Java8Parser.ClassInstanceCreationExpressionContext.html" title="class in com.binghamton.jhelp.antlr">Java8Parser.ClassInstanceCreationExpressionContext</a>&nbsp;classInstanceCreationExpression()</pre> </li> </ul> <a name="getRuleIndex--"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>getRuleIndex</h4> <pre>public&nbsp;int&nbsp;getRuleIndex()</pre> <dl> <dt><span class="overrideSpecifyLabel">Overrides:</span></dt> <dd><code>getRuleIndex</code>&nbsp;in class&nbsp;<code>org.antlr.v4.runtime.RuleContext</code></dd> </dl> </li> </ul> </li> </ul> </li> </ul> </div> </div> <!-- ========= END OF CLASS DATA ========= --> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar.bottom"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.bottom.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../index-all.html">Index</a></li> <li><a href="../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../com/binghamton/jhelp/antlr/Java8Parser.StatementContext.html" title="class in com.binghamton.jhelp.antlr"><span class="typeNameLink">Prev&nbsp;Class</span></a></li> <li><a href="../../../../com/binghamton/jhelp/antlr/Java8Parser.StatementExpressionListContext.html" title="class in com.binghamton.jhelp.antlr"><span class="typeNameLink">Next&nbsp;Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../index.html?com/binghamton/jhelp/antlr/Java8Parser.StatementExpressionContext.html" target="_top">Frames</a></li> <li><a href="Java8Parser.StatementExpressionContext.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li><a href="#field.summary">Field</a>&nbsp;|&nbsp;</li> <li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#method.summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li><a href="#field.detail">Field</a>&nbsp;|&nbsp;</li> <li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#method.detail">Method</a></li> </ul> </div> <a name="skip.navbar.bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> </body> </html>
mhems/jhelp
doc/api/com/binghamton/jhelp/antlr/Java8Parser.StatementExpressionContext.html
HTML
bsd-3-clause
24,635
<?php namespace backend\components; class csv { public static function writecsv($post = []) { $branch = utilities::getAllBranch(); $branch_code = isset($branch['all_ss_branch'][$post['D01_SS_CD']]) ? $branch['all_ss_branch'][$post['D01_SS_CD']] : ''; $branch_name = isset($branch['all_branch'][$branch_code]) ? $branch['all_branch'][$branch_code] : ''; $ss_name = isset($branch['all_ss'][$post['D01_SS_CD']]) ? $branch['all_ss'][$post['D01_SS_CD']] : ''; if ($post['D01_MOBTEL_NO'] && $post['D01_TEL_NO']) { $post['TEL_NUMBER'] = $post['D01_TEL_NO'] . ',' . $post['D01_MOBTEL_NO']; } elseif ($post['D01_MOBTEL_NO']) { $post['TEL_NUMBER'] = $post['D01_MOBTEL_NO']; } elseif ($post['D01_TEL_NO']) { $post['TEL_NUMBER'] = $post['D01_TEL_NO']; } else { $post['TEL_NUMBER'] = ''; } $data[0] = [ '保証書番号', '保証期間', '購入日', '購入本数', '顧客名', 'フリガナ', '郵便番号', '住所', '電話番号', '車名', '車番', '右前メーカー', '右前商品名', '右前サイズ', '右前セリアル', '右前本数', '左前メーカー', '左前商品名', '左前サイズ', '左前セリアル', '左前本数', '右後メーカー', '右後商品名', '右後サイズ', '右後セリアル', '右後本数', '左後メーカー', '左後商品名', '左後サイズ', '左後セリアル', '左後本数', 'その他Aメーカー', 'その他A商品名', 'その他Aサイズ', 'その他Aセリアル', 'その他A本数', 'その他Bメーカー', 'その他B商品名', 'その他Bサイズ', 'その他Bセリアル', 'その他B本数', 'POS伝票番号', '支店コード', '支店名', 'SSコード', 'SS名', '作業伝票番号', ]; $data[1] = [ 'warranty_card_number' => isset($post['M09_WARRANTY_NO']) ? $post['M09_WARRANTY_NO'] : '', 'warranty_period' => isset($post['warranty_period']) ? $post['warranty_period'] : '', 'purchase_date' => isset($post['M09_INP_DATE']) ? $post['M09_INP_DATE'] : '', 'purchase_no' => isset($post['D05_SURYO']) ? $post['D05_SURYO'] : '', 'D01_CUST_NAMEN' => isset($post['D01_CUST_NAMEN']) ? $post['D01_CUST_NAMEN'] : '', 'D01_CUST_NAMEK' => isset($post['D01_CUST_NAMEK']) ? $post['D01_CUST_NAMEK'] : '', 'D01_YUBIN_BANGO' => isset($post['D01_YUBIN_BANGO']) && trim($post['D01_YUBIN_BANGO']) != '' ? substr($post['D01_YUBIN_BANGO'], 0, 3) . '-' . substr($post['D01_YUBIN_BANGO'], 3, 4) : '', 'D01_ADDR' => isset($post['D01_ADDR']) ? $post['D01_ADDR'] : '', 'TEL_NUMBER' => $post['TEL_NUMBER'], 'D02_MODEL_CD' => isset($post['D02_CAR_NAMEN_' . $post['D02_CAR_SEQ_SELECT']]) ? $post['D02_CAR_NAMEN_' . $post['D02_CAR_SEQ_SELECT']] : '', 'D02_CAR_NO' => isset($post['D02_CAR_NO_' . $post['D02_CAR_SEQ_SELECT']]) ? $post['D02_RIKUUN_NAMEN_' . $post['D02_CAR_SEQ_SELECT']] . ' ' . $post['D02_CAR_ID_' . $post['D02_CAR_SEQ_SELECT']] . ' ' . $post['D02_HIRA_' . $post['D02_CAR_SEQ_SELECT']] . ' ' . $post['D02_CAR_NO_' . $post['D02_CAR_SEQ_SELECT']] : '', 'right_front_manu' => isset($post['right_front_manu']) ? $post['right_front_manu'] : '', 'right_front_product' => isset($post['right_front_product']) ? $post['right_front_product'] : '', 'right_front_size' => isset($post['right_front_size']) ? $post['right_front_size'] : '', 'right_front_serial' => isset($post['right_front_serial']) ? $post['right_front_serial'] : '', 'right_front_no' => isset($post['right_front_no']) && $post['right_front_no'] ? $post['right_front_no'] : '', 'left_front_manu' => isset($post['left_front_manu']) ? $post['left_front_manu'] : '', 'left_front_product' => isset($post['left_front_product']) ? $post['left_front_product'] : '', 'left_front_size' => isset($post['left_front_size']) ? $post['left_front_size'] : '', 'left_front_serial' => isset($post['left_front_serial']) ? $post['left_front_serial'] : '', 'left_front_no' => isset($post['left_front_no']) && $post['left_front_no'] ? $post['left_front_no'] : '', 'right_behind_manu' => isset($post['right_behind_manu']) ? $post['right_behind_manu'] : '', 'right_behind_product' => isset($post['right_behind_product']) ? $post['right_behind_product'] : '', 'right_behind_size' => isset($post['right_behind_size']) ? $post['right_behind_size'] : '', 'right_behind_serial' => isset($post['right_behind_serial']) ? $post['right_behind_serial'] : '', 'right_behind_no' => isset($post['right_behind_no']) && $post['right_behind_no'] ? $post['right_behind_no'] : '', 'left_behind_manu' => isset($post['left_behind_manu']) ? $post['left_behind_manu'] : '', 'left_behind_product' => isset($post['left_behind_product']) ? $post['left_behind_product'] : '', 'left_behind_size' => isset($post['left_behind_size']) ? $post['left_behind_size'] : '', 'left_behind_serial' => isset($post['left_behind_serial']) ? $post['left_behind_serial'] : '', 'left_behind_no' => isset($post['left_behind_no']) && $post['left_behind_no'] ? $post['left_behind_no'] : '', 'other_a_manu' => isset($post['other_a_manu']) ? $post['other_a_manu'] : '', 'other_a_product' => isset($post['other_a_product']) ? $post['other_a_product'] : '', 'other_a_size' => isset($post['other_a_size']) ? $post['other_a_size'] : '', 'other_a_serial' => isset($post['other_a_serial']) ? $post['other_a_serial'] : '', 'other_a_no' => isset($post['other_a_no']) && $post['other_a_no'] ? $post['other_a_no'] : '', 'other_b_manu' => isset($post['other_b_manu']) ? $post['other_b_manu'] : '', 'other_b_product' => isset($post['other_b_product']) ? $post['other_b_product'] : '', 'other_b_size' => isset($post['other_b_size']) ? $post['other_b_size'] : '', 'other_b_serial' => isset($post['other_b_serial']) ? $post['other_b_serial'] : '', 'other_b_no' => isset($post['other_b_no']) && $post['other_b_no'] ? $post['other_b_no'] : '', 'D03_POS_DEN_NO' => isset($post['D03_POS_DEN_NO']) ? $post['D03_POS_DEN_NO'] : '', 'branch_code' => $branch_code, 'branch_name' => $branch_name, 'D01_SS_CD' => isset($post['D01_SS_CD']) ? $post['D01_SS_CD'] : '', 'ss_name' => $ss_name, 'D03_DEN_NO' => isset($post['D03_DEN_NO']) ? $post['D03_DEN_NO'] : '', ]; utilities::createFolder('data/csv/'); $fp = fopen(getcwd() . '/data/csv/' . $post['D03_DEN_NO'] . '.csv', 'w+'); fputs($fp, $bom = (chr(0xEF) . chr(0xBB) . chr(0xBF))); foreach ($data as $key => $value) { fputcsv($fp, $value); } fclose($fp); } public static function readcsv($post = []) { if (file_exists(getcwd() . '/data/csv/' . $post['D03_DEN_NO'] . '.csv')) { $data = file_get_contents(getcwd() . '/data/csv/' . $post['D03_DEN_NO'] . '.csv'); if (substr($data, 0, 3) == "\xEF\xBB\xBF") { $data = substr($data, 3); } if (mb_detect_encoding($data, "UTF-8", true) === false) { $encode_ary = ["ASCII", "JIS", "eucjp-win", "sjis-win", "EUC-JP", "UTF-8"]; $data = mb_convert_encoding($data, 'UTF-8', $encode_ary); } $fp = tmpfile(); fwrite($fp, $data); rewind($fp); $title = fgetcsv($fp); $data = fgetcsv($fp); $result = [ 'M09_WARRANTY_NO' => $data['0'], 'warranty_period' => $data['1'], 'M09_INP_DATE' => $data['2'], 'D05_SURYO' => $data['3'], 'D01_CUST_NAMEN' => $data['4'], 'D01_CUST_NAMEK' => $data['5'], 'D01_YUBIN_BANGO' => $data['6'], 'D01_ADDR' => $data['7'], 'TEL_NUMBER' => $data['8'], 'D02_MODEL_CD' => $data['9'], 'D02_CAR_NO' => $data['10'], 'right_front_manu' => $data['11'], 'right_front_product' => $data['12'], 'right_front_size' => $data['13'], 'right_front_serial' => $data['14'], 'right_front_no' => $data['15'], 'left_front_manu' => $data['16'], 'left_front_product' => $data['17'], 'left_front_size' => $data['18'], 'left_front_serial' => $data['19'], 'left_front_no' => $data['20'], 'right_behind_manu' => $data['21'], 'right_behind_product' => $data['22'], 'right_behind_size' => $data['23'], 'right_behind_serial' => $data['24'], 'right_behind_no' => $data['25'], 'left_behind_manu' => $data['26'], 'left_behind_product' => $data['27'], 'left_behind_size' => $data['28'], 'left_behind_serial' => $data['29'], 'left_behind_no' => $data['30'], 'other_a_manu' => $data['31'], 'other_a_product' => $data['32'], 'other_a_size' => $data['33'], 'other_a_serial' => $data['34'], 'other_a_no' => $data['35'], 'other_b_manu' => $data['36'], 'other_b_product' => $data['37'], 'other_b_size' => $data['38'], 'other_b_serial' => $data['39'], 'other_b_no' => $data['40'], 'D03_POS_DEN_NO' => $data['41'], 'branch_code' => $data['42'], 'branch_name' => $data['43'], 'D01_SS_CD' => $data['44'], 'ss_name' => $data['45'], 'D03_DEN_NO' => $data['46'], ]; return $result; } return self::defaultcsv(); } public static function deletecsv($post = []) { if (isset($post['D03_DEN_NO']) && file_exists('data/csv/' . $post['D03_DEN_NO'] . '.csv')) { return unlink('data/csv/' . $post['D03_DEN_NO'] . '.csv'); } return true; } public function defaultcsv() { $result = [ 'M09_WARRANTY_NO' => '', 'warranty_period' => '', 'M09_INP_DATE' => '', 'D05_SURYO' => '', 'D01_CUST_NAMEN' => '', 'D01_CUST_NAMEK' => '', 'D01_YUBIN_BANGO' => '', 'D01_ADDR' => '', 'TEL_NUMBER' => '', 'D02_MODEL_CD' => '', 'D02_CAR_NO' => '', 'right_front_manu' => '', 'right_front_product' => '', 'right_front_size' => '', 'right_front_serial' => '', 'right_front_no' => '', 'left_front_manu' => '', 'left_front_product' => '', 'left_front_size' => '', 'left_front_serial' => '', 'left_front_no' => '', 'right_behind_manu' => '', 'right_behind_product' => '', 'right_behind_size' => '', 'right_behind_serial' => '', 'right_behind_no' => '', 'left_behind_manu' => '', 'left_behind_product' => '', 'left_behind_size' => '', 'left_behind_serial' => '', 'left_behind_no' => '', 'other_a_manu' => '', 'other_a_product' => '', 'other_a_size' => '', 'other_a_serial' => '', 'other_a_no' => '', 'other_b_manu' => '', 'other_b_product' => '', 'other_b_size' => '', 'other_b_serial' => '', 'other_b_no' => '', 'D03_POS_DEN_NO' => '', 'branch_code' => '', 'branch_name' => '', 'D01_SS_CD' => '', 'ss_name' => '', 'D03_DEN_NO' => '', ]; return $result; } }
huylv-hust/ws
backend/components/csv.php
PHP
bsd-3-clause
12,825
<?php /** * PostcodeAnywhere * * LICENSE * * This source file is subject to the new BSD license that is bundled * with this package in the file LICENSE.txt. * It is also available through the world-wide-web at this URL: * http://github.com/canddi/Zend_RabbitMQ/blob/master/LICENSE.txt * If you did not receive a copy of the license and are unable to * obtain it through the world-wide-web, please send an email * to [email protected] so we can send you a copy immediately. * */ /** * Custom exception for the API library. */ class PostcodeAnywhere_CustomerProfiling_Interactive_Exception extends Zend_Exception { }
TimLangley/Zend_PostcodeAnywhere
src/main/php/PostcodeAnywhere/CustomerProfiling/Interactive/Exception.php
PHP
bsd-3-clause
634
// Copyright 2016 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. /** * @fileoverview 'error-dialog' is a dialog that displays error messages * in the user manager. */ (function() { Polymer({ is: 'error-dialog', properties: { /** * The message shown in the dialog. * @private {string} */ message_: {type: String, value: ''} }, /** * Displays the dialog populated with the given message. * @param {string} message Error message to show. */ show(message) { this.message_ = message; this.$.dialog.showModal(); } }); })();
endlessm/chromium-browser
chrome/browser/resources/user_manager/error_dialog.js
JavaScript
bsd-3-clause
676
// Copyright 2016 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. package org.chromium.chrome.browser; import android.content.Context; import androidx.annotation.VisibleForTesting; import com.google.android.gms.gcm.GcmNetworkManager; import com.google.android.gms.gcm.GcmTaskService; import com.google.android.gms.gcm.TaskParams; import org.chromium.base.Log; import org.chromium.base.task.PostTask; import org.chromium.chrome.browser.background_sync.BackgroundSyncBackgroundTaskScheduler; import org.chromium.chrome.browser.init.ChromeBrowserInitializer; import org.chromium.chrome.browser.init.ServiceManagerStartupUtils; import org.chromium.chrome.browser.ntp.snippets.SnippetsBridge; import org.chromium.chrome.browser.ntp.snippets.SnippetsLauncher; import org.chromium.chrome.browser.offlinepages.BackgroundScheduler; import org.chromium.chrome.browser.offlinepages.OfflinePageUtils; import org.chromium.content_public.browser.UiThreadTaskTraits; /** * {@link ChromeBackgroundService} is scheduled through the {@link GcmNetworkManager} when the * browser needs to be launched for scheduled tasks, or in response to changing network or power * conditions. */ public class ChromeBackgroundService extends GcmTaskService { private static final String TAG = "BackgroundService"; @Override @VisibleForTesting public int onRunTask(final TaskParams params) { final String taskTag = params.getTag(); final Context context = this; PostTask.runOrPostTask(UiThreadTaskTraits.DEFAULT, () -> { switch (taskTag) { case BackgroundSyncBackgroundTaskScheduler.TASK_TAG: // Background Sync tasks are now scheduled using BackgroundTaskScheduler. // This should be rare, and we simply reschedule using BackgroundTaskScheduler. rescheduleOneShotBackgroundSyncTasks(); break; case OfflinePageUtils.TASK_TAG: // Offline pages are migrating to BackgroundTaskScheduler, therefore getting // a task through ChromeBackgroundService should cause a rescheduling using // the new component. rescheduleOfflinePages(); break; case SnippetsLauncher.TASK_TAG_WIFI: case SnippetsLauncher.TASK_TAG_FALLBACK: handleSnippetsOnPersistentSchedulerWakeUp(context, taskTag); break; // This is only for tests. case ServiceManagerStartupUtils.TASK_TAG: handleServicificationStartupTask(context, taskTag); break; default: Log.i(TAG, "Unknown task tag " + taskTag); break; } }); return GcmNetworkManager.RESULT_SUCCESS; } private void handleSnippetsOnPersistentSchedulerWakeUp(Context context, String tag) { if (!SnippetsLauncher.hasInstance()) launchBrowser(context, tag); snippetsOnPersistentSchedulerWakeUp(); } private void handleServicificationStartupTask(Context context, String tag) { launchBrowser(context, tag); } @VisibleForTesting protected void snippetsOnPersistentSchedulerWakeUp() { SnippetsBridge.onPersistentSchedulerWakeUp(); } @VisibleForTesting protected void snippetsOnBrowserUpgraded() { SnippetsBridge.onBrowserUpgraded(); } @VisibleForTesting protected void launchBrowser(Context context, String tag) { Log.i(TAG, "Launching browser"); ChromeBrowserInitializer.getInstance().handleSynchronousStartup(); } @VisibleForTesting protected void rescheduleBackgroundSyncTasksOnUpgrade() { rescheduleOneShotBackgroundSyncTasks(); } private void handleSnippetsOnBrowserUpgraded() { if (SnippetsLauncher.shouldNotifyOnBrowserUpgraded()) { if (!SnippetsLauncher.hasInstance()) { launchBrowser(this, /*tag=*/""); // The |tag| doesn't matter here. } snippetsOnBrowserUpgraded(); } } /** Reschedules offline pages (using appropriate version of Background Task Scheduler). */ private void rescheduleOfflinePages() { BackgroundScheduler.getInstance().reschedule(); } private void rescheduleOneShotBackgroundSyncTasks() { BackgroundSyncBackgroundTaskScheduler.getInstance().reschedule( BackgroundSyncBackgroundTaskScheduler.BackgroundSyncTask .ONE_SHOT_SYNC_CHROME_WAKE_UP); } @Override public void onInitializeTasks() { rescheduleBackgroundSyncTasksOnUpgrade(); handleSnippetsOnBrowserUpgraded(); } }
endlessm/chromium-browser
chrome/android/java/src/org/chromium/chrome/browser/ChromeBackgroundService.java
Java
bsd-3-clause
4,896
/* * Copyright 2012 The Toolkitchen Authors. All rights reserved. * Use of this source code is governed by a BSD-style * license that can be found in the LICENSE file. */ @host, g-panels { display: block; position: relative; outline: none; overflow: hidden; } @host > *, g-panels > * { position: absolute; top: 0; left: 0; width: 100%; height: 100%; -webkit-transform: translateZ(0); } g-panels > g-panels { position: absolute; } /* TODO(sorvell): note: this is a workaround for reference combinators approach defined in shadowDom spec */ /* TODO(sorvell): expose animation timing via css variable */ @host > .transition, g-panels > .transition { -webkit-transition: all 0.218s ease-in-out; } @host > .animate, g-panels > .animate { -webkit-animation-duration: 0.218s; -webkit-animation-fill-mode: both; } /* TODO(sorvell): include a reasonable set of default overlay opening animations. What's here right now is ad hoc. NOTE: until reference combinators (presumably), need to include this file in any document that wants panel transitions. */ /* fade */ @host > .panels-ascending-from, @host > .panels-descending-from, g-panels > .panels-ascending-from, g-panels > .panels-descending-from, { -webkit-animation-name: g-panels-fadeOut; } @host > .panels-ascending-to, @host > .panels-descending-to, g-panels > .panels-ascending-to, g-panels > .panels-descending-to { -webkit-animation-name: g-panels-fadeIn; } /* hslide */ @host.g-panels-hslide > .panels-ascending-from { -webkit-animation-name: g-panels-slideLeft; } @host.g-panels-hslide > .panels-ascending-to { -webkit-animation-name: g-panels-slideFromRight; } @host.g-panels-hslide > .panels-descending-from { -webkit-animation-name: g-panels-slideRight; } @host.g-panels-hslide > .panels-descending-to { -webkit-animation-name: g-panels-slideFromLeft; } g-panels.g-panels-hslide > .panels-ascending-from { -webkit-animation-name: g-panels-slideLeft; } g-panels.g-panels-hslide > .panels-ascending-to { -webkit-animation-name: g-panels-slideFromRight; } g-panels.g-panels-hslide > .panels-descending-from { -webkit-animation-name: g-panels-slideRight; } g-panels.g-panels-hslide > .panels-descending-to { -webkit-animation-name: g-panels-slideFromLeft; } /* vslide */ @host.g-panels-vslide > .panels-ascending-from { -webkit-animation-name: g-panels-slideTop; } @host.g-panels-vslide > .panels-ascending-to { -webkit-animation-name: g-panels-slideFromBottom; } @host.g-panels-vslide > .panels-descending-from { -webkit-animation-name: g-panels-slideBottom; } @host.g-panels-vslide > .panels-descending-to { -webkit-animation-name: g-panels-slideFromTop; } /* hslideover */ @host.g-panels-hslideover > .panels-ascending-from, @host.g-panels-hslideover > .panels-descending-from { -webkit-animation-name: none; } @host.g-panels-hslideover > .panels-ascending-to { -webkit-animation-name: g-panels-slideFromRight; } @host.g-panels-hslideover > .panels-descending-to { -webkit-animation-name: g-panels-slideFromLeft; } /* vslideover */ @host.g-panels-vslideover > .panels-ascending-from, @host.g-panels-vslideover > .panels-descending-from { -webkit-animation-name: none; } @host.g-panels-vslideover > .panels-ascending-to { -webkit-animation-name: g-panels-slideFromBottom; } @host.g-panels-vslideover > .panels-descending-to { -webkit-animation-name: g-panels-slideFromTop; } /* explode */ @host.g-panels-explode > .panels-ascending-from, @host.g-panels-explode > .panels-descending-from { -webkit-animation-name: g-panels-explodeOut; } @host.g-panels-explode > .panels-ascending-to, @host.g-panels-explode > .panels-descending-to { -webkit-animation-name: g-panels-explodeIn; } /* scale-slide */ @host.g-panels-scale-slide > .panels-ascending-from { -webkit-animation-name: g-panels-fadeScaleOut; } @host.g-panels-scale-slide > .panels-ascending-to { -webkit-animation-name: g-panels-slideFromRight; } @host.g-panels-scale-slide > .panels-descending-from { -webkit-animation-name: g-panels-slideRight; } @host.g-panels-scale-slide > .panels-descending-to { -webkit-animation-name: g-panels-fadeScaleIn; } /* fly-up-right */ @host.g-panels-fly-up-right > .panels-ascending-from { -webkit-animation-name: g-panels-flyOutRight; } @host.g-panels-fly-up-right > .panels-ascending-to { -webkit-animation-name: g-panels-fadeInPartial; } @host.g-panels-fly-up-right > .panels-descending-from { -webkit-animation-name: g-panels-fadeOutPartial; } @host.g-panels-fly-up-right > .panels-descending-to { -webkit-animation-name: g-panels-flyInLeft; } @-webkit-keyframes g-panels-fadeOut { 0% { opacity: 1; } 100% { opacity: 0; } } @-webkit-keyframes g-panels-fadeIn { 0% { opacity: 0; } 100% { opacity: 1; } } @-webkit-keyframes g-panels-fadeInPartial { 0% { opacity: 0.25; } 100% { opacity: 1; } } @-webkit-keyframes g-panels-fadeOutPartial { 0% { opacity: 1; } 100% { opacity: 0.25; } } @-webkit-keyframes g-panels-fadeScaleIn { 0% { z-index: 0; opacity: 0.5; -webkit-transform: scale(0.9) translateZ(0); } 20% { z-index: 0; -webkit-transform: scale(0.9) translateZ(0); } 100% { z-index: 0; opacity: 1; -webkit-transform: scale(1) translateZ(0); } } @-webkit-keyframes g-panels-fadeScaleOut { 0% { z-index: 0; opacity: 1; -webkit-transform: scale(1) translateZ(0); } 20% { z-index: 0; -webkit-transform: scale(0.9) translateZ(0); } 100% { z-index: 0; opacity: 0.5; -webkit-transform: scale(0.9) translateZ(0); } } @-webkit-keyframes g-panels-slideRight { 0% { z-index: 1; -webkit-transform: translate3d(0, 0, 0); } 100% { z-index: 1; -webkit-transform: translate3d(100%, 0, 0); } } @-webkit-keyframes g-panels-slideFromRight { 0% { z-index: 1; -webkit-transform: translate3d(100%, 0, 0); } 100% { z-index: 1; -webkit-transform: translate3d(0, 0, 0); } } @-webkit-keyframes g-panels-slideLeft { 0% { z-index: 1; -webkit-transform: translate3d(0, 0, 0); } 100% { z-index: 1; -webkit-transform: translate3d(-100%, 0, 0); } } @-webkit-keyframes g-panels-slideFromLeft { 0% { z-index: 1; -webkit-transform: translate3d(-100%, 0, 0); } 100% { z-index: 1; -webkit-transform: translate3d(0, 0, 0); } } @-webkit-keyframes g-panels-slideBottom { 0% { z-index: 1; -webkit-transform: translate3d(0, 0, 0); } 100% { z-index: 1; -webkit-transform: translate3d(0, 100%, 0); } } @-webkit-keyframes g-panels-slideFromBottom { 0% { z-index: 1; -webkit-transform: translate3d(0, 100%, 0); } 100% { z-index: 1; -webkit-transform: translate3d(0, 0, 0); } } @-webkit-keyframes g-panels-slideTop { 0% { z-index: 1; -webkit-transform: translate3d(0, 0, 0); } 100% { z-index: 1; -webkit-transform: translate3d(0, -100%, 0); } } @-webkit-keyframes g-panels-slideFromTop { 0% { z-index: 1; -webkit-transform: translate3d(0, -100%, 0); } 100% { z-index: 1; -webkit-transform: translate3d(0, 0, 0); } } @-webkit-keyframes g-panels-explodeOut { 0% { -webkit-transform: scale(1) translateZ(0); opacity: 1; } 100% { -webkit-transform: scale(0) translateZ(0); opacity: 0; } } @-webkit-keyframes g-panels-explodeIn { 0% { z-index: 1; -webkit-transform: scale(0) translateZ(0); opacity: 0; } 100% { z-index: 1; -webkit-transform: scale(1) translateZ(0); opacity: 1; } } @-webkit-keyframes g-panels-flyOutRight { 0% { z-index: 1; -webkit-transform: translate3d(0,0,0) rotate(0); } 100% { z-index: 1; -webkit-transform: translate3d(10%, -110%, 0) rotate(5deg); } } @-webkit-keyframes g-panels-flyInLeft { 0% { z-index: 1; -webkit-transform: translate3d(10%, -110%, 0) rotate(5deg); } 100% { z-index: 1; -webkit-transform: translate3d(0,0,0) rotate(0deg); } }
kublaj/apps
old/todomvc/toolkit/components/css/g-panels.css
CSS
bsd-3-clause
8,048
"""Base class for MultiGraph.""" # Copyright (C) 2004-2015 by # Aric Hagberg <[email protected]> # Dan Schult <[email protected]> # Pieter Swart <[email protected]> # All rights reserved. # BSD license. from copy import deepcopy import networkx as nx from networkx.classes.graph import Graph from networkx import NetworkXError __author__ = """\n""".join(['Aric Hagberg ([email protected])', 'Pieter Swart ([email protected])', 'Dan Schult([email protected])']) class MultiGraph(Graph): """ An undirected graph class that can store multiedges. Multiedges are multiple edges between two nodes. Each edge can hold optional data or attributes. A MultiGraph holds undirected edges. Self loops are allowed. Nodes can be arbitrary (hashable) Python objects with optional key/value attributes. Edges are represented as links between nodes with optional key/value attributes. Parameters ---------- data : input graph Data to initialize graph. If data=None (default) an empty graph is created. The data can be an edge list, or any NetworkX graph object. If the corresponding optional Python packages are installed the data can also be a NumPy matrix or 2d ndarray, a SciPy sparse matrix, or a PyGraphviz graph. attr : keyword arguments, optional (default= no attributes) Attributes to add to graph as key=value pairs. See Also -------- Graph DiGraph MultiDiGraph Examples -------- Create an empty graph structure (a "null graph") with no nodes and no edges. >>> G = nx.MultiGraph() G can be grown in several ways. **Nodes:** Add one node at a time: >>> G.add_node(1) Add the nodes from any container (a list, dict, set or even the lines from a file or the nodes from another graph). >>> G.add_nodes_from([2,3]) >>> G.add_nodes_from(range(100,110)) >>> H=nx.Graph() >>> H.add_path([0,1,2,3,4,5,6,7,8,9]) >>> G.add_nodes_from(H) In addition to strings and integers any hashable Python object (except None) can represent a node, e.g. a customized node object, or even another Graph. >>> G.add_node(H) **Edges:** G can also be grown by adding edges. Add one edge, >>> G.add_edge(1, 2) a list of edges, >>> G.add_edges_from([(1,2),(1,3)]) or a collection of edges, >>> G.add_edges_from(H.edges()) If some edges connect nodes not yet in the graph, the nodes are added automatically. If an edge already exists, an additional edge is created and stored using a key to identify the edge. By default the key is the lowest unused integer. >>> G.add_edges_from([(4,5,dict(route=282)), (4,5,dict(route=37))]) >>> G[4] {3: {0: {}}, 5: {0: {}, 1: {'route': 282}, 2: {'route': 37}}} **Attributes:** Each graph, node, and edge can hold key/value attribute pairs in an associated attribute dictionary (the keys must be hashable). By default these are empty, but can be added or changed using add_edge, add_node or direct manipulation of the attribute dictionaries named graph, node and edge respectively. >>> G = nx.MultiGraph(day="Friday") >>> G.graph {'day': 'Friday'} Add node attributes using add_node(), add_nodes_from() or G.node >>> G.add_node(1, time='5pm') >>> G.add_nodes_from([3], time='2pm') >>> G.node[1] {'time': '5pm'} >>> G.node[1]['room'] = 714 >>> del G.node[1]['room'] # remove attribute >>> G.nodes(data=True) [(1, {'time': '5pm'}), (3, {'time': '2pm'})] Warning: adding a node to G.node does not add it to the graph. Add edge attributes using add_edge(), add_edges_from(), subscript notation, or G.edge. >>> G.add_edge(1, 2, weight=4.7 ) >>> G.add_edges_from([(3,4),(4,5)], color='red') >>> G.add_edges_from([(1,2,{'color':'blue'}), (2,3,{'weight':8})]) >>> G[1][2][0]['weight'] = 4.7 >>> G.edge[1][2][0]['weight'] = 4 **Shortcuts:** Many common graph features allow python syntax to speed reporting. >>> 1 in G # check if node in graph True >>> [n for n in G if n<3] # iterate through nodes [1, 2] >>> len(G) # number of nodes in graph 5 >>> G[1] # adjacency dict keyed by neighbor to edge attributes ... # Note: you should not change this dict manually! {2: {0: {'weight': 4}, 1: {'color': 'blue'}}} The fastest way to traverse all edges of a graph is via adjacency_iter(), but the edges() method is often more convenient. >>> for n,nbrsdict in G.adjacency_iter(): ... for nbr,keydict in nbrsdict.items(): ... for key,eattr in keydict.items(): ... if 'weight' in eattr: ... (n,nbr,key,eattr['weight']) (1, 2, 0, 4) (2, 1, 0, 4) (2, 3, 0, 8) (3, 2, 0, 8) >>> G.edges(data='weight', keys=True) [(1, 2, 0, 4), (1, 2, 1, None), (2, 3, 0, 8), (3, 4, 0, None), (4, 5, 0, None)] **Reporting:** Simple graph information is obtained using methods. Iterator versions of many reporting methods exist for efficiency. Methods exist for reporting nodes(), edges(), neighbors() and degree() as well as the number of nodes and edges. For details on these and other miscellaneous methods, see below. **Subclasses (Advanced):** The MultiGraph class uses a dict-of-dict-of-dict-of-dict data structure. The outer dict (node_dict) holds adjacency lists keyed by node. The next dict (adjlist) represents the adjacency list and holds edge_key dicts keyed by neighbor. The edge_key dict holds each edge_attr dict keyed by edge key. The inner dict (edge_attr) represents the edge data and holds edge attribute values keyed by attribute names. Each of these four dicts in the dict-of-dict-of-dict-of-dict structure can be replaced by a user defined dict-like object. In general, the dict-like features should be maintained but extra features can be added. To replace one of the dicts create a new graph class by changing the class(!) variable holding the factory for that dict-like structure. The variable names are node_dict_factory, adjlist_dict_factory, edge_key_dict_factory and edge_attr_dict_factory. node_dict_factory : function, (default: dict) Factory function to be used to create the outer-most dict in the data structure that holds adjacency lists keyed by node. It should require no arguments and return a dict-like object. adjlist_dict_factory : function, (default: dict) Factory function to be used to create the adjacency list dict which holds multiedge key dicts keyed by neighbor. It should require no arguments and return a dict-like object. edge_key_dict_factory : function, (default: dict) Factory function to be used to create the edge key dict which holds edge data keyed by edge key. It should require no arguments and return a dict-like object. edge_attr_dict_factory : function, (default: dict) Factory function to be used to create the edge attribute dict which holds attrbute values keyed by attribute name. It should require no arguments and return a dict-like object. Examples -------- Create a multigraph object that tracks the order nodes are added. >>> from collections import OrderedDict >>> class OrderedGraph(nx.MultiGraph): ... node_dict_factory = OrderedDict >>> G = OrderedGraph() >>> G.add_nodes_from( (2,1) ) >>> G.nodes() [2, 1] >>> G.add_edges_from( ((2,2), (2,1), (2,1), (1,1)) ) >>> G.edges() [(2, 1), (2, 1), (2, 2), (1, 1)] Create a multgraph object that tracks the order nodes are added and for each node track the order that neighbors are added and for each neighbor tracks the order that multiedges are added. >>> class OrderedGraph(nx.MultiGraph): ... node_dict_factory = OrderedDict ... adjlist_dict_factory = OrderedDict ... edge_key_dict_factory = OrderedDict >>> G = OrderedGraph() >>> G.add_nodes_from( (2,1) ) >>> G.nodes() [2, 1] >>> G.add_edges_from( ((2,2), (2,1,2,{'weight':0.1}), (2,1,1,{'weight':0.2}), (1,1)) ) >>> G.edges(keys=True) [(2, 2, 0), (2, 1, 2), (2, 1, 1), (1, 1, 0)] """ #node_dict_factory=dict # already assigned in Graph #adjlist_dict_factory=dict edge_key_dict_factory=dict #edge_attr_dict_factory=dict def __init__(self, data=None, **attr): self.edge_key_dict_factory = self.edge_key_dict_factory Graph.__init__(self, data, **attr) def add_edge(self, u, v, key=None, attr_dict=None, **attr): """Add an edge between u and v. The nodes u and v will be automatically added if they are not already in the graph. Edge attributes can be specified with keywords or by providing a dictionary with key/value pairs. See examples below. Parameters ---------- u,v : nodes Nodes can be, for example, strings or numbers. Nodes must be hashable (and not None) Python objects. key : hashable identifier, optional (default=lowest unused integer) Used to distinguish multiedges between a pair of nodes. attr_dict : dictionary, optional (default= no attributes) Dictionary of edge attributes. Key/value pairs will update existing data associated with the edge. attr : keyword arguments, optional Edge data (or labels or objects) can be assigned using keyword arguments. See Also -------- add_edges_from : add a collection of edges Notes ----- To replace/update edge data, use the optional key argument to identify a unique edge. Otherwise a new edge will be created. NetworkX algorithms designed for weighted graphs cannot use multigraphs directly because it is not clear how to handle multiedge weights. Convert to Graph using edge attribute 'weight' to enable weighted graph algorithms. Examples -------- The following all add the edge e=(1,2) to graph G: >>> G = nx.Graph() # or DiGraph, MultiGraph, MultiDiGraph, etc >>> e = (1,2) >>> G.add_edge(1, 2) # explicit two-node form >>> G.add_edge(*e) # single edge as tuple of two nodes >>> G.add_edges_from( [(1,2)] ) # add edges from iterable container Associate data to edges using keywords: >>> G.add_edge(1, 2, weight=3) >>> G.add_edge(1, 2, key=0, weight=4) # update data for key=0 >>> G.add_edge(1, 3, weight=7, capacity=15, length=342.7) """ # set up attribute dict if attr_dict is None: attr_dict=attr else: try: attr_dict.update(attr) except AttributeError: raise NetworkXError(\ "The attr_dict argument must be a dictionary.") # add nodes if u not in self.adj: self.adj[u] = self.adjlist_dict_factory() self.node[u] = {} if v not in self.adj: self.adj[v] = self.adjlist_dict_factory() self.node[v] = {} if v in self.adj[u]: keydict=self.adj[u][v] if key is None: # find a unique integer key # other methods might be better here? key=len(keydict) while key in keydict: key+=1 datadict=keydict.get(key,self.edge_attr_dict_factory()) datadict.update(attr_dict) keydict[key]=datadict else: # selfloops work this way without special treatment if key is None: key=0 datadict=self.edge_attr_dict_factory() datadict.update(attr_dict) keydict=self.edge_key_dict_factory() keydict[key]=datadict self.adj[u][v] = keydict self.adj[v][u] = keydict def add_edges_from(self, ebunch, attr_dict=None, **attr): """Add all the edges in ebunch. Parameters ---------- ebunch : container of edges Each edge given in the container will be added to the graph. The edges can be: - 2-tuples (u,v) or - 3-tuples (u,v,d) for an edge attribute dict d, or - 4-tuples (u,v,k,d) for an edge identified by key k attr_dict : dictionary, optional (default= no attributes) Dictionary of edge attributes. Key/value pairs will update existing data associated with each edge. attr : keyword arguments, optional Edge data (or labels or objects) can be assigned using keyword arguments. See Also -------- add_edge : add a single edge add_weighted_edges_from : convenient way to add weighted edges Notes ----- Adding the same edge twice has no effect but any edge data will be updated when each duplicate edge is added. Edge attributes specified in edges take precedence over attributes specified generally. Examples -------- >>> G = nx.Graph() # or DiGraph, MultiGraph, MultiDiGraph, etc >>> G.add_edges_from([(0,1),(1,2)]) # using a list of edge tuples >>> e = zip(range(0,3),range(1,4)) >>> G.add_edges_from(e) # Add the path graph 0-1-2-3 Associate data to edges >>> G.add_edges_from([(1,2),(2,3)], weight=3) >>> G.add_edges_from([(3,4),(1,4)], label='WN2898') """ # set up attribute dict if attr_dict is None: attr_dict=attr else: try: attr_dict.update(attr) except AttributeError: raise NetworkXError(\ "The attr_dict argument must be a dictionary.") # process ebunch for e in ebunch: ne=len(e) if ne==4: u,v,key,dd = e elif ne==3: u,v,dd = e key=None elif ne==2: u,v = e dd = {} key=None else: raise NetworkXError(\ "Edge tuple %s must be a 2-tuple, 3-tuple or 4-tuple."%(e,)) ddd={} ddd.update(attr_dict) ddd.update(dd) self.add_edge(u, v, key, ddd) def remove_edge(self, u, v, key=None): """Remove an edge between u and v. Parameters ---------- u,v: nodes Remove an edge between nodes u and v. key : hashable identifier, optional (default=None) Used to distinguish multiple edges between a pair of nodes. If None remove a single (abritrary) edge between u and v. Raises ------ NetworkXError If there is not an edge between u and v, or if there is no edge with the specified key. See Also -------- remove_edges_from : remove a collection of edges Examples -------- >>> G = nx.MultiGraph() >>> G.add_path([0,1,2,3]) >>> G.remove_edge(0,1) >>> e = (1,2) >>> G.remove_edge(*e) # unpacks e from an edge tuple For multiple edges >>> G = nx.MultiGraph() # or MultiDiGraph, etc >>> G.add_edges_from([(1,2),(1,2),(1,2)]) >>> G.remove_edge(1,2) # remove a single (arbitrary) edge For edges with keys >>> G = nx.MultiGraph() # or MultiDiGraph, etc >>> G.add_edge(1,2,key='first') >>> G.add_edge(1,2,key='second') >>> G.remove_edge(1,2,key='second') """ try: d=self.adj[u][v] except (KeyError): raise NetworkXError( "The edge %s-%s is not in the graph."%(u,v)) # remove the edge with specified data if key is None: d.popitem() else: try: del d[key] except (KeyError): raise NetworkXError( "The edge %s-%s with key %s is not in the graph."%(u,v,key)) if len(d)==0: # remove the key entries if last edge del self.adj[u][v] if u!=v: # check for selfloop del self.adj[v][u] def remove_edges_from(self, ebunch): """Remove all edges specified in ebunch. Parameters ---------- ebunch: list or container of edge tuples Each edge given in the list or container will be removed from the graph. The edges can be: - 2-tuples (u,v) All edges between u and v are removed. - 3-tuples (u,v,key) The edge identified by key is removed. - 4-tuples (u,v,key,data) where data is ignored. See Also -------- remove_edge : remove a single edge Notes ----- Will fail silently if an edge in ebunch is not in the graph. Examples -------- >>> G = nx.MultiGraph() # or MultiDiGraph >>> G.add_path([0,1,2,3]) >>> ebunch=[(1,2),(2,3)] >>> G.remove_edges_from(ebunch) Removing multiple copies of edges >>> G = nx.MultiGraph() >>> G.add_edges_from([(1,2),(1,2),(1,2)]) >>> G.remove_edges_from([(1,2),(1,2)]) >>> G.edges() [(1, 2)] >>> G.remove_edges_from([(1,2),(1,2)]) # silently ignore extra copy >>> G.edges() # now empty graph [] """ for e in ebunch: try: self.remove_edge(*e[:3]) except NetworkXError: pass def has_edge(self, u, v, key=None): """Return True if the graph has an edge between nodes u and v. Parameters ---------- u,v : nodes Nodes can be, for example, strings or numbers. key : hashable identifier, optional (default=None) If specified return True only if the edge with key is found. Returns ------- edge_ind : bool True if edge is in the graph, False otherwise. Examples -------- Can be called either using two nodes u,v, an edge tuple (u,v), or an edge tuple (u,v,key). >>> G = nx.MultiGraph() # or MultiDiGraph >>> G.add_path([0,1,2,3]) >>> G.has_edge(0,1) # using two nodes True >>> e = (0,1) >>> G.has_edge(*e) # e is a 2-tuple (u,v) True >>> G.add_edge(0,1,key='a') >>> G.has_edge(0,1,key='a') # specify key True >>> e=(0,1,'a') >>> G.has_edge(*e) # e is a 3-tuple (u,v,'a') True The following syntax are equivalent: >>> G.has_edge(0,1) True >>> 1 in G[0] # though this gives KeyError if 0 not in G True """ try: if key is None: return v in self.adj[u] else: return key in self.adj[u][v] except KeyError: return False def edges(self, nbunch=None, data=False, keys=False, default=None): """Return a list of edges. Edges are returned as tuples with optional data and keys in the order (node, neighbor, key, data). Parameters ---------- nbunch : iterable container, optional (default= all nodes) A container of nodes. The container will be iterated through once. data : bool, optional (default=False) Return two tuples (u,v) (False) or three-tuples (u,v,data) (True). keys : bool, optional (default=False) Return two tuples (u,v) (False) or three-tuples (u,v,key) (True). Returns -------- edge_list: list of edge tuples Edges that are adjacent to any node in nbunch, or a list of all edges if nbunch is not specified. See Also -------- edges_iter : return an iterator over the edges Notes ----- Nodes in nbunch that are not in the graph will be (quietly) ignored. For directed graphs this returns the out-edges. Examples -------- >>> G = nx.MultiGraph() # or MultiDiGraph >>> G.add_path([0,1,2]) >>> G.add_edge(2,3,weight=5) >>> G.edges() [(0, 1), (1, 2), (2, 3)] >>> G.edges(data=True) # default edge data is {} (empty dictionary) [(0, 1, {}), (1, 2, {}), (2, 3, {'weight': 5})] >>> list(G.edges_iter(data='weight', default=1)) [(0, 1, 1), (1, 2, 1), (2, 3, 5)] >>> G.edges(keys=True) # default keys are integers [(0, 1, 0), (1, 2, 0), (2, 3, 0)] >>> G.edges(data=True,keys=True) # default keys are integers [(0, 1, 0, {}), (1, 2, 0, {}), (2, 3, 0, {'weight': 5})] >>> list(G.edges(data='weight',default=1,keys=True)) [(0, 1, 0, 1), (1, 2, 0, 1), (2, 3, 0, 5)] >>> G.edges([0,3]) [(0, 1), (3, 2)] >>> G.edges(0) [(0, 1)] """ return list(self.edges_iter(nbunch, data, keys, default)) def edges_iter(self, nbunch=None, data=False, keys=False, default=None): """Return an iterator over the edges. Edges are returned as tuples with optional data and keys in the order (node, neighbor, key, data). Parameters ---------- nbunch : iterable container, optional (default= all nodes) A container of nodes. The container will be iterated through once. data : string or bool, optional (default=False) The edge attribute returned in 3-tuple (u,v,ddict[data]). If True, return edge attribute dict in 3-tuple (u,v,ddict). If False, return 2-tuple (u,v). default : value, optional (default=None) Value used for edges that dont have the requested attribute. Only relevant if data is not True or False. keys : bool, optional (default=False) If True, return edge keys with each edge. Returns ------- edge_iter : iterator An iterator of (u,v), (u,v,d) or (u,v,key,d) tuples of edges. See Also -------- edges : return a list of edges Notes ----- Nodes in nbunch that are not in the graph will be (quietly) ignored. For directed graphs this returns the out-edges. Examples -------- >>> G = nx.MultiGraph() # or MultiDiGraph >>> G.add_path([0,1,2]) >>> G.add_edge(2,3,weight=5) >>> [e for e in G.edges_iter()] [(0, 1), (1, 2), (2, 3)] >>> list(G.edges_iter(data=True)) # default data is {} (empty dict) [(0, 1, {}), (1, 2, {}), (2, 3, {'weight': 5})] >>> list(G.edges_iter(data='weight', default=1)) [(0, 1, 1), (1, 2, 1), (2, 3, 5)] >>> list(G.edges(keys=True)) # default keys are integers [(0, 1, 0), (1, 2, 0), (2, 3, 0)] >>> list(G.edges(data=True,keys=True)) # default keys are integers [(0, 1, 0, {}), (1, 2, 0, {}), (2, 3, 0, {'weight': 5})] >>> list(G.edges(data='weight',default=1,keys=True)) [(0, 1, 0, 1), (1, 2, 0, 1), (2, 3, 0, 5)] >>> list(G.edges_iter([0,3])) [(0, 1), (3, 2)] >>> list(G.edges_iter(0)) [(0, 1)] """ seen={} # helper dict to keep track of multiply stored edges if nbunch is None: nodes_nbrs = self.adj.items() else: nodes_nbrs=((n,self.adj[n]) for n in self.nbunch_iter(nbunch)) if data is True: for n,nbrs in nodes_nbrs: for nbr,keydict in nbrs.items(): if nbr not in seen: for key,ddict in keydict.items(): yield (n,nbr,key,ddict) if keys else (n,nbr,ddict) seen[n]=1 elif data is not False: for n,nbrs in nodes_nbrs: for nbr,keydict in nbrs.items(): if nbr not in seen: for key,ddict in keydict.items(): d=ddict[data] if data in ddict else default yield (n,nbr,key,d) if keys else (n,nbr,d) seen[n]=1 else: for n,nbrs in nodes_nbrs: for nbr,keydict in nbrs.items(): if nbr not in seen: for key in keydict: yield (n,nbr,key) if keys else (n,nbr) seen[n] = 1 del seen def get_edge_data(self, u, v, key=None, default=None): """Return the attribute dictionary associated with edge (u,v). Parameters ---------- u,v : nodes default: any Python object (default=None) Value to return if the edge (u,v) is not found. key : hashable identifier, optional (default=None) Return data only for the edge with specified key. Returns ------- edge_dict : dictionary The edge attribute dictionary. Notes ----- It is faster to use G[u][v][key]. >>> G = nx.MultiGraph() # or MultiDiGraph >>> G.add_edge(0,1,key='a',weight=7) >>> G[0][1]['a'] # key='a' {'weight': 7} Warning: Assigning G[u][v][key] corrupts the graph data structure. But it is safe to assign attributes to that dictionary, >>> G[0][1]['a']['weight'] = 10 >>> G[0][1]['a']['weight'] 10 >>> G[1][0]['a']['weight'] 10 Examples -------- >>> G = nx.MultiGraph() # or MultiDiGraph >>> G.add_path([0,1,2,3]) >>> G.get_edge_data(0,1) {0: {}} >>> e = (0,1) >>> G.get_edge_data(*e) # tuple form {0: {}} >>> G.get_edge_data('a','b',default=0) # edge not in graph, return 0 0 """ try: if key is None: return self.adj[u][v] else: return self.adj[u][v][key] except KeyError: return default def degree_iter(self, nbunch=None, weight=None): """Return an iterator for (node, degree). The node degree is the number of edges adjacent to the node. Parameters ---------- nbunch : iterable container, optional (default=all nodes) A container of nodes. The container will be iterated through once. weight : string or None, optional (default=None) The edge attribute that holds the numerical value used as a weight. If None, then each edge has weight 1. The degree is the sum of the edge weights adjacent to the node. Returns ------- nd_iter : an iterator The iterator returns two-tuples of (node, degree). See Also -------- degree Examples -------- >>> G = nx.Graph() # or DiGraph, MultiGraph, MultiDiGraph, etc >>> G.add_path([0,1,2,3]) >>> list(G.degree_iter(0)) # node 0 with degree 1 [(0, 1)] >>> list(G.degree_iter([0,1])) [(0, 1), (1, 2)] """ if nbunch is None: nodes_nbrs = self.adj.items() else: nodes_nbrs=((n,self.adj[n]) for n in self.nbunch_iter(nbunch)) if weight is None: for n,nbrs in nodes_nbrs: deg = sum([len(data) for data in nbrs.values()]) yield (n, deg+(n in nbrs and len(nbrs[n]))) else: # edge weighted graph - degree is sum of nbr edge weights for n,nbrs in nodes_nbrs: deg = sum([d.get(weight,1) for data in nbrs.values() for d in data.values()]) if n in nbrs: deg += sum([d.get(weight,1) for key,d in nbrs[n].items()]) yield (n, deg) def is_multigraph(self): """Return True if graph is a multigraph, False otherwise.""" return True def is_directed(self): """Return True if graph is directed, False otherwise.""" return False def to_directed(self): """Return a directed representation of the graph. Returns ------- G : MultiDiGraph A directed graph with the same name, same nodes, and with each edge (u,v,data) replaced by two directed edges (u,v,data) and (v,u,data). Notes ----- This returns a "deepcopy" of the edge, node, and graph attributes which attempts to completely copy all of the data and references. This is in contrast to the similar D=DiGraph(G) which returns a shallow copy of the data. See the Python copy module for more information on shallow and deep copies, http://docs.python.org/library/copy.html. Warning ------- If you have subclassed MultiGraph to use dict-like objects in the data structure, those changes do not transfer to the MultiDiGraph created by this method. Examples -------- >>> G = nx.Graph() # or MultiGraph, etc >>> G.add_path([0,1]) >>> H = G.to_directed() >>> H.edges() [(0, 1), (1, 0)] If already directed, return a (deep) copy >>> G = nx.DiGraph() # or MultiDiGraph, etc >>> G.add_path([0,1]) >>> H = G.to_directed() >>> H.edges() [(0, 1)] """ from networkx.classes.multidigraph import MultiDiGraph G=MultiDiGraph() G.add_nodes_from(self) G.add_edges_from( (u,v,key,deepcopy(datadict)) for u,nbrs in self.adjacency_iter() for v,keydict in nbrs.items() for key,datadict in keydict.items() ) G.graph=deepcopy(self.graph) G.node=deepcopy(self.node) return G def selfloop_edges(self, data=False, keys=False, default=None): """Return a list of selfloop edges. A selfloop edge has the same node at both ends. Parameters ----------- data : bool, optional (default=False) Return selfloop edges as two tuples (u,v) (data=False) or three-tuples (u,v,datadict) (data=True) or three-tuples (u,v,datavalue) (data='attrname') default : value, optional (default=None) Value used for edges that dont have the requested attribute. Only relevant if data is not True or False. keys : bool, optional (default=False) If True, return edge keys with each edge. Returns ------- edgelist : list of edge tuples A list of all selfloop edges. See Also -------- nodes_with_selfloops, number_of_selfloops Examples -------- >>> G = nx.MultiGraph() # or MultiDiGraph >>> G.add_edge(1,1) >>> G.add_edge(1,2) >>> G.selfloop_edges() [(1, 1)] >>> G.selfloop_edges(data=True) [(1, 1, {})] >>> G.selfloop_edges(keys=True) [(1, 1, 0)] >>> G.selfloop_edges(keys=True, data=True) [(1, 1, 0, {})] """ if data is True: if keys: return [ (n,n,k,d) for n,nbrs in self.adj.items() if n in nbrs for k,d in nbrs[n].items()] else: return [ (n,n,d) for n,nbrs in self.adj.items() if n in nbrs for d in nbrs[n].values()] elif data is not False: if keys: return [ (n,n,k,d.get(data,default)) for n,nbrs in self.adj.items() if n in nbrs for k,d in nbrs[n].items()] else: return [ (n,n,d.get(data,default)) for n,nbrs in self.adj.items() if n in nbrs for d in nbrs[n].values()] else: if keys: return [ (n,n,k) for n,nbrs in self.adj.items() if n in nbrs for k in nbrs[n].keys()] else: return [ (n,n) for n,nbrs in self.adj.items() if n in nbrs for d in nbrs[n].values()] def number_of_edges(self, u=None, v=None): """Return the number of edges between two nodes. Parameters ---------- u,v : nodes, optional (default=all edges) If u and v are specified, return the number of edges between u and v. Otherwise return the total number of all edges. Returns ------- nedges : int The number of edges in the graph. If nodes u and v are specified return the number of edges between those nodes. See Also -------- size Examples -------- >>> G = nx.Graph() # or DiGraph, MultiGraph, MultiDiGraph, etc >>> G.add_path([0,1,2,3]) >>> G.number_of_edges() 3 >>> G.number_of_edges(0,1) 1 >>> e = (0,1) >>> G.number_of_edges(*e) 1 """ if u is None: return self.size() try: edgedata=self.adj[u][v] except KeyError: return 0 # no such edge return len(edgedata) def subgraph(self, nbunch): """Return the subgraph induced on nodes in nbunch. The induced subgraph of the graph contains the nodes in nbunch and the edges between those nodes. Parameters ---------- nbunch : list, iterable A container of nodes which will be iterated through once. Returns ------- G : Graph A subgraph of the graph with the same edge attributes. Notes ----- The graph, edge or node attributes just point to the original graph. So changes to the node or edge structure will not be reflected in the original graph while changes to the attributes will. To create a subgraph with its own copy of the edge/node attributes use: nx.Graph(G.subgraph(nbunch)) If edge attributes are containers, a deep copy can be obtained using: G.subgraph(nbunch).copy() For an inplace reduction of a graph to a subgraph you can remove nodes: G.remove_nodes_from([ n in G if n not in set(nbunch)]) Examples -------- >>> G = nx.Graph() # or DiGraph, MultiGraph, MultiDiGraph, etc >>> G.add_path([0,1,2,3]) >>> H = G.subgraph([0,1,2]) >>> H.edges() [(0, 1), (1, 2)] """ bunch =self.nbunch_iter(nbunch) # create new graph and copy subgraph into it H = self.__class__() # copy node and attribute dictionaries for n in bunch: H.node[n]=self.node[n] # namespace shortcuts for speed H_adj=H.adj self_adj=self.adj # add nodes and edges (undirected method) for n in H: Hnbrs=H.adjlist_dict_factory() H_adj[n]=Hnbrs for nbr,edgedict in self_adj[n].items(): if nbr in H_adj: # add both representations of edge: n-nbr and nbr-n # they share the same edgedict ed=edgedict.copy() Hnbrs[nbr]=ed H_adj[nbr][n]=ed H.graph=self.graph return H
jni/networkx
networkx/classes/multigraph.py
Python
bsd-3-clause
36,285
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: any.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() DESCRIPTOR = _descriptor.FileDescriptor( name='any.proto', package='ts_mon.proto', syntax='proto2', serialized_options=None, serialized_pb=_b('\n\tany.proto\x12\x0cts_mon.proto\".\n\x03\x41ny\x12\x14\n\x08type_url\x18\x01 \x01(\tB\x02\x08\x02\x12\x11\n\x05value\x18\x02 \x01(\x0c\x42\x02\x08\x01') ) _ANY = _descriptor.Descriptor( name='Any', full_name='ts_mon.proto.Any', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='type_url', full_name='ts_mon.proto.Any.type_url', index=0, number=1, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=_b('\010\002'), file=DESCRIPTOR), _descriptor.FieldDescriptor( name='value', full_name='ts_mon.proto.Any.value', index=1, number=2, type=12, cpp_type=9, label=1, has_default_value=False, default_value=_b(""), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=_b('\010\001'), file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=27, serialized_end=73, ) DESCRIPTOR.message_types_by_name['Any'] = _ANY _sym_db.RegisterFileDescriptor(DESCRIPTOR) Any = _reflection.GeneratedProtocolMessageType('Any', (_message.Message,), dict( DESCRIPTOR = _ANY, __module__ = 'any_pb2' # @@protoc_insertion_point(class_scope:ts_mon.proto.Any) )) _sym_db.RegisterMessage(Any) _ANY.fields_by_name['type_url']._options = None _ANY.fields_by_name['value']._options = None # @@protoc_insertion_point(module_scope)
endlessm/chromium-browser
tools/swarming_client/third_party/infra_libs/ts_mon/protos/any_pb2.py
Python
bsd-3-clause
2,347
#!/bin/bash # Copyright (c) 2014, Stanford University # All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: # 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. # 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # Creates empty Edx and EdxPrivate databases # on local MySQL server. Uses createEmptyEdxDbs.sql # for the definitions. Then invokes defineMySQLProcedures.sh # to install the stored prodcedures and functions required # for operation. usage="Usage: "`basename $0`" [-u username][-p][-n noindexex]" # Determine if this is a Mac. Some bash # commands are not available there: if [[ $(echo $OSTYPE | cut -c 1-6) == 'darwin' ]] then PLATFORM='macos' BASH_VERSION=$(echo $(bash --version) | sed -n 's/[^0-9]*version \([0-9]\).*/\1/p') if [[ $BASH_VERSION < 4 ]] then echo "On MacOS Bash version must be 4.0 or higher." exit 1 fi else PLATFORM='other' fi # Get MySQL version on this machine MYSQL_VERSION=$(mysql --version | sed -ne 's/.*Distrib \([0-9][.][0-9]\).*/\1/p') if [[ $MYSQL_VERSION > 5.5 ]] then MYSQL_VERSION='5.6+' else MYSQL_VERSION='5.5' fi askForPasswd=false buildIndexes=1 USERNAME=`whoami` PASSWD='' # Issue dire warning and ask for confirmation: read -p "This command will delete databases Edx and EdxPrivate! Confirm with capital-Y " confirmation if [ $confirmation != 'Y' ] || [ -z $confirmation ] then echo "Aborting...good for you!" exit 0 else echo "OK, going ahead." fi # ------------------- Process Commandline Option ----------------- # Check whether given -pPassword, i.e. fused -p with a # pwd string: for arg in $@ do # The sed -n option # says to print only if pattern matches: PASSWD=$(echo $arg | sed -n 's/-p\([^ ]*\)/\1/p') if [ -z $PASSWD ] then continue else #echo "Pwd is:"$PASSWD break fi done # Keep track of number of optional args the user provided: NEXT_ARG=0 while getopts ":u:pn" opt do case $opt in u) # look in given user's HOME/.ssh/ for mysql_root USERNAME=$OPTARG NEXT_ARG=$((NEXT_ARG + 2)) ;; p) # ask for mysql root pwd askForPasswd=0 NEXT_ARG=$((NEXT_ARG + 1)) ;; n) # don't build indexes on the empty tables: buildIndexes=false NEXT_ARG=$((NEXT_ARG + 1)) ;; \?) # If the $PASSWD is set, we *assume* that # the unrecognized option was a # -pMyPassword, and don't signal # an error. Therefore, if $PASSWD is # set then illegal options are quietly # ignored: if [ ! -z $PASSWD ] then continue else echo $USAGE exit 1 fi ;; esac done # Shift past all the optional parms: shift ${NEXT_ARG} if $askForPasswd && [ -z $PASSWD ] then # The -s option suppresses echo: read -s -p "Password for "$USERNAME" on MySQL server: " PASSWD echo elif [ -z $PASSWD ] then # Get home directory of whichever user will if [[ $PLATFORM == 'macos' ]] then # MacOS dcacheutil outputs multiple /etc/passwd related # lines for given user: name, uid, gid. Etc. The one we # want is: "dir: /Users/theUser". Use awk to find # the line, and extract the 2nd field (i.e. the home dir: HOME_DIR=$(dscacheutil -q user -a name $USERNAME | awk '/dir:/ {print $2}') else HOME_DIR=$(getent passwd $USERNAME | cut -d: -f6) fi # log into MySQL: # If the home dir has a readable file called mysql_root in its .ssh # subdir, then pull the pwd from there: if test -f $HOME_DIR/.ssh/mysql_root && test -r $HOME_DIR/.ssh/mysql_root then PASSWD=`cat $HOME_DIR/.ssh/mysql_root` fi fi #************** #echo 'UID of script caller: '$USERNAME #echo 'UID used for MySQL operations: root' #echo 'MySQL root password: '$PASSWD # exit 0 #************** #************** echo "About to create tables" #************** currScriptsDir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" if [[ $MYSQL_VERSION == '5.6+' ]] then mysql --login-path=root < ${currScriptsDir}/createEmptyEdxDbs.sql else if [ -z $PASSWD ] then mysql -u root < ${currScriptsDir}/createEmptyEdxDbs.sql else mysql -u root -p$PASSWD < ${currScriptsDir}/createEmptyEdxDbs.sql fi fi #************** echo "Done creating tables" echo "About to create procedures and functions." #************** if [ -z $PASSWD ] then $currScriptsDir/defineMySQLProcedures.sh -u root else $currScriptsDir/defineMySQLProcedures.sh -u root -p${PASSWD} fi #************** echo "Done creating procedures and functions." #************** if [ $buildIndexes = 1 ] then echo "Starting index creation." $currScriptsDir/createIndexForTable.sh -u root -p${PASSWD} echo "Done creating indexes." else echo "No index creation requested; no indexes defined." fi
paepcke/json_to_relation
scripts/createEmptyEdxDbs.sh
Shell
bsd-3-clause
6,086
<?php /** * RestPHP Framework * * PHP Version 5.3 * * Copyright (c) 2011, RestPHP Framework * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * Neither the name of the RestPHP Framework nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * * @category RestPHP * @package RestPHP * @subpackage Test * @author Joshua Johnston <[email protected]> * @copyright 2011 RestPHP Framework * @license http://opensource.org/licenses/bsd-license.php New BSD License */ /** * @namespace */ namespace RestPHP\Request\Header; /** * HostTest - Tests the Host header behaves as documented in RFC 2616 * Section 14 * * @category RestPHP * @package RestPHP * @subpackage Test * @author Joshua Johnston <[email protected]> * @copyright 2011 RestPHP Framework * @license http://opensource.org/licenses/bsd-license.php New BSD License * @link http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html RFC 2616 Sec 14 */ class HostTest extends \PHPUnit_Framework_TestCase { /** * * @var \RestPHP\Request\Header\Host */ protected $header; public function setUp() { $this->header = new \RestPHP\Request\Header\Host(); } public function testParse() { $this->markTestIncomplete('No tests implemented'); } }
Trii/RestPHP
test/RestPHP/Request/Header/HostTest.php
PHP
bsd-3-clause
2,690
// Copyright 2016 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. package org.chromium.blimp.core.contents; import org.chromium.base.ObserverList; import org.chromium.base.annotations.CalledByNative; import org.chromium.base.annotations.JNINamespace; import org.chromium.blimp_public.contents.BlimpContentsObserver; /** * Serves as a compound observer proxy for dispatching BlimpContentsObserver callbacks, * avoiding redundant JNI-related work when there are multiple Java-based observers. */ @JNINamespace("blimp::client") class BlimpContentsObserverProxy implements BlimpContentsObserver { private final ObserverList<BlimpContentsObserver> mObservers = new ObserverList<>(); private long mNativeBlimpContentsObserverProxy; BlimpContentsObserverProxy(BlimpContentsImpl blimpContentsImpl) { mNativeBlimpContentsObserverProxy = nativeInit(blimpContentsImpl); } void destroy() { if (mNativeBlimpContentsObserverProxy != 0) { nativeDestroy(mNativeBlimpContentsObserverProxy); mNativeBlimpContentsObserverProxy = 0; } mObservers.clear(); } void addObserver(BlimpContentsObserver observer) { assert mNativeBlimpContentsObserverProxy != 0; mObservers.addObserver(observer); } void removeObserver(BlimpContentsObserver observer) { mObservers.removeObserver(observer); } @Override @CalledByNative public void onNavigationStateChanged() { for (BlimpContentsObserver observer : mObservers) { observer.onNavigationStateChanged(); } } private native long nativeInit(BlimpContentsImpl blimpContentsImpl); private native void nativeDestroy(long nativeBlimpContentsObserverProxy); }
danakj/chromium
blimp/client/core/contents/android/java/src/org/chromium/blimp/core/contents/BlimpContentsObserverProxy.java
Java
bsd-3-clause
1,853
package org.tolweb.tapestry; import java.util.List; import org.apache.tapestry.event.PageBeginRenderListener; import org.apache.tapestry.event.PageEvent; import org.apache.tapestry.html.BasePage; import org.tolweb.hibernate.MappedNode; import org.tolweb.tapestry.injections.BaseInjectable; import org.tolweb.tapestry.injections.CookieInjectable; import org.tolweb.tapestry.injections.PageInjectable; import org.tolweb.tapestry.injections.UserInjectable; import org.tolweb.treegrow.main.Contributor; public abstract class NoPermissionsPage extends BasePage implements PageBeginRenderListener, PageInjectable, UserInjectable, CookieInjectable, BaseInjectable { @SuppressWarnings("unchecked") public abstract void setNodeNames(List value); @SuppressWarnings("unchecked") public abstract List getNodeNames(); public abstract MappedNode getPreviousNode(); public abstract void setPreviousNode(MappedNode value); public boolean getHasGroups() { return getNodeNames() != null && getNodeNames().size() > 0; } @SuppressWarnings("unchecked") public void pageBeginRender(PageEvent event) { Contributor contr = getContributor(); List nodeNames = getPermissionChecker().getNodeNamesContributorAttachedTo(contr.getId(), true); setNodeNames(nodeNames); } public String getSOrNull() { if (getNodeNames().size() > 0) { return "s"; } else { return null; } } public String getPublicUrl() { return getUrlBuilder().getPublicURLForBranchPage(getPreviousNode()); } }
tolweb/tolweb-app
OnlineContributors/src/org/tolweb/tapestry/NoPermissionsPage.java
Java
bsd-3-clause
1,494
import {Vector2D} from '../2D/Vector2D'; import {IIntersectionParam} from '../2D/IIntersectionParam'; import {AShape} from './AShape'; import {ICircle} from './ICircle'; import {Rect} from './Rect'; export class Circle extends AShape implements ICircle { constructor(public x = 0, public y = 0, public radius = 0) { super(); } get xy() { return new Vector2D(this.x, this.y); } toString() { return `Circle(x=${this.x},y=${this.y},radius=${this.radius})`; } protected shiftImpl(x: number, y: number) { this.x += x; this.y += y; } aabb(): Rect { return new Rect(this.x - this.radius, this.y - this.radius, this.radius * 2, this.radius * 2); } get center(): Vector2D { return this.xy; } transform(scale: number[], rotate: number) { return new Circle(this.x * scale[0], this.y * scale[1], this.radius * (scale[0] + scale[1]) / 2); } asIntersectionParams(): IIntersectionParam { return { name: 'Circle', params: [this.xy, this.radius] }; } static circle(x: number, y: number, radius: number): Circle { return new Circle(x, y, radius); } }
datavisyn/tdp_core
src/geom/Circle.ts
TypeScript
bsd-3-clause
1,134
<?php namespace app\models\frontend; use app\models\db\User; use Yii; use yii\base\Model; /** * Password reset request form */ class PasswordResetRequestForm extends Model { public $email; /** * {@inheritdoc} */ public function rules() { return [ ['email', 'filter', 'filter' => 'trim'], ['email', 'required'], ['email', 'email'], ['email', 'exist', 'targetClass' => User::class, 'filter' => ['statusId' => User::STATUS_ACTIVE], 'message' => Yii::t('error', 'There is no user with such email.'), ], ]; } /** * {@inheritdoc} */ public function attributeLabels() { return [ 'email' => Yii::t('user', 'Email'), ]; } /** * Sends an email with a link, for resetting the password. * * @return bool whether the email was send. */ public function send() { /* @var $user User */ $user = User::findOne([ 'statusId' => User::STATUS_ACTIVE, 'email' => $this->email, ]); if ($user) { if (!User::isPasswordResetTokenValid($user->passwordResetToken)) { $user->generatePasswordResetToken(); } if ($user->save()) { return Yii::$app->mailer->compose('passwordResetToken', ['user' => $user]) ->setFrom([Yii::$app->params['appEmail'] => Yii::$app->name]) ->setTo($this->email) ->setSubject('Password reset for ' . Yii::$app->name) ->send(); } } return false; } }
yii2tech/project-template
models/frontend/PasswordResetRequestForm.php
PHP
bsd-3-clause
1,731
<?php use common\models\Kurs; use common\models\Orders; use yii\helpers\Html; use yii\widgets\ActiveForm; use yii\widgets\MaskedInput; $orders = new Orders ?> <div class="radio_buttons"> <div> <input type='radio' class='variant' name='variant_id' value='0' id="variant0"><label for='variant0'>Все</label><br> </div> <?php foreach($product->variants as $variant): ?> <div> <input type='radio' class='variant' name='variant_id' value='<?= $variant->id ?>' id='variant<?= $variant->id ?>'> <label for='variant<?= $variant->id ?>'><?= $variant->title ?></label> </div> <?php endforeach; ?> </div> <div style='clear: both'></div> <br> <?php foreach($product->size as $size): ?> <div class='radio_buttons size variant<?= $size->variant_id ?>'> <div class="radio_buttons"> <input type='radio' class='size variant<?= $size->variant_id ?>' name='size_id' value='<?= $size->id ?>' id='size<?= $size->id ?>'> <label for='size<?= $size->id ?>'><?= $size->title ?></label> </div> </div> <?php endforeach; ?> <div style='clear: both'></div> <br> <?php foreach($product->size as $size): ?> <?php foreach($size->colors as $color): ?> <div class='radio_buttons color size<?= $color->size_id ?>'> <div class="radio_buttons"> <input type='radio' class='color size<?= $color->size_id ?>' name='color_id' value='<?= $color->prices['price'] ?>' id='color<?= $color->id ?>'><label for='color<?= $color->id ?>'><?= $color->title ?></label> </div> </div> <?php endforeach; ?> <?php endforeach; ?> <div style='clear: both'></div> <br> <div id='colorQTY' class='unvisible'> Количество:<br> <!--<div class='qty'></div> --> <input type="button" value="-" id="minusQ" class="minus"> <input type='number' name='quantity' class='quantityInput' id='quantityInput' min="50" max="10000" step="50" value='50' style='width: 75px'> <input type="button" value="+" id="addQ" class="plus"> <br><br> Количество цветов (сторона 1 : сторона 2)<br> <input type="button" value="-" id="minus1" class="minus"> <input type='number' name='colorQuantity1' class='colorQuantity1' max='9' min='1' value='1' style='width: 50px'> <input type="button" value="+" id="add1" class="plus"> : <input type="button" value="-" id="minus2" class="minus"> <input type='number' name='colorQuantity1' class='colorQuantity2' max='9' min='0' value='0' style='width: 50px'> <input type="button" value="+" id="add2" class="plus"> <br><br> <?php $i = 0; ?> <?php foreach($product->relations as $relation): ?> <?php foreach($relation->services->prices as $price): ?> <?php if($price->product_id == $product->id || $price->product_id == 0 ){ ?> <?php if($price->service_id !== 3 && $price->service_id !== 2 ){ ?> <div class='checkbox_buttons'> <div class="checkbox_buttons"> <input id="serv<?= $i ?>" type="checkbox" class="serv" value=" <?php if($relation->services['unit']){ echo '(' . $price->price . ' * quantity)'; }else{ echo $price->price; } ?> "> <label for='serv<?= $i ?>'><?= $relation->services['title'] ?></label> </div> </div> <?php $i += 1; } ?> <?php } ?> <?php endforeach; ?> <?php endforeach; ?> <div class="clear"></div> <br> <?php $i = 0; ?> <?php foreach($product->matrelations as $matrelation): ?> <div class="checkbox_buttons" style='display: inline'> <input id="dopserv<?= $i ?>" type="checkbox" class="dopserv" value="( <?= $matrelation->materials->workprice ?> * quantity)"> <label for='dopserv<?= $i ?>'><?= $matrelation->materials->title ?></label> </div> <div id='matcount<?= $i ?>' class='unvisible'> <div style='display: inline-block; padding: 10px'> <p>Длинна, см:</p> <input id='matshir<?= $i ?>' type='number' class='matquantity' value='1' style='width: 50px'> </div> <div style='display: inline-block; padding: 10px'> <p>Высота, см:</p> <input id='matvys<?= $i ?>' type='number' class='matquantity' value='1' style='width: 50px'> </div> </div> <br> <?php $i += 1; ?> <?php endforeach ?> <br> <button id='check' style='float:left' class='btn btn-primary'>Расчитать</button> <div id='sum' class='unvisible'> <div id="odometer" class="odometer" style='font-size: 27px; margin-left: 10px;'></div> грн. </div> </div> <br> <div id='form_orders' class='unvisible'> <?php $form = ActiveForm::begin([ 'action' => '@web/site/createorder', ]) ?> <?= $form->field($orders, 'name')->textInput(['value' => isset(Yii::$app->user->identity->fio) ? Yii::$app->user->identity->fio : false])->label('Ваше Имя *') ?> <?= $form->field($orders, 'telephone')->widget(MaskedInput::className(), [ 'mask' => '(999) 999-99-99', ])->textInput(['placeholder' => 'Введите номер телефона', 'value' => isset(Yii::$app->user->identity->telephone) ? Yii::$app->user->identity->telephone : false])->label('Телефон *') ?> <?= $form->field($orders, 'mail')->textInput(['value' => isset(Yii::$app->user->identity->email) ? Yii::$app->user->identity->email : false])->label('E-mail *') ?> <?= $form->field($orders, 'details')->hiddenInput()->label(false) ?> <?= $form->field($orders, 'user_id')->hiddenInput(['value' => isset(Yii::$app->user->identity->id) ? Yii::$app->user->identity->id : false])->label(false) ?> <div class="form-group"> <div class=""> <?= Html::submitButton('Заказать', ['class' => 'btn btn-primary']) ?> </div> </div> <?php ActiveForm::end() ?> </div> <div style="display: none"> <input id="products-formula" value="<?= $product->formula ?>"> <?php foreach($product->relations as $relation): ?> <?php foreach($relation->services->prices as $price): ?> <?php if($price->product_id == $product->id || $price->product_id == 0){ ?> <input class="form-control price sizew<?= $price->size['id'] ?> service<?= $relation->services['id'] ?>" value="<?= $price->price ?>" > <?php } ?> <?php endforeach; ?> <?php endforeach; ?> </div> <script> var material = []; var dopworkprice = []; <?php $i = 0 ?> <?php foreach($product->matrelations as $matrelations): ?> material[<?= $i ?>] = <?= $matrelations->materials->price ?>; dopworkprice[<?= $i ?>] = <?= $matrelations->materials->workprice ?>; <?php $i += 1 ?> <?php endforeach ?> var materialsKurs = <?= Kurs::findOne(1)->materials ?>; var worksKurs = <?= Kurs::findOne(1)->works ?>; var productName = '<?= $product->title ?>'; </script>
YegorSS/nedesign
frontend/views/site/_calculator.php
PHP
bsd-3-clause
6,983
// Copyright 2019 Google LLC. // Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. #include "fiddle/examples.h" // HASH=92e0032f85181795d1f8b5a2c8e4e4b7 REG_FIDDLE(Path_dump_2, 256, 256, true, 0) { void draw(SkCanvas* canvas) { SkPath path, copy; path.lineTo(6.f / 7, 2.f / 3); path.dump(); copy.setFillType(SkPath::kWinding_FillType); copy.moveTo(0, 0); copy.lineTo(0.857143f, 0.666667f); SkDebugf("path is " "%s" "equal to copy\n", path == copy ? "" : "not "); } } // END FIDDLE
rubenvb/skia
docs/examples/Path_dump_2.cpp
C++
bsd-3-clause
558
--- title: Integrations layout: docs_home class: grid linkTitle: "Integrations" main_menu: true weight: 5 menu: main: title: "What's an integration?" overview: > <p>An integration enables some features on CDS.</p> <p>It can concern the storage of the artifacts, the repositories manager, the hooks available to trigger workflows, the infrastructure used to spawn the workers.</p> <p>Here are the extensions available:</p> cards: - name: storage title: Storage - name: hooks title: Hooks on CDS Workflows - name: deployment title: Application Deployement - name: repository-manager title: Repositories Managers - name: compute title: Infrastructure used by CDS Workers - name: events title: CDS Events - name: authentication title: User Authentication - name: artifact-manager title: Artifact Manager ---
ovh/cds
docs/content/docs/integrations/_index.md
Markdown
bsd-3-clause
834
Yii 2 Basic Project Template ============================ Yii 2 Basic Project Template is a skeleton [Yii 2](http://www.yiiframework.com/) application best for rapidly creating small projects. The template contains the basic features including user login/logout and a contact page. It includes all commonly used configurations that would allow you to focus on adding new features to your application. [![Latest Stable Version](https://poser.pugx.org/yiisoft/yii2-app-basic/v/stable.png)](https://packagist.org/packages/yiisoft/yii2-app-basic) [![Total Downloads](https://poser.pugx.org/yiisoft/yii2-app-basic/downloads.png)](https://packagist.org/packages/yiisoft/yii2-app-basic) [![Build Status](https://travis-ci.org/yiisoft/yii2-app-basic.svg?branch=master)](https://travis-ci.org/yiisoft/yii2-app-basic) DIRECTORY STRUCTURE ------------------- assets/ contains assets definition commands/ contains console commands (controllers) config/ contains application configurations controllers/ contains Web controller classes mail/ contains view files for e-mails models/ contains model classes runtime/ contains files generated during runtime tests/ contains various tests for the basic application vendor/ contains dependent 3rd-party packages views/ contains view files for the Web application web/ contains the entry script and Web resources REQUIREMENTS ------------ The minimum requirement by this project template that your Web server supports PHP 5.4.0. INSTALLATION ------------ ### Install from an Archive File Extract the archive file downloaded from [yiiframework.com](http://www.yiiframework.com/download/) to a directory named `basic` that is directly under the Web root. Set cookie validation key in `config/web.php` file to some random secret string: ```php 'request' => [ // !!! insert a secret key in the following (if it is empty) - this is required by cookie validation 'cookieValidationKey' => '<secret random string goes here>', ], ``` You can then access the application through the following URL: ~~~ http://localhost/basic/web/ ~~~ ### Install via Composer If you do not have [Composer](http://getcomposer.org/), you may install it by following the instructions at [getcomposer.org](http://getcomposer.org/doc/00-intro.md#installation-nix). You can then install this project template using the following command: ~~~ php composer.phar global require "fxp/composer-asset-plugin:~1.0.0" php composer.phar create-project --prefer-dist --stability=dev yiisoft/yii2-app-basic basic ~~~ Now you should be able to access the application through the following URL, assuming `basic` is the directory directly under the Web root. ~~~ http://localhost/basic/web/ ~~~ CONFIGURATION ------------- ### Database Edit the file `config/db.php` with real data, for example: ```php return [ 'class' => 'yii\db\Connection', 'dsn' => 'mysql:host=localhost;dbname=yii2basic', 'username' => 'root', 'password' => '1234', 'charset' => 'utf8', ]; ``` **NOTE:** Yii won't create the database for you, this has to be done manually before you can access it. Also check and edit the other files in the `config/` directory to customize your application. # check
cyberavenger/check
README.md
Markdown
bsd-3-clause
3,409
module Main ( main ) where import qualified Types.BotTypes as BT import Control.Monad (forever) import Data.Aeson (decode) import qualified Data.Map as Map import qualified Data.Text.Lazy.Encoding as T import qualified Data.Text.Lazy.IO as T import System.Environment (getArgs) import System.Exit (ExitCode(ExitSuccess, ExitFailure)) import System.IO (stdout, stdin, hSetBuffering, BufferMode(..)) import System.Process (readProcessWithExitCode) import Text.Regex.PCRE ((=~)) main :: IO () main = do (nick:_) <- getArgs hSetBuffering stdout LineBuffering hSetBuffering stdin LineBuffering forever $ do line <- T.getLine handleMessage nick $ (decode . T.encodeUtf8) line handleMessage :: String -> Maybe BT.ServerMessage -> IO () handleMessage nick (Just (BT.ServerPrivMsg _ _ msg)) | str =~ helpPattern = help nick | [[_, url]] <- str =~ runPattern1 = asciipicture url | [[_, url]] <- str =~ runPattern2 = asciipicture url | [[_, url]] <- str =~ runPattern3 = asciipicture url | [[_, url]] <- str =~ runPattern4 = asciipicture url where str = BT.getMessage msg helpPattern = concat ["^", sp, nick, ":", ps, "asciipicture", ps, "help", sp, "$"] runPattern1 = concat ["^", sp, "asciipicture:", ps, "(.*)$"] runPattern2 = concat ["^", sp, "asciiart:", ps, "(.*)$"] runPattern3 = concat ["^", sp, nick, ":", ps, "asciiart", ps, "(.*)$"] runPattern4 = concat ["^", sp, nick, ":", ps, "asciipicture", ps, "(.*)$"] sp = "[ \\t]*" ps = "[ \\t]+" handleMessage _ _ = return () asciipicture :: String -> IO () asciipicture picRef = case Map.lookup picRef buildIn of Just url -> generatePicture url Nothing -> generatePicture picRef generatePicture :: String -> IO () generatePicture url = do (e, s, _) <- readProcessWithExitCode "/usr/bin/jp2a" [url, "--width=80", "--background=light"] [] case e of ExitSuccess -> putStrLn s ExitFailure _ -> return () help :: String -> IO () help nick = putStrLn $ unlines [ nick ++ ": asciipicture help - show this message" , "asciipicture: url - show asciipicture of jpg linked to" ] buildIn :: Map.Map String String buildIn = Map.fromList [ ("dickbutt", "https://static1.fjcdn.com/thumbnails/comments/" ++ "Dickbut+for+everybody+zentertainments+gets+a+dickbut+_" ++ "fc88e4d586c873f470964fab580a9518.jpg") , ("(y)", "http://clipartix.com/wp-content/uploads/2016/04/Thumbs-up" ++ "-clipart-cliparts-for-you.jpg") , ("pepe", "https://ih1.redbubble.net/image.53530799.0943/" ++ "flat,800x800,070,f.jpg") , ("wewlad", "http://vignette1.wikia.nocookie.net/trollpasta/images/e/" ++ "e6/Wew_lad.jpg") , ("just right", "http://static3.depositphotos.com/1001914/142/i/950/" ++ "depositphotos_1429391-Hand-sign-ok.jpg") ]
bus000/Dikunt
plugins/AsciiPicture/Main.hs
Haskell
bsd-3-clause
2,871
package org.wquery import java.io.StringReader import org.scalatest.Matchers import org.scalatest.testng.TestNGSuite import org.testng.annotations.Test import org.wquery.reader.{ExpressionReader, InputLineReader} import scala.collection.mutable.ListBuffer class ExpressionReaderTestSuite extends TestNGSuite with Matchers { @Test def simpleQuery() = result shouldNotChange """{person} |""".stripMargin @Test def noQuery() = result of "" should equal (Nil) @Test def emptyLine() = result of "\n" should equal (Nil) @Test def simpleQueryWithAComment() = result only """{person} -- here is a comment {car} |""".stripMargin should equal ("{person} \n") @Test def commentAtTheBeginning() = result of """-- {person} |""".stripMargin should equal (Nil) @Test def hashCommentAtTheBeginning() = result of """# {person} |""".stripMargin should equal (Nil) @Test def simpleDoEnd() = result shouldNotChange """from {}$a do | emit $a |end |""".stripMargin @Test def nestedDoEnd() = result shouldNotChange """from {}$a do | do | emit $a | emit $a | end |end |""".stripMargin @Test def nestedTwoDoEnds() = result shouldNotChange """from {}$a do | do | emit $a | emit $a | end | do | emit $a | end |end |""".stripMargin @Test def threeQueries() = result of """{person} |{person} |{person} |""".stripMargin should equal (List("{person}\n", "{person}\n", "{person}\n")) @Test def threeQueriesSeparatedBySpaces() = result of """{person} | |{person} | |{person} |""".stripMargin should equal (List("{person}\n", "{person}\n", "{person}\n")) @Test def fourComplexQueries() = result of """from {}$a do | do | emit $a | emit $a | end |end |{} |do | do | emit $a | emit $a | end |end |from {}$a do | do | emit $a | emit $a | end |end |""".stripMargin should equal (List( """from {}$a do | do | emit $a | emit $a | end |end |""".stripMargin, "{}\n", """do | do | emit $a | emit $a | end |end |""".stripMargin, """from {}$a do | do | emit $a | emit $a | end |end |""".stripMargin)) @Test def fourComplexQueriesWithNewLines() = result of """from {}$a do | do | emit $a | emit $a | end |end | |{} | |do | do | | emit $a | emit $a | end |end | |from {}$a do | do | emit $a | | emit $a | end |end |""".stripMargin should equal (List( """from {}$a do | do | emit $a | emit $a | end |end |""".stripMargin, "{}\n", """do | do | | emit $a | emit $a | end |end |""".stripMargin, """from {}$a do | do | emit $a | | emit $a | end |end |""".stripMargin)) @Test def lineContinuation() = result of """from {}$a \ | emit $a |""".stripMargin should equal (List("from {}$a \n emit $a\n")) @Test def lineContinuations() = result of """from {}$a \ | emit $a \ | emit $a |""".stripMargin should equal (List("from {}$a \n emit $a \n emit $a\n")) @Test def continuationSymbolInQuotedString() = result of """emit '\ | here is the end' |""".stripMargin should equal (List("emit '\\\n here is the end'\n")) // // initialization // object ResultOf { def of(query: String) = { val results = new ListBuffer[String] val reader = new ExpressionReader(new InputLineReader(new StringReader(query))) reader.foreach(results.append(_)) reader.close() results.toList } def only(query: String) = of(query).head def shouldNotChange(query: String) = only(query) should equal (query) } val result = ResultOf }
marekkubis/wquery
src/test/scala/org/wquery/ExpressionReaderTestSuite.scala
Scala
bsd-3-clause
4,317
export {default as Three} from "./src/3d/three/index.js" export {default as x} from "./src/3d/index" export {default as X} from "./src/3d/index" export {default as Flate} from "./src/3d/map/Flate" export {default as Earth} from "./src/3d/map/Earth" export {default as utilCityCenter} from "./src/utils/cityCenter"; export {default as utilCurve} from "./src/utils/curve"; export {default as utilForceEdgeBundling} from "./src/utils/forceEdgeBundling"; export {default as utilDataRangeIntensity} from "./src/utils/data-range/Intensity"; export {default as utilDataRangeCategory} from "./src/utils/data-range/Category"; export {default as utilDataRangeChoropleth} from "./src/utils/data-range/Choropleth";
huiyan-fe/mapv
index.3d.js
JavaScript
bsd-3-clause
704
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE190_Integer_Overflow__int64_t_fscanf_square_83_bad.cpp Label Definition File: CWE190_Integer_Overflow.label.xml Template File: sources-sinks-83_bad.tmpl.cpp */ /* * @description * CWE: 190 Integer Overflow * BadSource: fscanf Read data from the console using fscanf() * GoodSource: Set data to a small, non-zero number (two) * Sinks: square * GoodSink: Ensure there will not be an overflow before squaring data * BadSink : Square data, which can lead to overflow * Flow Variant: 83 Data flow: data passed to class constructor and destructor by declaring the class object on the stack * * */ #ifndef OMITBAD #include "std_testcase.h" #include "CWE190_Integer_Overflow__int64_t_fscanf_square_83.h" #include <math.h> #include <inttypes.h> namespace CWE190_Integer_Overflow__int64_t_fscanf_square_83 { CWE190_Integer_Overflow__int64_t_fscanf_square_83_bad::CWE190_Integer_Overflow__int64_t_fscanf_square_83_bad(int64_t dataCopy) { data = dataCopy; /* POTENTIAL FLAW: Use a value input from the console */ fscanf (stdin, "%" SCNd64, &data); } CWE190_Integer_Overflow__int64_t_fscanf_square_83_bad::~CWE190_Integer_Overflow__int64_t_fscanf_square_83_bad() { { /* POTENTIAL FLAW: if (data*data) > LLONG_MAX, this will overflow */ int64_t result = data * data; printLongLongLine(result); } } } #endif /* OMITBAD */
JianpingZeng/xcc
xcc/test/juliet/testcases/CWE190_Integer_Overflow/s02/CWE190_Integer_Overflow__int64_t_fscanf_square_83_bad.cpp
C++
bsd-3-clause
1,462
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef NET_SOCKET_SSL_CLIENT_SOCKET_WIN_H_ #define NET_SOCKET_SSL_CLIENT_SOCKET_WIN_H_ #define SECURITY_WIN32 // Needs to be defined before including security.h #include <windows.h> #include <wincrypt.h> #include <security.h> #include <string> #include "base/memory/scoped_ptr.h" #include "net/base/cert_verify_result.h" #include "net/base/completion_callback.h" #include "net/base/host_port_pair.h" #include "net/base/net_log.h" #include "net/base/ssl_config_service.h" #include "net/socket/ssl_client_socket.h" namespace net { class BoundNetLog; class CertVerifier; class ClientSocketHandle; class HostPortPair; class SingleRequestCertVerifier; // An SSL client socket implemented with the Windows Schannel. class SSLClientSocketWin : public SSLClientSocket { public: // Takes ownership of the |transport_socket|, which must already be connected. // The hostname specified in |host_and_port| will be compared with the name(s) // in the server's certificate during the SSL handshake. If SSL client // authentication is requested, the host_and_port field of SSLCertRequestInfo // will be populated with |host_and_port|. |ssl_config| specifies // the SSL settings. SSLClientSocketWin(ClientSocketHandle* transport_socket, const HostPortPair& host_and_port, const SSLConfig& ssl_config, const SSLClientSocketContext& context); ~SSLClientSocketWin(); // SSLClientSocket implementation. virtual void GetSSLCertRequestInfo(SSLCertRequestInfo* cert_request_info); virtual int ExportKeyingMaterial(const base::StringPiece& label, bool has_context, const base::StringPiece& context, unsigned char* out, unsigned int outlen); virtual NextProtoStatus GetNextProto(std::string* proto, std::string* server_protos); virtual ServerBoundCertService* GetServerBoundCertService() const OVERRIDE; // StreamSocket implementation. virtual int Connect(const CompletionCallback& callback) OVERRIDE; virtual void Disconnect() OVERRIDE; virtual bool IsConnected() const OVERRIDE; virtual bool IsConnectedAndIdle() const OVERRIDE; virtual int GetPeerAddress(IPEndPoint* address) const OVERRIDE; virtual int GetLocalAddress(IPEndPoint* address) const OVERRIDE; virtual const BoundNetLog& NetLog() const OVERRIDE{ return net_log_; } virtual void SetSubresourceSpeculation() OVERRIDE; virtual void SetOmniboxSpeculation() OVERRIDE; virtual bool WasEverUsed() const OVERRIDE; virtual bool UsingTCPFastOpen() const OVERRIDE; virtual int64 NumBytesRead() const OVERRIDE; virtual base::TimeDelta GetConnectTimeMicros() const OVERRIDE; virtual bool GetSSLInfo(SSLInfo* ssl_info) OVERRIDE; // Socket implementation. virtual int Read(IOBuffer* buf, int buf_len, const CompletionCallback& callback) OVERRIDE; virtual int Write(IOBuffer* buf, int buf_len, const CompletionCallback& callback) OVERRIDE; virtual bool SetReceiveBufferSize(int32 size) OVERRIDE; virtual bool SetSendBufferSize(int32 size) OVERRIDE; private: bool completed_handshake() const { return next_state_ == STATE_COMPLETED_HANDSHAKE; } // Initializes the SSL options and security context. Returns a net error code. int InitializeSSLContext(); void OnHandshakeIOComplete(int result); void OnReadComplete(int result); void OnWriteComplete(int result); int DoLoop(int last_io_result); int DoHandshakeRead(); int DoHandshakeReadComplete(int result); int DoHandshakeWrite(); int DoHandshakeWriteComplete(int result); int DoVerifyCert(); int DoVerifyCertComplete(int result); int DoPayloadRead(); int DoPayloadReadComplete(int result); int DoPayloadDecrypt(); int DoPayloadEncrypt(); int DoPayloadWrite(); int DoPayloadWriteComplete(int result); int DoCompletedRenegotiation(int result); int DidCallInitializeSecurityContext(); int DidCompleteHandshake(); void DidCompleteRenegotiation(); void LogConnectionTypeMetrics() const; void FreeSendBuffer(); scoped_ptr<ClientSocketHandle> transport_; HostPortPair host_and_port_; SSLConfig ssl_config_; // User function to callback when the Connect() completes. CompletionCallback user_connect_callback_; // User function to callback when a Read() completes. CompletionCallback user_read_callback_; scoped_refptr<IOBuffer> user_read_buf_; int user_read_buf_len_; // User function to callback when a Write() completes. CompletionCallback user_write_callback_; scoped_refptr<IOBuffer> user_write_buf_; int user_write_buf_len_; // Used to Read and Write using transport_. scoped_refptr<IOBuffer> transport_read_buf_; scoped_refptr<IOBuffer> transport_write_buf_; enum State { STATE_NONE, STATE_HANDSHAKE_READ, STATE_HANDSHAKE_READ_COMPLETE, STATE_HANDSHAKE_WRITE, STATE_HANDSHAKE_WRITE_COMPLETE, STATE_VERIFY_CERT, STATE_VERIFY_CERT_COMPLETE, STATE_COMPLETED_RENEGOTIATION, STATE_COMPLETED_HANDSHAKE // After the handshake, the socket remains // in the STATE_COMPLETED_HANDSHAKE state, // unless a renegotiate handshake occurs. }; State next_state_; SecPkgContext_StreamSizes stream_sizes_; scoped_refptr<X509Certificate> server_cert_; CertVerifier* const cert_verifier_; scoped_ptr<SingleRequestCertVerifier> verifier_; CertVerifyResult server_cert_verify_result_; CredHandle* creds_; CtxtHandle ctxt_; SecBuffer in_buffers_[2]; // Input buffers for InitializeSecurityContext. SecBuffer send_buffer_; // Output buffer for InitializeSecurityContext. SECURITY_STATUS isc_status_; // Return value of InitializeSecurityContext. scoped_array<char> payload_send_buffer_; int payload_send_buffer_len_; int bytes_sent_; // recv_buffer_ holds the received ciphertext. Since Schannel decrypts // data in place, sometimes recv_buffer_ may contain decrypted plaintext and // any undecrypted ciphertext. (Ciphertext is decrypted one full SSL record // at a time.) // // If bytes_decrypted_ is 0, the received ciphertext is at the beginning of // recv_buffer_, ready to be passed to DecryptMessage. scoped_array<char> recv_buffer_; char* decrypted_ptr_; // Points to the decrypted plaintext in recv_buffer_ int bytes_decrypted_; // The number of bytes of decrypted plaintext. char* received_ptr_; // Points to the received ciphertext in recv_buffer_ int bytes_received_; // The number of bytes of received ciphertext. // True if we're writing the first token (handshake message) to the server, // false if we're writing a subsequent token. After we have written a token // successfully, DoHandshakeWriteComplete checks this member to set the next // state. bool writing_first_token_; // Only used in the STATE_HANDSHAKE_READ_COMPLETE and // STATE_PAYLOAD_READ_COMPLETE states. True if a 'result' argument of OK // should be ignored, to prevent it from being interpreted as EOF. // // The reason we need this flag is that OK means not only "0 bytes of data // were read" but also EOF. We set ignore_ok_result_ to true when we need // to continue processing previously read data without reading more data. // We have to pass a 'result' of OK to the DoLoop method, and don't want it // to be interpreted as EOF. bool ignore_ok_result_; // Renegotiation is in progress. bool renegotiating_; // True when the decrypter needs more data in order to decrypt. bool need_more_data_; BoundNetLog net_log_; }; } // namespace net #endif // NET_SOCKET_SSL_CLIENT_SOCKET_WIN_H_
keishi/chromium
net/socket/ssl_client_socket_win.h
C
bsd-3-clause
7,920
/** * BetweenExp.java * --------------------------------- * Copyright (c) 2016 * RESOLVE Software Research Group * School of Computing * Clemson University * All rights reserved. * --------------------------------- * This file is subject to the terms and conditions defined in * file 'LICENSE.txt', which is part of this source code package. */ package edu.clemson.cs.rsrg.absyn.expressions.mathexpr; import edu.clemson.cs.rsrg.absyn.expressions.Exp; import edu.clemson.cs.rsrg.parsing.data.Location; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import java.util.Map; /** * <p>This is the class for a list of mathematical expression objects that * are joined together by the "and" operator that the compiler builds * using the ANTLR4 AST nodes.</p> * * @version 2.0 */ public class BetweenExp extends MathExp { // =========================================================== // Member Fields // =========================================================== /** <p>The expressions that compose this expression.</p> */ private final List<Exp> myJoiningExps; // =========================================================== // Constructors // =========================================================== /** * <p>This constructs a between expression of the form * "[x] and [y] and ...".</p> * * @param l A {@link Location} representation object. * @param joiningExps A list of {@link Exp} expressions. */ public BetweenExp(Location l, List<Exp> joiningExps) { super(l); myJoiningExps = joiningExps; } // =========================================================== // Public Methods // =========================================================== /** * {@inheritDoc} */ @Override public final String asString(int indentSize, int innerIndentInc) { StringBuffer sb = new StringBuffer(); printSpace(indentSize, sb); Iterator<Exp> it = myJoiningExps.iterator(); while (it.hasNext()) { sb.append(it.next().asString(0, innerIndentInc)); if (it.hasNext()) { sb.append(" and "); } } return sb.toString(); } /** * {@inheritDoc} */ @Override public final boolean containsExp(Exp exp) { boolean found = false; if (myJoiningExps != null) { Iterator<Exp> i = myJoiningExps.iterator(); while (i.hasNext() && !found) { Exp temp = i.next(); if (temp != null) { if (temp.containsExp(exp)) { found = true; } } } } return found; } /** * {@inheritDoc} */ @Override public final boolean containsVar(String varName, boolean IsOldExp) { boolean found = false; Iterator<Exp> i = myJoiningExps.iterator(); while (i.hasNext() && !found) { Exp temp = i.next(); if (temp != null) { if (temp.containsVar(varName, IsOldExp)) { found = true; } } } return found; } /** * {@inheritDoc} */ @Override public final boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; if (!super.equals(o)) return false; BetweenExp that = (BetweenExp) o; return myJoiningExps.equals(that.myJoiningExps); } /** * {@inheritDoc} */ @Override public final boolean equivalent(Exp e) { // I don't really understand what a "BetweenExp" is, so for now its // 'equivalent' implementation just checks to see if all subexpressions // exist as a subexpression in e. -HwS boolean retval = (e instanceof BetweenExp); if (retval) { BetweenExp eAsBetweenExp = (BetweenExp) e; Iterator<Exp> eSubexpressions = eAsBetweenExp.getSubExpressions().iterator(); Iterator<Exp> mySubexpressions; Exp curExp; while (retval && eSubexpressions.hasNext()) { curExp = eSubexpressions.next(); mySubexpressions = myJoiningExps.iterator(); retval = false; while (!retval && mySubexpressions.hasNext()) { retval = curExp.equivalent(mySubexpressions.next()); } } } return retval; } /** * <p>This method returns a deep copy of the list of * joining sub-expressions.</p> * * @return A list containing joining {@link Exp}s. */ public final List<Exp> getJoiningExps() { return myJoiningExps; } /** * {@inheritDoc} */ @Override public final List<Exp> getSubExpressions() { return copyExps(); } /** * {@inheritDoc} */ @Override public final int hashCode() { int result = super.hashCode(); result = 31 * result + myJoiningExps.hashCode(); return result; } /** * <p>This method applies VC Generator's remember rule. * For all inherited programming expression classes, this method * should throw an exception.</p> * * @return The resulting {@link BetweenExp} from applying the remember rule. */ @Override public final BetweenExp remember() { List<Exp> itemsCopy = new ArrayList<>(); if (myJoiningExps != null) { for (Exp item : myJoiningExps) { itemsCopy.add(((MathExp) item).remember().clone()); } } return new BetweenExp(cloneLocation(), itemsCopy); } /** * <p>This method applies the VC Generator's simplification step.</p> * * @return The resulting {@link MathExp} from applying the simplification step. */ @Override public final MathExp simplify() { return this.clone(); } // =========================================================== // Protected Methods // =========================================================== /** * {@inheritDoc} */ @Override protected final Exp copy() { return new BetweenExp(cloneLocation(), copyExps()); } /** * {@inheritDoc} */ @Override protected final Exp substituteChildren(Map<Exp, Exp> substitutions) { List<Exp> newJoiningExps = new ArrayList<>(); for (Exp e : myJoiningExps) { newJoiningExps.add(substitute(e, substitutions)); } return new BetweenExp(cloneLocation(), newJoiningExps); } // =========================================================== // Private Methods // =========================================================== /** * <p>This is a helper method that makes a copy of the * list of between expressions.</p> * * @return A list containing {@link Exp}s. */ private List<Exp> copyExps() { List<Exp> copyJoiningExps = new ArrayList<>(); for (Exp exp : myJoiningExps) { copyJoiningExps.add(exp.clone()); } return copyJoiningExps; } }
mikekab/RESOLVE
src/main/java/edu/clemson/cs/rsrg/absyn/expressions/mathexpr/BetweenExp.java
Java
bsd-3-clause
7,390
module.exports = { todo: { "Whitespace": true, 'Invalid unicode related syntax': true, 'Invalid Type Annotations': true, 'Array Comprehension': true, 'Harmony: Modules': true, 'Harmony: Invalid Class (strawman)': true, 'ES6: Destructured Parameters': true, 'ES7 Proposal: Rest Properties' : true, 'Harmony Invalid syntax': true, }, sections: { 'Primary Expression': [ 'this\n', 'null\n', '\n 42\n\n', { content: '(1 + 2 ) * 3', explanation: "Esprima is counting the first paren's location in " + "the location. Flow ignores all parens", expected_differences: { 'root.loc.start.column': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.body.0.loc.start.column': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.body.0.expression.loc.start.column': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.range.0': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.body.0.range.0': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.body.0.expression.range.0': { type: 'Wrong number', expected: 0, actual: 1 }, } } ], 'Grouping Operator': [ { content: '(1) + (2 ) + 3', explanation: "Esprima sometimes counts parens in their locations. "+ "Flow never does", expected_differences: { 'root.loc.start.column': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.body.0.loc.start.column': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.body.0.expression.loc.start.column': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.body.0.expression.left.loc.start.column': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.body.0.expression.left.loc.end.column': { type: 'Wrong number', expected: 11, actual: 8 }, 'root.range.0': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.body.0.range.0': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.body.0.expression.range.0': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.body.0.expression.left.range.0': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.body.0.expression.left.range.1': { type: 'Wrong number', expected: 11, actual: 8 }, } }, { content: '4 + 5 << (6)', explanation: "Esprima sometimes counts parens in their locations. " + "Flow never does", expected_differences: { 'root.loc.end.column': { type: 'Wrong number', expected: 12, actual: 11 }, 'root.body.0.loc.end.column': { type: 'Wrong number', expected: 12, actual: 11 }, 'root.body.0.expression.loc.end.column': { type: 'Wrong number', expected: 12, actual: 11 }, 'root.range.1': { type: 'Wrong number', expected: 12, actual: 11 }, 'root.body.0.range.1': { type: 'Wrong number', expected: 12, actual: 11 }, 'root.body.0.expression.range.1': { type: 'Wrong number', expected: 12, actual: 11 }, } }, ], 'Array Initializer': [ 'x = []', 'x = [ ]', 'x = [ 42 ]', 'x = [ 42, ]', 'x = [ ,, 42 ]', 'x = [ 1, 2, 3, ]', 'x = [ 1, 2,, 3, ]', /* TODO Unicode support '日本語 = []', 'T\u203F = []', 'T\u200C = []', 'T\u200D = []', '\u2163\u2161 = []', { content: '\u2163\u2161\u200A=\u2009[]', explanation: "TODO: support unicode character classes. Flow " + "doesn't realize when the LHS identifier ends due to whitespace " + "unicode.", expected_differences: { 'root.body.0.expression.left.loc.end.column': { type: 'Wrong number', expected: 2, actual: 3 }, 'root.body.0.expression.left.name': { type: 'Wrong string', expected: 'ⅣⅡ', actual: 'ⅣⅡ ' } } } */ ], 'Object Initializer': [ 'x = {}', 'x = { }', 'x = { answer: 42 }', 'x = { if: 42 }', 'x = { true: 42 }', 'x = { false: 42 }', 'x = { null: 42 }', 'x = { "answer": 42 }', 'x = { x: 1, x: 2 }', { content: 'x = { get width() { return m_width } }', explanation: "Esprima counts the whitespace before the implicit " + "semicolon in its loc. Flow doesn't.", expected_differences: { 'root.body.0.expression.right.properties.0.value.body.body.0.loc.end.column': { type: 'Wrong number', expected: 35, actual: 34 }, 'root.body.0.expression.right.properties.0.value.body.body.0.range.1': { type: 'Wrong number', expected: 35, actual: 34 }, } }, 'x = { get undef() {} }', 'x = { get if() {} }', 'x = { get true() {} }', 'x = { get false() {} }', 'x = { get null() {} }', 'x = { get "undef"() {} }', 'x = { get 10() {} }', { content: 'x = { set width(w) { m_width = w } }', explanation: "Esprima counts the whitespace before the implicit " + "semicolon in its loc. Flow doesn't.", expected_differences: { 'root.body.0.expression.right.properties.0.value.body.body.0.loc.end.column': { type: 'Wrong number', expected: 33, actual: 32 }, 'root.body.0.expression.right.properties.0.value.body.body.0.range.1': { type: 'Wrong number', expected: 33, actual: 32 }, } }, { content: 'x = { set if(w) { m_if = w } }', explanation: "Esprima counts the whitespace before the implicit " + "semicolon in its loc. Flow doesn't.", expected_differences: { 'root.body.0.expression.right.properties.0.value.body.body.0.loc.end.column': { type: 'Wrong number', expected: 27, actual: 26 }, 'root.body.0.expression.right.properties.0.value.body.body.0.range.1': { type: 'Wrong number', expected: 27, actual: 26 }, } }, { content: 'x = { set true(w) { m_true = w } }', explanation: "Esprima counts the whitespace before the implicit " + "semicolon in its loc. Flow doesn't.", expected_differences: { 'root.body.0.expression.right.properties.0.value.body.body.0.loc.end.column': { type: 'Wrong number', expected: 31, actual: 30 }, 'root.body.0.expression.right.properties.0.value.body.body.0.range.1': { type: 'Wrong number', expected: 31, actual: 30 }, } }, { content: 'x = { set false(w) { m_false = w } }', explanation: "Esprima counts the whitespace before the implicit " + "semicolon in its loc. Flow doesn't.", expected_differences: { 'root.body.0.expression.right.properties.0.value.body.body.0.loc.end.column': { type: 'Wrong number', expected: 33, actual: 32 }, 'root.body.0.expression.right.properties.0.value.body.body.0.range.1': { type: 'Wrong number', expected: 33, actual: 32 }, } }, { content: 'x = { set null(w) { m_null = w } }', explanation: "Esprima counts the whitespace before the implicit " + "semicolon in its loc. Flow doesn't.", expected_differences: { 'root.body.0.expression.right.properties.0.value.body.body.0.loc.end.column': { type: 'Wrong number', expected: 31, actual: 30 }, 'root.body.0.expression.right.properties.0.value.body.body.0.range.1': { type: 'Wrong number', expected: 31, actual: 30 }, } }, { content: 'x = { set "null"(w) { m_null = w } }', explanation: "Esprima counts the whitespace before the implicit " + "semicolon in its loc. Flow doesn't.", expected_differences: { 'root.body.0.expression.right.properties.0.value.body.body.0.loc.end.column': { type: 'Wrong number', expected: 33, actual: 32 }, 'root.body.0.expression.right.properties.0.value.body.body.0.range.1': { type: 'Wrong number', expected: 33, actual: 32 }, } }, { content: 'x = { set 10(w) { m_null = w } }', explanation: "Esprima counts the whitespace before the implicit " + "semicolon in its loc. Flow doesn't.", expected_differences: { 'root.body.0.expression.right.properties.0.value.body.body.0.loc.end.column': { type: 'Wrong number', expected: 29, actual: 28 }, 'root.body.0.expression.right.properties.0.value.body.body.0.range.1': { type: 'Wrong number', expected: 29, actual: 28 }, } }, 'x = { get: 42 }', 'x = { set: 43 }', 'x = { __proto__: 2 }', 'x = {"__proto__": 2 }', { content: 'x = { get width() { return m_width }, set width(width) { m_width = width; } }', explanation: "Esprima counts the whitespace before the implicit " + "semicolon in its loc. Flow doesn't.", expected_differences: { 'root.body.0.expression.right.properties.0.value.body.body.0.loc.end.column': { type: 'Wrong number', expected: 35, actual: 34 }, 'root.body.0.expression.right.properties.0.value.body.body.0.range.1': { type: 'Wrong number', expected: 35, actual: 34 }, } }, ], 'Comments': [ '/* block comment */ 42', { content: '42 /* block comment 1 */ /* block comment 2 */', explanation: "Esprima counts comments in its loc, Flow doesn't", expected_differences: { 'root.body.0.loc.end.column': { type: 'Wrong number', expected: 46, actual: 2 }, 'root.loc.end.column': { type: 'Wrong number', expected: 46, actual: 2 }, 'root.body.0.range.1': { type: 'Wrong number', expected: 46, actual: 2 }, 'root.range.1': { type: 'Wrong number', expected: 46, actual: 2 }, } }, 'var p1;/* block comment 1 */ /* block comment 2 */', '/*42*/', { content: '(a + /* assignmenr */b ) * c', explanation: "Esprima counts comments in its loc, Flow doesn't", expected_differences: { 'root.body.0.expression.loc.start.column': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.body.0.loc.start.column': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.loc.start.column': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.body.0.expression.range.0': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.body.0.range.0': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.range.0': { type: 'Wrong number', expected: 0, actual: 1 }, } }, '/* assignmenr */\n a = b', { content: '42 /*The*/ /*Answer*/', explanation: "Esprima counts comments in its loc, Flow doesn't", expected_differences: { 'root.body.0.loc.end.column': { type: 'Wrong number', expected: 21, actual: 2 }, 'root.loc.end.column': { type: 'Wrong number', expected: 21, actual: 2 }, 'root.body.0.range.1': { type: 'Wrong number', expected: 21, actual: 2 }, 'root.range.1': { type: 'Wrong number', expected: 21, actual: 2 }, } }, { content: '42 /*the*/ /*answer*/', explanation: "Esprima counts comments in its loc, Flow doesn't", expected_differences: { 'root.body.0.loc.end.column': { type: 'Wrong number', expected: 21, actual: 2 }, 'root.loc.end.column': { type: 'Wrong number', expected: 21, actual: 2 }, 'root.body.0.range.1': { type: 'Wrong number', expected: 21, actual: 2 }, 'root.range.1': { type: 'Wrong number', expected: 21, actual: 2 }, } }, { content: '42 /* the * answer */', explanation: "Esprima counts comments in its loc, Flow doesn't", expected_differences: { 'root.body.0.loc.end.column': { type: 'Wrong number', expected: 21, actual: 2 }, 'root.loc.end.column': { type: 'Wrong number', expected: 21, actual: 2 }, 'root.body.0.range.1': { type: 'Wrong number', expected: 21, actual: 2 }, 'root.range.1': { type: 'Wrong number', expected: 21, actual: 2 }, } }, { content: '42 /* The * answer */', explanation: "Esprima counts comments in its loc, Flow doesn't", expected_differences: { 'root.body.0.range.1': { type: 'Wrong number', expected: 21, actual: 2 }, 'root.body.0.loc.end.column': { type: 'Wrong number', expected: 21, actual: 2 }, 'root.range.1': { type: 'Wrong number', expected: 21, actual: 2 }, 'root.loc.end.column': { type: 'Wrong number', expected: 21, actual: 2 }, } }, '/* multiline\ncomment\nshould\nbe\nignored */ 42', '/*a\r\nb*/ 42', { content: '/*a\rb*/ 42', explanation: "Flow and esprima disagree whether \r is a newline", expected_differences: { 'root.body.0.expression.loc.start.line': { type: 'Wrong number', expected: 2, actual: 1 }, 'root.body.0.expression.loc.start.column': { type: 'Wrong number', expected: 4, actual: 8 }, 'root.body.0.expression.loc.end.line': { type: 'Wrong number', expected: 2, actual: 1 }, 'root.body.0.expression.loc.end.column': { type: 'Wrong number', expected: 6, actual: 10 }, 'root.body.0.loc.start.line': { type: 'Wrong number', expected: 2, actual: 1 }, 'root.body.0.loc.start.column': { type: 'Wrong number', expected: 4, actual: 8 }, 'root.body.0.loc.end.line': { type: 'Wrong number', expected: 2, actual: 1 }, 'root.body.0.loc.end.column': { type: 'Wrong number', expected: 6, actual: 10 }, 'root.loc.start.line': { type: 'Wrong number', expected: 2, actual: 1 }, 'root.loc.start.column': { type: 'Wrong number', expected: 4, actual: 8 }, 'root.loc.end.line': { type: 'Wrong number', expected: 2, actual: 1 }, 'root.loc.end.column': { type: 'Wrong number', expected: 6, actual: 10 }, 'root.comments.0.loc.end.line': { type: 'Wrong number', expected: 2, actual: 1 }, 'root.comments.0.loc.end.column': { type: 'Wrong number', expected: 3, actual: 7 }, } }, '/*a\nb*/ 42', '/*a\nc*/ 42', '// one\\n', '// line comment\n42', { content: '42 // line comment', explanation: "Esprima counts comments in its loc, Flow doesn't", expected_differences: { 'root.body.0.loc.end.column': { type: 'Wrong number', expected: 18, actual: 2 }, 'root.loc.end.column': { type: 'Wrong number', expected: 18, actual: 2 }, 'root.body.0.range.1': { type: 'Wrong number', expected: 18, actual: 2 }, 'root.range.1': { type: 'Wrong number', expected: 18, actual: 2 }, } }, '// Hello, world!\n42', '// Hello, world!\n', '// Hallo, world!\n', '//\n42', '//', '// ', '/**/42', { content: '42/**/', explanation: "Esprima counts comments in its loc, Flow doesn't", expected_differences: { 'root.body.0.loc.end.column': { type: 'Wrong number', expected: 6, actual: 2 }, 'root.loc.end.column': { type: 'Wrong number', expected: 6, actual: 2 }, 'root.body.0.range.1': { type: 'Wrong number', expected: 6, actual: 2 }, 'root.range.1': { type: 'Wrong number', expected: 6, actual: 2 }, } }, '// Hello, world!\n\n// Another hello\n42', 'if (x) { doThat() // Some comment\n }', 'if (x) { // Some comment\ndoThat(); }', { content: 'if (x) { /* Some comment */ doThat() }', explanation: "Esprima counts comments in its loc, Flow doesn't", expected_differences: { 'root.body.0.consequent.body.0.loc.end.column': { type: 'Wrong number', expected: 37, actual: 36 }, 'root.body.0.consequent.body.0.range.1': { type: 'Wrong number', expected: 37, actual: 36 }, } }, { content: 'if (x) { doThat() /* Some comment */ }', explanation: "Esprima counts comments in its loc, Flow doesn't", expected_differences: { 'root.body.0.consequent.body.0.loc.end.column': { type: 'Wrong number', expected: 37, actual: 17 }, 'root.body.0.consequent.body.0.range.1': { type: 'Wrong number', expected: 37, actual: 17 }, } }, { content: 'switch (answer) { case 42: /* perfect */ bingo() }', explanation: "Esprima counts comments in its loc, Flow doesn't", expected_differences: { 'root.body.0.cases.0.consequent.0.loc.end.column': { type: 'Wrong number', expected: 49, actual: 48 }, 'root.body.0.cases.0.loc.end.column': { type: 'Wrong number', expected: 49, actual: 48 }, 'root.body.0.cases.0.consequent.0.range.1': { type: 'Wrong number', expected: 49, actual: 48 }, 'root.body.0.cases.0.range.1': { type: 'Wrong number', expected: 49, actual: 48 }, } }, { content: 'switch (answer) { case 42: bingo() /* perfect */ }', explanation: "Esprima counts comments in its loc, Flow doesn't", expected_differences: { 'root.body.0.cases.0.consequent.0.loc.end.column': { type: 'Wrong number', expected: 49, actual: 34 }, 'root.body.0.cases.0.loc.end.column': { type: 'Wrong number', expected: 49, actual: 34 }, 'root.body.0.cases.0.consequent.0.range.1': { type: 'Wrong number', expected: 49, actual: 34 }, 'root.body.0.cases.0.range.1': { type: 'Wrong number', expected: 49, actual: 34 }, } }, { content: '/* header */ (function(){ var version = 1; }).call(this)', explanation: "Esprima counts comments in its loc, Flow doesn't", expected_differences: { 'root.body.0.expression.callee.loc.start.column': { type: 'Wrong number', expected: 13, actual: 14 }, 'root.body.0.expression.loc.start.column': { type: 'Wrong number', expected: 13, actual: 14 }, 'root.body.0.loc.start.column': { type: 'Wrong number', expected: 13, actual: 14 }, 'root.loc.start.column': { type: 'Wrong number', expected: 13, actual: 14 }, 'root.body.0.expression.callee.range.0': { type: 'Wrong number', expected: 13, actual: 14 }, 'root.body.0.expression.range.0': { type: 'Wrong number', expected: 13, actual: 14 }, 'root.body.0.range.0': { type: 'Wrong number', expected: 13, actual: 14 }, 'root.range.0': { type: 'Wrong number', expected: 13, actual: 14 }, } }, { content: '(function(){ var version = 1; /* sync */ }).call(this)', explanation: "Esprima counts comments in its loc, Flow doesn't", expected_differences: { 'root.body.0.expression.callee.loc.start.column': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.body.0.expression.loc.start.column': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.body.0.loc.start.column': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.loc.start.column': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.body.0.expression.callee.range.0': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.body.0.expression.range.0': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.body.0.range.0': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.range.0': { type: 'Wrong number', expected: 0, actual: 1 }, } }, 'function f() { /* infinite */ while (true) { } /* bar */ var each; }', /* Hmm, let's not support this crazy syntax for now, since it's not in * an ecma spec yet. Syntax comes from * http://javascript.spec.whatwg.org/#comment-syntax * and seems supported in V8 at least '<!-- foo', 'var x = 1<!--foo', '--> comment', '<!-- comment', ' \t --> comment', ' \t /* block comment *REMOVE_ME/ --> comment', '/* block comment *REMOVE_ME/--> comment', '/* not comment*REMOVE_ME/; i-->0', 'while (i-->0) {}', */ ], 'Numeric Literals': [ '0', '42', '3', '5', '.14', '3.14159', '6.02214179e+23', '1.492417830e-10', '0x0', '0x0;', { content: '0e+100 ', explanation: "We don't want to include the extra space in the " + "expression statement's location", expected_differences: { 'root.loc.end.column' : { type: 'Wrong number', expected: 7, actual: 6, }, 'root.body.0.loc.end.column' : { type: 'Wrong number', expected: 7, actual: 6, }, 'root.range.1': { type: 'Wrong number', expected: 7, actual: 6, }, 'root.body.0.range.1': { type: 'Wrong number', expected: 7, actual: 6, }, } }, '0e+100', '0xabc', '0xdef', '0X1A', '0x10', '0x100', '0X04', '02', '012', '0012', ], 'String Literals': [ '"Hello"', '"\\n\\r\\t\\v\\b\\f\\\\\\\'\\"\\0"', '"\\u0061"', '"\\x61"', '"Hello\\nworld"', '"Hello\\\nworld"', '"Hello\\02World"', '"Hello\\012World"', '"Hello\\122World"', '"Hello\\0122World"', '"Hello\\312World"', '"Hello\\412World"', '"Hello\\812World"', '"Hello\\712World"', '"Hello\\0World"', '"Hello\\\r\nworld"', '"Hello\\\rworld"', '"Hello\\1World"', ], 'Regular Expression Literals': [ 'var x = /[\\\\]/', 'var x = /[a-z]/i', 'var x = /[x-z]/i', 'var x = /[a-c]/i', 'var x = /[P QR]/i', /* Esprima harmony is exploding on this 'var x = /[\\]/]/', */ 'var x = /foo\\/bar/', 'var x = /=([^=\\s])+/g', 'var x = /42/g.test', /* String literal examples as regexps */ '/Hello/', '/\\n\\r\\t\\v\\b\\f\\\\\\\'\\"\\0/', '/\\u0061/', '/\\x61/', '/\\u00/', '/\\xt/', '/Hello\\nworld/', '/Hello\\02World/', '/Hello\\012World/', '/Hello\\122World/', '/Hello\\0122World/', '/Hello\\312World/', '/Hello\\412World/', '/Hello\\812World/', '/Hello\\712World/', '/Hello\\0World/', '/Hello\\1World/', '/Hello (World)/', ], 'Left-Hand-Side Expression': [ 'new Button', 'new Button()', 'new new foo', 'new new foo()', 'new foo().bar()', 'new foo[bar]', 'new foo.bar()', 'new function() {}', "new window[(['Active'].concat('Object').join('X'))]('Microsoft.XMLHTTP');", 'this.foo.export()', { content: '( new foo).bar()', explanation: "Esprima counts the paren in its location, Flow doesn't", expected_differences: { 'root.loc.start.column': { type: 'Wrong number', expected: 0, actual: 2 }, 'root.body.0.loc.start.column': { type: 'Wrong number', expected: 0, actual: 2 }, 'root.body.0.expression.loc.start.column': { type: 'Wrong number', expected: 0, actual: 2 }, 'root.body.0.expression.callee.loc.start.column': { type: 'Wrong number', expected: 0, actual: 2 }, 'root.range.0': { type: 'Wrong number', expected: 0, actual: 2 }, 'root.body.0.range.0': { type: 'Wrong number', expected: 0, actual: 2 }, 'root.body.0.expression.range.0': { type: 'Wrong number', expected: 0, actual: 2 }, 'root.body.0.expression.callee.range.0': { type: 'Wrong number', expected: 0, actual: 2 }, } }, 'foo(bar, baz)', { content: '( foo )()', explanation: "Esprima counts the paren in its location, Flow doesn't", expected_differences: { 'root.loc.start.column': { type: 'Wrong number', expected: 0, actual: 5 }, 'root.body.0.loc.start.column': { type: 'Wrong number', expected: 0, actual: 5 }, 'root.body.0.expression.loc.start.column': { type: 'Wrong number', expected: 0, actual: 5 }, 'root.range.0': { type: 'Wrong number', expected: 0, actual: 5 }, 'root.body.0.range.0': { type: 'Wrong number', expected: 0, actual: 5 }, 'root.body.0.expression.range.0': { type: 'Wrong number', expected: 0, actual: 5 }, } }, 'universe.milkyway', 'universe.milkyway.solarsystem', 'universe.milkyway.solarsystem.Earth', 'universe[galaxyName, otherUselessName]', 'universe[galaxyName]', 'universe[42].galaxies', 'universe(42).galaxies', 'universe(42).galaxies(14, 3, 77).milkyway', 'earth.asia.Indonesia.prepareForElection(2014)', 'universe.if', 'universe.true', 'universe.false', 'universe.null', 'universe.type', ], 'Postfix Expressions': [ 'x++', 'x--', 'eval++', 'eval--', 'arguments++', 'arguments--', ], 'Unary Operators': [ '++x', '--x', '++eval', '--eval', '++arguments', '--arguments', '+x', '-x', '~x', '!x', 'void x', 'delete x', 'typeof x', ], 'Multiplicative Operators': [ 'x * y', 'x / y', 'x % y', ], 'Additive Operators': [ 'x + y', 'x - y', '"use strict" + 42', ], 'Bitwise Shift Operator': [ 'x << y', 'x >> y', 'x >>> y', ], 'Relational Operators': [ 'x < y', 'x > y', 'x <= y', 'x >= y', 'x in y', 'x instanceof y', 'x < y < z', ], 'Equality Operators': [ 'x == y', 'x != y', 'x === y', 'x !== y', ], 'Binary Bitwise Operators': [ 'x & y', 'x ^ y', 'x | y', ], 'Binary Expressions': [ 'x + y + z', 'x - y + z', 'x + y - z', 'x - y - z', 'x + y * z', 'x + y / z', 'x - y % z', 'x * y * z', 'x * y / z', 'x * y % z', 'x % y * z', 'x << y << z', 'x | y | z', 'x & y & z', 'x ^ y ^ z', 'x & y | z', 'x | y ^ z', 'x | y & z', { content: '1 + type + interface + declare + let + eval + super + ' + 'async + await', explanation: 'Let is fine as an identifier', expected_differences: { 'root.errors': { type: 'Flow found no error', expected: 'Line 1: Unexpected token let', actual: undefined }, } }, ], 'Binary Logical Operators': [ 'x || y', 'x && y', 'x || y || z', 'x && y && z', 'x || y && z', 'x || y ^ z', ], 'Conditional Operator': [ 'y ? 1 : 2', 'x && y ? 1 : 2', { content: 'x = (0) ? 1 : 2', explanation: "Esprima counts the paren in it's RHS node's loc, " + "flow ignores parens", expected_differences: { 'root.body.0.expression.right.loc.start.column': { type: 'Wrong number', expected: 4, actual: 5 }, 'root.body.0.expression.right.range.0': { type: 'Wrong number', expected: 4, actual: 5 }, } } ], '[ES6] Arrow Function': [ '() => "test"', 'e => "test"', '(e) => "test"', '(a, b) => "test"', 'e => { 42; }', { content: 'e => ({ property: 42 })', explanation: "Esprima includes the parens in its loc, Flow doesn't", expected_differences: { 'root.loc.end.column': { type: 'Wrong number', expected: 23, actual: 22 }, 'root.body.0.loc.end.column': { type: 'Wrong number', expected: 23, actual: 22 }, 'root.body.0.expression.loc.end.column': { type: 'Wrong number', expected: 23, actual: 22 }, 'root.range.1': { type: 'Wrong number', expected: 23, actual: 22 }, 'root.body.0.range.1': { type: 'Wrong number', expected: 23, actual: 22 }, 'root.body.0.expression.range.1': { type: 'Wrong number', expected: 23, actual: 22 }, } }, // Not an object! { content: 'e => { label: 42 }', explanation: "Esprima counts the whitespace before the } in its " + "loc. Flow doesn't", expected_differences: { 'root.body.0.expression.body.body.0.loc.end.column': { type: 'Wrong number', expected: 17, actual: 16 }, 'root.body.0.expression.body.body.0.body.loc.end.column': { type: 'Wrong number', expected: 17, actual: 16 }, 'root.body.0.expression.body.body.0.range.1': { type: 'Wrong number', expected: 17, actual: 16 }, 'root.body.0.expression.body.body.0.body.range.1': { type: 'Wrong number', expected: 17, actual: 16 }, } }, '(a, b) => { 42; }', '(x=1) => x * x', // not strict mode, using eval 'eval => 42', // not strict mode, using arguments 'arguments => 42', // not strict mode, using octals '(a) => 00', // not strict mode, using eval, IsSimpleParameterList is true '(eval, a) => 42', // not strict mode, assigning to eval '(eval = 10) => 42', // not strict mode, using eval, IsSimpleParameterList is false '(eval, a = 10) => 42', { content: '(x => x)', explanation: "Esprima counts the parens in its loc. Flow doesn't", expected_differences: { 'root.loc.start.column': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.loc.end.column': { type: 'Wrong number', expected: 8, actual: 7 }, 'root.body.0.loc.start.column': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.body.0.loc.end.column': { type: 'Wrong number', expected: 8, actual: 7 }, 'root.range.0': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.range.1': { type: 'Wrong number', expected: 8, actual: 7 }, 'root.body.0.range.0': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.body.0.range.1': { type: 'Wrong number', expected: 8, actual: 7 }, } }, 'x => y => 42', { content: '(x) => ((y, z) => (x, y, z))', explanation: "Esprima counts the parens in its loc. Flow doesn't", expected_differences: { 'root.loc.end.column': { type: 'Wrong number', expected: 28, actual: 26 }, 'root.body.0.loc.end.column': { type: 'Wrong number', expected: 28, actual: 26 }, 'root.body.0.expression.loc.end.column': { type: 'Wrong number', expected: 28, actual: 26 }, 'root.body.0.expression.body.loc.end.column': { type: 'Wrong number', expected: 27, actual: 26 }, 'root.range.1': { type: 'Wrong number', expected: 28, actual: 26 }, 'root.body.0.range.1': { type: 'Wrong number', expected: 28, actual: 26 }, 'root.body.0.expression.range.1': { type: 'Wrong number', expected: 28, actual: 26 }, 'root.body.0.expression.body.range.1': { type: 'Wrong number', expected: 27, actual: 26 }, } }, 'foo(() => {})', 'foo((x, y) => {})', '(sun) => earth', // I don't see why this should be an error. 14.2.9 { content: '(a, a) => 42', explanation: "Esprima counts parens in its loc, Flow doesn't", expected_differences: { 'root.errors': { type: 'Flow found no error', expected: 'Line 1: Strict mode function may not have duplicate parameter names', actual: undefined }, } }, '([...a]) => 42', '({...a}) => 42', ], 'Assignment Operators': [ 'x = 42', 'eval = 42', 'arguments = 42', 'type = 42', 'of = 42', 'interface = 42', 'declare = 42', 'x *= 42', 'x /= 42', 'x %= 42', 'x += 42', 'x -= 42', 'x <<= 42', 'x >>= 42', 'x >>>= 42', 'x &= 42', 'x ^= 42', 'x |= 42', ], 'Complex Expression': [ 'a || b && c | d ^ e & f == g < h >>> i + j * k', ], 'Block': [ { content: '{ foo }', explanation: "Esprima counts the whitespace before the curly brace " + "that implies the semicolon. Flow doesn't", expected_differences: { 'root.body.0.body.0.loc.end.column': { type: 'Wrong number', expected: 6, actual: 5 }, 'root.body.0.body.0.range.1': { type: 'Wrong number', expected: 6, actual: 5 } } }, '{ doThis(); doThat(); }', '{}', ], 'Variable Statement': [ 'var x', 'var x, y;', 'var x = 42', 'var eval = 42, arguments = 42, type = 12', 'var x = 14, y = 3, z = 1977', 'var implements, interface, declare, package', 'var private, protected, public, static', ], 'Let Statement': [ 'let x', { content: '{ let x }', explanation: "Esprima counts the space before the implicit " + "semicolon. Flow doesn't", expected_differences: { 'root.body.0.body.0.loc.end.column': { type: 'Wrong number', expected: 8, actual: 7 }, 'root.body.0.body.0.range.1': { type: 'Wrong number', expected: 8, actual: 7 }, } }, { content: '{ let x = 42 }', explanation: "Esprima counts the space before the implicit " + "semicolon. Flow doesn't", expected_differences: { 'root.body.0.body.0.loc.end.column': { type: 'Wrong number', expected: 13, actual: 12 }, 'root.body.0.body.0.range.1': { type: 'Wrong number', expected: 13, actual: 12 }, } }, { content: '{ let x = 14, y = 3, z = 1977 }', explanation: "Esprima counts the space before the implicit " + "semicolon. Flow doesn't", expected_differences: { 'root.body.0.body.0.loc.end.column': { type: 'Wrong number', expected: 30, actual: 29 }, 'root.body.0.body.0.range.1': { type: 'Wrong number', expected: 30, actual: 29 }, } }, { content: 'if (true) let += 1', explanation: 'Let is fine as an identifier', expected_differences: { 'root.errors': { type: 'Flow found no error', expected: 'Line 1: Unexpected token let', actual: undefined }, } } ], 'Const Statement': [ 'const x = 42', { content: '{ const x = 42 }', explanation: "Esprima counts the space before the implicit " + "semicolon. Flow doesn't", expected_differences: { 'root.body.0.body.0.loc.end.column': { type: 'Wrong number', expected: 15, actual: 14 }, 'root.body.0.body.0.range.1': { type: 'Wrong number', expected: 15, actual: 14 }, } }, { content: '{ const x = 14, y = 3, z = 1977 }', explanation: "Esprima counts the space before the implicit " + "semicolon. Flow doesn't", expected_differences: { 'root.body.0.body.0.loc.end.column': { type: 'Wrong number', expected: 32, actual: 31 }, 'root.body.0.body.0.range.1': { type: 'Wrong number', expected: 32, actual: 31 }, } }, ], 'Empty Statement': [ ';', ], 'Expression Statement': [ 'x', 'x, y', /* TODO Unicode :( '\\u0061', 'a\\u0061', '\\u0061a', '\\u0061a ', */ ], 'If Statement': [ 'if (morning) goodMorning()', { content: 'if (morning) (function(){})', explanation: "Esprima counts the parens in their loc, Flow doesn't", expected_differences: { 'root.loc.end.column': { type: 'Wrong number', expected: 27, actual: 26 } , 'root.body.0.loc.end.column': { type: 'Wrong number', expected: 27, actual: 26 } , 'root.body.0.consequent.loc.start.column': { type: 'Wrong number', expected: 13, actual: 14 } , 'root.body.0.consequent.loc.end.column': { type: 'Wrong number', expected: 27, actual: 26 } , 'root.range.1': { type: 'Wrong number', expected: 27, actual: 26 } , 'root.body.0.range.1': { type: 'Wrong number', expected: 27, actual: 26 } , 'root.body.0.consequent.range.0': { type: 'Wrong number', expected: 13, actual: 14 } , 'root.body.0.consequent.range.1': { type: 'Wrong number', expected: 27, actual: 26 } , } }, 'if (morning) var x = 0;', 'if (morning) function a(){}', 'if (morning) goodMorning(); else goodDay()', /* Esprima harmony is exploding on this 'if (true) that()\n; else;', */ 'if (true) that(); else;', 'if (true) declare += 4;', ], 'Iteration Statements': [ 'do keep(); while (true)', 'do keep(); while (true);', 'do { x++; y--; } while (x < 10)', { content: '{ do { } while (false) false }', explanation: "Esprima counts whitespace before implicit semicolon. " + "Flow does not.", expected_differences: { 'root.body.0.body.1.loc.end.column': { type: 'Wrong number', expected: 29, actual: 28 }, 'root.body.0.body.1.range.1': { type: 'Wrong number', expected: 29, actual: 28 }, } }, 'do that();while (true)', /* Esprima harmony is exploding on this 'do that()\n;while (true)', */ 'while (true) doSomething()', 'while (x < 10) { x++; y--; }', 'for(;;);', 'for(;;){}', 'for(x = 0;;);', 'for(var x = 0;;);', 'for(let x = 0;;);', 'for(var x = 0, y = 1;;);', 'for(x = 0; x < 42;);', 'for(x = 0; x < 42; x++);', 'for(x = 0; x < 42; x++) process(x);', 'for(x in list) process(x);', 'for (var x in list) process(x);', /* Esprima harmony is exploding due to unexpect in 'for (var x = 42 in list) process(x);', */ 'for (let x in list) process(x);', /* Esprima harmony is exploding due to unexpect in 'for (var x = y = z in q);', */ /* Esprima harmony is exploding due to unexpect in { content: 'for (var a = b = c = (d in e) in z);', explanation: "Esprima counts the parens for (d in e) in the loc. " + "Flow does not.", expected_differences: { 'root.body.0.left.loc.end.column': { type: 'Wrong number', expected: 29, actual: 28 }, 'root.body.0.left.declarations.0.loc.end.column': { type: 'Wrong number', expected: 29, actual: 28 }, 'root.body.0.left.declarations.0.init.loc.end.column': { type: 'Wrong number', expected: 29, actual: 28 }, 'root.body.0.left.declarations.0.init.right.loc.end.column': { type: 'Wrong number', expected: 29, actual: 28 }, } }, */ /* Esprima harmony is exploding due to unexpect in { content: 'for (var i = function() { return 10 in [] } in list) process(x);', explanation: "The return statement has an implicit semicolon. "+ "Esprima counts the whitespace before the implicit semicolon in " + "the loc. Flow doesn't", expected_differences: { 'root.body.0.left.declarations.0.init.body.body.0.loc.end.column': { type: 'Wrong number', expected: 42, actual: 41 } } } */ ], 'continue statement': [ 'while (true) { continue; }', { content: 'while (true) { continue }', explanation: " Esprima counts the whitespace before the curly " + "brace that implies the semicolon. Flow doesn't", expected_differences: { 'root.body.0.body.body.0.loc.end.column': { type: 'Wrong number', expected: 24, actual: 23 }, 'root.body.0.body.body.0.range.1': { type: 'Wrong number', expected: 24, actual: 23 }, } }, { content: 'done: while (true) { continue done }', explanation: " Esprima counts the whitespace before the curly " + "brace that implies the semicolon. Flow doesn't", expected_differences: { 'root.body.0.body.body.body.0.loc.end.column': { type: 'Wrong number', expected: 35, actual: 34 }, 'root.body.0.body.body.body.0.range.1': { type: 'Wrong number', expected: 35, actual: 34 }, } }, 'done: while (true) { continue done; }', '__proto__: while (true) { continue __proto__; }', ], 'break statement': [ { content: 'while (true) { break }', explanation: " Esprima counts the whitespace before the curly " + "brace that implies the semicolon. Flow doesn't", expected_differences: { 'root.body.0.body.body.0.loc.end.column': { type: 'Wrong number', expected: 21, actual: 20 }, 'root.body.0.body.body.0.range.1': { type: 'Wrong number', expected: 21, actual: 20 }, } }, { content: 'done: while (true) { break done }', explanation: " Esprima counts the whitespace before the curly " + "brace that implies the semicolon. Flow doesn't", expected_differences: { 'root.body.0.body.body.body.0.loc.end.column': { type: 'Wrong number', expected: 32, actual: 31 }, 'root.body.0.body.body.body.0.range.1': { type: 'Wrong number', expected: 32, actual: 31 }, } }, 'done: while (true) { break done; }', '__proto__: while (true) { break __proto__; }', ], 'return statement': [ { content: '(function(){ return })', explanation: "Esprima counts the parens and the whitespace before " + "an implicit semicolon in its loc. Flow doesn't", expected_differences: { 'root.loc.start.column': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.loc.end.column': { type: 'Wrong number', expected: 22, actual: 21 }, 'root.body.0.loc.start.column': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.body.0.loc.end.column': { type: 'Wrong number', expected: 22, actual: 21 }, 'root.body.0.expression.body.body.0.loc.end.column': { type: 'Wrong number', expected: 20, actual: 19 }, 'root.range.0': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.range.1': { type: 'Wrong number', expected: 22, actual: 21 }, 'root.body.0.range.0': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.body.0.range.1': { type: 'Wrong number', expected: 22, actual: 21 }, 'root.body.0.expression.body.body.0.range.1': { type: 'Wrong number', expected: 20, actual: 19 }, } }, { content: '(function(){ return; })', explanation: "Esprima counts the parens in its loc. Flow doesn't", expected_differences: { 'root.loc.start.column': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.loc.end.column': { type: 'Wrong number', expected: 23, actual: 22 }, 'root.body.0.loc.start.column': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.body.0.loc.end.column': { type: 'Wrong number', expected: 23, actual: 22 }, 'root.range.0': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.range.1': { type: 'Wrong number', expected: 23, actual: 22 }, 'root.body.0.range.0': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.body.0.range.1': { type: 'Wrong number', expected: 23, actual: 22 }, } }, { content: '(function(){ return x; })', explanation: "Esprima counts the parens in its loc. Flow doesn't", expected_differences: { 'root.loc.start.column': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.loc.end.column': { type: 'Wrong number', expected: 25, actual: 24 }, 'root.body.0.loc.start.column': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.body.0.loc.end.column': { type: 'Wrong number', expected: 25, actual: 24 }, 'root.range.0': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.range.1': { type: 'Wrong number', expected: 25, actual: 24 }, 'root.body.0.range.0': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.body.0.range.1': { type: 'Wrong number', expected: 25, actual: 24 }, } }, { content: '(function(){ return x * y })', explanation: "Esprima counts the parens and the whitespace before " + "an implicit semicolon in its loc. Flow doesn't", expected_differences: { 'root.loc.start.column': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.loc.end.column': { type: 'Wrong number', expected: 28, actual: 27 }, 'root.body.0.loc.start.column': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.body.0.loc.end.column': { type: 'Wrong number', expected: 28, actual: 27 }, 'root.body.0.expression.body.body.0.loc.end.column': { type: 'Wrong number', expected: 26, actual: 25 }, 'root.range.0': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.range.1': { type: 'Wrong number', expected: 28, actual: 27 }, 'root.body.0.range.0': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.body.0.range.1': { type: 'Wrong number', expected: 28, actual: 27 }, 'root.body.0.expression.body.body.0.range.1': { type: 'Wrong number', expected: 26, actual: 25 }, } }, ], 'with statement': [ 'with (x) foo = bar', 'with (x) foo = bar;', { content: 'with (x) { foo = bar }', explanation: "Esprima counts the whitespace before the implicit "+ "semicolon in its loc. Flow doesn't", expected_differences: { 'root.body.0.body.body.0.loc.end.column': { type: 'Wrong number', expected: 21, actual: 20 }, 'root.body.0.body.body.0.range.1': { type: 'Wrong number', expected: 21, actual: 20 }, } } ], 'switch statement': [ 'switch (x) {}', 'switch (answer) { case 42: hi(); break; }', { content: 'switch (answer) { case 42: hi(); break; default: break }', explanation: "Esprima counts the whitespace before the implicit " + "semicolon in its loc. Flow doesn't", expected_differences: { 'root.body.0.cases.1.loc.end.column': { type: 'Wrong number', expected: 55, actual: 54 }, 'root.body.0.cases.1.consequent.0.loc.end.column': { type: 'Wrong number', expected: 55, actual: 54 }, 'root.body.0.cases.1.range.1': { type: 'Wrong number', expected: 55, actual: 54 }, 'root.body.0.cases.1.consequent.0.range.1': { type: 'Wrong number', expected: 55, actual: 54 }, } } ], 'Labelled Statements': [ 'start: for (;;) break start', 'start: while (true) break start', '__proto__: test', 'type: 42', 'of: 52', 'declare: 62', ], 'throw statement': [ 'throw x;', 'throw x * y', 'throw { message: "Error" }', ], 'try statement': [ 'try { } catch (e) { }', 'try { } catch (eval) { }', 'try { } catch (arguments) { }', { content: 'try { } catch (e) { say(e) }', explanation: "Esprima counts the whitespace before the implicit " + "semicolon in its loc. Flow doesn't", expected_differences: { 'root.body.0.handlers.0.body.body.0.loc.end.column': { type: 'Wrong number', expected: 27, actual: 26 }, 'root.body.0.handlers.0.body.body.0.range.1': { type: 'Wrong number', expected: 27, actual: 26 }, } }, { content: 'try { } finally { cleanup(stuff) }', explanation: "Esprima counts the whitespace before the implicit " + "semicolon in its loc. Flow doesn't", expected_differences: { 'root.body.0.finalizer.body.0.loc.end.column': { type: 'Wrong number', expected: 33, actual: 32 }, 'root.body.0.finalizer.body.0.range.1': { type: 'Wrong number', expected: 33, actual: 32 }, } }, { content: 'try { doThat(); } catch (e) { say(e) }', explanation: "Esprima counts the whitespace before the implicit " + "semicolon in its loc. Flow doesn't", expected_differences: { 'root.body.0.handlers.0.body.body.0.loc.end.column': { type: 'Wrong number', expected: 37, actual: 36 }, 'root.body.0.handlers.0.body.body.0.range.1': { type: 'Wrong number', expected: 37, actual: 36 }, } }, { content: 'try { doThat(); } catch (e) { say(e) } finally { cleanup(stuff) }', explanation: "Esprima counts the whitespace before the two implicit " + "semicolons in its loc. Flow doesn't", expected_differences: { 'root.body.0.handlers.0.body.body.0.loc.end.column': { type: 'Wrong number', expected: 37, actual: 36 }, 'root.body.0.finalizer.body.0.loc.end.column': { type: 'Wrong number', expected: 64, actual: 63 }, 'root.body.0.handlers.0.body.body.0.range.1': { type: 'Wrong number', expected: 37, actual: 36 }, 'root.body.0.finalizer.body.0.range.1': { type: 'Wrong number', expected: 64, actual: 63 }, } }, ], 'debugger statement': [ 'debugger;', 'debugger', ], 'Function Expression': [ { content: '(function(){}())', explanation: "Esprima counts the outer parens in its loc. Flow doesn't", expected_differences: { 'root.body.0.loc.start.column': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.body.0.loc.end.column': { type: 'Wrong number', expected: 16, actual: 15 }, 'root.loc.start.column': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.loc.end.column': { type: 'Wrong number', expected: 16, actual: 15 }, 'root.body.0.range.0': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.body.0.range.1': { type: 'Wrong number', expected: 16, actual: 15 }, 'root.range.0': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.range.1': { type: 'Wrong number', expected: 16, actual: 15 }, } }, 'var x = function(){}.bind(this)', ], 'Function Definition': [ 'function hello() { sayHi(); }', 'function eval() { }', 'function arguments() { }', 'function test(t, t) { }', { content: '(function test(t, t) { })', explanation: "Esprima counts the parens in the loc. Flow doesn't", expected_differences: { 'root.loc.start.column': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.loc.end.column': { type: 'Wrong number', expected: 25, actual: 24 }, 'root.body.0.loc.start.column': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.body.0.loc.end.column': { type: 'Wrong number', expected: 25, actual: 24 }, 'root.range.0': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.range.1': { type: 'Wrong number', expected: 25, actual: 24 }, 'root.body.0.range.0': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.body.0.range.1': { type: 'Wrong number', expected: 25, actual: 24 }, } }, { content: 'function eval() { function inner() { "use strict" } }', explanation: "Esprima counts the implict semicolon in the loc. " + "Flow doesn't", expected_differences: { 'root.body.0.body.body.0.body.body.0.loc.end.column': { type: 'Wrong number', expected: 50, actual: 49 }, 'root.body.0.body.body.0.body.body.0.range.1': { type: 'Wrong number', expected: 50, actual: 49 }, } }, 'function hello(a) { sayHi(); }', 'function hello(a, b) { sayHi(); }', { content: 'var hi = function() { sayHi() };', explanation: "Esprima counts the implict semicolon in the loc. " + "Flow doesn't", expected_differences: { 'root.body.0.declarations.0.init.body.body.0.loc.end.column': { type: 'Wrong number', expected: 30, actual: 29 }, 'root.body.0.declarations.0.init.body.body.0.range.1': { type: 'Wrong number', expected: 30, actual: 29 }, } }, 'var hi = function eval() { };', 'var hi = function arguments() { };', { content: 'var hello = function hi() { sayHi() };', explanation: "Esprima counts the implict semicolon in the loc. " + "Flow doesn't", expected_differences: { 'root.body.0.declarations.0.init.body.body.0.loc.end.column': { type: 'Wrong number', expected: 36, actual: 35 }, 'root.body.0.declarations.0.init.body.body.0.range.1': { type: 'Wrong number', expected: 36, actual: 35 }, } }, { content: '(function(){})', explanation: "Esprima counts the parens in the loc. Flow doesn't", expected_differences: { 'root.loc.start.column': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.loc.end.column': { type: 'Wrong number', expected: 14, actual: 13 }, 'root.body.0.loc.start.column': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.body.0.loc.end.column': { type: 'Wrong number', expected: 14, actual: 13 }, 'root.range.0': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.range.1': { type: 'Wrong number', expected: 14, actual: 13 }, 'root.body.0.range.0': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.body.0.range.1': { type: 'Wrong number', expected: 14, actual: 13 }, } }, 'function universe(__proto__) { }', 'function test() { "use strict" + 42; }', ], '[ES6] Default Parameter Value': [ 'x = function(y = 1) {}', 'function f(a = 1) {}', 'x = { f: function(a=1) {} }', ], 'Automatic semicolon insertion': [ { content: '{ x\n++y }', explanation: "Esprima counts the implicit semicolon on the second "+ "line in its loc. Flow doesn't", expected_differences: { 'root.body.0.body.1.loc.end.column': { type: 'Wrong number', expected: 4, actual: 3 }, 'root.body.0.body.1.range.1': { type: 'Wrong number', expected: 8, actual: 7 }, } }, { content: '{ x\n--y }', explanation: "Esprima counts the implicit semicolon on the second "+ "line in its loc. Flow doesn't", expected_differences: { 'root.body.0.body.1.loc.end.column': { type: 'Wrong number', expected: 4, actual: 3 }, 'root.body.0.body.1.range.1': { type: 'Wrong number', expected: 8, actual: 7 }, } }, 'var x /* comment */;', '{ var x = 14, y = 3\nz; }', 'while (true) { continue\nthere; }', 'while (true) { continue // Comment\nthere; }', 'while (true) { continue /* Multiline\nComment */there; }', 'while (true) { break\nthere; }', 'while (true) { break // Comment\nthere; }', 'while (true) { break /* Multiline\nComment */there; }', { content: '(function(){ return\nx; })', explanation: "Esprima counts the parens and implicit semicolon in " + "its loc. Flow doesn't", expected_differences: { 'root.loc.start.column': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.loc.end.column': { type: 'Wrong number', expected: 5, actual: 4 }, 'root.body.0.loc.start.column': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.body.0.loc.end.column': { type: 'Wrong number', expected: 5, actual: 4 }, 'root.range.0': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.range.1': { type: 'Wrong number', expected: 25, actual: 24 }, 'root.body.0.range.0': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.body.0.range.1': { type: 'Wrong number', expected: 25, actual: 24 }, } }, { content: '(function(){ return // Comment\nx; })', explanation: "Esprima counts the parens in its loc. Flow doesn't", expected_differences: { 'root.loc.start.column': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.loc.end.column': { type: 'Wrong number', expected: 5, actual: 4 }, 'root.body.0.loc.start.column': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.body.0.loc.end.column': { type: 'Wrong number', expected: 5, actual: 4 }, 'root.range.0': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.range.1': { type: 'Wrong number', expected: 5, actual: 4 }, 'root.body.0.range.0': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.body.0.range.1': { type: 'Wrong number', expected: 5, actual: 4 }, 'root.range.0': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.range.1': { type: 'Wrong number', expected: 36, actual: 35 }, 'root.body.0.range.0': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.body.0.range.1': { type: 'Wrong number', expected: 36, actual: 35 }, } }, { content: '(function(){ return/* Multiline\nComment */x; })', explanation: "Esprima counts the parens in its loc. Flow doesn't", expected_differences: { 'root.loc.start.column': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.loc.end.column': { type: 'Wrong number', expected: 15, actual: 14 }, 'root.body.0.loc.start.column': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.body.0.loc.end.column': { type: 'Wrong number', expected: 15, actual: 14 }, 'root.range.0': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.body.0.range.0': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.range.1': { type: 'Wrong number', expected: 47, actual: 46 }, 'root.body.0.range.1': { type: 'Wrong number', expected: 47, actual: 46 }, } }, '{ throw error\nerror; }', '{ throw error// Comment\nerror; }', '{ throw error/* Multiline\nComment */error; }', ], 'Directive Prolog': [ { content: '(function () { \'use\\x20strict\'; with (i); }())', explanation: "Esprima counts the outer parens in its loc. Flow doesn't", expected_differences: { 'root.body.0.loc.start.column': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.body.0.loc.end.column': { type: 'Wrong number', expected: 46, actual: 45 }, 'root.loc.start.column': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.loc.end.column': { type: 'Wrong number', expected: 46, actual: 45 }, 'root.body.0.range.0': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.body.0.range.1': { type: 'Wrong number', expected: 46, actual: 45 }, 'root.range.0': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.range.1': { type: 'Wrong number', expected: 46, actual: 45 }, } }, { content: '(function () { \'use\\nstrict\'; with (i); }())', explanation: "Esprima counts the outer parens in its loc. Flow doesn't", expected_differences: { 'root.body.0.loc.start.column': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.body.0.loc.end.column': { type: 'Wrong number', expected: 44, actual: 43 }, 'root.loc.start.column': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.loc.end.column': { type: 'Wrong number', expected: 44, actual: 43 }, 'root.body.0.range.0': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.body.0.range.1': { type: 'Wrong number', expected: 44, actual: 43 }, 'root.range.0': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.range.1': { type: 'Wrong number', expected: 44, actual: 43 }, } }, ], 'Whitespace': [ 'new\x20\x09\x0B\x0C\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\uFEFFa', '{0\x0A1\x0D2\u20283\u20294}', ], 'Source elements': [ { content: '', explanation: "An empty program should start and end on line 1. "+ "Ain't no such thing as line 0", expected_differences: { 'root.loc.start.line': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.loc.end.line': { type: 'Wrong number', expected: 0, actual: 1 } } }, ], 'Source option': [ 'x + y - z', { content: 'a + (b < (c * d)) + e', explanation: "Esprima counts the parens in the locs. Flow doesn't", expected_differences: { 'root.body.0.expression.left.loc.end.column': { type: 'Wrong number', expected: 17, actual: 15 } , 'root.body.0.expression.left.right.loc.end.column': { type: 'Wrong number', expected: 16, actual: 15 }, 'root.body.0.expression.left.range.1': { type: 'Wrong number', expected: 17, actual: 15 } , 'root.body.0.expression.left.right.range.1': { type: 'Wrong number', expected: 16, actual: 15 }, } }, ], 'Invalid syntax': [ '{', '}', '3ea', '3in []', '3e', { content: '3e+', explanation: "Esprima counts comments in its loc, Flow doesn't", expected_differences: { 'root.errors.0.column': { type: 'Wrong error column', expected: 3, actual: '0-2' }, } }, { content: '3e-', explanation: "Esprima counts comments in its loc, Flow doesn't", expected_differences: { 'root.errors.0.column': { type: 'Wrong error column', expected: 3, actual: '0-2' }, } }, '3x', '3x0', '0x', { content: '09', explanation: "Spec doesn't support this but every implementation does", expected_differences: { 'root.errors': { type: 'Flow found no error', expected: 'Line 1: Unexpected token ILLEGAL', actual: undefined }, } }, '018', '01a', '3in[]', '0x3in[]', '"Hello\nWorld"', 'x\\', 'var x = /(s/g', '/', '/test', '/test\n/', /* TODO uncomment when esprima is fixed * https://code.google.com/p/esprima/issues/detail?id=604 { content: 'var x = /[a-z]/\\ux', explanation: "10.8.5.1 disallows unicode escape flags", expected_differences: { 'root.errors.0.column': { type: 'Wrong error column', expected: 18, actual: '15-16' }, 'root.errors.0.message': { type: 'Wrong error message', expected: 'Invalid regular expression', actual: 'Unexpected token ILLEGAL' }, } }, { content: 'var x = /[a-z]/\\\\ux', explanation: "10.8.5.1 disallows unicode escape flags", expected_differences: { 'root.errors.0.column': { type: 'Wrong error column', expected: 19, actual: '15-16' }, 'root.errors.0.message': { type: 'Wrong error message', expected: 'Invalid regular expression', actual: 'Unexpected token ILLEGAL' }, } }, */ '3 = 4', 'func() = 4', { content: '(1 + 1) = 10', explanation: "Esprima counts parens in its loc, Flow doesn't", expected_differences: { 'root.errors.0.column': { type: 'Wrong error column', expected: 7, actual: '1-6' }, } }, '"\\u{110000}"', { content: '"\\u{}"', explanation: "Flow's lexer complains at the beginning of a bad escape", expected_differences: { 'root.errors.0.column': { type: 'Wrong error column', expected: 4, actual: '2-3' }, } }, { content: '"\\u{FFFF"', explanation: "Flow's lexer complains at the beginning of a bad escape", expected_differences: { 'root.errors.0.column': { type: 'Wrong error column', expected: 9, actual: '2-3' }, } }, { content: '"\\u{FFZ}"', explanation: "Flow's lexer complains at the beginning of a bad escape", expected_differences: { 'root.errors.0.column': { type: 'Wrong error column', expected: 7, actual: '2-3' }, } }, 'x\\', '1++', '1--', '++1', '--1', { content: 'for((1 + 1) in list) process(x);', explanation: "Esprima counts comments in its loc, Flow doesn't", expected_differences: { 'root.errors.0.column': { type: 'Wrong error column', expected: 11, actual: '5-10' }, } }, '[', '[,', '1 + {', '1 + { t:t ', '1 + { t:t,', 'var x = /\n/', 'var x = "\n', 'var if = 42', 'i #= 42', 'i + 2 = 42', '+i = 42', '1 + (', '\n\n\n{', '\n/* Some multiline\ncomment */\n)', '{ set 1 }', '{ get 2 }', '({ set: s(if) { } })', '({ set s(.) { } })', '({ set s() { } })', '({ set: s() { } })', '({ set: s(a, b) { } })', '({ get: g(d) { } })', '({ get i() { }, i: 42 })', '({ i: 42, get i() { } })', '({ set i(x) { }, i: 42 })', '({ i: 42, set i(x) { } })', '({ get i() { }, get i() { } })', '({ set i(x) { }, set i(x) { } })', '((a)) => 42', '(a, (b)) => 42', { content: '"use strict"; (eval = 10) => 42', explanation: "This is an arrow function error, not an assignment "+ "error", expected_differences: { 'root.errors.0.message': { type: 'Wrong error message', expected: 'Assignment to eval or arguments is not allowed in strict mode', actual: 'Parameter name eval or arguments is not allowed in strict mode', }, }, }, // strict mode, using eval when IsSimpleParameterList is true { content: '"use strict"; eval => 42', explanation: "Esprima error loc is crazy here", expected_differences: { 'root.errors.0.column': { type: 'Wrong error column', expected: 24, actual: '14-18' }, } }, // strict mode, using arguments when IsSimpleParameterList is true { content: '"use strict"; arguments => 42', explanation: "Esprima doesn't point to the bad argument", expected_differences: { 'root.errors.0.column': { type: 'Wrong error column', expected: 29, actual: '14-23' }, } }, // strict mode, using eval when IsSimpleParameterList is true { content: '"use strict"; (eval, a) => 42', explanation: "Esprima error loc is crazy here", expected_differences: { 'root.errors.0.column': { type: 'Wrong error column', expected: 29, actual: '15-19' }, } }, // strict mode, using arguments when IsSimpleParameterList is true { content: '"use strict"; (arguments, a) => 42', explanation: "Esprima doesn't point to the bad argument", expected_differences: { 'root.errors.0.column': { type: 'Wrong error column', expected: 34, actual: '15-24' }, } }, { content: '"use strict"; (a, a) => 42', explanation: "Esprima counts parens in its loc, Flow doesn't", expected_differences: { 'root.errors.0.column': { type: 'Wrong error column', expected: 20, actual: '18-19' }, } }, '"use strict"; (a) => 00', '() <= 42', '() ? 42', '() + 42', '(...x) + 42', '()++', '()()', '(10) => 00', '(10, 20) => 00', { content: '"use strict"; (eval) => 42', explanation: "Esprima error loc is crazy here", expected_differences: { 'root.errors.0.column': { type: 'Wrong error column', expected: 26, actual: '15-19' }, } }, { content: '(eval) => { "use strict"; 42 }', explanation: "Esprima error loc is crazy here", expected_differences: { 'root.errors.0.column': { type: 'Wrong error column', expected: 30, actual: '1-5' }, } }, 'function t(if) { }', 'function t(true) { }', 'function t(false) { }', 'function t(null) { }', 'function null() { }', 'function true() { }', 'function false() { }', 'function if() { }', 'a b;', 'if.a;', 'a if;', { content: 'a class;', explanation: 'class is no longer a future reserved word', expected_differences: { 'root.errors.0.message': { type: 'Wrong error message', expected: 'Unexpected reserved word', actual: 'Unexpected token class', }, }, }, 'break\n', 'break 1;', 'continue\n', 'continue 2;', 'throw', 'throw;', 'throw\n', { content: 'for (var i, i2 in {});', explanation: "Esprima counts comments in its loc, Flow doesn't", expected_differences: { 'root.errors.0.column': { type: 'Wrong error column', expected: 15, actual: '5-14' }, 'root.errors.0.message': { type: 'Wrong error message', expected: 'Unexpected token in', actual: 'Invalid left-hand side in for-in' }, } }, 'for ((i in {}));', 'for (i + 1 in {});', 'for (+i in {});', 'if(false)', 'if(false) doThis(); else', 'do', 'while(false)', 'for(;;)', 'with(x)', 'try { }', 'const x = 12, y;', 'const x, y = 12;', 'const x;', { content: 'if(true) let a = 1;', explanation: "The let keyword is parsed as an identifer. " + "It's the a that causes the error", expected_differences: { 'root.errors.0.column': { type: 'Wrong error column', expected: 9, actual: '13-14' }, 'root.errors.0.message': { type: 'Wrong error message', expected: 'Unexpected token let', actual: 'Unexpected identifier', }, } }, 'if(true) const a = 1;', { content: 'switch (c) { default: default: }', explanation: "Esprima points after the duplicate default", expected_differences: { 'root.errors.0.column': { type: 'Wrong error column', expected: 30, actual: '22-29' }, } }, 'new X()."s"', '/*', '/*\n\n\n', '/**', '/*\n\n*', '/*hello', '/*hello *', '\n]', { content: '\r]', explanation: "Flow and esprima disagree whether \r is a newline", expected_differences: { 'root.errors.0.column': { type: 'Wrong error column', expected: 0, actual: '1-2' }, 'root.errors.0.line': { type: 'Wrong error line', expected: 2, actual: '1-1' }, } }, '\r\n]', { content: '\n\r]', explanation: "Flow and esprima disagree whether \r is a newline", expected_differences: { 'root.errors.0.column': { type: 'Wrong error column', expected: 0, actual: '1-2' }, 'root.errors.0.line': { type: 'Wrong error line', expected: 3, actual: '2-2' }, } }, '//\r\n]', { content: '//\n\r]', explanation: "Flow and esprima disagree whether \r is a newline", expected_differences: { 'root.errors.0.column': { type: 'Wrong error column', expected: 0, actual: '1-2' }, 'root.errors.0.line': { type: 'Wrong error line', expected: 3, actual: '2-2' }, } }, '/a\\\n/', { content: '//\r \n]', explanation: "Flow and esprima disagree whether \r is a newline", expected_differences: { 'root.errors.0.line': { type: 'Wrong error line', expected: 3, actual: '2-2' }, } }, '/*\r\n*/]', { content: '/*\n\r*/]', explanation: "Flow and esprima disagree whether \r is a newline", expected_differences: { 'root.errors.0.column': { type: 'Wrong error column', expected: 2, actual: '3-4' }, 'root.errors.0.line': { type: 'Wrong error line', expected: 3, actual: '2-2' }, } }, { content: '/*\r \n*/]', explanation: "Flow and esprima disagree whether \r is a newline", expected_differences: { 'root.errors.0.line': { type: 'Wrong error line', expected: 3, actual: '2-2' }, } }, '\\\\', '\\x', { content: '"\\', explanation: "Esprima has a non-existant location for the eof", expected_differences: { 'root.errors.0.column': { type: 'Wrong error column', expected: 3, actual: '2-2' }, } }, '"\\u', 'try { } catch() {}', 'return', 'break', 'continue', 'switch (x) { default: continue; }', 'do { x } *', 'while (true) { break x; }', 'while (true) { continue x; }', 'x: while (true) { (function () { break x; }); }', 'x: while (true) { (function () { continue x; }); }', 'x: while (true) { (function () { break; }); }', 'x: while (true) { (function () { continue; }); }', { content: 'x: while (true) { x: while (true) { } }', explanation: "Esprima points to the location after the second colon", expected_differences: { 'root.errors.0.column': { type: 'Wrong error column', expected: 20, actual: '18-19' }, } }, '(function () { \'use strict\'; delete i; }())', '(function () { \'use strict\'; with (i); }())', 'function hello() {\'use strict\'; ({ i: 42, i: 42 }) }', 'function hello() {\'use strict\'; ({ hasOwnProperty: 42, hasOwnProperty: 42 }) }', 'function hello() {\'use strict\'; var eval = 10; }', 'function hello() {\'use strict\'; var arguments = 10; }', 'function hello() {\'use strict\'; try { } catch (eval) { } }', 'function hello() {\'use strict\'; try { } catch (arguments) { } }', 'function hello() {\'use strict\'; eval = 10; }', 'function hello() {\'use strict\'; arguments = 10; }', 'function hello() {\'use strict\'; ++eval; }', 'function hello() {\'use strict\'; --eval; }', 'function hello() {\'use strict\'; ++arguments; }', 'function hello() {\'use strict\'; --arguments; }', 'function hello() {\'use strict\'; eval++; }', 'function hello() {\'use strict\'; eval--; }', 'function hello() {\'use strict\'; arguments++; }', 'function hello() {\'use strict\'; arguments--; }', 'function hello() {\'use strict\'; function eval() { } }', 'function hello() {\'use strict\'; function arguments() { } }', 'function eval() {\'use strict\'; }', 'function arguments() {\'use strict\'; }', 'function hello() {\'use strict\'; (function eval() { }()) }', 'function hello() {\'use strict\'; (function arguments() { }()) }', '(function eval() {\'use strict\'; })()', '(function arguments() {\'use strict\'; })()', 'function hello() {\'use strict\'; ({ s: function eval() { } }); }', '(function package() {\'use strict\'; })()', 'function hello() {\'use strict\'; ({ i: 10, set s(eval) { } }); }', 'function hello() {\'use strict\'; ({ set s(eval) { } }); }', 'function hello() {\'use strict\'; ({ s: function s(eval) { } }); }', 'function hello(eval) {\'use strict\';}', 'function hello(arguments) {\'use strict\';}', 'function hello() { \'use strict\'; function inner(eval) {} }', 'function hello() { \'use strict\'; function inner(arguments) {} }', ' "\\1"; \'use strict\';', 'function hello() { \'use strict\'; "\\1"; }', 'function hello() { \'use strict\'; 021; }', 'function hello() { \'use strict\'; ({ "\\1": 42 }); }', 'function hello() { \'use strict\'; ({ 021: 42 }); }', 'function hello() { "octal directive\\1"; "use strict"; }', 'function hello() { "octal directive\\1"; "octal directive\\2"; "use strict"; }', 'function hello() { "use strict"; function inner() { "octal directive\\1"; } }', 'function hello() { "use strict"; var implements; }', 'function hello() { "use strict"; var interface; }', 'function hello() { "use strict"; var package; }', 'function hello() { "use strict"; var private; }', 'function hello() { "use strict"; var protected; }', 'function hello() { "use strict"; var public; }', 'function hello() { "use strict"; var static; }', 'function hello() { "use strict"; var yield; }', 'function hello() { "use strict"; var let; }', 'function hello(static) { "use strict"; }', 'function static() { "use strict"; }', 'function eval(a) { "use strict"; }', 'function arguments(a) { "use strict"; }', 'var yield', { content: 'var let', explanation: "Bug in esprima. This should be allowed", expected_differences: { 'root.errors': { type: 'Flow found no error', expected: 'Line 1: Unexpected token let', actual: undefined }, } }, '"use strict"; function static() { }', 'function a(t, t) { "use strict"; }', 'function a(eval) { "use strict"; }', 'function a(package) { "use strict"; }', 'function a() { "use strict"; function b(t, t) { }; }', '(function a(t, t) { "use strict"; })', 'function a() { "use strict"; (function b(t, t) { }); }', // Duplicates are forbidden if IsSimpleParameterList is false, and rest // params, patterns, and defaults all make the params non-simple { content: '(t, t, ...rest) => 42', explanation: "Esprima points to the end of the params not to the "+ "bad param itself", expected_differences: { 'root.errors.0.column': { type: 'Wrong error column', expected: 15, actual: '4-5' }, } }, { content: '(t, t, [b]) => 42', explanation: "Esprima points to the end of the params not to the "+ "bad param itself", expected_differences: { 'root.errors.0.column': { type: 'Wrong error column', expected: 11, actual: '4-5' }, } }, { content: '(t, t, {b}) => 42', explanation: "Esprima points to the end of the params not to the "+ "bad param itself", expected_differences: { 'root.errors.0.column': { type: 'Wrong error column', expected: 11, actual: '4-5' }, } }, { content: '(t, t, b=1) => 42', explanation: "Esprima points to the end of the params not to the "+ "bad param itself", expected_differences: { 'root.errors.0.column': { type: 'Wrong error column', expected: 11, actual: '4-5' }, } }, '(function a(eval) { "use strict"; })', '(function a(package) { "use strict"; })', { content: '__proto__: __proto__: 42;', explanation: "Esprima points to the location after the second colon", expected_differences: { 'root.errors.0.column': { type: 'Wrong error column', expected: 21, actual: '11-20' }, } }, '"use strict"; function t(__proto__, __proto__) { }', '"use strict"; x = { __proto__: 42, __proto__: 43 }', '"use strict"; x = { get __proto__() { }, __proto__: 43 }', 'var', 'let', 'const', '{ ; ; ', 'function t() { ; ; ', 'let let', 'const let=4', 'for (let let=4;;) {}', 'for (let in arr) {}', 'for (let let in arr) {}', { content: 'class let { }', explanation: "Esprima counts comments in its loc, Flow doesn't", expected_differences: { 'root.errors.0.message': { type: 'Wrong error message', expected: 'Unexpected token let', actual: 'Use of future reserved word in strict mode' }, } }, 'class A { foo() { let let } }', { content: 'function foo([a.a]) {}', explanation: 'Esprima is off by one', expected_differences: { 'root.errors.0.column': { type: 'Wrong error column', expected: 18, actual: '14-17' }, }, }, { content: 'var f = function ([a.a]) {}', explanation: 'Esprima is off by one', expected_differences: { 'root.errors.0.column': { type: 'Wrong error column', expected: 23, actual: '19-22' }, }, }, ], 'Invalid unicode related syntax': [ 'x\\u005c', 'x\\u002a', 'a\\u', '\\ua', 'var x = /[a-z\n]/\\ux', '\u203F = 10', '\\u005c', '\\u0000', '\u200C = []', '\u200D = []', ], 'JSX': [ '<a />;\n', '<n:a n:v />', '<a n:foo="bar"> {value} <b><c /></b></a>', '<a b={" "} c=" " d="&amp;" />', '<a\n/>', /* TODO unicode support '<日本語></日本語>', */ '<AbC-def\n test="&#x0026;&#38;">\nbar\nbaz\n</AbC-def>', '<a b={x ? <c /> : <d />} />', { content: '<a>{}</a>', explanation: 'Esprima counts the curly-braces in its loc, flow does not. FIXME', expected_differences: { 'root.body.0.expression.children.0.expression.range.0': { type: 'Wrong number', expected: '4', actual: '3' }, 'root.body.0.expression.children.0.expression.range.1': { type: 'Wrong number', expected: '4', actual: '5' }, } }, { content: '<a>{/* this is a comment */}</a>', explanation: 'Esprima counts the curly-braces in its loc, flow does not. FIXME', expected_differences: { 'root.body.0.expression.children.0.expression.range.0': { type: 'Wrong number', expected: '4', actual: '3' }, 'root.body.0.expression.children.0.expression.range.1': { type: 'Wrong number', expected: '27', actual: '28' }, } }, '<div>@test content</div>', '<div><br />7x invalid-js-identifier</div>', '<a.b></a.b>', '<a.b.c></a.b.c>', '<div {...props} />', '<div {...props} post="attribute" />', '<div pre="leading" pre2="attribute" {...props}></div>', '<a> </a>', 'function() { return <div/>; }' ], 'Invalid JSX Syntax': [ '</>', '<a: />', '<:a />', '<a b=d />', '<a>', '<a></b>', '<a foo="bar', '<a:b></b>', '<a:b.c></a:b.c>', '<a.b:c></a.b:c>', '<a.b.c></a>', '<.a></.a>', '<a.></a.>', '<a[foo]></a[foo]>', '<a[\'foo\']></a[\'foo\']>', '<a><a />', '<a b={}>', '<a>{"str";}</a>', '<span className="a", id="b" />', '<div className"app">', '<div {props} />', '<div>stuff</div {...props}>', '<div {...props}>stuff</div {...props}>', '<div><a/><b/><c/>', ], 'Invalid Type Annotations': [ 'function foo(callback:) {}', 'function foo(): {}', 'function foo(): { foo() }', 'function foo(callback:(string) => number) {}', 'a = {foo(): { return 42; }}', 'class Foo { get bar<T>() { } }', 'var a:{a:number b:string}', ], 'ES6 Unicode Code Point Escape Sequence': [ '"\\u{714E}\\u{8336}"', '"\\u{20BB7}\\u{91CE}\\u{5BB6}"' ], // ECMAScript 6th Syntax, 7.8.3 Numeric Literals 'ES6: Numeric Literal': [ '00', '0o0', 'function test() {\'use strict\'; 0o0; }', '0o2', '0o12', '0O0', 'function test() {\'use strict\'; 0O0; }', '0O2', '0O12', '0b0', '0b1', '0b10', '0B0', '0B1', '0B10' ], // ECMAScript 6th Syntax, 11.1. 9 Template Literals 'ES6 Template Strings': [ '`42`', 'raw`42`', 'raw`hello ${name}`', '`$`', '`\\n\\r\\b\\v\\t\\f\\\n\\\r\n`', '`\n\r\n`', '`\\u{000042}\\u0042\\x42\\102\\A`', '`Hello\rworld`', 'new raw`42`' ], // ECMAScript 6th Syntax, 12.11 The switch statement 'ES6: Switch Case Declaration': [ 'switch (answer) { case 42: let t = 42; break; }' ], // ECMAScript 6th Syntax, 13.2 Arrow Function Definitions 'ES6: Arrow Function': [ '() => "test"', 'e => "test"', '(e) => "test"', '(a, b) => "test"', 'e => { 42; }', { content: 'e => ({ property: 42 })', explanation: "Esprima counts the parens in its loc, Flow doesn't", expected_differences: { 'root.body.0.expression.loc.end.column': { type: 'Wrong number', expected: 23, actual: 22 }, 'root.body.0.loc.end.column': { type: 'Wrong number', expected: 23, actual: 22 }, 'root.loc.end.column': { type: 'Wrong number', expected: 23, actual: 22 }, 'root.body.0.expression.range.1': { type: 'Wrong number', expected: 23, actual: 22 }, 'root.body.0.range.1': { type: 'Wrong number', expected: 23, actual: 22 }, 'root.range.1': { type: 'Wrong number', expected: 23, actual: 22 }, } }, // Not an object! { content: 'e => { label: 42 }', explanation: "Esprima counts the implicit semicolon in its loc, " + "Flow doesn't", expected_differences: { 'root.body.0.expression.body.body.0.body.loc.end.column': { type: 'Wrong number', expected: 17, actual: 16 }, 'root.body.0.expression.body.body.0.loc.end.column': { type: 'Wrong number', expected: 17, actual: 16 }, 'root.body.0.expression.body.body.0.body.range.1': { type: 'Wrong number', expected: 17, actual: 16 }, 'root.body.0.expression.body.body.0.range.1': { type: 'Wrong number', expected: 17, actual: 16 }, } }, '(a, b) => { 42; }', '([a, , b]) => 42', { content: '([a.a]) => 42', explanation: 'Esprima has the wrong location because it is ' + 'doing the check after-the-fact, once the => is reached', expected_differences: { 'root.errors.0.column': { type: 'Wrong error column', expected: 7, actual: '2-5' }, }, }, '(x=1) => x * x', // not strict mode, using eval 'eval => 42', // not strict mode, using arguments 'arguments => 42', // not strict mode, using octals '(a) => 00', // not strict mode, using eval, IsSimpleParameterList is true '(eval, a) => 42', // not strict mode, assigning to eval '(eval = 10) => 42', // not strict mode, using eval, IsSimpleParameterList is false '(eval, a = 10) => 42', { content: '(x => x)', explanation: "Esprima counts the parens in its loc, Flow doesn't", expected_differences: { 'root.body.0.loc.start.column': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.body.0.loc.end.column': { type: 'Wrong number', expected: 8, actual: 7 }, 'root.loc.start.column': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.loc.end.column': { type: 'Wrong number', expected: 8, actual: 7 }, 'root.body.0.range.0': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.body.0.range.1': { type: 'Wrong number', expected: 8, actual: 7 }, 'root.range.0': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.range.1': { type: 'Wrong number', expected: 8, actual: 7 }, } }, 'x => y => 42', { content: '(x) => ((y, z) => (x, y, z))', explanation: "TODO", expected_differences: { 'root.body.0.expression.body.loc.end.column': { type: 'Wrong number', expected: 27, actual: 26 }, 'root.body.0.expression.loc.end.column': { type: 'Wrong number', expected: 28, actual: 26 }, 'root.body.0.loc.end.column': { type: 'Wrong number', expected: 28, actual: 26 }, 'root.loc.end.column': { type: 'Wrong number', expected: 28, actual: 26 }, 'root.body.0.expression.body.range.1': { type: 'Wrong number', expected: 27, actual: 26 }, 'root.body.0.expression.range.1': { type: 'Wrong number', expected: 28, actual: 26 }, 'root.body.0.range.1': { type: 'Wrong number', expected: 28, actual: 26 }, 'root.range.1': { type: 'Wrong number', expected: 28, actual: 26 }, } }, 'foo(() => {})', 'foo((x, y) => {})' ], // ECMAScript 6th Syntax, 13.13 Method Definitions 'ES6: Method Definition': [ 'x = { method() { } }', 'x = { method(test) { } }', 'x = { \'method\'() { } }', 'x = { get() { } }', 'x = { set() { } }', ], 'Array Comprehension': [ '[[x,b,c] for (x in []) for (b in []) if (b && c)]' , '[x for (a in [])]' , '[1 for (x in [])]' , '[(x,1) for (x in [])]' , '[x for (x of array)]', '[x for (x of array) for (y of array2) if (x === test)]' ], // http://wiki.ecmascript.org/doku.php?id=harmony:object_literals#object_literal_property_value_shorthand 'Harmony: Object Literal Property Value Shorthand': [ 'x = { y, z }' ], // http://wiki.ecmascript.org/doku.php?id=harmony:destructuring 'Harmony: Destructuring': [ '[a, b] = [b, a]', { content: '({ responseText: text }) = res', explanation: "Esprima counts the parens in the loc, flow doesn't.", expected_differences: { 'root.body.0.expression.loc.start.column': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.body.0.loc.start.column': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.loc.start.column': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.body.0.expression.range.0': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.body.0.range.0': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.range.0': { type: 'Wrong number', expected: 0, actual: 1 }, } }, 'const {a} = {}', 'const [a] = []', 'let {a} = {}', 'let [a] = []', 'var {a} = {}', 'var [a] = []', 'const {a:b} = {}', 'let {a:b} = {}', 'var {a:b} = {}', 'var f = function({node, guestStatus}) {}', ], // http://wiki.ecmascript.org/doku.php?id=harmony:modules 'Harmony: Modules': [ 'module "crypto" {}', 'module crypto from "crypto";', 'module "crypto/e" {}', 'export var document', 'export var document = { }', 'export let document', 'export let document = { }', 'export const document = { }', 'export function parse() { }', 'export class Class {}', 'export default = 42', 'export *', 'export * from "crypto"', 'export { encrypt }', 'export { encrypt, decrypt }', 'export { encrypt as default }', 'export { encrypt, decrypt as dec }', 'module "lib" { export var document }', 'module "lib" { export var document = { } }', 'module "lib" { export let document }', 'module "lib" { export let document = { } }', 'module "lib" { export const document = { } }', 'module "lib" { export function parse() { } }', 'module "lib" { export class Class {} }', 'module "lib" { export * }', 'module "security" { export * from "crypto" }', 'module "crypto" { export { encrypt } }', 'module "crypto" { export { encrypt, decrypt } }', 'module "crypto" { export { encrypt, decrypt as dec } }', 'import "jquery"', 'import $ from "jquery"', 'import { encrypt, decrypt } from "crypto"', 'import { encrypt as enc } from "crypto"', 'import { decrypt, encrypt as enc } from "crypto"', 'import default from "foo"', 'import { null as nil } from "bar"', 'module "security" { import "cryto" }', 'module()', 'module "foo" { module() }' ], // http://wiki.ecmascript.org/doku.php?id=harmony:generators 'Harmony: Yield Expression': [ { content: '(function* () { yield v })', explanation: "Esprima counts the parens and implict semicolon in " + "its loc. Flow doesn't", expected_differences: { 'root.body.0.expression.body.body.0.loc.end.column': { type: 'Wrong number', expected: 24, actual: 23 }, 'root.body.0.loc.start.column': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.body.0.loc.end.column': { type: 'Wrong number', expected: 26, actual: 25 }, 'root.loc.start.column': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.loc.end.column': { type: 'Wrong number', expected: 26, actual: 25 }, 'root.body.0.expression.body.body.0.range.1': { type: 'Wrong number', expected: 24, actual: 23 }, 'root.body.0.range.0': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.body.0.range.1': { type: 'Wrong number', expected: 26, actual: 25 }, 'root.range.0': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.range.1': { type: 'Wrong number', expected: 26, actual: 25 }, } }, { content: '(function* () { yield *v })', explanation: "Esprima counts the parens and implict semicolon in " + "its loc. Flow doesn't", expected_differences: { 'root.body.0.expression.body.body.0.loc.end.column': { type: 'Wrong number', expected: 25, actual: 24 }, 'root.body.0.loc.start.column': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.body.0.loc.end.column': { type: 'Wrong number', expected: 27, actual: 26 }, 'root.loc.start.column': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.loc.end.column': { type: 'Wrong number', expected: 27, actual: 26 }, 'root.body.0.expression.body.body.0.range.1': { type: 'Wrong number', expected: 25, actual: 24 }, 'root.body.0.range.0': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.body.0.range.1': { type: 'Wrong number', expected: 27, actual: 26 }, 'root.range.0': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.range.1': { type: 'Wrong number', expected: 27, actual: 26 }, } }, { content: 'function* test () { yield *v }', explanation: "Esprima counts the implict semicolon in its loc, flow " + "doesn't", expected_differences: { 'root.body.0.body.body.0.loc.end.column': { type: 'Wrong number', expected: 29, actual: 28 }, 'root.body.0.body.body.0.range.1': { type: 'Wrong number', expected: 29, actual: 28 }, } }, { content: 'var x = { *test () { yield *v } };', explanation: "Esprima counts the implict semicolon in its loc, flow " + "doesn't", expected_differences: { 'root.body.0.declarations.0.init.properties.0.value.body.body.0.loc.end.column': { type: 'Wrong number', expected: 30, actual: 29 }, 'root.body.0.declarations.0.init.properties.0.value.body.body.0.range.1': { type: 'Wrong number', expected: 30, actual: 29 }, } }, 'function* t() {}', { content: '(function* () { yield yield 10 })', explanation: "Esprima counts the parens and implict semicolon in " + "its loc. Flow doesn't", expected_differences: { 'root.body.0.expression.body.body.0.loc.end.column': { type: 'Wrong number', expected: 31, actual: 30 }, 'root.body.0.loc.start.column': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.body.0.loc.end.column': { type: 'Wrong number', expected: 33, actual: 32 }, 'root.loc.start.column': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.loc.end.column': { type: 'Wrong number', expected: 33, actual: 32 }, 'root.body.0.expression.body.body.0.range.1': { type: 'Wrong number', expected: 31, actual: 30 }, 'root.body.0.range.0': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.body.0.range.1': { type: 'Wrong number', expected: 33, actual: 32 }, 'root.range.0': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.range.1': { type: 'Wrong number', expected: 33, actual: 32 }, } }, 'function* f () { var e = () => yield 1; }', ], // http://wiki.ecmascript.org/doku.php?id=harmony:iterators 'Harmony: Iterators': [ 'for(x of list) process(x);', 'for (var x of list) process(x);', 'for (let x of list) process(x);', { content: 'for (var x = 42 of list) process(x);', explanation: "Esprima thinks this is valid, it isn't", expected_differences : { 'root.errors.0.column': { type: 'Wrong error column', expected: undefined, actual: 6, }, 'root.errors.0.line': { type: 'Wrong error line', expected: undefined, actual: 1, }, 'root.errors.0.message': { type: 'Wrong error message', expected: undefined, actual: 'Invalid left-hand side in for-of', } } } ], // http://wiki.ecmascript.org/doku.php?id=strawman:maximally_minimal_classes 'Harmony: Class (strawman)': [ 'var A = class extends B {}', 'class type {}', 'class A extends class B extends C {} {}', 'class A {get() {}}', 'class A { static get() {}}', 'class A extends B {get foo() {}}', 'class A extends B { static get foo() {}}', 'class A {set a(v) {}}', 'class A { static set a(v) {}}', 'class A {set(v) {};}', 'class A { static set(v) {};}', 'class A {*gen(v) { yield v; }}', 'class A { static *gen(v) { yield v; }}', { content: '"use strict"; (class A {constructor() { super() }})', explanation: "Esprima counts the parens and implicit semicolon in " + "its loc, Flow doesn't", expected_differences: { 'root.body.1.expression.body.body.0.value.body.body.0.loc.end.column': { type: 'Wrong number', expected: 48, actual: 47 }, 'root.body.1.loc.start.column': { type: 'Wrong number', expected: 14, actual: 15 }, 'root.body.1.loc.end.column': { type: 'Wrong number', expected: 51, actual: 50 }, 'root.loc.end.column': { type: 'Wrong number', expected: 51, actual: 50 }, 'root.body.1.expression.body.body.0.value.body.body.0.range.1': { type: 'Wrong number', expected: 48, actual: 47 }, 'root.body.1.range.0': { type: 'Wrong number', expected: 14, actual: 15 }, 'root.body.1.range.1': { type: 'Wrong number', expected: 51, actual: 50 }, 'root.range.1': { type: 'Wrong number', expected: 51, actual: 50 }, } }, 'class A {static foo() {}}', 'class A {foo() {} static bar() {}}', { content: '"use strict"; (class A { static constructor() { super() }})', explanation: "Esprima counts the parens and implicit semicolon in " + "its loc, Flow doesn't", expected_differences: { 'root.body.1.expression.body.body.0.value.body.body.0.loc.end.column': { type: 'Wrong number', expected: 56, actual: 55 }, 'root.body.1.loc.start.column': { type: 'Wrong number', expected: 14, actual: 15 }, 'root.body.1.loc.end.column': { type: 'Wrong number', expected: 59, actual: 58 }, 'root.loc.end.column': { type: 'Wrong number', expected: 59, actual: 58 }, 'root.body.1.expression.body.body.0.value.body.body.0.range.1': { type: 'Wrong number', expected: 56, actual: 55 }, 'root.body.1.range.0': { type: 'Wrong number', expected: 14, actual: 15 }, 'root.body.1.range.1': { type: 'Wrong number', expected: 59, actual: 58 }, 'root.range.1': { type: 'Wrong number', expected: 59, actual: 58 }, } }, 'class A { foo() {} bar() {}}', 'class A { get foo() {} set foo(v) {}}', 'class A { static get foo() {} get foo() {}}', 'class A { static get foo() {} static get bar() {} }', 'class A { static get foo() {} static set foo(v) {} get foo() {} set foo(v) {}}', 'class A { set foo(v) {} get foo() {} }', 'class A { [x]() {} }', 'class A { [1+1]() {} }', 'class A { get [1+1]() {} }', 'class A { static get [1+1]() {} }', ], 'Harmony: Invalid Class (strawman)': [ 'class A { get foo() {} get foo() {} }', 'class A { set foo(v) {} set foo(v) {} }', 'class A { get foo() {} foo() {} }', 'class A { foo() {} get foo() {} }', 'class A { set foo(v) {} foo() {} }', 'class A { foo() {} set foo(v) {} }', ], 'ES6: Computed Properties': [ { content: '({[x]: 10})', explanation: "Esprima counts comments in its loc, Flow doesn't", expected_differences: { 'root.body.0.loc.start.column': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.body.0.loc.end.column': { type: 'Wrong number', expected: 11, actual: 10 }, 'root.loc.start.column': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.loc.end.column': { type: 'Wrong number', expected: 11, actual: 10 }, 'root.body.0.range.0': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.body.0.range.1': { type: 'Wrong number', expected: 11, actual: 10 }, 'root.range.0': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.range.1': { type: 'Wrong number', expected: 11, actual: 10 }, } }, { content: '({["x" + "y"]: 10})', explanation: "Esprima counts comments in its loc, Flow doesn't", expected_differences: { 'root.body.0.loc.start.column': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.body.0.loc.end.column': { type: 'Wrong number', expected: 19, actual: 18 }, 'root.loc.start.column': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.loc.end.column': { type: 'Wrong number', expected: 19, actual: 18 }, 'root.body.0.range.0': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.body.0.range.1': { type: 'Wrong number', expected: 19, actual: 18 }, 'root.range.0': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.range.1': { type: 'Wrong number', expected: 19, actual: 18 }, } }, { content: '({[x]: function() {}})', explanation: "Esprima counts comments in its loc, Flow doesn't", expected_differences: { 'root.body.0.loc.start.column': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.body.0.loc.end.column': { type: 'Wrong number', expected: 22, actual: 21 }, 'root.loc.start.column': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.loc.end.column': { type: 'Wrong number', expected: 22, actual: 21 }, 'root.body.0.range.0': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.body.0.range.1': { type: 'Wrong number', expected: 22, actual: 21 }, 'root.range.0': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.range.1': { type: 'Wrong number', expected: 22, actual: 21 }, } }, { content: '({[x]: 10, y: 20})', explanation: "Esprima counts comments in its loc, Flow doesn't", expected_differences: { 'root.body.0.loc.start.column': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.body.0.loc.end.column': { type: 'Wrong number', expected: 18, actual: 17 }, 'root.loc.start.column': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.loc.end.column': { type: 'Wrong number', expected: 18, actual: 17 }, 'root.body.0.range.0': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.body.0.range.1': { type: 'Wrong number', expected: 18, actual: 17 }, 'root.range.0': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.range.1': { type: 'Wrong number', expected: 18, actual: 17 }, } }, { content: '({get [x]() {}, set [x](v) {}})', explanation: "Esprima counts comments in its loc, Flow doesn't", expected_differences: { 'root.body.0.loc.start.column': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.body.0.loc.end.column': { type: 'Wrong number', expected: 31, actual: 30 }, 'root.loc.start.column': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.loc.end.column': { type: 'Wrong number', expected: 31, actual: 30 }, 'root.body.0.range.0': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.body.0.range.1': { type: 'Wrong number', expected: 31, actual: 30 }, 'root.range.0': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.range.1': { type: 'Wrong number', expected: 31, actual: 30 }, } }, { content: '({[x]() {}})', explanation: "Esprima counts comments in its loc, Flow doesn't", expected_differences: { 'root.body.0.loc.start.column': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.body.0.loc.end.column': { type: 'Wrong number', expected: 12, actual: 11 }, 'root.loc.start.column': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.loc.end.column': { type: 'Wrong number', expected: 12, actual: 11 }, 'root.body.0.range.0': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.body.0.range.1': { type: 'Wrong number', expected: 12, actual: 11 }, 'root.range.0': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.range.1': { type: 'Wrong number', expected: 12, actual: 11 }, } }, 'var {[x]: y} = {y}', 'function f({[x]: y}) {}', 'var x = {*[test]() { yield *v; }}', ], 'ES6: Default parameters': [ 'function f([x] = [1]) {}', 'function f({x} = {x: 10}) {}', 'f = function({x} = {x: 10}) {}', { content: '({f: function({x} = {x: 10}) {}})', explanation: "Esprima counts the parens in its loc, Flow doesn't", expected_differences: { 'root.body.0.loc.start.column': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.body.0.range.0': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.body.0.loc.end.column': { type: 'Wrong number', expected: 33, actual: 32 }, 'root.body.0.range.1': { type: 'Wrong number', expected: 33, actual: 32 }, 'root.loc.start.column': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.range.0': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.loc.end.column': { type: 'Wrong number', expected: 33, actual: 32 }, 'root.range.1': { type: 'Wrong number', expected: 33, actual: 32 }, } }, { content: '({f({x} = {x: 10}) {}})', explanation: "Esprima counts the parens in its loc, Flow doesn't", expected_differences: { 'root.body.0.loc.start.column': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.body.0.range.0': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.body.0.loc.end.column': { type: 'Wrong number', expected: 23, actual: 22 }, 'root.body.0.range.1': { type: 'Wrong number', expected: 23, actual: 22 }, 'root.loc.start.column': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.range.0': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.loc.end.column': { type: 'Wrong number', expected: 23, actual: 22 }, 'root.range.1': { type: 'Wrong number', expected: 23, actual: 22 }, } }, { content: '(class {f({x} = {x: 10}) {}})', explanation: "Esprima counts the parens in its loc, Flow doesn't", expected_differences: { 'root.body.0.loc.start.column': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.body.0.range.0': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.body.0.loc.end.column': { type: 'Wrong number', expected: 29, actual: 28 }, 'root.body.0.range.1': { type: 'Wrong number', expected: 29, actual: 28 }, 'root.loc.start.column': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.range.0': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.loc.end.column': { type: 'Wrong number', expected: 29, actual: 28 }, 'root.range.1': { type: 'Wrong number', expected: 29, actual: 28 }, } }, { content: '(({x} = {x: 10}) => {})', explanation: "Esprima counts the parens in its loc, Flow doesn't", expected_differences: { 'root.body.0.loc.start.column': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.body.0.range.0': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.body.0.loc.end.column': { type: 'Wrong number', expected: 23, actual: 22 }, 'root.body.0.range.1': { type: 'Wrong number', expected: 23, actual: 22 }, 'root.loc.start.column': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.range.0': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.loc.end.column': { type: 'Wrong number', expected: 23, actual: 22 }, 'root.range.1': { type: 'Wrong number', expected: 23, actual: 22 }, } }, 'x = function(y = 1) {}', 'function f(a = 1) {}', 'x = { f: function(a=1) {} }', 'x = { f(a=1) {} }' ], // ECMAScript 6th Syntax, 13 - Rest parameters // http://wiki.ecmascript.org/doku.php?id=harmony:rest_parameters 'ES6: Rest parameters': [ 'function f(...a) {}', 'function f(a, ...b) {}', 'function f(a = 4, ...b) {}', 'var a = function f(...a) {}', 'var a = function f(a, ...b) {}', '(...a) => a', '(a, ...b) => a', ], 'ES6: Destructured Parameters': [ 'function x([ a, b ]){}', 'function x({ a, b }){}', '"use strict"; function x({ a }){ "use strict"; }', 'function x(a, { a }){}', 'function x(...[ a, b ]){}', 'function x({ a: { w, x }, b: [y, z] }, ...[a, b, c]){}', '(function x([ a, b ]){})', '(function x({ a, b }){})', '(function x(...[ a, b ]){})', '(function x({ a: { w, x }, b: [y, z] }, ...[a, b, c]){})', '({ x([ a, b ]){} })', '({ x(...[ a, b ]){} })', '({ x({ a: { w, x }, b: [y, z] }, ...[a, b, c]){} })', '(...a) => {}', '(a, ...b) => {}', '({ a }) => {}', '({ a }, ...b) => {}', '(...[a, b]) => {}', '(a, ...[b]) => {}', '({ a: [a, b] }, ...c) => {}', '({ a: b, c }, [d, e], ...f) => {}' ], 'ES6: SpreadElement': [ '[...a] = b', '[a, ...b] = c', '[{ a, b }, ...c] = d', '[a, ...[b, c]] = d', 'var [...a] = b', 'var [a, ...b] = c', 'var [{ a, b }, ...c] = d', 'var [a, ...[b, c]] = d', 'func(...a)', 'func(a, ...b)', 'new foo(...a)', 'new foo(a, ...b)', 'function foo(...a){}', 'function foo(a, ...a){}', ], // https://gist.github.com/sebmarkbage/aa849c7973cb4452c547 'ES7 Proposal: Rest Properties' : [ 'let {...x} = z', 'let {x, ...y} = z', '(function({x, ...y}) { })' ], // https://gist.github.com/sebmarkbage/aa849c7973cb4452c547 'ES7 Proposal: Spread Properties': [ 'let z = {...x}', 'z = {x, ...y}', { content: '({x, ...y, a, ...b, c})', explanation: "Esprima counts the parens in the loc, Flow doesn't", expected_differences: { 'root.body.0.loc.start.column': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.body.0.range.0': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.body.0.loc.end.column': { type: 'Wrong number', expected: 23, actual: 22 }, 'root.body.0.range.1': { type: 'Wrong number', expected: 23, actual: 22 }, 'root.loc.start.column': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.range.0': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.loc.end.column': { type: 'Wrong number', expected: 23, actual: 22 }, 'root.range.1': { type: 'Wrong number', expected: 23, actual: 22 }, } }, ], 'Harmony Invalid syntax': [ '0o', '0o1a', '0o9', '0o18', '0O', '0O1a', '0O9', '0O18', '0b', '0b1a', '0b9', '0b18', '0b12', '0B', '0B1a', '0B9', '0B18', '0B12', '"\\u{110000}"', '[v] += ary', '[2] = 42', '({ obj:20 }) = 42', '( { get x() {} } ) = 0', 'x \n is y', 'x \n isnt y', 'function default() {}', 'function hello() {\'use strict\'; ({ i: 10, s(eval) { } }); }', 'function a() { "use strict"; ({ b(t, t) { } }); }', 'var super', 'var default', 'let default', 'const default', '({ v: eval }) = obj', '({ v: arguments }) = obj', 'for (var i = function() { return 10 in [] } in list) process(x);', 'for (let x = 42 in list) process(x);', 'for (let x = 42 of list) process(x);', 'module\n"crypto" {}', 'module foo from bar', 'module 42', 'module foo bar', 'module "crypto" { module "e" {} }', 'module "x" { export * from foo }', 'import foo', 'import { foo, bar }', 'import foo from bar', '((a)) => 42', '(a, (b)) => 42', '"use strict"; (eval = 10) => 42', // strict mode, using eval when IsSimpleParameterList is true '"use strict"; eval => 42', // strict mode, using arguments when IsSimpleParameterList is true '"use strict"; arguments => 42', // strict mode, using eval when IsSimpleParameterList is true '"use strict"; (eval, a) => 42', // strict mode, using arguments when IsSimpleParameterList is true '"use strict"; (arguments, a) => 42', // strict mode, using eval when IsSimpleParameterList is false '"use strict"; (eval, a = 10) => 42', '(a, a) => 42', '"use strict"; (a, a) => 42', '"use strict"; (a) => 00', '() <= 42', '(10) => 00', '(10, 20) => 00', 'yield v', 'yield 10', 'yield* 10', 'e => yield* 10', '(function () { yield 10 })', '(function () { yield* 10 })', '(function() { "use strict"; f(yield v) })', 'var obj = { *test** }', 'class A extends yield B { }', 'class default', '`test', 'switch `test`', '`hello ${10 `test`', '`hello ${10;test`', 'function a() 1 // expression closure is not supported', '[a,b if (a)] // (a,b)', 'for each (let x in {}) {};', '[x for (let x in [])]', '[x for (const x in [])]', '[x for (var x in [])]', '[a,b for (a in [])] // (a,b) ', '[x if (x)] // block required', 'var a = [x if (x)]', '[for (x in [])] // no espression', '({ "chance" }) = obj', '({ 42 }) = obj', 'function f(a, ...b, c)', 'function f(a, ...b = 0)', 'function x(...{ a }){}', '"use strict"; function x(a, { a }){}', '"use strict"; function x({ b: { a } }, [{ b: { a } }]){}', '"use strict"; function x(a, ...[a]){}', '(...a, b) => {}', '([ 5 ]) => {}', '({ 5 }) => {}', '(...[ 5 ]) => {}', '[...{ a }] = b', '[...a, b] = c', 'func(...a, b)', 'let {...a, b} = x', '(function({...a, b}) {})', '({ t(eval) { "use strict"; } });', '"use strict"; `${test}\\02`;', '[...a, ] = b', 'if (b,...a, );', '(b, ...a)', 'module "Universe" { ; ; ', 'switch (cond) { case 10: let a = 20; ', '"use strict"; (eval) => 42', '(eval) => { "use strict"; 42 }', '({ get test() { } }) => 42' ], 'Type Annotations': [ 'a = class Foo<T> { }', 'a = class Foo<T> extends Bar<T> {}', 'a=function<T,S>() {}', 'a={set fooProp(value:number){}}', 'class Array { concat(items:number | string) {}; }', 'class Foo { [1 + 1]: string; }', 'class Foo { 123:string; }', 'class Foo { "bar"<T>() { } }', 'class Foo { "prop1":string; }', 'class Foo { [prop1]: string; }' , 'class Foo { prop1:string; prop2:number; }', 'class Foo { static prop1:string; prop2:number; }', 'class Foo {set fooProp(value:number){}}', 'class Foo<T> {}', 'class Foo<T> { bar<U>():number { return 42; }}', 'class Foo<T> extends Bar<T> {}', 'class Foo<T> extends mixin(Bar) {}', 'function foo(): {} {}', 'function foo():(_:bool) => number{}', 'function foo():(_?:bool) => number{}', 'function foo(callback: (_1:bool, _2:string) => number){}', 'function foo(callback: (_:bool) => number){}', 'function foo(callback: () => number){}', 'function foo(callback: () => void){}', 'function foo(nullableNum: ?number){}', 'function foo():number{}', 'function foo(numVal: any){}', 'function foo(numVal: number){}', 'function foo(numVal: number, strVal: string){}', 'function foo(numVal: number, untypedVal){}', 'function foo(numVal: number, x: number){}', 'function foo(requiredParam, optParam?) {}', 'function foo(requiredParam, optParam?=123) {}', 'function foo<T>() {}', 'function foo<T,S>() {}', 'function foo(...typedRest: Array<number>){}', 'function foo(untypedVal, numVal: number){}', 'function foo():() => void{}', 'function foo([x]: Array<string>) {}', 'function foo({x}: { x: string; }) {}', 'interface Array<T> { concat(...items: Array<Array<T> | T>): Array<T>; }', 'interface Array<T> { concat(...items: Array<Array<T> & T>): Array<T>; }', 'var a: { add(...rest:Array<number>): number; }', 'var a: { add(x: number, y:number): number; }', 'var a:Array<number> = [1, 2, 3]', 'var a: { foo<T>(x: T): number; }', 'var a: ?{numVal: number};', 'var a: {numVal: number};', 'var a: {numVal: number; [indexer: string]: number};', 'var a: {numVal: number; [index: number]: string};', 'var a: {numVal: number; strVal: string}', 'var a: {param1: number; param2: string}', 'var a: {param1: number; param2?: string}', 'var a:(...rest:Array<number>) => number', 'var a: {subObj: ?{strVal: string}}', 'var a: {subObj: {strVal: string}}', 'var bar: (str:number, i:number)=> string = foo;', 'var numVal:number;', 'var numVal:number = otherNumVal;', 'var [x]: Array<string> = [ "hello" ];', 'var x : number | string = 4;', 'var x : number & string = 4;', 'var x : () => number | () => string = fn;', 'var x : () => number & () => string = fn;', 'var x: typeof Y | number = Y;', 'var x: typeof Y & number = Y;', 'var x: typeof Y = Y;', 'var {x}: {x: string; } = { x: "hello" };', ], 'Tuples': [ /* TODO */ ], 'Type Aliases': [ 'type FBID = number;', 'type FBID = number', 'type Arr<T> = Array<T>;', ], 'Interfaces': [ 'interface A {}', 'interface A<T, S> {}', 'interface A { foo: number; }', 'interface A extends B {}', 'interface A extends B, C {}', 'interface A<T> extends B<T> {}', 'class Foo implements Bar {}', 'class Foo extends Bar implements Bat, Man<number> {}', 'class Foo extends class Bar implements Bat {} {}', 'class Foo extends class Bar implements Bat {} implements Man {}', ], 'Array Types': [ 'var x: number[];', 'var x: ?number[];', { content: 'var x: (?number)[];', explanation: 'Flow does not count parens in its locs', expected_differences: { 'root.body.0.declarations.0.id.typeAnnotation.typeAnnotation.loc.start.column': { type: 'Wrong number', expected: 7, actual: 8, }, 'root.body.0.declarations.0.id.typeAnnotation.typeAnnotation.range.0': { type: 'Wrong number', expected: 7, actual: 8, } } }, 'var x: () => number[];', { content: 'var x: (() => number)[];', explanation: 'Flow does not count parens in its locs', expected_differences: { 'root.body.0.declarations.0.id.typeAnnotation.typeAnnotation.loc.start.column': { type: 'Wrong number', expected: 7, actual: 8, }, 'root.body.0.declarations.0.id.typeAnnotation.typeAnnotation.range.0': { type: 'Wrong number', expected: 7, actual: 8, } } }, 'var x: typeof A[];', ], 'Export': { 'options': { sourceType: "module" }, 'tests': [ 'export * from "foo";', 'export * from "foo"', /* This should be supported... 'export {} from "foo";', */ 'export { bar } from "foo";', 'export { bar } from "foo"', 'export { bar, baz } from "foo";', 'export { bar };', /* Esprima should support trailing comma 'export { bar, }', */ 'export { bar, baz };', 'export var x, y', 'export var y = 12', 'export let x, y', 'export let y = 12', 'export const x, y', 'export const y = 12', 'export function foo() {}', 'export class A {}', 'export default 1 + 1;', 'export default 1 + 1', /* Esprima parses default exports wrong 'export default function foo() {}', 'export default function *foo() {}', 'export default class {};', 'export default class A {};', */ ] }, 'Invalid Exports': { 'options': { sourceType: "module" }, 'tests': [ /* Esprima doesn't parse nameless exported classes yet 'export class {}', */ 'export function {}', 'export default function() {}', /* Esprima parses default exports wrong 'export default class A {}', */ ], }, 'Import': { 'options': { sourceType: "module" }, 'tests': [ 'import "MyModule";', 'import defaultbinding from "MyModule";', 'import * as namespace from "MyModule";', 'import {} from "MyModule";', 'import defaultbinding, {} from "MyModule";', /* TODO Esprima should support these 'import {x,} from "MyModule";', 'import defaultbinding, {x,} from "MyModule";', */ 'import {x} from "MyModule";', 'import {x,y} from "MyModule";', 'import {x as z} from "MyModule";', 'import {x, y as z} from "MyModule";', 'import defaultbinding, * as namespace from "MyModule";', 'import defaultbinding, {x} from "MyModule";', 'import defaultbinding, {x,y} from "MyModule";', 'import defaultbinding, {x as z} from "MyModule";', 'import defaultbinding, {x, y as z} from "MyModule";', // These aren't import types 'import type from "MyModule"', 'import type, {} from "MyModule"', 'import type, * as namespace from "MyModule"', // Other pseudo keywords 'import of from "MyModule"', 'import declare from "MyModule"', ], }, 'Import Type': { 'options': { sourceType: "module" }, 'tests': [ 'import type defaultbinding from "MyModule";', 'import type * as namespace from "MyModule";', 'import type {} from "MyModule";', 'import type defaultbinding, {} from "MyModule";', /* TODO Esprima should support these 'import type {x,} from "MyModule";', 'import type defaultbinding, {x,} from "MyModule";', */ 'import type {x} from "MyModule";', 'import type {x,y} from "MyModule";', 'import type {x as z} from "MyModule";', 'import type {x, y as z} from "MyModule";', 'import type defaultbinding, * as namespace from "MyModule";', 'import type defaultbinding, {x} from "MyModule";', 'import type defaultbinding, {x,y} from "MyModule";', 'import type defaultbinding, {x as z} from "MyModule";', 'import type defaultbinding, {x, y as z} from "MyModule";', ], }, 'Import Typeof': { 'options': { sourceType: "module" }, 'tests': [ 'import typeof defaultbinding from "MyModule";', 'import typeof {} from "MyModule";', 'import typeof defaultbinding, {} from "MyModule";', /* TODO Esprima should support these 'import typeof {x,} from "MyModule";', 'import typeof defaultbinding, {x,} from "MyModule";', */ 'import typeof {x} from "MyModule";', 'import typeof {x,y} from "MyModule";', 'import typeof {x as z} from "MyModule";', 'import typeof {x, y as z} from "MyModule";', 'import typeof defaultbinding, {x} from "MyModule";', 'import typeof defaultbinding, {x,y} from "MyModule";', 'import typeof defaultbinding, {x as z} from "MyModule";', 'import typeof defaultbinding, {x, y as z} from "MyModule";', ], }, 'Declare Statements': [ 'declare var foo', 'declare var foo;', 'declare var foo: number;', 'declare function foo(): void', 'declare function foo(): void;', 'declare function foo<T>(): void;', 'declare function foo(x: number, y: string): void;', 'declare class A {}', 'declare class A<T> extends B<T> { x: number }', 'declare class A { static foo(): number; static x : string }', 'declare class A { static [ indexer: number]: string }', 'declare class A { static () : number }', ], 'Invalid Declare Statements': [ 'declare class A { "static" foo(): number }', 'declare class A { static : number }', 'declare function foo();', 'declare function foo(x): void', ], 'Declare Module': [ 'declare module A {}', 'declare module "./a/b.js" {}', 'declare module A { declare var x: number; }', 'declare module A { declare function foo(): number; }', 'declare module A { declare class B { foo(): number; } }', ], 'Invalid Declare Module': [ 'declare Module A {}', 'declare module {}', '"use strict"; declare module "\\01" {}', { content: 'declare module A { declare module B {} }', explanation: "We realize the error as soon as we hit the second "+ "module keyword", expected_differences: { 'root.errors.0.column': { type: 'Wrong error column', expected: 19, actual: '27-33' } } }, { content: 'declare module A { export default 1 +1; }', explanation: 'export is no longer a future reserved word', expected_differences: { 'root.errors.0.message': { type: 'Wrong error message', expected: 'Unexpected reserved word', actual: 'Unexpected token export', }, }, }, ], 'Type Grouping': [ 'var a: (number)', { content: 'var a: (() => number) | () => string', explanation: 'Esprima counts the parens in the type locs', expected_differences: { 'root.body.0.declarations.0.id.typeAnnotation.typeAnnotation.range.0': { type: 'Wrong number', expected: 7, actual: 8 }, 'root.body.0.declarations.0.id.typeAnnotation.typeAnnotation.loc.start.column': { type: 'Wrong number', expected: 7, actual: 8 } } }, 'var a: (A | B)', { content: 'var a: number & (string | bool)', explanation: 'Esprima counts the parens in the type locs', expected_differences: { 'root.body.0.declarations.0.id.typeAnnotation.typeAnnotation.range.1': { type: 'Wrong number', expected: 31, actual: 30 }, 'root.body.0.declarations.0.id.typeAnnotation.typeAnnotation.loc.end.column': { type: 'Wrong number', expected: 31, actual: 30, } } }, 'var a: (typeof A)', 'var a: Array<(number)>', 'var a: ([]) = []', 'var a: (A)', 'var a: (A.B)', 'var a: (A<T>)', 'var a: (A | B)', 'var a: (A & B)', ], 'Typecasts': [ { content: '(xxx: number)', explanation: 'Esprima counts the parens in its locs', expected_differences: { 'root.body.0.range.0': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.body.0.range.1': { type: 'Wrong number', expected: 13, actual: 12 }, 'root.body.0.loc.start.column': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.body.0.loc.end.column': { type: 'Wrong number', expected: 13, actual: 12 }, 'root.range.0': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.range.1': { type: 'Wrong number', expected: 13, actual: 12 }, 'root.loc.start.column': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.loc.end.column': { type: 'Wrong number', expected: 13, actual: 12 }, } }, { content: '({xxx: 0, yyy: "hey"}: {xxx: number; yyy: string})', explanation: 'Esprima counts the parens in its locs', expected_differences: { 'root.body.0.range.0': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.body.0.range.1': { type: 'Wrong number', expected: 50, actual: 49 }, 'root.body.0.loc.start.column': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.body.0.loc.end.column': { type: 'Wrong number', expected: 50, actual: 49 }, 'root.range.0': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.range.1': { type: 'Wrong number', expected: 50, actual: 49 }, 'root.loc.start.column': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.loc.end.column': { type: 'Wrong number', expected: 50, actual: 49 }, } }, // distinguish between function type params and typecasts { content: '((xxx) => xxx + 1: (xxx: number) => number)', explanation: 'Esprima counts the parens in its locs', expected_differences: { 'root.body.0.range.0': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.body.0.range.1': { type: 'Wrong number', expected: 43, actual: 42 }, 'root.body.0.loc.start.column': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.body.0.loc.end.column': { type: 'Wrong number', expected: 43, actual: 42 }, 'root.range.0': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.range.1': { type: 'Wrong number', expected: 43, actual: 42 }, 'root.loc.start.column': { type: 'Wrong number', expected: 0, actual: 1 }, 'root.loc.end.column': { type: 'Wrong number', expected: 43, actual: 42 }, } }, // parens disambiguate groups from casts { content: '((xxx: number), (yyy: string))', explanation: 'Esprima counts the parens in its locs', expected_differences: { 'root.body.0.expression.range.0': { type: 'Wrong number', expected: 1, actual: 2 }, 'root.body.0.expression.range.1': { type: 'Wrong number', expected: 29, actual: 28 }, 'root.body.0.expression.loc.start.column': { type: 'Wrong number', expected: 1, actual: 2 }, 'root.body.0.expression.loc.end.column': { type: 'Wrong number', expected: 29, actual: 28 }, 'root.body.0.range.0': { type: 'Wrong number', expected: 0, actual: 2 }, 'root.body.0.range.1': { type: 'Wrong number', expected: 30, actual: 28 }, 'root.body.0.loc.start.column': { type: 'Wrong number', expected: 0, actual: 2 }, 'root.body.0.loc.end.column': { type: 'Wrong number', expected: 30, actual: 28 }, 'root.range.0': { type: 'Wrong number', expected: 0, actual: 2 }, 'root.range.1': { type: 'Wrong number', expected: 30, actual: 28 }, 'root.loc.start.column': { type: 'Wrong number', expected: 0, actual: 2 }, 'root.loc.end.column': { type: 'Wrong number', expected: 30, actual: 28 }, } }, ], 'Invalid Typecasts': [ // Must be parenthesized 'var x: number = 0: number;', // ...even within groups '(xxx: number, yyy: string)' ], 'Bounded Polymorphism': [ 'function foo<T: Foo>() {}', 'class Foo<T: Bar> {}', ], 'For Of Loops': [ 'for(x of list) process(x);', 'for (var x of list) process(x);', 'for (let x of list) process(x);', ], 'Invalid For Of Loops': [ { content: 'for (let x = 42 of list) process(x);', explanation: 'Exprima is off by one here location-wise '+ 'and I like my error here better', expected_differences: { 'root.errors.0.column': { type: 'Wrong error column', expected: 16, actual: '5-15', } , 'root.errors.0.message': { type: 'Wrong error message', expected: 'Unexpected identifier', actual: 'Invalid left-hand side in for-of', } } }, ], 'Async/Await': [ 'try { foo(); } catch (async) { bar(); }', 'try { foo(); } catch (await) { bar(); }', 'var x = { async() { bar(); }}', 'var x = { set async(v) { }, get async() { return "foo";}, }', 'var x = { set await(v) { }, get await() { return "foo";}, }', 'class async { }', 'class async { async() { } }', 'class async { async async() { await foo; } }', 'class await { await() { } }', 'class A { set async(v) { } get async() { return "foo";} }', 'class A { set await(v) { } get await() { return "foo";} }', { content: 'y = async function() { return await bar; } ()', explanation: 'Babel has no problem with this, and it seems ' + 'perfectly sensical', expected_differences: { 'root.errors': { type: 'Flow found no error', expected: 'Line 1: Unexpected token (', actual: undefined, }, }, }, 'async function f() { return 1; }', 'async function foo() { await 1; }', 'var x = { async m() { await 1; } };', 'function async() { }', 'async function foo() { return function await() { }; }', { content: 'async function foo() { return await foo + await bar + 5; }', explanation: 'Works in Babel and the spec appears to allow it', expected_differences: { 'root.errors': { type: 'Flow found no error', expected: 'Line 1: Unexpected identifier', actual: undefined, }, }, }, 'async function foo() { var await = 4; }', 'var x = async function bar() { await foo; }', 'async function foo() { return await; }', 'var x = async (a, b) => await a;', 'var x = async a => await a;', 'foo(async () => await bar);', 'var x = async\ny => y', 'class A { async bar() { await foo; } }', ], } };
OCamlPro/flow
src/parser/test/esprima_tests.js
JavaScript
bsd-3-clause
172,742
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef SYNC_INTERNAL_API_JS_SYNC_MANAGER_OBSERVER_H_ #define SYNC_INTERNAL_API_JS_SYNC_MANAGER_OBSERVER_H_ #include <string> #include "base/basictypes.h" #include "base/compiler_specific.h" #include "sync/internal_api/public/sync_manager.h" #include "sync/internal_api/public/util/weak_handle.h" #include "sync/protocol/sync_protocol_error.h" namespace tracked_objects { class Location; } // namespace tracked_objects namespace syncer { class JsEventDetails; class JsEventHandler; // Routes SyncManager events to a JsEventHandler. class JsSyncManagerObserver : public SyncManager::Observer { public: JsSyncManagerObserver(); virtual ~JsSyncManagerObserver(); void SetJsEventHandler(const WeakHandle<JsEventHandler>& event_handler); // SyncManager::Observer implementation. virtual void OnSyncCycleCompleted( const sessions::SyncSessionSnapshot& snapshot) OVERRIDE; virtual void OnConnectionStatusChange(ConnectionStatus status) OVERRIDE; virtual void OnUpdatedToken(const std::string& token) OVERRIDE; virtual void OnPassphraseRequired( PassphraseRequiredReason reason, const sync_pb::EncryptedData& pending_keys) OVERRIDE; virtual void OnPassphraseAccepted() OVERRIDE; virtual void OnBootstrapTokenUpdated( const std::string& bootstrap_token) OVERRIDE; virtual void OnEncryptedTypesChanged( ModelTypeSet encrypted_types, bool encrypt_everything) OVERRIDE; virtual void OnEncryptionComplete() OVERRIDE; virtual void OnInitializationComplete( const WeakHandle<JsBackend>& js_backend, bool success) OVERRIDE; virtual void OnStopSyncingPermanently() OVERRIDE; virtual void OnActionableError( const SyncProtocolError& sync_protocol_error) OVERRIDE; private: void HandleJsEvent(const tracked_objects::Location& from_here, const std::string& name, const JsEventDetails& details); WeakHandle<JsEventHandler> event_handler_; DISALLOW_COPY_AND_ASSIGN(JsSyncManagerObserver); }; } // namespace syncer #endif // SYNC_INTERNAL_API_JS_SYNC_MANAGER_OBSERVER_H_
keishi/chromium
sync/internal_api/js_sync_manager_observer.h
C
bsd-3-clause
2,240
(function() { 'use strict'; Polymer({ is: 'fields-list', properties:{ fields: { type: Array, notify: true } }, _queryFilter: function(query){ return function(field){ if (!query) return true; if (!field) return false; return (field.name && ~field.name.indexOf(query)); }; } }); })();
n8m/polytest
app/elements/fields-list/fields-list.js
JavaScript
bsd-3-clause
375
<!DOCTYPE html> <!-- Copyright (c) 2015 Intel Corporation. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of works must retain the original copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the original copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of Intel Corporation nor the names of its contributors may be used to endorse or promote products derived from this work without specific prior written permission. THIS SOFTWARE IS PROVIDED BY INTEL CORPORATION "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL CORPORATION BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Authors: Wang, Hongjuan <[email protected]> --> <meta charset="utf-8" /> <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, width=device-width"> <link rel="stylesheet" type="text/css" href="../../css/bootstrap.css"> <link rel="stylesheet" type="text/css" href="../../css/main.css"> <script src="../../js/jquery-2.1.3.min.js"></script> <script src="../../js/bootstrap.min.js"></script> <script src="../../js/common.js"></script> <script src="../../js/tests.js"></script> <div id="header"> <h3 id="main_page_title"></h3> </div> <div class="content"> <h4>Pre-condition</h4> <ol> <li>Build a webapp with below command:<br/> $ python [path]/make_apk.py --package=[package] --app-url=https://crosswalk-project.org/ --name=[name] --mode=shared<br/> Then install and launch it </li> </ol> <h4>Test Steps</h4> <ol> <li>Click "Get Crosswalk", check the launching screen</li> <li>Check the status of install crosswalk runtime library, click "Done" to complete installation process</li> <li>Check the display content of the launched test app</li> </ol> <ul> <li>Note: In formal test process, when click "Get Crosswalk" button, it should launch a Google Play or third party app store on Android, or even launch an app store selector (if there are two or more app stores were installed on device) for user to select one to download Crosswalk Runtime Library</li> </ul> </div> <div class="footer"> <div id="footer"></div> </div> <div class="modal fade" id="popup_info"> </div>
jacky-young/crosswalk-test-suite
usecase/usecase-wrt-android-tests/samples/SharedModeGooglePlay/index.html
HTML
bsd-3-clause
3,008
// Copyright 2019 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. /** * @fileoverview Polymer element for displaying ARC ADB sideloading screen. */ // The constants need to be synced with EnableAdbSideloadingScreenView::UIState. const ADB_SIDELOADING_SCREEN_STATE = { ERROR: 1, SETUP: 2, }; Polymer({ is: 'oobe-adb-sideloading-screen', behaviors: [OobeI18nBehavior, OobeDialogHostBehavior, LoginScreenBehavior], properties: { uiState_: String, }, EXTERNAL_API: [ 'setScreenState', ], ready() { this.initializeLoginScreen('EnableAdbSideloadingScreen', { noAnimatedTransition: true, resetAllowed: true, }); this.setScreenState(this.SCREEN_STATE_SETUP); }, focus() { if (this.uiState_ === ADB_SIDELOADING_SCREEN_STATE.SETUP) { this.$.enableAdbSideloadDialog.focus(); } else if (this.uiState_ === ADB_SIDELOADING_SCREEN_STATE.ERROR) { this.$.enableAdbSideloadErrorDialog.focus(); } }, /* * Executed on language change. */ updateLocalizedContent() { this.i18nUpdateLocale(); }, onBeforeShow(data) { this.behaviors.forEach((behavior) => { if (behavior.onBeforeShow) behavior.onBeforeShow.call(this); }); this.setScreenState(this.SCREEN_STATE_SETUP); }, /** * Sets UI state for the dialog to show corresponding content. * @param {ADB_SIDELOADING_SCREEN_STATE} state. */ setScreenState(state) { if (state == ADB_SIDELOADING_SCREEN_STATE.ERROR) { this.uiState_ = 'error'; } else if (state == ADB_SIDELOADING_SCREEN_STATE.SETUP) { this.uiState_ = 'setup'; } }, isState_(uiState, state) { return uiState === state; }, /** * On-tap event handler for enable button. * * @private */ onEnableTap_() { this.userActed('enable-pressed'); }, /** * On-tap event handler for cancel button. * * @private */ onCancelTap_() { this.userActed('cancel-pressed'); }, /** * On-tap event handler for learn more link. * * @private */ onLearnMoreTap_() { this.userActed('learn-more-link'); }, });
endlessm/chromium-browser
chrome/browser/resources/chromeos/login/oobe_adb_sideloading_screen.js
JavaScript
bsd-3-clause
2,221
<?php namespace common\behaviors; use yii\db\Expression; use yii\db\BaseActiveRecord; use yii\behaviors\AttributeBehavior; class TimestampBehavior extends AttributeBehavior { public $createdAtAttribute = 'created_at'; public $updatedAtAttribute = 'updated_at'; public $value; /** * @inheritdoc */ public function init() { parent::init(); if (empty($this->attributes)) { $this->attributes = [ BaseActiveRecord::EVENT_BEFORE_INSERT => [$this->createdAtAttribute, $this->updatedAtAttribute], BaseActiveRecord::EVENT_BEFORE_UPDATE => $this->updatedAtAttribute, ]; } } public function events() { return parent::events(); // TODO: Change the autogenerated stub } /** * @param \yii\base\Event $event * @return int|mixed|Expression */ protected function getValue($event) { if ($this->value instanceof Expression) { return $this->value; } else { return $this->value !== null ? call_user_func($this->value, $event) : date('Y-m-d H:i:s', time()); } } }
bactv/olympia_project
common/behaviors/TimestampBehavior.php
PHP
bsd-3-clause
1,166
<?php return array ( 'Friendship Approved' => 'Freundschaftsanfrage Bestätigt', );
LeonidLyalin/vova
common/humhub/protected/humhub/modules/friendship/messages/de/notifications_RequestApproved.php
PHP
bsd-3-clause
86
/* * Copyright (c) 1997 - 2015 * Actelion Pharmaceuticals Ltd. * Gewerbestrasse 16 * CH-4123 Allschwil, Switzerland * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, this * list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. Neither the name of the the copyright holder nor the * names of its contributors may be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ package com.actelion.research.chem.reaction; import com.actelion.research.chem.SSSearcher; public interface IReactionMapper { Reaction matchReaction(Reaction r, SSSearcher sss); }
egonw/openchemlib
src/com/actelion/research/chem/reaction/IReactionMapper.java
Java
bsd-3-clause
1,822
/* * Copyright (C) 2011 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "modules/webgl/WebGLContextObject.h" #include "modules/webgl/WebGLRenderingContextBase.h" namespace blink { WebGLContextObject::WebGLContextObject(WebGLRenderingContextBase* context) : WebGLObject(context) , m_context(context) { } WebGLContextObject::~WebGLContextObject() { #if !ENABLE(OILPAN) if (m_context) m_context->removeContextObject(this); #endif } void WebGLContextObject::detachContext() { detach(); if (m_context) { deleteObject(m_context->contextGL()); m_context->removeContextObject(this); m_context = nullptr; } } gpu::gles2::GLES2Interface* WebGLContextObject::getAGLInterface() const { return m_context->contextGL(); } DEFINE_TRACE(WebGLContextObject) { visitor->trace(m_context); WebGLObject::trace(visitor); } } // namespace blink
was4444/chromium.src
third_party/WebKit/Source/modules/webgl/WebGLContextObject.cpp
C++
bsd-3-clause
2,186
//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- // // perforce_result.h // //------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- // Copyright (c) Wargaming.net. All rights reserved. //------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- #ifndef PERFORCE_RESULT_H_ #define PERFORCE_RESULT_H_ #pragma once #include "version_control/i_result.hpp" namespace wgt { class PerforceResult : public IResult { public: PerforceResult(const char* output, const char* errors, AttributeResults&& results = AttributeResults()); virtual const char* errors() const override; virtual const char* output() const override; virtual const AttributeResults& results() const override; private: std::string output_; std::string errors_; AttributeResults results_; }; class MultiResult : public IResult { public: void appendResult(IResultPtr result); virtual const char* errors() const override; virtual const char* output() const override; virtual const AttributeResults& results() const override; private: std::vector<IResultPtr> results_; mutable std::string output_; mutable std::string errors_; mutable AttributeResults attributeResults_; }; } // end namespace wgt #endif // PERFORCE_RESULT_H_
wgsyd/wgtf
src/core/plugins/plg_perforce/perforce_result.hpp
C++
bsd-3-clause
1,577
// Copyright 2018 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef BASE_TRACE_EVENT_CFI_BACKTRACE_ANDROID_H_ #define BASE_TRACE_EVENT_CFI_BACKTRACE_ANDROID_H_ #include <memory> #include "base/base_export.h" #include "base/debug/debugging_buildflags.h" #include "base/files/memory_mapped_file.h" #include "base/gtest_prod_util.h" #include "base/threading/thread_local_storage.h" #include "starboard/types.h" namespace base { namespace trace_event { // This class is used to unwind stack frames in the current thread. The unwind // information (dwarf debug info) is stripped from the chrome binary and we do // not build with exception tables (ARM EHABI) in release builds. So, we use a // custom unwind table which is generated and added to specific android builds, // when add_unwind_tables_in_apk build option is specified. This unwind table // contains information for unwinding stack frames when the functions calls are // from lib[mono]chrome.so. The file is added as an asset to the apk and the // table is used to unwind stack frames for profiling. This class implements // methods to read and parse the unwind table and unwind stack frames using this // data. class BASE_EXPORT CFIBacktraceAndroid { public: // Creates and initializes by memory mapping the unwind tables from apk assets // on first call. static CFIBacktraceAndroid* GetInitializedInstance(); // Returns true if the given program counter |pc| is mapped in chrome library. static bool is_chrome_address(uintptr_t pc) { return pc >= executable_start_addr() && pc < executable_end_addr(); } // Returns the start and end address of the current library. static uintptr_t executable_start_addr(); static uintptr_t executable_end_addr(); // Returns true if stack unwinding is possible using CFI unwind tables in apk. // There is no need to check this before each unwind call. Will always return // the same value based on CFI tables being present in the binary. bool can_unwind_stack_frames() const { return can_unwind_stack_frames_; } // Returns the program counters by unwinding stack in the current thread in // order of latest call frame first. Unwinding works only if // can_unwind_stack_frames() returns true. This function allocates memory from // heap for cache on the first call of the calling thread, unless // AllocateCacheForCurrentThread() is called from the thread. For each stack // frame, this method searches through the unwind table mapped in memory to // find the unwind information for function and walks the stack to find all // the return address. This only works until the last function call from the // chrome.so. We do not have unwind information to unwind beyond any frame // outside of chrome.so. Calls to Unwind() are thread safe and lock free, once // Initialize() returns success. size_t Unwind(const void** out_trace, size_t max_depth); // Same as above function, but starts from a given program counter |pc| and // stack pointer |sp|. This can be from current thread or any other thread. // But the caller must make sure that the thread's stack segment is not racy // to read. size_t Unwind(uintptr_t pc, uintptr_t sp, const void** out_trace, size_t max_depth); // Allocates memory for CFI cache for the current thread so that Unwind() // calls are safe for signal handlers. void AllocateCacheForCurrentThread(); // The CFI information that correspond to an instruction. struct CFIRow { bool operator==(const CFIBacktraceAndroid::CFIRow& o) const { return cfa_offset == o.cfa_offset && ra_offset == o.ra_offset; } // The offset of the call frame address of previous function from the // current stack pointer. Rule for unwinding SP: SP_prev = SP_cur + // cfa_offset. uint16_t cfa_offset = 0; // The offset of location of return address from the previous call frame // address. Rule for unwinding PC: PC_prev = * (SP_prev - ra_offset). uint16_t ra_offset = 0; }; // Finds the CFI row for the given |func_addr| in terms of offset from // the start of the current binary. Concurrent calls are thread safe. bool FindCFIRowForPC(uintptr_t func_addr, CFIRow* out); private: FRIEND_TEST_ALL_PREFIXES(CFIBacktraceAndroidTest, TestCFICache); FRIEND_TEST_ALL_PREFIXES(CFIBacktraceAndroidTest, TestFindCFIRow); FRIEND_TEST_ALL_PREFIXES(CFIBacktraceAndroidTest, TestUnwinding); // A simple cache that stores entries in table using prime modulo hashing. // This cache with 500 entries already gives us 95% hit rate, and fits in a // single system page (usually 4KiB). Using a thread local cache for each // thread gives us 30% improvements on performance of heap profiling. class CFICache { public: // Add new item to the cache. It replaces an existing item with same hash. // Constant time operation. void Add(uintptr_t address, CFIRow cfi); // Finds the given address and fills |cfi| with the info for the address. // returns true if found, otherwise false. Assumes |address| is never 0. bool Find(uintptr_t address, CFIRow* cfi); private: FRIEND_TEST_ALL_PREFIXES(CFIBacktraceAndroidTest, TestCFICache); // Size is the highest prime which fits the cache in a single system page, // usually 4KiB. A prime is chosen to make sure addresses are hashed evenly. static const int kLimit = 509; struct AddrAndCFI { uintptr_t address; CFIRow cfi; }; AddrAndCFI cache_[kLimit] = {}; }; static_assert(sizeof(CFIBacktraceAndroid::CFICache) < 4096, "The cache does not fit in a single page."); CFIBacktraceAndroid(); ~CFIBacktraceAndroid(); // Initializes unwind tables using the CFI asset file in the apk if present. // Also stores the limits of mapped region of the lib[mono]chrome.so binary, // since the unwind is only feasible for addresses within the .so file. Once // initialized, the memory map of the unwind table is never cleared since we // cannot guarantee that all the threads are done using the memory map when // heap profiling is turned off. But since we keep the memory map is clean, // the system can choose to evict the unused pages when needed. This would // still reduce the total amount of address space available in process. void Initialize(); // Finds the UNW_INDEX and UNW_DATA tables in from the CFI file memory map. void ParseCFITables(); CFICache* GetThreadLocalCFICache(); // The start address of the memory mapped unwind table asset file. Unique ptr // because it is replaced in tests. std::unique_ptr<MemoryMappedFile> cfi_mmap_; // The UNW_INDEX table: Start address of the function address column. The // memory segment corresponding to this column is treated as an array of // uintptr_t. const uintptr_t* unw_index_function_col_ = nullptr; // The UNW_INDEX table: Start address of the index column. The memory segment // corresponding to this column is treated as an array of uint16_t. const uint16_t* unw_index_indices_col_ = nullptr; // The number of rows in UNW_INDEX table. size_t unw_index_row_count_ = 0; // The start address of UNW_DATA table. const uint16_t* unw_data_start_addr_ = nullptr; bool can_unwind_stack_frames_ = false; ThreadLocalStorage::Slot thread_local_cfi_cache_; }; } // namespace trace_event } // namespace base #endif // BASE_TRACE_EVENT_CFI_BACKTRACE_ANDROID_H_
youtube/cobalt
base/trace_event/cfi_backtrace_android.h
C
bsd-3-clause
7,580
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>lib&#x2F;yui3&#x2F;src&#x2F;yui&#x2F;js&#x2F;yui-array.js - AlloyUI</title> <link rel="stylesheet" href="http:&#x2F;&#x2F;yui.yahooapis.com&#x2F;3.4.0&#x2F;build&#x2F;cssgrids&#x2F;cssgrids-min.css"> <link rel="stylesheet" href="..&#x2F;assets/../../build/aui-skin-classic/css/aui-skin-classic-all-min.css"> <link rel="stylesheet" href="..&#x2F;assets/vendor/prettify/prettify-min.css"> <link rel="stylesheet" href="..&#x2F;assets/css/main.css" id="site_styles"> <script src="..&#x2F;assets/../../build/aui/aui.js"></script> </head> <body class="yui3-skin-sam"> <div id="doc"> <div id="hd" class="yui3-g header"> <div class="yui3-u-3-4"> <h1><img src="..&#x2F;assets/css/logo_small.png"></h1> </div> <div class="yui3-u-1-4 version"> <div class="version-details"> <span class="version-lib">AlloyUI 1.7.0</span> <div class="yui-version"> <span class="version-lib version-lib-yui">YUI 3.7.3</span> </div> </div> </div> </div> <div id="bd" class="yui3-g"> <div class="yui3-u-1-4"> <div id="docs-sidebar" class="sidebar apidocs"> <div id="api-list"> <h2 class="off-left">APIs</h2> <div id="api-tabview" class="tabview"> <ul class="aui-tabview-list aui-widget-hd tabs" id="api-tabview-list"> <li class="aui-tab"><a class="aui-tab-label" href="#api-classes">Classes</a></li> <li class="aui-tab"><a class="aui-tab-label" href="#api-modules">Modules</a></li> <li class="aui-tab"><a class="aui-tab-label" href="#api-everything">Everything</a></li> </ul> <div id="api-tabview-filter"> <input type="search" id="api-filter" placeholder="Type to filter APIs"> </div> <div class="aui-tabview-content aui-widget-bd" id="api-tabview-panel"> <ul id="api-classes" class="apis classes aui-tabview-content-item"> <li><a href="..&#x2F;classes/A.DataType.DateMath.html">A.DataType.DateMath</a></li> <li><a href="..&#x2F;classes/A.HTML5.html">A.HTML5</a></li> <li><a href="..&#x2F;classes/A.io.html">A.io</a></li> <li><a href="..&#x2F;classes/A.Node.html">A.Node</a></li> <li><a href="..&#x2F;classes/A.NodeList.html">A.NodeList</a></li> <li><a href="..&#x2F;classes/A.Plugin.IO.html">A.Plugin.IO</a></li> <li><a href="..&#x2F;classes/Anim.html">Anim</a></li> <li><a href="..&#x2F;classes/App.html">App</a></li> <li><a href="..&#x2F;classes/App.Base.html">App.Base</a></li> <li><a href="..&#x2F;classes/App.Content.html">App.Content</a></li> <li><a href="..&#x2F;classes/App.Transitions.html">App.Transitions</a></li> <li><a href="..&#x2F;classes/App.TransitionsNative.html">App.TransitionsNative</a></li> <li><a href="..&#x2F;classes/AreaSeries.html">AreaSeries</a></li> <li><a href="..&#x2F;classes/AreaSplineSeries.html">AreaSplineSeries</a></li> <li><a href="..&#x2F;classes/Array.html">Array</a></li> <li><a href="..&#x2F;classes/ArrayList.html">ArrayList</a></li> <li><a href="..&#x2F;classes/ArraySort.html">ArraySort</a></li> <li><a href="..&#x2F;classes/AsyncQueue.html">AsyncQueue</a></li> <li><a href="..&#x2F;classes/Attribute.html">Attribute</a></li> <li><a href="..&#x2F;classes/AttributeCore.html">AttributeCore</a></li> <li><a href="..&#x2F;classes/AttributeEvents.html">AttributeEvents</a></li> <li><a href="..&#x2F;classes/AttributeExtras.html">AttributeExtras</a></li> <li><a href="..&#x2F;classes/AttributeLite.html">AttributeLite</a></li> <li><a href="..&#x2F;classes/AUI~event~input.html">AUI~event~input</a></li> <li><a href="..&#x2F;classes/AutoComplete.html">AutoComplete</a></li> <li><a href="..&#x2F;classes/AutoCompleteBase.html">AutoCompleteBase</a></li> <li><a href="..&#x2F;classes/AutoCompleteFilters.html">AutoCompleteFilters</a></li> <li><a href="..&#x2F;classes/AutoCompleteHighlighters.html">AutoCompleteHighlighters</a></li> <li><a href="..&#x2F;classes/AutoCompleteList.html">AutoCompleteList</a></li> <li><a href="..&#x2F;classes/Axis.html">Axis</a></li> <li><a href="..&#x2F;classes/AxisType.html">AxisType</a></li> <li><a href="..&#x2F;classes/BarSeries.html">BarSeries</a></li> <li><a href="..&#x2F;classes/Base.html">Base</a></li> <li><a href="..&#x2F;classes/BaseCellEditor.html">BaseCellEditor</a></li> <li><a href="..&#x2F;classes/BaseCore.html">BaseCore</a></li> <li><a href="..&#x2F;classes/BaseOptionsCellEditor.html">BaseOptionsCellEditor</a></li> <li><a href="..&#x2F;classes/BottomAxisLayout.html">BottomAxisLayout</a></li> <li><a href="..&#x2F;classes/Button.html">Button</a></li> <li><a href="..&#x2F;classes/ButtonCore.html">ButtonCore</a></li> <li><a href="..&#x2F;classes/ButtonGroup.html">ButtonGroup</a></li> <li><a href="..&#x2F;classes/ButtonItem.html">ButtonItem</a></li> <li><a href="..&#x2F;classes/ButtonPlugin.html">ButtonPlugin</a></li> <li><a href="..&#x2F;classes/Cache.html">Cache</a></li> <li><a href="..&#x2F;classes/CacheOffline.html">CacheOffline</a></li> <li><a href="..&#x2F;classes/Calendar.html">Calendar</a></li> <li><a href="..&#x2F;classes/CalendarBase.html">CalendarBase</a></li> <li><a href="..&#x2F;classes/CanvasCircle.html">CanvasCircle</a></li> <li><a href="..&#x2F;classes/CanvasDrawing.html">CanvasDrawing</a></li> <li><a href="..&#x2F;classes/CanvasEllipse.html">CanvasEllipse</a></li> <li><a href="..&#x2F;classes/CanvasGraphic.html">CanvasGraphic</a></li> <li><a href="..&#x2F;classes/CanvasPath.html">CanvasPath</a></li> <li><a href="..&#x2F;classes/CanvasPieSlice.html">CanvasPieSlice</a></li> <li><a href="..&#x2F;classes/CanvasRect.html">CanvasRect</a></li> <li><a href="..&#x2F;classes/CanvasShape.html">CanvasShape</a></li> <li><a href="..&#x2F;classes/Carousel.html">Carousel</a></li> <li><a href="..&#x2F;classes/CartesianChart.html">CartesianChart</a></li> <li><a href="..&#x2F;classes/CartesianSeries.html">CartesianSeries</a></li> <li><a href="..&#x2F;classes/CategoryAxis.html">CategoryAxis</a></li> <li><a href="..&#x2F;classes/CellEditorSupport.html">CellEditorSupport</a></li> <li><a href="..&#x2F;classes/CharCounter.html">CharCounter</a></li> <li><a href="..&#x2F;classes/Chart.html">Chart</a></li> <li><a href="..&#x2F;classes/ChartBase.html">ChartBase</a></li> <li><a href="..&#x2F;classes/ChartLegend.html">ChartLegend</a></li> <li><a href="..&#x2F;classes/CheckboxCellEditor.html">CheckboxCellEditor</a></li> <li><a href="..&#x2F;classes/Circle.html">Circle</a></li> <li><a href="..&#x2F;classes/CircleGroup.html">CircleGroup</a></li> <li><a href="..&#x2F;classes/ClassNameManager.html">ClassNameManager</a></li> <li><a href="..&#x2F;classes/ClickableRail.html">ClickableRail</a></li> <li><a href="..&#x2F;classes/ColorPicker.html">ColorPicker</a></li> <li><a href="..&#x2F;classes/ColumnSeries.html">ColumnSeries</a></li> <li><a href="..&#x2F;classes/ComboSeries.html">ComboSeries</a></li> <li><a href="..&#x2F;classes/ComboSplineSeries.html">ComboSplineSeries</a></li> <li><a href="..&#x2F;classes/Component.html">Component</a></li> <li><a href="..&#x2F;classes/config.html">config</a></li> <li><a href="..&#x2F;classes/Console.html">Console</a></li> <li><a href="..&#x2F;classes/Controller.html">Controller</a></li> <li><a href="..&#x2F;classes/Cookie.html">Cookie</a></li> <li><a href="..&#x2F;classes/CurveUtil.html">CurveUtil</a></li> <li><a href="..&#x2F;classes/CustomEvent.html">CustomEvent</a></li> <li><a href="..&#x2F;classes/DataSchema.Array.html">DataSchema.Array</a></li> <li><a href="..&#x2F;classes/DataSchema.Base.html">DataSchema.Base</a></li> <li><a href="..&#x2F;classes/DataSchema.JSON.html">DataSchema.JSON</a></li> <li><a href="..&#x2F;classes/DataSchema.Text.html">DataSchema.Text</a></li> <li><a href="..&#x2F;classes/DataSchema.XML.html">DataSchema.XML</a></li> <li><a href="..&#x2F;classes/DataSource.Function.html">DataSource.Function</a></li> <li><a href="..&#x2F;classes/DataSource.Get.html">DataSource.Get</a></li> <li><a href="..&#x2F;classes/DataSource.IO.html">DataSource.IO</a></li> <li><a href="..&#x2F;classes/DataSource.Local.html">DataSource.Local</a></li> <li><a href="..&#x2F;classes/DataSourceArraySchema.html">DataSourceArraySchema</a></li> <li><a href="..&#x2F;classes/DataSourceCache.html">DataSourceCache</a></li> <li><a href="..&#x2F;classes/DataSourceCacheExtension.html">DataSourceCacheExtension</a></li> <li><a href="..&#x2F;classes/DataSourceJSONSchema.html">DataSourceJSONSchema</a></li> <li><a href="..&#x2F;classes/DataSourceTextSchema.html">DataSourceTextSchema</a></li> <li><a href="..&#x2F;classes/DataSourceXMLSchema.html">DataSourceXMLSchema</a></li> <li><a href="..&#x2F;classes/DataTable.html">DataTable</a></li> <li><a href="..&#x2F;classes/DataTable.Base.html">DataTable.Base</a></li> <li><a href="..&#x2F;classes/DataTable.BodyView.html">DataTable.BodyView</a></li> <li><a href="..&#x2F;classes/DataTable.ColumnWidths.html">DataTable.ColumnWidths</a></li> <li><a href="..&#x2F;classes/DataTable.Core.html">DataTable.Core</a></li> <li><a href="..&#x2F;classes/DataTable.HeaderView.html">DataTable.HeaderView</a></li> <li><a href="..&#x2F;classes/DataTable.Message.html">DataTable.Message</a></li> <li><a href="..&#x2F;classes/DataTable.Mutable.html">DataTable.Mutable</a></li> <li><a href="..&#x2F;classes/DataTable.Scrollable.html">DataTable.Scrollable</a></li> <li><a href="..&#x2F;classes/DataTable.Sortable.html">DataTable.Sortable</a></li> <li><a href="..&#x2F;classes/DataTable.TableView.html">DataTable.TableView</a></li> <li><a href="..&#x2F;classes/DataType.Boolean.html">DataType.Boolean</a></li> <li><a href="..&#x2F;classes/DataType.Date.Locale.html">DataType.Date.Locale</a></li> <li><a href="..&#x2F;classes/DataType.String.html">DataType.String</a></li> <li><a href="..&#x2F;classes/Date.html">Date</a></li> <li><a href="..&#x2F;classes/DateCellEditor.html">DateCellEditor</a></li> <li><a href="..&#x2F;classes/DatepickerManager.html">DatepickerManager</a></li> <li><a href="..&#x2F;classes/DatePickerSelect.html">DatePickerSelect</a></li> <li><a href="..&#x2F;classes/DD.DDM.html">DD.DDM</a></li> <li><a href="..&#x2F;classes/DD.Delegate.html">DD.Delegate</a></li> <li><a href="..&#x2F;classes/DD.Drag.html">DD.Drag</a></li> <li><a href="..&#x2F;classes/DD.Drop.html">DD.Drop</a></li> <li><a href="..&#x2F;classes/DD.Scroll.html">DD.Scroll</a></li> <li><a href="..&#x2F;classes/DelayedTask.html">DelayedTask</a></li> <li><a href="..&#x2F;classes/Dial.html">Dial</a></li> <li><a href="..&#x2F;classes/Dialog.html">Dialog</a></li> <li><a href="..&#x2F;classes/DialogManager.html">DialogManager</a></li> <li><a href="..&#x2F;classes/DialogMask.html">DialogMask</a></li> <li><a href="..&#x2F;classes/Do.html">Do</a></li> <li><a href="..&#x2F;classes/Do.AlterArgs.html">Do.AlterArgs</a></li> <li><a href="..&#x2F;classes/Do.AlterReturn.html">Do.AlterReturn</a></li> <li><a href="..&#x2F;classes/Do.Error.html">Do.Error</a></li> <li><a href="..&#x2F;classes/Do.Halt.html">Do.Halt</a></li> <li><a href="..&#x2F;classes/Do.Method.html">Do.Method</a></li> <li><a href="..&#x2F;classes/Do.Prevent.html">Do.Prevent</a></li> <li><a href="..&#x2F;classes/DOM.html">DOM</a></li> <li><a href="..&#x2F;classes/DOMEventFacade.html">DOMEventFacade</a></li> <li><a href="..&#x2F;classes/Drawing.html">Drawing</a></li> <li><a href="..&#x2F;classes/DropDownCellEditor.html">DropDownCellEditor</a></li> <li><a href="..&#x2F;classes/Easing.html">Easing</a></li> <li><a href="..&#x2F;classes/Editable.html">Editable</a></li> <li><a href="..&#x2F;classes/EditorBase.html">EditorBase</a></li> <li><a href="..&#x2F;classes/EditorSelection.html">EditorSelection</a></li> <li><a href="..&#x2F;classes/Ellipse.html">Ellipse</a></li> <li><a href="..&#x2F;classes/EllipseGroup.html">EllipseGroup</a></li> <li><a href="..&#x2F;classes/Escape.html">Escape</a></li> <li><a href="..&#x2F;classes/Event.html">Event</a></li> <li><a href="..&#x2F;classes/EventFacade.html">EventFacade</a></li> <li><a href="..&#x2F;classes/EventHandle.html">EventHandle</a></li> <li><a href="..&#x2F;classes/EventTarget.html">EventTarget</a></li> <li><a href="..&#x2F;classes/ExecCommand.html">ExecCommand</a></li> <li><a href="..&#x2F;classes/Features.html">Features</a></li> <li><a href="..&#x2F;classes/File.html">File</a></li> <li><a href="..&#x2F;classes/FileFlash.html">FileFlash</a></li> <li><a href="..&#x2F;classes/FileHTML5.html">FileHTML5</a></li> <li><a href="..&#x2F;classes/Fills.html">Fills</a></li> <li><a href="..&#x2F;classes/Frame.html">Frame</a></li> <li><a href="..&#x2F;classes/Get.html">Get</a></li> <li><a href="..&#x2F;classes/Get.Transaction.html">Get.Transaction</a></li> <li><a href="..&#x2F;classes/GetNodeJS.html">GetNodeJS</a></li> <li><a href="..&#x2F;classes/Graph.html">Graph</a></li> <li><a href="..&#x2F;classes/Graphic.html">Graphic</a></li> <li><a href="..&#x2F;classes/GraphicBase.html">GraphicBase</a></li> <li><a href="..&#x2F;classes/Gridlines.html">Gridlines</a></li> <li><a href="..&#x2F;classes/GroupDiamond.html">GroupDiamond</a></li> <li><a href="..&#x2F;classes/GroupRect.html">GroupRect</a></li> <li><a href="..&#x2F;classes/Handlebars.html">Handlebars</a></li> <li><a href="..&#x2F;classes/Highlight.html">Highlight</a></li> <li><a href="..&#x2F;classes/Histogram.html">Histogram</a></li> <li><a href="..&#x2F;classes/HistoryBase.html">HistoryBase</a></li> <li><a href="..&#x2F;classes/HistoryHash.html">HistoryHash</a></li> <li><a href="..&#x2F;classes/HistoryHTML5.html">HistoryHTML5</a></li> <li><a href="..&#x2F;classes/HorizontalLegendLayout.html">HorizontalLegendLayout</a></li> <li><a href="..&#x2F;classes/ImageGallery.html">ImageGallery</a></li> <li><a href="..&#x2F;classes/ImageViewer.html">ImageViewer</a></li> <li><a href="..&#x2F;classes/ImageViewerMask.html">ImageViewerMask</a></li> <li><a href="..&#x2F;classes/ImgLoadGroup.html">ImgLoadGroup</a></li> <li><a href="..&#x2F;classes/ImgLoadImgObj.html">ImgLoadImgObj</a></li> <li><a href="..&#x2F;classes/Intl.html">Intl</a></li> <li><a href="..&#x2F;classes/IO.html">IO</a></li> <li><a href="..&#x2F;classes/IORequest.html">IORequest</a></li> <li><a href="..&#x2F;classes/JSON.html">JSON</a></li> <li><a href="..&#x2F;classes/JSONPRequest.html">JSONPRequest</a></li> <li><a href="..&#x2F;classes/Lang.html">Lang</a></li> <li><a href="..&#x2F;classes/LazyModelList.html">LazyModelList</a></li> <li><a href="..&#x2F;classes/LeftAxisLayout.html">LeftAxisLayout</a></li> <li><a href="..&#x2F;classes/Lines.html">Lines</a></li> <li><a href="..&#x2F;classes/LineSeries.html">LineSeries</a></li> <li><a href="..&#x2F;classes/LiveSearch.html">LiveSearch</a></li> <li><a href="..&#x2F;classes/Loader.html">Loader</a></li> <li><a href="..&#x2F;classes/LoadingMask.html">LoadingMask</a></li> <li><a href="..&#x2F;classes/MarkerSeries.html">MarkerSeries</a></li> <li><a href="..&#x2F;classes/Matrix.html">Matrix</a></li> <li><a href="..&#x2F;classes/MatrixUtil.html">MatrixUtil</a></li> <li><a href="..&#x2F;classes/Model.html">Model</a></li> <li><a href="..&#x2F;classes/ModelList.html">ModelList</a></li> <li><a href="..&#x2F;classes/ModelSync.REST.html">ModelSync.REST</a></li> <li><a href="..&#x2F;classes/NestedList.html">NestedList</a></li> <li><a href="..&#x2F;classes/Node.html">Node</a></li> <li><a href="..&#x2F;classes/NodeList.html">NodeList</a></li> <li><a href="..&#x2F;classes/Number.html">Number</a></li> <li><a href="..&#x2F;classes/NumericAxis.html">NumericAxis</a></li> <li><a href="..&#x2F;classes/Object.html">Object</a></li> <li><a href="..&#x2F;classes/Overlay.html">Overlay</a></li> <li><a href="..&#x2F;classes/OverlayBase.html">OverlayBase</a></li> <li><a href="..&#x2F;classes/OverlayContext.html">OverlayContext</a></li> <li><a href="..&#x2F;classes/OverlayContextManager.html">OverlayContextManager</a></li> <li><a href="..&#x2F;classes/OverlayContextPanel.html">OverlayContextPanel</a></li> <li><a href="..&#x2F;classes/OverlayContextPanelManager.html">OverlayContextPanelManager</a></li> <li><a href="..&#x2F;classes/OverlayManager.html">OverlayManager</a></li> <li><a href="..&#x2F;classes/OverlayMask.html">OverlayMask</a></li> <li><a href="..&#x2F;classes/Paginator.html">Paginator</a></li> <li><a href="..&#x2F;classes/Panel.html">Panel</a></li> <li><a href="..&#x2F;classes/Parallel.html">Parallel</a></li> <li><a href="..&#x2F;classes/ParseContent.html">ParseContent</a></li> <li><a href="..&#x2F;classes/Path.html">Path</a></li> <li><a href="..&#x2F;classes/PieChart.html">PieChart</a></li> <li><a href="..&#x2F;classes/PieSeries.html">PieSeries</a></li> <li><a href="..&#x2F;classes/Pjax.html">Pjax</a></li> <li><a href="..&#x2F;classes/PjaxBase.html">PjaxBase</a></li> <li><a href="..&#x2F;classes/PjaxContent.html">PjaxContent</a></li> <li><a href="..&#x2F;classes/Plots.html">Plots</a></li> <li><a href="..&#x2F;classes/Plugin.Align.html">Plugin.Align</a></li> <li><a href="..&#x2F;classes/Plugin.AutoComplete.html">Plugin.AutoComplete</a></li> <li><a href="..&#x2F;classes/Plugin.Base.html">Plugin.Base</a></li> <li><a href="..&#x2F;classes/Plugin.Cache.html">Plugin.Cache</a></li> <li><a href="..&#x2F;classes/Plugin.CalendarNavigator.html">Plugin.CalendarNavigator</a></li> <li><a href="..&#x2F;classes/Plugin.ConsoleFilters.html">Plugin.ConsoleFilters</a></li> <li><a href="..&#x2F;classes/Plugin.CreateLinkBase.html">Plugin.CreateLinkBase</a></li> <li><a href="..&#x2F;classes/Plugin.DataTableDataSource.html">Plugin.DataTableDataSource</a></li> <li><a href="..&#x2F;classes/Plugin.DDConstrained.html">Plugin.DDConstrained</a></li> <li><a href="..&#x2F;classes/Plugin.DDNodeScroll.html">Plugin.DDNodeScroll</a></li> <li><a href="..&#x2F;classes/Plugin.DDProxy.html">Plugin.DDProxy</a></li> <li><a href="..&#x2F;classes/Plugin.DDWindowScroll.html">Plugin.DDWindowScroll</a></li> <li><a href="..&#x2F;classes/Plugin.Drag.html">Plugin.Drag</a></li> <li><a href="..&#x2F;classes/Plugin.Drop.html">Plugin.Drop</a></li> <li><a href="..&#x2F;classes/Plugin.EditorBidi.html">Plugin.EditorBidi</a></li> <li><a href="..&#x2F;classes/Plugin.EditorBR.html">Plugin.EditorBR</a></li> <li><a href="..&#x2F;classes/Plugin.EditorLists.html">Plugin.EditorLists</a></li> <li><a href="..&#x2F;classes/Plugin.EditorPara.html">Plugin.EditorPara</a></li> <li><a href="..&#x2F;classes/Plugin.EditorParaBase.html">Plugin.EditorParaBase</a></li> <li><a href="..&#x2F;classes/Plugin.EditorParaIE.html">Plugin.EditorParaIE</a></li> <li><a href="..&#x2F;classes/Plugin.EditorTab.html">Plugin.EditorTab</a></li> <li><a href="..&#x2F;classes/Plugin.ExecCommand.html">Plugin.ExecCommand</a></li> <li><a href="..&#x2F;classes/Plugin.Flick.html">Plugin.Flick</a></li> <li><a href="..&#x2F;classes/Plugin.Host.html">Plugin.Host</a></li> <li><a href="..&#x2F;classes/plugin.NodeFocusManager.html">plugin.NodeFocusManager</a></li> <li><a href="..&#x2F;classes/Plugin.NodeFX.html">Plugin.NodeFX</a></li> <li><a href="..&#x2F;classes/plugin.NodeMenuNav.html">plugin.NodeMenuNav</a></li> <li><a href="..&#x2F;classes/Plugin.Pjax.html">Plugin.Pjax</a></li> <li><a href="..&#x2F;classes/Plugin.Resize.html">Plugin.Resize</a></li> <li><a href="..&#x2F;classes/Plugin.ResizeConstrained.html">Plugin.ResizeConstrained</a></li> <li><a href="..&#x2F;classes/Plugin.ResizeProxy.html">Plugin.ResizeProxy</a></li> <li><a href="..&#x2F;classes/Plugin.ScrollInfo.html">Plugin.ScrollInfo</a></li> <li><a href="..&#x2F;classes/Plugin.ScrollViewList.html">Plugin.ScrollViewList</a></li> <li><a href="..&#x2F;classes/Plugin.ScrollViewPaginator.html">Plugin.ScrollViewPaginator</a></li> <li><a href="..&#x2F;classes/Plugin.ScrollViewScrollbars.html">Plugin.ScrollViewScrollbars</a></li> <li><a href="..&#x2F;classes/Plugin.Shim.html">Plugin.Shim</a></li> <li><a href="..&#x2F;classes/Plugin.SortScroll.html">Plugin.SortScroll</a></li> <li><a href="..&#x2F;classes/Plugin.WidgetAnim.html">Plugin.WidgetAnim</a></li> <li><a href="..&#x2F;classes/Pollable.html">Pollable</a></li> <li><a href="..&#x2F;classes/PortalLayout.html">PortalLayout</a></li> <li><a href="..&#x2F;classes/Profiler.html">Profiler</a></li> <li><a href="..&#x2F;classes/ProgressBar.html">ProgressBar</a></li> <li><a href="..&#x2F;classes/QueryString.html">QueryString</a></li> <li><a href="..&#x2F;classes/Queue.html">Queue</a></li> <li><a href="..&#x2F;classes/RadioCellEditor.html">RadioCellEditor</a></li> <li><a href="..&#x2F;classes/Rating.html">Rating</a></li> <li><a href="..&#x2F;classes/Record.html">Record</a></li> <li><a href="..&#x2F;classes/Recordset.html">Recordset</a></li> <li><a href="..&#x2F;classes/RecordsetFilter.html">RecordsetFilter</a></li> <li><a href="..&#x2F;classes/RecordsetIndexer.html">RecordsetIndexer</a></li> <li><a href="..&#x2F;classes/RecordsetSort.html">RecordsetSort</a></li> <li><a href="..&#x2F;classes/Rect.html">Rect</a></li> <li><a href="..&#x2F;classes/Renderer.html">Renderer</a></li> <li><a href="..&#x2F;classes/Resize.html">Resize</a></li> <li><a href="..&#x2F;classes/RightAxisLayout.html">RightAxisLayout</a></li> <li><a href="..&#x2F;classes/Router.html">Router</a></li> <li><a href="..&#x2F;classes/ScrollView.html">ScrollView</a></li> <li><a href="..&#x2F;classes/Selector.html">Selector</a></li> <li><a href="..&#x2F;classes/Shape.html">Shape</a></li> <li><a href="..&#x2F;classes/ShapeGroup.html">ShapeGroup</a></li> <li><a href="..&#x2F;classes/Slider.html">Slider</a></li> <li><a href="..&#x2F;classes/SliderBase.html">SliderBase</a></li> <li><a href="..&#x2F;classes/SliderValueRange.html">SliderValueRange</a></li> <li><a href="..&#x2F;classes/Sortable.html">Sortable</a></li> <li><a href="..&#x2F;classes/SplineSeries.html">SplineSeries</a></li> <li><a href="..&#x2F;classes/StackedAreaSeries.html">StackedAreaSeries</a></li> <li><a href="..&#x2F;classes/StackedAreaSplineSeries.html">StackedAreaSplineSeries</a></li> <li><a href="..&#x2F;classes/StackedAxis.html">StackedAxis</a></li> <li><a href="..&#x2F;classes/StackedBarSeries.html">StackedBarSeries</a></li> <li><a href="..&#x2F;classes/StackedColumnSeries.html">StackedColumnSeries</a></li> <li><a href="..&#x2F;classes/StackedComboSeries.html">StackedComboSeries</a></li> <li><a href="..&#x2F;classes/StackedComboSplineSeries.html">StackedComboSplineSeries</a></li> <li><a href="..&#x2F;classes/StackedLineSeries.html">StackedLineSeries</a></li> <li><a href="..&#x2F;classes/StackedMarkerSeries.html">StackedMarkerSeries</a></li> <li><a href="..&#x2F;classes/StackedSplineSeries.html">StackedSplineSeries</a></li> <li><a href="..&#x2F;classes/StackingUtil.html">StackingUtil</a></li> <li><a href="..&#x2F;classes/State.html">State</a></li> <li><a href="..&#x2F;classes/StyleSheet.html">StyleSheet</a></li> <li><a href="..&#x2F;classes/Subscriber.html">Subscriber</a></li> <li><a href="..&#x2F;classes/SVGCircle.html">SVGCircle</a></li> <li><a href="..&#x2F;classes/SVGDrawing.html">SVGDrawing</a></li> <li><a href="..&#x2F;classes/SVGEllipse.html">SVGEllipse</a></li> <li><a href="..&#x2F;classes/SVGGraphic.html">SVGGraphic</a></li> <li><a href="..&#x2F;classes/SVGPath.html">SVGPath</a></li> <li><a href="..&#x2F;classes/SVGPieSlice.html">SVGPieSlice</a></li> <li><a href="..&#x2F;classes/SVGRect.html">SVGRect</a></li> <li><a href="..&#x2F;classes/SVGShape.html">SVGShape</a></li> <li><a href="..&#x2F;classes/SWF.html">SWF</a></li> <li><a href="..&#x2F;classes/SWFDetect.html">SWFDetect</a></li> <li><a href="..&#x2F;classes/SyntheticEvent.html">SyntheticEvent</a></li> <li><a href="..&#x2F;classes/SyntheticEvent.Notifier.html">SyntheticEvent.Notifier</a></li> <li><a href="..&#x2F;classes/SynthRegistry.html">SynthRegistry</a></li> <li><a href="..&#x2F;classes/Tab.html">Tab</a></li> <li><a href="..&#x2F;classes/TabView.html">TabView</a></li> <li><a href="..&#x2F;classes/Test.ArrayAssert.html">Test.ArrayAssert</a></li> <li><a href="..&#x2F;classes/Test.Assert.html">Test.Assert</a></li> <li><a href="..&#x2F;classes/Test.AssertionError.html">Test.AssertionError</a></li> <li><a href="..&#x2F;classes/Test.ComparisonFailure.html">Test.ComparisonFailure</a></li> <li><a href="..&#x2F;classes/Test.Console.html">Test.Console</a></li> <li><a href="..&#x2F;classes/Test.CoverageFormat.html">Test.CoverageFormat</a></li> <li><a href="..&#x2F;classes/Test.DateAssert.html">Test.DateAssert</a></li> <li><a href="..&#x2F;classes/Test.EventTarget.html">Test.EventTarget</a></li> <li><a href="..&#x2F;classes/Test.Mock.html">Test.Mock</a></li> <li><a href="..&#x2F;classes/Test.Mock.Value.html">Test.Mock.Value</a></li> <li><a href="..&#x2F;classes/Test.ObjectAssert.html">Test.ObjectAssert</a></li> <li><a href="..&#x2F;classes/Test.Reporter.html">Test.Reporter</a></li> <li><a href="..&#x2F;classes/Test.Results.html">Test.Results</a></li> <li><a href="..&#x2F;classes/Test.Runner.html">Test.Runner</a></li> <li><a href="..&#x2F;classes/Test.ShouldError.html">Test.ShouldError</a></li> <li><a href="..&#x2F;classes/Test.ShouldFail.html">Test.ShouldFail</a></li> <li><a href="..&#x2F;classes/Test.TestCase.html">Test.TestCase</a></li> <li><a href="..&#x2F;classes/Test.TestFormat.html">Test.TestFormat</a></li> <li><a href="..&#x2F;classes/Test.TestNode.html">Test.TestNode</a></li> <li><a href="..&#x2F;classes/Test.TestRunner.html">Test.TestRunner</a></li> <li><a href="..&#x2F;classes/Test.TestSuite.html">Test.TestSuite</a></li> <li><a href="..&#x2F;classes/Test.UnexpectedError.html">Test.UnexpectedError</a></li> <li><a href="..&#x2F;classes/Test.UnexpectedValue.html">Test.UnexpectedValue</a></li> <li><a href="..&#x2F;classes/Test.Wait.html">Test.Wait</a></li> <li><a href="..&#x2F;classes/Text.AccentFold.html">Text.AccentFold</a></li> <li><a href="..&#x2F;classes/Text.WordBreak.html">Text.WordBreak</a></li> <li><a href="..&#x2F;classes/TextAreaCellEditor.html">TextAreaCellEditor</a></li> <li><a href="..&#x2F;classes/Textboxlist.html">Textboxlist</a></li> <li><a href="..&#x2F;classes/TextCellEditor.html">TextCellEditor</a></li> <li><a href="..&#x2F;classes/ThumbRating.html">ThumbRating</a></li> <li><a href="..&#x2F;classes/TimeAxis.html">TimeAxis</a></li> <li><a href="..&#x2F;classes/ToggleButton.html">ToggleButton</a></li> <li><a href="..&#x2F;classes/Toolbar.html">Toolbar</a></li> <li><a href="..&#x2F;classes/Tooltip.html">Tooltip</a></li> <li><a href="..&#x2F;classes/TopAxisLayout.html">TopAxisLayout</a></li> <li><a href="..&#x2F;classes/Transition.html">Transition</a></li> <li><a href="..&#x2F;classes/TreeData.html">TreeData</a></li> <li><a href="..&#x2F;classes/TreeNode.html">TreeNode</a></li> <li><a href="..&#x2F;classes/TreeNodeCheck.html">TreeNodeCheck</a></li> <li><a href="..&#x2F;classes/TreeNodeIO.html">TreeNodeIO</a></li> <li><a href="..&#x2F;classes/TreeNodeRadio.html">TreeNodeRadio</a></li> <li><a href="..&#x2F;classes/TreeNodeTask.html">TreeNodeTask</a></li> <li><a href="..&#x2F;classes/TreeView.html">TreeView</a></li> <li><a href="..&#x2F;classes/TreeViewDD.html">TreeViewDD</a></li> <li><a href="..&#x2F;classes/UA.html">UA</a></li> <li><a href="..&#x2F;classes/Uploader.html">Uploader</a></li> <li><a href="..&#x2F;classes/Uploader.Queue.html">Uploader.Queue</a></li> <li><a href="..&#x2F;classes/UploaderFlash.html">UploaderFlash</a></li> <li><a href="..&#x2F;classes/UploaderHTML5.html">UploaderHTML5</a></li> <li><a href="..&#x2F;classes/ValueChange.html">ValueChange</a></li> <li><a href="..&#x2F;classes/VerticalLegendLayout.html">VerticalLegendLayout</a></li> <li><a href="..&#x2F;classes/View.html">View</a></li> <li><a href="..&#x2F;classes/View.NodeMap.html">View.NodeMap</a></li> <li><a href="..&#x2F;classes/VMLCircle.html">VMLCircle</a></li> <li><a href="..&#x2F;classes/VMLDrawing.html">VMLDrawing</a></li> <li><a href="..&#x2F;classes/VMLEllipse.html">VMLEllipse</a></li> <li><a href="..&#x2F;classes/VMLGraphic.html">VMLGraphic</a></li> <li><a href="..&#x2F;classes/VMLPath.html">VMLPath</a></li> <li><a href="..&#x2F;classes/VMLPieSlice.html">VMLPieSlice</a></li> <li><a href="..&#x2F;classes/VMLRect.html">VMLRect</a></li> <li><a href="..&#x2F;classes/VMLShape.html">VMLShape</a></li> <li><a href="..&#x2F;classes/Widget.html">Widget</a></li> <li><a href="..&#x2F;classes/WidgetAutohide.html">WidgetAutohide</a></li> <li><a href="..&#x2F;classes/WidgetButtons.html">WidgetButtons</a></li> <li><a href="..&#x2F;classes/WidgetChild.html">WidgetChild</a></li> <li><a href="..&#x2F;classes/WidgetModality.html">WidgetModality</a></li> <li><a href="..&#x2F;classes/WidgetParent.html">WidgetParent</a></li> <li><a href="..&#x2F;classes/WidgetPosition.html">WidgetPosition</a></li> <li><a href="..&#x2F;classes/WidgetPositionAlign.html">WidgetPositionAlign</a></li> <li><a href="..&#x2F;classes/WidgetPositionConstrain.html">WidgetPositionConstrain</a></li> <li><a href="..&#x2F;classes/WidgetStack.html">WidgetStack</a></li> <li><a href="..&#x2F;classes/WidgetStdMod.html">WidgetStdMod</a></li> <li><a href="..&#x2F;classes/XML.html">XML</a></li> <li><a href="..&#x2F;classes/YQL.html">YQL</a></li> <li><a href="..&#x2F;classes/YQLRequest.html">YQLRequest</a></li> <li><a href="..&#x2F;classes/YUI.html">YUI</a></li> <li><a href="..&#x2F;classes/YUI~substitute.html">YUI~substitute</a></li> </ul> <ul id="api-modules" class="apis modules aui-tabview-content-item"> <li><a href="..&#x2F;modules/align-plugin.html">align-plugin</a></li> <li><a href="..&#x2F;modules/anim.html">anim</a></li> <li><a href="..&#x2F;modules/anim-base.html">anim-base</a></li> <li><a href="..&#x2F;modules/anim-color.html">anim-color</a></li> <li><a href="..&#x2F;modules/anim-curve.html">anim-curve</a></li> <li><a href="..&#x2F;modules/anim-easing.html">anim-easing</a></li> <li><a href="..&#x2F;modules/anim-node-plugin.html">anim-node-plugin</a></li> <li><a href="..&#x2F;modules/anim-scroll.html">anim-scroll</a></li> <li><a href="..&#x2F;modules/anim-shape.html">anim-shape</a></li> <li><a href="..&#x2F;modules/anim-shape-transform.html">anim-shape-transform</a></li> <li><a href="..&#x2F;modules/anim-xy.html">anim-xy</a></li> <li><a href="..&#x2F;modules/app.html">app</a></li> <li><a href="..&#x2F;modules/app-base.html">app-base</a></li> <li><a href="..&#x2F;modules/app-content.html">app-content</a></li> <li><a href="..&#x2F;modules/app-transitions.html">app-transitions</a></li> <li><a href="..&#x2F;modules/app-transitions-native.html">app-transitions-native</a></li> <li><a href="..&#x2F;modules/array-extras.html">array-extras</a></li> <li><a href="..&#x2F;modules/array-invoke.html">array-invoke</a></li> <li><a href="..&#x2F;modules/arraylist.html">arraylist</a></li> <li><a href="..&#x2F;modules/arraylist-add.html">arraylist-add</a></li> <li><a href="..&#x2F;modules/arraylist-filter.html">arraylist-filter</a></li> <li><a href="..&#x2F;modules/arraysort.html">arraysort</a></li> <li><a href="..&#x2F;modules/async-queue.html">async-queue</a></li> <li><a href="..&#x2F;modules/attribute.html">attribute</a></li> <li><a href="..&#x2F;modules/attribute-base.html">attribute-base</a></li> <li><a href="..&#x2F;modules/attribute-complex.html">attribute-complex</a></li> <li><a href="..&#x2F;modules/attribute-core.html">attribute-core</a></li> <li><a href="..&#x2F;modules/attribute-events.html">attribute-events</a></li> <li><a href="..&#x2F;modules/attribute-extras.html">attribute-extras</a></li> <li><a href="..&#x2F;modules/aui-autocomplete.html">aui-autocomplete</a></li> <li><a href="..&#x2F;modules/aui-button-item.html">aui-button-item</a></li> <li><a href="..&#x2F;modules/aui-calendar.html">aui-calendar</a></li> <li><a href="..&#x2F;modules/aui-calendar-base.html">aui-calendar-base</a></li> <li><a href="..&#x2F;modules/aui-calendar-datepicker-select.html">aui-calendar-datepicker-select</a></li> <li><a href="..&#x2F;modules/aui-carousel.html">aui-carousel</a></li> <li><a href="..&#x2F;modules/aui-char-counter.html">aui-char-counter</a></li> <li><a href="..&#x2F;modules/aui-color-picker.html">aui-color-picker</a></li> <li><a href="..&#x2F;modules/aui-component.html">aui-component</a></li> <li><a href="..&#x2F;modules/aui-datatype.html">aui-datatype</a></li> <li><a href="..&#x2F;modules/aui-delayed-task.html">aui-delayed-task</a></li> <li><a href="..&#x2F;modules/aui-dialog.html">aui-dialog</a></li> <li><a href="..&#x2F;modules/aui-editable.html">aui-editable</a></li> <li><a href="..&#x2F;modules/aui-event.html">aui-event</a></li> <li><a href="..&#x2F;modules/aui-event-input.html">aui-event-input</a></li> <li><a href="..&#x2F;modules/aui-image-viewer.html">aui-image-viewer</a></li> <li><a href="..&#x2F;modules/aui-image-viewer-base.html">aui-image-viewer-base</a></li> <li><a href="..&#x2F;modules/aui-image-viewer-gallery.html">aui-image-viewer-gallery</a></li> <li><a href="..&#x2F;modules/aui-io.html">aui-io</a></li> <li><a href="..&#x2F;modules/aui-io-plugin.html">aui-io-plugin</a></li> <li><a href="..&#x2F;modules/aui-io-request.html">aui-io-request</a></li> <li><a href="..&#x2F;modules/aui-live-search.html">aui-live-search</a></li> <li><a href="..&#x2F;modules/aui-loading-mask.html">aui-loading-mask</a></li> <li><a href="..&#x2F;modules/aui-media-viewer-plugin.html">aui-media-viewer-plugin</a></li> <li><a href="..&#x2F;modules/aui-nested-list.html">aui-nested-list</a></li> <li><a href="..&#x2F;modules/aui-node.html">aui-node</a></li> <li><a href="..&#x2F;modules/aui-node-base.html">aui-node-base</a></li> <li><a href="..&#x2F;modules/aui-node-html5.html">aui-node-html5</a></li> <li><a href="..&#x2F;modules/aui-overlay.html">aui-overlay</a></li> <li><a href="..&#x2F;modules/aui-overlay-base.html">aui-overlay-base</a></li> <li><a href="..&#x2F;modules/aui-overlay-context.html">aui-overlay-context</a></li> <li><a href="..&#x2F;modules/aui-overlay-context-panel.html">aui-overlay-context-panel</a></li> <li><a href="..&#x2F;modules/aui-overlay-manager.html">aui-overlay-manager</a></li> <li><a href="..&#x2F;modules/aui-overlay-mask.html">aui-overlay-mask</a></li> <li><a href="..&#x2F;modules/aui-paginator.html">aui-paginator</a></li> <li><a href="..&#x2F;modules/aui-panel.html">aui-panel</a></li> <li><a href="..&#x2F;modules/aui-parse-content.html">aui-parse-content</a></li> <li><a href="..&#x2F;modules/aui-portal-layout.html">aui-portal-layout</a></li> <li><a href="..&#x2F;modules/aui-progressbar.html">aui-progressbar</a></li> <li><a href="..&#x2F;modules/aui-rating.html">aui-rating</a></li> <li><a href="..&#x2F;modules/aui-resize.html">aui-resize</a></li> <li><a href="..&#x2F;modules/aui-text.html">aui-text</a></li> <li><a href="..&#x2F;modules/aui-textboxlist.html">aui-textboxlist</a></li> <li><a href="..&#x2F;modules/aui-toolbar.html">aui-toolbar</a></li> <li><a href="..&#x2F;modules/aui-tooltip.html">aui-tooltip</a></li> <li><a href="..&#x2F;modules/aui-tree.html">aui-tree</a></li> <li><a href="..&#x2F;modules/aui-tree-data.html">aui-tree-data</a></li> <li><a href="..&#x2F;modules/aui-tree-node.html">aui-tree-node</a></li> <li><a href="..&#x2F;modules/aui-tree-view.html">aui-tree-view</a></li> <li><a href="..&#x2F;modules/autocomplete.html">autocomplete</a></li> <li><a href="..&#x2F;modules/autocomplete-base.html">autocomplete-base</a></li> <li><a href="..&#x2F;modules/autocomplete-filters.html">autocomplete-filters</a></li> <li><a href="..&#x2F;modules/autocomplete-filters-accentfold.html">autocomplete-filters-accentfold</a></li> <li><a href="..&#x2F;modules/autocomplete-highlighters.html">autocomplete-highlighters</a></li> <li><a href="..&#x2F;modules/autocomplete-highlighters-accentfold.html">autocomplete-highlighters-accentfold</a></li> <li><a href="..&#x2F;modules/autocomplete-list.html">autocomplete-list</a></li> <li><a href="..&#x2F;modules/autocomplete-list-keys.html">autocomplete-list-keys</a></li> <li><a href="..&#x2F;modules/autocomplete-plugin.html">autocomplete-plugin</a></li> <li><a href="..&#x2F;modules/autocomplete-sources.html">autocomplete-sources</a></li> <li><a href="..&#x2F;modules/base.html">base</a></li> <li><a href="..&#x2F;modules/base-base.html">base-base</a></li> <li><a href="..&#x2F;modules/base-build.html">base-build</a></li> <li><a href="..&#x2F;modules/base-core.html">base-core</a></li> <li><a href="..&#x2F;modules/base-pluginhost.html">base-pluginhost</a></li> <li><a href="..&#x2F;modules/button.html">button</a></li> <li><a href="..&#x2F;modules/button-core.html">button-core</a></li> <li><a href="..&#x2F;modules/button-group.html">button-group</a></li> <li><a href="..&#x2F;modules/button-plugin.html">button-plugin</a></li> <li><a href="..&#x2F;modules/cache.html">cache</a></li> <li><a href="..&#x2F;modules/cache-base.html">cache-base</a></li> <li><a href="..&#x2F;modules/cache-offline.html">cache-offline</a></li> <li><a href="..&#x2F;modules/cache-plugin.html">cache-plugin</a></li> <li><a href="..&#x2F;modules/calendar.html">calendar</a></li> <li><a href="..&#x2F;modules/calendar-base.html">calendar-base</a></li> <li><a href="..&#x2F;modules/calendarnavigator.html">calendarnavigator</a></li> <li><a href="..&#x2F;modules/charts.html">charts</a></li> <li><a href="..&#x2F;modules/charts-base.html">charts-base</a></li> <li><a href="..&#x2F;modules/charts-legend.html">charts-legend</a></li> <li><a href="..&#x2F;modules/classnamemanager.html">classnamemanager</a></li> <li><a href="..&#x2F;modules/clickable-rail.html">clickable-rail</a></li> <li><a href="..&#x2F;modules/collection.html">collection</a></li> <li><a href="..&#x2F;modules/console.html">console</a></li> <li><a href="..&#x2F;modules/console-filters.html">console-filters</a></li> <li><a href="..&#x2F;modules/cookie.html">cookie</a></li> <li><a href="..&#x2F;modules/createlink-base.html">createlink-base</a></li> <li><a href="..&#x2F;modules/dataschema.html">dataschema</a></li> <li><a href="..&#x2F;modules/dataschema-array.html">dataschema-array</a></li> <li><a href="..&#x2F;modules/dataschema-base.html">dataschema-base</a></li> <li><a href="..&#x2F;modules/dataschema-json.html">dataschema-json</a></li> <li><a href="..&#x2F;modules/dataschema-text.html">dataschema-text</a></li> <li><a href="..&#x2F;modules/dataschema-xml.html">dataschema-xml</a></li> <li><a href="..&#x2F;modules/datasource.html">datasource</a></li> <li><a href="..&#x2F;modules/datasource-arrayschema.html">datasource-arrayschema</a></li> <li><a href="..&#x2F;modules/datasource-cache.html">datasource-cache</a></li> <li><a href="..&#x2F;modules/datasource-function.html">datasource-function</a></li> <li><a href="..&#x2F;modules/datasource-get.html">datasource-get</a></li> <li><a href="..&#x2F;modules/datasource-io.html">datasource-io</a></li> <li><a href="..&#x2F;modules/datasource-jsonschema.html">datasource-jsonschema</a></li> <li><a href="..&#x2F;modules/datasource-local.html">datasource-local</a></li> <li><a href="..&#x2F;modules/datasource-polling.html">datasource-polling</a></li> <li><a href="..&#x2F;modules/datasource-textschema.html">datasource-textschema</a></li> <li><a href="..&#x2F;modules/datasource-xmlschema.html">datasource-xmlschema</a></li> <li><a href="..&#x2F;modules/datatable.html">datatable</a></li> <li><a href="..&#x2F;modules/datatable-base.html">datatable-base</a></li> <li><a href="..&#x2F;modules/datatable-base-deprecated.html">datatable-base-deprecated</a></li> <li><a href="..&#x2F;modules/datatable-body.html">datatable-body</a></li> <li><a href="..&#x2F;modules/datatable-column-widths.html">datatable-column-widths</a></li> <li><a href="..&#x2F;modules/datatable-core.html">datatable-core</a></li> <li><a href="..&#x2F;modules/datatable-datasource.html">datatable-datasource</a></li> <li><a href="..&#x2F;modules/datatable-datasource-deprecated.html">datatable-datasource-deprecated</a></li> <li><a href="..&#x2F;modules/datatable-deprecated.html">datatable-deprecated</a></li> <li><a href="..&#x2F;modules/datatable-head.html">datatable-head</a></li> <li><a href="..&#x2F;modules/datatable-message.html">datatable-message</a></li> <li><a href="..&#x2F;modules/datatable-mutable.html">datatable-mutable</a></li> <li><a href="..&#x2F;modules/datatable-scroll.html">datatable-scroll</a></li> <li><a href="..&#x2F;modules/datatable-scroll-deprecated.html">datatable-scroll-deprecated</a></li> <li><a href="..&#x2F;modules/datatable-sort.html">datatable-sort</a></li> <li><a href="..&#x2F;modules/datatable-sort-deprecated.html">datatable-sort-deprecated</a></li> <li><a href="..&#x2F;modules/datatable-table.html">datatable-table</a></li> <li><a href="..&#x2F;modules/datatype.html">datatype</a></li> <li><a href="..&#x2F;modules/datatype-date.html">datatype-date</a></li> <li><a href="..&#x2F;modules/datatype-date-format.html">datatype-date-format</a></li> <li><a href="..&#x2F;modules/datatype-date-math.html">datatype-date-math</a></li> <li><a href="..&#x2F;modules/datatype-date-parse.html">datatype-date-parse</a></li> <li><a href="..&#x2F;modules/datatype-number.html">datatype-number</a></li> <li><a href="..&#x2F;modules/datatype-number-format.html">datatype-number-format</a></li> <li><a href="..&#x2F;modules/datatype-number-parse.html">datatype-number-parse</a></li> <li><a href="..&#x2F;modules/datatype-xml.html">datatype-xml</a></li> <li><a href="..&#x2F;modules/datatype-xml-format.html">datatype-xml-format</a></li> <li><a href="..&#x2F;modules/datatype-xml-parse.html">datatype-xml-parse</a></li> <li><a href="..&#x2F;modules/dd.html">dd</a></li> <li><a href="..&#x2F;modules/dd-constrain.html">dd-constrain</a></li> <li><a href="..&#x2F;modules/dd-ddm.html">dd-ddm</a></li> <li><a href="..&#x2F;modules/dd-ddm-base.html">dd-ddm-base</a></li> <li><a href="..&#x2F;modules/dd-ddm-drop.html">dd-ddm-drop</a></li> <li><a href="..&#x2F;modules/dd-delegate.html">dd-delegate</a></li> <li><a href="..&#x2F;modules/dd-drag.html">dd-drag</a></li> <li><a href="..&#x2F;modules/dd-drop.html">dd-drop</a></li> <li><a href="..&#x2F;modules/dd-drop-plugin.html">dd-drop-plugin</a></li> <li><a href="..&#x2F;modules/dd-gestures.html">dd-gestures</a></li> <li><a href="..&#x2F;modules/dd-plugin.html">dd-plugin</a></li> <li><a href="..&#x2F;modules/dd-proxy.html">dd-proxy</a></li> <li><a href="..&#x2F;modules/dd-scroll.html">dd-scroll</a></li> <li><a href="..&#x2F;modules/dial.html">dial</a></li> <li><a href="..&#x2F;modules/dom.html">dom</a></li> <li><a href="..&#x2F;modules/dom-base.html">dom-base</a></li> <li><a href="..&#x2F;modules/dom-screen.html">dom-screen</a></li> <li><a href="..&#x2F;modules/dom-style.html">dom-style</a></li> <li><a href="..&#x2F;modules/dump.html">dump</a></li> <li><a href="..&#x2F;modules/editor.html">editor</a></li> <li><a href="..&#x2F;modules/editor-base.html">editor-base</a></li> <li><a href="..&#x2F;modules/editor-bidi.html">editor-bidi</a></li> <li><a href="..&#x2F;modules/editor-br.html">editor-br</a></li> <li><a href="..&#x2F;modules/editor-lists.html">editor-lists</a></li> <li><a href="..&#x2F;modules/editor-para.html">editor-para</a></li> <li><a href="..&#x2F;modules/editor-para-base.html">editor-para-base</a></li> <li><a href="..&#x2F;modules/editor-para-ie.html">editor-para-ie</a></li> <li><a href="..&#x2F;modules/editor-tab.html">editor-tab</a></li> <li><a href="..&#x2F;modules/escape.html">escape</a></li> <li><a href="..&#x2F;modules/event.html">event</a></li> <li><a href="..&#x2F;modules/event-base.html">event-base</a></li> <li><a href="..&#x2F;modules/event-contextmenu.html">event-contextmenu</a></li> <li><a href="..&#x2F;modules/event-custom.html">event-custom</a></li> <li><a href="..&#x2F;modules/event-custom-base.html">event-custom-base</a></li> <li><a href="..&#x2F;modules/event-custom-complex.html">event-custom-complex</a></li> <li><a href="..&#x2F;modules/event-delegate.html">event-delegate</a></li> <li><a href="..&#x2F;modules/event-flick.html">event-flick</a></li> <li><a href="..&#x2F;modules/event-focus.html">event-focus</a></li> <li><a href="..&#x2F;modules/event-gestures.html">event-gestures</a></li> <li><a href="..&#x2F;modules/event-hover.html">event-hover</a></li> <li><a href="..&#x2F;modules/event-key.html">event-key</a></li> <li><a href="..&#x2F;modules/event-mouseenter.html">event-mouseenter</a></li> <li><a href="..&#x2F;modules/event-mousewheel.html">event-mousewheel</a></li> <li><a href="..&#x2F;modules/event-move.html">event-move</a></li> <li><a href="..&#x2F;modules/event-outside.html">event-outside</a></li> <li><a href="..&#x2F;modules/event-resize.html">event-resize</a></li> <li><a href="..&#x2F;modules/event-simulate.html">event-simulate</a></li> <li><a href="..&#x2F;modules/event-synthetic.html">event-synthetic</a></li> <li><a href="..&#x2F;modules/event-tap.html">event-tap</a></li> <li><a href="..&#x2F;modules/event-touch.html">event-touch</a></li> <li><a href="..&#x2F;modules/event-valuechange.html">event-valuechange</a></li> <li><a href="..&#x2F;modules/exec-command.html">exec-command</a></li> <li><a href="..&#x2F;modules/features.html">features</a></li> <li><a href="..&#x2F;modules/file.html">file</a></li> <li><a href="..&#x2F;modules/file-flash.html">file-flash</a></li> <li><a href="..&#x2F;modules/file-html5.html">file-html5</a></li> <li><a href="..&#x2F;modules/frame.html">frame</a></li> <li><a href="..&#x2F;modules/gesture-simulate.html">gesture-simulate</a></li> <li><a href="..&#x2F;modules/get.html">get</a></li> <li><a href="..&#x2F;modules/get-nodejs.html">get-nodejs</a></li> <li><a href="..&#x2F;modules/graphics.html">graphics</a></li> <li><a href="..&#x2F;modules/handlebars.html">handlebars</a></li> <li><a href="..&#x2F;modules/handlebars-base.html">handlebars-base</a></li> <li><a href="..&#x2F;modules/handlebars-compiler.html">handlebars-compiler</a></li> <li><a href="..&#x2F;modules/highlight.html">highlight</a></li> <li><a href="..&#x2F;modules/highlight-accentfold.html">highlight-accentfold</a></li> <li><a href="..&#x2F;modules/highlight-base.html">highlight-base</a></li> <li><a href="..&#x2F;modules/history.html">history</a></li> <li><a href="..&#x2F;modules/history-base.html">history-base</a></li> <li><a href="..&#x2F;modules/history-hash.html">history-hash</a></li> <li><a href="..&#x2F;modules/history-hash-ie.html">history-hash-ie</a></li> <li><a href="..&#x2F;modules/history-html5.html">history-html5</a></li> <li><a href="..&#x2F;modules/imageloader.html">imageloader</a></li> <li><a href="..&#x2F;modules/intl.html">intl</a></li> <li><a href="..&#x2F;modules/io.html">io</a></li> <li><a href="..&#x2F;modules/io-base.html">io-base</a></li> <li><a href="..&#x2F;modules/io-form.html">io-form</a></li> <li><a href="..&#x2F;modules/io-nodejs.html">io-nodejs</a></li> <li><a href="..&#x2F;modules/io-queue.html">io-queue</a></li> <li><a href="..&#x2F;modules/io-upload-iframe.html">io-upload-iframe</a></li> <li><a href="..&#x2F;modules/io-xdr.html">io-xdr</a></li> <li><a href="..&#x2F;modules/json.html">json</a></li> <li><a href="..&#x2F;modules/json-parse.html">json-parse</a></li> <li><a href="..&#x2F;modules/json-stringify.html">json-stringify</a></li> <li><a href="..&#x2F;modules/jsonp.html">jsonp</a></li> <li><a href="..&#x2F;modules/jsonp-url.html">jsonp-url</a></li> <li><a href="..&#x2F;modules/lazy-model-list.html">lazy-model-list</a></li> <li><a href="..&#x2F;modules/loader.html">loader</a></li> <li><a href="..&#x2F;modules/loader-base.html">loader-base</a></li> <li><a href="..&#x2F;modules/matrix.html">matrix</a></li> <li><a href="..&#x2F;modules/model.html">model</a></li> <li><a href="..&#x2F;modules/model-list.html">model-list</a></li> <li><a href="..&#x2F;modules/model-sync-rest.html">model-sync-rest</a></li> <li><a href="..&#x2F;modules/node.html">node</a></li> <li><a href="..&#x2F;modules/node-base.html">node-base</a></li> <li><a href="..&#x2F;modules/node-core.html">node-core</a></li> <li><a href="..&#x2F;modules/node-data.html">node-data</a></li> <li><a href="..&#x2F;modules/node-deprecated.html">node-deprecated</a></li> <li><a href="..&#x2F;modules/node-event-delegate.html">node-event-delegate</a></li> <li><a href="..&#x2F;modules/node-event-html5.html">node-event-html5</a></li> <li><a href="..&#x2F;modules/node-event-simulate.html">node-event-simulate</a></li> <li><a href="..&#x2F;modules/node-flick.html">node-flick</a></li> <li><a href="..&#x2F;modules/node-focusmanager.html">node-focusmanager</a></li> <li><a href="..&#x2F;modules/node-load.html">node-load</a></li> <li><a href="..&#x2F;modules/node-menunav.html">node-menunav</a></li> <li><a href="..&#x2F;modules/node-pluginhost.html">node-pluginhost</a></li> <li><a href="..&#x2F;modules/node-screen.html">node-screen</a></li> <li><a href="..&#x2F;modules/node-scroll-info.html">node-scroll-info</a></li> <li><a href="..&#x2F;modules/node-style.html">node-style</a></li> <li><a href="..&#x2F;modules/oop.html">oop</a></li> <li><a href="..&#x2F;modules/overlay.html">overlay</a></li> <li><a href="..&#x2F;modules/panel.html">panel</a></li> <li><a href="..&#x2F;modules/parallel.html">parallel</a></li> <li><a href="..&#x2F;modules/pjax.html">pjax</a></li> <li><a href="..&#x2F;modules/pjax-base.html">pjax-base</a></li> <li><a href="..&#x2F;modules/pjax-content.html">pjax-content</a></li> <li><a href="..&#x2F;modules/pjax-plugin.html">pjax-plugin</a></li> <li><a href="..&#x2F;modules/plugin.html">plugin</a></li> <li><a href="..&#x2F;modules/pluginhost.html">pluginhost</a></li> <li><a href="..&#x2F;modules/pluginhost-base.html">pluginhost-base</a></li> <li><a href="..&#x2F;modules/pluginhost-config.html">pluginhost-config</a></li> <li><a href="..&#x2F;modules/profiler.html">profiler</a></li> <li><a href="..&#x2F;modules/querystring.html">querystring</a></li> <li><a href="..&#x2F;modules/querystring-parse.html">querystring-parse</a></li> <li><a href="..&#x2F;modules/querystring-parse-simple.html">querystring-parse-simple</a></li> <li><a href="..&#x2F;modules/querystring-stringify.html">querystring-stringify</a></li> <li><a href="..&#x2F;modules/querystring-stringify-simple.html">querystring-stringify-simple</a></li> <li><a href="..&#x2F;modules/queue-promote.html">queue-promote</a></li> <li><a href="..&#x2F;modules/range-slider.html">range-slider</a></li> <li><a href="..&#x2F;modules/recordset.html">recordset</a></li> <li><a href="..&#x2F;modules/recordset-base.html">recordset-base</a></li> <li><a href="..&#x2F;modules/recordset-filter.html">recordset-filter</a></li> <li><a href="..&#x2F;modules/recordset-indexer.html">recordset-indexer</a></li> <li><a href="..&#x2F;modules/recordset-sort.html">recordset-sort</a></li> <li><a href="..&#x2F;modules/resize.html">resize</a></li> <li><a href="..&#x2F;modules/resize-contrain.html">resize-contrain</a></li> <li><a href="..&#x2F;modules/resize-plugin.html">resize-plugin</a></li> <li><a href="..&#x2F;modules/resize-proxy.html">resize-proxy</a></li> <li><a href="..&#x2F;modules/rollup.html">rollup</a></li> <li><a href="..&#x2F;modules/router.html">router</a></li> <li><a href="..&#x2F;modules/scrollview.html">scrollview</a></li> <li><a href="..&#x2F;modules/scrollview-base.html">scrollview-base</a></li> <li><a href="..&#x2F;modules/scrollview-base-ie.html">scrollview-base-ie</a></li> <li><a href="..&#x2F;modules/scrollview-list.html">scrollview-list</a></li> <li><a href="..&#x2F;modules/scrollview-paginator.html">scrollview-paginator</a></li> <li><a href="..&#x2F;modules/scrollview-scrollbars.html">scrollview-scrollbars</a></li> <li><a href="..&#x2F;modules/selection.html">selection</a></li> <li><a href="..&#x2F;modules/selector-css2.html">selector-css2</a></li> <li><a href="..&#x2F;modules/selector-css3.html">selector-css3</a></li> <li><a href="..&#x2F;modules/selector-native.html">selector-native</a></li> <li><a href="..&#x2F;modules/shim-plugin.html">shim-plugin</a></li> <li><a href="..&#x2F;modules/slider.html">slider</a></li> <li><a href="..&#x2F;modules/slider-base.html">slider-base</a></li> <li><a href="..&#x2F;modules/slider-value-range.html">slider-value-range</a></li> <li><a href="..&#x2F;modules/sortable.html">sortable</a></li> <li><a href="..&#x2F;modules/sortable-scroll.html">sortable-scroll</a></li> <li><a href="..&#x2F;modules/stylesheet.html">stylesheet</a></li> <li><a href="..&#x2F;modules/substitute.html">substitute</a></li> <li><a href="..&#x2F;modules/swf.html">swf</a></li> <li><a href="..&#x2F;modules/swfdetect.html">swfdetect</a></li> <li><a href="..&#x2F;modules/tabview.html">tabview</a></li> <li><a href="..&#x2F;modules/test.html">test</a></li> <li><a href="..&#x2F;modules/test-console.html">test-console</a></li> <li><a href="..&#x2F;modules/text.html">text</a></li> <li><a href="..&#x2F;modules/text-accentfold.html">text-accentfold</a></li> <li><a href="..&#x2F;modules/text-wordbreak.html">text-wordbreak</a></li> <li><a href="..&#x2F;modules/transition.html">transition</a></li> <li><a href="..&#x2F;modules/transition-timer.html">transition-timer</a></li> <li><a href="..&#x2F;modules/uploader.html">uploader</a></li> <li><a href="..&#x2F;modules/uploader-deprecated.html">uploader-deprecated</a></li> <li><a href="..&#x2F;modules/uploader-flash.html">uploader-flash</a></li> <li><a href="..&#x2F;modules/uploader-html5.html">uploader-html5</a></li> <li><a href="..&#x2F;modules/uploader-queue.html">uploader-queue</a></li> <li><a href="..&#x2F;modules/view.html">view</a></li> <li><a href="..&#x2F;modules/view-node-map.html">view-node-map</a></li> <li><a href="..&#x2F;modules/widget.html">widget</a></li> <li><a href="..&#x2F;modules/widget-anim.html">widget-anim</a></li> <li><a href="..&#x2F;modules/widget-autohide.html">widget-autohide</a></li> <li><a href="..&#x2F;modules/widget-base.html">widget-base</a></li> <li><a href="..&#x2F;modules/widget-base-ie.html">widget-base-ie</a></li> <li><a href="..&#x2F;modules/widget-buttons.html">widget-buttons</a></li> <li><a href="..&#x2F;modules/widget-child.html">widget-child</a></li> <li><a href="..&#x2F;modules/widget-htmlparser.html">widget-htmlparser</a></li> <li><a href="..&#x2F;modules/widget-locale.html">widget-locale</a></li> <li><a href="..&#x2F;modules/widget-modality.html">widget-modality</a></li> <li><a href="..&#x2F;modules/widget-parent.html">widget-parent</a></li> <li><a href="..&#x2F;modules/widget-position.html">widget-position</a></li> <li><a href="..&#x2F;modules/widget-position-align.html">widget-position-align</a></li> <li><a href="..&#x2F;modules/widget-position-constrain.html">widget-position-constrain</a></li> <li><a href="..&#x2F;modules/widget-skin.html">widget-skin</a></li> <li><a href="..&#x2F;modules/widget-stack.html">widget-stack</a></li> <li><a href="..&#x2F;modules/widget-stdmod.html">widget-stdmod</a></li> <li><a href="..&#x2F;modules/widget-uievents.html">widget-uievents</a></li> <li><a href="..&#x2F;modules/yql.html">yql</a></li> <li><a href="..&#x2F;modules/yql-nodejs.html">yql-nodejs</a></li> <li><a href="..&#x2F;modules/yql-winjs.html">yql-winjs</a></li> <li><a href="..&#x2F;modules/yui.html">yui</a></li> <li><a href="..&#x2F;modules/yui-base.html">yui-base</a></li> <li><a href="..&#x2F;modules/yui-later.html">yui-later</a></li> <li><a href="..&#x2F;modules/yui-log.html">yui-log</a></li> <li><a href="..&#x2F;modules/yui-throttle.html">yui-throttle</a></li> <li><a href="..&#x2F;modules/yui3.html">yui3</a></li> </ul> <ul id="api-everything" class="apis everything aui-tabview-content-item"> <li class="message">Begin typing in the search box above to see results.</li> </ul> </div> </div> </div> </div> </div> <div class="yui3-u-3-4"> <div id="api-options"> Show: <label for="api-show-inherited"> <input type="checkbox" id="api-show-inherited" checked> Inherited </label> <label for="api-show-protected"> <input type="checkbox" id="api-show-protected"> Protected </label> <label for="api-show-private"> <input type="checkbox" id="api-show-private"> Private </label> </div> <div class="apidocs"> <div id="docs-main" class="content"> <h1 class="file-heading">File: lib&#x2F;yui3&#x2F;src&#x2F;yui&#x2F;js&#x2F;yui-array.js</h1> <div class="file"> <pre class="code prettyprint linenums"> &#x2F;** @module yui @submodule yui-base *&#x2F; var Lang = Y.Lang, Native = Array.prototype, hasOwn = Object.prototype.hasOwnProperty; &#x2F;** Provides utility methods for working with arrays. Additional array helpers can be found in the &#x60;collection&#x60; and &#x60;array-extras&#x60; modules. &#x60;Y.Array(thing)&#x60; returns a native array created from _thing_. Depending on _thing_&#x27;s type, one of the following will happen: * Arrays are returned unmodified unless a non-zero _startIndex_ is specified. * Array-like collections (see &#x60;Array.test()&#x60;) are converted to arrays. * For everything else, a new array is created with _thing_ as the sole item. Note: elements that are also collections, such as &#x60;&lt;form&gt;&#x60; and &#x60;&lt;select&gt;&#x60; elements, are not automatically converted to arrays. To force a conversion, pass &#x60;true&#x60; as the value of the _force_ parameter. @class Array @constructor @param {Any} thing The thing to arrayify. @param {Number} [startIndex=0] If non-zero and _thing_ is an array or array-like collection, a subset of items starting at the specified index will be returned. @param {Boolean} [force=false] If &#x60;true&#x60;, _thing_ will be treated as an array-like collection no matter what. @return {Array} A native array created from _thing_, according to the rules described above. **&#x2F; function YArray(thing, startIndex, force) { var len, result; startIndex || (startIndex = 0); if (force || YArray.test(thing)) { &#x2F;&#x2F; IE throws when trying to slice HTMLElement collections. try { return Native.slice.call(thing, startIndex); } catch (ex) { result = []; for (len = thing.length; startIndex &lt; len; ++startIndex) { result.push(thing[startIndex]); } return result; } } return [thing]; } Y.Array = YArray; &#x2F;** Dedupes an array of strings, returning an array that&#x27;s guaranteed to contain only one copy of a given string. This method differs from &#x60;Array.unique()&#x60; in that it&#x27;s optimized for use only with strings, whereas &#x60;unique&#x60; may be used with other types (but is slower). Using &#x60;dedupe()&#x60; with non-string values may result in unexpected behavior. @method dedupe @param {String[]} array Array of strings to dedupe. @return {Array} Deduped copy of _array_. @static @since 3.4.0 **&#x2F; YArray.dedupe = function (array) { var hash = {}, results = [], i, item, len; for (i = 0, len = array.length; i &lt; len; ++i) { item = array[i]; if (!hasOwn.call(hash, item)) { hash[item] = 1; results.push(item); } } return results; }; &#x2F;** Executes the supplied function on each item in the array. This method wraps the native ES5 &#x60;Array.forEach()&#x60; method if available. @method each @param {Array} array Array to iterate. @param {Function} fn Function to execute on each item in the array. The function will receive the following arguments: @param {Any} fn.item Current array item. @param {Number} fn.index Current array index. @param {Array} fn.array Array being iterated. @param {Object} [thisObj] &#x60;this&#x60; object to use when calling _fn_. @return {YUI} The YUI instance. @static **&#x2F; YArray.each = YArray.forEach = Lang._isNative(Native.forEach) ? function (array, fn, thisObj) { Native.forEach.call(array || [], fn, thisObj || Y); return Y; } : function (array, fn, thisObj) { for (var i = 0, len = (array &amp;&amp; array.length) || 0; i &lt; len; ++i) { if (i in array) { fn.call(thisObj || Y, array[i], i, array); } } return Y; }; &#x2F;** Alias for &#x60;each()&#x60;. @method forEach @static **&#x2F; &#x2F;** Returns an object using the first array as keys and the second as values. If the second array is not provided, or if it doesn&#x27;t contain the same number of values as the first array, then &#x60;true&#x60; will be used in place of the missing values. @example Y.Array.hash([&#x27;a&#x27;, &#x27;b&#x27;, &#x27;c&#x27;], [&#x27;foo&#x27;, &#x27;bar&#x27;]); &#x2F;&#x2F; =&gt; {a: &#x27;foo&#x27;, b: &#x27;bar&#x27;, c: true} @method hash @param {String[]} keys Array of strings to use as keys. @param {Array} [values] Array to use as values. @return {Object} Hash using the first array as keys and the second as values. @static **&#x2F; YArray.hash = function (keys, values) { var hash = {}, vlen = (values &amp;&amp; values.length) || 0, i, len; for (i = 0, len = keys.length; i &lt; len; ++i) { if (i in keys) { hash[keys[i]] = vlen &gt; i &amp;&amp; i in values ? values[i] : true; } } return hash; }; &#x2F;** Returns the index of the first item in the array that&#x27;s equal (using a strict equality check) to the specified _value_, or &#x60;-1&#x60; if the value isn&#x27;t found. This method wraps the native ES5 &#x60;Array.indexOf()&#x60; method if available. @method indexOf @param {Array} array Array to search. @param {Any} value Value to search for. @param {Number} [from=0] The index at which to begin the search. @return {Number} Index of the item strictly equal to _value_, or &#x60;-1&#x60; if not found. @static **&#x2F; YArray.indexOf = Lang._isNative(Native.indexOf) ? function (array, value, from) { return Native.indexOf.call(array, value, from); } : function (array, value, from) { &#x2F;&#x2F; http:&#x2F;&#x2F;es5.github.com&#x2F;#x15.4.4.14 var len = array.length; from = +from || 0; from = (from &gt; 0 || -1) * Math.floor(Math.abs(from)); if (from &lt; 0) { from += len; if (from &lt; 0) { from = 0; } } for (; from &lt; len; ++from) { if (from in array &amp;&amp; array[from] === value) { return from; } } return -1; }; &#x2F;** Numeric sort convenience function. The native &#x60;Array.prototype.sort()&#x60; function converts values to strings and sorts them in lexicographic order, which is unsuitable for sorting numeric values. Provide &#x60;Array.numericSort&#x60; as a custom sort function when you want to sort values in numeric order. @example [42, 23, 8, 16, 4, 15].sort(Y.Array.numericSort); &#x2F;&#x2F; =&gt; [4, 8, 15, 16, 23, 42] @method numericSort @param {Number} a First value to compare. @param {Number} b Second value to compare. @return {Number} Difference between _a_ and _b_. @static **&#x2F; YArray.numericSort = function (a, b) { return a - b; }; &#x2F;** Executes the supplied function on each item in the array. Returning a truthy value from the function will stop the processing of remaining items. @method some @param {Array} array Array to iterate over. @param {Function} fn Function to execute on each item. The function will receive the following arguments: @param {Any} fn.value Current array item. @param {Number} fn.index Current array index. @param {Array} fn.array Array being iterated over. @param {Object} [thisObj] &#x60;this&#x60; object to use when calling _fn_. @return {Boolean} &#x60;true&#x60; if the function returns a truthy value on any of the items in the array; &#x60;false&#x60; otherwise. @static **&#x2F; YArray.some = Lang._isNative(Native.some) ? function (array, fn, thisObj) { return Native.some.call(array, fn, thisObj); } : function (array, fn, thisObj) { for (var i = 0, len = array.length; i &lt; len; ++i) { if (i in array &amp;&amp; fn.call(thisObj, array[i], i, array)) { return true; } } return false; }; &#x2F;** Evaluates _obj_ to determine if it&#x27;s an array, an array-like collection, or something else. This is useful when working with the function &#x60;arguments&#x60; collection and &#x60;HTMLElement&#x60; collections. Note: This implementation doesn&#x27;t consider elements that are also collections, such as &#x60;&lt;form&gt;&#x60; and &#x60;&lt;select&gt;&#x60;, to be array-like. @method test @param {Object} obj Object to test. @return {Number} A number indicating the results of the test: * 0: Neither an array nor an array-like collection. * 1: Real array. * 2: Array-like collection. @static **&#x2F; YArray.test = function (obj) { var result = 0; if (Lang.isArray(obj)) { result = 1; } else if (Lang.isObject(obj)) { try { &#x2F;&#x2F; indexed, but no tagName (element) or scrollTo&#x2F;document (window. From DOM.isWindow test which we can&#x27;t use here), &#x2F;&#x2F; or functions without apply&#x2F;call (Safari &#x2F;&#x2F; HTMLElementCollection bug). if (&#x27;length&#x27; in obj &amp;&amp; !obj.tagName &amp;&amp; !(obj.scrollTo &amp;&amp; obj.document) &amp;&amp; !obj.apply) { result = 2; } } catch (ex) {} } return result; }; </pre> </div> </div> </div> </div> </div> </div> <script src="..&#x2F;assets/vendor/prettify/prettify-min.js"></script> <script>prettyPrint();</script> <script src="..&#x2F;assets/js/yui-prettify.js"></script> <!--script src="..&#x2F;assets/js/tabs.js"></script--> <script src="..&#x2F;assets/../api.js"></script> <script src="..&#x2F;assets/js/api-filter.js"></script> <script src="..&#x2F;assets/js/api-list.js"></script> <script src="..&#x2F;assets/js/api-search.js"></script> <script src="..&#x2F;assets/js/apidocs.js"></script> </body> </html>
giros/alloy-ui
api/files/lib_yui3_src_yui_js_yui-array.js.html
HTML
bsd-3-clause
87,481
/* * Copyright (c) 2019, salesforce.com, inc. * All rights reserved. * Licensed under the BSD 3-Clause license. * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ import { IParseResults, ItBlock, ParsedNode, ParsedNodeTypes } from 'jest-editor-support'; import { escapeStrForRegex } from 'jest-regex-util'; import stripAnsi from 'strip-ansi'; import * as vscode from 'vscode'; type ParsedNodeWithAncestorTitles = Pick< ParsedNode, Exclude<keyof ParsedNode, 'children'> > & { name?: string; ancestorTitles?: string[]; children?: ParsedNodeWithAncestorTitles[]; }; /** * Extended itBlock definition with ancestor titles */ export type ItBlockWithAncestorTitles = ItBlock & { ancestorTitles?: string[] }; /** * Extended parse results definition with extended itBlock definition */ export type IExtendedParseResults = Pick< IParseResults, Exclude<keyof IParseResults, 'root'> > & { root: ParsedNodeWithAncestorTitles; itBlocksWithAncestorTitles?: ItBlockWithAncestorTitles[]; }; function populateAncestorTitlesRecursive( node: ParsedNodeWithAncestorTitles, ancestorTitles: string[], itBlocksWithAncestorTitles: ItBlockWithAncestorTitles[] ) { node.ancestorTitles = ancestorTitles; if (node.type === ParsedNodeTypes.it) { itBlocksWithAncestorTitles.push(node as ItBlockWithAncestorTitles); } if ( node.type === ParsedNodeTypes.root || node.type === ParsedNodeTypes.describe ) { if (!node.children) { return; } node.children.forEach(childNode => { populateAncestorTitlesRecursive( childNode, node.name ? [...ancestorTitles, node.name] : ancestorTitles, itBlocksWithAncestorTitles ); }); } } /** * Populate ancestor titles for itBlocks * @param parsedResult original parse results */ export function populateAncestorTitles(parsedResult: IExtendedParseResults) { try { const itBlocksWithAncestorTitles: ItBlockWithAncestorTitles[] = []; populateAncestorTitlesRecursive( parsedResult.root, [], itBlocksWithAncestorTitles ); parsedResult.itBlocksWithAncestorTitles = itBlocksWithAncestorTitles; return parsedResult; } catch (error) { console.error(error); } } /** * Extract the VS Code position from failure message stacktrace in Jest output. * @param testFsPath test file path * @param failureMessage failure message from Jest output */ export function extractPositionFromFailureMessage( testFsPath: string, failureMessage: string ) { try { const locationMatcher = new RegExp( escapeStrForRegex(testFsPath) + '\\:(\\d+)\\:(\\d+)', 'i' ); const matchResult = failureMessage.match(locationMatcher); if (matchResult) { const lineString = matchResult[1]; const columnString = matchResult[2]; const line = parseInt(lineString, 10); const column = parseInt(columnString, 10); if (isNaN(line) || isNaN(column)) { return undefined; } return new vscode.Position(line - 1, column - 1); } return undefined; } catch (error) { return undefined; } } /** * Strip the ANSI color codes from failure message * @param failureMessage failure message from Jest output */ export function sanitizeFailureMessage(failureMessage: string) { return stripAnsi(failureMessage); }
forcedotcom/salesforcedx-vscode
packages/salesforcedx-vscode-lwc/src/testSupport/testIndexer/jestUtils.ts
TypeScript
bsd-3-clause
3,393
///////////////////////////////////////////////////////////////////////////// // Name: src/common/bmpbase.cpp // Purpose: wxBitmapBase // Author: VaclavSlavik // Created: 2001/04/11 // Copyright: (c) 2001, Vaclav Slavik // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" #include "wx/bitmap.h" #ifndef WX_PRECOMP #include "wx/colour.h" #include "wx/icon.h" #include "wx/image.h" #endif // WX_PRECOMP #if wxUSE_IMAGE && wxUSE_LIBPNG && wxUSE_STREAMS #define wxHAS_PNG_LOAD #include "wx/mstream.h" #endif // ---------------------------------------------------------------------------- // wxVariant support // ---------------------------------------------------------------------------- #if wxUSE_VARIANT IMPLEMENT_VARIANT_OBJECT_EXPORTED_SHALLOWCMP(wxBitmap,WXDLLEXPORT) IMPLEMENT_VARIANT_OBJECT_EXPORTED_SHALLOWCMP(wxIcon,WXDLLEXPORT) #endif #if wxUSE_EXTENDED_RTTI //WX_IMPLEMENT_ANY_VALUE_TYPE(wxAnyValueTypeImpl<wxBitmap>) //WX_IMPLEMENT_ANY_VALUE_TYPE(wxAnyValueTypeImpl<wxIcon>) #endif // ---------------------------------------------------------------------------- // wxBitmapHelpers // ---------------------------------------------------------------------------- // wxOSX has a native version and doesn't use this one. #ifndef __WXOSX__ /* static */ wxBitmap wxBitmapHelpers::NewFromPNGData(const void* data, size_t size) { wxBitmap bitmap; #ifdef wxHAS_PNG_LOAD wxMemoryInputStream is(data, size); wxImage image(is, wxBITMAP_TYPE_PNG); if ( image.IsOk() ) bitmap = wxBitmap(image); #endif // wxHAS_PNG_LOAD return bitmap; } #endif // !__WXOSX__ // ---------------------------------------------------------------------------- // wxBitmapBase // ---------------------------------------------------------------------------- #if wxUSE_BITMAP_BASE #ifndef WX_PRECOMP #include "wx/log.h" #include "wx/utils.h" #include "wx/palette.h" #include "wx/module.h" #endif // WX_PRECOMP wxIMPLEMENT_ABSTRACT_CLASS(wxBitmapBase, wxGDIObject); wxIMPLEMENT_ABSTRACT_CLASS(wxBitmapHandler, wxObject); wxList wxBitmapBase::sm_handlers; void wxBitmapBase::AddHandler(wxBitmapHandler *handler) { sm_handlers.Append(handler); } void wxBitmapBase::InsertHandler(wxBitmapHandler *handler) { sm_handlers.Insert(handler); } bool wxBitmapBase::RemoveHandler(const wxString& name) { wxBitmapHandler *handler = FindHandler(name); if ( handler ) { sm_handlers.DeleteObject(handler); return true; } else return false; } wxBitmapHandler *wxBitmapBase::FindHandler(const wxString& name) { wxList::compatibility_iterator node = sm_handlers.GetFirst(); while ( node ) { wxBitmapHandler *handler = (wxBitmapHandler *)node->GetData(); if ( handler->GetName() == name ) return handler; node = node->GetNext(); } return NULL; } wxBitmapHandler *wxBitmapBase::FindHandler(const wxString& extension, wxBitmapType bitmapType) { wxList::compatibility_iterator node = sm_handlers.GetFirst(); while ( node ) { wxBitmapHandler *handler = (wxBitmapHandler *)node->GetData(); if ( handler->GetExtension() == extension && (bitmapType == wxBITMAP_TYPE_ANY || handler->GetType() == bitmapType) ) return handler; node = node->GetNext(); } return NULL; } wxBitmapHandler *wxBitmapBase::FindHandler(wxBitmapType bitmapType) { wxList::compatibility_iterator node = sm_handlers.GetFirst(); while ( node ) { wxBitmapHandler *handler = (wxBitmapHandler *)node->GetData(); if (handler->GetType() == bitmapType) return handler; node = node->GetNext(); } return NULL; } void wxBitmapBase::CleanUpHandlers() { wxList::compatibility_iterator node = sm_handlers.GetFirst(); while ( node ) { wxBitmapHandler *handler = (wxBitmapHandler *)node->GetData(); wxList::compatibility_iterator next = node->GetNext(); delete handler; sm_handlers.Erase(node); node = next; } } class wxBitmapBaseModule: public wxModule { wxDECLARE_DYNAMIC_CLASS(wxBitmapBaseModule); public: wxBitmapBaseModule() {} bool OnInit() wxOVERRIDE { wxBitmap::InitStandardHandlers(); return true; } void OnExit() wxOVERRIDE { wxBitmap::CleanUpHandlers(); } }; wxIMPLEMENT_DYNAMIC_CLASS(wxBitmapBaseModule, wxModule); #endif // wxUSE_BITMAP_BASE // ---------------------------------------------------------------------------- // wxBitmap common // ---------------------------------------------------------------------------- #if !(defined(__WXGTK__) || defined(__WXMOTIF__) || defined(__WXX11__) || defined(__WXQT__)) wxBitmap::wxBitmap(const char* const* bits) { wxCHECK2_MSG(bits != NULL, return, wxT("invalid bitmap data")); #if wxUSE_IMAGE && wxUSE_XPM wxImage image(bits); wxCHECK2_MSG(image.IsOk(), return, wxT("invalid bitmap data")); *this = wxBitmap(image); #else wxFAIL_MSG(wxT("creating bitmaps from XPMs not supported")); #endif // wxUSE_IMAGE && wxUSE_XPM } #endif // !(defined(__WXGTK__) || defined(__WXMOTIF__) || defined(__WXX11__)) // ---------------------------------------------------------------------------- // wxMaskBase // ---------------------------------------------------------------------------- bool wxMaskBase::Create(const wxBitmap& bitmap, const wxColour& colour) { FreeData(); return InitFromColour(bitmap, colour); } #if wxUSE_PALETTE bool wxMaskBase::Create(const wxBitmap& bitmap, int paletteIndex) { wxPalette *pal = bitmap.GetPalette(); wxCHECK_MSG( pal, false, wxT("Cannot create mask from palette index of a bitmap without palette") ); unsigned char r,g,b; pal->GetRGB(paletteIndex, &r, &g, &b); return Create(bitmap, wxColour(r, g, b)); } #endif // wxUSE_PALETTE bool wxMaskBase::Create(const wxBitmap& bitmap) { FreeData(); return InitFromMonoBitmap(bitmap); }
ric2b/Vivaldi-browser
update_notifier/thirdparty/wxWidgets/src/common/bmpbase.cpp
C++
bsd-3-clause
6,174
/* * Copyright (c) 2010, Anima Games, Benjamin Karaban, Laurent Schneider, * Jérémie Comarmond, Didier Colin. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * - Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * - Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * - Neither the name of the copyright holder nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef UNIVERSE_PARTREPRESENTATIONBILLBOARD_H_ #define UNIVERSE_PARTREPRESENTATIONBILLBOARD_H_ #include <Renderer/IBillboard.h> #include <Universe/RessourcePool.h> #include <Universe/Particles/IPartRepresentation.h> namespace Universe { class World; class LM_API_UNI PartRepresentationBillboard : public Core::Object, public IPartRepresentation { public: PartRepresentationBillboard(World & pWorld); PartRepresentationBillboard(const Ptr<RessourcePool> & pRessourcesPool, const Ptr<Renderer::IBillboardGroup> & pBill); virtual void setMaxSize(int32 maxSize); virtual int32 getMaxSize() const; virtual void setPartScale(float s); virtual float getPartScale() const; virtual EPartRepresentation getType() const { return PR_BILLBOARD; }; virtual void setColorFactor(float f); virtual float getColorFactor() const; virtual void setGlowFactor(float f); virtual float getGlowFactor() const; virtual void setZBias(float z) { _pBill->setZBias(z); } virtual float getZBias() const { return _pBill->getZBias(); } virtual void setFogFactor(float f) { _pBill->setFogFactor(f); } virtual float getFogFactor() const { return _pBill->getFogFactor(); } virtual void update(const Core::List<Particle> & particles); virtual void setWorldMatrix(const Core::Matrix4f & matrix); virtual void setVisible(bool flag); virtual void kill(); virtual Core::AABoxf getBoundingBox() const; virtual const String & getTexture() const; virtual void setTexture(const String & name); virtual Renderer::EBillboardMode getMode() const; virtual void setMode(Renderer::EBillboardMode mode); virtual void setAlign(Renderer::EBillboardAlign align); virtual Renderer::EBillboardAlign getAlign() const; virtual void setAlignVector(const Core::Vector3f & vec); virtual const Core::Vector3f & getAlignVector() const; virtual void setSpriteLayout(int32 uCount, int32 vCount) { _pBill->setSpriteLayout(uCount, vCount); }; virtual int32 getUSpriteLayout() const { return _pBill->getUSpriteLayout(); }; virtual int32 getVSpriteLayout() const { return _pBill->getVSpriteLayout(); }; virtual void setSpriteSmooth(bool s) { _pBill->setSpriteSmooth(s); }; virtual bool isSpriteSmooth() const { return _pBill->isSpriteSmooth(); }; virtual bool hasSpriteLayout() const { return _pBill->hasSpriteLayout(); }; virtual void importXML(const Ptr<Core::XMLNode> & pNode); virtual void exportXML(const Ptr<Core::XMLNode> & pNode); protected: Ptr<RessourcePool> _pRessourcesPool; Ptr<Renderer::IBillboardGroup> _pBill; String _textureName; }; } #endif /* PARTREPRESENTATIONBILLBOARD_H_ */
benkaraban/anima-games-engine
Sources/Modules/Universe/Particles/PartRepresentationBillboard.h
C
bsd-3-clause
4,488
PKG_NAME = lcms2 PKG_VERS = 2.4 PKG_EXT = tar.gz PKG_DIST_NAME = $(PKG_NAME)-$(PKG_VERS).$(PKG_EXT) PKG_DIST_SITE = http://download.sourceforge.net/project/lcms/lcms/$(PKG_VERS) PKG_DIR = $(PKG_NAME)-$(PKG_VERS) DEPENDS = HOMEPAGE = http://www.littlecms.com/ COMMENT = Little CMS intends to be an OPEN SOURCE small-footprint color management engine, with special focus on accuracy and performance LICENSE = MIT License GNU_CONFIGURE = 1 include ../../mk/spksrc.cross-cc.mk
Ximi1970/spksrc-ximi
cross/lcms2/Makefile
Makefile
bsd-3-clause
479
# Rubysl::Iconv TODO: Write a gem description ## Installation Add this line to your application's Gemfile: gem 'rubysl-iconv' And then execute: $ bundle Or install it yourself as: $ gem install rubysl-iconv ## Usage TODO: Write usage instructions here ## Contributing 1. Fork it 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
rubysl/rubysl-iconv
README.md
Markdown
bsd-3-clause
513
#include <Python.h> #include "database.h" #include "log.h" #include "tracer.h" PyObject *Err_Base; /** * Makes a C string from a Python unicode or bytes object. * * If successful, the result is a string that the caller must free(). * Else, returns NULL. */ static char *get_string(PyObject *obj) { if(PyUnicode_Check(obj)) { const char *str; PyObject *pyutf8 = PyUnicode_AsUTF8String(obj); if(pyutf8 == NULL) return NULL; #if PY_MAJOR_VERSION >= 3 str = PyBytes_AsString(pyutf8); #else str = PyString_AsString(pyutf8); #endif if(str == NULL) return NULL; { char *ret = strdup(str); Py_DECREF(pyutf8); return ret; } } else if( #if PY_MAJOR_VERSION >= 3 PyBytes_Check(obj) #else PyString_Check(obj) #endif ) { const char *str; #if PY_MAJOR_VERSION >= 3 str = PyBytes_AsString(obj); #else str = PyString_AsString(obj); #endif if(str == NULL) return NULL; return strdup(str); } else return NULL; } static PyObject *pytracer_execute(PyObject *self, PyObject *args) { PyObject *ret = NULL; int exit_status; char *binary = NULL, *databasepath = NULL; char **argv = NULL; size_t argv_len; PyObject *py_binary, *py_argv, *py_databasepath; if(log_setup() != 0) { /* LCOV_EXCL_START : Can't fail unless Python is in a broken state */ PyErr_SetString(Err_Base, "Error occurred"); return NULL; /* LCOV_EXCL_STOP */ } /* Reads arguments */ if(!PyArg_ParseTuple(args, "OO!O", &py_binary, &PyList_Type, &py_argv, &py_databasepath)) return NULL; binary = get_string(py_binary); if(binary == NULL) goto done; databasepath = get_string(py_databasepath); if(databasepath == NULL) goto done; /* Converts argv from Python list to char[][] */ { size_t i; int bad = 0; argv_len = PyList_Size(py_argv); argv = malloc((argv_len + 1) * sizeof(char*)); for(i = 0; i < argv_len; ++i) { PyObject *arg = PyList_GetItem(py_argv, i); char *str = get_string(arg); if(str == NULL) { bad = 1; break; } argv[i] = str; } if(bad) { size_t j; for(j = 0; j < i; ++j) free(argv[j]); free(argv); argv = NULL; goto done; } argv[argv_len] = NULL; } if(fork_and_trace(binary, argv_len, argv, databasepath, &exit_status) == 0) { ret = PyLong_FromLong(exit_status); } else { PyErr_SetString(Err_Base, "Error occurred"); ret = NULL; } done: free(binary); free(databasepath); /* Deallocs argv */ if(argv) { size_t i; for(i = 0; i < argv_len; ++i) free(argv[i]); free(argv); } return ret; } static PyMethodDef methods[] = { {"execute", pytracer_execute, METH_VARARGS, "execute(binary, argv, databasepath)\n" "\n" "Runs the specified binary with the argument list argv under trace and " "writes\nthe captured events to SQLite3 database databasepath."}, { NULL, NULL, 0, NULL } }; #if PY_MAJOR_VERSION >= 3 static struct PyModuleDef moduledef = { PyModuleDef_HEAD_INIT, "reprozip._pytracer", /* m_name */ "C interface to tracer", /* m_doc */ -1, /* m_size */ methods, /* m_methods */ NULL, /* m_reload */ NULL, /* m_traverse */ NULL, /* m_clear */ NULL, /* m_free */ }; #endif #if PY_MAJOR_VERSION >= 3 PyMODINIT_FUNC PyInit__pytracer(void) #else PyMODINIT_FUNC init_pytracer(void) #endif { PyObject *mod; #if PY_MAJOR_VERSION >= 3 mod = PyModule_Create(&moduledef); #else mod = Py_InitModule("reprozip._pytracer", methods); #endif if(mod == NULL) { #if PY_MAJOR_VERSION >= 3 return NULL; #else return; #endif } Err_Base = PyErr_NewException("_pytracer.Error", NULL, NULL); Py_INCREF(Err_Base); PyModule_AddObject(mod, "Error", Err_Base); #if PY_MAJOR_VERSION >= 3 return mod; #endif }
ViDA-NYU/reprozip
reprozip/native/pytracer.c
C
bsd-3-clause
4,552
from rpython.jit.codewriter.policy import JitPolicy from topaz.main import create_entry_point, get_topaz_config_options def target(driver, args): driver.exe_name = "bin/topaz" driver.config.set(**get_topaz_config_options()) return create_entry_point(driver.config), None def jitpolicy(driver): return JitPolicy() def handle_config(config, translateconfig): from rpython.translator.platform import host_factory max_stack_size = 11 << 18 # 2.8 Megs if host_factory.name == 'msvc': host_factory.cflags += ('/DMAX_STACK_SIZE=%d' % max_stack_size,) elif host_factory.name in ('linux', 'darwin'): host_factory.cflags += ('-DMAX_STACK_SIZE=%d' % max_stack_size,) config.translation.suggest(check_str_without_nul=True)
topazproject/topaz
targettopaz.py
Python
bsd-3-clause
771
# Misc. shell functions # =========================================================================== # --------------------------------------------------------------------------- # Is the shell ZSH or Bash? is_zsh() { [ -n "$ZSH_VERSION" ] && return 0 return 1 } not_zsh() { is_zsh && return 1 return 0 } is_bash() { [ -n "$BASH_VERSION" ] && return 0 return 1 } # --------------------------------------------------------------------------- # Loop over a string and call a function with each individual # parsed-out string. An additional argument may be passed to the function. # Keeps looping as long as the function returns 0. loop_over_var() { _sep=${1?'Missing separator to use'} _func=${2?'Missing function to call'} _str=${3?'Missing string to parse and loop over'} _extra=$4 if is_zsh then oldIFS=$IFS IFS=$_sep for v in ${=_str} do $_func $v "$_extra" [[ $? -eq 0 ]] || break done IFS=$oldIFS else extra="$4" oldIFS=$IFS IFS=$_sep set -- $_str for v in "$@" do $_func $v "$extra" [[ $? -eq 0 ]] || break done unset _set _func _str _extra IFS=$oldIFS fi } # --------------------------------------------------------------------------- # Load arbitrary file. Looks in current directory. Then, if BASH_PATH is set, # looks in those directories. Doesn't complain if the file isn't found. _dot_this() { if [ -r "$1/$2" ] then . "$1/$2" return 1 fi return 0 } # 'load_file' is a conditional 'source' command that searches # SH_LOAD_FILE_PATH for the file to be loaded. It works for both Bash and # ZSH. load_file() { file="$1" if [ "$file" != "$(basename $file)" ] then # Not a simple path. Don't search. [[ -r "$file" ]] && . "$file" else loop_over_var : _dot_this "$SH_LOAD_FILE_PATH" "$file" fi } # --------------------------------------------------------------------------- # Portable readlink xreadlink() { case "$PLATFORM" in darwin|freebsd) readlink -n $1 ;; linux) readlink -n -e $1 ;; *) echo "xreadlink: Unknown platform: $PLATFORM" >&2 return 1 esac } # --------------------------------------------------------------------------- # "which": Like the old BSD "which" command, sort of. Really, it's a portable # way to do either "type -p" (zsh) or "type -P" (bash). which() { : ${1?'Missing command to find'} if is_zsh then whence -p "$1" else type -P "$1" fi } # --------------------------------------------------------------------------- # The shell is interactive if the list of command-line options (in shell # built-in variable $-) contains an "i". interactive() { case "$-" in *i*) return 0 ;; *) return 1 ;; esac }
bmc/lib-sh
misc-funcs.sh
Shell
bsd-3-clause
3,034
/* this file has been autogenerated by vtkNodeJsWrap */ /* editing this might proof futile */ #define VTK_WRAPPING_CXX #define VTK_STREAMS_FWD_ONLY #include <nan.h> #include "vtkObjectWrap.h" #include "vtkExtractStructuredGridHelperWrap.h" #include "vtkPointDataWrap.h" #include "vtkPointsWrap.h" #include "vtkCellDataWrap.h" #include "../../plus/plus.h" using namespace v8; extern Nan::Persistent<v8::Object> vtkNodeJsNoWrap; Nan::Persistent<v8::FunctionTemplate> VtkExtractStructuredGridHelperWrap::ptpl; VtkExtractStructuredGridHelperWrap::VtkExtractStructuredGridHelperWrap() { } VtkExtractStructuredGridHelperWrap::VtkExtractStructuredGridHelperWrap(vtkSmartPointer<vtkExtractStructuredGridHelper> _native) { native = _native; } VtkExtractStructuredGridHelperWrap::~VtkExtractStructuredGridHelperWrap() { } void VtkExtractStructuredGridHelperWrap::Init(v8::Local<v8::Object> exports) { Nan::SetAccessor(exports, Nan::New("vtkExtractStructuredGridHelper").ToLocalChecked(), ConstructorGetter); Nan::SetAccessor(exports, Nan::New("ExtractStructuredGridHelper").ToLocalChecked(), ConstructorGetter); } void VtkExtractStructuredGridHelperWrap::ConstructorGetter( v8::Local<v8::String> property, const Nan::PropertyCallbackInfo<v8::Value>& info) { InitPtpl(); info.GetReturnValue().Set(Nan::New(ptpl)->GetFunction()); } void VtkExtractStructuredGridHelperWrap::InitPtpl() { if (!ptpl.IsEmpty()) return; v8::Local<v8::FunctionTemplate> tpl = Nan::New<v8::FunctionTemplate>(New); VtkObjectWrap::InitPtpl( ); tpl->Inherit(Nan::New<FunctionTemplate>(VtkObjectWrap::ptpl)); tpl->SetClassName(Nan::New("VtkExtractStructuredGridHelperWrap").ToLocalChecked()); tpl->InstanceTemplate()->SetInternalFieldCount(1); Nan::SetPrototypeMethod(tpl, "ComputeBeginAndEnd", ComputeBeginAndEnd); Nan::SetPrototypeMethod(tpl, "computeBeginAndEnd", ComputeBeginAndEnd); Nan::SetPrototypeMethod(tpl, "CopyCellData", CopyCellData); Nan::SetPrototypeMethod(tpl, "copyCellData", CopyCellData); Nan::SetPrototypeMethod(tpl, "CopyPointsAndPointData", CopyPointsAndPointData); Nan::SetPrototypeMethod(tpl, "copyPointsAndPointData", CopyPointsAndPointData); Nan::SetPrototypeMethod(tpl, "GetClassName", GetClassName); Nan::SetPrototypeMethod(tpl, "getClassName", GetClassName); Nan::SetPrototypeMethod(tpl, "GetMappedExtentValue", GetMappedExtentValue); Nan::SetPrototypeMethod(tpl, "getMappedExtentValue", GetMappedExtentValue); Nan::SetPrototypeMethod(tpl, "GetMappedExtentValueFromIndex", GetMappedExtentValueFromIndex); Nan::SetPrototypeMethod(tpl, "getMappedExtentValueFromIndex", GetMappedExtentValueFromIndex); Nan::SetPrototypeMethod(tpl, "GetMappedIndex", GetMappedIndex); Nan::SetPrototypeMethod(tpl, "getMappedIndex", GetMappedIndex); Nan::SetPrototypeMethod(tpl, "GetMappedIndexFromExtentValue", GetMappedIndexFromExtentValue); Nan::SetPrototypeMethod(tpl, "getMappedIndexFromExtentValue", GetMappedIndexFromExtentValue); Nan::SetPrototypeMethod(tpl, "GetOutputWholeExtent", GetOutputWholeExtent); Nan::SetPrototypeMethod(tpl, "getOutputWholeExtent", GetOutputWholeExtent); Nan::SetPrototypeMethod(tpl, "GetPartitionedOutputExtent", GetPartitionedOutputExtent); Nan::SetPrototypeMethod(tpl, "getPartitionedOutputExtent", GetPartitionedOutputExtent); Nan::SetPrototypeMethod(tpl, "GetPartitionedVOI", GetPartitionedVOI); Nan::SetPrototypeMethod(tpl, "getPartitionedVOI", GetPartitionedVOI); Nan::SetPrototypeMethod(tpl, "GetSize", GetSize); Nan::SetPrototypeMethod(tpl, "getSize", GetSize); Nan::SetPrototypeMethod(tpl, "Initialize", Initialize); Nan::SetPrototypeMethod(tpl, "initialize", Initialize); Nan::SetPrototypeMethod(tpl, "IsA", IsA); Nan::SetPrototypeMethod(tpl, "isA", IsA); Nan::SetPrototypeMethod(tpl, "IsValid", IsValid); Nan::SetPrototypeMethod(tpl, "isValid", IsValid); Nan::SetPrototypeMethod(tpl, "NewInstance", NewInstance); Nan::SetPrototypeMethod(tpl, "newInstance", NewInstance); Nan::SetPrototypeMethod(tpl, "SafeDownCast", SafeDownCast); Nan::SetPrototypeMethod(tpl, "safeDownCast", SafeDownCast); #ifdef VTK_NODE_PLUS_VTKEXTRACTSTRUCTUREDGRIDHELPERWRAP_INITPTPL VTK_NODE_PLUS_VTKEXTRACTSTRUCTUREDGRIDHELPERWRAP_INITPTPL #endif ptpl.Reset( tpl ); } void VtkExtractStructuredGridHelperWrap::New(const Nan::FunctionCallbackInfo<v8::Value>& info) { if(!info.IsConstructCall()) { Nan::ThrowError("Constructor not called in a construct call."); return; } if(info.Length() == 0) { vtkSmartPointer<vtkExtractStructuredGridHelper> native = vtkSmartPointer<vtkExtractStructuredGridHelper>::New(); VtkExtractStructuredGridHelperWrap* obj = new VtkExtractStructuredGridHelperWrap(native); obj->Wrap(info.This()); } else { if(info[0]->ToObject() != vtkNodeJsNoWrap ) { Nan::ThrowError("Parameter Error"); return; } } info.GetReturnValue().Set(info.This()); } void VtkExtractStructuredGridHelperWrap::ComputeBeginAndEnd(const Nan::FunctionCallbackInfo<v8::Value>& info) { VtkExtractStructuredGridHelperWrap *wrapper = ObjectWrap::Unwrap<VtkExtractStructuredGridHelperWrap>(info.Holder()); vtkExtractStructuredGridHelper *native = (vtkExtractStructuredGridHelper *)wrapper->native.GetPointer(); size_t i; if(info.Length() > 0 && info[0]->IsInt32Array()) { v8::Local<v8::Int32Array>a0(v8::Local<v8::Int32Array>::Cast(info[0]->ToObject())); if( a0->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() > 1 && info[1]->IsInt32Array()) { v8::Local<v8::Int32Array>a1(v8::Local<v8::Int32Array>::Cast(info[1]->ToObject())); if( a1->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() > 2 && info[2]->IsInt32Array()) { v8::Local<v8::Int32Array>a2(v8::Local<v8::Int32Array>::Cast(info[2]->ToObject())); if( a2->Length() < 3 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() > 3 && info[3]->IsInt32Array()) { v8::Local<v8::Int32Array>a3(v8::Local<v8::Int32Array>::Cast(info[3]->ToObject())); if( a3->Length() < 3 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() != 4) { Nan::ThrowError("Too many parameters."); return; } native->ComputeBeginAndEnd( (int *)(a0->Buffer()->GetContents().Data()), (int *)(a1->Buffer()->GetContents().Data()), (int *)(a2->Buffer()->GetContents().Data()), (int *)(a3->Buffer()->GetContents().Data()) ); return; } else if(info.Length() > 3 && info[3]->IsArray()) { v8::Local<v8::Array>a3(v8::Local<v8::Array>::Cast(info[3]->ToObject())); int b3[3]; if( a3->Length() < 3 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 3; i++ ) { if( !a3->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b3[i] = a3->Get(i)->Int32Value(); } if(info.Length() != 4) { Nan::ThrowError("Too many parameters."); return; } native->ComputeBeginAndEnd( (int *)(a0->Buffer()->GetContents().Data()), (int *)(a1->Buffer()->GetContents().Data()), (int *)(a2->Buffer()->GetContents().Data()), b3 ); return; } } else if(info.Length() > 2 && info[2]->IsArray()) { v8::Local<v8::Array>a2(v8::Local<v8::Array>::Cast(info[2]->ToObject())); int b2[3]; if( a2->Length() < 3 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 3; i++ ) { if( !a2->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b2[i] = a2->Get(i)->Int32Value(); } if(info.Length() > 3 && info[3]->IsArray()) { v8::Local<v8::Array>a3(v8::Local<v8::Array>::Cast(info[3]->ToObject())); int b3[3]; if( a3->Length() < 3 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 3; i++ ) { if( !a3->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b3[i] = a3->Get(i)->Int32Value(); } if(info.Length() != 4) { Nan::ThrowError("Too many parameters."); return; } native->ComputeBeginAndEnd( (int *)(a0->Buffer()->GetContents().Data()), (int *)(a1->Buffer()->GetContents().Data()), b2, b3 ); return; } } } else if(info.Length() > 1 && info[1]->IsArray()) { v8::Local<v8::Array>a1(v8::Local<v8::Array>::Cast(info[1]->ToObject())); int b1[6]; if( a1->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 6; i++ ) { if( !a1->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b1[i] = a1->Get(i)->Int32Value(); } if(info.Length() > 2 && info[2]->IsArray()) { v8::Local<v8::Array>a2(v8::Local<v8::Array>::Cast(info[2]->ToObject())); int b2[3]; if( a2->Length() < 3 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 3; i++ ) { if( !a2->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b2[i] = a2->Get(i)->Int32Value(); } if(info.Length() > 3 && info[3]->IsArray()) { v8::Local<v8::Array>a3(v8::Local<v8::Array>::Cast(info[3]->ToObject())); int b3[3]; if( a3->Length() < 3 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 3; i++ ) { if( !a3->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b3[i] = a3->Get(i)->Int32Value(); } if(info.Length() != 4) { Nan::ThrowError("Too many parameters."); return; } native->ComputeBeginAndEnd( (int *)(a0->Buffer()->GetContents().Data()), b1, b2, b3 ); return; } } } } else if(info.Length() > 0 && info[0]->IsArray()) { v8::Local<v8::Array>a0(v8::Local<v8::Array>::Cast(info[0]->ToObject())); int b0[6]; if( a0->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 6; i++ ) { if( !a0->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b0[i] = a0->Get(i)->Int32Value(); } if(info.Length() > 1 && info[1]->IsArray()) { v8::Local<v8::Array>a1(v8::Local<v8::Array>::Cast(info[1]->ToObject())); int b1[6]; if( a1->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 6; i++ ) { if( !a1->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b1[i] = a1->Get(i)->Int32Value(); } if(info.Length() > 2 && info[2]->IsArray()) { v8::Local<v8::Array>a2(v8::Local<v8::Array>::Cast(info[2]->ToObject())); int b2[3]; if( a2->Length() < 3 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 3; i++ ) { if( !a2->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b2[i] = a2->Get(i)->Int32Value(); } if(info.Length() > 3 && info[3]->IsArray()) { v8::Local<v8::Array>a3(v8::Local<v8::Array>::Cast(info[3]->ToObject())); int b3[3]; if( a3->Length() < 3 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 3; i++ ) { if( !a3->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b3[i] = a3->Get(i)->Int32Value(); } if(info.Length() != 4) { Nan::ThrowError("Too many parameters."); return; } native->ComputeBeginAndEnd( b0, b1, b2, b3 ); return; } } } else if(info.Length() > 1 && info[1]->IsInt32Array()) { v8::Local<v8::Int32Array>a1(v8::Local<v8::Int32Array>::Cast(info[1]->ToObject())); if( a1->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() > 2 && info[2]->IsArray()) { v8::Local<v8::Array>a2(v8::Local<v8::Array>::Cast(info[2]->ToObject())); int b2[3]; if( a2->Length() < 3 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 3; i++ ) { if( !a2->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b2[i] = a2->Get(i)->Int32Value(); } if(info.Length() > 3 && info[3]->IsArray()) { v8::Local<v8::Array>a3(v8::Local<v8::Array>::Cast(info[3]->ToObject())); int b3[3]; if( a3->Length() < 3 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 3; i++ ) { if( !a3->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b3[i] = a3->Get(i)->Int32Value(); } if(info.Length() != 4) { Nan::ThrowError("Too many parameters."); return; } native->ComputeBeginAndEnd( b0, (int *)(a1->Buffer()->GetContents().Data()), b2, b3 ); return; } } } } else if(info.Length() > 0 && info[0]->IsInt32Array()) { v8::Local<v8::Int32Array>a0(v8::Local<v8::Int32Array>::Cast(info[0]->ToObject())); if( a0->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() > 1 && info[1]->IsArray()) { v8::Local<v8::Array>a1(v8::Local<v8::Array>::Cast(info[1]->ToObject())); int b1[6]; if( a1->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 6; i++ ) { if( !a1->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b1[i] = a1->Get(i)->Int32Value(); } if(info.Length() > 2 && info[2]->IsInt32Array()) { v8::Local<v8::Int32Array>a2(v8::Local<v8::Int32Array>::Cast(info[2]->ToObject())); if( a2->Length() < 3 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() > 3 && info[3]->IsArray()) { v8::Local<v8::Array>a3(v8::Local<v8::Array>::Cast(info[3]->ToObject())); int b3[3]; if( a3->Length() < 3 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 3; i++ ) { if( !a3->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b3[i] = a3->Get(i)->Int32Value(); } if(info.Length() != 4) { Nan::ThrowError("Too many parameters."); return; } native->ComputeBeginAndEnd( (int *)(a0->Buffer()->GetContents().Data()), b1, (int *)(a2->Buffer()->GetContents().Data()), b3 ); return; } } } } else if(info.Length() > 0 && info[0]->IsArray()) { v8::Local<v8::Array>a0(v8::Local<v8::Array>::Cast(info[0]->ToObject())); int b0[6]; if( a0->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 6; i++ ) { if( !a0->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b0[i] = a0->Get(i)->Int32Value(); } if(info.Length() > 1 && info[1]->IsArray()) { v8::Local<v8::Array>a1(v8::Local<v8::Array>::Cast(info[1]->ToObject())); int b1[6]; if( a1->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 6; i++ ) { if( !a1->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b1[i] = a1->Get(i)->Int32Value(); } if(info.Length() > 2 && info[2]->IsInt32Array()) { v8::Local<v8::Int32Array>a2(v8::Local<v8::Int32Array>::Cast(info[2]->ToObject())); if( a2->Length() < 3 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() > 3 && info[3]->IsArray()) { v8::Local<v8::Array>a3(v8::Local<v8::Array>::Cast(info[3]->ToObject())); int b3[3]; if( a3->Length() < 3 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 3; i++ ) { if( !a3->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b3[i] = a3->Get(i)->Int32Value(); } if(info.Length() != 4) { Nan::ThrowError("Too many parameters."); return; } native->ComputeBeginAndEnd( b0, b1, (int *)(a2->Buffer()->GetContents().Data()), b3 ); return; } } } else if(info.Length() > 1 && info[1]->IsInt32Array()) { v8::Local<v8::Int32Array>a1(v8::Local<v8::Int32Array>::Cast(info[1]->ToObject())); if( a1->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() > 2 && info[2]->IsInt32Array()) { v8::Local<v8::Int32Array>a2(v8::Local<v8::Int32Array>::Cast(info[2]->ToObject())); if( a2->Length() < 3 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() > 3 && info[3]->IsArray()) { v8::Local<v8::Array>a3(v8::Local<v8::Array>::Cast(info[3]->ToObject())); int b3[3]; if( a3->Length() < 3 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 3; i++ ) { if( !a3->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b3[i] = a3->Get(i)->Int32Value(); } if(info.Length() != 4) { Nan::ThrowError("Too many parameters."); return; } native->ComputeBeginAndEnd( b0, (int *)(a1->Buffer()->GetContents().Data()), (int *)(a2->Buffer()->GetContents().Data()), b3 ); return; } } } } else if(info.Length() > 0 && info[0]->IsInt32Array()) { v8::Local<v8::Int32Array>a0(v8::Local<v8::Int32Array>::Cast(info[0]->ToObject())); if( a0->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() > 1 && info[1]->IsInt32Array()) { v8::Local<v8::Int32Array>a1(v8::Local<v8::Int32Array>::Cast(info[1]->ToObject())); if( a1->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() > 2 && info[2]->IsArray()) { v8::Local<v8::Array>a2(v8::Local<v8::Array>::Cast(info[2]->ToObject())); int b2[3]; if( a2->Length() < 3 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 3; i++ ) { if( !a2->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b2[i] = a2->Get(i)->Int32Value(); } if(info.Length() > 3 && info[3]->IsInt32Array()) { v8::Local<v8::Int32Array>a3(v8::Local<v8::Int32Array>::Cast(info[3]->ToObject())); if( a3->Length() < 3 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() != 4) { Nan::ThrowError("Too many parameters."); return; } native->ComputeBeginAndEnd( (int *)(a0->Buffer()->GetContents().Data()), (int *)(a1->Buffer()->GetContents().Data()), b2, (int *)(a3->Buffer()->GetContents().Data()) ); return; } } } else if(info.Length() > 1 && info[1]->IsArray()) { v8::Local<v8::Array>a1(v8::Local<v8::Array>::Cast(info[1]->ToObject())); int b1[6]; if( a1->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 6; i++ ) { if( !a1->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b1[i] = a1->Get(i)->Int32Value(); } if(info.Length() > 2 && info[2]->IsArray()) { v8::Local<v8::Array>a2(v8::Local<v8::Array>::Cast(info[2]->ToObject())); int b2[3]; if( a2->Length() < 3 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 3; i++ ) { if( !a2->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b2[i] = a2->Get(i)->Int32Value(); } if(info.Length() > 3 && info[3]->IsInt32Array()) { v8::Local<v8::Int32Array>a3(v8::Local<v8::Int32Array>::Cast(info[3]->ToObject())); if( a3->Length() < 3 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() != 4) { Nan::ThrowError("Too many parameters."); return; } native->ComputeBeginAndEnd( (int *)(a0->Buffer()->GetContents().Data()), b1, b2, (int *)(a3->Buffer()->GetContents().Data()) ); return; } } } } else if(info.Length() > 0 && info[0]->IsArray()) { v8::Local<v8::Array>a0(v8::Local<v8::Array>::Cast(info[0]->ToObject())); int b0[6]; if( a0->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 6; i++ ) { if( !a0->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b0[i] = a0->Get(i)->Int32Value(); } if(info.Length() > 1 && info[1]->IsArray()) { v8::Local<v8::Array>a1(v8::Local<v8::Array>::Cast(info[1]->ToObject())); int b1[6]; if( a1->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 6; i++ ) { if( !a1->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b1[i] = a1->Get(i)->Int32Value(); } if(info.Length() > 2 && info[2]->IsArray()) { v8::Local<v8::Array>a2(v8::Local<v8::Array>::Cast(info[2]->ToObject())); int b2[3]; if( a2->Length() < 3 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 3; i++ ) { if( !a2->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b2[i] = a2->Get(i)->Int32Value(); } if(info.Length() > 3 && info[3]->IsInt32Array()) { v8::Local<v8::Int32Array>a3(v8::Local<v8::Int32Array>::Cast(info[3]->ToObject())); if( a3->Length() < 3 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() != 4) { Nan::ThrowError("Too many parameters."); return; } native->ComputeBeginAndEnd( b0, b1, b2, (int *)(a3->Buffer()->GetContents().Data()) ); return; } } } else if(info.Length() > 1 && info[1]->IsInt32Array()) { v8::Local<v8::Int32Array>a1(v8::Local<v8::Int32Array>::Cast(info[1]->ToObject())); if( a1->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() > 2 && info[2]->IsArray()) { v8::Local<v8::Array>a2(v8::Local<v8::Array>::Cast(info[2]->ToObject())); int b2[3]; if( a2->Length() < 3 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 3; i++ ) { if( !a2->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b2[i] = a2->Get(i)->Int32Value(); } if(info.Length() > 3 && info[3]->IsInt32Array()) { v8::Local<v8::Int32Array>a3(v8::Local<v8::Int32Array>::Cast(info[3]->ToObject())); if( a3->Length() < 3 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() != 4) { Nan::ThrowError("Too many parameters."); return; } native->ComputeBeginAndEnd( b0, (int *)(a1->Buffer()->GetContents().Data()), b2, (int *)(a3->Buffer()->GetContents().Data()) ); return; } } } } else if(info.Length() > 0 && info[0]->IsInt32Array()) { v8::Local<v8::Int32Array>a0(v8::Local<v8::Int32Array>::Cast(info[0]->ToObject())); if( a0->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() > 1 && info[1]->IsArray()) { v8::Local<v8::Array>a1(v8::Local<v8::Array>::Cast(info[1]->ToObject())); int b1[6]; if( a1->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 6; i++ ) { if( !a1->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b1[i] = a1->Get(i)->Int32Value(); } if(info.Length() > 2 && info[2]->IsInt32Array()) { v8::Local<v8::Int32Array>a2(v8::Local<v8::Int32Array>::Cast(info[2]->ToObject())); if( a2->Length() < 3 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() > 3 && info[3]->IsInt32Array()) { v8::Local<v8::Int32Array>a3(v8::Local<v8::Int32Array>::Cast(info[3]->ToObject())); if( a3->Length() < 3 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() != 4) { Nan::ThrowError("Too many parameters."); return; } native->ComputeBeginAndEnd( (int *)(a0->Buffer()->GetContents().Data()), b1, (int *)(a2->Buffer()->GetContents().Data()), (int *)(a3->Buffer()->GetContents().Data()) ); return; } } } } else if(info.Length() > 0 && info[0]->IsArray()) { v8::Local<v8::Array>a0(v8::Local<v8::Array>::Cast(info[0]->ToObject())); int b0[6]; if( a0->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 6; i++ ) { if( !a0->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b0[i] = a0->Get(i)->Int32Value(); } if(info.Length() > 1 && info[1]->IsArray()) { v8::Local<v8::Array>a1(v8::Local<v8::Array>::Cast(info[1]->ToObject())); int b1[6]; if( a1->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 6; i++ ) { if( !a1->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b1[i] = a1->Get(i)->Int32Value(); } if(info.Length() > 2 && info[2]->IsInt32Array()) { v8::Local<v8::Int32Array>a2(v8::Local<v8::Int32Array>::Cast(info[2]->ToObject())); if( a2->Length() < 3 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() > 3 && info[3]->IsInt32Array()) { v8::Local<v8::Int32Array>a3(v8::Local<v8::Int32Array>::Cast(info[3]->ToObject())); if( a3->Length() < 3 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() != 4) { Nan::ThrowError("Too many parameters."); return; } native->ComputeBeginAndEnd( b0, b1, (int *)(a2->Buffer()->GetContents().Data()), (int *)(a3->Buffer()->GetContents().Data()) ); return; } } } else if(info.Length() > 1 && info[1]->IsInt32Array()) { v8::Local<v8::Int32Array>a1(v8::Local<v8::Int32Array>::Cast(info[1]->ToObject())); if( a1->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() > 2 && info[2]->IsInt32Array()) { v8::Local<v8::Int32Array>a2(v8::Local<v8::Int32Array>::Cast(info[2]->ToObject())); if( a2->Length() < 3 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() > 3 && info[3]->IsInt32Array()) { v8::Local<v8::Int32Array>a3(v8::Local<v8::Int32Array>::Cast(info[3]->ToObject())); if( a3->Length() < 3 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() != 4) { Nan::ThrowError("Too many parameters."); return; } native->ComputeBeginAndEnd( b0, (int *)(a1->Buffer()->GetContents().Data()), (int *)(a2->Buffer()->GetContents().Data()), (int *)(a3->Buffer()->GetContents().Data()) ); return; } } } } Nan::ThrowError("Parameter mismatch"); } void VtkExtractStructuredGridHelperWrap::CopyCellData(const Nan::FunctionCallbackInfo<v8::Value>& info) { VtkExtractStructuredGridHelperWrap *wrapper = ObjectWrap::Unwrap<VtkExtractStructuredGridHelperWrap>(info.Holder()); vtkExtractStructuredGridHelper *native = (vtkExtractStructuredGridHelper *)wrapper->native.GetPointer(); size_t i; if(info.Length() > 0 && info[0]->IsInt32Array()) { v8::Local<v8::Int32Array>a0(v8::Local<v8::Int32Array>::Cast(info[0]->ToObject())); if( a0->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() > 1 && info[1]->IsInt32Array()) { v8::Local<v8::Int32Array>a1(v8::Local<v8::Int32Array>::Cast(info[1]->ToObject())); if( a1->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() > 2 && info[2]->IsObject() && (Nan::New(VtkCellDataWrap::ptpl))->HasInstance(info[2])) { VtkCellDataWrap *a2 = ObjectWrap::Unwrap<VtkCellDataWrap>(info[2]->ToObject()); if(info.Length() > 3 && info[3]->IsObject() && (Nan::New(VtkCellDataWrap::ptpl))->HasInstance(info[3])) { VtkCellDataWrap *a3 = ObjectWrap::Unwrap<VtkCellDataWrap>(info[3]->ToObject()); if(info.Length() != 4) { Nan::ThrowError("Too many parameters."); return; } native->CopyCellData( (int *)(a0->Buffer()->GetContents().Data()), (int *)(a1->Buffer()->GetContents().Data()), (vtkCellData *) a2->native.GetPointer(), (vtkCellData *) a3->native.GetPointer() ); return; } } } else if(info.Length() > 1 && info[1]->IsArray()) { v8::Local<v8::Array>a1(v8::Local<v8::Array>::Cast(info[1]->ToObject())); int b1[6]; if( a1->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 6; i++ ) { if( !a1->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b1[i] = a1->Get(i)->Int32Value(); } if(info.Length() > 2 && info[2]->IsObject() && (Nan::New(VtkCellDataWrap::ptpl))->HasInstance(info[2])) { VtkCellDataWrap *a2 = ObjectWrap::Unwrap<VtkCellDataWrap>(info[2]->ToObject()); if(info.Length() > 3 && info[3]->IsObject() && (Nan::New(VtkCellDataWrap::ptpl))->HasInstance(info[3])) { VtkCellDataWrap *a3 = ObjectWrap::Unwrap<VtkCellDataWrap>(info[3]->ToObject()); if(info.Length() != 4) { Nan::ThrowError("Too many parameters."); return; } native->CopyCellData( (int *)(a0->Buffer()->GetContents().Data()), b1, (vtkCellData *) a2->native.GetPointer(), (vtkCellData *) a3->native.GetPointer() ); return; } } } } else if(info.Length() > 0 && info[0]->IsArray()) { v8::Local<v8::Array>a0(v8::Local<v8::Array>::Cast(info[0]->ToObject())); int b0[6]; if( a0->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 6; i++ ) { if( !a0->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b0[i] = a0->Get(i)->Int32Value(); } if(info.Length() > 1 && info[1]->IsArray()) { v8::Local<v8::Array>a1(v8::Local<v8::Array>::Cast(info[1]->ToObject())); int b1[6]; if( a1->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 6; i++ ) { if( !a1->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b1[i] = a1->Get(i)->Int32Value(); } if(info.Length() > 2 && info[2]->IsObject() && (Nan::New(VtkCellDataWrap::ptpl))->HasInstance(info[2])) { VtkCellDataWrap *a2 = ObjectWrap::Unwrap<VtkCellDataWrap>(info[2]->ToObject()); if(info.Length() > 3 && info[3]->IsObject() && (Nan::New(VtkCellDataWrap::ptpl))->HasInstance(info[3])) { VtkCellDataWrap *a3 = ObjectWrap::Unwrap<VtkCellDataWrap>(info[3]->ToObject()); if(info.Length() != 4) { Nan::ThrowError("Too many parameters."); return; } native->CopyCellData( b0, b1, (vtkCellData *) a2->native.GetPointer(), (vtkCellData *) a3->native.GetPointer() ); return; } } } else if(info.Length() > 1 && info[1]->IsInt32Array()) { v8::Local<v8::Int32Array>a1(v8::Local<v8::Int32Array>::Cast(info[1]->ToObject())); if( a1->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() > 2 && info[2]->IsObject() && (Nan::New(VtkCellDataWrap::ptpl))->HasInstance(info[2])) { VtkCellDataWrap *a2 = ObjectWrap::Unwrap<VtkCellDataWrap>(info[2]->ToObject()); if(info.Length() > 3 && info[3]->IsObject() && (Nan::New(VtkCellDataWrap::ptpl))->HasInstance(info[3])) { VtkCellDataWrap *a3 = ObjectWrap::Unwrap<VtkCellDataWrap>(info[3]->ToObject()); if(info.Length() != 4) { Nan::ThrowError("Too many parameters."); return; } native->CopyCellData( b0, (int *)(a1->Buffer()->GetContents().Data()), (vtkCellData *) a2->native.GetPointer(), (vtkCellData *) a3->native.GetPointer() ); return; } } } } Nan::ThrowError("Parameter mismatch"); } void VtkExtractStructuredGridHelperWrap::CopyPointsAndPointData(const Nan::FunctionCallbackInfo<v8::Value>& info) { VtkExtractStructuredGridHelperWrap *wrapper = ObjectWrap::Unwrap<VtkExtractStructuredGridHelperWrap>(info.Holder()); vtkExtractStructuredGridHelper *native = (vtkExtractStructuredGridHelper *)wrapper->native.GetPointer(); size_t i; if(info.Length() > 0 && info[0]->IsInt32Array()) { v8::Local<v8::Int32Array>a0(v8::Local<v8::Int32Array>::Cast(info[0]->ToObject())); if( a0->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() > 1 && info[1]->IsInt32Array()) { v8::Local<v8::Int32Array>a1(v8::Local<v8::Int32Array>::Cast(info[1]->ToObject())); if( a1->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() > 2 && info[2]->IsObject() && (Nan::New(VtkPointDataWrap::ptpl))->HasInstance(info[2])) { VtkPointDataWrap *a2 = ObjectWrap::Unwrap<VtkPointDataWrap>(info[2]->ToObject()); if(info.Length() > 3 && info[3]->IsObject() && (Nan::New(VtkPointsWrap::ptpl))->HasInstance(info[3])) { VtkPointsWrap *a3 = ObjectWrap::Unwrap<VtkPointsWrap>(info[3]->ToObject()); if(info.Length() > 4 && info[4]->IsObject() && (Nan::New(VtkPointDataWrap::ptpl))->HasInstance(info[4])) { VtkPointDataWrap *a4 = ObjectWrap::Unwrap<VtkPointDataWrap>(info[4]->ToObject()); if(info.Length() > 5 && info[5]->IsObject() && (Nan::New(VtkPointsWrap::ptpl))->HasInstance(info[5])) { VtkPointsWrap *a5 = ObjectWrap::Unwrap<VtkPointsWrap>(info[5]->ToObject()); if(info.Length() != 6) { Nan::ThrowError("Too many parameters."); return; } native->CopyPointsAndPointData( (int *)(a0->Buffer()->GetContents().Data()), (int *)(a1->Buffer()->GetContents().Data()), (vtkPointData *) a2->native.GetPointer(), (vtkPoints *) a3->native.GetPointer(), (vtkPointData *) a4->native.GetPointer(), (vtkPoints *) a5->native.GetPointer() ); return; } } } } } else if(info.Length() > 1 && info[1]->IsArray()) { v8::Local<v8::Array>a1(v8::Local<v8::Array>::Cast(info[1]->ToObject())); int b1[6]; if( a1->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 6; i++ ) { if( !a1->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b1[i] = a1->Get(i)->Int32Value(); } if(info.Length() > 2 && info[2]->IsObject() && (Nan::New(VtkPointDataWrap::ptpl))->HasInstance(info[2])) { VtkPointDataWrap *a2 = ObjectWrap::Unwrap<VtkPointDataWrap>(info[2]->ToObject()); if(info.Length() > 3 && info[3]->IsObject() && (Nan::New(VtkPointsWrap::ptpl))->HasInstance(info[3])) { VtkPointsWrap *a3 = ObjectWrap::Unwrap<VtkPointsWrap>(info[3]->ToObject()); if(info.Length() > 4 && info[4]->IsObject() && (Nan::New(VtkPointDataWrap::ptpl))->HasInstance(info[4])) { VtkPointDataWrap *a4 = ObjectWrap::Unwrap<VtkPointDataWrap>(info[4]->ToObject()); if(info.Length() > 5 && info[5]->IsObject() && (Nan::New(VtkPointsWrap::ptpl))->HasInstance(info[5])) { VtkPointsWrap *a5 = ObjectWrap::Unwrap<VtkPointsWrap>(info[5]->ToObject()); if(info.Length() != 6) { Nan::ThrowError("Too many parameters."); return; } native->CopyPointsAndPointData( (int *)(a0->Buffer()->GetContents().Data()), b1, (vtkPointData *) a2->native.GetPointer(), (vtkPoints *) a3->native.GetPointer(), (vtkPointData *) a4->native.GetPointer(), (vtkPoints *) a5->native.GetPointer() ); return; } } } } } } else if(info.Length() > 0 && info[0]->IsArray()) { v8::Local<v8::Array>a0(v8::Local<v8::Array>::Cast(info[0]->ToObject())); int b0[6]; if( a0->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 6; i++ ) { if( !a0->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b0[i] = a0->Get(i)->Int32Value(); } if(info.Length() > 1 && info[1]->IsArray()) { v8::Local<v8::Array>a1(v8::Local<v8::Array>::Cast(info[1]->ToObject())); int b1[6]; if( a1->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 6; i++ ) { if( !a1->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b1[i] = a1->Get(i)->Int32Value(); } if(info.Length() > 2 && info[2]->IsObject() && (Nan::New(VtkPointDataWrap::ptpl))->HasInstance(info[2])) { VtkPointDataWrap *a2 = ObjectWrap::Unwrap<VtkPointDataWrap>(info[2]->ToObject()); if(info.Length() > 3 && info[3]->IsObject() && (Nan::New(VtkPointsWrap::ptpl))->HasInstance(info[3])) { VtkPointsWrap *a3 = ObjectWrap::Unwrap<VtkPointsWrap>(info[3]->ToObject()); if(info.Length() > 4 && info[4]->IsObject() && (Nan::New(VtkPointDataWrap::ptpl))->HasInstance(info[4])) { VtkPointDataWrap *a4 = ObjectWrap::Unwrap<VtkPointDataWrap>(info[4]->ToObject()); if(info.Length() > 5 && info[5]->IsObject() && (Nan::New(VtkPointsWrap::ptpl))->HasInstance(info[5])) { VtkPointsWrap *a5 = ObjectWrap::Unwrap<VtkPointsWrap>(info[5]->ToObject()); if(info.Length() != 6) { Nan::ThrowError("Too many parameters."); return; } native->CopyPointsAndPointData( b0, b1, (vtkPointData *) a2->native.GetPointer(), (vtkPoints *) a3->native.GetPointer(), (vtkPointData *) a4->native.GetPointer(), (vtkPoints *) a5->native.GetPointer() ); return; } } } } } else if(info.Length() > 1 && info[1]->IsInt32Array()) { v8::Local<v8::Int32Array>a1(v8::Local<v8::Int32Array>::Cast(info[1]->ToObject())); if( a1->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() > 2 && info[2]->IsObject() && (Nan::New(VtkPointDataWrap::ptpl))->HasInstance(info[2])) { VtkPointDataWrap *a2 = ObjectWrap::Unwrap<VtkPointDataWrap>(info[2]->ToObject()); if(info.Length() > 3 && info[3]->IsObject() && (Nan::New(VtkPointsWrap::ptpl))->HasInstance(info[3])) { VtkPointsWrap *a3 = ObjectWrap::Unwrap<VtkPointsWrap>(info[3]->ToObject()); if(info.Length() > 4 && info[4]->IsObject() && (Nan::New(VtkPointDataWrap::ptpl))->HasInstance(info[4])) { VtkPointDataWrap *a4 = ObjectWrap::Unwrap<VtkPointDataWrap>(info[4]->ToObject()); if(info.Length() > 5 && info[5]->IsObject() && (Nan::New(VtkPointsWrap::ptpl))->HasInstance(info[5])) { VtkPointsWrap *a5 = ObjectWrap::Unwrap<VtkPointsWrap>(info[5]->ToObject()); if(info.Length() != 6) { Nan::ThrowError("Too many parameters."); return; } native->CopyPointsAndPointData( b0, (int *)(a1->Buffer()->GetContents().Data()), (vtkPointData *) a2->native.GetPointer(), (vtkPoints *) a3->native.GetPointer(), (vtkPointData *) a4->native.GetPointer(), (vtkPoints *) a5->native.GetPointer() ); return; } } } } } } Nan::ThrowError("Parameter mismatch"); } void VtkExtractStructuredGridHelperWrap::GetClassName(const Nan::FunctionCallbackInfo<v8::Value>& info) { VtkExtractStructuredGridHelperWrap *wrapper = ObjectWrap::Unwrap<VtkExtractStructuredGridHelperWrap>(info.Holder()); vtkExtractStructuredGridHelper *native = (vtkExtractStructuredGridHelper *)wrapper->native.GetPointer(); char const * r; if(info.Length() != 0) { Nan::ThrowError("Too many parameters."); return; } r = native->GetClassName(); info.GetReturnValue().Set(Nan::New(r).ToLocalChecked()); } void VtkExtractStructuredGridHelperWrap::GetMappedExtentValue(const Nan::FunctionCallbackInfo<v8::Value>& info) { VtkExtractStructuredGridHelperWrap *wrapper = ObjectWrap::Unwrap<VtkExtractStructuredGridHelperWrap>(info.Holder()); vtkExtractStructuredGridHelper *native = (vtkExtractStructuredGridHelper *)wrapper->native.GetPointer(); if(info.Length() > 0 && info[0]->IsInt32()) { if(info.Length() > 1 && info[1]->IsInt32()) { int r; if(info.Length() != 2) { Nan::ThrowError("Too many parameters."); return; } r = native->GetMappedExtentValue( info[0]->Int32Value(), info[1]->Int32Value() ); info.GetReturnValue().Set(Nan::New(r)); return; } } Nan::ThrowError("Parameter mismatch"); } void VtkExtractStructuredGridHelperWrap::GetMappedExtentValueFromIndex(const Nan::FunctionCallbackInfo<v8::Value>& info) { VtkExtractStructuredGridHelperWrap *wrapper = ObjectWrap::Unwrap<VtkExtractStructuredGridHelperWrap>(info.Holder()); vtkExtractStructuredGridHelper *native = (vtkExtractStructuredGridHelper *)wrapper->native.GetPointer(); if(info.Length() > 0 && info[0]->IsInt32()) { if(info.Length() > 1 && info[1]->IsInt32()) { int r; if(info.Length() != 2) { Nan::ThrowError("Too many parameters."); return; } r = native->GetMappedExtentValueFromIndex( info[0]->Int32Value(), info[1]->Int32Value() ); info.GetReturnValue().Set(Nan::New(r)); return; } } Nan::ThrowError("Parameter mismatch"); } void VtkExtractStructuredGridHelperWrap::GetMappedIndex(const Nan::FunctionCallbackInfo<v8::Value>& info) { VtkExtractStructuredGridHelperWrap *wrapper = ObjectWrap::Unwrap<VtkExtractStructuredGridHelperWrap>(info.Holder()); vtkExtractStructuredGridHelper *native = (vtkExtractStructuredGridHelper *)wrapper->native.GetPointer(); if(info.Length() > 0 && info[0]->IsInt32()) { if(info.Length() > 1 && info[1]->IsInt32()) { int r; if(info.Length() != 2) { Nan::ThrowError("Too many parameters."); return; } r = native->GetMappedIndex( info[0]->Int32Value(), info[1]->Int32Value() ); info.GetReturnValue().Set(Nan::New(r)); return; } } Nan::ThrowError("Parameter mismatch"); } void VtkExtractStructuredGridHelperWrap::GetMappedIndexFromExtentValue(const Nan::FunctionCallbackInfo<v8::Value>& info) { VtkExtractStructuredGridHelperWrap *wrapper = ObjectWrap::Unwrap<VtkExtractStructuredGridHelperWrap>(info.Holder()); vtkExtractStructuredGridHelper *native = (vtkExtractStructuredGridHelper *)wrapper->native.GetPointer(); if(info.Length() > 0 && info[0]->IsInt32()) { if(info.Length() > 1 && info[1]->IsInt32()) { int r; if(info.Length() != 2) { Nan::ThrowError("Too many parameters."); return; } r = native->GetMappedIndexFromExtentValue( info[0]->Int32Value(), info[1]->Int32Value() ); info.GetReturnValue().Set(Nan::New(r)); return; } } Nan::ThrowError("Parameter mismatch"); } void VtkExtractStructuredGridHelperWrap::GetOutputWholeExtent(const Nan::FunctionCallbackInfo<v8::Value>& info) { VtkExtractStructuredGridHelperWrap *wrapper = ObjectWrap::Unwrap<VtkExtractStructuredGridHelperWrap>(info.Holder()); vtkExtractStructuredGridHelper *native = (vtkExtractStructuredGridHelper *)wrapper->native.GetPointer(); int const * r; if(info.Length() != 0) { Nan::ThrowError("Too many parameters."); return; } r = native->GetOutputWholeExtent(); Local<v8::ArrayBuffer> ab = v8::ArrayBuffer::New(v8::Isolate::GetCurrent(), 6 * sizeof(int)); Local<v8::Int32Array> at = v8::Int32Array::New(ab, 0, 6); memcpy(ab->GetContents().Data(), r, 6 * sizeof(int)); info.GetReturnValue().Set(at); } void VtkExtractStructuredGridHelperWrap::GetPartitionedOutputExtent(const Nan::FunctionCallbackInfo<v8::Value>& info) { VtkExtractStructuredGridHelperWrap *wrapper = ObjectWrap::Unwrap<VtkExtractStructuredGridHelperWrap>(info.Holder()); vtkExtractStructuredGridHelper *native = (vtkExtractStructuredGridHelper *)wrapper->native.GetPointer(); size_t i; if(info.Length() > 0 && info[0]->IsInt32Array()) { v8::Local<v8::Int32Array>a0(v8::Local<v8::Int32Array>::Cast(info[0]->ToObject())); if( a0->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() > 1 && info[1]->IsInt32Array()) { v8::Local<v8::Int32Array>a1(v8::Local<v8::Int32Array>::Cast(info[1]->ToObject())); if( a1->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() > 2 && info[2]->IsInt32Array()) { v8::Local<v8::Int32Array>a2(v8::Local<v8::Int32Array>::Cast(info[2]->ToObject())); if( a2->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() > 3 && info[3]->IsInt32Array()) { v8::Local<v8::Int32Array>a3(v8::Local<v8::Int32Array>::Cast(info[3]->ToObject())); if( a3->Length() < 3 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() > 4 && info[4]->IsBoolean()) { if(info.Length() > 5 && info[5]->IsInt32Array()) { v8::Local<v8::Int32Array>a5(v8::Local<v8::Int32Array>::Cast(info[5]->ToObject())); if( a5->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() != 6) { Nan::ThrowError("Too many parameters."); return; } native->GetPartitionedOutputExtent( (int *)(a0->Buffer()->GetContents().Data()), (int *)(a1->Buffer()->GetContents().Data()), (int *)(a2->Buffer()->GetContents().Data()), (int *)(a3->Buffer()->GetContents().Data()), info[4]->BooleanValue(), (int *)(a5->Buffer()->GetContents().Data()) ); return; } else if(info.Length() > 5 && info[5]->IsArray()) { v8::Local<v8::Array>a5(v8::Local<v8::Array>::Cast(info[5]->ToObject())); int b5[6]; if( a5->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 6; i++ ) { if( !a5->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b5[i] = a5->Get(i)->Int32Value(); } if(info.Length() != 6) { Nan::ThrowError("Too many parameters."); return; } native->GetPartitionedOutputExtent( (int *)(a0->Buffer()->GetContents().Data()), (int *)(a1->Buffer()->GetContents().Data()), (int *)(a2->Buffer()->GetContents().Data()), (int *)(a3->Buffer()->GetContents().Data()), info[4]->BooleanValue(), b5 ); return; } } } else if(info.Length() > 3 && info[3]->IsArray()) { v8::Local<v8::Array>a3(v8::Local<v8::Array>::Cast(info[3]->ToObject())); int b3[3]; if( a3->Length() < 3 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 3; i++ ) { if( !a3->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b3[i] = a3->Get(i)->Int32Value(); } if(info.Length() > 4 && info[4]->IsBoolean()) { if(info.Length() > 5 && info[5]->IsArray()) { v8::Local<v8::Array>a5(v8::Local<v8::Array>::Cast(info[5]->ToObject())); int b5[6]; if( a5->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 6; i++ ) { if( !a5->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b5[i] = a5->Get(i)->Int32Value(); } if(info.Length() != 6) { Nan::ThrowError("Too many parameters."); return; } native->GetPartitionedOutputExtent( (int *)(a0->Buffer()->GetContents().Data()), (int *)(a1->Buffer()->GetContents().Data()), (int *)(a2->Buffer()->GetContents().Data()), b3, info[4]->BooleanValue(), b5 ); return; } } } } else if(info.Length() > 2 && info[2]->IsArray()) { v8::Local<v8::Array>a2(v8::Local<v8::Array>::Cast(info[2]->ToObject())); int b2[6]; if( a2->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 6; i++ ) { if( !a2->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b2[i] = a2->Get(i)->Int32Value(); } if(info.Length() > 3 && info[3]->IsArray()) { v8::Local<v8::Array>a3(v8::Local<v8::Array>::Cast(info[3]->ToObject())); int b3[3]; if( a3->Length() < 3 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 3; i++ ) { if( !a3->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b3[i] = a3->Get(i)->Int32Value(); } if(info.Length() > 4 && info[4]->IsBoolean()) { if(info.Length() > 5 && info[5]->IsArray()) { v8::Local<v8::Array>a5(v8::Local<v8::Array>::Cast(info[5]->ToObject())); int b5[6]; if( a5->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 6; i++ ) { if( !a5->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b5[i] = a5->Get(i)->Int32Value(); } if(info.Length() != 6) { Nan::ThrowError("Too many parameters."); return; } native->GetPartitionedOutputExtent( (int *)(a0->Buffer()->GetContents().Data()), (int *)(a1->Buffer()->GetContents().Data()), b2, b3, info[4]->BooleanValue(), b5 ); return; } } } } } else if(info.Length() > 1 && info[1]->IsArray()) { v8::Local<v8::Array>a1(v8::Local<v8::Array>::Cast(info[1]->ToObject())); int b1[6]; if( a1->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 6; i++ ) { if( !a1->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b1[i] = a1->Get(i)->Int32Value(); } if(info.Length() > 2 && info[2]->IsArray()) { v8::Local<v8::Array>a2(v8::Local<v8::Array>::Cast(info[2]->ToObject())); int b2[6]; if( a2->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 6; i++ ) { if( !a2->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b2[i] = a2->Get(i)->Int32Value(); } if(info.Length() > 3 && info[3]->IsArray()) { v8::Local<v8::Array>a3(v8::Local<v8::Array>::Cast(info[3]->ToObject())); int b3[3]; if( a3->Length() < 3 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 3; i++ ) { if( !a3->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b3[i] = a3->Get(i)->Int32Value(); } if(info.Length() > 4 && info[4]->IsBoolean()) { if(info.Length() > 5 && info[5]->IsArray()) { v8::Local<v8::Array>a5(v8::Local<v8::Array>::Cast(info[5]->ToObject())); int b5[6]; if( a5->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 6; i++ ) { if( !a5->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b5[i] = a5->Get(i)->Int32Value(); } if(info.Length() != 6) { Nan::ThrowError("Too many parameters."); return; } native->GetPartitionedOutputExtent( (int *)(a0->Buffer()->GetContents().Data()), b1, b2, b3, info[4]->BooleanValue(), b5 ); return; } } } } } } else if(info.Length() > 0 && info[0]->IsArray()) { v8::Local<v8::Array>a0(v8::Local<v8::Array>::Cast(info[0]->ToObject())); int b0[6]; if( a0->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 6; i++ ) { if( !a0->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b0[i] = a0->Get(i)->Int32Value(); } if(info.Length() > 1 && info[1]->IsArray()) { v8::Local<v8::Array>a1(v8::Local<v8::Array>::Cast(info[1]->ToObject())); int b1[6]; if( a1->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 6; i++ ) { if( !a1->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b1[i] = a1->Get(i)->Int32Value(); } if(info.Length() > 2 && info[2]->IsArray()) { v8::Local<v8::Array>a2(v8::Local<v8::Array>::Cast(info[2]->ToObject())); int b2[6]; if( a2->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 6; i++ ) { if( !a2->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b2[i] = a2->Get(i)->Int32Value(); } if(info.Length() > 3 && info[3]->IsArray()) { v8::Local<v8::Array>a3(v8::Local<v8::Array>::Cast(info[3]->ToObject())); int b3[3]; if( a3->Length() < 3 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 3; i++ ) { if( !a3->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b3[i] = a3->Get(i)->Int32Value(); } if(info.Length() > 4 && info[4]->IsBoolean()) { if(info.Length() > 5 && info[5]->IsArray()) { v8::Local<v8::Array>a5(v8::Local<v8::Array>::Cast(info[5]->ToObject())); int b5[6]; if( a5->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 6; i++ ) { if( !a5->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b5[i] = a5->Get(i)->Int32Value(); } if(info.Length() != 6) { Nan::ThrowError("Too many parameters."); return; } native->GetPartitionedOutputExtent( b0, b1, b2, b3, info[4]->BooleanValue(), b5 ); return; } } } } } else if(info.Length() > 1 && info[1]->IsInt32Array()) { v8::Local<v8::Int32Array>a1(v8::Local<v8::Int32Array>::Cast(info[1]->ToObject())); if( a1->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() > 2 && info[2]->IsArray()) { v8::Local<v8::Array>a2(v8::Local<v8::Array>::Cast(info[2]->ToObject())); int b2[6]; if( a2->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 6; i++ ) { if( !a2->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b2[i] = a2->Get(i)->Int32Value(); } if(info.Length() > 3 && info[3]->IsArray()) { v8::Local<v8::Array>a3(v8::Local<v8::Array>::Cast(info[3]->ToObject())); int b3[3]; if( a3->Length() < 3 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 3; i++ ) { if( !a3->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b3[i] = a3->Get(i)->Int32Value(); } if(info.Length() > 4 && info[4]->IsBoolean()) { if(info.Length() > 5 && info[5]->IsArray()) { v8::Local<v8::Array>a5(v8::Local<v8::Array>::Cast(info[5]->ToObject())); int b5[6]; if( a5->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 6; i++ ) { if( !a5->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b5[i] = a5->Get(i)->Int32Value(); } if(info.Length() != 6) { Nan::ThrowError("Too many parameters."); return; } native->GetPartitionedOutputExtent( b0, (int *)(a1->Buffer()->GetContents().Data()), b2, b3, info[4]->BooleanValue(), b5 ); return; } } } } } } else if(info.Length() > 0 && info[0]->IsInt32Array()) { v8::Local<v8::Int32Array>a0(v8::Local<v8::Int32Array>::Cast(info[0]->ToObject())); if( a0->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() > 1 && info[1]->IsArray()) { v8::Local<v8::Array>a1(v8::Local<v8::Array>::Cast(info[1]->ToObject())); int b1[6]; if( a1->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 6; i++ ) { if( !a1->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b1[i] = a1->Get(i)->Int32Value(); } if(info.Length() > 2 && info[2]->IsInt32Array()) { v8::Local<v8::Int32Array>a2(v8::Local<v8::Int32Array>::Cast(info[2]->ToObject())); if( a2->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() > 3 && info[3]->IsArray()) { v8::Local<v8::Array>a3(v8::Local<v8::Array>::Cast(info[3]->ToObject())); int b3[3]; if( a3->Length() < 3 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 3; i++ ) { if( !a3->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b3[i] = a3->Get(i)->Int32Value(); } if(info.Length() > 4 && info[4]->IsBoolean()) { if(info.Length() > 5 && info[5]->IsArray()) { v8::Local<v8::Array>a5(v8::Local<v8::Array>::Cast(info[5]->ToObject())); int b5[6]; if( a5->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 6; i++ ) { if( !a5->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b5[i] = a5->Get(i)->Int32Value(); } if(info.Length() != 6) { Nan::ThrowError("Too many parameters."); return; } native->GetPartitionedOutputExtent( (int *)(a0->Buffer()->GetContents().Data()), b1, (int *)(a2->Buffer()->GetContents().Data()), b3, info[4]->BooleanValue(), b5 ); return; } } } } } } else if(info.Length() > 0 && info[0]->IsArray()) { v8::Local<v8::Array>a0(v8::Local<v8::Array>::Cast(info[0]->ToObject())); int b0[6]; if( a0->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 6; i++ ) { if( !a0->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b0[i] = a0->Get(i)->Int32Value(); } if(info.Length() > 1 && info[1]->IsArray()) { v8::Local<v8::Array>a1(v8::Local<v8::Array>::Cast(info[1]->ToObject())); int b1[6]; if( a1->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 6; i++ ) { if( !a1->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b1[i] = a1->Get(i)->Int32Value(); } if(info.Length() > 2 && info[2]->IsInt32Array()) { v8::Local<v8::Int32Array>a2(v8::Local<v8::Int32Array>::Cast(info[2]->ToObject())); if( a2->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() > 3 && info[3]->IsArray()) { v8::Local<v8::Array>a3(v8::Local<v8::Array>::Cast(info[3]->ToObject())); int b3[3]; if( a3->Length() < 3 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 3; i++ ) { if( !a3->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b3[i] = a3->Get(i)->Int32Value(); } if(info.Length() > 4 && info[4]->IsBoolean()) { if(info.Length() > 5 && info[5]->IsArray()) { v8::Local<v8::Array>a5(v8::Local<v8::Array>::Cast(info[5]->ToObject())); int b5[6]; if( a5->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 6; i++ ) { if( !a5->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b5[i] = a5->Get(i)->Int32Value(); } if(info.Length() != 6) { Nan::ThrowError("Too many parameters."); return; } native->GetPartitionedOutputExtent( b0, b1, (int *)(a2->Buffer()->GetContents().Data()), b3, info[4]->BooleanValue(), b5 ); return; } } } } } else if(info.Length() > 1 && info[1]->IsInt32Array()) { v8::Local<v8::Int32Array>a1(v8::Local<v8::Int32Array>::Cast(info[1]->ToObject())); if( a1->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() > 2 && info[2]->IsInt32Array()) { v8::Local<v8::Int32Array>a2(v8::Local<v8::Int32Array>::Cast(info[2]->ToObject())); if( a2->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() > 3 && info[3]->IsArray()) { v8::Local<v8::Array>a3(v8::Local<v8::Array>::Cast(info[3]->ToObject())); int b3[3]; if( a3->Length() < 3 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 3; i++ ) { if( !a3->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b3[i] = a3->Get(i)->Int32Value(); } if(info.Length() > 4 && info[4]->IsBoolean()) { if(info.Length() > 5 && info[5]->IsArray()) { v8::Local<v8::Array>a5(v8::Local<v8::Array>::Cast(info[5]->ToObject())); int b5[6]; if( a5->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 6; i++ ) { if( !a5->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b5[i] = a5->Get(i)->Int32Value(); } if(info.Length() != 6) { Nan::ThrowError("Too many parameters."); return; } native->GetPartitionedOutputExtent( b0, (int *)(a1->Buffer()->GetContents().Data()), (int *)(a2->Buffer()->GetContents().Data()), b3, info[4]->BooleanValue(), b5 ); return; } } } } } } else if(info.Length() > 0 && info[0]->IsInt32Array()) { v8::Local<v8::Int32Array>a0(v8::Local<v8::Int32Array>::Cast(info[0]->ToObject())); if( a0->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() > 1 && info[1]->IsInt32Array()) { v8::Local<v8::Int32Array>a1(v8::Local<v8::Int32Array>::Cast(info[1]->ToObject())); if( a1->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() > 2 && info[2]->IsArray()) { v8::Local<v8::Array>a2(v8::Local<v8::Array>::Cast(info[2]->ToObject())); int b2[6]; if( a2->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 6; i++ ) { if( !a2->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b2[i] = a2->Get(i)->Int32Value(); } if(info.Length() > 3 && info[3]->IsInt32Array()) { v8::Local<v8::Int32Array>a3(v8::Local<v8::Int32Array>::Cast(info[3]->ToObject())); if( a3->Length() < 3 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() > 4 && info[4]->IsBoolean()) { if(info.Length() > 5 && info[5]->IsArray()) { v8::Local<v8::Array>a5(v8::Local<v8::Array>::Cast(info[5]->ToObject())); int b5[6]; if( a5->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 6; i++ ) { if( !a5->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b5[i] = a5->Get(i)->Int32Value(); } if(info.Length() != 6) { Nan::ThrowError("Too many parameters."); return; } native->GetPartitionedOutputExtent( (int *)(a0->Buffer()->GetContents().Data()), (int *)(a1->Buffer()->GetContents().Data()), b2, (int *)(a3->Buffer()->GetContents().Data()), info[4]->BooleanValue(), b5 ); return; } } } } } else if(info.Length() > 1 && info[1]->IsArray()) { v8::Local<v8::Array>a1(v8::Local<v8::Array>::Cast(info[1]->ToObject())); int b1[6]; if( a1->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 6; i++ ) { if( !a1->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b1[i] = a1->Get(i)->Int32Value(); } if(info.Length() > 2 && info[2]->IsArray()) { v8::Local<v8::Array>a2(v8::Local<v8::Array>::Cast(info[2]->ToObject())); int b2[6]; if( a2->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 6; i++ ) { if( !a2->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b2[i] = a2->Get(i)->Int32Value(); } if(info.Length() > 3 && info[3]->IsInt32Array()) { v8::Local<v8::Int32Array>a3(v8::Local<v8::Int32Array>::Cast(info[3]->ToObject())); if( a3->Length() < 3 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() > 4 && info[4]->IsBoolean()) { if(info.Length() > 5 && info[5]->IsArray()) { v8::Local<v8::Array>a5(v8::Local<v8::Array>::Cast(info[5]->ToObject())); int b5[6]; if( a5->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 6; i++ ) { if( !a5->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b5[i] = a5->Get(i)->Int32Value(); } if(info.Length() != 6) { Nan::ThrowError("Too many parameters."); return; } native->GetPartitionedOutputExtent( (int *)(a0->Buffer()->GetContents().Data()), b1, b2, (int *)(a3->Buffer()->GetContents().Data()), info[4]->BooleanValue(), b5 ); return; } } } } } } else if(info.Length() > 0 && info[0]->IsArray()) { v8::Local<v8::Array>a0(v8::Local<v8::Array>::Cast(info[0]->ToObject())); int b0[6]; if( a0->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 6; i++ ) { if( !a0->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b0[i] = a0->Get(i)->Int32Value(); } if(info.Length() > 1 && info[1]->IsArray()) { v8::Local<v8::Array>a1(v8::Local<v8::Array>::Cast(info[1]->ToObject())); int b1[6]; if( a1->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 6; i++ ) { if( !a1->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b1[i] = a1->Get(i)->Int32Value(); } if(info.Length() > 2 && info[2]->IsArray()) { v8::Local<v8::Array>a2(v8::Local<v8::Array>::Cast(info[2]->ToObject())); int b2[6]; if( a2->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 6; i++ ) { if( !a2->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b2[i] = a2->Get(i)->Int32Value(); } if(info.Length() > 3 && info[3]->IsInt32Array()) { v8::Local<v8::Int32Array>a3(v8::Local<v8::Int32Array>::Cast(info[3]->ToObject())); if( a3->Length() < 3 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() > 4 && info[4]->IsBoolean()) { if(info.Length() > 5 && info[5]->IsArray()) { v8::Local<v8::Array>a5(v8::Local<v8::Array>::Cast(info[5]->ToObject())); int b5[6]; if( a5->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 6; i++ ) { if( !a5->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b5[i] = a5->Get(i)->Int32Value(); } if(info.Length() != 6) { Nan::ThrowError("Too many parameters."); return; } native->GetPartitionedOutputExtent( b0, b1, b2, (int *)(a3->Buffer()->GetContents().Data()), info[4]->BooleanValue(), b5 ); return; } } } } } else if(info.Length() > 1 && info[1]->IsInt32Array()) { v8::Local<v8::Int32Array>a1(v8::Local<v8::Int32Array>::Cast(info[1]->ToObject())); if( a1->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() > 2 && info[2]->IsArray()) { v8::Local<v8::Array>a2(v8::Local<v8::Array>::Cast(info[2]->ToObject())); int b2[6]; if( a2->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 6; i++ ) { if( !a2->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b2[i] = a2->Get(i)->Int32Value(); } if(info.Length() > 3 && info[3]->IsInt32Array()) { v8::Local<v8::Int32Array>a3(v8::Local<v8::Int32Array>::Cast(info[3]->ToObject())); if( a3->Length() < 3 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() > 4 && info[4]->IsBoolean()) { if(info.Length() > 5 && info[5]->IsArray()) { v8::Local<v8::Array>a5(v8::Local<v8::Array>::Cast(info[5]->ToObject())); int b5[6]; if( a5->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 6; i++ ) { if( !a5->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b5[i] = a5->Get(i)->Int32Value(); } if(info.Length() != 6) { Nan::ThrowError("Too many parameters."); return; } native->GetPartitionedOutputExtent( b0, (int *)(a1->Buffer()->GetContents().Data()), b2, (int *)(a3->Buffer()->GetContents().Data()), info[4]->BooleanValue(), b5 ); return; } } } } } } else if(info.Length() > 0 && info[0]->IsInt32Array()) { v8::Local<v8::Int32Array>a0(v8::Local<v8::Int32Array>::Cast(info[0]->ToObject())); if( a0->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() > 1 && info[1]->IsArray()) { v8::Local<v8::Array>a1(v8::Local<v8::Array>::Cast(info[1]->ToObject())); int b1[6]; if( a1->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 6; i++ ) { if( !a1->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b1[i] = a1->Get(i)->Int32Value(); } if(info.Length() > 2 && info[2]->IsInt32Array()) { v8::Local<v8::Int32Array>a2(v8::Local<v8::Int32Array>::Cast(info[2]->ToObject())); if( a2->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() > 3 && info[3]->IsInt32Array()) { v8::Local<v8::Int32Array>a3(v8::Local<v8::Int32Array>::Cast(info[3]->ToObject())); if( a3->Length() < 3 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() > 4 && info[4]->IsBoolean()) { if(info.Length() > 5 && info[5]->IsArray()) { v8::Local<v8::Array>a5(v8::Local<v8::Array>::Cast(info[5]->ToObject())); int b5[6]; if( a5->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 6; i++ ) { if( !a5->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b5[i] = a5->Get(i)->Int32Value(); } if(info.Length() != 6) { Nan::ThrowError("Too many parameters."); return; } native->GetPartitionedOutputExtent( (int *)(a0->Buffer()->GetContents().Data()), b1, (int *)(a2->Buffer()->GetContents().Data()), (int *)(a3->Buffer()->GetContents().Data()), info[4]->BooleanValue(), b5 ); return; } } } } } } else if(info.Length() > 0 && info[0]->IsArray()) { v8::Local<v8::Array>a0(v8::Local<v8::Array>::Cast(info[0]->ToObject())); int b0[6]; if( a0->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 6; i++ ) { if( !a0->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b0[i] = a0->Get(i)->Int32Value(); } if(info.Length() > 1 && info[1]->IsArray()) { v8::Local<v8::Array>a1(v8::Local<v8::Array>::Cast(info[1]->ToObject())); int b1[6]; if( a1->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 6; i++ ) { if( !a1->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b1[i] = a1->Get(i)->Int32Value(); } if(info.Length() > 2 && info[2]->IsInt32Array()) { v8::Local<v8::Int32Array>a2(v8::Local<v8::Int32Array>::Cast(info[2]->ToObject())); if( a2->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() > 3 && info[3]->IsInt32Array()) { v8::Local<v8::Int32Array>a3(v8::Local<v8::Int32Array>::Cast(info[3]->ToObject())); if( a3->Length() < 3 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() > 4 && info[4]->IsBoolean()) { if(info.Length() > 5 && info[5]->IsArray()) { v8::Local<v8::Array>a5(v8::Local<v8::Array>::Cast(info[5]->ToObject())); int b5[6]; if( a5->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 6; i++ ) { if( !a5->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b5[i] = a5->Get(i)->Int32Value(); } if(info.Length() != 6) { Nan::ThrowError("Too many parameters."); return; } native->GetPartitionedOutputExtent( b0, b1, (int *)(a2->Buffer()->GetContents().Data()), (int *)(a3->Buffer()->GetContents().Data()), info[4]->BooleanValue(), b5 ); return; } } } } } else if(info.Length() > 1 && info[1]->IsInt32Array()) { v8::Local<v8::Int32Array>a1(v8::Local<v8::Int32Array>::Cast(info[1]->ToObject())); if( a1->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() > 2 && info[2]->IsInt32Array()) { v8::Local<v8::Int32Array>a2(v8::Local<v8::Int32Array>::Cast(info[2]->ToObject())); if( a2->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() > 3 && info[3]->IsInt32Array()) { v8::Local<v8::Int32Array>a3(v8::Local<v8::Int32Array>::Cast(info[3]->ToObject())); if( a3->Length() < 3 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() > 4 && info[4]->IsBoolean()) { if(info.Length() > 5 && info[5]->IsArray()) { v8::Local<v8::Array>a5(v8::Local<v8::Array>::Cast(info[5]->ToObject())); int b5[6]; if( a5->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 6; i++ ) { if( !a5->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b5[i] = a5->Get(i)->Int32Value(); } if(info.Length() != 6) { Nan::ThrowError("Too many parameters."); return; } native->GetPartitionedOutputExtent( b0, (int *)(a1->Buffer()->GetContents().Data()), (int *)(a2->Buffer()->GetContents().Data()), (int *)(a3->Buffer()->GetContents().Data()), info[4]->BooleanValue(), b5 ); return; } } } } } } else if(info.Length() > 0 && info[0]->IsInt32Array()) { v8::Local<v8::Int32Array>a0(v8::Local<v8::Int32Array>::Cast(info[0]->ToObject())); if( a0->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() > 1 && info[1]->IsInt32Array()) { v8::Local<v8::Int32Array>a1(v8::Local<v8::Int32Array>::Cast(info[1]->ToObject())); if( a1->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() > 2 && info[2]->IsInt32Array()) { v8::Local<v8::Int32Array>a2(v8::Local<v8::Int32Array>::Cast(info[2]->ToObject())); if( a2->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() > 3 && info[3]->IsArray()) { v8::Local<v8::Array>a3(v8::Local<v8::Array>::Cast(info[3]->ToObject())); int b3[3]; if( a3->Length() < 3 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 3; i++ ) { if( !a3->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b3[i] = a3->Get(i)->Int32Value(); } if(info.Length() > 4 && info[4]->IsBoolean()) { if(info.Length() > 5 && info[5]->IsInt32Array()) { v8::Local<v8::Int32Array>a5(v8::Local<v8::Int32Array>::Cast(info[5]->ToObject())); if( a5->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() != 6) { Nan::ThrowError("Too many parameters."); return; } native->GetPartitionedOutputExtent( (int *)(a0->Buffer()->GetContents().Data()), (int *)(a1->Buffer()->GetContents().Data()), (int *)(a2->Buffer()->GetContents().Data()), b3, info[4]->BooleanValue(), (int *)(a5->Buffer()->GetContents().Data()) ); return; } } } } else if(info.Length() > 2 && info[2]->IsArray()) { v8::Local<v8::Array>a2(v8::Local<v8::Array>::Cast(info[2]->ToObject())); int b2[6]; if( a2->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 6; i++ ) { if( !a2->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b2[i] = a2->Get(i)->Int32Value(); } if(info.Length() > 3 && info[3]->IsArray()) { v8::Local<v8::Array>a3(v8::Local<v8::Array>::Cast(info[3]->ToObject())); int b3[3]; if( a3->Length() < 3 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 3; i++ ) { if( !a3->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b3[i] = a3->Get(i)->Int32Value(); } if(info.Length() > 4 && info[4]->IsBoolean()) { if(info.Length() > 5 && info[5]->IsInt32Array()) { v8::Local<v8::Int32Array>a5(v8::Local<v8::Int32Array>::Cast(info[5]->ToObject())); if( a5->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() != 6) { Nan::ThrowError("Too many parameters."); return; } native->GetPartitionedOutputExtent( (int *)(a0->Buffer()->GetContents().Data()), (int *)(a1->Buffer()->GetContents().Data()), b2, b3, info[4]->BooleanValue(), (int *)(a5->Buffer()->GetContents().Data()) ); return; } } } } } else if(info.Length() > 1 && info[1]->IsArray()) { v8::Local<v8::Array>a1(v8::Local<v8::Array>::Cast(info[1]->ToObject())); int b1[6]; if( a1->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 6; i++ ) { if( !a1->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b1[i] = a1->Get(i)->Int32Value(); } if(info.Length() > 2 && info[2]->IsArray()) { v8::Local<v8::Array>a2(v8::Local<v8::Array>::Cast(info[2]->ToObject())); int b2[6]; if( a2->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 6; i++ ) { if( !a2->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b2[i] = a2->Get(i)->Int32Value(); } if(info.Length() > 3 && info[3]->IsArray()) { v8::Local<v8::Array>a3(v8::Local<v8::Array>::Cast(info[3]->ToObject())); int b3[3]; if( a3->Length() < 3 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 3; i++ ) { if( !a3->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b3[i] = a3->Get(i)->Int32Value(); } if(info.Length() > 4 && info[4]->IsBoolean()) { if(info.Length() > 5 && info[5]->IsInt32Array()) { v8::Local<v8::Int32Array>a5(v8::Local<v8::Int32Array>::Cast(info[5]->ToObject())); if( a5->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() != 6) { Nan::ThrowError("Too many parameters."); return; } native->GetPartitionedOutputExtent( (int *)(a0->Buffer()->GetContents().Data()), b1, b2, b3, info[4]->BooleanValue(), (int *)(a5->Buffer()->GetContents().Data()) ); return; } } } } } } else if(info.Length() > 0 && info[0]->IsArray()) { v8::Local<v8::Array>a0(v8::Local<v8::Array>::Cast(info[0]->ToObject())); int b0[6]; if( a0->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 6; i++ ) { if( !a0->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b0[i] = a0->Get(i)->Int32Value(); } if(info.Length() > 1 && info[1]->IsArray()) { v8::Local<v8::Array>a1(v8::Local<v8::Array>::Cast(info[1]->ToObject())); int b1[6]; if( a1->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 6; i++ ) { if( !a1->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b1[i] = a1->Get(i)->Int32Value(); } if(info.Length() > 2 && info[2]->IsArray()) { v8::Local<v8::Array>a2(v8::Local<v8::Array>::Cast(info[2]->ToObject())); int b2[6]; if( a2->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 6; i++ ) { if( !a2->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b2[i] = a2->Get(i)->Int32Value(); } if(info.Length() > 3 && info[3]->IsArray()) { v8::Local<v8::Array>a3(v8::Local<v8::Array>::Cast(info[3]->ToObject())); int b3[3]; if( a3->Length() < 3 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 3; i++ ) { if( !a3->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b3[i] = a3->Get(i)->Int32Value(); } if(info.Length() > 4 && info[4]->IsBoolean()) { if(info.Length() > 5 && info[5]->IsInt32Array()) { v8::Local<v8::Int32Array>a5(v8::Local<v8::Int32Array>::Cast(info[5]->ToObject())); if( a5->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() != 6) { Nan::ThrowError("Too many parameters."); return; } native->GetPartitionedOutputExtent( b0, b1, b2, b3, info[4]->BooleanValue(), (int *)(a5->Buffer()->GetContents().Data()) ); return; } } } } } else if(info.Length() > 1 && info[1]->IsInt32Array()) { v8::Local<v8::Int32Array>a1(v8::Local<v8::Int32Array>::Cast(info[1]->ToObject())); if( a1->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() > 2 && info[2]->IsArray()) { v8::Local<v8::Array>a2(v8::Local<v8::Array>::Cast(info[2]->ToObject())); int b2[6]; if( a2->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 6; i++ ) { if( !a2->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b2[i] = a2->Get(i)->Int32Value(); } if(info.Length() > 3 && info[3]->IsArray()) { v8::Local<v8::Array>a3(v8::Local<v8::Array>::Cast(info[3]->ToObject())); int b3[3]; if( a3->Length() < 3 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 3; i++ ) { if( !a3->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b3[i] = a3->Get(i)->Int32Value(); } if(info.Length() > 4 && info[4]->IsBoolean()) { if(info.Length() > 5 && info[5]->IsInt32Array()) { v8::Local<v8::Int32Array>a5(v8::Local<v8::Int32Array>::Cast(info[5]->ToObject())); if( a5->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() != 6) { Nan::ThrowError("Too many parameters."); return; } native->GetPartitionedOutputExtent( b0, (int *)(a1->Buffer()->GetContents().Data()), b2, b3, info[4]->BooleanValue(), (int *)(a5->Buffer()->GetContents().Data()) ); return; } } } } } } else if(info.Length() > 0 && info[0]->IsInt32Array()) { v8::Local<v8::Int32Array>a0(v8::Local<v8::Int32Array>::Cast(info[0]->ToObject())); if( a0->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() > 1 && info[1]->IsArray()) { v8::Local<v8::Array>a1(v8::Local<v8::Array>::Cast(info[1]->ToObject())); int b1[6]; if( a1->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 6; i++ ) { if( !a1->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b1[i] = a1->Get(i)->Int32Value(); } if(info.Length() > 2 && info[2]->IsInt32Array()) { v8::Local<v8::Int32Array>a2(v8::Local<v8::Int32Array>::Cast(info[2]->ToObject())); if( a2->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() > 3 && info[3]->IsArray()) { v8::Local<v8::Array>a3(v8::Local<v8::Array>::Cast(info[3]->ToObject())); int b3[3]; if( a3->Length() < 3 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 3; i++ ) { if( !a3->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b3[i] = a3->Get(i)->Int32Value(); } if(info.Length() > 4 && info[4]->IsBoolean()) { if(info.Length() > 5 && info[5]->IsInt32Array()) { v8::Local<v8::Int32Array>a5(v8::Local<v8::Int32Array>::Cast(info[5]->ToObject())); if( a5->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() != 6) { Nan::ThrowError("Too many parameters."); return; } native->GetPartitionedOutputExtent( (int *)(a0->Buffer()->GetContents().Data()), b1, (int *)(a2->Buffer()->GetContents().Data()), b3, info[4]->BooleanValue(), (int *)(a5->Buffer()->GetContents().Data()) ); return; } } } } } } else if(info.Length() > 0 && info[0]->IsArray()) { v8::Local<v8::Array>a0(v8::Local<v8::Array>::Cast(info[0]->ToObject())); int b0[6]; if( a0->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 6; i++ ) { if( !a0->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b0[i] = a0->Get(i)->Int32Value(); } if(info.Length() > 1 && info[1]->IsArray()) { v8::Local<v8::Array>a1(v8::Local<v8::Array>::Cast(info[1]->ToObject())); int b1[6]; if( a1->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 6; i++ ) { if( !a1->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b1[i] = a1->Get(i)->Int32Value(); } if(info.Length() > 2 && info[2]->IsInt32Array()) { v8::Local<v8::Int32Array>a2(v8::Local<v8::Int32Array>::Cast(info[2]->ToObject())); if( a2->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() > 3 && info[3]->IsArray()) { v8::Local<v8::Array>a3(v8::Local<v8::Array>::Cast(info[3]->ToObject())); int b3[3]; if( a3->Length() < 3 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 3; i++ ) { if( !a3->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b3[i] = a3->Get(i)->Int32Value(); } if(info.Length() > 4 && info[4]->IsBoolean()) { if(info.Length() > 5 && info[5]->IsInt32Array()) { v8::Local<v8::Int32Array>a5(v8::Local<v8::Int32Array>::Cast(info[5]->ToObject())); if( a5->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() != 6) { Nan::ThrowError("Too many parameters."); return; } native->GetPartitionedOutputExtent( b0, b1, (int *)(a2->Buffer()->GetContents().Data()), b3, info[4]->BooleanValue(), (int *)(a5->Buffer()->GetContents().Data()) ); return; } } } } } else if(info.Length() > 1 && info[1]->IsInt32Array()) { v8::Local<v8::Int32Array>a1(v8::Local<v8::Int32Array>::Cast(info[1]->ToObject())); if( a1->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() > 2 && info[2]->IsInt32Array()) { v8::Local<v8::Int32Array>a2(v8::Local<v8::Int32Array>::Cast(info[2]->ToObject())); if( a2->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() > 3 && info[3]->IsArray()) { v8::Local<v8::Array>a3(v8::Local<v8::Array>::Cast(info[3]->ToObject())); int b3[3]; if( a3->Length() < 3 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 3; i++ ) { if( !a3->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b3[i] = a3->Get(i)->Int32Value(); } if(info.Length() > 4 && info[4]->IsBoolean()) { if(info.Length() > 5 && info[5]->IsInt32Array()) { v8::Local<v8::Int32Array>a5(v8::Local<v8::Int32Array>::Cast(info[5]->ToObject())); if( a5->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() != 6) { Nan::ThrowError("Too many parameters."); return; } native->GetPartitionedOutputExtent( b0, (int *)(a1->Buffer()->GetContents().Data()), (int *)(a2->Buffer()->GetContents().Data()), b3, info[4]->BooleanValue(), (int *)(a5->Buffer()->GetContents().Data()) ); return; } } } } } } else if(info.Length() > 0 && info[0]->IsInt32Array()) { v8::Local<v8::Int32Array>a0(v8::Local<v8::Int32Array>::Cast(info[0]->ToObject())); if( a0->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() > 1 && info[1]->IsInt32Array()) { v8::Local<v8::Int32Array>a1(v8::Local<v8::Int32Array>::Cast(info[1]->ToObject())); if( a1->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() > 2 && info[2]->IsArray()) { v8::Local<v8::Array>a2(v8::Local<v8::Array>::Cast(info[2]->ToObject())); int b2[6]; if( a2->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 6; i++ ) { if( !a2->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b2[i] = a2->Get(i)->Int32Value(); } if(info.Length() > 3 && info[3]->IsInt32Array()) { v8::Local<v8::Int32Array>a3(v8::Local<v8::Int32Array>::Cast(info[3]->ToObject())); if( a3->Length() < 3 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() > 4 && info[4]->IsBoolean()) { if(info.Length() > 5 && info[5]->IsInt32Array()) { v8::Local<v8::Int32Array>a5(v8::Local<v8::Int32Array>::Cast(info[5]->ToObject())); if( a5->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() != 6) { Nan::ThrowError("Too many parameters."); return; } native->GetPartitionedOutputExtent( (int *)(a0->Buffer()->GetContents().Data()), (int *)(a1->Buffer()->GetContents().Data()), b2, (int *)(a3->Buffer()->GetContents().Data()), info[4]->BooleanValue(), (int *)(a5->Buffer()->GetContents().Data()) ); return; } } } } } else if(info.Length() > 1 && info[1]->IsArray()) { v8::Local<v8::Array>a1(v8::Local<v8::Array>::Cast(info[1]->ToObject())); int b1[6]; if( a1->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 6; i++ ) { if( !a1->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b1[i] = a1->Get(i)->Int32Value(); } if(info.Length() > 2 && info[2]->IsArray()) { v8::Local<v8::Array>a2(v8::Local<v8::Array>::Cast(info[2]->ToObject())); int b2[6]; if( a2->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 6; i++ ) { if( !a2->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b2[i] = a2->Get(i)->Int32Value(); } if(info.Length() > 3 && info[3]->IsInt32Array()) { v8::Local<v8::Int32Array>a3(v8::Local<v8::Int32Array>::Cast(info[3]->ToObject())); if( a3->Length() < 3 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() > 4 && info[4]->IsBoolean()) { if(info.Length() > 5 && info[5]->IsInt32Array()) { v8::Local<v8::Int32Array>a5(v8::Local<v8::Int32Array>::Cast(info[5]->ToObject())); if( a5->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() != 6) { Nan::ThrowError("Too many parameters."); return; } native->GetPartitionedOutputExtent( (int *)(a0->Buffer()->GetContents().Data()), b1, b2, (int *)(a3->Buffer()->GetContents().Data()), info[4]->BooleanValue(), (int *)(a5->Buffer()->GetContents().Data()) ); return; } } } } } } else if(info.Length() > 0 && info[0]->IsArray()) { v8::Local<v8::Array>a0(v8::Local<v8::Array>::Cast(info[0]->ToObject())); int b0[6]; if( a0->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 6; i++ ) { if( !a0->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b0[i] = a0->Get(i)->Int32Value(); } if(info.Length() > 1 && info[1]->IsArray()) { v8::Local<v8::Array>a1(v8::Local<v8::Array>::Cast(info[1]->ToObject())); int b1[6]; if( a1->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 6; i++ ) { if( !a1->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b1[i] = a1->Get(i)->Int32Value(); } if(info.Length() > 2 && info[2]->IsArray()) { v8::Local<v8::Array>a2(v8::Local<v8::Array>::Cast(info[2]->ToObject())); int b2[6]; if( a2->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 6; i++ ) { if( !a2->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b2[i] = a2->Get(i)->Int32Value(); } if(info.Length() > 3 && info[3]->IsInt32Array()) { v8::Local<v8::Int32Array>a3(v8::Local<v8::Int32Array>::Cast(info[3]->ToObject())); if( a3->Length() < 3 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() > 4 && info[4]->IsBoolean()) { if(info.Length() > 5 && info[5]->IsInt32Array()) { v8::Local<v8::Int32Array>a5(v8::Local<v8::Int32Array>::Cast(info[5]->ToObject())); if( a5->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() != 6) { Nan::ThrowError("Too many parameters."); return; } native->GetPartitionedOutputExtent( b0, b1, b2, (int *)(a3->Buffer()->GetContents().Data()), info[4]->BooleanValue(), (int *)(a5->Buffer()->GetContents().Data()) ); return; } } } } } else if(info.Length() > 1 && info[1]->IsInt32Array()) { v8::Local<v8::Int32Array>a1(v8::Local<v8::Int32Array>::Cast(info[1]->ToObject())); if( a1->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() > 2 && info[2]->IsArray()) { v8::Local<v8::Array>a2(v8::Local<v8::Array>::Cast(info[2]->ToObject())); int b2[6]; if( a2->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 6; i++ ) { if( !a2->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b2[i] = a2->Get(i)->Int32Value(); } if(info.Length() > 3 && info[3]->IsInt32Array()) { v8::Local<v8::Int32Array>a3(v8::Local<v8::Int32Array>::Cast(info[3]->ToObject())); if( a3->Length() < 3 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() > 4 && info[4]->IsBoolean()) { if(info.Length() > 5 && info[5]->IsInt32Array()) { v8::Local<v8::Int32Array>a5(v8::Local<v8::Int32Array>::Cast(info[5]->ToObject())); if( a5->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() != 6) { Nan::ThrowError("Too many parameters."); return; } native->GetPartitionedOutputExtent( b0, (int *)(a1->Buffer()->GetContents().Data()), b2, (int *)(a3->Buffer()->GetContents().Data()), info[4]->BooleanValue(), (int *)(a5->Buffer()->GetContents().Data()) ); return; } } } } } } else if(info.Length() > 0 && info[0]->IsInt32Array()) { v8::Local<v8::Int32Array>a0(v8::Local<v8::Int32Array>::Cast(info[0]->ToObject())); if( a0->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() > 1 && info[1]->IsArray()) { v8::Local<v8::Array>a1(v8::Local<v8::Array>::Cast(info[1]->ToObject())); int b1[6]; if( a1->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 6; i++ ) { if( !a1->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b1[i] = a1->Get(i)->Int32Value(); } if(info.Length() > 2 && info[2]->IsInt32Array()) { v8::Local<v8::Int32Array>a2(v8::Local<v8::Int32Array>::Cast(info[2]->ToObject())); if( a2->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() > 3 && info[3]->IsInt32Array()) { v8::Local<v8::Int32Array>a3(v8::Local<v8::Int32Array>::Cast(info[3]->ToObject())); if( a3->Length() < 3 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() > 4 && info[4]->IsBoolean()) { if(info.Length() > 5 && info[5]->IsInt32Array()) { v8::Local<v8::Int32Array>a5(v8::Local<v8::Int32Array>::Cast(info[5]->ToObject())); if( a5->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() != 6) { Nan::ThrowError("Too many parameters."); return; } native->GetPartitionedOutputExtent( (int *)(a0->Buffer()->GetContents().Data()), b1, (int *)(a2->Buffer()->GetContents().Data()), (int *)(a3->Buffer()->GetContents().Data()), info[4]->BooleanValue(), (int *)(a5->Buffer()->GetContents().Data()) ); return; } } } } } } else if(info.Length() > 0 && info[0]->IsArray()) { v8::Local<v8::Array>a0(v8::Local<v8::Array>::Cast(info[0]->ToObject())); int b0[6]; if( a0->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 6; i++ ) { if( !a0->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b0[i] = a0->Get(i)->Int32Value(); } if(info.Length() > 1 && info[1]->IsArray()) { v8::Local<v8::Array>a1(v8::Local<v8::Array>::Cast(info[1]->ToObject())); int b1[6]; if( a1->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 6; i++ ) { if( !a1->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b1[i] = a1->Get(i)->Int32Value(); } if(info.Length() > 2 && info[2]->IsInt32Array()) { v8::Local<v8::Int32Array>a2(v8::Local<v8::Int32Array>::Cast(info[2]->ToObject())); if( a2->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() > 3 && info[3]->IsInt32Array()) { v8::Local<v8::Int32Array>a3(v8::Local<v8::Int32Array>::Cast(info[3]->ToObject())); if( a3->Length() < 3 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() > 4 && info[4]->IsBoolean()) { if(info.Length() > 5 && info[5]->IsInt32Array()) { v8::Local<v8::Int32Array>a5(v8::Local<v8::Int32Array>::Cast(info[5]->ToObject())); if( a5->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() != 6) { Nan::ThrowError("Too many parameters."); return; } native->GetPartitionedOutputExtent( b0, b1, (int *)(a2->Buffer()->GetContents().Data()), (int *)(a3->Buffer()->GetContents().Data()), info[4]->BooleanValue(), (int *)(a5->Buffer()->GetContents().Data()) ); return; } } } } } else if(info.Length() > 1 && info[1]->IsInt32Array()) { v8::Local<v8::Int32Array>a1(v8::Local<v8::Int32Array>::Cast(info[1]->ToObject())); if( a1->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() > 2 && info[2]->IsInt32Array()) { v8::Local<v8::Int32Array>a2(v8::Local<v8::Int32Array>::Cast(info[2]->ToObject())); if( a2->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() > 3 && info[3]->IsInt32Array()) { v8::Local<v8::Int32Array>a3(v8::Local<v8::Int32Array>::Cast(info[3]->ToObject())); if( a3->Length() < 3 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() > 4 && info[4]->IsBoolean()) { if(info.Length() > 5 && info[5]->IsInt32Array()) { v8::Local<v8::Int32Array>a5(v8::Local<v8::Int32Array>::Cast(info[5]->ToObject())); if( a5->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() != 6) { Nan::ThrowError("Too many parameters."); return; } native->GetPartitionedOutputExtent( b0, (int *)(a1->Buffer()->GetContents().Data()), (int *)(a2->Buffer()->GetContents().Data()), (int *)(a3->Buffer()->GetContents().Data()), info[4]->BooleanValue(), (int *)(a5->Buffer()->GetContents().Data()) ); return; } } } } } } Nan::ThrowError("Parameter mismatch"); } void VtkExtractStructuredGridHelperWrap::GetPartitionedVOI(const Nan::FunctionCallbackInfo<v8::Value>& info) { VtkExtractStructuredGridHelperWrap *wrapper = ObjectWrap::Unwrap<VtkExtractStructuredGridHelperWrap>(info.Holder()); vtkExtractStructuredGridHelper *native = (vtkExtractStructuredGridHelper *)wrapper->native.GetPointer(); size_t i; if(info.Length() > 0 && info[0]->IsInt32Array()) { v8::Local<v8::Int32Array>a0(v8::Local<v8::Int32Array>::Cast(info[0]->ToObject())); if( a0->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() > 1 && info[1]->IsInt32Array()) { v8::Local<v8::Int32Array>a1(v8::Local<v8::Int32Array>::Cast(info[1]->ToObject())); if( a1->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() > 2 && info[2]->IsInt32Array()) { v8::Local<v8::Int32Array>a2(v8::Local<v8::Int32Array>::Cast(info[2]->ToObject())); if( a2->Length() < 3 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() > 3 && info[3]->IsBoolean()) { if(info.Length() > 4 && info[4]->IsInt32Array()) { v8::Local<v8::Int32Array>a4(v8::Local<v8::Int32Array>::Cast(info[4]->ToObject())); if( a4->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() != 5) { Nan::ThrowError("Too many parameters."); return; } native->GetPartitionedVOI( (int *)(a0->Buffer()->GetContents().Data()), (int *)(a1->Buffer()->GetContents().Data()), (int *)(a2->Buffer()->GetContents().Data()), info[3]->BooleanValue(), (int *)(a4->Buffer()->GetContents().Data()) ); return; } else if(info.Length() > 4 && info[4]->IsArray()) { v8::Local<v8::Array>a4(v8::Local<v8::Array>::Cast(info[4]->ToObject())); int b4[6]; if( a4->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 6; i++ ) { if( !a4->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b4[i] = a4->Get(i)->Int32Value(); } if(info.Length() != 5) { Nan::ThrowError("Too many parameters."); return; } native->GetPartitionedVOI( (int *)(a0->Buffer()->GetContents().Data()), (int *)(a1->Buffer()->GetContents().Data()), (int *)(a2->Buffer()->GetContents().Data()), info[3]->BooleanValue(), b4 ); return; } } } else if(info.Length() > 2 && info[2]->IsArray()) { v8::Local<v8::Array>a2(v8::Local<v8::Array>::Cast(info[2]->ToObject())); int b2[3]; if( a2->Length() < 3 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 3; i++ ) { if( !a2->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b2[i] = a2->Get(i)->Int32Value(); } if(info.Length() > 3 && info[3]->IsBoolean()) { if(info.Length() > 4 && info[4]->IsArray()) { v8::Local<v8::Array>a4(v8::Local<v8::Array>::Cast(info[4]->ToObject())); int b4[6]; if( a4->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 6; i++ ) { if( !a4->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b4[i] = a4->Get(i)->Int32Value(); } if(info.Length() != 5) { Nan::ThrowError("Too many parameters."); return; } native->GetPartitionedVOI( (int *)(a0->Buffer()->GetContents().Data()), (int *)(a1->Buffer()->GetContents().Data()), b2, info[3]->BooleanValue(), b4 ); return; } } } } else if(info.Length() > 1 && info[1]->IsArray()) { v8::Local<v8::Array>a1(v8::Local<v8::Array>::Cast(info[1]->ToObject())); int b1[6]; if( a1->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 6; i++ ) { if( !a1->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b1[i] = a1->Get(i)->Int32Value(); } if(info.Length() > 2 && info[2]->IsArray()) { v8::Local<v8::Array>a2(v8::Local<v8::Array>::Cast(info[2]->ToObject())); int b2[3]; if( a2->Length() < 3 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 3; i++ ) { if( !a2->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b2[i] = a2->Get(i)->Int32Value(); } if(info.Length() > 3 && info[3]->IsBoolean()) { if(info.Length() > 4 && info[4]->IsArray()) { v8::Local<v8::Array>a4(v8::Local<v8::Array>::Cast(info[4]->ToObject())); int b4[6]; if( a4->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 6; i++ ) { if( !a4->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b4[i] = a4->Get(i)->Int32Value(); } if(info.Length() != 5) { Nan::ThrowError("Too many parameters."); return; } native->GetPartitionedVOI( (int *)(a0->Buffer()->GetContents().Data()), b1, b2, info[3]->BooleanValue(), b4 ); return; } } } } } else if(info.Length() > 0 && info[0]->IsArray()) { v8::Local<v8::Array>a0(v8::Local<v8::Array>::Cast(info[0]->ToObject())); int b0[6]; if( a0->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 6; i++ ) { if( !a0->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b0[i] = a0->Get(i)->Int32Value(); } if(info.Length() > 1 && info[1]->IsArray()) { v8::Local<v8::Array>a1(v8::Local<v8::Array>::Cast(info[1]->ToObject())); int b1[6]; if( a1->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 6; i++ ) { if( !a1->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b1[i] = a1->Get(i)->Int32Value(); } if(info.Length() > 2 && info[2]->IsArray()) { v8::Local<v8::Array>a2(v8::Local<v8::Array>::Cast(info[2]->ToObject())); int b2[3]; if( a2->Length() < 3 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 3; i++ ) { if( !a2->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b2[i] = a2->Get(i)->Int32Value(); } if(info.Length() > 3 && info[3]->IsBoolean()) { if(info.Length() > 4 && info[4]->IsArray()) { v8::Local<v8::Array>a4(v8::Local<v8::Array>::Cast(info[4]->ToObject())); int b4[6]; if( a4->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 6; i++ ) { if( !a4->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b4[i] = a4->Get(i)->Int32Value(); } if(info.Length() != 5) { Nan::ThrowError("Too many parameters."); return; } native->GetPartitionedVOI( b0, b1, b2, info[3]->BooleanValue(), b4 ); return; } } } } else if(info.Length() > 1 && info[1]->IsInt32Array()) { v8::Local<v8::Int32Array>a1(v8::Local<v8::Int32Array>::Cast(info[1]->ToObject())); if( a1->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() > 2 && info[2]->IsArray()) { v8::Local<v8::Array>a2(v8::Local<v8::Array>::Cast(info[2]->ToObject())); int b2[3]; if( a2->Length() < 3 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 3; i++ ) { if( !a2->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b2[i] = a2->Get(i)->Int32Value(); } if(info.Length() > 3 && info[3]->IsBoolean()) { if(info.Length() > 4 && info[4]->IsArray()) { v8::Local<v8::Array>a4(v8::Local<v8::Array>::Cast(info[4]->ToObject())); int b4[6]; if( a4->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 6; i++ ) { if( !a4->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b4[i] = a4->Get(i)->Int32Value(); } if(info.Length() != 5) { Nan::ThrowError("Too many parameters."); return; } native->GetPartitionedVOI( b0, (int *)(a1->Buffer()->GetContents().Data()), b2, info[3]->BooleanValue(), b4 ); return; } } } } } else if(info.Length() > 0 && info[0]->IsInt32Array()) { v8::Local<v8::Int32Array>a0(v8::Local<v8::Int32Array>::Cast(info[0]->ToObject())); if( a0->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() > 1 && info[1]->IsArray()) { v8::Local<v8::Array>a1(v8::Local<v8::Array>::Cast(info[1]->ToObject())); int b1[6]; if( a1->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 6; i++ ) { if( !a1->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b1[i] = a1->Get(i)->Int32Value(); } if(info.Length() > 2 && info[2]->IsInt32Array()) { v8::Local<v8::Int32Array>a2(v8::Local<v8::Int32Array>::Cast(info[2]->ToObject())); if( a2->Length() < 3 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() > 3 && info[3]->IsBoolean()) { if(info.Length() > 4 && info[4]->IsArray()) { v8::Local<v8::Array>a4(v8::Local<v8::Array>::Cast(info[4]->ToObject())); int b4[6]; if( a4->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 6; i++ ) { if( !a4->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b4[i] = a4->Get(i)->Int32Value(); } if(info.Length() != 5) { Nan::ThrowError("Too many parameters."); return; } native->GetPartitionedVOI( (int *)(a0->Buffer()->GetContents().Data()), b1, (int *)(a2->Buffer()->GetContents().Data()), info[3]->BooleanValue(), b4 ); return; } } } } } else if(info.Length() > 0 && info[0]->IsArray()) { v8::Local<v8::Array>a0(v8::Local<v8::Array>::Cast(info[0]->ToObject())); int b0[6]; if( a0->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 6; i++ ) { if( !a0->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b0[i] = a0->Get(i)->Int32Value(); } if(info.Length() > 1 && info[1]->IsArray()) { v8::Local<v8::Array>a1(v8::Local<v8::Array>::Cast(info[1]->ToObject())); int b1[6]; if( a1->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 6; i++ ) { if( !a1->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b1[i] = a1->Get(i)->Int32Value(); } if(info.Length() > 2 && info[2]->IsInt32Array()) { v8::Local<v8::Int32Array>a2(v8::Local<v8::Int32Array>::Cast(info[2]->ToObject())); if( a2->Length() < 3 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() > 3 && info[3]->IsBoolean()) { if(info.Length() > 4 && info[4]->IsArray()) { v8::Local<v8::Array>a4(v8::Local<v8::Array>::Cast(info[4]->ToObject())); int b4[6]; if( a4->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 6; i++ ) { if( !a4->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b4[i] = a4->Get(i)->Int32Value(); } if(info.Length() != 5) { Nan::ThrowError("Too many parameters."); return; } native->GetPartitionedVOI( b0, b1, (int *)(a2->Buffer()->GetContents().Data()), info[3]->BooleanValue(), b4 ); return; } } } } else if(info.Length() > 1 && info[1]->IsInt32Array()) { v8::Local<v8::Int32Array>a1(v8::Local<v8::Int32Array>::Cast(info[1]->ToObject())); if( a1->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() > 2 && info[2]->IsInt32Array()) { v8::Local<v8::Int32Array>a2(v8::Local<v8::Int32Array>::Cast(info[2]->ToObject())); if( a2->Length() < 3 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() > 3 && info[3]->IsBoolean()) { if(info.Length() > 4 && info[4]->IsArray()) { v8::Local<v8::Array>a4(v8::Local<v8::Array>::Cast(info[4]->ToObject())); int b4[6]; if( a4->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 6; i++ ) { if( !a4->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b4[i] = a4->Get(i)->Int32Value(); } if(info.Length() != 5) { Nan::ThrowError("Too many parameters."); return; } native->GetPartitionedVOI( b0, (int *)(a1->Buffer()->GetContents().Data()), (int *)(a2->Buffer()->GetContents().Data()), info[3]->BooleanValue(), b4 ); return; } } } } } else if(info.Length() > 0 && info[0]->IsInt32Array()) { v8::Local<v8::Int32Array>a0(v8::Local<v8::Int32Array>::Cast(info[0]->ToObject())); if( a0->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() > 1 && info[1]->IsInt32Array()) { v8::Local<v8::Int32Array>a1(v8::Local<v8::Int32Array>::Cast(info[1]->ToObject())); if( a1->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() > 2 && info[2]->IsArray()) { v8::Local<v8::Array>a2(v8::Local<v8::Array>::Cast(info[2]->ToObject())); int b2[3]; if( a2->Length() < 3 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 3; i++ ) { if( !a2->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b2[i] = a2->Get(i)->Int32Value(); } if(info.Length() > 3 && info[3]->IsBoolean()) { if(info.Length() > 4 && info[4]->IsInt32Array()) { v8::Local<v8::Int32Array>a4(v8::Local<v8::Int32Array>::Cast(info[4]->ToObject())); if( a4->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() != 5) { Nan::ThrowError("Too many parameters."); return; } native->GetPartitionedVOI( (int *)(a0->Buffer()->GetContents().Data()), (int *)(a1->Buffer()->GetContents().Data()), b2, info[3]->BooleanValue(), (int *)(a4->Buffer()->GetContents().Data()) ); return; } } } } else if(info.Length() > 1 && info[1]->IsArray()) { v8::Local<v8::Array>a1(v8::Local<v8::Array>::Cast(info[1]->ToObject())); int b1[6]; if( a1->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 6; i++ ) { if( !a1->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b1[i] = a1->Get(i)->Int32Value(); } if(info.Length() > 2 && info[2]->IsArray()) { v8::Local<v8::Array>a2(v8::Local<v8::Array>::Cast(info[2]->ToObject())); int b2[3]; if( a2->Length() < 3 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 3; i++ ) { if( !a2->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b2[i] = a2->Get(i)->Int32Value(); } if(info.Length() > 3 && info[3]->IsBoolean()) { if(info.Length() > 4 && info[4]->IsInt32Array()) { v8::Local<v8::Int32Array>a4(v8::Local<v8::Int32Array>::Cast(info[4]->ToObject())); if( a4->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() != 5) { Nan::ThrowError("Too many parameters."); return; } native->GetPartitionedVOI( (int *)(a0->Buffer()->GetContents().Data()), b1, b2, info[3]->BooleanValue(), (int *)(a4->Buffer()->GetContents().Data()) ); return; } } } } } else if(info.Length() > 0 && info[0]->IsArray()) { v8::Local<v8::Array>a0(v8::Local<v8::Array>::Cast(info[0]->ToObject())); int b0[6]; if( a0->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 6; i++ ) { if( !a0->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b0[i] = a0->Get(i)->Int32Value(); } if(info.Length() > 1 && info[1]->IsArray()) { v8::Local<v8::Array>a1(v8::Local<v8::Array>::Cast(info[1]->ToObject())); int b1[6]; if( a1->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 6; i++ ) { if( !a1->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b1[i] = a1->Get(i)->Int32Value(); } if(info.Length() > 2 && info[2]->IsArray()) { v8::Local<v8::Array>a2(v8::Local<v8::Array>::Cast(info[2]->ToObject())); int b2[3]; if( a2->Length() < 3 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 3; i++ ) { if( !a2->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b2[i] = a2->Get(i)->Int32Value(); } if(info.Length() > 3 && info[3]->IsBoolean()) { if(info.Length() > 4 && info[4]->IsInt32Array()) { v8::Local<v8::Int32Array>a4(v8::Local<v8::Int32Array>::Cast(info[4]->ToObject())); if( a4->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() != 5) { Nan::ThrowError("Too many parameters."); return; } native->GetPartitionedVOI( b0, b1, b2, info[3]->BooleanValue(), (int *)(a4->Buffer()->GetContents().Data()) ); return; } } } } else if(info.Length() > 1 && info[1]->IsInt32Array()) { v8::Local<v8::Int32Array>a1(v8::Local<v8::Int32Array>::Cast(info[1]->ToObject())); if( a1->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() > 2 && info[2]->IsArray()) { v8::Local<v8::Array>a2(v8::Local<v8::Array>::Cast(info[2]->ToObject())); int b2[3]; if( a2->Length() < 3 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 3; i++ ) { if( !a2->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b2[i] = a2->Get(i)->Int32Value(); } if(info.Length() > 3 && info[3]->IsBoolean()) { if(info.Length() > 4 && info[4]->IsInt32Array()) { v8::Local<v8::Int32Array>a4(v8::Local<v8::Int32Array>::Cast(info[4]->ToObject())); if( a4->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() != 5) { Nan::ThrowError("Too many parameters."); return; } native->GetPartitionedVOI( b0, (int *)(a1->Buffer()->GetContents().Data()), b2, info[3]->BooleanValue(), (int *)(a4->Buffer()->GetContents().Data()) ); return; } } } } } else if(info.Length() > 0 && info[0]->IsInt32Array()) { v8::Local<v8::Int32Array>a0(v8::Local<v8::Int32Array>::Cast(info[0]->ToObject())); if( a0->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() > 1 && info[1]->IsArray()) { v8::Local<v8::Array>a1(v8::Local<v8::Array>::Cast(info[1]->ToObject())); int b1[6]; if( a1->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 6; i++ ) { if( !a1->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b1[i] = a1->Get(i)->Int32Value(); } if(info.Length() > 2 && info[2]->IsInt32Array()) { v8::Local<v8::Int32Array>a2(v8::Local<v8::Int32Array>::Cast(info[2]->ToObject())); if( a2->Length() < 3 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() > 3 && info[3]->IsBoolean()) { if(info.Length() > 4 && info[4]->IsInt32Array()) { v8::Local<v8::Int32Array>a4(v8::Local<v8::Int32Array>::Cast(info[4]->ToObject())); if( a4->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() != 5) { Nan::ThrowError("Too many parameters."); return; } native->GetPartitionedVOI( (int *)(a0->Buffer()->GetContents().Data()), b1, (int *)(a2->Buffer()->GetContents().Data()), info[3]->BooleanValue(), (int *)(a4->Buffer()->GetContents().Data()) ); return; } } } } } else if(info.Length() > 0 && info[0]->IsArray()) { v8::Local<v8::Array>a0(v8::Local<v8::Array>::Cast(info[0]->ToObject())); int b0[6]; if( a0->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 6; i++ ) { if( !a0->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b0[i] = a0->Get(i)->Int32Value(); } if(info.Length() > 1 && info[1]->IsArray()) { v8::Local<v8::Array>a1(v8::Local<v8::Array>::Cast(info[1]->ToObject())); int b1[6]; if( a1->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 6; i++ ) { if( !a1->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b1[i] = a1->Get(i)->Int32Value(); } if(info.Length() > 2 && info[2]->IsInt32Array()) { v8::Local<v8::Int32Array>a2(v8::Local<v8::Int32Array>::Cast(info[2]->ToObject())); if( a2->Length() < 3 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() > 3 && info[3]->IsBoolean()) { if(info.Length() > 4 && info[4]->IsInt32Array()) { v8::Local<v8::Int32Array>a4(v8::Local<v8::Int32Array>::Cast(info[4]->ToObject())); if( a4->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() != 5) { Nan::ThrowError("Too many parameters."); return; } native->GetPartitionedVOI( b0, b1, (int *)(a2->Buffer()->GetContents().Data()), info[3]->BooleanValue(), (int *)(a4->Buffer()->GetContents().Data()) ); return; } } } } else if(info.Length() > 1 && info[1]->IsInt32Array()) { v8::Local<v8::Int32Array>a1(v8::Local<v8::Int32Array>::Cast(info[1]->ToObject())); if( a1->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() > 2 && info[2]->IsInt32Array()) { v8::Local<v8::Int32Array>a2(v8::Local<v8::Int32Array>::Cast(info[2]->ToObject())); if( a2->Length() < 3 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() > 3 && info[3]->IsBoolean()) { if(info.Length() > 4 && info[4]->IsInt32Array()) { v8::Local<v8::Int32Array>a4(v8::Local<v8::Int32Array>::Cast(info[4]->ToObject())); if( a4->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() != 5) { Nan::ThrowError("Too many parameters."); return; } native->GetPartitionedVOI( b0, (int *)(a1->Buffer()->GetContents().Data()), (int *)(a2->Buffer()->GetContents().Data()), info[3]->BooleanValue(), (int *)(a4->Buffer()->GetContents().Data()) ); return; } } } } } Nan::ThrowError("Parameter mismatch"); } void VtkExtractStructuredGridHelperWrap::GetSize(const Nan::FunctionCallbackInfo<v8::Value>& info) { VtkExtractStructuredGridHelperWrap *wrapper = ObjectWrap::Unwrap<VtkExtractStructuredGridHelperWrap>(info.Holder()); vtkExtractStructuredGridHelper *native = (vtkExtractStructuredGridHelper *)wrapper->native.GetPointer(); if(info.Length() > 0 && info[0]->IsInt32()) { int r; if(info.Length() != 1) { Nan::ThrowError("Too many parameters."); return; } r = native->GetSize( info[0]->Int32Value() ); info.GetReturnValue().Set(Nan::New(r)); return; } Nan::ThrowError("Parameter mismatch"); } void VtkExtractStructuredGridHelperWrap::Initialize(const Nan::FunctionCallbackInfo<v8::Value>& info) { VtkExtractStructuredGridHelperWrap *wrapper = ObjectWrap::Unwrap<VtkExtractStructuredGridHelperWrap>(info.Holder()); vtkExtractStructuredGridHelper *native = (vtkExtractStructuredGridHelper *)wrapper->native.GetPointer(); size_t i; if(info.Length() > 0 && info[0]->IsInt32Array()) { v8::Local<v8::Int32Array>a0(v8::Local<v8::Int32Array>::Cast(info[0]->ToObject())); if( a0->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() > 1 && info[1]->IsInt32Array()) { v8::Local<v8::Int32Array>a1(v8::Local<v8::Int32Array>::Cast(info[1]->ToObject())); if( a1->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() > 2 && info[2]->IsInt32Array()) { v8::Local<v8::Int32Array>a2(v8::Local<v8::Int32Array>::Cast(info[2]->ToObject())); if( a2->Length() < 3 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() > 3 && info[3]->IsBoolean()) { if(info.Length() != 4) { Nan::ThrowError("Too many parameters."); return; } native->Initialize( (int *)(a0->Buffer()->GetContents().Data()), (int *)(a1->Buffer()->GetContents().Data()), (int *)(a2->Buffer()->GetContents().Data()), info[3]->BooleanValue() ); return; } } else if(info.Length() > 2 && info[2]->IsArray()) { v8::Local<v8::Array>a2(v8::Local<v8::Array>::Cast(info[2]->ToObject())); int b2[3]; if( a2->Length() < 3 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 3; i++ ) { if( !a2->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b2[i] = a2->Get(i)->Int32Value(); } if(info.Length() > 3 && info[3]->IsBoolean()) { if(info.Length() != 4) { Nan::ThrowError("Too many parameters."); return; } native->Initialize( (int *)(a0->Buffer()->GetContents().Data()), (int *)(a1->Buffer()->GetContents().Data()), b2, info[3]->BooleanValue() ); return; } } } else if(info.Length() > 1 && info[1]->IsArray()) { v8::Local<v8::Array>a1(v8::Local<v8::Array>::Cast(info[1]->ToObject())); int b1[6]; if( a1->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 6; i++ ) { if( !a1->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b1[i] = a1->Get(i)->Int32Value(); } if(info.Length() > 2 && info[2]->IsArray()) { v8::Local<v8::Array>a2(v8::Local<v8::Array>::Cast(info[2]->ToObject())); int b2[3]; if( a2->Length() < 3 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 3; i++ ) { if( !a2->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b2[i] = a2->Get(i)->Int32Value(); } if(info.Length() > 3 && info[3]->IsBoolean()) { if(info.Length() != 4) { Nan::ThrowError("Too many parameters."); return; } native->Initialize( (int *)(a0->Buffer()->GetContents().Data()), b1, b2, info[3]->BooleanValue() ); return; } } } } else if(info.Length() > 0 && info[0]->IsArray()) { v8::Local<v8::Array>a0(v8::Local<v8::Array>::Cast(info[0]->ToObject())); int b0[6]; if( a0->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 6; i++ ) { if( !a0->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b0[i] = a0->Get(i)->Int32Value(); } if(info.Length() > 1 && info[1]->IsArray()) { v8::Local<v8::Array>a1(v8::Local<v8::Array>::Cast(info[1]->ToObject())); int b1[6]; if( a1->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 6; i++ ) { if( !a1->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b1[i] = a1->Get(i)->Int32Value(); } if(info.Length() > 2 && info[2]->IsArray()) { v8::Local<v8::Array>a2(v8::Local<v8::Array>::Cast(info[2]->ToObject())); int b2[3]; if( a2->Length() < 3 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 3; i++ ) { if( !a2->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b2[i] = a2->Get(i)->Int32Value(); } if(info.Length() > 3 && info[3]->IsBoolean()) { if(info.Length() != 4) { Nan::ThrowError("Too many parameters."); return; } native->Initialize( b0, b1, b2, info[3]->BooleanValue() ); return; } } } else if(info.Length() > 1 && info[1]->IsInt32Array()) { v8::Local<v8::Int32Array>a1(v8::Local<v8::Int32Array>::Cast(info[1]->ToObject())); if( a1->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() > 2 && info[2]->IsArray()) { v8::Local<v8::Array>a2(v8::Local<v8::Array>::Cast(info[2]->ToObject())); int b2[3]; if( a2->Length() < 3 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 3; i++ ) { if( !a2->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b2[i] = a2->Get(i)->Int32Value(); } if(info.Length() > 3 && info[3]->IsBoolean()) { if(info.Length() != 4) { Nan::ThrowError("Too many parameters."); return; } native->Initialize( b0, (int *)(a1->Buffer()->GetContents().Data()), b2, info[3]->BooleanValue() ); return; } } } } else if(info.Length() > 0 && info[0]->IsInt32Array()) { v8::Local<v8::Int32Array>a0(v8::Local<v8::Int32Array>::Cast(info[0]->ToObject())); if( a0->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() > 1 && info[1]->IsArray()) { v8::Local<v8::Array>a1(v8::Local<v8::Array>::Cast(info[1]->ToObject())); int b1[6]; if( a1->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 6; i++ ) { if( !a1->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b1[i] = a1->Get(i)->Int32Value(); } if(info.Length() > 2 && info[2]->IsInt32Array()) { v8::Local<v8::Int32Array>a2(v8::Local<v8::Int32Array>::Cast(info[2]->ToObject())); if( a2->Length() < 3 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() > 3 && info[3]->IsBoolean()) { if(info.Length() != 4) { Nan::ThrowError("Too many parameters."); return; } native->Initialize( (int *)(a0->Buffer()->GetContents().Data()), b1, (int *)(a2->Buffer()->GetContents().Data()), info[3]->BooleanValue() ); return; } } } } else if(info.Length() > 0 && info[0]->IsArray()) { v8::Local<v8::Array>a0(v8::Local<v8::Array>::Cast(info[0]->ToObject())); int b0[6]; if( a0->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 6; i++ ) { if( !a0->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b0[i] = a0->Get(i)->Int32Value(); } if(info.Length() > 1 && info[1]->IsArray()) { v8::Local<v8::Array>a1(v8::Local<v8::Array>::Cast(info[1]->ToObject())); int b1[6]; if( a1->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 6; i++ ) { if( !a1->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b1[i] = a1->Get(i)->Int32Value(); } if(info.Length() > 2 && info[2]->IsInt32Array()) { v8::Local<v8::Int32Array>a2(v8::Local<v8::Int32Array>::Cast(info[2]->ToObject())); if( a2->Length() < 3 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() > 3 && info[3]->IsBoolean()) { if(info.Length() != 4) { Nan::ThrowError("Too many parameters."); return; } native->Initialize( b0, b1, (int *)(a2->Buffer()->GetContents().Data()), info[3]->BooleanValue() ); return; } } } else if(info.Length() > 1 && info[1]->IsInt32Array()) { v8::Local<v8::Int32Array>a1(v8::Local<v8::Int32Array>::Cast(info[1]->ToObject())); if( a1->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() > 2 && info[2]->IsInt32Array()) { v8::Local<v8::Int32Array>a2(v8::Local<v8::Int32Array>::Cast(info[2]->ToObject())); if( a2->Length() < 3 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() > 3 && info[3]->IsBoolean()) { if(info.Length() != 4) { Nan::ThrowError("Too many parameters."); return; } native->Initialize( b0, (int *)(a1->Buffer()->GetContents().Data()), (int *)(a2->Buffer()->GetContents().Data()), info[3]->BooleanValue() ); return; } } } } Nan::ThrowError("Parameter mismatch"); } void VtkExtractStructuredGridHelperWrap::IsA(const Nan::FunctionCallbackInfo<v8::Value>& info) { VtkExtractStructuredGridHelperWrap *wrapper = ObjectWrap::Unwrap<VtkExtractStructuredGridHelperWrap>(info.Holder()); vtkExtractStructuredGridHelper *native = (vtkExtractStructuredGridHelper *)wrapper->native.GetPointer(); if(info.Length() > 0 && info[0]->IsString()) { Nan::Utf8String a0(info[0]); int r; if(info.Length() != 1) { Nan::ThrowError("Too many parameters."); return; } r = native->IsA( *a0 ); info.GetReturnValue().Set(Nan::New(r)); return; } Nan::ThrowError("Parameter mismatch"); } void VtkExtractStructuredGridHelperWrap::IsValid(const Nan::FunctionCallbackInfo<v8::Value>& info) { VtkExtractStructuredGridHelperWrap *wrapper = ObjectWrap::Unwrap<VtkExtractStructuredGridHelperWrap>(info.Holder()); vtkExtractStructuredGridHelper *native = (vtkExtractStructuredGridHelper *)wrapper->native.GetPointer(); bool r; if(info.Length() != 0) { Nan::ThrowError("Too many parameters."); return; } r = native->IsValid(); info.GetReturnValue().Set(Nan::New(r)); } void VtkExtractStructuredGridHelperWrap::NewInstance(const Nan::FunctionCallbackInfo<v8::Value>& info) { VtkExtractStructuredGridHelperWrap *wrapper = ObjectWrap::Unwrap<VtkExtractStructuredGridHelperWrap>(info.Holder()); vtkExtractStructuredGridHelper *native = (vtkExtractStructuredGridHelper *)wrapper->native.GetPointer(); vtkExtractStructuredGridHelper * r; if(info.Length() != 0) { Nan::ThrowError("Too many parameters."); return; } r = native->NewInstance(); VtkExtractStructuredGridHelperWrap::InitPtpl(); v8::Local<v8::Value> argv[1] = { Nan::New(vtkNodeJsNoWrap) }; v8::Local<v8::Function> cons = Nan::New<v8::FunctionTemplate>(VtkExtractStructuredGridHelperWrap::ptpl)->GetFunction(); v8::Local<v8::Object> wo = cons->NewInstance(1, argv); VtkExtractStructuredGridHelperWrap *w = new VtkExtractStructuredGridHelperWrap(); w->native = r; w->Wrap(wo); info.GetReturnValue().Set(wo); } void VtkExtractStructuredGridHelperWrap::SafeDownCast(const Nan::FunctionCallbackInfo<v8::Value>& info) { VtkExtractStructuredGridHelperWrap *wrapper = ObjectWrap::Unwrap<VtkExtractStructuredGridHelperWrap>(info.Holder()); vtkExtractStructuredGridHelper *native = (vtkExtractStructuredGridHelper *)wrapper->native.GetPointer(); if(info.Length() > 0 && info[0]->IsObject() && (Nan::New(VtkObjectWrap::ptpl))->HasInstance(info[0])) { VtkObjectWrap *a0 = ObjectWrap::Unwrap<VtkObjectWrap>(info[0]->ToObject()); vtkExtractStructuredGridHelper * r; if(info.Length() != 1) { Nan::ThrowError("Too many parameters."); return; } r = native->SafeDownCast( (vtkObject *) a0->native.GetPointer() ); VtkExtractStructuredGridHelperWrap::InitPtpl(); v8::Local<v8::Value> argv[1] = { Nan::New(vtkNodeJsNoWrap) }; v8::Local<v8::Function> cons = Nan::New<v8::FunctionTemplate>(VtkExtractStructuredGridHelperWrap::ptpl)->GetFunction(); v8::Local<v8::Object> wo = cons->NewInstance(1, argv); VtkExtractStructuredGridHelperWrap *w = new VtkExtractStructuredGridHelperWrap(); w->native = r; w->Wrap(wo); info.GetReturnValue().Set(wo); return; } Nan::ThrowError("Parameter mismatch"); }
axkibe/node-vtk
wrappers/7.0.0/vtkExtractStructuredGridHelperWrap.cc
C++
bsd-3-clause
146,024
# pvgit pvgit is a pipeviz message producer for working with git repositories. It has two basic operations: 1. `pvgit sync` will report all the refs (branches and tags) in a repository, as well as the current HEAD. If `-a` is passed, it will also send the repository’s entire commit history. 1. `pvgit instrument` is used to set up `post-commit` and/or `post-checkout` hooks on a git repository. These will automatically inform a pipeviz daemon whenever commits are made or branches are changed. See the `help` output for each command for more details. # Installation This package uses [glide](https://github.com/Masterminds/glide) to manage dependencies. It also relies on [git2go](https://github.com/libgit2/git2go) for git interactions via libgit2, which means installation involves CGO. Installing libgit2 is an OS/distro-specific process, so see [git2go](https://github.com/libgit2/git2go#installing) docs on that. Once libgit2 is findable by pkg-config and glide is on your $PATH, run `make && make install` to install pvgit.
pipeviz/pvgit
README.md
Markdown
bsd-3-clause
1,040
<?php namespace app\models; use Yii; /** * This is the model class for table "user_role". * * @property integer $id * @property string $role * * @property User[] $users */ class UserRole extends \yii\db\ActiveRecord { /** * @inheritdoc */ public static function tableName() { return 'user_role'; } /** * @inheritdoc */ public function rules() { return [ [['role'], 'required'], [['role'], 'string', 'max' => 45], ]; } /** * @inheritdoc */ public function attributeLabels() { return [ 'id' => 'ID', 'role' => 'Role', ]; } /** * @return \yii\db\ActiveQuery */ public function getUsers() { return $this->hasMany(User::className(), ['user_role_id' => 'id']); } }
ntajxyooj/Money
models/UserRole.php
PHP
bsd-3-clause
872
require File.expand_path(File.dirname(__FILE__) + "/../spec_helper") require "steak" require "capybara/rails" require "capybara/dsl" require "selenium-webdriver" # Put your acceptance spec helpers inside /spec/acceptance/support Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f} Capybara.default_wait_time = 10 Capybara.server_port = 3333 RSpec.configure do |config| config.include Warden::Test::Helpers config.include Capybara, :type => :acceptance config.before(:each) do Rails.cache.clear end config.before(:each, :js => true) do Capybara.current_driver = :selenium end config.after(:each, :type => :acceptance) do case page.driver.class when Capybara::Driver::RackTest page.driver.rack_mock_session.clear_cookies when Capybara::Driver::Culerity page.driver.browser.clear_cookies when Capybara::Driver::Selenium page.driver.cleanup! end Capybara.use_default_driver end end
Vizzuality/cartoset
spec/acceptance/acceptance_helper.rb
Ruby
bsd-3-clause
970
--- title: "Epic Links" tags: learning music self-improvement tech --- A collection of links that I found useful, inspired me and may bring you enjoyment and/or enlightenment as well. ## Disclaimer I'm not in any way affiliated with the following links, I just find them useful, delightful, funny... ## Useful Tools * [https://caniuse.com](https://caniuse.com) * [https://css-tricks.com](https://css-tricks.com) ## Favorite Developer Blogs * [ayende.com](https://ayende.com) * [blog.ploeh.dk/](http://blog.ploeh.dk) * [cuttingedge.it/blogs/steven/](https://cuttingedge.it/blogs/steven) * [ericlippert.com](https://ericlippert.com) ## Daily Dose * [aeon.co](https://aeon.co) * [news.ycombinator.com/newest](https://news.ycombinator.com/newest) * [reddit.com/r/elm/new](https://www.reddit.com/r/elm/new) * [discourse.elm-lang.org](https://discourse.elm-lang.org) * [elm-dev](https://groups.google.com/forum/#!forum/elm-dev) * [elm-discuss](https://groups.google.com/forum/#!forum/elm-discuss) * [reddit.com/r/javascript/new](https://www.reddit.com/r/javascript/new) * [reddit.com/r/elm/csharp](https://www.reddit.com/r/csharp/new) * [reddit.com/r/java/new](https://www.reddit.com/r/java/new) ## Articles ### Design & Layout <ul> <li> <span class="ui-content__last-update">[2017-03-20]</span> <a href="http://lea.verou.me/css3patterns/" target="_blank">CSS3 Patterns Gallery</a> </li> <li> <span class="ui-content__last-update">[2017-03-20]</span> <a href="https://css-tricks.com/dont-overthink-it-grids/" target="_blank">Don't overthink it grids</a> </li> <li> <span class="ui-content__last-update">[2017-03-20]</span> <a href="https://www.lightningdesignsystem.com/getting-started/" target="_blank">Lightning Design System</a> <em>I'm not a fan of salesforce but their BEM design system is inspired.</em> </li> </ul> ### Sleeping - <span class="ui-content__last-update">[2017-12-17]</span> <a href="https://www.stevepavlina.com/blog/2005/10/polyphasic-sleep/" target="_blank">Polyphasic Sleep</a> - <span class="ui-content__last-update">[2017-12-17]</span> <a href="https://www.stevepavlina.com/blog/2006/01/stevepavlinacom-podcast-010-lucid-dreaming/" target="_blank">Lucid Dreaming Podcast</a> - <span class="ui-content__last-update">[2017-03-20]</span> <a href="https://aeon.co/essays/the-terror-and-the-bliss-of-sleep-paralysis" target="_blank">The Terror and the Bliss of Sleep Paralysis</a> - <span class="ui-content__last-update">[2017-03-20]</span> <a href="https://aeon.co/essays/why-broken-sleep-is-a-golden-time-for-creativity" target="_blank">Why broken sleep is a golden time for creativity</a> - <span class="ui-content__last-update">[2019-08-06]</span> <a href="http://www.bbc.com/future/story/20190516-why-cant-some-people-remember-their-dreams" target="_blank">Why can't people remember their dreams?</a> - <span class="ui-content__last-update">[2019-08-06]</span> <a href="http://www.bbc.com/future/story/20190503-how-to-become-a-lucid-dreamer" target="_blank">How to become a lucid dreamer</a> ### Music - <span class="ui-content__last-update">[2017-03-20]</span> <a href="https://pudding.cool/2017/03/music-history/index.html" target="_blank">How Music Evolved: Billboard's Hot 100, 1958 - 2016</a> ### Imagination - <span class="ui-content__last-update">[2017-12-03]</span> <a href="https://theconversation.com/blind-in-the-mind-why-some-people-cant-see-pictures-in-their-imagination-86849" target="_blank">Blind in the Mind - Why Some People can't see pictures in their imagination</a> ### Reading - <span class="ui-content__last-update">[2017-03-20]</span> <a href="http://www.asimovonline.com/oldsite/asimov_titles.html" target="_blank">A List of Isaac Asimov's Books</a> - <span class="ui-content__last-update">[2017-03-20]</span> <a href="http://www.depauw.edu/sfs/backissues/5/lem5art.htm" target="_blank">Stanislaw Lem: Philip K. Dick: A Visionary Among the Charlatans</a> ### Science - <span class="ui-content__last-update">[2017-03-20]</span> <a href="https://aeon.co/essays/why-pregnancy-is-a-biological-war-between-mother-and-baby" target="_blank">Why Pregnancy is a Biological War Between Mother and Baby</a> ### Software Architecture <ul> <li> <span class="ui-content__last-update">[2017-12-08]</span> <a href="http://joeduffyblog.com/2015/11/03/blogging-about-midori/" target="_blank">Blogging About Midori (MS Async First OS Experiment)</a> </li> <li> <span class="ui-content__last-update">[2017-12-08]</span> <a href="https://gustafnk.github.io/microservice-websites/" target="_blank">Microservice Websites (Full Article)</a> </li> <li> <span class="ui-content__last-update">[2017-12-08]</span> <a href="http://microservice-websites.netlify.com/" target="_blank">Microservice Websites (Just the Gist)</a> </li> </ul> ### Tech/Programming <ul> <li> <span class="ui-content__last-update">[2017-03-20]</span> <a href="http://fabiensanglard.net/anotherWorld_code_review/index.php" target="_blank">Another World Code Review</a> </li> <li> <span class="ui-content__last-update">[2017-03-20]</span> <a href="http://dev.stephendiehl.com/hask/" target="_blank">What I wish I knew when learning Haskell</a> </li> </ul> ## Talks ### Learning - <span class="ui-content__last-update">[2017-03-20]</span> <a href="https://www.youtube.com/watch?v=5MgBikgcWnY" target="_blank">The first 20 hours -- how to learn anything | Josh Kaufman</a> ### Tech <ul> <li> <span class="ui-content__last-update">[2017-03-20]</span> <a href="https://www.youtube.com/watch?v=TMuno5RZNeE" target="_blank">Bob Martin SOLID Principles of Object Oriented and Agile Design</a> </li> <li> <span class="ui-content__last-update">[2017-03-20]</span> <a href="https://www.youtube.com/watch?v=ecIWPzGEbFc" target="_blank">"Uncle" Bob Martin - "The Future of Programming"</a> </li> <li> <span class="ui-content__last-update">[2017-03-20]</span> <a href="https://www.youtube.com/watch?v=ZhuHCtR3xq8" target="_blank">Brian Beckman: Don't fear the Monad</a> </li> <li> <span class="ui-content__last-update">[2017-03-20]</span> <a href="https://www.youtube.com/watch?v=lE6Hxz4yomA" target="_blank">Eric Evans: What I've learned about DDD since the book</a> </li> <li> <span class="ui-content__last-update">[2017-03-20]</span> <a href="https://www.youtube.com/watch?v=oYk8CKH7OhE" target="_blank">Evan Czaplicki - Let's be mainstream! User focused design in Elm - Curry On</a> </li> <li> <span class="ui-content__last-update">[2017-03-20]</span> <a href="https://www.youtube.com/watch?v=KSuCYUqY058" target="_blank">Evan Czaplicki - elm-autocomplete with Greg Ziegan (API Design Session)</a> </li> <li> <span class="ui-content__last-update">[2017-03-20]</span> <a href="https://www.youtube.com/watch?v=looJcaeboBY" target="_blank">Expert to Expert: Brian Beckman and Erik Meijer - Inside the .NET Reactive Framework (Rx)</a> </li> <li> <span class="ui-content__last-update">[2017-03-20]</span> <a href="https://www.youtube.com/watch?v=LDW0QWie21s" target="_blank">Greg Young — A Decade of DDD, CQRS, Event Sourcing</a> </li> <li> <span class="ui-content__last-update">[2017-03-20]</span> <a href="https://www.youtube.com/watch?v=JHGkaShoyNs" target="_blank">Greg Young - CQRS and Event Sourcing - Code on the Beach 2014</a> </li> <li> <span class="ui-content__last-update">[2017-03-20]</span> <a href="https://www.youtube.com/watch?v=KaLROwp-VDY" target="_blank">Greg Young - "How to get productive in a project in 24h"</a> </li> <li> <span class="ui-content__last-update">[2018-01-26]</span> <a href="https://vimeo.com/108441214" target="_blank">Greg Young — The art of destroying software</a> </li> <li> <span class="ui-content__last-update">[2017-03-20]</span> <a href="https://www.youtube.com/watch?v=IcgmSRJHu_8" target="_blank">Richard Feldman - "Making Impossible States Impossible" </a> </li> </ul>
canena/canena.github.io
src/_posts/2017-03-20-epic-links.md
Markdown
bsd-3-clause
8,340
<?php $vendorDir = dirname(__DIR__); return array ( 'yiisoft/yii2-bootstrap' => array ( 'name' => 'yiisoft/yii2-bootstrap', 'version' => '2.0.5.0', 'alias' => array ( '@yii/bootstrap' => $vendorDir . '/yiisoft/yii2-bootstrap', ), ), 'cebe/yii2-gravatar' => array ( 'name' => 'cebe/yii2-gravatar', 'version' => '1.1.0.0', 'alias' => array ( '@cebe/gravatar' => $vendorDir . '/cebe/yii2-gravatar/cebe/gravatar', ), ), 'yiisoft/yii2-swiftmailer' => array ( 'name' => 'yiisoft/yii2-swiftmailer', 'version' => '2.0.4.0', 'alias' => array ( '@yii/swiftmailer' => $vendorDir . '/yiisoft/yii2-swiftmailer', ), ), 'yiisoft/yii2-codeception' => array ( 'name' => 'yiisoft/yii2-codeception', 'version' => '2.0.4.0', 'alias' => array ( '@yii/codeception' => $vendorDir . '/yiisoft/yii2-codeception', ), ), 'yiisoft/yii2-debug' => array ( 'name' => 'yiisoft/yii2-debug', 'version' => '2.0.5.0', 'alias' => array ( '@yii/debug' => $vendorDir . '/yiisoft/yii2-debug', ), ), 'yiisoft/yii2-faker' => array ( 'name' => 'yiisoft/yii2-faker', 'version' => '2.0.3.0', 'alias' => array ( '@yii/faker' => $vendorDir . '/yiisoft/yii2-faker', ), ), 'yiisoft/yii2-gii' => array ( 'name' => 'yiisoft/yii2-gii', 'version' => '2.0.4.0', 'alias' => array ( '@yii/gii' => $vendorDir . '/yiisoft/yii2-gii', ), ), 'rmrevin/yii2-fontawesome' => array ( 'name' => 'rmrevin/yii2-fontawesome', 'version' => '2.13.0.0', 'alias' => array ( '@rmrevin/yii/fontawesome' => $vendorDir . '/rmrevin/yii2-fontawesome', ), ), 'dmstr/yii2-adminlte-asset' => array ( 'name' => 'dmstr/yii2-adminlte-asset', 'version' => '2.2.4.0', 'alias' => array ( '@dmstr' => $vendorDir . '/dmstr/yii2-adminlte-asset', ), ), 'yiisoft/yii2-jui' => array ( 'name' => 'yiisoft/yii2-jui', 'version' => '2.0.4.0', 'alias' => array ( '@yii/jui' => $vendorDir . '/yiisoft/yii2-jui', ), ), );
damsal7/obligatorioPhp
vendor/yiisoft/extensions.php
PHP
bsd-3-clause
2,163
/************************************************************************************************************************ Copyright (c) 2016, Imagination Technologies Limited and/or its affiliated group companies. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ************************************************************************************************************************/ #include <string.h> #include <stdio.h> #include "awa/static.h" #define HEATER_INSTANCES 1 typedef struct { char Manufacturer[64]; AwaFloat Temperature; } HeaterObject; static HeaterObject heater[HEATER_INSTANCES]; AwaResult handler(AwaStaticClient * client, AwaOperation operation, AwaObjectID objectID, AwaObjectInstanceID objectInstanceID, AwaResourceID resourceID, AwaResourceInstanceID resourceInstanceID, void ** dataPointer, size_t * dataSize, bool * changed) { AwaResult result = AwaResult_InternalError; if ((objectID == 1000) && (objectInstanceID >= 0) && (objectInstanceID < HEATER_INSTANCES)) { switch (operation) { case AwaOperation_CreateObjectInstance: { result = AwaResult_SuccessCreated; memset(&heater[objectInstanceID], 0, sizeof(heater[objectInstanceID])); break; } case AwaOperation_CreateResource: { switch (resourceID) { case 101: strcpy(heater[objectInstanceID].Manufacturer, "HotAir Systems Inc"); break; case 104: heater[objectInstanceID].Temperature = 0.0; break; default: break; } result = AwaResult_SuccessCreated; break; } case AwaOperation_Write: { switch (resourceID) { case 101: { int currentLength = strlen(heater[objectInstanceID].Manufacturer) + 1; if ((*dataSize != currentLength) || (memcmp(*dataPointer, heater[objectInstanceID].Manufacturer, currentLength) != 0)) { *changed = true; strcpy(heater[objectInstanceID].Manufacturer, "HotAir Systems Inc"); } break; } case 104: { AwaFloat newTemperature = **((AwaFloat **)dataPointer); if (newTemperature != heater[objectInstanceID].Temperature) { *changed = true; heater[objectInstanceID].Temperature = newTemperature; } break; } default: break; } result = AwaResult_SuccessChanged; break; } case AwaOperation_Read: { switch (resourceID) { case 101: { *dataPointer = heater[objectInstanceID].Manufacturer; *dataSize = strlen(heater[objectInstanceID].Manufacturer) + 1; break; } case 104: { *dataPointer = &heater[objectInstanceID].Temperature; *dataSize = sizeof(heater[objectInstanceID].Temperature); break; } default: break; } result = AwaResult_SuccessContent; break; } default: result = AwaResult_InternalError; break; } } return result; } static void DefineHeaterObject(AwaStaticClient * awaClient) { AwaStaticClient_DefineObject(awaClient, 1000, "Heater", 0, HEATER_INSTANCES); AwaStaticClient_SetObjectOperationHandler(awaClient, 1000, handler); AwaStaticClient_DefineResource(awaClient, 1000, 101, "Manufacturer", AwaResourceType_String, 0, 1, AwaResourceOperations_ReadWrite); AwaStaticClient_SetResourceOperationHandler(awaClient, 1000, 101, handler); AwaStaticClient_DefineResource(awaClient, 1000, 104, "Temperature", AwaResourceType_Float, 0, 1, AwaResourceOperations_ReadWrite); AwaStaticClient_SetResourceOperationHandler(awaClient, 1000, 104, handler); } static void CreateHeaterObject(AwaStaticClient * awaClient) { int instance = 0; AwaStaticClient_CreateObjectInstance(awaClient, 1000, instance); AwaStaticClient_CreateResource(awaClient, 1000, instance, 101); AwaStaticClient_CreateResource(awaClient, 1000, instance, 104); } int main(void) { AwaStaticClient * awaClient = AwaStaticClient_New(); AwaStaticClient_SetLogLevel(AwaLogLevel_Error); AwaStaticClient_SetEndPointName(awaClient, "AwaStaticClient1"); AwaStaticClient_SetCoAPListenAddressPort(awaClient, "0.0.0.0", 0); AwaStaticClient_SetBootstrapServerURI(awaClient, "coap://[127.0.0.1]:15685"); AwaStaticClient_Init(awaClient); DefineHeaterObject(awaClient); CreateHeaterObject(awaClient); while (1) { AwaStaticClient_Process(awaClient); //heater[0].Temperature = value from hardware //AwaStaticClient_ResourceChanged(awaClient, 1000, 0, 104); } AwaStaticClient_Free(&awaClient); return 0; }
FlowM2M/AwaLWM2M
api/examples/tutorials/static-client-tutorial3.c
C
bsd-3-clause
7,158
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head profile="http://selenium-ide.openqa.org/profiles/test-case"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>Creat account Nothing</title> </head> <body> <table cellpadding="1" cellspacing="1" border="1"> <thead> <tr><td rowspan="1" colspan="3">Creat account Nothing</td></tr> </thead><tbody> <tr> <td>open</td> <td>/</td> <td></td> </tr> <tr> <td>click</td> <td>id=create_account_button</td> <td></td> </tr> <tr> <td>waitForText</td> <td>css=div.modal_dialog &gt; div.modal_dialog_top_block &gt; div.modal_dialog_title</td> <td>Create a New Account</td> </tr> <tr> <td>sendKeys</td> <td>id=form_create_account_field_email</td> <td>[email protected]</td> </tr> <tr> <td>verifyElementPresent</td> <td>css=#form_create_account_submit_button.disabled</td> <td></td> </tr> </tbody></table> </body> </html>
solarpermit/solarpermit
functional-tests/CreateanAccount-GoodEmail.html
HTML
bsd-3-clause
1,073
var User = require('../models/user'); var jwt = require('jsonwebtoken'); // used to create, sign, and verify tokens var config = require('../config.js'); exports.getToken = function (user) { return jwt.sign(user, config.secretKey, { expiresIn: 3600 }); }; exports.verifyOrdinaryUser = function (req, res, next) { // check header or url parameters or post parameters for token var token = req.body.token || req.query.token || req.headers['x-access-token']; // decode token if (token) { // verifies secret and checks exp jwt.verify(token, config.secretKey, function (err, decoded) { if (err) { var err = new Error('You are not authenticated!'); err.status = 401; return next(err); } else { // if everything is good, save to request for use in other routes req.decoded = decoded; next(); } }); } else { // if there is no token // return an error var err = new Error('No token provided!'); err.status = 403; return next(err); } };
namuit/coursera-server-side-development
week3/rest-server-passport/models/verify.js
JavaScript
isc
1,166
<ng-container [formGroup]="group"> <kendo-autocomplete #kendoAutoComplete [data]="model.list" [formControlName]="model.id" [id]="id" [ngClass]="[getClass('element', 'control'), getClass('grid', 'control')]" [placeholder]="model.placeholder" [popupSettings]="model.getAdditional('popupSettings', {})" [suggest]="model.getAdditional('suggest', false)" [tabIndex]="model.tabIndex" (blur)="onBlur($event)" (close)="onCustomEvent($event, 'close')" (filterChange)="onCustomEvent($event, 'filterChange')" (focus)="onFocus($event)" (open)="onCustomEvent($event, 'open')" (valueChange)="onChange($event)"></kendo-autocomplete> </ng-container>
udos86/ng-dynamic-forms
projects/ng-dynamic-forms/ui-kendo/src/lib/autocomplete/dynamic-kendo-autocomplete.component.html
HTML
isc
976
/* * Sun RPC is a product of Sun Microsystems, Inc. and is provided for * unrestricted use provided that this legend is included on all tape * media and as a part of the software program in whole or part. Users * may copy or modify Sun RPC without charge, but are not authorized * to license or distribute it to anyone else except as part of a product or * program developed by the user. * * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. * * Sun RPC is provided with no support and without any obligation on the * part of Sun Microsystems, Inc. to assist in its use, correction, * modification or enhancement. * * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC * OR ANY PART THEREOF. * * In no event will Sun Microsystems, Inc. be liable for any lost revenue * or profits or other special, indirect and consequential damages, even if * Sun has been advised of the possibility of such damages. * * Sun Microsystems, Inc. * 2550 Garcia Avenue * Mountain View, California 94043 */ #if 0 #ifndef lint #ident "@(#)rpc_cout.c 1.14 93/07/05 SMI" static char sccsid[] = "@(#)rpc_cout.c 1.13 89/02/22 (C) 1987 SMI"; #endif #endif #include <sys/cdefs.h> __FBSDID("$FreeBSD$"); /* * rpc_cout.c, XDR routine outputter for the RPC protocol compiler * Copyright (C) 1987, Sun Microsystems, Inc. */ #include <ctype.h> #include <stdio.h> #include <string.h> #include "rpc_parse.h" #include "rpc_scan.h" #include "rpc_util.h" static void print_header( definition * ); static void print_trailer( void ); static void print_stat( int , declaration * ); static void emit_enum( definition * ); static void emit_program( definition * ); static void emit_union( definition * ); static void emit_struct( definition * ); static void emit_typedef( definition * ); static void emit_inline( int, declaration *, int ); static void emit_single_in_line( int, declaration *, int, relation ); /* * Emit the C-routine for the given definition */ void emit(definition *def) { if (def->def_kind == DEF_CONST) { return; } if (def->def_kind == DEF_PROGRAM) { emit_program(def); return; } if (def->def_kind == DEF_TYPEDEF) { /* * now we need to handle declarations like * struct typedef foo foo; * since we dont want this to be expanded into 2 calls to xdr_foo */ if (strcmp(def->def.ty.old_type, def->def_name) == 0) return; } print_header(def); switch (def->def_kind) { case DEF_UNION: emit_union(def); break; case DEF_ENUM: emit_enum(def); break; case DEF_STRUCT: emit_struct(def); break; case DEF_TYPEDEF: emit_typedef(def); break; /* DEF_CONST and DEF_PROGRAM have already been handled */ default: break; } print_trailer(); } static int findtype(definition *def, const char *type) { if (def->def_kind == DEF_PROGRAM || def->def_kind == DEF_CONST) { return (0); } else { return (streq(def->def_name, type)); } } static int undefined(const char *type) { definition *def; def = (definition *) FINDVAL(defined, type, findtype); return (def == NULL); } static void print_generic_header(const char *procname, int pointerp) { f_print(fout, "\n"); f_print(fout, "bool_t\n"); f_print(fout, "xdr_%s(", procname); f_print(fout, "XDR *xdrs, "); f_print(fout, "%s ", procname); if (pointerp) f_print(fout, "*"); f_print(fout, "objp)\n{\n\n"); } static void print_header(definition *def) { print_generic_header(def->def_name, def->def_kind != DEF_TYPEDEF || !isvectordef(def->def.ty.old_type, def->def.ty.rel)); /* Now add Inline support */ if (inline_size == 0) return; /* May cause lint to complain. but ... */ f_print(fout, "\tregister long *buf;\n\n"); } static void print_prog_header(proc_list *plist) { print_generic_header(plist->args.argname, 1); } static void print_trailer(void) { f_print(fout, "\treturn (TRUE);\n"); f_print(fout, "}\n"); } static void print_ifopen(int indent, const char *name) { tabify(fout, indent); f_print(fout, "if (!xdr_%s(xdrs", name); } static void print_ifarg(const char *arg) { f_print(fout, ", %s", arg); } static void print_ifsizeof(int indent, const char *prefix, const char *type) { if (indent) { f_print(fout, ",\n"); tabify(fout, indent); } else { f_print(fout, ", "); } if (streq(type, "bool")) { f_print(fout, "sizeof (bool_t), (xdrproc_t) xdr_bool"); } else { f_print(fout, "sizeof ("); if (undefined(type) && prefix) { f_print(fout, "%s ", prefix); } f_print(fout, "%s), (xdrproc_t) xdr_%s", type, type); } } static void print_ifclose(int indent, int brace) { f_print(fout, "))\n"); tabify(fout, indent); f_print(fout, "\treturn (FALSE);\n"); if (brace) f_print(fout, "\t}\n"); } static void print_ifstat(int indent, const char *prefix, const char *type, relation rel, const char *amax, const char *objname, const char *name) { const char *alt = NULL; int brace = 0; switch (rel) { case REL_POINTER: brace = 1; f_print(fout, "\t{\n"); f_print(fout, "\t%s **pp = %s;\n", type, objname); print_ifopen(indent, "pointer"); print_ifarg("(char **)"); f_print(fout, "pp"); print_ifsizeof(0, prefix, type); break; case REL_VECTOR: if (streq(type, "string")) { alt = "string"; } else if (streq(type, "opaque")) { alt = "opaque"; } if (alt) { print_ifopen(indent, alt); print_ifarg(objname); } else { print_ifopen(indent, "vector"); print_ifarg("(char *)"); f_print(fout, "%s", objname); } print_ifarg(amax); if (!alt) { print_ifsizeof(indent + 1, prefix, type); } break; case REL_ARRAY: if (streq(type, "string")) { alt = "string"; } else if (streq(type, "opaque")) { alt = "bytes"; } if (streq(type, "string")) { print_ifopen(indent, alt); print_ifarg(objname); } else { if (alt) { print_ifopen(indent, alt); } else { print_ifopen(indent, "array"); } print_ifarg("(char **)"); if (*objname == '&') { f_print(fout, "%s.%s_val, (u_int *) %s.%s_len", objname, name, objname, name); } else { f_print(fout, "&%s->%s_val, (u_int *) &%s->%s_len", objname, name, objname, name); } } print_ifarg(amax); if (!alt) { print_ifsizeof(indent + 1, prefix, type); } break; case REL_ALIAS: print_ifopen(indent, type); print_ifarg(objname); break; } print_ifclose(indent, brace); } /* ARGSUSED */ static void emit_enum(definition *def __unused) { print_ifopen(1, "enum"); print_ifarg("(enum_t *)objp"); print_ifclose(1, 0); } static void emit_program(definition *def) { decl_list *dl; version_list *vlist; proc_list *plist; for (vlist = def->def.pr.versions; vlist != NULL; vlist = vlist->next) for (plist = vlist->procs; plist != NULL; plist = plist->next) { if (!newstyle || plist->arg_num < 2) continue; /* old style, or single argument */ print_prog_header(plist); for (dl = plist->args.decls; dl != NULL; dl = dl->next) print_stat(1, &dl->decl); print_trailer(); } } static void emit_union(definition *def) { declaration *dflt; case_list *cl; declaration *cs; char *object; const char *vecformat = "objp->%s_u.%s"; const char *format = "&objp->%s_u.%s"; print_stat(1, &def->def.un.enum_decl); f_print(fout, "\tswitch (objp->%s) {\n", def->def.un.enum_decl.name); for (cl = def->def.un.cases; cl != NULL; cl = cl->next) { f_print(fout, "\tcase %s:\n", cl->case_name); if (cl->contflag == 1) /* a continued case statement */ continue; cs = &cl->case_decl; if (!streq(cs->type, "void")) { object = xmalloc(strlen(def->def_name) + strlen(format) + strlen(cs->name) + 1); if (isvectordef (cs->type, cs->rel)) { s_print(object, vecformat, def->def_name, cs->name); } else { s_print(object, format, def->def_name, cs->name); } print_ifstat(2, cs->prefix, cs->type, cs->rel, cs->array_max, object, cs->name); free(object); } f_print(fout, "\t\tbreak;\n"); } dflt = def->def.un.default_decl; if (dflt != NULL) { if (!streq(dflt->type, "void")) { f_print(fout, "\tdefault:\n"); object = xmalloc(strlen(def->def_name) + strlen(format) + strlen(dflt->name) + 1); if (isvectordef (dflt->type, dflt->rel)) { s_print(object, vecformat, def->def_name, dflt->name); } else { s_print(object, format, def->def_name, dflt->name); } print_ifstat(2, dflt->prefix, dflt->type, dflt->rel, dflt->array_max, object, dflt->name); free(object); f_print(fout, "\t\tbreak;\n"); } else { f_print(fout, "\tdefault:\n"); f_print(fout, "\t\tbreak;\n"); } } else { f_print(fout, "\tdefault:\n"); f_print(fout, "\t\treturn (FALSE);\n"); } f_print(fout, "\t}\n"); } static void inline_struct(definition *def, int flag) { decl_list *dl; int i, size; decl_list *cur, *psav; bas_type *ptr; char *sizestr; const char *plus; char ptemp[256]; int indent = 1; cur = NULL; if (flag == PUT) f_print(fout, "\n\tif (xdrs->x_op == XDR_ENCODE) {\n"); else f_print(fout, "\t\treturn (TRUE);\n\t} else if (xdrs->x_op == XDR_DECODE) {\n"); i = 0; size = 0; sizestr = NULL; for (dl = def->def.st.decls; dl != NULL; dl = dl->next) { /* xxx */ /* now walk down the list and check for basic types */ if ((dl->decl.prefix == NULL) && ((ptr = find_type(dl->decl.type)) != NULL) && ((dl->decl.rel == REL_ALIAS) || (dl->decl.rel == REL_VECTOR))){ if (i == 0) cur = dl; i++; if (dl->decl.rel == REL_ALIAS) size += ptr->length; else { /* this code is required to handle arrays */ if (sizestr == NULL) plus = ""; else plus = " + "; if (ptr->length != 1) s_print(ptemp, "%s%s * %d", plus, dl->decl.array_max, ptr->length); else s_print(ptemp, "%s%s", plus, dl->decl.array_max); /* now concatenate to sizestr !!!! */ if (sizestr == NULL) { sizestr = xstrdup(ptemp); } else{ sizestr = xrealloc(sizestr, strlen(sizestr) +strlen(ptemp)+1); sizestr = strcat(sizestr, ptemp); /* build up length of array */ } } } else { if (i > 0) { if (sizestr == NULL && size < inline_size){ /* * don't expand into inline code * if size < inline_size */ while (cur != dl){ print_stat(indent + 1, &cur->decl); cur = cur->next; } } else { /* were already looking at a xdr_inlineable structure */ tabify(fout, indent + 1); if (sizestr == NULL) f_print(fout, "buf = XDR_INLINE(xdrs, %d * BYTES_PER_XDR_UNIT);", size); else { if (size == 0) f_print(fout, "buf = XDR_INLINE(xdrs, (%s) * BYTES_PER_XDR_UNIT);", sizestr); else f_print(fout, "buf = XDR_INLINE(xdrs, (%d + (%s)) * BYTES_PER_XDR_UNIT);", size, sizestr); } f_print(fout, "\n"); tabify(fout, indent + 1); f_print(fout, "if (buf == NULL) {\n"); psav = cur; while (cur != dl){ print_stat(indent + 2, &cur->decl); cur = cur->next; } f_print(fout, "\n\t\t} else {\n"); cur = psav; while (cur != dl){ emit_inline(indent + 2, &cur->decl, flag); cur = cur->next; } tabify(fout, indent + 1); f_print(fout, "}\n"); } } size = 0; i = 0; free(sizestr); sizestr = NULL; print_stat(indent + 1, &dl->decl); } } if (i > 0) { if (sizestr == NULL && size < inline_size){ /* don't expand into inline code if size < inline_size */ while (cur != dl){ print_stat(indent + 1, &cur->decl); cur = cur->next; } } else { /* were already looking at a xdr_inlineable structure */ if (sizestr == NULL) f_print(fout, "\t\tbuf = XDR_INLINE(xdrs, %d * BYTES_PER_XDR_UNIT);", size); else if (size == 0) f_print(fout, "\t\tbuf = XDR_INLINE(xdrs, (%s) * BYTES_PER_XDR_UNIT);", sizestr); else f_print(fout, "\t\tbuf = XDR_INLINE(xdrs, (%d + (%s)) * BYTES_PER_XDR_UNIT);", size, sizestr); f_print(fout, "\n\t\tif (buf == NULL) {\n"); psav = cur; while (cur != NULL){ print_stat(indent + 2, &cur->decl); cur = cur->next; } f_print(fout, "\t\t} else {\n"); cur = psav; while (cur != dl){ emit_inline(indent + 2, &cur->decl, flag); cur = cur->next; } f_print(fout, "\t\t}\n"); } } } static void emit_struct(definition *def) { decl_list *dl; int j, size, flag; bas_type *ptr; int can_inline; if (inline_size == 0) { /* No xdr_inlining at all */ for (dl = def->def.st.decls; dl != NULL; dl = dl->next) print_stat(1, &dl->decl); return; } for (dl = def->def.st.decls; dl != NULL; dl = dl->next) if (dl->decl.rel == REL_VECTOR){ f_print(fout, "\tint i;\n"); break; } size = 0; can_inline = 0; /* * Make a first pass and see if inling is possible. */ for (dl = def->def.st.decls; dl != NULL; dl = dl->next) if ((dl->decl.prefix == NULL) && ((ptr = find_type(dl->decl.type)) != NULL) && ((dl->decl.rel == REL_ALIAS)|| (dl->decl.rel == REL_VECTOR))){ if (dl->decl.rel == REL_ALIAS) size += ptr->length; else { can_inline = 1; break; /* can be inlined */ } } else { if (size >= inline_size){ can_inline = 1; break; /* can be inlined */ } size = 0; } if (size >= inline_size) can_inline = 1; if (can_inline == 0){ /* can not inline, drop back to old mode */ for (dl = def->def.st.decls; dl != NULL; dl = dl->next) print_stat(1, &dl->decl); return; } flag = PUT; for (j = 0; j < 2; j++){ inline_struct(def, flag); if (flag == PUT) flag = GET; } f_print(fout, "\t\treturn (TRUE);\n\t}\n\n"); /* now take care of XDR_FREE case */ for (dl = def->def.st.decls; dl != NULL; dl = dl->next) print_stat(1, &dl->decl); } static void emit_typedef(definition *def) { const char *prefix = def->def.ty.old_prefix; const char *type = def->def.ty.old_type; const char *amax = def->def.ty.array_max; relation rel = def->def.ty.rel; print_ifstat(1, prefix, type, rel, amax, "objp", def->def_name); } static void print_stat(int indent, declaration *dec) { const char *prefix = dec->prefix; const char *type = dec->type; const char *amax = dec->array_max; relation rel = dec->rel; char name[256]; if (isvectordef(type, rel)) { s_print(name, "objp->%s", dec->name); } else { s_print(name, "&objp->%s", dec->name); } print_ifstat(indent, prefix, type, rel, amax, name, dec->name); } char *upcase(const char *); static void emit_inline(int indent, declaration *decl, int flag) { switch (decl->rel) { case REL_ALIAS : emit_single_in_line(indent, decl, flag, REL_ALIAS); break; case REL_VECTOR : tabify(fout, indent); f_print(fout, "{\n"); tabify(fout, indent + 1); f_print(fout, "%s *genp;\n\n", decl->type); tabify(fout, indent + 1); f_print(fout, "for (i = 0, genp = objp->%s;\n", decl->name); tabify(fout, indent + 2); f_print(fout, "i < %s; i++) {\n", decl->array_max); emit_single_in_line(indent + 2, decl, flag, REL_VECTOR); tabify(fout, indent + 1); f_print(fout, "}\n"); tabify(fout, indent); f_print(fout, "}\n"); break; default: break; } } static void emit_single_in_line(int indent, declaration *decl, int flag, relation rel) { char *upp_case; tabify(fout, indent); if (flag == PUT) f_print(fout, "IXDR_PUT_"); else if (rel == REL_ALIAS) f_print(fout, "objp->%s = IXDR_GET_", decl->name); else f_print(fout, "*genp++ = IXDR_GET_"); upp_case = upcase(decl->type); /* hack - XX */ if (strcmp(upp_case, "INT") == 0) { free(upp_case); upp_case = strdup("LONG"); } if (strcmp(upp_case, "U_INT") == 0) { free(upp_case); upp_case = strdup("U_LONG"); } if (flag == PUT) if (rel == REL_ALIAS) f_print(fout, "%s(buf, objp->%s);\n", upp_case, decl->name); else f_print(fout, "%s(buf, *genp++);\n", upp_case); else f_print(fout, "%s(buf);\n", upp_case); free(upp_case); } char * upcase(const char *str) { char *ptr, *hptr; ptr = (char *)xmalloc(strlen(str)+1); hptr = ptr; while (*str != '\0') *ptr++ = toupper(*str++); *ptr = '\0'; return (hptr); }
TigerBSD/TigerBSD
FreeBSD/usr.bin/rpcgen/rpc_cout.c
C
isc
16,441
const test = require('tape') const isFunction = require('../core/isFunction') const isChain = require('./isChain') test('isChain predicate', t => { t.ok(isFunction(isChain), 'is a function') t.end() })
evilsoft/crocks
src/predicates/isChain.spec.js
JavaScript
isc
209
// Copyright (c) 2013-2016 The btcsuite developers // Copyright (c) 2015-2016 The Decred developers // Use of this source code is governed by an ISC // license that can be found in the LICENSE file. package peer import ( "crypto/rand" "fmt" "testing" "github.com/decred/dcrd/chaincfg/chainhash" "github.com/decred/dcrd/wire" ) // TestMruInventoryMap ensures the MruInventoryMap behaves as expected including // limiting, eviction of least-recently used entries, specific entry removal, // and existence tests. func TestMruInventoryMap(t *testing.T) { // Create a bunch of fake inventory vectors to use in testing the mru // inventory code. numInvVects := 10 invVects := make([]*wire.InvVect, 0, numInvVects) for i := 0; i < numInvVects; i++ { hash := &chainhash.Hash{byte(i)} iv := wire.NewInvVect(wire.InvTypeBlock, hash) invVects = append(invVects, iv) } tests := []struct { name string limit int }{ {name: "limit 0", limit: 0}, {name: "limit 1", limit: 1}, {name: "limit 5", limit: 5}, {name: "limit 7", limit: 7}, {name: "limit one less than available", limit: numInvVects - 1}, {name: "limit all available", limit: numInvVects}, } testLoop: for i, test := range tests { // Create a new mru inventory map limited by the specified test // limit and add all of the test inventory vectors. This will // cause evicition since there are more test inventory vectors // than the limits. mruInvMap := newMruInventoryMap(uint(test.limit)) for j := 0; j < numInvVects; j++ { mruInvMap.Add(invVects[j]) } // Ensure the limited number of most recent entries in the // inventory vector list exist. for j := numInvVects - test.limit; j < numInvVects; j++ { if !mruInvMap.Exists(invVects[j]) { t.Errorf("Exists #%d (%s) entry %s does not "+ "exist", i, test.name, *invVects[j]) continue testLoop } } // Ensure the entries before the limited number of most recent // entries in the inventory vector list do not exist. for j := 0; j < numInvVects-test.limit; j++ { if mruInvMap.Exists(invVects[j]) { t.Errorf("Exists #%d (%s) entry %s exists", i, test.name, *invVects[j]) continue testLoop } } // Readd the entry that should currently be the least-recently // used entry so it becomes the most-recently used entry, then // force an eviction by adding an entry that doesn't exist and // ensure the evicted entry is the new least-recently used // entry. // // This check needs at least 2 entries. if test.limit > 1 { origLruIndex := numInvVects - test.limit mruInvMap.Add(invVects[origLruIndex]) iv := wire.NewInvVect(wire.InvTypeBlock, &chainhash.Hash{0x00, 0x01}) mruInvMap.Add(iv) // Ensure the original lru entry still exists since it // was updated and should've have become the mru entry. if !mruInvMap.Exists(invVects[origLruIndex]) { t.Errorf("MRU #%d (%s) entry %s does not exist", i, test.name, *invVects[origLruIndex]) continue testLoop } // Ensure the entry that should've become the new lru // entry was evicted. newLruIndex := origLruIndex + 1 if mruInvMap.Exists(invVects[newLruIndex]) { t.Errorf("MRU #%d (%s) entry %s exists", i, test.name, *invVects[newLruIndex]) continue testLoop } } // Delete all of the entries in the inventory vector list, // including those that don't exist in the map, and ensure they // no longer exist. for j := 0; j < numInvVects; j++ { mruInvMap.Delete(invVects[j]) if mruInvMap.Exists(invVects[j]) { t.Errorf("Delete #%d (%s) entry %s exists", i, test.name, *invVects[j]) continue testLoop } } } } // TestMruInventoryMapStringer tests the stringized output for the // MruInventoryMap type. func TestMruInventoryMapStringer(t *testing.T) { // Create a couple of fake inventory vectors to use in testing the mru // inventory stringer code. hash1 := &chainhash.Hash{0x01} hash2 := &chainhash.Hash{0x02} iv1 := wire.NewInvVect(wire.InvTypeBlock, hash1) iv2 := wire.NewInvVect(wire.InvTypeBlock, hash2) // Create new mru inventory map and add the inventory vectors. mruInvMap := newMruInventoryMap(uint(2)) mruInvMap.Add(iv1) mruInvMap.Add(iv2) // Ensure the stringer gives the expected result. Since map iteration // is not ordered, either entry could be first, so account for both // cases. wantStr1 := fmt.Sprintf("<%d>[%s, %s]", 2, *iv1, *iv2) wantStr2 := fmt.Sprintf("<%d>[%s, %s]", 2, *iv2, *iv1) gotStr := mruInvMap.String() if gotStr != wantStr1 && gotStr != wantStr2 { t.Fatalf("unexpected string representation - got %q, want %q "+ "or %q", gotStr, wantStr1, wantStr2) } } // BenchmarkMruInventoryList performs basic benchmarks on the most recently // used inventory handling. func BenchmarkMruInventoryList(b *testing.B) { // Create a bunch of fake inventory vectors to use in benchmarking // the mru inventory code. b.StopTimer() numInvVects := 100000 invVects := make([]*wire.InvVect, 0, numInvVects) for i := 0; i < numInvVects; i++ { hashBytes := make([]byte, chainhash.HashSize) rand.Read(hashBytes) hash, _ := chainhash.NewHash(hashBytes) iv := wire.NewInvVect(wire.InvTypeBlock, hash) invVects = append(invVects, iv) } b.StartTimer() // Benchmark the add plus evicition code. limit := 20000 mruInvMap := newMruInventoryMap(uint(limit)) for i := 0; i < b.N; i++ { mruInvMap.Add(invVects[i%numInvVects]) } }
jcmincke/dcrd
peer/mruinvmap_test.go
GO
isc
5,448
/*- * Copyright (c) 1989, 1993, 1994 * The Regents of the University of California. All rights reserved. * * This code is derived from software contributed to Berkeley by * Michael Fischbein. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifndef lint static const char copyright[] = "@(#) Copyright (c) 1989, 1993, 1994\n\ The Regents of the University of California. All rights reserved.\n"; #endif /* not lint */ #if 0 #ifndef lint static char sccsid[] = "@(#)ls.c 8.5 (Berkeley) 4/2/94"; #endif /* not lint */ #endif #include <sys/cdefs.h> __FBSDID("$FreeBSD$"); #include <sys/param.h> #include <sys/stat.h> #include <sys/ioctl.h> #include <sys/mac.h> #include <dirent.h> #include <err.h> #include <errno.h> #include <fts.h> #include <grp.h> #include <inttypes.h> #include <limits.h> #include <locale.h> #include <pwd.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #ifdef COLORLS #include <termcap.h> #include <signal.h> #endif #include <libxo/xo.h> #include "ls.h" #include "extern.h" /* * Upward approximation of the maximum number of characters needed to * represent a value of integral type t as a string, excluding the * NUL terminator, with provision for a sign. */ #define STRBUF_SIZEOF(t) (1 + CHAR_BIT * sizeof(t) / 3 + 1) /* * MAKENINES(n) turns n into (10**n)-1. This is useful for converting a width * into a number that wide in decimal. * XXX: Overflows are not considered. */ #define MAKENINES(n) \ do { \ intmax_t i; \ \ /* Use a loop as all values of n are small. */ \ for (i = 1; n > 0; i *= 10) \ n--; \ n = i - 1; \ } while(0) static void display(const FTSENT *, FTSENT *, int); static int mastercmp(const FTSENT * const *, const FTSENT * const *); static void traverse(int, char **, int); static void (*printfcn)(const DISPLAY *); static int (*sortfcn)(const FTSENT *, const FTSENT *); long blocksize; /* block size units */ int termwidth = 80; /* default terminal width */ /* flags */ int f_accesstime; /* use time of last access */ int f_birthtime; /* use time of birth */ int f_flags; /* show flags associated with a file */ int f_humanval; /* show human-readable file sizes */ int f_inode; /* print inode */ static int f_kblocks; /* print size in kilobytes */ int f_label; /* show MAC label */ static int f_listdir; /* list actual directory, not contents */ static int f_listdot; /* list files beginning with . */ int f_longform; /* long listing format */ static int f_noautodot; /* do not automatically enable -A for root */ static int f_nofollow; /* don't follow symbolic link arguments */ int f_nonprint; /* show unprintables as ? */ static int f_nosort; /* don't sort output */ int f_notabs; /* don't use tab-separated multi-col output */ int f_numericonly; /* don't convert uid/gid to name */ int f_octal; /* show unprintables as \xxx */ int f_octal_escape; /* like f_octal but use C escapes if possible */ static int f_recursive; /* ls subdirectories also */ static int f_reversesort; /* reverse whatever sort is used */ int f_samesort; /* sort time and name in same direction */ int f_sectime; /* print full time information */ static int f_singlecol; /* use single column output */ int f_size; /* list size in short listing */ static int f_sizesort; int f_slash; /* similar to f_type, but only for dirs */ int f_sortacross; /* sort across rows, not down columns */ int f_statustime; /* use time of last mode change */ static int f_stream; /* stream the output, separate with commas */ int f_thousands; /* show file sizes with thousands separators */ char *f_timeformat; /* user-specified time format */ static int f_timesort; /* sort by time vice name */ int f_type; /* add type character for non-regular files */ static int f_whiteout; /* show whiteout entries */ #ifdef COLORLS int f_color; /* add type in color for non-regular files */ char *ansi_bgcol; /* ANSI sequence to set background colour */ char *ansi_fgcol; /* ANSI sequence to set foreground colour */ char *ansi_coloff; /* ANSI sequence to reset colours */ char *attrs_off; /* ANSI sequence to turn off attributes */ char *enter_bold; /* ANSI sequence to set color to bold mode */ #endif static int rval; int main(int argc, char *argv[]) { static char dot[] = ".", *dotav[] = {dot, NULL}; struct winsize win; int ch, fts_options, notused; char *p; const char *errstr = NULL; #ifdef COLORLS char termcapbuf[1024]; /* termcap definition buffer */ char tcapbuf[512]; /* capability buffer */ char *bp = tcapbuf; #endif (void)setlocale(LC_ALL, ""); /* Terminal defaults to -Cq, non-terminal defaults to -1. */ if (isatty(STDOUT_FILENO)) { termwidth = 80; if ((p = getenv("COLUMNS")) != NULL && *p != '\0') termwidth = strtonum(p, 0, INT_MAX, &errstr); else if (ioctl(STDOUT_FILENO, TIOCGWINSZ, &win) != -1 && win.ws_col > 0) termwidth = win.ws_col; f_nonprint = 1; } else { f_singlecol = 1; /* retrieve environment variable, in case of explicit -C */ p = getenv("COLUMNS"); if (p) termwidth = strtonum(p, 0, INT_MAX, &errstr); } if (errstr) termwidth = 80; fts_options = FTS_PHYSICAL; if (getenv("LS_SAMESORT")) f_samesort = 1; argc = xo_parse_args(argc, argv); if (argc < 0) return (1); xo_set_flags(NULL, XOF_COLUMNS); xo_set_version(LS_XO_VERSION); while ((ch = getopt(argc, argv, "1ABCD:FGHILPRSTUWXZabcdfghiklmnopqrstuwxy,")) != -1) { switch (ch) { /* * The -1, -C, -x and -l options all override each other so * shell aliasing works right. */ case '1': f_singlecol = 1; f_longform = 0; f_stream = 0; break; case 'C': f_sortacross = f_longform = f_singlecol = 0; break; case 'l': f_longform = 1; f_singlecol = 0; f_stream = 0; break; case 'x': f_sortacross = 1; f_longform = 0; f_singlecol = 0; break; /* The -c, -u, and -U options override each other. */ case 'c': f_statustime = 1; f_accesstime = 0; f_birthtime = 0; break; case 'u': f_accesstime = 1; f_statustime = 0; f_birthtime = 0; break; case 'U': f_birthtime = 1; f_accesstime = 0; f_statustime = 0; break; case 'f': f_nosort = 1; /* FALLTHROUGH */ case 'a': fts_options |= FTS_SEEDOT; /* FALLTHROUGH */ case 'A': f_listdot = 1; break; /* The -t and -S options override each other. */ case 'S': f_sizesort = 1; f_timesort = 0; break; case 't': f_timesort = 1; f_sizesort = 0; break; /* Other flags. Please keep alphabetic. */ case ',': f_thousands = 1; break; case 'B': f_nonprint = 0; f_octal = 1; f_octal_escape = 0; break; case 'D': f_timeformat = optarg; break; case 'F': f_type = 1; f_slash = 0; break; case 'G': setenv("CLICOLOR", "", 1); break; case 'H': fts_options |= FTS_COMFOLLOW; f_nofollow = 0; break; case 'I': f_noautodot = 1; break; case 'L': fts_options &= ~FTS_PHYSICAL; fts_options |= FTS_LOGICAL; f_nofollow = 0; break; case 'P': fts_options &= ~FTS_COMFOLLOW; fts_options &= ~FTS_LOGICAL; fts_options |= FTS_PHYSICAL; f_nofollow = 1; break; case 'R': f_recursive = 1; break; case 'T': f_sectime = 1; break; case 'W': f_whiteout = 1; break; case 'Z': f_label = 1; break; case 'b': f_nonprint = 0; f_octal = 0; f_octal_escape = 1; break; /* The -d option turns off the -R option. */ case 'd': f_listdir = 1; f_recursive = 0; break; case 'g': /* Compatibility with 4.3BSD. */ break; case 'h': f_humanval = 1; break; case 'i': f_inode = 1; break; case 'k': f_humanval = 0; f_kblocks = 1; break; case 'm': f_stream = 1; f_singlecol = 0; f_longform = 0; break; case 'n': f_numericonly = 1; break; case 'o': f_flags = 1; break; case 'p': f_slash = 1; f_type = 1; break; case 'q': f_nonprint = 1; f_octal = 0; f_octal_escape = 0; break; case 'r': f_reversesort = 1; break; case 's': f_size = 1; break; case 'w': f_nonprint = 0; f_octal = 0; f_octal_escape = 0; break; case 'y': f_samesort = 1; break; default: case '?': usage(); } } argc -= optind; argv += optind; /* Root is -A automatically unless -I. */ if (!f_listdot && getuid() == (uid_t)0 && !f_noautodot) f_listdot = 1; /* Enabling of colours is conditional on the environment. */ if (getenv("CLICOLOR") && (isatty(STDOUT_FILENO) || getenv("CLICOLOR_FORCE"))) #ifdef COLORLS if (tgetent(termcapbuf, getenv("TERM")) == 1) { ansi_fgcol = tgetstr("AF", &bp); ansi_bgcol = tgetstr("AB", &bp); attrs_off = tgetstr("me", &bp); enter_bold = tgetstr("md", &bp); /* To switch colours off use 'op' if * available, otherwise use 'oc', or * don't do colours at all. */ ansi_coloff = tgetstr("op", &bp); if (!ansi_coloff) ansi_coloff = tgetstr("oc", &bp); if (ansi_fgcol && ansi_bgcol && ansi_coloff) f_color = 1; } #else xo_warnx("color support not compiled in"); #endif /*COLORLS*/ #ifdef COLORLS if (f_color) { /* * We can't put tabs and color sequences together: * column number will be incremented incorrectly * for "stty oxtabs" mode. */ f_notabs = 1; (void)signal(SIGINT, colorquit); (void)signal(SIGQUIT, colorquit); parsecolors(getenv("LSCOLORS")); } #endif /* * If not -F, -i, -l, -s, -S or -t options, don't require stat * information, unless in color mode in which case we do * need this to determine which colors to display. */ if (!f_inode && !f_longform && !f_size && !f_timesort && !f_sizesort && !f_type #ifdef COLORLS && !f_color #endif ) fts_options |= FTS_NOSTAT; /* * If not -F, -P, -d or -l options, follow any symbolic links listed on * the command line, unless in color mode in which case we need to * distinguish file type for a symbolic link itself and its target. */ if (!f_nofollow && !f_longform && !f_listdir && (!f_type || f_slash) #ifdef COLORLS && !f_color #endif ) fts_options |= FTS_COMFOLLOW; /* * If -W, show whiteout entries */ #ifdef FTS_WHITEOUT if (f_whiteout) fts_options |= FTS_WHITEOUT; #endif /* If -i, -l or -s, figure out block size. */ if (f_inode || f_longform || f_size) { if (f_kblocks) blocksize = 2; else { (void)getbsize(&notused, &blocksize); blocksize /= 512; } } /* Select a sort function. */ if (f_reversesort) { if (!f_timesort && !f_sizesort) sortfcn = revnamecmp; else if (f_sizesort) sortfcn = revsizecmp; else if (f_accesstime) sortfcn = revacccmp; else if (f_birthtime) sortfcn = revbirthcmp; else if (f_statustime) sortfcn = revstatcmp; else /* Use modification time. */ sortfcn = revmodcmp; } else { if (!f_timesort && !f_sizesort) sortfcn = namecmp; else if (f_sizesort) sortfcn = sizecmp; else if (f_accesstime) sortfcn = acccmp; else if (f_birthtime) sortfcn = birthcmp; else if (f_statustime) sortfcn = statcmp; else /* Use modification time. */ sortfcn = modcmp; } /* Select a print function. */ if (f_singlecol) printfcn = printscol; else if (f_longform) printfcn = printlong; else if (f_stream) printfcn = printstream; else printfcn = printcol; xo_open_container("file-information"); if (argc) traverse(argc, argv, fts_options); else traverse(1, dotav, fts_options); xo_close_container("file-information"); xo_finish(); exit(rval); } static int output; /* If anything output. */ /* * Traverse() walks the logical directory structure specified by the argv list * in the order specified by the mastercmp() comparison function. During the * traversal it passes linked lists of structures to display() which represent * a superset (may be exact set) of the files to be displayed. */ static void traverse(int argc, char *argv[], int options) { FTS *ftsp; FTSENT *p, *chp; int ch_options; int first = 1; if ((ftsp = fts_open(argv, options, f_nosort ? NULL : mastercmp)) == NULL) xo_err(1, "fts_open"); /* * We ignore errors from fts_children here since they will be * replicated and signalled on the next call to fts_read() below. */ chp = fts_children(ftsp, 0); if (chp != NULL) display(NULL, chp, options); if (f_listdir) return; /* * If not recursing down this tree and don't need stat info, just get * the names. */ ch_options = !f_recursive && !f_label && options & FTS_NOSTAT ? FTS_NAMEONLY : 0; while ((p = fts_read(ftsp)) != NULL) switch (p->fts_info) { case FTS_DC: xo_warnx("%s: directory causes a cycle", p->fts_name); break; case FTS_DNR: case FTS_ERR: xo_warnx("%s: %s", p->fts_path, strerror(p->fts_errno)); rval = 1; break; case FTS_D: if (p->fts_level != FTS_ROOTLEVEL && p->fts_name[0] == '.' && !f_listdot) break; if (first) { first = 0; xo_open_list("directory"); } xo_open_instance("directory"); /* * If already output something, put out a newline as * a separator. If multiple arguments, precede each * directory with its name. */ if (output) { xo_emit("\n"); (void)printname("path", p->fts_path); xo_emit(":\n"); } else if (argc > 1) { (void)printname("path", p->fts_path); xo_emit(":\n"); output = 1; } chp = fts_children(ftsp, ch_options); display(p, chp, options); xo_close_instance("directory"); if (!f_recursive && chp != NULL) (void)fts_set(ftsp, p, FTS_SKIP); break; default: break; } if (!first) xo_close_list("directory"); if (errno) xo_err(1, "fts_read"); } /* * Display() takes a linked list of FTSENT structures and passes the list * along with any other necessary information to the print function. P * points to the parent directory of the display list. */ static void display(const FTSENT *p, FTSENT *list, int options) { struct stat *sp; DISPLAY d; FTSENT *cur; NAMES *np; off_t maxsize; long maxblock; uintmax_t maxinode; u_long btotal, labelstrlen, maxlen, maxnlink; u_long maxlabelstr; u_int sizelen; int maxflags; gid_t maxgroup; uid_t maxuser; size_t flen, ulen, glen; char *initmax; int entries, needstats; const char *user, *group; char *flags, *labelstr = NULL; char ngroup[STRBUF_SIZEOF(uid_t) + 1]; char nuser[STRBUF_SIZEOF(gid_t) + 1]; needstats = f_inode || f_longform || f_size; flen = 0; btotal = 0; initmax = getenv("LS_COLWIDTHS"); /* Fields match -lios order. New ones should be added at the end. */ maxlabelstr = maxblock = maxlen = maxnlink = 0; maxuser = maxgroup = maxflags = maxsize = 0; maxinode = 0; if (initmax != NULL && *initmax != '\0') { char *initmax2, *jinitmax; int ninitmax; /* Fill-in "::" as "0:0:0" for the sake of scanf. */ jinitmax = malloc(strlen(initmax) * 2 + 2); if (jinitmax == NULL) xo_err(1, "malloc"); initmax2 = jinitmax; if (*initmax == ':') strcpy(initmax2, "0:"), initmax2 += 2; else *initmax2++ = *initmax, *initmax2 = '\0'; for (initmax++; *initmax != '\0'; initmax++) { if (initmax[-1] == ':' && initmax[0] == ':') { *initmax2++ = '0'; *initmax2++ = initmax[0]; initmax2[1] = '\0'; } else { *initmax2++ = initmax[0]; initmax2[1] = '\0'; } } if (initmax2[-1] == ':') strcpy(initmax2, "0"); ninitmax = sscanf(jinitmax, " %ju : %ld : %lu : %u : %u : %i : %jd : %lu : %lu ", &maxinode, &maxblock, &maxnlink, &maxuser, &maxgroup, &maxflags, &maxsize, &maxlen, &maxlabelstr); f_notabs = 1; switch (ninitmax) { case 0: maxinode = 0; /* FALLTHROUGH */ case 1: maxblock = 0; /* FALLTHROUGH */ case 2: maxnlink = 0; /* FALLTHROUGH */ case 3: maxuser = 0; /* FALLTHROUGH */ case 4: maxgroup = 0; /* FALLTHROUGH */ case 5: maxflags = 0; /* FALLTHROUGH */ case 6: maxsize = 0; /* FALLTHROUGH */ case 7: maxlen = 0; /* FALLTHROUGH */ case 8: maxlabelstr = 0; /* FALLTHROUGH */ #ifdef COLORLS if (!f_color) #endif f_notabs = 0; /* FALLTHROUGH */ default: break; } MAKENINES(maxinode); MAKENINES(maxblock); MAKENINES(maxnlink); MAKENINES(maxsize); free(jinitmax); } d.s_size = 0; sizelen = 0; flags = NULL; for (cur = list, entries = 0; cur; cur = cur->fts_link) { if (cur->fts_info == FTS_ERR || cur->fts_info == FTS_NS) { xo_warnx("%s: %s", cur->fts_name, strerror(cur->fts_errno)); cur->fts_number = NO_PRINT; rval = 1; continue; } /* * P is NULL if list is the argv list, to which different rules * apply. */ if (p == NULL) { /* Directories will be displayed later. */ if (cur->fts_info == FTS_D && !f_listdir) { cur->fts_number = NO_PRINT; continue; } } else { /* Only display dot file if -a/-A set. */ if (cur->fts_name[0] == '.' && !f_listdot) { cur->fts_number = NO_PRINT; continue; } } if (cur->fts_namelen > maxlen) maxlen = cur->fts_namelen; if (f_octal || f_octal_escape) { u_long t = len_octal(cur->fts_name, cur->fts_namelen); if (t > maxlen) maxlen = t; } if (needstats) { sp = cur->fts_statp; if (sp->st_blocks > maxblock) maxblock = sp->st_blocks; if (sp->st_ino > maxinode) maxinode = sp->st_ino; if (sp->st_nlink > maxnlink) maxnlink = sp->st_nlink; if (sp->st_size > maxsize) maxsize = sp->st_size; btotal += sp->st_blocks; if (f_longform) { if (f_numericonly) { (void)snprintf(nuser, sizeof(nuser), "%u", sp->st_uid); (void)snprintf(ngroup, sizeof(ngroup), "%u", sp->st_gid); user = nuser; group = ngroup; } else { user = user_from_uid(sp->st_uid, 0); group = group_from_gid(sp->st_gid, 0); } if ((ulen = strlen(user)) > maxuser) maxuser = ulen; if ((glen = strlen(group)) > maxgroup) maxgroup = glen; if (f_flags) { flags = fflagstostr(sp->st_flags); if (flags != NULL && *flags == '\0') { free(flags); flags = strdup("-"); } if (flags == NULL) xo_err(1, "fflagstostr"); flen = strlen(flags); if (flen > (size_t)maxflags) maxflags = flen; } else flen = 0; labelstr = NULL; if (f_label) { char name[PATH_MAX + 1]; mac_t label; int error; error = mac_prepare_file_label(&label); if (error == -1) { xo_warn("MAC label for %s/%s", cur->fts_parent->fts_path, cur->fts_name); goto label_out; } if (cur->fts_level == FTS_ROOTLEVEL) snprintf(name, sizeof(name), "%s", cur->fts_name); else snprintf(name, sizeof(name), "%s/%s", cur->fts_parent-> fts_accpath, cur->fts_name); if (options & FTS_LOGICAL) error = mac_get_file(name, label); else error = mac_get_link(name, label); if (error == -1) { xo_warn("MAC label for %s/%s", cur->fts_parent->fts_path, cur->fts_name); mac_free(label); goto label_out; } error = mac_to_text(label, &labelstr); if (error == -1) { xo_warn("MAC label for %s/%s", cur->fts_parent->fts_path, cur->fts_name); mac_free(label); goto label_out; } mac_free(label); label_out: if (labelstr == NULL) labelstr = strdup("-"); labelstrlen = strlen(labelstr); if (labelstrlen > maxlabelstr) maxlabelstr = labelstrlen; } else labelstrlen = 0; if ((np = malloc(sizeof(NAMES) + labelstrlen + ulen + glen + flen + 4)) == NULL) xo_err(1, "malloc"); np->user = &np->data[0]; (void)strcpy(np->user, user); np->group = &np->data[ulen + 1]; (void)strcpy(np->group, group); if (S_ISCHR(sp->st_mode) || S_ISBLK(sp->st_mode)) { sizelen = snprintf(NULL, 0, "%#jx", (uintmax_t)sp->st_rdev); if (d.s_size < sizelen) d.s_size = sizelen; } if (f_flags) { np->flags = &np->data[ulen + glen + 2]; (void)strcpy(np->flags, flags); free(flags); } if (f_label) { np->label = &np->data[ulen + glen + 2 + (f_flags ? flen + 1 : 0)]; (void)strcpy(np->label, labelstr); free(labelstr); } cur->fts_pointer = np; } } ++entries; } /* * If there are no entries to display, we normally stop right * here. However, we must continue if we have to display the * total block count. In this case, we display the total only * on the second (p != NULL) pass. */ if (!entries && (!(f_longform || f_size) || p == NULL)) return; d.list = list; d.entries = entries; d.maxlen = maxlen; if (needstats) { d.btotal = btotal; d.s_block = snprintf(NULL, 0, "%lu", howmany(maxblock, blocksize)); d.s_flags = maxflags; d.s_label = maxlabelstr; d.s_group = maxgroup; d.s_inode = snprintf(NULL, 0, "%ju", maxinode); d.s_nlink = snprintf(NULL, 0, "%lu", maxnlink); sizelen = f_humanval ? HUMANVALSTR_LEN : snprintf(NULL, 0, "%ju", maxsize); if (d.s_size < sizelen) d.s_size = sizelen; d.s_user = maxuser; } if (f_thousands) /* make space for commas */ d.s_size += (d.s_size - 1) / 3; printfcn(&d); output = 1; if (f_longform) for (cur = list; cur; cur = cur->fts_link) free(cur->fts_pointer); } /* * Ordering for mastercmp: * If ordering the argv (fts_level = FTS_ROOTLEVEL) return non-directories * as larger than directories. Within either group, use the sort function. * All other levels use the sort function. Error entries remain unsorted. */ static int mastercmp(const FTSENT * const *a, const FTSENT * const *b) { int a_info, b_info; a_info = (*a)->fts_info; if (a_info == FTS_ERR) return (0); b_info = (*b)->fts_info; if (b_info == FTS_ERR) return (0); if (a_info == FTS_NS || b_info == FTS_NS) return (namecmp(*a, *b)); if (a_info != b_info && (*a)->fts_level == FTS_ROOTLEVEL && !f_listdir) { if (a_info == FTS_D) return (1); if (b_info == FTS_D) return (-1); } return (sortfcn(*a, *b)); }
TigerBSD/TigerBSD
FreeBSD/bin/ls/ls.c
C
isc
23,754
from __future__ import absolute_import from builtins import str from builtins import object import copy import json from multiprocessing.pool import ThreadPool from solnlib.packages.splunklib.binding import HTTPError from ..rest_handler.schema import RestSchema from ..rest_handler.handler import RestHandler __all__ = [ 'GlobalConfigError', 'Configuration', 'Inputs', 'Configs', 'Settings', ] class GlobalConfigError(Exception): pass class Configuration(object): """ Splunk Configuration Handler. """ FILTERS = [u'eai:appName', u'eai:acl', u'eai:userName'] ENTITY_NAME = u'name' SETTINGS = u'settings' NOT_FOUND = u'[404]: Not Found' def __init__(self, splunkd_client, schema): """ :param splunkd_client: SplunkRestClient :param schema: """ self._client = splunkd_client self._schema = schema def load(self, *args, **kwargs): """ Load all stored configuration for given schema. :param args: :param kwargs: :return: """ raise NotImplementedError() def save_stanza(self, item): """ Save configuration with type_name and configuration :param item: :return: error while save the configuration """ return self._save_configuration(item[0], item[1]) def save(self, payload): """ Save configuration. Return error while saving. It includes creating and updating. That is, it will try to update first, then create if NOT FOUND error occurs. :param payload: same format with return of ``load``. :return: Usage:: >>> from splunktaucclib.global_config import GlobalConfig >>> global_config = GlobalConfig() >>> payload = { >>> 'settings': [ >>> { >>> 'name': 'proxy', >>> 'proxy_host': '1.2.3.4', >>> 'proxy_port': '5678', >>> }, >>> { >>> 'name': 'logging', >>> 'level': 'DEBUG', >>> } >>> ] >>> } >>> global_config.settings.save(payload) """ # expand the payload to task_list task_list = [] for type_name, configurations in list(payload.items()): task_list.extend([(type_name, configuration) for configuration in configurations]) task_len = len(task_list) # return empty error list if task list is empty if not task_list: return [] task_len = min(8, task_len) pool = ThreadPool(processes=task_len) errors = pool.map(self.save_stanza, task_list) pool.close() pool.join() return errors @property def internal_schema(self): """ Get the schema for inputs, configs and settings :return: """ return self._schema.inputs + self._schema.configs + self._schema.settings def _save_configuration(self, type_name, configuration): schema = self._search_configuration_schema( type_name, configuration[self.ENTITY_NAME], ) configuration = copy.copy(configuration) self._dump_multiple_select(configuration, schema) # update try: self._update(type_name, copy.copy(configuration)) except HTTPError as exc: if self.NOT_FOUND in str(exc): # not exists, go to create pass else: return exc except Exception as exc: return exc else: return None # create try: self._create(type_name, configuration) except Exception as exc: return exc else: return None def _create(self, type_name, configuration): self._save_endpoint( type_name, configuration, ) def _update(self, type_name, configuration): name = configuration[self.ENTITY_NAME] del configuration[self.ENTITY_NAME] self._save_endpoint( type_name, configuration, name=name, ) @classmethod def _filter_fields(cls, entity): for (k, v) in list(entity.items()): if k in cls.FILTERS: del entity[k] def _load_endpoint(self, name, schema): query = { 'output_mode': 'json', 'count': '0', '--cred--': '1', } response = self._client.get( RestHandler.path_segment(self._endpoint_path(name)), **query ) body = response.body.read() cont = json.loads(body) entities = [] for entry in cont['entry']: entity = entry['content'] entity[self.ENTITY_NAME] = entry['name'] self._load_multiple_select(entity, schema) entities.append(entity) return entities def _save_endpoint(self, endpoint, content, name=None): endpoint = self._endpoint_path(endpoint) self._client.post( RestHandler.path_segment(endpoint, name=name), **content ) @classmethod def _load_multiple_select(cls, entity, schema): for field in schema: field_type = field.get('type') value = entity.get(field['field']) if field_type != 'multipleSelect' or not value: continue delimiter = field['options']['delimiter'] entity[field['field']] = value.split(delimiter) @classmethod def _dump_multiple_select(cls, entity, schema): for field in schema: field_type = field.get('type') value = entity.get(field['field']) if field_type != 'multipleSelect' or not value: continue if not isinstance(value, list): continue delimiter = field['options']['delimiter'] entity[field['field']] = delimiter.join(value) def _endpoint_path(self, name): return '{admin_match}/{endpoint_name}'.format( admin_match=self._schema.admin_match, endpoint_name=RestSchema.endpoint_name( name, self._schema.namespace ) ) def _search_configuration_schema(self, type_name, configuration_name): for item in self.internal_schema: # add support for settings schema if item['name'] == type_name or \ (type_name == self.SETTINGS and item['name'] == configuration_name): return item['entity'] else: raise GlobalConfigError( 'Schema Not Found for Configuration, ' 'configuration_type={configuration_type}, ' 'configuration_name={configuration_name}'.format( configuration_type=type_name, configuration_name=configuration_name, ), ) class Inputs(Configuration): def __init__(self, splunkd_client, schema): super(Inputs, self).__init__(splunkd_client, schema) self._splunkd_client = splunkd_client self._schema = schema self._references = None def load(self, input_type=None): """ :param input_type: :return: Usage:: >>> from splunktaucclib.global_config import GlobalConfig >>> global_config = GlobalConfig() >>> inputs = global_config.inputs.load() """ # move configs read operation out of init method if not self._references: self._references = Configs(self._splunkd_client, self._schema).load() inputs = {} for input_item in self.internal_schema: if input_type is None or input_item['name'] == input_type: input_entities = self._load_endpoint( input_item['name'], input_item['entity'] ) # filter unused fields in response for input_entity in input_entities: self._filter_fields(input_entity) # expand referenced entity self._reference( input_entities, input_item, self._references, ) inputs[input_item['name']] = input_entities return inputs @property def internal_schema(self): return self._schema.inputs @classmethod def _reference( cls, input_entities, input_item, configs ): for input_entity in input_entities: cls._input_reference( input_item['name'], input_entity, input_item['entity'], configs ) @classmethod def _input_reference( cls, input_type, input_entity, input_schema, configs ): for field in input_schema: options = field.get('options', {}) config_type = options.get('referenceName') config_name = input_entity.get(field['field']) if not config_type or not config_name: continue for config in configs.get(config_type, []): if config['name'] == config_name: input_entity[field['field']] = config break else: raise GlobalConfigError( 'Config Not Found for Input, ' 'input_type={input_type}, ' 'input_name={input_name}, ' 'config_type={config_type}, ' 'config_name={config_name}'.format( input_type=input_type, input_name=input_entity['name'], config_type=config_type, config_name=config_name ) ) class Configs(Configuration): def load(self, config_type=None): """ :param config_type: :return: Usage:: >>> from splunktaucclib.global_config import GlobalConfig >>> global_config = GlobalConfig() >>> configs = global_config.configs.load() """ configs = {} for config in self.internal_schema: if config_type is None or config['name'] == config_type: config_entities = self._load_endpoint( config['name'], config['entity'] ) for config_entity in config_entities: self._filter_fields(config_entity) configs[config['name']] = config_entities return configs @property def internal_schema(self): return self._schema.configs class Settings(Configuration): TYPE_NAME = u'settings' def load(self): """ :return: Usage:: >>> from splunktaucclib.global_config import GlobalConfig >>> global_config = GlobalConfig() >>> settings = global_config.settings.load() """ settings = [] for setting in self.internal_schema: setting_entity = self._load_endpoint( 'settings/%s' % setting['name'], setting['entity'] ) self._load_multiple_select( setting_entity[0], setting['entity'] ) entity = setting_entity[0] self._filter_fields(entity) settings.append(entity) return {Settings.TYPE_NAME: settings} @property def internal_schema(self): return self._schema.settings def _search_configuration_schema(self, type_name, configuration_name): return super(Settings, self)._search_configuration_schema( configuration_name, configuration_name, )
PaloAltoNetworks-BD/SplunkforPaloAltoNetworks
Splunk_TA_paloalto/bin/splunk_ta_paloalto/aob_py3/splunktaucclib/global_config/configuration.py
Python
isc
12,119
/*- * Copyright (c) 1993, 1994 * The Regents of the University of California. All rights reserved. * Copyright (c) 1993, 1994, 1995, 1996 * Keith Bostic. All rights reserved. * * See the LICENSE file for redistribution information. * * $Id: cl.h,v 10.34 2011/08/15 20:07:32 zy Exp $ */ #ifdef USE_WIDECHAR #define _XOPEN_SOURCE_EXTENDED #endif #ifdef HAVE_NCURSES_H #include <ncurses.h> #else #include <curses.h> #endif typedef struct _cl_private { char ibuf[256]; /* Input keys. */ size_t skip; /* Remaining keys. */ CONVWIN cw; /* Conversion buffer. */ int eof_count; /* EOF count. */ struct termios orig; /* Original terminal values. */ struct termios ex_enter;/* Terminal values to enter ex. */ struct termios vi_enter;/* Terminal values to enter vi. */ char *el; /* Clear to EOL terminal string. */ char *cup; /* Cursor movement terminal string. */ char *cuu1; /* Cursor up terminal string. */ char *rmso, *smso; /* Inverse video terminal strings. */ char *smcup, *rmcup; /* Terminal start/stop strings. */ char *oname; /* Original screen window name. */ SCR *focus; /* Screen that has the "focus". */ int killersig; /* Killer signal. */ #define INDX_HUP 0 #define INDX_INT 1 #define INDX_TERM 2 #define INDX_WINCH 3 #define INDX_MAX 4 /* Original signal information. */ struct sigaction oact[INDX_MAX]; enum { /* Tty group write mode. */ TGW_UNKNOWN=0, TGW_SET, TGW_UNSET } tgw; enum { /* Terminal initialization strings. */ TE_SENT=0, TI_SENT } ti_te; #define CL_IN_EX 0x0001 /* Currently running ex. */ #define CL_LAYOUT 0x0002 /* Screen layout changed. */ #define CL_RENAME 0x0004 /* X11 xterm icon/window renamed. */ #define CL_RENAME_OK 0x0008 /* User wants the windows renamed. */ #define CL_SCR_EX_INIT 0x0010 /* Ex screen initialized. */ #define CL_SCR_VI_INIT 0x0020 /* Vi screen initialized. */ #define CL_SIGHUP 0x0040 /* SIGHUP arrived. */ #define CL_SIGINT 0x0080 /* SIGINT arrived. */ #define CL_SIGTERM 0x0100 /* SIGTERM arrived. */ #define CL_SIGWINCH 0x0200 /* SIGWINCH arrived. */ #define CL_STDIN_TTY 0x0400 /* Talking to a terminal. */ u_int32_t flags; } CL_PRIVATE; #define CLP(sp) ((CL_PRIVATE *)((sp)->gp->cl_private)) #define GCLP(gp) ((CL_PRIVATE *)gp->cl_private) #define CLSP(sp) ((WINDOW *)((sp)->cl_private)) /* Return possibilities from the keyboard read routine. */ typedef enum { INP_OK=0, INP_EOF, INP_ERR, INP_INTR, INP_TIMEOUT } input_t; /* The screen position relative to a specific window. */ #define RCNO(sp, cno) (cno) #define RLNO(sp, lno) (lno) #include "extern.h"
TigerBSD/TigerBSD
FreeBSD/contrib/nvi/cl/cl.h
C
isc
2,586
app.service('utils', function ($log) { var checkErrorObj = function(obj){ var fields = ["show", "msg"]; for(var i=0; i<fields.length; i++) { if(obj[fields[i]] == undefined){ $log.error("error obj lack of field: "+fields[i]); return false; } } return true; }; return { // obj format: // { // show: true, // msg: "" // } setErrorMsg: function (obj, show, msg) { if(!checkErrorObj(obj)){ return; } obj.msg = msg; obj.show = show; } }; });
bitmark-inc/bitmark-webgui
webpages/scripts/services/utils.js
JavaScript
isc
669
-- boundary2.test -- -- db eval { -- SELECT a FROM t1 WHERE r <= 549755813887 ORDER BY x -- } SELECT a FROM t1 WHERE r <= 549755813887 ORDER BY x
bkiers/sqlite-parser
src/test/resources/boundary2.test_942.sql
SQL
mit
150
/* ----------------------------------------------------------------------------- This source file is part of OGRE (Object-oriented Graphics Rendering Engine) For the latest info, see http://www.ogre3d.org/ Copyright (c) 2000-2016 Torus Knot Software Ltd 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. ----------------------------------------------------------------------------- */ #include "OgreStableHeaders.h" #include "OgreRectangle2D.h" #include "OgreHardwareBufferManager.h" namespace Ogre { #define POSITION_BINDING 0 #define NORMAL_BINDING 1 #define TEXCOORD_BINDING 2 Rectangle2D::Rectangle2D(bool includeTextureCoords, Ogre::HardwareBuffer::Usage vBufUsage) : SimpleRenderable() { _initRectangle2D(includeTextureCoords, vBufUsage); } Rectangle2D::Rectangle2D(const String& name, bool includeTextureCoords, Ogre::HardwareBuffer::Usage vBufUsage) : SimpleRenderable(name) { _initRectangle2D(includeTextureCoords, vBufUsage); } void Rectangle2D::_initRectangle2D(bool includeTextureCoords, Ogre::HardwareBuffer::Usage vBufUsage) { // use identity projection and view matrices mUseIdentityProjection = true; mUseIdentityView = true; mRenderOp.vertexData = OGRE_NEW VertexData(); mRenderOp.indexData = 0; mRenderOp.vertexData->vertexCount = 4; mRenderOp.vertexData->vertexStart = 0; mRenderOp.operationType = RenderOperation::OT_TRIANGLE_STRIP; mRenderOp.useIndexes = false; mRenderOp.useGlobalInstancingVertexBufferIsAvailable = false; VertexDeclaration* decl = mRenderOp.vertexData->vertexDeclaration; VertexBufferBinding* bind = mRenderOp.vertexData->vertexBufferBinding; decl->addElement(POSITION_BINDING, 0, VET_FLOAT3, VES_POSITION); HardwareVertexBufferSharedPtr vbuf = HardwareBufferManager::getSingleton().createVertexBuffer( decl->getVertexSize(POSITION_BINDING), mRenderOp.vertexData->vertexCount, vBufUsage); // Bind buffer bind->setBinding(POSITION_BINDING, vbuf); decl->addElement(NORMAL_BINDING, 0, VET_FLOAT3, VES_NORMAL); vbuf = HardwareBufferManager::getSingleton().createVertexBuffer( decl->getVertexSize(NORMAL_BINDING), mRenderOp.vertexData->vertexCount, vBufUsage); bind->setBinding(NORMAL_BINDING, vbuf); float *pNorm = static_cast<float*>(vbuf->lock(HardwareBuffer::HBL_DISCARD)); *pNorm++ = 0.0f; *pNorm++ = 0.0f; *pNorm++ = 1.0f; *pNorm++ = 0.0f; *pNorm++ = 0.0f; *pNorm++ = 1.0f; *pNorm++ = 0.0f; *pNorm++ = 0.0f; *pNorm++ = 1.0f; *pNorm++ = 0.0f; *pNorm++ = 0.0f; *pNorm++ = 1.0f; vbuf->unlock(); if (includeTextureCoords) { decl->addElement(TEXCOORD_BINDING, 0, VET_FLOAT2, VES_TEXTURE_COORDINATES); HardwareVertexBufferSharedPtr tvbuf = HardwareBufferManager::getSingleton().createVertexBuffer( decl->getVertexSize(TEXCOORD_BINDING), mRenderOp.vertexData->vertexCount, vBufUsage); // Bind buffer bind->setBinding(TEXCOORD_BINDING, tvbuf); // Set up basic tex coordinates setDefaultUVs(); } // set basic white material this->setMaterial("BaseWhiteNoLighting"); } Rectangle2D::~Rectangle2D() { OGRE_DELETE mRenderOp.vertexData; } void Rectangle2D::setCorners(Real left, Real top, Real right, Real bottom, bool updateAABB) { HardwareVertexBufferSharedPtr vbuf = mRenderOp.vertexData->vertexBufferBinding->getBuffer(POSITION_BINDING); float* pFloat = static_cast<float*>(vbuf->lock(HardwareBuffer::HBL_DISCARD)); *pFloat++ = left; *pFloat++ = top; *pFloat++ = -1; *pFloat++ = left; *pFloat++ = bottom; *pFloat++ = -1; *pFloat++ = right; *pFloat++ = top; *pFloat++ = -1; *pFloat++ = right; *pFloat++ = bottom; *pFloat++ = -1; vbuf->unlock(); if(updateAABB) { mBox.setExtents( std::min(left, right), std::min(top, bottom), 0, std::max(left, right), std::max(top, bottom), 0); } } void Rectangle2D::setNormals(const Ogre::Vector3 &topLeft, const Ogre::Vector3 &bottomLeft, const Ogre::Vector3 &topRight, const Ogre::Vector3 &bottomRight) { HardwareVertexBufferSharedPtr vbuf = mRenderOp.vertexData->vertexBufferBinding->getBuffer(NORMAL_BINDING); float* pFloat = static_cast<float*>(vbuf->lock(HardwareBuffer::HBL_DISCARD)); *pFloat++ = topLeft.x; *pFloat++ = topLeft.y; *pFloat++ = topLeft.z; *pFloat++ = bottomLeft.x; *pFloat++ = bottomLeft.y; *pFloat++ = bottomLeft.z; *pFloat++ = topRight.x; *pFloat++ = topRight.y; *pFloat++ = topRight.z; *pFloat++ = bottomRight.x; *pFloat++ = bottomRight.y; *pFloat++ = bottomRight.z; vbuf->unlock(); } void Rectangle2D::setUVs( const Ogre::Vector2 &topLeft, const Ogre::Vector2 &bottomLeft, const Ogre::Vector2 &topRight, const Ogre::Vector2 &bottomRight) { if( mRenderOp.vertexData->vertexDeclaration->getElementCount() <= TEXCOORD_BINDING ) return; //Vertex data wasn't built with UV buffer HardwareVertexBufferSharedPtr vbuf = mRenderOp.vertexData->vertexBufferBinding->getBuffer(TEXCOORD_BINDING); float* pFloat = static_cast<float*>(vbuf->lock(HardwareBuffer::HBL_DISCARD)); *pFloat++ = topLeft.x; *pFloat++ = topLeft.y; *pFloat++ = bottomLeft.x; *pFloat++ = bottomLeft.y; *pFloat++ = topRight.x; *pFloat++ = topRight.y; *pFloat++ = bottomRight.x; *pFloat++ = bottomRight.y; vbuf->unlock(); } void Rectangle2D::setDefaultUVs() { setUVs( Vector2::ZERO, Vector2::UNIT_Y, Vector2::UNIT_X, Vector2::UNIT_SCALE ); } // Override this method to prevent parent transforms (rotation,translation,scale) void Rectangle2D::getWorldTransforms( Matrix4* xform ) const { // return identity matrix to prevent parent transforms *xform = Matrix4::IDENTITY; } }
MTASZTAKI/ApertusVR
plugins/render/ogreRender/3rdParty/ogre/OgreMain/src/OgreRectangle2D.cpp
C++
mit
7,548
var CustomSet = require('./custom_set'); describe('CustomSet', function() { it('can delete elements', function(){ var expected = new CustomSet([1, 3]); var actual = new CustomSet([3, 2, 1]).delete(2); expect(actual.eql(expected)).toBe(true); var expected2 = new CustomSet([1, 2, 3]); var actual2 = new CustomSet([3, 2, 1]).delete(4); expect(actual2.eql(expected2)).toBe(true); }); xit('can check for difference', function(){ var expected = new CustomSet([1, 3]); var actual = new CustomSet([3, 2, 1]).difference(new CustomSet([2, 4])); expect(actual.eql(expected)).toBe(true); var expected2 = new CustomSet([1, 2, 3]); var actual2 = new CustomSet([1, 2, 3]).difference(new CustomSet([4])); expect(actual2.eql(expected2)).toBe(true); }); xit('can test disjoint', function() { var actual = new CustomSet([1, 2]).disjoint(new CustomSet([3, 4])); expect(actual).toBe(true); var actual2 = new CustomSet([1, 2]).disjoint(new CustomSet([2, 3])); expect(actual2).toBe(false); var actual3 = new CustomSet().disjoint(new CustomSet()); expect(actual3).toBe(true); }); xit('can be emptied', function() { var actual = new CustomSet([1, 2]).empty(); var expected = new CustomSet(); expect(actual.eql(expected)).toBe(true); var actual2 = new CustomSet().empty(); var expected2 = new CustomSet(); expect(actual2.eql(expected2)).toBe(true); }); xit('can check for intersection', function() { var actual = new CustomSet(['a', 'b', 'c']).intersection(new CustomSet(['a', 'c', 'd'])); var expected = new CustomSet(['a', 'c']); expect(actual.eql(expected)).toBe(true); var actual2 = new CustomSet([1, 2, 3]).intersection(new CustomSet([3, 5, 4])); var expected2 = new CustomSet([3]); expect(actual2.eql(expected2)).toBe(true); }); xit('can test for a member', function() { var actual = new CustomSet([1, 2, 3]).member(2); expect(actual).toBe(true); var actual2 = new CustomSet([1, 2, 3]).member(4); expect(actual2).toBe(false); }); xit('can add a member with put', function() { var actual = new CustomSet([1, 2, 4]).put(3); var expected = new CustomSet([1, 2, 3, 4]); expect(actual.eql(expected)).toBe(true); var actual2 = new CustomSet([1, 2, 3]).put(3); var expected2 = new CustomSet([1, 2, 3]); expect(actual2.eql(expected2)).toBe(true); }); xit('knows its size', function() { var actual = new CustomSet().size(); expect(actual).toBe(0); var actual2 = new CustomSet([1, 2, 3]).size(); expect(actual2).toBe(3); var actual3 = new CustomSet([1, 2, 3, 2]).size(); expect(actual3).toBe(3); }); xit('can test for subsets', function() { var actual = new CustomSet([1, 2, 3]).subset(new CustomSet([1, 2, 3])); expect(actual).toBe(true); var actual2 = new CustomSet([4, 1, 2, 3]).subset(new CustomSet([1, 2, 3])); expect(actual2).toBe(true); var actual3 = new CustomSet([4, 1, 3]).subset(new CustomSet([1, 2, 3])); expect(actual3).toBe(false); var actual4 = new CustomSet([4, 1, 3]).subset(new CustomSet()); expect(actual4).toBe(true); var actual5 = new CustomSet().subset(new CustomSet()); expect(actual5).toBe(true); }); xit('can give back a list', function() { var actual = new CustomSet().toList(); var expected = []; expect(actual.sort()).toEqual(expected); var actual2 = new CustomSet([3, 1, 2]).toList(); var expected2 = [1, 2, 3]; expect(actual2.sort()).toEqual(expected2); var actual3 = new CustomSet([3, 1, 2, 1]).toList(); var expected3 = [1, 2, 3]; expect(actual3.sort()).toEqual(expected3); }); xit('can test for union', function() { var actual = new CustomSet([1, 3]).union(new CustomSet([2])); var expected = new CustomSet([3, 2, 1]); expect(actual.eql(expected)).toBe(true); var actual2 = new CustomSet([1, 3]).union(new CustomSet([2, 3])); var expected2 = new CustomSet([3, 2, 1]); expect(actual2.eql(expected2)).toBe(true); var actual3 = new CustomSet([1, 3]).union(new CustomSet()); var expected3 = new CustomSet([3, 1]); expect(actual3.eql(expected3)).toBe(true); var actual4 = new CustomSet().union(new CustomSet()); var expected4 = new CustomSet(); expect(actual4.eql(expected4)).toBe(true); }); });
wobh/xjavascript
custom-set/custom_set_test.spec.js
JavaScript
mit
4,362
#include "ofApp.h" REGISTERCLASS(ofApp) void ofApp::setup() { } void ofApp::update() { } void ofApp::draw() { } void ofApp::exit() { } void ofApp::keyPressed(ofKeyEventArgs& key) { } void ofApp::keyReleased(ofKeyEventArgs& key) { } void ofApp::mouseMoved(ofMouseEventArgs& mouse) { } void ofApp::mouseDragged(ofMouseEventArgs& mouse) { } void ofApp::mousePressed(ofMouseEventArgs& mouse) { } void ofApp::mouseReleased(ofMouseEventArgs& mouse) { } void ofApp::mouseScrolled(ofMouseEventArgs& mouse) { } void ofApp::mouseEntered(ofMouseEventArgs& mouse) { } void ofApp::mouseExited(ofMouseEventArgs& mouse) { } void ofApp::touchDown(ofTouchEventArgs& touch) { } void ofApp::touchMoved(ofTouchEventArgs& touch) { } void ofApp::touchUp(ofTouchEventArgs& touch) { } void ofApp::touchDoubleTap(ofTouchEventArgs& touch) { } void ofApp::touchCancelled(ofTouchEventArgs& touch) { } void ofApp::windowResized(ofResizeEventArgs& window) { } void ofApp::dragged(ofDragInfo& dragged) { } void ofApp::messageReceived(ofMessage& message) { }
GuidoSchmidt/ofLiveApp
src/ofApp.cpp
C++
mit
1,049
<?php namespace Jhul\Core\Application\Response\WebPage; class Content { private $_data = [ 'content' => '', ]; public function s( $key, $value ) { $this->_data[$key] = $value; return $this; } public function g( $key ) { if( isset( $this->_data[$key] ) ) return $this->_data[$key]; } public function a( $key, $value ) { $this->_data[$key] .= $value; } public function has( $e ) { return !empty( $this->_data[$e] ) ; } }
JhulFramework/PHPServer4ODK
required/odk/0.1/framework/jhul/Jhul/Core/Application/Response/WebPage/Content.php
PHP
mit
452
#!/usr/bin/env bash SRC=$(cd $(dirname "$0"); pwd) source "${SRC}/include.sh" echo -e "\033[1mRunning tests:\033[0m" echo "####################### DEBUG ############################" echo "PM2 Command = " $pm2 echo "Node version = " $nodeVersion $node -e "var os = require('os'); console.log('arch : %s\nplatform : %s\nrelease : %s\ntype : %s\nmem : %d', os.arch(), os.platform(), os.release(), os.type(), os.totalmem())" echo "###################### !DEBUG! ###########################" cd $file_path $pm2 kill spec "kill daemon" # # Different way to stop process # $pm2 start echo.js $pm2 start echo.js -f $pm2 start echo.js -f OUT=`$pm2 prettylist | grep -o "restart_time" | wc -l` [ $OUT -eq 3 ] || fail "$1" success "$1" $pm2 stop 12412 $pm2 stop 0 OUT=`$pm2 prettylist | grep -o "stopped" | wc -l` [ $OUT -eq 1 ] || fail "$1" success "$1" $pm2 stop asdsdaecho.js $pm2 stop echo $pm2 list OUT=`$pm2 prettylist | grep -o "stopped" | wc -l` [ $OUT -eq 3 ] || fail "$1" success "$1" # # Describe process # $pm2 describe 0 spec "should describe stopped process" $pm2 restart 1 $pm2 describe 1 spec "should describe online process" $pm2 describe asdsa ispec "should exit with right exit code when no process found" # # Update pm2 # $pm2 updatePM2 spec "should update pm2" # # Main tests # $pm2 kill spec "kill daemon" $pm2 start eyayimfake ispec "should fail if script doesnt exist" $pm2 ispec "No argument" $pm2 list $pm2 start cluster-pm2.json spec "Should start well formated json with name for file prefix" $pm2 list spec "Should list processes succesfully" $pm2 start multi-echo.json spec "Should start multiple applications" $pm2 generate echo spec "Should generate echo sample json" $pm2 start echo-pm2.json -f spec "Should start echo service" $pm2 list $pm2 logs & spec "Should display logs" TMPPID=$! sleep 1 kill $! spec "Should kill logs" $pm2 logs echo & spec "Should display logs" TMPPID=$! sleep 1 kill $! spec "Should kill logs" $pm2 web spec "Should start web interface" sleep 0.3 JSON_FILE='/tmp/web-json' $http_get -q http://localhost:9615/ -O $JSON_FILE cat $JSON_FILE | grep "HttpInterface.js" > /dev/null spec "Should get the right JSON with HttpInterface file launched" $pm2 flush spec "Should clean logs" cat ~/.pm2/logs/echo-out.log | wc -l spec "File Log should be cleaned" sleep 0.3 $http_get -q http://localhost:9615/ -O $JSON_FILE cat $JSON_FILE | grep "restart_time\":0" > /dev/null spec "Should get the right JSON with HttpInterface file launched" # # Restart only one process # $pm2 restart 1 sleep 0.3 $http_get -q http://localhost:9615/ -O $JSON_FILE OUT=`cat $JSON_FILE | grep -o "restart_time\":1" | wc -l` [ $OUT -eq 1 ] || fail "$1" success "$1" # # Restart all processes # $pm2 restart all spec "Should restart all processes" sleep 0.3 $http_get -q http://localhost:9615/ -O $JSON_FILE OUT=`cat $JSON_FILE | grep -o "restart_time\":1" | wc -l` [ $OUT -eq 7 ] || fail "$1" success "$1" $pm2 list $pm2 dump spec "Should dump current processes" ls ~/.pm2/dump.pm2 spec "Dump file should be present" $pm2 stop all spec "Should stop all processes" sleep 0.5 OUT=`$pm2 prettylist | grep -o "stopped" | wc -l` [ $OUT -eq 8 ] || fail "Process not stopped" success "Process succesfully stopped" $pm2 kill # # Issue #71 # PROC_NAME='ECHONEST' # Launch a script with name option $pm2 start echo.js --name $PROC_NAME -f OUT=`$pm2 prettylist | grep -o "ECHONEST" | wc -l` [ $OUT -gt 0 ] || fail "Process not launched" success "Processes sucessfully launched with a specific name" # Restart a process by name $pm2 restart $PROC_NAME OUT=`$pm2 prettylist | grep -o "restart_time: 1" | wc -l` [ $OUT -gt 0 ] || fail "Process name not restarted" success "Processes sucessfully restarted with a specific name" $pm2 kill $pm2 resurrect spec "Should resurect all apps" sleep 0.5 OUT=`$pm2 prettylist | grep -o "restart_time" | wc -l` [ $OUT -eq 8 ] || fail "Not valid process number" success "Processes valid" $pm2 delete all spec "Should delete all processes" sleep 0.5 OUT=`$pm2 prettylist | grep -o "restart_time" | wc -l` [ $OUT -eq 0 ] || fail "Process not stopped" success "Process succesfully stopped" # # Cron # $pm2 start cron.js -c "* * * asdasd" ispec "Cron should throw error when pattern invalid" $pm2 start cron.js -c "* * * * * *" spec "Should cron restart echo.js" $pm2 kill test ispec "Should not kill with extra args" $pm2 kill spec "Should kill daemon"
liuyan19880121/test_nodeclub
node_modules/pm2/test/cli.sh
Shell
mit
4,467
<?php namespace Proxies\__CG__\Win8\EnrolBundle\Entity; /** * DO NOT EDIT THIS FILE - IT WAS CREATED BY DOCTRINE'S PROXY GENERATOR */ class Termin extends \Win8\EnrolBundle\Entity\Termin implements \Doctrine\ORM\Proxy\Proxy { /** * @var \Closure the callback responsible for loading properties in the proxy object. This callback is called with * three parameters, being respectively the proxy object to be initialized, the method that triggered the * initialization process and an array of ordered parameters that were passed to that method. * * @see \Doctrine\Common\Persistence\Proxy::__setInitializer */ public $__initializer__; /** * @var \Closure the callback responsible of loading properties that need to be copied in the cloned object * * @see \Doctrine\Common\Persistence\Proxy::__setCloner */ public $__cloner__; /** * @var boolean flag indicating if this object was already initialized * * @see \Doctrine\Common\Persistence\Proxy::__isInitialized */ public $__isInitialized__ = false; /** * @var array properties to be lazy loaded, with keys being the property * names and values being their default values * * @see \Doctrine\Common\Persistence\Proxy::__getLazyProperties */ public static $lazyPropertiesDefaults = array(); /** * @param \Closure $initializer * @param \Closure $cloner */ public function __construct($initializer = null, $cloner = null) { $this->__initializer__ = $initializer; $this->__cloner__ = $cloner; } /** * * @return array */ public function __sleep() { if ($this->__isInitialized__) { return array('__isInitialized__', '' . "\0" . 'Win8\\EnrolBundle\\Entity\\Termin' . "\0" . 'id', '' . "\0" . 'Win8\\EnrolBundle\\Entity\\Termin' . "\0" . 'datefrom', '' . "\0" . 'Win8\\EnrolBundle\\Entity\\Termin' . "\0" . 'dateto', '' . "\0" . 'Win8\\EnrolBundle\\Entity\\Termin' . "\0" . 'availableplaceno', '' . "\0" . 'Win8\\EnrolBundle\\Entity\\Termin' . "\0" . 'registers'); } return array('__isInitialized__', '' . "\0" . 'Win8\\EnrolBundle\\Entity\\Termin' . "\0" . 'id', '' . "\0" . 'Win8\\EnrolBundle\\Entity\\Termin' . "\0" . 'datefrom', '' . "\0" . 'Win8\\EnrolBundle\\Entity\\Termin' . "\0" . 'dateto', '' . "\0" . 'Win8\\EnrolBundle\\Entity\\Termin' . "\0" . 'availableplaceno', '' . "\0" . 'Win8\\EnrolBundle\\Entity\\Termin' . "\0" . 'registers'); } /** * */ public function __wakeup() { if ( ! $this->__isInitialized__) { $this->__initializer__ = function (Termin $proxy) { $proxy->__setInitializer(null); $proxy->__setCloner(null); $existingProperties = get_object_vars($proxy); foreach ($proxy->__getLazyProperties() as $property => $defaultValue) { if ( ! array_key_exists($property, $existingProperties)) { $proxy->$property = $defaultValue; } } }; } } /** * */ public function __clone() { $this->__cloner__ && $this->__cloner__->__invoke($this, '__clone', array()); } /** * Forces initialization of the proxy */ public function __load() { $this->__initializer__ && $this->__initializer__->__invoke($this, '__load', array()); } /** * {@inheritDoc} * @internal generated method: use only when explicitly handling proxy specific loading logic */ public function __isInitialized() { return $this->__isInitialized__; } /** * {@inheritDoc} * @internal generated method: use only when explicitly handling proxy specific loading logic */ public function __setInitialized($initialized) { $this->__isInitialized__ = $initialized; } /** * {@inheritDoc} * @internal generated method: use only when explicitly handling proxy specific loading logic */ public function __setInitializer(\Closure $initializer = null) { $this->__initializer__ = $initializer; } /** * {@inheritDoc} * @internal generated method: use only when explicitly handling proxy specific loading logic */ public function __getInitializer() { return $this->__initializer__; } /** * {@inheritDoc} * @internal generated method: use only when explicitly handling proxy specific loading logic */ public function __setCloner(\Closure $cloner = null) { $this->__cloner__ = $cloner; } /** * {@inheritDoc} * @internal generated method: use only when explicitly handling proxy specific cloning logic */ public function __getCloner() { return $this->__cloner__; } /** * {@inheritDoc} * @internal generated method: use only when explicitly handling proxy specific loading logic * @static */ public function __getLazyProperties() { return self::$lazyPropertiesDefaults; } /** * {@inheritDoc} */ public function getId() { if ($this->__isInitialized__ === false) { return (int) parent::getId(); } $this->__initializer__ && $this->__initializer__->__invoke($this, 'getId', array()); return parent::getId(); } /** * {@inheritDoc} */ public function setDatefrom($datefrom) { $this->__initializer__ && $this->__initializer__->__invoke($this, 'setDatefrom', array($datefrom)); return parent::setDatefrom($datefrom); } /** * {@inheritDoc} */ public function getDatefrom() { $this->__initializer__ && $this->__initializer__->__invoke($this, 'getDatefrom', array()); return parent::getDatefrom(); } /** * {@inheritDoc} */ public function setDateto($dateto) { $this->__initializer__ && $this->__initializer__->__invoke($this, 'setDateto', array($dateto)); return parent::setDateto($dateto); } /** * {@inheritDoc} */ public function getDateto() { $this->__initializer__ && $this->__initializer__->__invoke($this, 'getDateto', array()); return parent::getDateto(); } /** * {@inheritDoc} */ public function setAvailableplaceno($availableplaceno) { $this->__initializer__ && $this->__initializer__->__invoke($this, 'setAvailableplaceno', array($availableplaceno)); return parent::setAvailableplaceno($availableplaceno); } /** * {@inheritDoc} */ public function getAvailableplaceno() { $this->__initializer__ && $this->__initializer__->__invoke($this, 'getAvailableplaceno', array()); return parent::getAvailableplaceno(); } /** * {@inheritDoc} */ public function addRegister(\Win8\EnrolBundle\Entity\Register $registers) { $this->__initializer__ && $this->__initializer__->__invoke($this, 'addRegister', array($registers)); return parent::addRegister($registers); } /** * {@inheritDoc} */ public function removeRegister(\Win8\EnrolBundle\Entity\Register $registers) { $this->__initializer__ && $this->__initializer__->__invoke($this, 'removeRegister', array($registers)); return parent::removeRegister($registers); } /** * {@inheritDoc} */ public function getRegisters() { $this->__initializer__ && $this->__initializer__->__invoke($this, 'getRegisters', array()); return parent::getRegisters(); } /** * {@inheritDoc} */ public function __toString() { $this->__initializer__ && $this->__initializer__->__invoke($this, '__toString', array()); return parent::__toString(); } }
Pedrokratov/Win8
app/cache/prod/doctrine/orm/Proxies/__CG__Win8EnrolBundleEntityTermin.php
PHP
mit
8,034
<?php /** * @package framework * @copyright Copyright (c) 2005-2020 The Regents of the University of California. * @license http://opensource.org/licenses/MIT MIT */ namespace Hubzero\Routing\Router; use Countable; use Closure; use Iterator; /** * Iterator class for Rules */ class Rules implements Countable, Iterator { /** * Container for data * * @var array */ protected $data = array(); /** * Constructor * * @param array $data Array of data * @return void */ public function __construct(array $data = array()) { foreach ($data as $key => $value) { $this->data[$key] = $this->close($value); } } /** * Wrap value in a Closure * * @param mixed $value * @return object */ public function close($value) { if (!($value instanceof Closure)) { $value = function($uri) use ($value) { if (is_callable($value)) { return call_user_func_array($value, array($uri)); } return $value; }; } return $value; } /** * Add item to the end of the array * * @param string $key * @param mixed $value * @return object */ public function append($key, $value) { if (!$this->has($key, $value)) { $this->data[$key] = $this->close($value); } return $this; } /** * Add item to the beginning of the array * * @param string $key * @param mixed $value * @return object */ public function prepend($key, $value) { if ($this->has($key)) { unset($this->data[$key]); } $data = array($key => $this->close($value)); $this->data = $data + $this->data; return $this; } /** * Add item to the array before specificed $idx * * @param string $idx * @param string $key * @param mixed $value * @return object */ public function insertBefore($idx, $key, $value=null) { if ($this->has($key)) { $value = $value ?: $this->data[$key]; unset($this->data[$key]); } $data = array(); foreach ($this->data as $k => $v) { if ($idx == $k) { $data[$key] = $this->close($value); } $data[$k] = $v; } $this->data = $data; if (!$this->has($key)) { $this->append($key, $value); } return $this; } /** * Add item to the array after specificed $idx * * @param string $idx * @param string $key * @param mixed $value * @return object */ public function insertAfter($idx, $key, $value=null) { if ($this->has($key)) { $value = $value ?: $this->data[$key]; unset($this->data[$key]); } $data = array(); foreach ($this->data as $k => $v) { $data[$k] = $v; if ($idx == $k) { $data[$key] = $this->close($value); } } $this->data = $data; if (!$this->has($key)) { $this->append($key, $value); } return $this; } /** * Determine if rule exist for a given key * * @param string $key * @return boolean */ public function has($key) { return isset($this->data[$key]); } /** * Get a rule for a specific key * * @param string $key * @return mixed */ public function get($key) { if (array_key_exists($key, $this->data)) { return $this->close($this->data[$key]); } return null; } /** * Get all of the rules from the bag for a given key * * @param string $key * @param mixed $value * @return mixed */ public function set($key, $value) { $this->data[$key] = $this->close($value); return $this; } /** * Get all of the rules * * @return array */ public function all() { return $this->data; } /** * Get the number of rules * * @return integer */ public function count() { return count($this->data); } /** * Are there any rules? * * @return boolean */ public function any() { return ($this->count() > 0); } /** * Clear all rules * * @return object */ public function clear() { $this->data = array(); return $this; } /** * Merge a new array of rules into the bag. * * @param array $data * @return object */ public function merge(array $data) { $this->data = array_merge($this->data, $data); return $this; } /** * Rewind to beginning of array * * @return void */ public function rewind() { reset($this->data); } /** * Get current item in the array * * @return object */ public function current() { return current($this->data); } /** * Get the key of the current item * * @return string */ public function key() { return key($this->data); } /** * Move to next item in the array * * @return void */ public function next() { next($this->data); } /** * Is array position valid? * * @return boolean */ public function valid() { return key($this->data) !== null; } }
hubzero/framework
src/Routing/Router/Rules.php
PHP
mit
4,782
#include "f2c.h" #include "blaswrap.h" /* Table of constant values */ static integer c__1 = 1; /* Subroutine */ int zhpgv_(integer *itype, char *jobz, char *uplo, integer * n, doublecomplex *ap, doublecomplex *bp, doublereal *w, doublecomplex *z__, integer *ldz, doublecomplex *work, doublereal *rwork, integer * info) { /* System generated locals */ integer z_dim1, z_offset, i__1; /* Local variables */ integer j, neig; extern logical lsame_(char *, char *); char trans[1]; logical upper; extern /* Subroutine */ int zhpev_(char *, char *, integer *, doublecomplex *, doublereal *, doublecomplex *, integer *, doublecomplex *, doublereal *, integer *); logical wantz; extern /* Subroutine */ int ztpmv_(char *, char *, char *, integer *, doublecomplex *, doublecomplex *, integer *), ztpsv_(char *, char *, char *, integer *, doublecomplex * , doublecomplex *, integer *), xerbla_( char *, integer *), zhpgst_(integer *, char *, integer *, doublecomplex *, doublecomplex *, integer *), zpptrf_( char *, integer *, doublecomplex *, integer *); /* -- LAPACK driver routine (version 3.1) -- */ /* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. */ /* November 2006 */ /* .. Scalar Arguments .. */ /* .. */ /* .. Array Arguments .. */ /* .. */ /* Purpose */ /* ======= */ /* ZHPGV computes all the eigenvalues and, optionally, the eigenvectors */ /* of a complex generalized Hermitian-definite eigenproblem, of the form */ /* A*x=(lambda)*B*x, A*Bx=(lambda)*x, or B*A*x=(lambda)*x. */ /* Here A and B are assumed to be Hermitian, stored in packed format, */ /* and B is also positive definite. */ /* Arguments */ /* ========= */ /* ITYPE (input) INTEGER */ /* Specifies the problem type to be solved: */ /* = 1: A*x = (lambda)*B*x */ /* = 2: A*B*x = (lambda)*x */ /* = 3: B*A*x = (lambda)*x */ /* JOBZ (input) CHARACTER*1 */ /* = 'N': Compute eigenvalues only; */ /* = 'V': Compute eigenvalues and eigenvectors. */ /* UPLO (input) CHARACTER*1 */ /* = 'U': Upper triangles of A and B are stored; */ /* = 'L': Lower triangles of A and B are stored. */ /* N (input) INTEGER */ /* The order of the matrices A and B. N >= 0. */ /* AP (input/output) COMPLEX*16 array, dimension (N*(N+1)/2) */ /* On entry, the upper or lower triangle of the Hermitian matrix */ /* A, packed columnwise in a linear array. The j-th column of A */ /* is stored in the array AP as follows: */ /* if UPLO = 'U', AP(i + (j-1)*j/2) = A(i,j) for 1<=i<=j; */ /* if UPLO = 'L', AP(i + (j-1)*(2*n-j)/2) = A(i,j) for j<=i<=n. */ /* On exit, the contents of AP are destroyed. */ /* BP (input/output) COMPLEX*16 array, dimension (N*(N+1)/2) */ /* On entry, the upper or lower triangle of the Hermitian matrix */ /* B, packed columnwise in a linear array. The j-th column of B */ /* is stored in the array BP as follows: */ /* if UPLO = 'U', BP(i + (j-1)*j/2) = B(i,j) for 1<=i<=j; */ /* if UPLO = 'L', BP(i + (j-1)*(2*n-j)/2) = B(i,j) for j<=i<=n. */ /* On exit, the triangular factor U or L from the Cholesky */ /* factorization B = U**H*U or B = L*L**H, in the same storage */ /* format as B. */ /* W (output) DOUBLE PRECISION array, dimension (N) */ /* If INFO = 0, the eigenvalues in ascending order. */ /* Z (output) COMPLEX*16 array, dimension (LDZ, N) */ /* If JOBZ = 'V', then if INFO = 0, Z contains the matrix Z of */ /* eigenvectors. The eigenvectors are normalized as follows: */ /* if ITYPE = 1 or 2, Z**H*B*Z = I; */ /* if ITYPE = 3, Z**H*inv(B)*Z = I. */ /* If JOBZ = 'N', then Z is not referenced. */ /* LDZ (input) INTEGER */ /* The leading dimension of the array Z. LDZ >= 1, and if */ /* JOBZ = 'V', LDZ >= max(1,N). */ /* WORK (workspace) COMPLEX*16 array, dimension (max(1, 2*N-1)) */ /* RWORK (workspace) DOUBLE PRECISION array, dimension (max(1, 3*N-2)) */ /* INFO (output) INTEGER */ /* = 0: successful exit */ /* < 0: if INFO = -i, the i-th argument had an illegal value */ /* > 0: ZPPTRF or ZHPEV returned an error code: */ /* <= N: if INFO = i, ZHPEV failed to converge; */ /* i off-diagonal elements of an intermediate */ /* tridiagonal form did not convergeto zero; */ /* > N: if INFO = N + i, for 1 <= i <= n, then the leading */ /* minor of order i of B is not positive definite. */ /* The factorization of B could not be completed and */ /* no eigenvalues or eigenvectors were computed. */ /* ===================================================================== */ /* .. Local Scalars .. */ /* .. */ /* .. External Functions .. */ /* .. */ /* .. External Subroutines .. */ /* .. */ /* .. Executable Statements .. */ /* Test the input parameters. */ /* Parameter adjustments */ --ap; --bp; --w; z_dim1 = *ldz; z_offset = 1 + z_dim1; z__ -= z_offset; --work; --rwork; /* Function Body */ wantz = lsame_(jobz, "V"); upper = lsame_(uplo, "U"); *info = 0; if (*itype < 1 || *itype > 3) { *info = -1; } else if (! (wantz || lsame_(jobz, "N"))) { *info = -2; } else if (! (upper || lsame_(uplo, "L"))) { *info = -3; } else if (*n < 0) { *info = -4; } else if (*ldz < 1 || wantz && *ldz < *n) { *info = -9; } if (*info != 0) { i__1 = -(*info); xerbla_("ZHPGV ", &i__1); return 0; } /* Quick return if possible */ if (*n == 0) { return 0; } /* Form a Cholesky factorization of B. */ zpptrf_(uplo, n, &bp[1], info); if (*info != 0) { *info = *n + *info; return 0; } /* Transform problem to standard eigenvalue problem and solve. */ zhpgst_(itype, uplo, n, &ap[1], &bp[1], info); zhpev_(jobz, uplo, n, &ap[1], &w[1], &z__[z_offset], ldz, &work[1], & rwork[1], info); if (wantz) { /* Backtransform eigenvectors to the original problem. */ neig = *n; if (*info > 0) { neig = *info - 1; } if (*itype == 1 || *itype == 2) { /* For A*x=(lambda)*B*x and A*B*x=(lambda)*x; */ /* backtransform eigenvectors: x = inv(L)'*y or inv(U)*y */ if (upper) { *(unsigned char *)trans = 'N'; } else { *(unsigned char *)trans = 'C'; } i__1 = neig; for (j = 1; j <= i__1; ++j) { ztpsv_(uplo, trans, "Non-unit", n, &bp[1], &z__[j * z_dim1 + 1], &c__1); /* L10: */ } } else if (*itype == 3) { /* For B*A*x=(lambda)*x; */ /* backtransform eigenvectors: x = L*y or U'*y */ if (upper) { *(unsigned char *)trans = 'C'; } else { *(unsigned char *)trans = 'N'; } i__1 = neig; for (j = 1; j <= i__1; ++j) { ztpmv_(uplo, trans, "Non-unit", n, &bp[1], &z__[j * z_dim1 + 1], &c__1); /* L20: */ } } } return 0; /* End of ZHPGV */ } /* zhpgv_ */
dacap/loseface
third_party/clapack/SRC/zhpgv.c
C
mit
7,301
export { fromEvent } from 'rxjs'; //# sourceMappingURL=fromEvent.js.map
friendsofagape/mt2414ui
node_modules/rxjs-compat/_esm5/observable/fromEvent.js
JavaScript
mit
71
## DARIAH NLP WG Our Web Presence
DARIAH-NLP/DARIAH-NLP.github.io
README.md
Markdown
mit
35
<?php class IWD_Opc_Block_Onepage_Comment extends Mage_Core_Block_Template{ public function _construct(){ $this->setTemplate('opc/onepage/comment.phtml'); } }
z-v/iboxGento2
app/code/community/IWD/Opc/Block/Onepage/Comment.php
PHP
mit
168
using System; using System.Collections.Generic; using System.Linq; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Audio; using Microsoft.Xna.Framework.Content; using Microsoft.Xna.Framework.GamerServices; using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Input; using Microsoft.Xna.Framework.Media; using Microsoft.Xna.Framework.Net; using Microsoft.Xna.Framework.Storage; using FlatRedBall; using FlatRedBall.Gui; using System.Windows.Forms; using FlatRedBall.IO; using PolygonEditor; using PolygonEditor.Gui; using FlatRedBall.ManagedSpriteGroups; using PolygonEditorXna.IO; namespace PolygonEditorXna { /// <summary> /// This is the main type for your game /// </summary> public class Game1 : Microsoft.Xna.Framework.Game { GraphicsDeviceManager graphics; public Game1() { graphics = new GraphicsDeviceManager(this); Content.RootDirectory = "Content"; } /// <summary> /// Allows the game to perform any initialization it needs to before starting to run. /// This is where it can query for any required services and load any non-graphic /// related content. Calling base.Initialize will enumerate through any components /// and initialize them as well. /// </summary> protected override void Initialize() { FlatRedBallServices.InitializeFlatRedBall(this, graphics); //SpriteManager.Camera.LightingEnabled = true; //SpriteManager.Camera.Lights.SetDefaultLighting(FlatRedBall.Graphics.Lighting.LightCollection.DefaultLightingSetup.Evening); FlatRedBall.Graphics.Lighting.LightManager.AddAmbientLight(Color.White); IsMouseVisible = true; GuiManager.IsUIEnabled = true; SpriteManager.Camera.CameraModelCullMode = FlatRedBall.Graphics.CameraModelCullMode.None; EditorData.Initialize(null); GuiData.Initialize(); ProcessCommandLineArguments(); // TODO: Set the name of the file that the user is editing. base.Initialize(); } /// <summary> /// Allows the game to run logic such as updating the world, /// checking for collisions, gathering input, and playing audio. /// </summary> /// <param name="gameTime">Provides a snapshot of timing values.</param> protected override void Update(GameTime gameTime) { FlatRedBallServices.Update(gameTime); // TODO: Add your update logic here EditorData.Update(); if (EditorData.Scene != null) { foreach (SpriteGrid spriteGrid in EditorData.Scene.SpriteGrids) { spriteGrid.Manage(); } } base.Update(gameTime); } /// <summary> /// This is called when the game should draw itself. /// </summary> /// <param name="gameTime">Provides a snapshot of timing values.</param> protected override void Draw(GameTime gameTime) { FlatRedBallServices.Draw(); base.Draw(gameTime); } void ProcessCommandLineArguments() { foreach (string s in Program.CommandLineArguments) { ProcessCommandLineArgument(s); } } public void ProcessCommandLineArgument(string argument) { string extension = FileManager.GetExtension(argument); switch (extension) { case "scnx": EditorData.LoadScene(argument); break; case "plylstx": EditorData.LoadPolygonList(argument); break; case "shcx": FileLoader.LoadShapeCollection(argument); break; } } protected void ProcessDroppedFile(string fileName) { string extension = FileManager.GetExtension(fileName); switch (extension) { case "scnx": EditorData.LoadScene(fileName); break; } } private void GameForm_DragDrop(object sender, DragEventArgs e) { if (e.Data.GetDataPresent(DataFormats.FileDrop)) { // Assign the file names to a string array, in // case the user has selected multiple files. string[] files = (string[])e.Data.GetData(DataFormats.FileDrop); try { foreach (string fileName in files) { string extension = FileManager.GetExtension(fileName); switch (extension) { case "plylstx": EditorData.LoadPolygonList(fileName); //this.BringToFront(); //this.Focus(); break; case "scnx": //GameData.guiData.fileButtonWindow.AskToReplaceOrInsertNewScene(fileName); break; } } } catch (Exception ex) { System.Windows.Forms.MessageBox.Show(ex.Message); return; } } } } }
GorillaOne/FlatRedBall
FRBDK/PolygonEditor/PolygonEditor/PolygonEditor/Game1.cs
C#
mit
5,709
/** * Copyright (C) 2010-14 diirt developers. See COPYRIGHT.TXT * All rights reserved. Use is subject to license terms. See LICENSE.TXT */ package org.diirt.datasource; /** * Groups all the parameters required to add a reader to a ChannelHandler. * <p> * All parameters where grouped in this class so that if something needs to be * added or removed the impact is lessened. The class is immutable so that * the ChannelHandler can cache it for reference. * * @author carcassi */ public class ChannelHandlerReadSubscription { /** * Creates the parameters for a new subscription. * * @param valueCache the cache where to write the value * @param exceptionWriteFunction the write function to dispatch exceptions * @param connectionWriteFunction the connection write function to dispatch exceptions */ public ChannelHandlerReadSubscription(ValueCache<?> valueCache, WriteFunction<Exception> exceptionWriteFunction, WriteFunction<Boolean> connectionWriteFunction) { this.valueCache = valueCache; this.exceptionWriteFunction = exceptionWriteFunction; this.connectionWriteFunction = connectionWriteFunction; } private final ValueCache<?> valueCache; private final WriteFunction<Exception> exceptionWriteFunction; private final WriteFunction<Boolean> connectionWriteFunction; /** * The cache where to write the value. * * @return never null */ public ValueCache<?> getValueCache() { return valueCache; } /** * The write function for exceptions. * * @return never null */ public WriteFunction<Exception> getExceptionWriteFunction() { return exceptionWriteFunction; } /** * The write function for the connection flag. * * @return never null */ public WriteFunction<Boolean> getConnectionWriteFunction() { return connectionWriteFunction; } @Override public int hashCode() { int hash = 5; hash = 67 * hash + (this.valueCache != null ? this.valueCache.hashCode() : 0); hash = 67 * hash + (this.exceptionWriteFunction != null ? this.exceptionWriteFunction.hashCode() : 0); hash = 67 * hash + (this.connectionWriteFunction != null ? this.connectionWriteFunction.hashCode() : 0); return hash; } @Override public boolean equals(Object obj) { if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final ChannelHandlerReadSubscription other = (ChannelHandlerReadSubscription) obj; if (this.valueCache != other.valueCache && (this.valueCache == null || !this.valueCache.equals(other.valueCache))) { return false; } if (this.exceptionWriteFunction != other.exceptionWriteFunction && (this.exceptionWriteFunction == null || !this.exceptionWriteFunction.equals(other.exceptionWriteFunction))) { return false; } if (this.connectionWriteFunction != other.connectionWriteFunction && (this.connectionWriteFunction == null || !this.connectionWriteFunction.equals(other.connectionWriteFunction))) { return false; } return true; } }
richardfearn/diirt
pvmanager/pvmanager-core/src/main/java/org/diirt/datasource/ChannelHandlerReadSubscription.java
Java
mit
3,289
# Copyright 2014 Google Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. """Shared implementation of connections to API servers.""" import json from pkg_resources import get_distribution import six from six.moves.urllib.parse import urlencode # pylint: disable=F0401 import httplib2 from gcloud.exceptions import make_exception API_BASE_URL = 'https://www.googleapis.com' """The base of the API call URL.""" class Connection(object): """A generic connection to Google Cloud Platform. Subclasses should understand only the basic types in method arguments, however they should be capable of returning advanced types. If no value is passed in for ``http``, a :class:`httplib2.Http` object will be created and authorized with the ``credentials``. If not, the ``credentials`` and ``http`` need not be related. Subclasses may seek to use the private key from ``credentials`` to sign data. A custom (non-``httplib2``) HTTP object must have a ``request`` method which accepts the following arguments: * ``uri`` * ``method`` * ``body`` * ``headers`` In addition, ``redirections`` and ``connection_type`` may be used. Without the use of ``credentials.authorize(http)``, a custom ``http`` object will also need to be able to add a bearer token to API requests and handle token refresh on 401 errors. :type credentials: :class:`oauth2client.client.OAuth2Credentials` or :class:`NoneType` :param credentials: The OAuth2 Credentials to use for this connection. :type http: :class:`httplib2.Http` or class that defines ``request()``. :param http: An optional HTTP object to make requests. """ USER_AGENT = "gcloud-python/{0}".format(get_distribution('gcloud').version) """The user agent for gcloud-python requests.""" SCOPE = None """The scopes required for authenticating with a service. Needs to be set by subclasses. """ def __init__(self, credentials=None, http=None): self._http = http self._credentials = self._create_scoped_credentials( credentials, self.SCOPE) @property def credentials(self): """Getter for current credentials. :rtype: :class:`oauth2client.client.OAuth2Credentials` or :class:`NoneType` :returns: The credentials object associated with this connection. """ return self._credentials @property def http(self): """A getter for the HTTP transport used in talking to the API. :rtype: :class:`httplib2.Http` :returns: A Http object used to transport data. """ if self._http is None: self._http = httplib2.Http() if self._credentials: self._http = self._credentials.authorize(self._http) return self._http @staticmethod def _create_scoped_credentials(credentials, scope): """Create a scoped set of credentials if it is required. :type credentials: :class:`oauth2client.client.OAuth2Credentials` or :class:`NoneType` :param credentials: The OAuth2 Credentials to add a scope to. :type scope: list of URLs :param scope: the effective service auth scopes for the connection. :rtype: :class:`oauth2client.client.OAuth2Credentials` or :class:`NoneType` :returns: A new credentials object that has a scope added (if needed). """ if credentials and credentials.create_scoped_required(): credentials = credentials.create_scoped(scope) return credentials class JSONConnection(Connection): """A connection to a Google JSON-based API. These APIs are discovery based. For reference: https://developers.google.com/discovery/ This defines :meth:`Connection.api_request` for making a generic JSON API request and API requests are created elsewhere. The class constants * ``API_BASE_URL`` * ``API_VERSION`` * ``API_URL_TEMPLATE`` must be updated by subclasses. """ API_BASE_URL = None """The base of the API call URL.""" API_VERSION = None """The version of the API, used in building the API call's URL.""" API_URL_TEMPLATE = None """A template for the URL of a particular API call.""" @classmethod def build_api_url(cls, path, query_params=None, api_base_url=None, api_version=None): """Construct an API url given a few components, some optional. Typically, you shouldn't need to use this method. :type path: string :param path: The path to the resource (ie, ``'/b/bucket-name'``). :type query_params: dict :param query_params: A dictionary of keys and values to insert into the query string of the URL. :type api_base_url: string :param api_base_url: The base URL for the API endpoint. Typically you won't have to provide this. :type api_version: string :param api_version: The version of the API to call. Typically you shouldn't provide this and instead use the default for the library. :rtype: string :returns: The URL assembled from the pieces provided. """ api_base_url = api_base_url or cls.API_BASE_URL url = cls.API_URL_TEMPLATE.format( api_base_url=(api_base_url or cls.API_BASE_URL), api_version=(api_version or cls.API_VERSION), path=path) query_params = query_params or {} if query_params: url += '?' + urlencode(query_params) return url def _make_request(self, method, url, data=None, content_type=None, headers=None, target_object=None): """A low level method to send a request to the API. Typically, you shouldn't need to use this method. :type method: string :param method: The HTTP method to use in the request. :type url: string :param url: The URL to send the request to. :type data: string :param data: The data to send as the body of the request. :type content_type: string :param content_type: The proper MIME type of the data provided. :type headers: dict :param headers: A dictionary of HTTP headers to send with the request. :type target_object: object or :class:`NoneType` :param target_object: Argument to be used by library callers. This can allow custom behavior, for example, to defer an HTTP request and complete initialization of the object at a later time. :rtype: tuple of ``response`` (a dictionary of sorts) and ``content`` (a string). :returns: The HTTP response object and the content of the response, returned by :meth:`_do_request`. """ headers = headers or {} headers['Accept-Encoding'] = 'gzip' if data: content_length = len(str(data)) else: content_length = 0 headers['Content-Length'] = content_length if content_type: headers['Content-Type'] = content_type headers['User-Agent'] = self.USER_AGENT return self._do_request(method, url, headers, data, target_object) def _do_request(self, method, url, headers, data, target_object): # pylint: disable=unused-argument """Low-level helper: perform the actual API request over HTTP. Allows batch context managers to override and defer a request. :type method: string :param method: The HTTP method to use in the request. :type url: string :param url: The URL to send the request to. :type headers: dict :param headers: A dictionary of HTTP headers to send with the request. :type data: string :param data: The data to send as the body of the request. :type target_object: object or :class:`NoneType` :param target_object: Unused ``target_object`` here but may be used by a superclass. :rtype: tuple of ``response`` (a dictionary of sorts) and ``content`` (a string). :returns: The HTTP response object and the content of the response. """ return self.http.request(uri=url, method=method, headers=headers, body=data) def api_request(self, method, path, query_params=None, data=None, content_type=None, api_base_url=None, api_version=None, expect_json=True, _target_object=None): """Make a request over the HTTP transport to the API. You shouldn't need to use this method, but if you plan to interact with the API using these primitives, this is the correct one to use. :type method: string :param method: The HTTP method name (ie, ``GET``, ``POST``, etc). Required. :type path: string :param path: The path to the resource (ie, ``'/b/bucket-name'``). Required. :type query_params: dict :param query_params: A dictionary of keys and values to insert into the query string of the URL. Default is empty dict. :type data: string :param data: The data to send as the body of the request. Default is the empty string. :type content_type: string :param content_type: The proper MIME type of the data provided. Default is None. :type api_base_url: string :param api_base_url: The base URL for the API endpoint. Typically you won't have to provide this. Default is the standard API base URL. :type api_version: string :param api_version: The version of the API to call. Typically you shouldn't provide this and instead use the default for the library. Default is the latest API version supported by gcloud-python. :type expect_json: boolean :param expect_json: If True, this method will try to parse the response as JSON and raise an exception if that cannot be done. Default is True. :type _target_object: object or :class:`NoneType` :param _target_object: Protected argument to be used by library callers. This can allow custom behavior, for example, to defer an HTTP request and complete initialization of the object at a later time. :raises: Exception if the response code is not 200 OK. """ url = self.build_api_url(path=path, query_params=query_params, api_base_url=api_base_url, api_version=api_version) # Making the executive decision that any dictionary # data will be sent properly as JSON. if data and isinstance(data, dict): data = json.dumps(data) content_type = 'application/json' response, content = self._make_request( method=method, url=url, data=data, content_type=content_type, target_object=_target_object) if not 200 <= response.status < 300: raise make_exception(response, content, error_info=method + ' ' + url) string_or_bytes = (six.binary_type, six.text_type) if content and expect_json and isinstance(content, string_or_bytes): content_type = response.get('content-type', '') if not content_type.startswith('application/json'): raise TypeError('Expected JSON, got %s' % content_type) if isinstance(content, six.binary_type): content = content.decode('utf-8') return json.loads(content) return content
thonkify/thonkify
src/lib/gcloud/connection.py
Python
mit
12,949
/** ***************************************************************************** * @file client.c * @author Yue Wang 12027710 * @version V0.0.3 * @date 03-Oct-2013 * @brief ****************************************************************************** * */ /* Includes ------------------------------------------------------------------*/ #include <windows.h> #include <stdio.h> #include <stdlib.h> #include <winsock.h> #include "UDP_supporting_functions_2013.c" /* MACRO ---------------------------------------------------------------------*/ #define WSVERS MAKEWORD(2,0) #define BUFFESIZE 80 #define SEGMENTSIZE 78 #define GENERATOR 0x8005 //0x8005, generator for polynomial division /* VARIABLES-------------------------------------------------------------------*/ WSADATA wsadata; struct sockaddr_in localaddr,remoteaddr; //segment size, i.e., if fgets gets more than this number of bytes is segments the message in smaller parts. /* Prototype-------------------------------------------------------------------*/ unsigned int CRCpolynomial(char *buffer); /* MAIN------------------------------------------------------------------------*/ int main(int argc, char *argv[]) { // WSSTARTUP if (WSAStartup(WSVERS, &wsadata) != 0) { WSACleanup(); printf("WSAStartup failed\n"); } // Initialization memset(&localaddr, 0, sizeof(localaddr));//clean up int localPort=1234; localaddr.sin_family = AF_INET; localaddr.sin_addr.s_addr = INADDR_ANY;//server address should be local localaddr.sin_port = htons(localPort); memset(&remoteaddr, 0, sizeof(remoteaddr));//clean up randominit(); SOCKET s; char send_buffer[BUFFESIZE],receive_buffer[BUFFESIZE]; remoteaddr.sin_family = AF_INET; // Dealing with user's arguments if (argc != 5) { printf("2011 code USAGE: client remote_IP-address port lossesbit(0 or 1) damagebit(0 or 1)\n"); exit(1); } remoteaddr.sin_addr.s_addr = inet_addr(argv[1]);//IP address remoteaddr.sin_port = htons((u_short)atoi(argv[2]));//always get the port number packets_lostbit=atoi(argv[3]); packets_damagedbit=atoi(argv[4]); if (packets_damagedbit<0 || packets_damagedbit>1 || packets_lostbit<0 || packets_lostbit>1) { printf("2011 code USAGE: client remote_IP-address port lossesbit(0 or 1) damagebit(0 or 1)\n"); exit(0); } //CREATE CLIENT'S SOCKET s = socket(AF_INET, SOCK_DGRAM, 0);//this is a UDP socket if (s < 0) { printf("socket failed\n"); exit(1); } //NONBLOCKING OPTION for Windows u_long iMode=1; ioctlsocket(s,FIONBIO,&iMode); //Open A TEXT FILE int counter=0;//sequence of packets int ackcounter=0; char temp_buffer[BUFFESIZE]; char CRC_str[BUFFESIZE]; FILE *fin=fopen("file1_Windows.txt","r"); if(fin==NULL) { printf("cannot open file\n"); exit(0); } while (1) { memset(send_buffer, 0, sizeof(send_buffer));//clean up the send_buffer before reading the next line fgets(send_buffer,SEGMENTSIZE,fin); if (!feof(fin)) { //add a headert to the packet with the sequence number sprintf(temp_buffer,"PACKET %d ",counter); counter++; strcat(temp_buffer,send_buffer); strcpy(send_buffer,temp_buffer); //---------coding------- temp_buffer[strlen(temp_buffer)-1] = 0; sprintf(CRC_str,"%d ",CRCpolynomial(temp_buffer)); strcat(CRC_str,send_buffer); strcpy(send_buffer, CRC_str); //---------------------- send_unreliably(s,send_buffer, remoteaddr); Sleep(1000); //RECEIVE memset(receive_buffer, 0, sizeof(receive_buffer)); recv_nonblocking(s,receive_buffer, remoteaddr);//you can replace this, but use MSG_DONTWAIT to get non-blocking recv printf("RECEIVE --> %s \n",receive_buffer); Sleep(1000); } else { printf("end of the file \n"); memset(send_buffer, 0, sizeof(send_buffer)); sprintf(send_buffer,"CLOSE \r\n"); send_unreliably(s,send_buffer,remoteaddr);//we actually send this reliably, read UDP_supporting_functions_2012.c break; } } //CLOSESOCKET printf("closing everything on the client's side ... \n"); fclose(fin); closesocket(s); exit(0); } /* Function definitions ------------------------------------------------------*/ unsigned int CRCpolynomial(char *buffer){ unsigned char i; unsigned int rem=0x0000; int bufsize=strlen((char*)buffer); while(bufsize--!=0){ for(i=0x80;i!=0;i/=2){ if((rem&0x8000)!=0){ rem=rem<<1; rem^=GENERATOR; } else{ rem=rem<<1; } if((*buffer&i)!=0){ rem^=GENERATOR; } } buffer++; } rem=rem&0xffff; return rem; }
Mooophy/159334
src/As2/c0.0.3/client_Unreliable_2013.c
C
mit
4,638
<html> <head></head> <body> <h1>Hello, World! (Very Original ;^) )</h1> <br> <b>Sample coming from Ruby</b> </body> </html>
alainbloch/vertical-response
examples/message_content.html
HTML
mit
124
package page import ( "io/ioutil" "github.com/russross/blackfriday" ) type Page struct { src string dst string input_file string head_file string foot_file string template []byte content []byte html []byte } type PageError struct { s string } func (e *PageError) Error() string { return e.s } func NewError(text string) error { return &PageError{text} } func New(src string, dst string, input_file string, tpl []byte, cnt []byte, h []byte) (error, Page) { p := Page{"", "", "", []byte(``), []byte(``), []byte(``)} p.src = src p.dst = dst p.input_file = input_file p.template = tpl p.content = cnt p.html = h return nil, p } func (page *Page) LoadTemplate() error { dat, err := ioutil.ReadFile(page.src + page.input_file) if err != nil { panic(err) } page.template = dat return nil } func (page *Page) Compile() error { page.content = blackfriday.MarkdownBasic(page.template) return nil } func (page *Page) Build() error { //page.html = page.head + page.content + page.foot page.html = page.content return nil } func (page *Page) Output() error { err := ioutil.WriteFile(page.dst, page.html, 0644) if err != nil { panic(err) } return nil }
crispgm/sinister
page/page.go
GO
mit
1,309
using System; using System.Collections.Generic; using System.Text; namespace NetOffice.DeveloperToolbox.Controls.Hex { /// <summary> /// The interface for objects that can translate between characters and bytes. /// </summary> public interface IByteCharConverter { /// <summary> /// Returns the character to display for the byte passed across. /// </summary> /// <param name="b"></param> /// <returns></returns> char ToChar(byte b); /// <summary> /// Returns the byte to use when the character passed across is entered during editing. /// </summary> /// <param name="c"></param> /// <returns></returns> byte ToByte(char c); } /// <summary> /// The default <see cref="IByteCharConverter"/> implementation. /// </summary> public class DefaultByteCharConverter : IByteCharConverter { /// <summary> /// Returns the character to display for the byte passed across. /// </summary> /// <param name="b"></param> /// <returns></returns> public virtual char ToChar(byte b) { return b > 0x1F && !(b > 0x7E && b < 0xA0) ? (char)b : '.'; } /// <summary> /// Returns the byte to use for the character passed across. /// </summary> /// <param name="c"></param> /// <returns></returns> public virtual byte ToByte(char c) { return (byte)c; } /// <summary> /// Returns a description of the byte char provider. /// </summary> /// <returns></returns> public override string ToString() { return ""; } } /// <summary> /// A byte char provider that can translate bytes encoded in codepage 500 EBCDIC /// </summary> public class EbcdicByteCharProvider : IByteCharConverter { /// <summary> /// The IBM EBCDIC code page 500 encoding. Note that this is not always supported by .NET, /// the underlying platform has to provide support for it. /// </summary> private Encoding _ebcdicEncoding = Encoding.GetEncoding(500); /// <summary> /// Returns the EBCDIC character corresponding to the byte passed across. /// </summary> /// <param name="b"></param> /// <returns></returns> public virtual char ToChar(byte b) { string encoded = _ebcdicEncoding.GetString(new byte[] { b }); return encoded.Length > 0 ? encoded[0] : '.'; } /// <summary> /// Returns the byte corresponding to the EBCDIC character passed across. /// </summary> /// <param name="c"></param> /// <returns></returns> public virtual byte ToByte(char c) { byte[] decoded = _ebcdicEncoding.GetBytes(new char[] { c }); return decoded.Length > 0 ? decoded[0] : (byte)0; } /// <summary> /// Returns a description of the byte char provider. /// </summary> /// <returns></returns> public override string ToString() { return "EBCDIC (Code Page 500)"; } } }
NetOfficeFw/NetOffice
Toolbox/Toolbox/Controls/Hex/ByteCharConverters.cs
C#
mit
3,266
//Author: Stefan Toman #include <iostream> #include <string> using namespace std; int main() { ios::sync_with_stdio(false); int t; cin >> t; for(int i = 1; i <= t; i++) { string s; cin >> s; int firstb = -1; for(int j = 0; j < s.size() - 1 && firstb == -1; j++) { if(s[j] > s[j+1]) firstb = j; } if(firstb >= 0) { s[firstb]--; for(int k = firstb + 1; k < s.size(); k++) s[k] = '9'; for(int k = firstb - 1; k >= 0; k--) { if(s[k] > s[k+1]) { s[k]--; s[k+1] = '9'; } } while(s[0] == '0') s.erase(0, 1); } cout << "Case #" << i << ": " << s << endl; } return 0; }
stoman/CompetitiveProgramming
problems/tidynumbers/submissions/accepted/stefan.cpp
C++
mit
624
The Bebop.jl package is licensed under the MIT Expat License: > Copyright (c) 2014: Howard Mao. > > 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.
ivarne/Bebop.jl
LICENSE.md
Markdown
mit
1,156
module Util.Safe ( runWithFiles ) where import Pipes.Safe (runSafeT) import Pipes.Safe.Prelude (withFile) import Universum hiding (withFile) runWithFile :: (MonadIO m, MonadMask m) => FilePath -> IOMode -> (Handle -> m r) -> m r runWithFile fp mode f = runSafeT $ withFile fp mode $ lift . f runWithFiles :: (MonadIO m, MonadMask m) => [(a, FilePath)] -> IOMode -> ([(a, Handle)]-> m r) -> m r runWithFiles [] _ f = f [] runWithFiles ((a, fp) : xs) mode f = runWithFile fp mode $ \h -> runWithFiles xs mode $ \ys -> f $ (a, h) : ys
input-output-hk/pos-haskell-prototype
tools/post-mortem/src/Util/Safe.hs
Haskell
mit
594
/** * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ // this is a separate file so it can be mocked in tests export {loadPartialConfig, loadPartialConfigAsync} from '@babel/core';
facebook/jest
packages/babel-jest/src/loadBabelConfig.ts
TypeScript
mit
338
<ion-modal-view> <ion-header-bar class="bar bar-header bar-positive"> <h1 class="title">GROUP CLOSED!</h1> <button class="button button-clear button-primary" ng-click="closeGroupConfirmationModal.hide()">Cancel</button> </ion-header-bar> <ion-content class="padding"> <ion-list> <ion-item ng-click="ok()" ng-tap="ok()" align="center"> OK </ion-item> </ion-list> </ion-content> </ion-modal-view>
tlkiong/m-apal
www/templates/common/closeGroupModal.html
HTML
mit
482
using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; using System.Xml.Linq; using System.IO; using System.Reflection; using Duality; namespace Duality.Editor { public class XmlCodeDoc { private static readonly char[] MemberNameSep = "{[(".ToCharArray(); public enum EntryType { Unknown, Type, Field, Property, Event, Method, Constructor } public class Entry { private EntryType type; private string typeName; private string memberName; private string summary; private string remarks; public EntryType EntryType { get { return this.type; } } public string TypeName { get { return this.typeName; } } public string MemberName { get { return this.memberName; } } public Type Type { get { return ReflectionHelper.ResolveType(this.typeName); } } public MemberInfo Member { get { return ReflectionHelper.ResolveMember(this.memberName); } } public string Summary { get { return this.summary; } set { this.summary = value; } } public string Remarks { get { return this.remarks; } set { this.remarks = value; } } private Entry(EntryType type, string typeName, string memberName) { this.type = type; this.typeName = typeName; this.memberName = memberName; } public Entry(Entry other) { this.type = other.type; this.typeName = other.typeName; this.memberName = other.memberName; this.summary = other.summary; this.remarks = other.remarks; } public static Entry Create(MemberInfo member) { EntryType entryType; if (member is Type) entryType = EntryType.Type; else if (member is FieldInfo) entryType = EntryType.Field; else if (member is PropertyInfo) entryType = EntryType.Property; else if (member is MethodInfo) entryType = EntryType.Method; else if (member is ConstructorInfo) entryType = EntryType.Constructor; else if (member is EventInfo) entryType = EntryType.Event; else entryType = EntryType.Unknown; if (member is Type) return new Entry(entryType, (member as Type).GetTypeId(), member.GetMemberId()); else if (member != null) return new Entry(entryType, member.DeclaringType.GetTypeId(), member.GetMemberId()); else return null; } } private Dictionary<string,Entry> entries = new Dictionary<string,Entry>(); public XmlCodeDoc() { } public XmlCodeDoc(Stream str) { this.LoadFromStream(str); } public XmlCodeDoc(string file) { this.LoadFromFile(file); } public void LoadFromFile(string file) { using (FileStream str = File.OpenRead(file)) { this.LoadFromStream(str); } } public void LoadFromStream(Stream str) { StreamReader reader = new StreamReader(str); this.LoadFromXml(reader.ReadToEnd()); } public void LoadFromXml(string xml) { this.Clear(); XDocument xmlDoc = XDocument.Parse(xml); XElement assemblyNode = xmlDoc.Descendants("assembly").FirstOrDefault(); XElement assemblyNameNode = assemblyNode != null ? assemblyNode.Element("name") : null; string assemblyName = assemblyNameNode != null ? assemblyNameNode.Value : null; XElement memberNode = xmlDoc.Descendants("members").FirstOrDefault(); foreach (XElement child in memberNode.Elements()) { XAttribute memberNameAttrib = child.Attribute("name"); if (memberNameAttrib == null) continue; // Create a member entry based on the determined data. MemberInfo member = ResolveDocStyleMember(memberNameAttrib.Value); if (member != null) { Entry memberEntry = Entry.Create(member); XElement summaryNode = child.Element("summary"); XElement remarksNode = child.Element("remarks"); if (summaryNode != null) { string summary = summaryNode.Value; summary = Regex.Replace(summary, "[\n\r\t\\s]+", " ", RegexOptions.Multiline); summary = Regex.Replace(summary, "<c>(.*?)<\\/c>", m => m.Groups[1].Value.Trim('"')); summary = Regex.Replace(summary, "<code>(.*?)<\\/code>", m => m.Groups[1].Value.Trim('"')); summary = Regex.Replace(summary, "<see cref=(\"[^\"]*\")>(.*?)<\\/see>", m => m.Groups[2].Value.Trim('"')); summary = Regex.Replace(summary, "<see cref=(\"[^\"]*\")\\s/>", delegate(Match m) { MemberInfo info = ResolveDocStyleMember(m.Groups[1].Value.Trim('"')); return info != null ? info.Name : m.Groups[1].Value; }); summary = Regex.Replace(summary, "[ ]{2,}", " "); memberEntry.Summary = summary.Trim(); } if (remarksNode != null) { string remarks = remarksNode.Value; remarks = Regex.Replace(remarks, "[\n\r\t\\s]+", " ", RegexOptions.Multiline); remarks = Regex.Replace(remarks, "<c>(.*?)<\\/c>", m => m.Groups[1].Value.Trim('"')); remarks = Regex.Replace(remarks, "<code>(.*?)<\\/code>", m => m.Groups[1].Value.Trim('"')); remarks = Regex.Replace(remarks, "<see cref=(\"[^\"]*\")>(.*?)<\\/see>", m => m.Groups[2].Value.Trim('"')); remarks = Regex.Replace(remarks, "<see cref=(\"[^\"]*\")\\s/>", delegate(Match m) { MemberInfo info = ResolveDocStyleMember(m.Groups[1].Value.Trim('"')); return info != null ? info.Name : m.Groups[1].Value; }); remarks = Regex.Replace(remarks, "[ ]{2,}", " "); memberEntry.Remarks = remarks.Trim(); } this.AddEntry(memberEntry); } } } public void Clear() { this.entries.Clear(); } public void AddEntry(Entry entry) { this.entries[entry.MemberName] = entry; } public void AppendDoc(XmlCodeDoc other) { foreach (var pair in other.entries) this.AddEntry(new Entry(pair.Value)); } public Entry GetMemberDoc(MemberInfo info) { if (info == null) return null; Entry result; if (!this.entries.TryGetValue(info.GetMemberId(), out result)) return null; return result; } private static MemberInfo ResolveDocStyleMember(string docId) { // Conversion operator syntax not supported yet if (docId.Contains('~')) return null; // Determine entry type EntryType memberEntryType; switch (docId[0]) { case 'M': memberEntryType = EntryType.Method; break; case 'T': memberEntryType = EntryType.Type; break; case 'F': memberEntryType = EntryType.Field; break; case 'P': memberEntryType = EntryType.Property; break; case 'E': memberEntryType = EntryType.Event; break; default: memberEntryType = EntryType.Unknown; return null; } // Determine member name and its (Declaring) type name string memberName; string memberTypeName; if (memberEntryType == EntryType.Type) { memberName = memberTypeName = docId.Remove(0, 2); } else { int memberNameSepIndex = docId.IndexOfAny(MemberNameSep); int lastDotIndex = memberNameSepIndex != -1 ? docId.LastIndexOf('.', memberNameSepIndex) : docId.LastIndexOf('.'); memberTypeName = docId.Substring(2, lastDotIndex - 2); memberName = docId.Substring(lastDotIndex + 1, docId.Length - lastDotIndex - 1); } // Determine the members (declaring) type Type memberType = ResolveDocStyleType(memberTypeName); if (memberType == null) return null; // Determine the member info MemberInfo member = null; if (memberEntryType == EntryType.Type) member = memberType; else if (memberEntryType == EntryType.Field) member = memberType.GetField(memberName, ReflectionHelper.BindAll); else if (memberEntryType == EntryType.Event) member = memberType.GetEvent(memberName, ReflectionHelper.BindAll); else if (memberEntryType == EntryType.Property) { string methodName; Type[] paramTypes; int paramIndex = memberName.IndexOf('('); if (paramIndex != -1) { methodName = memberName.Substring(0, paramIndex); string paramList = memberName.Substring(paramIndex + 1, memberName.Length - paramIndex - 2); string[] paramTypeNames = paramList.Split(','); paramTypes = new Type[paramTypeNames.Length]; for (int i = 0; i < paramTypeNames.Length; i++) { bool isByRef = false; if (paramTypeNames[i].EndsWith("@")) { // ref / out parameter paramTypeNames[i] = paramTypeNames[i].Remove(paramTypeNames[i].Length - 1); isByRef = true; } paramTypes[i] = ResolveDocStyleType(paramTypeNames[i]); if (isByRef && paramTypes[i] != null) paramTypes[i] = paramTypes[i].MakeByRefType(); } } else { methodName = memberName; paramTypes = Type.EmptyTypes; } member = memberType.GetProperty(methodName, ReflectionHelper.BindAll, null, null, paramTypes, null); } else if (memberEntryType == EntryType.Method) { string methodName; string[] paramTypeNames; int paramIndex = memberName.IndexOf('('); if (paramIndex != -1) { methodName = memberName.Substring(0, paramIndex); string paramList = memberName.Substring(paramIndex + 1, memberName.Length - paramIndex - 2); paramTypeNames = SplitGenArgs(paramList); } else { methodName = memberName; paramTypeNames = new string[0]; } // Determine parameter types Type[] paramTypes = new Type[paramTypeNames.Length]; bool[] paramTypeByRef = new bool[paramTypeNames.Length]; for (int i = 0; i < paramTypeNames.Length; i++) { paramTypeByRef[i] = false; if (paramTypeNames[i].EndsWith("@")) { // ref / out parameter paramTypeNames[i] = paramTypeNames[i].Remove(paramTypeNames[i].Length - 1); paramTypeByRef[i] = true; } if (paramTypeNames[i][0] == '`' && paramTypeNames[i][1] != '`') { int typeGenArgIndex = 0; int.TryParse(paramTypeNames[i].Substring(1, paramTypeNames[i].Length - 1), out typeGenArgIndex); paramTypes[i] = memberType.GetGenericArguments()[typeGenArgIndex]; } else if (paramTypeNames[i].StartsWith("``")) paramTypes[i] = null; else paramTypes[i] = ResolveDocStyleType(paramTypeNames[i]); if (paramTypeByRef[i] && paramTypes[i] != null) paramTypes[i] = paramTypes[i].MakeByRefType(); } if (methodName == "#ctor") memberEntryType = EntryType.Constructor; if (memberEntryType == EntryType.Constructor) { member = memberType.GetConstructor(paramTypes); } else { int genMethodArgDeclIndex = methodName.IndexOf("``", System.StringComparison.Ordinal); int genMethodArgs = 0; if (genMethodArgDeclIndex != -1) { genMethodArgs = int.Parse(methodName.Substring(genMethodArgDeclIndex + 2, methodName.Length - genMethodArgDeclIndex - 2)); methodName = methodName.Remove(genMethodArgDeclIndex); } MethodInfo[] availMethods = memberType.GetMethods(ReflectionHelper.BindAll).Where( m => m.Name == methodName && m.GetGenericArguments().Length == genMethodArgs && m.GetParameters().Length == paramTypes.Length).ToArray(); // Select the method that fits foreach (MethodInfo method in availMethods) { bool possibleMatch = true; ParameterInfo[] methodParams = method.GetParameters(); for (int i = 0; i < methodParams.Length; i++) { // Generic method param if (paramTypes[i] == null) { Type genMethodParam = ResolveDocStyleType(paramTypeNames[i], method); if (paramTypeByRef[i] && genMethodParam != null) genMethodParam = genMethodParam.MakeByRefType(); if (genMethodParam != methodParams[i].ParameterType) { possibleMatch = false; break; } } // Some other param else if (methodParams[i].ParameterType != paramTypes[i]) { possibleMatch = false; break; } } if (possibleMatch) { member = method; break; } } } } return member; } private static Type ResolveDocStyleType(string typeString, MethodInfo declaringMethod = null) { return ReflectionHelper.ResolveType(ConvertFromDocStyleType(typeString), false, declaringMethod); } private static string ConvertFromDocStyleType(string typeString) { int genArgStartIndex = typeString.IndexOf('{'); int genArgEndIndex = typeString.LastIndexOf('}'); if (genArgStartIndex != -1) { string genArgList = typeString.Substring(genArgStartIndex + 1, genArgEndIndex - genArgStartIndex - 1); string[] genArgStrings = SplitGenArgs(genArgList); typeString = typeString.Substring(0, genArgStartIndex) + "`" + genArgStrings.Length + "[" + genArgStrings.ToString(s => "[" + ConvertFromDocStyleType(s) + "]", ",") + "]" + typeString.Substring(genArgEndIndex + 1, typeString.Length - genArgEndIndex - 1); } return typeString; } private static string[] SplitGenArgs(string paramList) { return ReflectionHelper.SplitArgs(paramList, '{', '}', ',', 0); } } }
Andrea/duality
DualityEditor/Helpers/XmlCodeDoc.cs
C#
mit
13,384
<?php /* FcpSiteBundle:Fixture/admin:admin.html.twig */ class __TwigTemplate_afeb5711fc57ac9052e617730a01f1ae extends Twig_Template { public function __construct(Twig_Environment $env) { parent::__construct($env); $this->parent = $this->env->loadTemplate("::base.html.twig"); $this->blocks = array( 'body' => array($this, 'block_body'), 'javascripts' => array($this, 'block_javascripts'), ); } protected function doGetParent(array $context) { return "::base.html.twig"; } protected function doDisplay(array $context, array $blocks = array()) { $this->parent->display($context, array_merge($this->blocks, $blocks)); } // line 3 public function block_body($context, array $blocks = array()) { // line 4 $this->displayParentBlock("body", $context, $blocks); echo " <div class=\"row\"> <div class=\"twelve columns\"> <div class=\"warning alert mobile\"> Het administrator paneel is niet gebouwd om gebruikt te worden op kleine toestellen zoals een smartphone. Voor een optimale ervaring, beheer je de website best via een tablet of PC. </div> <h2>Wedstrijden</h2> <div style=\"float: right\" class=\"medium danger btn\"><a href=\""; // line 11 echo twig_escape_filter($this->env, $this->env->getExtension('routing')->getPath("admin_fixture_create"), "html", null, true); echo "\">Wedstrijd toevoegen</a></div> <p>In het wedstrijd administatie paneel kan je nieuwe wedstrijden toevoegen, bewerken en verwijderen. Gebruik de tool-icoontjes om de gewenste actie uit te voeren.</p> <table class=\"records_list\"> <thead> <tr> <th width=\"50\">ID</th> <th width=\"120\">Thuisploeg</th> <th width=\"120\">Uitploeg</th> <th width=\"170\">Locatie</th> <th>Datum</th> <th>Score</th> <th>Scheidsrechter</th> <th>Verslag</th> <th>Tools</th> </tr> </thead> <tbody> "; // line 29 $context['_parent'] = (array) $context; $context['_seq'] = twig_ensure_traversable($this->getContext($context, "fixtures")); foreach ($context['_seq'] as $context["_key"] => $context["fixture"]) { // line 30 echo " <tr> <td>"; // line 31 echo twig_escape_filter($this->env, $this->getAttribute($this->getContext($context, "fixture"), "id"), "html", null, true); echo "</td> <td>"; // line 32 echo twig_escape_filter($this->env, $this->getAttribute($this->getContext($context, "fixture"), "homeTeam"), "html", null, true); echo "</td> <td>"; // line 33 echo twig_escape_filter($this->env, $this->getAttribute($this->getContext($context, "fixture"), "awayTeam"), "html", null, true); echo "</td> <td>"; // line 34 echo twig_escape_filter($this->env, $this->getAttribute($this->getContext($context, "fixture"), "location"), "html", null, true); echo "</td> <td>"; // line 35 if ($this->getAttribute($this->getContext($context, "fixture"), "scheduledDate")) { echo twig_escape_filter($this->env, twig_date_format_filter($this->env, $this->getAttribute($this->getContext($context, "fixture"), "scheduledDate"), "d-m-Y H:i"), "html", null, true); } echo "</td> <td>"; // line 36 echo twig_escape_filter($this->env, $this->getAttribute($this->getContext($context, "fixture"), "homeScore"), "html", null, true); echo " - "; echo twig_escape_filter($this->env, $this->getAttribute($this->getContext($context, "fixture"), "awayScore"), "html", null, true); echo "</td> <td>"; // line 37 echo twig_escape_filter($this->env, $this->getAttribute($this->getContext($context, "fixture"), "refereeName"), "html", null, true); echo "</td> <td>"; // line 38 if ($this->getAttribute($this->getContext($context, "fixture", true), "reportArticle", array(), "any", true, true)) { echo " "; echo "V"; echo " "; } else { echo " "; echo "X"; echo " "; } echo "</td> <td> <div clas=\"row\"> <div class=\"four columns\"> <a href=\""; // line 42 echo twig_escape_filter($this->env, $this->env->getExtension('routing')->getPath("fixture_show", array("id" => $this->getAttribute($this->getContext($context, "fixture"), "id"))), "html", null, true); echo "\" title=\"Toon wedstrijd\"><i class=\"icon-eye\"></i></a> </div> <div class=\"four columns\"> <a href=\""; // line 45 echo twig_escape_filter($this->env, $this->env->getExtension('routing')->getPath("admin_fixture_edit", array("id" => $this->getAttribute($this->getContext($context, "fixture"), "id"))), "html", null, true); echo "\" title=\"Bewerk wedstrijd\"><i class=\"icon-pencil\"></i></a> </div> <div class=\"four columns\"> <a style=\"cursor: pointer\" title=\"Verwijder wedstrijd\"><i class=\"icon-trash\" onclick=\"confirmDelete('"; // line 48 echo twig_escape_filter($this->env, $this->getAttribute($this->getContext($context, "fixture"), "homeTeam"), "html", null, true); echo " - "; echo twig_escape_filter($this->env, $this->getAttribute($this->getContext($context, "fixture"), "awayTeam"), "html", null, true); echo "', '"; echo twig_escape_filter($this->env, $this->getAttribute($this->getContext($context, "fixture"), "id"), "html", null, true); echo "')\"></i></a> </div> </div> </td> </tr> "; } $_parent = $context['_parent']; unset($context['_seq'], $context['_iterated'], $context['_key'], $context['fixture'], $context['_parent'], $context['loop']); $context = array_merge($_parent, array_intersect_key($context, $_parent)); // line 54 echo " </tbody> </table> "; } // line 57 public function block_javascripts($context, array $blocks = array()) { // line 58 echo " "; $this->displayParentBlock("javascripts", $context, $blocks); echo " <script> function confirmDelete(fixtureName, fixtureId) { if(confirm('Weet je zeker dat je ' + fixtureName + ' wilt verwijderen?')) { \$.ajax({ url: \""; // line 63 echo twig_escape_filter($this->env, $this->env->getExtension('routing')->getPath("admin_fixture_delete"), "html", null, true); echo "\", type: \"POST\", data: { \"fixture_id\" : fixtureId }, success: function(data) { location.reload(true); } }); } } </script> "; } public function getTemplateName() { return "FcpSiteBundle:Fixture/admin:admin.html.twig"; } public function isTraitable() { return false; } public function getDebugInfo() { return array ( 163 => 63, 154 => 58, 151 => 57, 145 => 54, 129 => 48, 123 => 45, 117 => 42, 102 => 38, 98 => 37, 92 => 36, 86 => 35, 82 => 34, 78 => 33, 74 => 32, 70 => 31, 67 => 30, 63 => 29, 42 => 11, 32 => 4, 29 => 3,); } }
NicolasVH/FCPruisens
app/cache/dev_old/twig/af/eb/5711fc57ac9052e617730a01f1ae.php
PHP
mit
8,343
/// Copyright (c) 2009 Microsoft Corporation /// /// Redistribution and use in source and binary forms, with or without modification, are permitted provided /// that the following conditions are met: /// * Redistributions of source code must retain the above copyright notice, this list of conditions and /// the following disclaimer. /// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and /// the following disclaimer in the documentation and/or other materials provided with the distribution. /// * Neither the name of Microsoft nor the names of its contributors may be used to /// endorse or promote products derived from this software without specific prior written permission. /// /// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR /// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS /// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE /// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT /// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS /// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, /// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF /// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ES5Harness.registerTest( { id: "15.2.3.4-4-29", path: "TestCases/chapter15/15.2/15.2.3/15.2.3.4/15.2.3.4-4-29.js", description: "Object.getOwnPropertyNames returns array of property names (Error)", test: function testcase() { var result = Object.getOwnPropertyNames(Error); var expResult = ["prototype", "length"]; if (compareArray(expResult, result)) { return true; } }, precondition: function prereq() { return fnExists(Object.getOwnPropertyNames); } });
techdragon/Js2Py
tests/TestCases/chapter15/15.2/15.2.3/15.2.3.4/15.2.3.4-4-29.js
JavaScript
mit
2,038
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en_US" lang="en_US"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Qt 4.8: audiodevicesbase.ui Example File (multimedia/audiodevices/audiodevicesbase.ui)</title> <link rel="stylesheet" type="text/css" href="style/style.css" /> <script src="scripts/jquery.js" type="text/javascript"></script> <script src="scripts/functions.js" type="text/javascript"></script> <link rel="stylesheet" type="text/css" href="style/superfish.css" /> <link rel="stylesheet" type="text/css" href="style/narrow.css" /> <!--[if IE]> <meta name="MSSmartTagsPreventParsing" content="true"> <meta http-equiv="imagetoolbar" content="no"> <![endif]--> <!--[if lt IE 7]> <link rel="stylesheet" type="text/css" href="style/style_ie6.css"> <![endif]--> <!--[if IE 7]> <link rel="stylesheet" type="text/css" href="style/style_ie7.css"> <![endif]--> <!--[if IE 8]> <link rel="stylesheet" type="text/css" href="style/style_ie8.css"> <![endif]--> <script src="scripts/superfish.js" type="text/javascript"></script> <script src="scripts/narrow.js" type="text/javascript"></script> </head> <body class="" onload="CheckEmptyAndLoadList();"> <div class="header" id="qtdocheader"> <div class="content"> <div id="nav-logo"> <a href="index.html">Home</a></div> <a href="index.html" class="qtref"><span>Qt Reference Documentation</span></a> <div id="narrowsearch"></div> <div id="nav-topright"> <ul> <li class="nav-topright-home"><a href="http://qt.digia.com/">Qt HOME</a></li> <li class="nav-topright-dev"><a href="http://qt-project.org/">DEV</a></li> <li class="nav-topright-doc nav-topright-doc-active"><a href="http://qt-project.org/doc/"> DOC</a></li> <li class="nav-topright-blog"><a href="http://blog.qt.digia.com/">BLOG</a></li> </ul> </div> <div id="shortCut"> <ul> <li class="shortCut-topleft-inactive"><span><a href="index.html">Qt 4.8</a></span></li> <li class="shortCut-topleft-active"><a href="http://qt-project.org/doc/">ALL VERSIONS </a></li> </ul> </div> <ul class="sf-menu" id="narrowmenu"> <li><a href="#">API Lookup</a> <ul> <li><a href="classes.html">Class index</a></li> <li><a href="functions.html">Function index</a></li> <li><a href="modules.html">Modules</a></li> <li><a href="namespaces.html">Namespaces</a></li> <li><a href="qtglobal.html">Global Declarations</a></li> <li><a href="qdeclarativeelements.html">QML elements</a></li> </ul> </li> <li><a href="#">Qt Topics</a> <ul> <li><a href="qt-basic-concepts.html">Programming with Qt</a></li> <li><a href="qtquick.html">Device UIs &amp; Qt Quick</a></li> <li><a href="qt-gui-concepts.html">UI Design with Qt</a></li> <li><a href="supported-platforms.html">Supported Platforms</a></li> <li><a href="technology-apis.html">Qt and Key Technologies</a></li> <li><a href="best-practices.html">How-To's and Best Practices</a></li> </ul> </li> <li><a href="#">Examples</a> <ul> <li><a href="all-examples.html">Examples</a></li> <li><a href="tutorials.html">Tutorials</a></li> <li><a href="demos.html">Demos</a></li> <li><a href="qdeclarativeexamples.html">QML Examples</a></li> </ul> </li> </ul> </div> </div> <div class="wrapper"> <div class="hd"> <span></span> </div> <div class="bd group"> <div class="sidebar"> <div class="searchlabel"> Search index:</div> <div class="search" id="sidebarsearch"> <form id="qtdocsearch" action="" onsubmit="return false;"> <fieldset> <input type="text" name="searchstring" id="pageType" value="" /> <div id="resultdialog"> <a href="#" id="resultclose">Close</a> <p id="resultlinks" class="all"><a href="#" id="showallresults">All</a> | <a href="#" id="showapiresults">API</a> | <a href="#" id="showarticleresults">Articles</a> | <a href="#" id="showexampleresults">Examples</a></p> <p id="searchcount" class="all"><span id="resultcount"></span><span id="apicount"></span><span id="articlecount"></span><span id="examplecount"></span>&nbsp;results:</p> <ul id="resultlist" class="all"> </ul> </div> </fieldset> </form> </div> <div class="box first bottombar" id="lookup"> <h2 title="API Lookup"><span></span> API Lookup</h2> <div id="list001" class="list"> <ul id="ul001" > <li class="defaultLink"><a href="classes.html">Class index</a></li> <li class="defaultLink"><a href="functions.html">Function index</a></li> <li class="defaultLink"><a href="modules.html">Modules</a></li> <li class="defaultLink"><a href="namespaces.html">Namespaces</a></li> <li class="defaultLink"><a href="qtglobal.html">Global Declarations</a></li> <li class="defaultLink"><a href="qdeclarativeelements.html">QML elements</a></li> </ul> </div> </div> <div class="box bottombar" id="topics"> <h2 title="Qt Topics"><span></span> Qt Topics</h2> <div id="list002" class="list"> <ul id="ul002" > <li class="defaultLink"><a href="qt-basic-concepts.html">Programming with Qt</a></li> <li class="defaultLink"><a href="qtquick.html">Device UIs &amp; Qt Quick</a></li> <li class="defaultLink"><a href="qt-gui-concepts.html">UI Design with Qt</a></li> <li class="defaultLink"><a href="supported-platforms.html">Supported Platforms</a></li> <li class="defaultLink"><a href="technology-apis.html">Qt and Key Technologies</a></li> <li class="defaultLink"><a href="best-practices.html">How-To's and Best Practices</a></li> </ul> </div> </div> <div class="box" id="examples"> <h2 title="Examples"><span></span> Examples</h2> <div id="list003" class="list"> <ul id="ul003"> <li class="defaultLink"><a href="all-examples.html">Examples</a></li> <li class="defaultLink"><a href="tutorials.html">Tutorials</a></li> <li class="defaultLink"><a href="demos.html">Demos</a></li> <li class="defaultLink"><a href="qdeclarativeexamples.html">QML Examples</a></li> </ul> </div> </div> </div> <div class="wrap"> <div class="toolbar"> <div class="breadcrumb toolblock"> <ul> <li class="first"><a href="index.html">Home</a></li> <!-- Breadcrumbs go here --> </ul> </div> <div class="toolbuttons toolblock"> <ul> <li id="smallA" class="t_button">A</li> <li id="medA" class="t_button active">A</li> <li id="bigA" class="t_button">A</li> <li id="print" class="t_button"><a href="javascript:this.print();"> <span>Print</span></a></li> </ul> </div> </div> <div class="content mainContent"> <h1 class="title">audiodevicesbase.ui Example File</h1> <span class="small-subtitle">multimedia/audiodevices/audiodevicesbase.ui</span> <!-- $$$multimedia/audiodevices/audiodevicesbase.ui-description --> <div class="descr"> <a name="details"></a> <pre class="cpp"> &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt; &lt;ui version=&quot;4.0&quot;&gt; &lt;class&gt;AudioDevicesBase&lt;/class&gt; &lt;widget class=&quot;QMainWindow&quot; name=&quot;AudioDevicesBase&quot;&gt; &lt;property name=&quot;geometry&quot;&gt; &lt;rect&gt; &lt;x&gt;0&lt;/x&gt; &lt;y&gt;0&lt;/y&gt; &lt;width&gt;679&lt;/width&gt; &lt;height&gt;598&lt;/height&gt; &lt;/rect&gt; &lt;/property&gt; &lt;property name=&quot;windowTitle&quot;&gt; &lt;string&gt;Audio Devices&lt;/string&gt; &lt;/property&gt; &lt;widget class=&quot;QWidget&quot; name=&quot;centralwidget&quot;&gt; &lt;layout class=&quot;QVBoxLayout&quot; name=&quot;verticalLayout&quot;&gt; &lt;item&gt; &lt;widget class=&quot;QScrollArea&quot; name=&quot;scrollArea&quot;&gt; &lt;property name=&quot;sizePolicy&quot;&gt; &lt;sizepolicy hsizetype=&quot;Expanding&quot; vsizetype=&quot;Expanding&quot;&gt; &lt;horstretch&gt;0&lt;/horstretch&gt; &lt;verstretch&gt;0&lt;/verstretch&gt; &lt;/sizepolicy&gt; &lt;/property&gt; &lt;property name=&quot;widgetResizable&quot;&gt; &lt;bool&gt;true&lt;/bool&gt; &lt;/property&gt; &lt;widget class=&quot;QWidget&quot; name=&quot;scrollAreaWidgetContents&quot;&gt; &lt;property name=&quot;geometry&quot;&gt; &lt;rect&gt; &lt;x&gt;0&lt;/x&gt; &lt;y&gt;0&lt;/y&gt; &lt;width&gt;659&lt;/width&gt; &lt;height&gt;558&lt;/height&gt; &lt;/rect&gt; &lt;/property&gt; &lt;layout class=&quot;QGridLayout&quot; name=&quot;gridLayout_4&quot;&gt; &lt;item row=&quot;0&quot; column=&quot;0&quot;&gt; &lt;layout class=&quot;QGridLayout&quot; name=&quot;gridLayout_2&quot;&gt; &lt;item row=&quot;0&quot; column=&quot;0&quot;&gt; &lt;widget class=&quot;QLabel&quot; name=&quot;modeLabel&quot;&gt; &lt;property name=&quot;text&quot;&gt; &lt;string&gt;Mode&lt;/string&gt; &lt;/property&gt; &lt;/widget&gt; &lt;/item&gt; &lt;item row=&quot;0&quot; column=&quot;1&quot;&gt; &lt;widget class=&quot;QLabel&quot; name=&quot;deviceLabel&quot;&gt; &lt;property name=&quot;text&quot;&gt; &lt;string&gt;Device&lt;/string&gt; &lt;/property&gt; &lt;/widget&gt; &lt;/item&gt; &lt;item row=&quot;1&quot; column=&quot;0&quot;&gt; &lt;widget class=&quot;QComboBox&quot; name=&quot;modeBox&quot;&gt; &lt;item&gt; &lt;property name=&quot;text&quot;&gt; &lt;string&gt;Input&lt;/string&gt; &lt;/property&gt; &lt;/item&gt; &lt;item&gt; &lt;property name=&quot;text&quot;&gt; &lt;string&gt;Output&lt;/string&gt; &lt;/property&gt; &lt;/item&gt; &lt;/widget&gt; &lt;/item&gt; &lt;item row=&quot;1&quot; column=&quot;1&quot;&gt; &lt;widget class=&quot;QComboBox&quot; name=&quot;deviceBox&quot;/&gt; &lt;/item&gt; &lt;item row=&quot;2&quot; column=&quot;0&quot; colspan=&quot;2&quot;&gt; &lt;widget class=&quot;QTabWidget&quot; name=&quot;tabWidget&quot;&gt; &lt;property name=&quot;currentIndex&quot;&gt; &lt;number&gt;0&lt;/number&gt; &lt;/property&gt; &lt;widget class=&quot;QWidget&quot; name=&quot;testFormatTab&quot;&gt; &lt;attribute name=&quot;title&quot;&gt; &lt;string&gt;Test format&lt;/string&gt; &lt;/attribute&gt; &lt;layout class=&quot;QGridLayout&quot; name=&quot;gridLayout&quot;&gt; &lt;item row=&quot;0&quot; column=&quot;1&quot;&gt; &lt;widget class=&quot;QLabel&quot; name=&quot;actualLabel&quot;&gt; &lt;property name=&quot;sizePolicy&quot;&gt; &lt;sizepolicy hsizetype=&quot;Preferred&quot; vsizetype=&quot;Fixed&quot;&gt; &lt;horstretch&gt;0&lt;/horstretch&gt; &lt;verstretch&gt;0&lt;/verstretch&gt; &lt;/sizepolicy&gt; &lt;/property&gt; &lt;property name=&quot;frameShape&quot;&gt; &lt;enum&gt;QFrame::NoFrame&lt;/enum&gt; &lt;/property&gt; &lt;property name=&quot;frameShadow&quot;&gt; &lt;enum&gt;QFrame::Plain&lt;/enum&gt; &lt;/property&gt; &lt;property name=&quot;text&quot;&gt; &lt;string&gt;&amp;lt;i&amp;gt;Actual Settings&amp;lt;/i&amp;gt;&lt;/string&gt; &lt;/property&gt; &lt;property name=&quot;textFormat&quot;&gt; &lt;enum&gt;Qt::RichText&lt;/enum&gt; &lt;/property&gt; &lt;property name=&quot;alignment&quot;&gt; &lt;set&gt;Qt::AlignCenter&lt;/set&gt; &lt;/property&gt; &lt;/widget&gt; &lt;/item&gt; &lt;item row=&quot;0&quot; column=&quot;2&quot;&gt; &lt;widget class=&quot;QLabel&quot; name=&quot;nearestLabel&quot;&gt; &lt;property name=&quot;sizePolicy&quot;&gt; &lt;sizepolicy hsizetype=&quot;Preferred&quot; vsizetype=&quot;Fixed&quot;&gt; &lt;horstretch&gt;0&lt;/horstretch&gt; &lt;verstretch&gt;0&lt;/verstretch&gt; &lt;/sizepolicy&gt; &lt;/property&gt; &lt;property name=&quot;frameShape&quot;&gt; &lt;enum&gt;QFrame::NoFrame&lt;/enum&gt; &lt;/property&gt; &lt;property name=&quot;frameShadow&quot;&gt; &lt;enum&gt;QFrame::Plain&lt;/enum&gt; &lt;/property&gt; &lt;property name=&quot;text&quot;&gt; &lt;string&gt;&amp;lt;!DOCTYPE HTML PUBLIC &amp;quot;-//W3C//DTD HTML 4.0//EN&amp;quot; &amp;quot;http://www.w3.org/TR/REC-html40/strict.dtd&amp;quot;&amp;gt; &amp;lt;html&amp;gt;&amp;lt;head&amp;gt;&amp;lt;meta name=&amp;quot;qrichtext&amp;quot; content=&amp;quot;1&amp;quot; /&amp;gt;&amp;lt;style type=&amp;quot;text/css&amp;quot;&amp;gt; p, li { white-space: pre-wrap; } &amp;lt;/style&amp;gt;&amp;lt;/head&amp;gt;&amp;lt;body style=&amp;quot; font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;&amp;quot;&amp;gt; &amp;lt;p style=&amp;quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot; font-style:italic;&amp;quot;&amp;gt;Nearest Settings&amp;lt;/span&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;&lt;/string&gt; &lt;/property&gt; &lt;property name=&quot;textFormat&quot;&gt; &lt;enum&gt;Qt::RichText&lt;/enum&gt; &lt;/property&gt; &lt;property name=&quot;alignment&quot;&gt; &lt;set&gt;Qt::AlignCenter&lt;/set&gt; &lt;/property&gt; &lt;/widget&gt; &lt;/item&gt; &lt;item row=&quot;3&quot; column=&quot;1&quot;&gt; &lt;widget class=&quot;QComboBox&quot; name=&quot;frequencyBox&quot;&gt; &lt;property name=&quot;sizePolicy&quot;&gt; &lt;sizepolicy hsizetype=&quot;Expanding&quot; vsizetype=&quot;Fixed&quot;&gt; &lt;horstretch&gt;0&lt;/horstretch&gt; &lt;verstretch&gt;0&lt;/verstretch&gt; &lt;/sizepolicy&gt; &lt;/property&gt; &lt;/widget&gt; &lt;/item&gt; &lt;item row=&quot;3&quot; column=&quot;2&quot;&gt; &lt;widget class=&quot;QLineEdit&quot; name=&quot;nearestFreq&quot;&gt; &lt;property name=&quot;enabled&quot;&gt; &lt;bool&gt;false&lt;/bool&gt; &lt;/property&gt; &lt;/widget&gt; &lt;/item&gt; &lt;item row=&quot;5&quot; column=&quot;1&quot;&gt; &lt;widget class=&quot;QComboBox&quot; name=&quot;channelsBox&quot;/&gt; &lt;/item&gt; &lt;item row=&quot;5&quot; column=&quot;2&quot;&gt; &lt;widget class=&quot;QLineEdit&quot; name=&quot;nearestChannel&quot;&gt; &lt;property name=&quot;enabled&quot;&gt; &lt;bool&gt;false&lt;/bool&gt; &lt;/property&gt; &lt;/widget&gt; &lt;/item&gt; &lt;item row=&quot;9&quot; column=&quot;1&quot;&gt; &lt;widget class=&quot;QComboBox&quot; name=&quot;sampleSizesBox&quot;/&gt; &lt;/item&gt; &lt;item row=&quot;9&quot; column=&quot;2&quot;&gt; &lt;widget class=&quot;QLineEdit&quot; name=&quot;nearestSampleSize&quot;&gt; &lt;property name=&quot;enabled&quot;&gt; &lt;bool&gt;false&lt;/bool&gt; &lt;/property&gt; &lt;/widget&gt; &lt;/item&gt; &lt;item row=&quot;14&quot; column=&quot;1&quot;&gt; &lt;widget class=&quot;QComboBox&quot; name=&quot;endianBox&quot;/&gt; &lt;/item&gt; &lt;item row=&quot;14&quot; column=&quot;2&quot;&gt; &lt;widget class=&quot;QLineEdit&quot; name=&quot;nearestEndian&quot;&gt; &lt;property name=&quot;enabled&quot;&gt; &lt;bool&gt;false&lt;/bool&gt; &lt;/property&gt; &lt;/widget&gt; &lt;/item&gt; &lt;item row=&quot;15&quot; column=&quot;1&quot;&gt; &lt;widget class=&quot;QPushButton&quot; name=&quot;testButton&quot;&gt; &lt;property name=&quot;text&quot;&gt; &lt;string&gt;Test&lt;/string&gt; &lt;/property&gt; &lt;/widget&gt; &lt;/item&gt; &lt;item row=&quot;15&quot; column=&quot;2&quot;&gt; &lt;widget class=&quot;QLabel&quot; name=&quot;testResult&quot;&gt; &lt;property name=&quot;text&quot;&gt; &lt;string/&gt; &lt;/property&gt; &lt;/widget&gt; &lt;/item&gt; &lt;item row=&quot;3&quot; column=&quot;0&quot;&gt; &lt;widget class=&quot;QLabel&quot; name=&quot;actualFreqLabel&quot;&gt; &lt;property name=&quot;text&quot;&gt; &lt;string&gt;Frequency (Hz)&lt;/string&gt; &lt;/property&gt; &lt;/widget&gt; &lt;/item&gt; &lt;item row=&quot;5&quot; column=&quot;0&quot;&gt; &lt;widget class=&quot;QLabel&quot; name=&quot;actualChannelLabel&quot;&gt; &lt;property name=&quot;text&quot;&gt; &lt;string&gt;Channels&lt;/string&gt; &lt;/property&gt; &lt;/widget&gt; &lt;/item&gt; &lt;item row=&quot;9&quot; column=&quot;0&quot;&gt; &lt;widget class=&quot;QLabel&quot; name=&quot;actualSampleSizeLabel&quot;&gt; &lt;property name=&quot;text&quot;&gt; &lt;string&gt;Sample size (bits)&lt;/string&gt; &lt;/property&gt; &lt;/widget&gt; &lt;/item&gt; &lt;item row=&quot;14&quot; column=&quot;0&quot;&gt; &lt;widget class=&quot;QLabel&quot; name=&quot;actualEndianLabel&quot;&gt; &lt;property name=&quot;text&quot;&gt; &lt;string&gt;Endianess&lt;/string&gt; &lt;/property&gt; &lt;/widget&gt; &lt;/item&gt; &lt;item row=&quot;16&quot; column=&quot;0&quot; colspan=&quot;3&quot;&gt; &lt;widget class=&quot;QLabel&quot; name=&quot;label&quot;&gt; &lt;property name=&quot;sizePolicy&quot;&gt; &lt;sizepolicy hsizetype=&quot;Preferred&quot; vsizetype=&quot;Fixed&quot;&gt; &lt;horstretch&gt;0&lt;/horstretch&gt; &lt;verstretch&gt;0&lt;/verstretch&gt; &lt;/sizepolicy&gt; &lt;/property&gt; &lt;property name=&quot;text&quot;&gt; &lt;string&gt;Note: an invalid codec 'audio/test' exists in order to allow an invalid format to be constructed, and therefore to trigger a 'nearest format' calculation.&lt;/string&gt; &lt;/property&gt; &lt;property name=&quot;wordWrap&quot;&gt; &lt;bool&gt;true&lt;/bool&gt; &lt;/property&gt; &lt;/widget&gt; &lt;/item&gt; &lt;item row=&quot;2&quot; column=&quot;0&quot;&gt; &lt;widget class=&quot;QLabel&quot; name=&quot;actualCodecLabel&quot;&gt; &lt;property name=&quot;text&quot;&gt; &lt;string&gt;Codec&lt;/string&gt; &lt;/property&gt; &lt;/widget&gt; &lt;/item&gt; &lt;item row=&quot;2&quot; column=&quot;2&quot;&gt; &lt;widget class=&quot;QLineEdit&quot; name=&quot;nearestCodec&quot;&gt; &lt;property name=&quot;enabled&quot;&gt; &lt;bool&gt;false&lt;/bool&gt; &lt;/property&gt; &lt;/widget&gt; &lt;/item&gt; &lt;item row=&quot;2&quot; column=&quot;1&quot;&gt; &lt;widget class=&quot;QComboBox&quot; name=&quot;codecsBox&quot;/&gt; &lt;/item&gt; &lt;item row=&quot;6&quot; column=&quot;0&quot;&gt; &lt;widget class=&quot;QLabel&quot; name=&quot;actualSampleTypeLabel&quot;&gt; &lt;property name=&quot;text&quot;&gt; &lt;string&gt;SampleType&lt;/string&gt; &lt;/property&gt; &lt;/widget&gt; &lt;/item&gt; &lt;item row=&quot;6&quot; column=&quot;1&quot;&gt; &lt;widget class=&quot;QComboBox&quot; name=&quot;sampleTypesBox&quot;/&gt; &lt;/item&gt; &lt;item row=&quot;6&quot; column=&quot;2&quot;&gt; &lt;widget class=&quot;QLineEdit&quot; name=&quot;nearestSampleType&quot;&gt; &lt;property name=&quot;enabled&quot;&gt; &lt;bool&gt;false&lt;/bool&gt; &lt;/property&gt; &lt;/widget&gt; &lt;/item&gt; &lt;/layout&gt; &lt;/widget&gt; &lt;widget class=&quot;QWidget&quot; name=&quot;tab&quot;&gt; &lt;attribute name=&quot;title&quot;&gt; &lt;string&gt;All formats&lt;/string&gt; &lt;/attribute&gt; &lt;layout class=&quot;QVBoxLayout&quot; name=&quot;verticalLayout_2&quot;&gt; &lt;item&gt; &lt;widget class=&quot;QPushButton&quot; name=&quot;populateTableButton&quot;&gt; &lt;property name=&quot;text&quot;&gt; &lt;string&gt;Populate table&lt;/string&gt; &lt;/property&gt; &lt;/widget&gt; &lt;/item&gt; &lt;item&gt; &lt;widget class=&quot;QTableWidget&quot; name=&quot;allFormatsTable&quot;&gt; &lt;property name=&quot;editTriggers&quot;&gt; &lt;set&gt;QAbstractItemView::NoEditTriggers&lt;/set&gt; &lt;/property&gt; &lt;property name=&quot;dragDropOverwriteMode&quot;&gt; &lt;bool&gt;false&lt;/bool&gt; &lt;/property&gt; &lt;property name=&quot;selectionMode&quot;&gt; &lt;enum&gt;QAbstractItemView::NoSelection&lt;/enum&gt; &lt;/property&gt; &lt;property name=&quot;selectionBehavior&quot;&gt; &lt;enum&gt;QAbstractItemView::SelectItems&lt;/enum&gt; &lt;/property&gt; &lt;property name=&quot;textElideMode&quot;&gt; &lt;enum&gt;Qt::ElideNone&lt;/enum&gt; &lt;/property&gt; &lt;property name=&quot;sortingEnabled&quot;&gt; &lt;bool&gt;false&lt;/bool&gt; &lt;/property&gt; &lt;property name=&quot;wordWrap&quot;&gt; &lt;bool&gt;false&lt;/bool&gt; &lt;/property&gt; &lt;property name=&quot;cornerButtonEnabled&quot;&gt; &lt;bool&gt;false&lt;/bool&gt; &lt;/property&gt; &lt;attribute name=&quot;horizontalHeaderHighlightSections&quot;&gt; &lt;bool&gt;false&lt;/bool&gt; &lt;/attribute&gt; &lt;attribute name=&quot;verticalHeaderVisible&quot;&gt; &lt;bool&gt;false&lt;/bool&gt; &lt;/attribute&gt; &lt;attribute name=&quot;verticalHeaderHighlightSections&quot;&gt; &lt;bool&gt;false&lt;/bool&gt; &lt;/attribute&gt; &lt;attribute name=&quot;verticalHeaderVisible&quot;&gt; &lt;bool&gt;false&lt;/bool&gt; &lt;/attribute&gt; &lt;attribute name=&quot;horizontalHeaderHighlightSections&quot;&gt; &lt;bool&gt;false&lt;/bool&gt; &lt;/attribute&gt; &lt;attribute name=&quot;verticalHeaderHighlightSections&quot;&gt; &lt;bool&gt;false&lt;/bool&gt; &lt;/attribute&gt; &lt;column&gt; &lt;property name=&quot;text&quot;&gt; &lt;string&gt;Codec&lt;/string&gt; &lt;/property&gt; &lt;property name=&quot;textAlignment&quot;&gt; &lt;set&gt;AlignHCenter|AlignVCenter|AlignCenter&lt;/set&gt; &lt;/property&gt; &lt;/column&gt; &lt;column&gt; &lt;property name=&quot;text&quot;&gt; &lt;string&gt;Frequency (Hz)&lt;/string&gt; &lt;/property&gt; &lt;property name=&quot;textAlignment&quot;&gt; &lt;set&gt;AlignHCenter|AlignVCenter|AlignCenter&lt;/set&gt; &lt;/property&gt; &lt;/column&gt; &lt;column&gt; &lt;property name=&quot;text&quot;&gt; &lt;string&gt;Channels&lt;/string&gt; &lt;/property&gt; &lt;property name=&quot;textAlignment&quot;&gt; &lt;set&gt;AlignHCenter|AlignVCenter|AlignCenter&lt;/set&gt; &lt;/property&gt; &lt;/column&gt; &lt;column&gt; &lt;property name=&quot;text&quot;&gt; &lt;string&gt;Sample type&lt;/string&gt; &lt;/property&gt; &lt;property name=&quot;textAlignment&quot;&gt; &lt;set&gt;AlignHCenter|AlignVCenter|AlignCenter&lt;/set&gt; &lt;/property&gt; &lt;/column&gt; &lt;column&gt; &lt;property name=&quot;text&quot;&gt; &lt;string&gt;Sample size (bits)&lt;/string&gt; &lt;/property&gt; &lt;property name=&quot;textAlignment&quot;&gt; &lt;set&gt;AlignHCenter|AlignVCenter|AlignCenter&lt;/set&gt; &lt;/property&gt; &lt;/column&gt; &lt;column&gt; &lt;property name=&quot;text&quot;&gt; &lt;string&gt;Endianness&lt;/string&gt; &lt;/property&gt; &lt;property name=&quot;textAlignment&quot;&gt; &lt;set&gt;AlignHCenter|AlignVCenter|AlignCenter&lt;/set&gt; &lt;/property&gt; &lt;/column&gt; &lt;/widget&gt; &lt;/item&gt; &lt;/layout&gt; &lt;/widget&gt; &lt;/widget&gt; &lt;/item&gt; &lt;/layout&gt; &lt;/item&gt; &lt;/layout&gt; &lt;/widget&gt; &lt;/widget&gt; &lt;/item&gt; &lt;/layout&gt; &lt;/widget&gt; &lt;widget class=&quot;QStatusBar&quot; name=&quot;statusbar&quot;/&gt; &lt;/widget&gt; &lt;resources/&gt; &lt;connections/&gt; &lt;/ui&gt;</pre> </div> <!-- @@@multimedia/audiodevices/audiodevicesbase.ui --> </div> </div> </div> <div class="ft"> <span></span> </div> </div> <div class="footer"> <p> <acronym title="Copyright">&copy;</acronym> 2013 Digia Plc and/or its subsidiaries. Documentation contributions included herein are the copyrights of their respective owners.</p> <br /> <p> The documentation provided herein is licensed under the terms of the <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation License version 1.3</a> as published by the Free Software Foundation.</p> <p> Documentation sources may be obtained from <a href="http://www.qt-project.org"> www.qt-project.org</a>.</p> <br /> <p> Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide. All other trademarks are property of their respective owners. <a title="Privacy Policy" href="http://en.gitorious.org/privacy_policy/">Privacy Policy</a></p> </div> <script src="scripts/functions.js" type="text/javascript"></script> </body> </html>
stephaneAG/PengPod700
QtEsrc/qt-everywhere-opensource-src-4.8.5/doc/html/multimedia-audiodevices-audiodevicesbase-ui.html
HTML
mit
30,330
<div class="container-fluid"> <div class="row"> <div class="col-sm-2"></div> <div class="col-sm-8"> <div class="article"> <div class="title"> <a name="download"></a> <strong class="embossed">Download</strong> <span>Descarga el código</span> </div> <div class="meta"><span>Happy coding! ;-)</span></div> <div class="body"> <p> <a href="https://github.com/neslonso/Sintax">Fork me on github</a> </p> <ul> <li> <a href="#" onclick=" Post('MODULE','actions','acClase','docHome','acMetodo','acPackCode','acTipo','plain'); return false; ">Versión <?=SKEL_VERSION?></a> </li> <li> <a href="#" onclick=" Post('MODULE','actions','acClase','docHome','acMetodo','acPackCode','acTipo','plain','type','withVendorCode'); return false; ">Versión <?=SKEL_VERSION?> + plugins</a> </li> </ul> <date>Creado: 13 de septiembre, 2014</date> </div> </div> </div> <div class="col-sm-2"></div> </div> </div>
neslonso/Sintax
appZzzMeta/server/clases/Pages/zzDoc/docHome/markup/parts/download.php
PHP
mit
1,051
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "chrome/browser/about_flags.h" #include "base/command_line.h" namespace about_flags { void RemoveFlagsSwitches(base::CommandLine::SwitchMap* switch_list) {} } // namespace about_flags
brave/electron
chromium_src/chrome/browser/about_flags.cc
C++
mit
368
// const picturefill = require('picturefill') const assign = require('lodash/assign') const TinyPicturesUniversal = require('./index') module.exports = class TinyPictures extends TinyPicturesUniversal { constructor(options) { super(options) // lazySizes const lazySizesConfigBackup = window.lazySizesConfig window.lazySizesConfig = this._options.lazySizesConfig this._lazySizes = require('lazysizes') // cannot be required before config is set on window window.lazySizesConfig = lazySizesConfigBackup window.document.addEventListener('lazybeforeunveil', (event) => { const img = event.target if (!img.getAttribute('data-tp-src') && !img.getAttribute('data-tp-srcset')) { return } let element = img const elementsToReveal = [img] const noPicture = img.hasAttribute('tp-nopicture') || img.classList.contains('tp-nopicture') // class for legacy reasons if (!noPicture) { element = this.wrapInPicture(img) const sources = element.getElementsByTagName('source') for (let i = 0; i < sources.length; i++) { elementsToReveal.unshift(sources[i]) } } elementsToReveal.forEach((elementToReveal) => this.revealAttributes(elementToReveal)) }) } baseUrl() { if (this._options.defaultBaseUrl) { return this._options.defaultBaseUrl } return window.location.href } wrapInPicture(img) { if (img.parentElement.nodeName.toLowerCase() === 'picture') { return img.parentElement } const eventName = 'tpbeforewrapinpicture' const event = typeof Event === 'function' ? new Event(eventName) : document.createEvent('Event') event.initEvent(eventName, true, true) img.dispatchEvent(event) if (event.defaultPrevented) { return null } const picture = document.createElement('picture') img.parentNode.insertBefore(picture, img) img.parentNode.removeChild(img) picture.appendChild(img) // add source elements const ie9Start = document.createComment('[if IE 9]><video style="display: none"><![endif]') const ie9End = document.createComment('[if IE 9]></video><![endif]') picture.insertBefore(ie9Start, img) const webpSource = document.createElement('source') webpSource.setAttribute('type', 'image/webp') const source = document.createElement('source') const attributes = [ 'data-tp-src', 'data-tp-srcset', 'data-tp-sizes' ] const elements = [webpSource, source] elements.forEach((element, index) => { attributes.forEach((attribute) => { const value = img.getAttribute(attribute) if (value) { element.setAttribute(attribute, value) } }) const overrideOptions = index === 0 ? {format: 'webp'} : {} element.setAttribute('data-tp-options', JSON.stringify(this.mergedOptions(img, overrideOptions))) picture.insertBefore(element, img) }) picture.insertBefore(ie9End, img) return picture } mergedOptions(img, overrideOptions) { const optionsString = img.getAttribute('data-tp-options') const options = optionsString ? JSON.parse(optionsString) : {} return assign({}, options, overrideOptions) } revealAttributes(element) { // element can be either source or img const isSource = element.nodeName.toLowerCase() === 'source' const sizes = element.getAttribute('data-tp-sizes') if (sizes) { element.setAttribute( 'srcset', this.srcsetArray( element.getAttribute('data-tp-src'), this.mergedOptions(element) ) .join(', ') ) if (sizes === 'auto') { this._lazySizes.autoSizer.updateElem(element) } else { element.setAttribute('sizes', sizes) } } if(!sizes && isSource || !isSource) { element.setAttribute( isSource ? 'srcset' : 'src', this.url( element.getAttribute('data-tp-src'), this.mergedOptions(element) ) ) } } reveal(element) { if (element.classList.contains('tp-lazyloading') || element.classList.contains('tp-lazyloaded')) { return } return this._lazySizes.loader.unveil(element) } revealAll() { const document = window.document var list = document.getElementsByTagName('img') for (var i = 0; i < list.length; i++) { this.reveal(list[i]) } } lazyload() { this._lazySizes.init() } registerAngularJsModule(angular) { angular.module('tiny.pictures', []) .filter('tinyPicturesUrl', () => this.url.bind(this)) } registerJQueryPlugin(jQuery) { const self = this jQuery.fn.tinyPictures = function () { this.filter('img') .each(function () { return self.reveal(this) }) return this } } }
erkstruwe/tiny.pictures-js
src/browser.js
JavaScript
mit
5,551
from django import forms from django.contrib.auth.forms import UserCreationForm from django.contrib.auth.models import User from django_maps import settings import os class ProfilePhotoUploadForm(forms.Form): userId = forms.IntegerField() file = forms.FileField() class RegistrationForm(UserCreationForm): email = forms.EmailField(required=True) class Meta: model = User fields = ("username", "email", "password1", "password2") #can add fields here (firs_name,last_name) def save(self, commit=True): #calling super(RegistrationForm) internally calls set_password user = super(RegistrationForm,self).save(commit=False) if commit: user.save() #create directory for user media target = settings.USER_MEDIA_ROOT+'/'+str(user.id) target2 = target + "/profile_pictures" os.mkdir(target) os.mkdir(target2) return user
agilman/django_maps
maps/forms.py
Python
mit
967
<html> <head> </head> <body> <h1>F1</h1> <table cellspacing="0px" border="1" width="900"> <tbody> <tr> <td align="middle"><img width="80" src='undip.png' /></td> </tr> <tr> <td> <h2 align="center">UNIVERSITAS DIPONEGORO</h2> <p align="center"><strong>SURAT PERMINTAAN PEMBAYARAN<br> JENIS : UP</strong></p> <p align="right"> <b>Nomor: 02/WR1/SPP-UP/Jan/2017</b> </p> <p align="left"> TAHUN ANGGARAN : 2017<br> Tanggal : 1 Januari 2017 </p> </td> </tr> <tr> <td>Satuan Unit Kerja Penggunga Anggaran (SUKPA): Wakil Rektor I</td> </tr> <tr> <td>Unit Kerja : BAA &nbsp;&nbsp; Kode Unit Kerja : 44</td> </tr> <tr> <td> <table border=0> <tr> <td width='450'></td> <td>Kepada Yth.<br> Kuasa Pengguna Anggaran<br> SUKPA Wakil Rektor I<br> di Semarang </td> </tr> <tr> <td colspan="2"> </td> </tr> <tr> <td colspan="2"> <p> Dengan Berpedoman pada Dokumen RKAT yang telah disetujui oleh MWA, bersama ini kami mengajukan Surat Permintaan Pembayaran sebagai berikut:<br> a. Jumlah Pembayaran Yang diminta: Rp. 300.000.000,-<br> b. Untuk Keperluan : Pengisian Uang Persediaan <br> c. Nama bendahara pengeluaran : Berani Sejahtera.<br> d. Alamat : Jl.Prof. Sudharto Tembalang <br> e. No Rekening Bank : 134765890910 <br> f. No NPWP : 123456789 <br> g. Sumber Dana dari APBN : Rp -<br> h. Sumber Dana Selain APBN : Rp -<br> Pembayaran sebagaimana tersebut diatas, dibebankan pada pengeluaran dengan uraian sebagai berikut:<br> </p> <td> </tr> </table> </td> </tr> <tr> <td> <table cellspacing="0px" border="1" width="900"> <tr> <td colspan='3' align="center"> <b>PENGELUARAN</b> </td> <td colspan='3' align="center"> <b>PERHITUNGAN TERKAIT PIHAK LAIN</b> </td> </tr> <tr> <td rowspan="2" align="center"> NAMA AKUN </td> <td rowspan="2" align="center"> KODE AKUN </td> <td rowspan="2" align="center"> JUMLAH UANG </td> <td colspan="3" align="center"> PENERIMAAN DARI PIHAK KE-3 </td> </tr> <tr> <td align="center"> Akun </td> <td colspan="2" align="center"> Jumlah Uang </td> </tr> <tr> <td> Isian Akun data </td> <td> Isian Kode Akun data </td> <td> Isian Jumlah Uang </td> <td> - Akun </td> <td colspan="2"> </td> </tr> <tr> <td rowspan="3"> .......................... </td> <td rowspan="3"> .......................... </td> <td rowspan="3"> .......................... </td> <td colspan="3" align="center"> POTONGAN UNTUK PIHAK LAIN </td> </tr> <tr> <td align="center"> Akun Pajak dan Potongan Lainnya </td> <td colspan="2" align="center"> Jumlah Uang </td> </tr> <tr> <td align="center"> iuran wajib Pegawai </td> <td colspan="2" align="center"> Rp </td> </tr> <tr> <td colspan="2"> Jumlah Pengeluaran </td> <td> Rp. 300.000 </td> <td> Pajak Penghasilan </td> <td colspan="2"> Rp.- </td> </tr> <tr> <td colspan="2"> Dikurangi : Jumlah potongan untuk pihak lain </td> <td> Rp. 0 </td> <td> ...dst </td> <td colspan="2"> Rp.0 </td> </tr> <tr> <td colspan="2"> <strong>Jumlah pembayaran yang diminta</strong> </td> <td> Rp. 300.000.000,- </td> <td> <strong>Jumlah Potongan</strong> </td> <td colspan="2"> Rp.0 </td> </tr> </table> </td> </tr> <tr> <td> SPP Sebagaimana dimaksud diatas, disusun sesuai dengan dokumen lampiran yang persyaratkan dan disampaikan secara bersamaan serta merupakan bagian yang tidak terpisahkan dari surat ini.<br><br> </td> <tr> <tr> <td> <table> <tr> <td width="450"> </td> <td> Semarang, 1 Januari 2017 <br> Bendahara Pengeluaran SUKPA<br> <br> <br> <br> Berani Sejahtera<br> NIP 123456009<br> </td> </tr> </table> </td> </tr> <tr> <td> <strong>Keterangan:</strong><br> <ul> <li>Semua bukti Pengeluaran untuk pekerjaan dengan perjanjian yang disahkan Pejabat Pembuat Komitmen telah diuji dan dinyatakan memenuhi persyaratan untuk dilakukan pembayaran atas beban RKAT Undip, selanjutnya bukti-bukti pengeluaran dimaksud disimpan dan diusahakan oleh Pejabat Penatasuahaan Keuangan SUKPA</li> <li> Semua Bukti-bukti pengeluaran untuk pekerjaan yang disahkan Pejabat dan pengendali Kegiatan (PPPK) telah diuji dan dinyatakan memenuhi persyaratan untuk dilakukan pembayaran atas beban RKAT Undip, selanjutnya bukti-bukti pengeluaran dimaksud disimpan dan ditatausahakan oleh Pejabat Penatausahaan SUKPA. </li> <li>Kebenaran perhitungan dan isi tertuang dalam SPP ini menjadi tanggung Jawab bendahara Pengeluaran sepanjang sesuai dengan bukti-bukti pengeluaran yang telah ditandatangani oleh PPPPK atau PPK</li> </ul> </td> </tr> </tbody> </table> <p>&nbsp;</p> </body> </html>
swdmnd/rsa
application/views/layout/layout.html
HTML
mit
6,106
use std::error::Error; use std::fs; pub struct Config { pub query: String, pub filename: String, } impl Config { pub fn new(args: &[String]) -> Result<Config, &'static str> { if args.len() < 3 { return Err("not enough arguments"); } let query = args[1].clone(); let filename = args[2].clone(); Ok(Config { query, filename }) } } pub fn run(config: Config) -> Result<(), Box<dyn Error>> { let contents = fs::read_to_string(config.filename)?; println!("With text:\n{}", contents); Ok(()) }
KaiserY/trpl-zh-cn
listings/ch12-an-io-project/listing-12-14/src/lib.rs
Rust
mit
575
body{ font-family: 'Jura', sans-serif; color: #000; } h1{ font-family: 'Black Ops One', cursive; font-size: 3em; font-weight: bolder; color: #000; } .screen { display: none; text-align: center; width: 960px; background-image: url("../imgs/fondo.png"); background-size: 100% 100%; } .p { height: 250px; display: inline-block; } .datos { display: inline-block; width: 600px; text-align: center; vertical-align: top; } p img{ height: 50px; } img{ vertical-align: middle;; } .btn{ font-family: 'Jura', sans-serif; font-size: 1.5em; padding: 1em 3em; background-color: #F4DDA9; border: none; -webkit-transition: all 0.4s; } .btn: hover{ background-color: #f7f7f7; color: #222; cursor: pointer; }
gnzandrs/pabloworld
src/css/style.css
CSS
mit
726
using Orleans; using BenchmarkGrainInterfaces.Ping; using System.Threading.Tasks; using Orleans.Runtime; namespace BenchmarkGrains.Ping { public class PingGrain : Grain, IPingGrain { private IPingGrain _self; public override Task OnActivateAsync() { _self = this.AsReference<IPingGrain>(); return base.OnActivateAsync(); } public ValueTask Run() => default; public ValueTask PingPongInterleave(IPingGrain other, int count) { if (count == 0) return default; return other.PingPongInterleave(_self, count - 1); } public ValueTask<int> GetSiloPort() => new(((ILocalSiloDetails)ServiceProvider.GetService(typeof(ILocalSiloDetails))).SiloAddress.Endpoint.Port); } }
jthelin/orleans
test/Grains/BenchmarkGrains/Ping/PingGrain.cs
C#
mit
797
// Copyright (c) 2012 Intel Corp // Copyright (c) 2012 The Chromium Authors // // 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 co // pies 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 al // l copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IM // PLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNES // S FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS // OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WH // ETHER 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. #include "content/nw/src/browser/native_window_aura.h" #if defined(OS_WIN) #include <shobjidl.h> #include <dwmapi.h> #endif #include "base/strings/utf_string_conversions.h" #include "base/values.h" #include "base/command_line.h" #if defined(OS_WIN) #include "base/win/scoped_comptr.h" #include "base/win/windows_version.h" #include "base/win/wrapped_window_proc.h" #endif #include "chrome/browser/platform_util.h" #include "content/nw/src/api/menu/menu.h" #include "content/nw/src/browser/browser_view_layout.h" #include "content/nw/src/browser/menubar_view.h" #include "content/nw/src/browser/native_window_toolbar_aura.h" #include "content/nw/src/common/shell_switches.h" #include "content/nw/src/nw_shell.h" #include "content/public/browser/native_web_keyboard_event.h" #include "content/public/browser/render_view_host.h" #include "content/public/browser/render_widget_host_view.h" #include "content/public/browser/web_contents.h" #include "content/public/common/content_switches.h" #include "extensions/common/draggable_region.h" #include "third_party/skia/include/core/SkPaint.h" #include "ui/base/hit_test.h" #include "ui/gfx/native_widget_types.h" #if defined(OS_WIN) #include "ui/gfx/win/hwnd_util.h" #include "ui/gfx/icon_util.h" #include "ui/views/win/hwnd_util.h" #endif #include "ui/gfx/path.h" #include "ui/gfx/canvas.h" #include "ui/gfx/font_list.h" #include "ui/gfx/platform_font.h" #include "ui/gfx/image/image_skia_operations.h" #include "ui/views/background.h" #include "ui/views/controls/webview/webview.h" #include "ui/views/layout/box_layout.h" #include "ui/views/views_delegate.h" #include "ui/views/views_switches.h" #include "ui/views/widget/widget.h" #include "ui/views/window/native_frame_view.h" #include "ui/views/widget/native_widget_private.h" #include "ui/events/event_handler.h" #include "ui/wm/core/easy_resize_window_targeter.h" #include "ui/aura/window.h" #include "chrome/browser/ui/views/accelerator_table.h" #include "base/basictypes.h" #include "chrome/app/chrome_command_ids.h" #include "ui/base/accelerators/accelerator.h" #include "ui/events/event_constants.h" #if defined(USE_ASH) #include "ash/accelerators/accelerator_table.h" #endif namespace content { extern bool g_support_transparency; extern bool g_force_cpu_draw; } using base::WeakPtr; using base::WeakPtrFactory; namespace nw { namespace { const int kResizeInsideBoundsSize = 5; const int kResizeAreaCornerSize = 16; // Returns true if |possible_parent| is a parent window of |child|. bool IsParent(gfx::NativeView child, gfx::NativeView possible_parent) { if (!child) return false; #if !defined(USE_AURA) && defined(OS_WIN) if (::GetWindow(child, GW_OWNER) == possible_parent) return true; #endif gfx::NativeView parent = child; while ((parent = (gfx::NativeView)platform_util::GetParent(parent)) != NULL) { if (possible_parent == parent) return true; } return false; } class NativeWindowClientView : public views::ClientView { public: NativeWindowClientView(views::Widget* widget, views::View* contents_view, const base::WeakPtr<content::Shell>& shell) : views::ClientView(widget, contents_view), shell_(shell) { } virtual ~NativeWindowClientView() {} virtual bool CanClose() OVERRIDE { if (shell_) return shell_->ShouldCloseWindow(); else return true; } private: base::WeakPtr<content::Shell> shell_; }; class NativeWindowFrameView : public views::NonClientFrameView { public: static const char kViewClassName[]; explicit NativeWindowFrameView(const WeakPtr<NativeWindowAura>& window); virtual ~NativeWindowFrameView(); void Init(views::Widget* frame); // views::NonClientFrameView implementation. virtual gfx::Rect GetBoundsForClientView() const OVERRIDE; virtual gfx::Rect GetWindowBoundsForClientBounds( const gfx::Rect& client_bounds) const OVERRIDE; virtual int NonClientHitTest(const gfx::Point& point) OVERRIDE; virtual void GetWindowMask(const gfx::Size& size, gfx::Path* window_mask) OVERRIDE; virtual void ResetWindowControls() OVERRIDE {} virtual void UpdateWindowIcon() OVERRIDE {} virtual void UpdateWindowTitle() OVERRIDE {} // views::View implementation. virtual gfx::Size GetPreferredSize() const OVERRIDE; virtual void Layout() OVERRIDE; virtual const char* GetClassName() const OVERRIDE; virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; virtual gfx::Size GetMinimumSize() const OVERRIDE; virtual gfx::Size GetMaximumSize() const OVERRIDE; private: WeakPtr<NativeWindowAura> window_; views::Widget* frame_; DISALLOW_COPY_AND_ASSIGN(NativeWindowFrameView); }; const char NativeWindowFrameView::kViewClassName[] = "content/nw/src/browser/NativeWindowFrameView"; NativeWindowFrameView::NativeWindowFrameView(const WeakPtr<NativeWindowAura>& window) : window_(window), frame_(NULL) { } NativeWindowFrameView::~NativeWindowFrameView() { } void NativeWindowFrameView::Init(views::Widget* frame) { frame_ = frame; } gfx::Rect NativeWindowFrameView::GetBoundsForClientView() const { return bounds(); } gfx::Rect NativeWindowFrameView::GetWindowBoundsForClientBounds( const gfx::Rect& client_bounds) const { gfx::Rect window_bounds = client_bounds; // Enforce minimum size (1, 1) in case that client_bounds is passed with // empty size. This could occur when the frameless window is being // initialized. if (window_bounds.IsEmpty()) { window_bounds.set_width(1); window_bounds.set_height(1); } return window_bounds; } int NativeWindowFrameView::NonClientHitTest(const gfx::Point& point) { if (!window_ || frame_->IsFullscreen()) return HTCLIENT; // Check the frame first, as we allow a small area overlapping the contents // to be used for resize handles. bool can_ever_resize = frame_->widget_delegate() ? frame_->widget_delegate()->CanResize() : false; // Don't allow overlapping resize handles when the window is maximized or // fullscreen, as it can't be resized in those states. int resize_border = frame_->IsMaximized() || frame_->IsFullscreen() ? 0 : kResizeInsideBoundsSize; int frame_component = GetHTComponentForFrame(point, resize_border, resize_border, kResizeAreaCornerSize, kResizeAreaCornerSize, can_ever_resize); if (frame_component != HTNOWHERE) return frame_component; // Ajust the point if we have a toolbar. gfx::Point adjusted_point(point); if (window_->toolbar()) adjusted_point.set_y(adjusted_point.y() - window_->toolbar()->height()); // Check for possible draggable region in the client area for the frameless // window. if (window_->draggable_region() && window_->draggable_region()->contains(adjusted_point.x(), adjusted_point.y())) return HTCAPTION; int client_component = frame_->client_view()->NonClientHitTest(point); if (client_component != HTNOWHERE) return client_component; // Caption is a safe default. return HTCAPTION; } void NativeWindowFrameView::GetWindowMask(const gfx::Size& size, gfx::Path* window_mask) { // We got nothing to say about no window mask. } gfx::Size NativeWindowFrameView::GetPreferredSize() const { gfx::Size pref = frame_->client_view()->GetPreferredSize(); gfx::Rect bounds(0, 0, pref.width(), pref.height()); return frame_->non_client_view()->GetWindowBoundsForClientBounds( bounds).size(); } void NativeWindowFrameView::Layout() { } void NativeWindowFrameView::OnPaint(gfx::Canvas* canvas) { } const char* NativeWindowFrameView::GetClassName() const { return kViewClassName; } gfx::Size NativeWindowFrameView::GetMinimumSize() const { return frame_->client_view()->GetMinimumSize(); } gfx::Size NativeWindowFrameView::GetMaximumSize() const { return frame_->client_view()->GetMaximumSize(); } } // namespace NativeWindowAura::NativeWindowAura(const base::WeakPtr<content::Shell>& shell, base::DictionaryValue* manifest) : NativeWindow(shell, manifest), toolbar_(NULL), web_view_(NULL), is_fullscreen_(false), is_visible_on_all_workspaces_(false), is_minimized_(false), is_maximized_(false), is_focus_(false), is_blur_(false), menu_(NULL), resizable_(true), minimum_size_(0, 0), maximum_size_(), initial_focus_(true), last_width_(-1), last_height_(-1), weak_factory_(this) { manifest->GetBoolean("focus", &initial_focus_); manifest->GetBoolean("fullscreen", &is_fullscreen_); manifest->GetBoolean("resizable", &resizable_); manifest->GetBoolean("visible-on-all-workspaces", &is_visible_on_all_workspaces_); window_ = new views::Widget; views::Widget::InitParams params(views::Widget::InitParams::TYPE_WINDOW); params.delegate = this; params.remove_standard_frame = !has_frame(); params.use_system_default_icon = true; if (content::g_support_transparency && transparent_) params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; if (is_fullscreen_) params.show_state = ui::SHOW_STATE_FULLSCREEN; params.visible_on_all_workspaces = is_visible_on_all_workspaces_; #if defined(OS_WIN) if (has_frame()) window_->set_frame_type(views::Widget::FRAME_TYPE_FORCE_NATIVE); #endif window_->Init(params); // WS_CAPTION is needed or the size will be miscalculated on maximizing // see upstream issue #224924 #if defined(OS_WIN) HWND hwnd = views::HWNDForWidget(window_->GetTopLevelWidget()); int current_style = ::GetWindowLong(hwnd, GWL_STYLE); ::SetWindowLong(hwnd, GWL_STYLE, current_style | WS_CAPTION); #endif if (!has_frame()) InstallEasyResizeTargeterOnContainer(); views::WidgetFocusManager::GetInstance()->AddFocusChangeListener(this); int width, height; manifest->GetInteger(switches::kmWidth, &width); manifest->GetInteger(switches::kmHeight, &height); gfx::Rect window_bounds = window_->non_client_view()->GetWindowBoundsForClientBounds( gfx::Rect(width,height)); last_width_ = width; last_height_ = height; window_->AddObserver(this); window_->SetSize(window_bounds.size()); window_->CenterWindow(window_bounds.size()); window_->UpdateWindowIcon(); OnViewWasResized(); window_->SetInitialFocus(ui::SHOW_STATE_NORMAL); } NativeWindowAura::~NativeWindowAura() { #if defined(OS_WIN) FOR_EACH_OBSERVER(web_modal::ModalDialogHostObserver, observer_list_, OnHostDestroying()); #endif views::WidgetFocusManager::GetInstance()->RemoveFocusChangeListener(this); } void NativeWindowAura::Close() { window_->Close(); } void NativeWindowAura::Move(const gfx::Rect& bounds) { window_->SetBounds(bounds); } void NativeWindowAura::Focus(bool focus) { window_->Activate(); } void NativeWindowAura::Show() { VLOG(1) << "NativeWindowAura::Show(); initial_focus = " << initial_focus_; if (is_maximized_) window_->native_widget_private()->ShowWithWindowState(ui::SHOW_STATE_MAXIMIZED); else if (!initial_focus_) { window_->set_focus_on_creation(false); window_->native_widget_private()->ShowWithWindowState(ui::SHOW_STATE_INACTIVE); } else if (is_fullscreen_) { window_->native_widget_private()->ShowWithWindowState(ui::SHOW_STATE_FULLSCREEN); } else window_->native_widget_private()->Show(); } void NativeWindowAura::Hide() { window_->Hide(); } void NativeWindowAura::Maximize() { window_->Maximize(); } void NativeWindowAura::Unmaximize() { window_->Restore(); } void NativeWindowAura::Minimize() { window_->Minimize(); } void NativeWindowAura::Restore() { window_->Restore(); } void NativeWindowAura::SetFullscreen(bool fullscreen) { is_fullscreen_ = fullscreen; window_->SetFullscreen(fullscreen); if (shell()) { if (fullscreen) shell()->SendEvent("enter-fullscreen"); else shell()->SendEvent("leave-fullscreen"); } } bool NativeWindowAura::IsFullscreen() { return is_fullscreen_; } void NativeWindowAura::SetTransparent(bool transparent) { if (!content::g_support_transparency) return; #if defined(OS_WIN) // Check for Windows Vista or higher, transparency isn't supported in // anything lower. if (base::win::GetVersion() < base::win::VERSION_VISTA) { NOTREACHED() << "The operating system does not support transparency."; transparent_ = false; return; } // Check to see if composition is disabled, if so we have to throw an // error, there's no graceful recovery, yet. TODO: Graceful recovery. BOOL enabled = FALSE; HRESULT result = ::DwmIsCompositionEnabled(&enabled); if (!enabled || !SUCCEEDED(result)) { NOTREACHED() << "Windows DWM composition is not enabled, transparency is not supported."; transparent_ = false; return; } HWND hWnd = views::HWNDForWidget(window_); const int marginVal = transparent ? -1 : 0; MARGINS mgMarInset = { marginVal, marginVal, marginVal, marginVal }; if (DwmExtendFrameIntoClientArea(hWnd, &mgMarInset) != S_OK) { NOTREACHED() << "Windows DWM extending to client area failed, transparency is not supported."; transparent_ = false; return; } // this is needed, or transparency will fail if it defined on startup bool change_window_style = false; const LONG lastExStyle = GetWindowLong(hWnd, GWL_EXSTYLE); const LONG exStyle = WS_EX_COMPOSITED; const LONG newExStyle = transparent ? lastExStyle | exStyle : lastExStyle & ~exStyle; SetWindowLong(hWnd, GWL_EXSTYLE, newExStyle); change_window_style |= lastExStyle != newExStyle; if (change_window_style) { window_->FrameTypeChanged(); } if (content::g_force_cpu_draw && transparent) { // Quick FIX where window content is not updated Minimize(); Restore(); } #elif defined(USE_X11) && !defined(OS_CHROMEOS) static char cachedRes = -1; if ( cachedRes<0 ) { const CommandLine& command_line = *CommandLine::ForCurrentProcess(); cachedRes = !command_line.HasSwitch(switches::kDisableGpu) || !command_line.HasSwitch(views::switches::kEnableTransparentVisuals); } if (cachedRes && transparent) { LOG(INFO) << "if transparency does not work, try with --enable-transparent-visuals --disable-gpu"; } #endif if (toolbar_) { toolbar_->set_background(transparent ? views::Background::CreateSolidBackground(SK_ColorTRANSPARENT) : views::Background::CreateStandardPanelBackground()); toolbar_->SchedulePaint(); } content::RenderWidgetHostView* rwhv = shell_->web_contents()->GetRenderWidgetHostView(); if (rwhv) { rwhv->SetBackgroundOpaque(!transparent); } transparent_ = transparent; } void NativeWindowAura::SetSize(const gfx::Size& size) { window_->SetSize(size); } gfx::Size NativeWindowAura::GetSize() { return window_->GetWindowBoundsInScreen().size(); } void NativeWindowAura::SetMinimumSize(int width, int height) { minimum_size_.set_width(width); minimum_size_.set_height(height); } void NativeWindowAura::SetMaximumSize(int width, int height) { maximum_size_.set_width(width); maximum_size_.set_height(height); } void NativeWindowAura::SetResizable(bool resizable) { resizable_ = resizable; #if 0 //FIXME // Show/Hide the maximize button. DWORD style = ::GetWindowLong(views::HWNDForWidget(window_), GWL_STYLE); if (resizable) style |= WS_MAXIMIZEBOX; else style &= ~WS_MAXIMIZEBOX; ::SetWindowLong(views::HWNDForWidget(window_), GWL_STYLE, style); #endif } void NativeWindowAura::SetShowInTaskbar(bool show) { #if defined(OS_WIN) if (show == false && base::win::GetVersion() < base::win::VERSION_VISTA) { // Change the owner of native window. Only needed on Windows XP. ::SetWindowLong(views::HWNDForWidget(window_), GWLP_HWNDPARENT, (LONG)ui::GetHiddenWindow()); } base::win::ScopedComPtr<ITaskbarList> taskbar; HRESULT result = taskbar.CreateInstance(CLSID_TaskbarList, NULL, CLSCTX_INPROC_SERVER); if (FAILED(result)) { VLOG(1) << "Failed creating a TaskbarList object: " << result; return; } result = taskbar->HrInit(); if (FAILED(result)) { LOG(ERROR) << "Failed initializing an ITaskbarList interface."; return; } if (show) result = taskbar->AddTab(views::HWNDForWidget(window_)); else result = taskbar->DeleteTab(views::HWNDForWidget(window_)); if (FAILED(result)) { LOG(ERROR) << "Failed to change the show in taskbar attribute"; return; } #endif } void NativeWindowAura::SetAlwaysOnTop(bool top) { window_->StackAtTop(); // SetAlwaysOnTop should be called after StackAtTop because otherwise // the top-most flag will be removed. window_->SetAlwaysOnTop(top); } void NativeWindowAura::SetVisibleOnAllWorkspaces(bool all_workspaces) { is_visible_on_all_workspaces_ = all_workspaces; window_->SetVisibleOnAllWorkspaces(all_workspaces); } void NativeWindowAura::OnWidgetActivationChanged(views::Widget* widget, bool active) { if (active) { if (shell()) shell()->SendEvent("focus"); is_focus_ = true; is_blur_ = false; }else{ if (shell()) shell()->SendEvent("blur"); is_focus_ = false; is_blur_ = true; } } void NativeWindowAura::OnWidgetBoundsChanged(views::Widget* widget, const gfx::Rect& new_bounds) { int w = new_bounds.width(); int h = new_bounds.height(); if (shell() && (w != last_width_ || h != last_height_)) { base::ListValue args; args.AppendInteger(w); args.AppendInteger(h); shell()->SendEvent("resize", args); last_width_ = w; last_height_ = h; } } void NativeWindowAura::SetPosition(const std::string& position) { if (position == "center") { gfx::Rect bounds = window_->GetWindowBoundsInScreen(); window_->CenterWindow(gfx::Size(bounds.width(), bounds.height())); } else if (position == "mouse") { #if defined(OS_WIN) //FIXME gfx::Rect bounds = window_->GetWindowBoundsInScreen(); POINT pt; if (::GetCursorPos(&pt)) { int x = pt.x - (bounds.width() >> 1); int y = pt.y - (bounds.height() >> 1); bounds.set_x(x > 0 ? x : 0); bounds.set_y(y > 0 ? y : 0); window_->SetBoundsConstrained(bounds); } #endif } } void NativeWindowAura::SetPosition(const gfx::Point& position) { gfx::Rect bounds = window_->GetWindowBoundsInScreen(); window_->SetBounds(gfx::Rect(position, bounds.size())); } gfx::Point NativeWindowAura::GetPosition() { return window_->GetWindowBoundsInScreen().origin(); } void NativeWindowAura::FlashFrame(int count) { #if defined(OS_WIN) //FIXME FLASHWINFO fwi; fwi.cbSize = sizeof(fwi); fwi.hwnd = views::HWNDForWidget(window_); if (count != 0) { fwi.dwFlags = FLASHW_ALL; fwi.uCount = count < 0 ? 4 : count; fwi.dwTimeout = 0; } else { fwi.dwFlags = FLASHW_STOP; } FlashWindowEx(&fwi); #endif } #if defined(OS_WIN) HICON createBadgeIcon(const HWND hWnd, const TCHAR *value, const int sizeX, const int sizeY) { // canvas for the overlay icon gfx::Canvas canvas(gfx::Size(sizeX, sizeY), 1, false); // drawing red circle SkPaint paint; paint.setColor(SK_ColorRED); canvas.DrawCircle(gfx::Point(sizeX / 2, sizeY / 2), sizeX / 2, paint); // drawing the text gfx::PlatformFont *platform_font = gfx::PlatformFont::CreateDefault(); const int fontSize = sizeY*0.65f; gfx::Font font(platform_font->GetFontName(), fontSize); platform_font->Release(); platform_font = NULL; const int yMargin = (sizeY - fontSize) / 2; canvas.DrawStringRectWithFlags(value, gfx::FontList(font), SK_ColorWHITE, gfx::Rect(sizeX, fontSize + yMargin + 1), gfx::Canvas::TEXT_ALIGN_CENTER); // return the canvas as windows native icon handle return IconUtil::CreateHICONFromSkBitmap(canvas.ExtractImageRep().sk_bitmap()); } #endif void NativeWindowAura::SetBadgeLabel(const std::string& badge) { #if defined(OS_WIN) base::win::ScopedComPtr<ITaskbarList3> taskbar; HRESULT result = taskbar.CreateInstance(CLSID_TaskbarList, NULL, CLSCTX_INPROC_SERVER); if (FAILED(result)) { VLOG(1) << "Failed creating a TaskbarList3 object: " << result; return; } result = taskbar->HrInit(); if (FAILED(result)) { LOG(ERROR) << "Failed initializing an ITaskbarList3 interface."; return; } HICON icon = NULL; HWND hWnd = views::HWNDForWidget(window_); if (badge.size()) icon = createBadgeIcon(hWnd, base::UTF8ToUTF16(badge).c_str(), 32, 32); taskbar->SetOverlayIcon(hWnd, icon, L"Status"); DestroyIcon(icon); #endif } void NativeWindowAura::SetProgressBar(double progress) { #if defined(OS_WIN) base::win::ScopedComPtr<ITaskbarList3> taskbar; HRESULT result = taskbar.CreateInstance(CLSID_TaskbarList, NULL, CLSCTX_INPROC_SERVER); if (FAILED(result)) { VLOG(1) << "Failed creating a TaskbarList3 object: " << result; return; } result = taskbar->HrInit(); if (FAILED(result)) { LOG(ERROR) << "Failed initializing an ITaskbarList3 interface."; return; } HWND hWnd = views::HWNDForWidget(window_); TBPFLAG tbpFlag = TBPF_NOPROGRESS; if (progress > 1) { tbpFlag = TBPF_INDETERMINATE; } else if (progress >= 0) { tbpFlag = TBPF_NORMAL; taskbar->SetProgressValue(hWnd, progress * 100, 100); } taskbar->SetProgressState(hWnd, tbpFlag); #endif } void NativeWindowAura::SetKiosk(bool kiosk) { SetFullscreen(kiosk); } bool NativeWindowAura::IsKiosk() { return IsFullscreen(); } void NativeWindowAura::SetMenu(nwapi::Menu* menu) { window_->set_has_menu_bar(true); menu_ = menu; #if defined(OS_LINUX) MenuBarView* menubar = new MenuBarView(); GetBrowserViewLayout()->set_menu_bar(menubar); AddChildView(menubar); menubar->UpdateMenu(menu->model()); Layout(); SchedulePaint(); #endif // The menu is lazily built. #if defined(OS_WIN) //FIXME menu->Rebuild(); menu->SetWindow(this); // menu is nwapi::Menu, menu->menu_ is NativeMenuWin, ::SetMenu(views::HWNDForWidget(window_), menu->menu_->GetNativeMenu()); #endif menu->UpdateKeys( window_->GetFocusManager() ); } BrowserViewLayout* NativeWindowAura::GetBrowserViewLayout() const { return static_cast<BrowserViewLayout*>(GetLayoutManager()); } void NativeWindowAura::SetTitle(const std::string& title) { title_ = title; window_->UpdateWindowTitle(); } void NativeWindowAura::AddToolbar() { toolbar_ = new NativeWindowToolbarAura(shell()); GetBrowserViewLayout()->set_tool_bar(toolbar_); AddChildViewAt(toolbar_, 0); } void NativeWindowAura::SetToolbarButtonEnabled(TOOLBAR_BUTTON button, bool enabled) { if (toolbar_) toolbar_->SetButtonEnabled(button, enabled); } void NativeWindowAura::SetToolbarUrlEntry(const std::string& url) { if (toolbar_) toolbar_->SetUrlEntry(url); } void NativeWindowAura::SetToolbarIsLoading(bool loading) { if (toolbar_) toolbar_->SetIsLoading(loading); } views::View* NativeWindowAura::GetContentsView() { return this; } views::ClientView* NativeWindowAura::CreateClientView(views::Widget* widget) { return new NativeWindowClientView(widget, GetContentsView(), shell_); } views::NonClientFrameView* NativeWindowAura::CreateNonClientFrameView( views::Widget* widget) { if (has_frame()) return new views::NativeFrameView(GetWidget()); NativeWindowFrameView* frame_view = new NativeWindowFrameView(weak_factory_.GetWeakPtr()); frame_view->Init(window_); return frame_view; } void NativeWindowAura::OnWidgetMove() { gfx::Point origin = GetPosition(); if (shell()) { base::ListValue args; args.AppendInteger(origin.x()); args.AppendInteger(origin.y()); shell()->SendEvent("move", args); } } bool NativeWindowAura::CanResize() const { return resizable_; } bool NativeWindowAura::CanMaximize() const { return resizable_; } views::Widget* NativeWindowAura::GetWidget() { return window_; } const views::Widget* NativeWindowAura::GetWidget() const { return window_; } base::string16 NativeWindowAura::GetWindowTitle() const { return base::UTF8ToUTF16(title_); } void NativeWindowAura::DeleteDelegate() { OnNativeWindowDestory(); } bool NativeWindowAura::ShouldShowWindowTitle() const { return has_frame(); } bool NativeWindowAura::ShouldHandleOnSize() const { return true; } void NativeWindowAura::OnNativeFocusChange(gfx::NativeView focused_before, gfx::NativeView focused_now) { gfx::NativeView this_window = GetWidget()->GetNativeView(); if (IsParent(focused_now, this_window) || IsParent(this_window, focused_now)) return; if (focused_now == this_window) { if (!is_focus_ && shell()) shell()->SendEvent("focus"); is_focus_ = true; is_blur_ = false; } else if (focused_before == this_window) { if (!is_blur_ && shell()) shell()->SendEvent("blur"); is_focus_ = false; is_blur_ = true; } } gfx::ImageSkia NativeWindowAura::GetWindowAppIcon() { gfx::Image icon = app_icon(); if (icon.IsEmpty()) return gfx::ImageSkia(); gfx::ImageSkia icon2 = *icon.ToImageSkia(); #if defined(OS_WIN) int size = ::GetSystemMetrics(SM_CXICON); return gfx::ImageSkiaOperations::CreateResizedImage(icon2, skia::ImageOperations::RESIZE_BEST, gfx::Size(size, size)); #else return icon2; #endif } gfx::ImageSkia NativeWindowAura::GetWindowIcon() { gfx::Image icon = app_icon(); if (icon.IsEmpty()) return gfx::ImageSkia(); return *icon.ToImageSkia(); } views::View* NativeWindowAura::GetInitiallyFocusedView() { return web_view_; } void NativeWindowAura::UpdateDraggableRegions( const std::vector<extensions::DraggableRegion>& regions) { // Draggable region is not supported for non-frameless window. if (has_frame()) return; SkRegion* draggable_region = new SkRegion; // By default, the whole window is non-draggable. We need to explicitly // include those draggable regions. for (std::vector<extensions::DraggableRegion>::const_iterator iter = regions.begin(); iter != regions.end(); ++iter) { const extensions::DraggableRegion& region = *iter; draggable_region->op( region.bounds.x(), region.bounds.y(), region.bounds.right(), region.bounds.bottom(), region.draggable ? SkRegion::kUnion_Op : SkRegion::kDifference_Op); } draggable_region_.reset(draggable_region); OnViewWasResized(); } void NativeWindowAura::HandleKeyboardEvent( const content::NativeWebKeyboardEvent& event) { unhandled_keyboard_event_handler_.HandleKeyboardEvent(event, GetFocusManager()); // Any unhandled keyboard/character messages should be defproced. // This allows stuff like F10, etc to work correctly. // DefWindowProc(event.os_event.hwnd, event.os_event.message, // event.os_event.wParam, event.os_event.lParam); } #if 0 void NativeWindowAura::Layout() { DCHECK(web_view_); if (toolbar_) { toolbar_->SetBounds(0, 0, width(), 34); web_view_->SetBounds(0, 34, width(), height() - 34); } else { web_view_->SetBounds(0, 0, width(), height()); } OnViewWasResized(); } #endif void NativeWindowAura::ViewHierarchyChanged( const ViewHierarchyChangedDetails& details) { if (details.is_add && details.child == this) { BrowserViewLayout* layout = new BrowserViewLayout(); SetLayoutManager(layout); web_view_ = new views::WebView(NULL); web_view_->SetWebContents(web_contents()); layout->set_web_view(web_view_); AddChildView(web_view_); } } gfx::Size NativeWindowAura::GetMinimumSize() const { return minimum_size_; } gfx::Size NativeWindowAura::GetMaximumSize() const { return maximum_size_; } void NativeWindowAura::OnFocus() { web_view_->RequestFocus(); } bool NativeWindowAura::InitialFocus() { return initial_focus_; } bool NativeWindowAura::AcceleratorPressed(const ui::Accelerator& accelerator) { return true; } bool NativeWindowAura::CanHandleAccelerators() const { return true; } void NativeWindowAura::SetInitialFocus(bool initial_focus) { initial_focus_ = initial_focus; } bool NativeWindowAura::ExecuteWindowsCommand(int command_id) { #if defined(OS_WIN) // Windows uses the 4 lower order bits of |command_id| for type-specific // information so we must exclude this when comparing. static const int sc_mask = 0xFFF0; if ((command_id & sc_mask) == SC_MINIMIZE) { is_minimized_ = true; if (shell()) shell()->SendEvent("minimize"); } else if ((command_id & sc_mask) == SC_RESTORE && is_minimized_) { is_minimized_ = false; if (shell()) shell()->SendEvent("restore"); } else if ((command_id & sc_mask) == SC_RESTORE && !is_minimized_) { is_maximized_ = false; if (shell()) shell()->SendEvent("unmaximize"); } #endif return false; } void NativeWindowAura::HandleWMStateUpdate() { if (window_->IsMaximized()) { if (!is_maximized_ && shell()) shell()->SendEvent("maximize"); is_maximized_ = true; }else if (is_maximized_) { if (shell()) shell()->SendEvent("unmaximize"); is_maximized_ = false; } if (window_->IsMinimized()) { if (!is_minimized_ && shell()) shell()->SendEvent("minimize"); is_minimized_ = true; }else if (is_minimized_) { if (shell()) shell()->SendEvent("restore"); is_minimized_ = false; } } bool NativeWindowAura::HandleSize(unsigned int param, const gfx::Size& size) { #if defined(OS_WIN) if (param == SIZE_MAXIMIZED) { is_maximized_ = true; if (shell()) shell()->SendEvent("maximize"); }else if (param == SIZE_RESTORED && is_maximized_) { is_maximized_ = false; if (shell()) shell()->SendEvent("unmaximize"); } #endif return false; } bool NativeWindowAura::ExecuteAppCommand(int command_id) { #if defined(OS_WIN) if (menu_) { menu_->menu_delegate_->ExecuteCommand(command_id, 0); menu_->menu_->UpdateStates(); } #endif return false; } void NativeWindowAura::SaveWindowPlacement(const gfx::Rect& bounds, ui::WindowShowState show_state) { // views::WidgetDelegate::SaveWindowPlacement(bounds, show_state); } void NativeWindowAura::OnViewWasResized() { // Set the window shape of the RWHV. #if defined(OS_WIN) DCHECK(window_); DCHECK(web_view_); gfx::Size sz = web_view_->size(); int height = sz.height(), width = sz.width(); gfx::Path path; path.addRect(0, 0, width, height); SetWindowRgn((HWND)web_contents()->GetNativeView(), (HRGN)path.CreateNativeRegion(), 1); SkRegion* rgn = new SkRegion; if (!window_->IsFullscreen()) { if (draggable_region()) rgn->op(*draggable_region(), SkRegion::kUnion_Op); if (!has_frame() && CanResize() && !window_->IsMaximized()) { rgn->op(0, 0, width, kResizeInsideBoundsSize, SkRegion::kUnion_Op); rgn->op(0, 0, kResizeInsideBoundsSize, height, SkRegion::kUnion_Op); rgn->op(width - kResizeInsideBoundsSize, 0, width, height, SkRegion::kUnion_Op); rgn->op(0, height - kResizeInsideBoundsSize, width, height, SkRegion::kUnion_Op); } } #if 0 //FIXME if (web_contents()->GetRenderViewHost()->GetView()) web_contents()->GetRenderViewHost()->GetView()->SetClickthroughRegion(rgn); #endif #endif } void NativeWindowAura::InstallEasyResizeTargeterOnContainer() { aura::Window* window = window_->GetNativeWindow(); gfx::Insets inset(kResizeInsideBoundsSize, kResizeInsideBoundsSize, kResizeInsideBoundsSize, kResizeInsideBoundsSize); // Add the EasyResizeWindowTargeter on the window, not its root window. The // root window does not have a delegate, which is needed to handle the event // in Linux. window->SetEventTargeter(scoped_ptr<ui::EventTargeter>( new wm::EasyResizeWindowTargeter(window, inset, inset))); } bool NativeWindowAura::ShouldDescendIntoChildForEventHandling( gfx::NativeView child, const gfx::Point& location) { #if defined(USE_AURA) if (child->Contains(web_view_->web_contents()->GetNativeView())) { // App window should claim mouse events that fall within the draggable // region. return !draggable_region_.get() || !draggable_region_->contains(location.x(), location.y()); } #endif return true; } gfx::NativeView NativeWindowAura::GetHostView() const { return window_->GetNativeView(); } gfx::Size NativeWindowAura::GetMaximumDialogSize() { return window_->GetWindowBoundsInScreen().size(); } gfx::Point NativeWindowAura::GetDialogPosition(const gfx::Size& size) { gfx::Size app_window_size = window_->GetWindowBoundsInScreen().size(); return gfx::Point(app_window_size.width() / 2 - size.width() / 2, app_window_size.height() / 2 - size.height() / 2); } void NativeWindowAura::AddObserver(web_modal::ModalDialogHostObserver* observer) { if (observer && !observer_list_.HasObserver(observer)) observer_list_.AddObserver(observer); } void NativeWindowAura::RemoveObserver(web_modal::ModalDialogHostObserver* observer) { observer_list_.RemoveObserver(observer); } } // namespace nw
redgecombe/nw.js
src/browser/native_window_aura.cc
C++
mit
34,767
package cz.tomasdvorak.eet.client.exceptions; /** * DNS lookup failed after timeout reached. */ public class DnsTimeoutException extends Exception { public DnsTimeoutException(final String message, final Throwable cause) { super(message, cause); } }
PavelCibulka/eet-client
src/main/java/cz/tomasdvorak/eet/client/exceptions/DnsTimeoutException.java
Java
mit
269