answer
stringlengths
15
1.25M
package org.renjin.primitives; import org.renjin.eval.Context; import org.renjin.eval.EvalException; import org.renjin.primitives.annotations.processor.ArgumentException; import org.renjin.primitives.annotations.processor.ArgumentIterator; import org.renjin.primitives.annotations.processor.WrapperRuntime; import org.renjin.primitives.files.Files; import org.renjin.sexp.BuiltinFunction; import org.renjin.sexp.DoubleVector; import org.renjin.sexp.Environment; import org.renjin.sexp.FunctionCall; import org.renjin.sexp.IntVector; import org.renjin.sexp.LogicalVector; import org.renjin.sexp.PairList; import org.renjin.sexp.SEXP; import org.renjin.sexp.StringVector; public class R$primitive$file$access extends BuiltinFunction { public R$primitive$file$access() { super("file.access"); } public SEXP apply(Context context, Environment environment, FunctionCall call, PairList args) { try { ArgumentIterator argIt = new ArgumentIterator(context, environment, args); SEXP s0 = argIt.evalNext(); SEXP s1 = argIt.evalNext(); if (!argIt.hasNext()) { return this.doApply(context, environment, s0, s1); } throw new EvalException("file.access: too many arguments, expected at most 2."); } catch (ArgumentException e) { throw new EvalException(context, "Invalid argument: %s. Expected:\n\tfile.access(character, integer(1))", e.getMessage()); } catch (EvalException e) { e.initContext(context); throw e; } catch (RuntimeException e) { throw e; } catch (Exception e) { throw new EvalException(e); } } public static SEXP doApply(Context context, Environment environment, FunctionCall call, String[] argNames, SEXP[] args) { try { if ((args.length) == 2) { return doApply(context, environment, args[ 0 ], args[ 1 ]); } } catch (EvalException e) { e.initContext(context); throw e; } catch (RuntimeException e) { throw e; } catch (Exception e) { throw new EvalException(e); } throw new EvalException("file.access: max arity is 2"); } public SEXP apply(Context context, Environment environment, FunctionCall call, String[] argNames, SEXP[] args) { return R$primitive$file$access.doApply(context, environment, call, argNames, args); } public static SEXP doApply(Context context, Environment environment, SEXP arg0, SEXP arg1) throws Exception { if ((arg0 instanceof StringVector)&&(((arg1 instanceof IntVector)||(arg1 instanceof DoubleVector))||(arg1 instanceof LogicalVector))) { return Files.fileAccess(context, ((StringVector) arg0), WrapperRuntime.convertToInt(arg1)); } else { throw new EvalException(String.format("Invalid argument:\n\tfile.access(%s, %s)\n\tExpected:\n\tfile.access(character, integer(1))", arg0 .getTypeName(), arg1 .getTypeName())); } } }
<p> This example shows how Telerik DatePicker for ASP.NET MVC is being validated through the built-in server-side validation capabilities of ASP.NET MVC. </p> <pre class="prettyprint"> &lt%= Html.ValidationSummary() %&gt; &lt% using (Html.BeginForm("Action", "Controller")) { %&gt &lt%= Html.Telerik().DatePicker() .Name("deliveryDate") %> &lt%= Html.ValidationMessage("deliveryDate", "*") %&gt &lt;input type="submit" value="Post" /&gt <% } %> </pre> <p> Additionally you can use <em>DatePickerFor</em> extension in order to create DatePicker for a concrete <em>Model property</em>. If it has <strong>Range</strong> attribute, DatePicker component will use it to define min and max date contraints. </p>
package com.baicai.util.help; import java.io.File; import java.io.FileWriter; import java.io.IOException; import java.text.SimpleDateFormat; import java.util.Date; import org.beetl.core.Configuration; import org.beetl.core.GroupTemplate; import org.beetl.core.Template; import org.beetl.core.resource.FileResourceLoader; /** * * @Description: beetlmodel * @author waitfox@qq.com * @date 2016116 11:31:04 * @version V1.0 */ public class GenModel { public static final String RESOURCEPATH = "F:/data/eclipse/p2p/src/test/resources"; public static void generetor(String tableName) throws IOException { FileResourceLoader resourceLo = new FileResourceLoader(RESOURCEPATH, "utf-8"); resourceLo.setRoot(RESOURCEPATH); Configuration config = Configuration.<API key>(); config.getResourceMap().put("root", null);// root GroupTemplate gt = new GroupTemplate(resourceLo, config); Template t = gt.getTemplate("model.htm"); TableBean tb = Generator.getTable(tableName); String date = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss").format(new Date()); t.binding("table", tb); t.binding("package", Generator.PACKAGE_BASE); t.binding("createDate", date); String str = t.render(); System.out.println(str); File f = new File(Generator.OUTPUT_PATH+tb.<API key>()+".java"); FileWriter fw; try { fw = new FileWriter(f);// FileWriter fw.write(str); fw.close(); } catch (IOException e) { e.printStackTrace(); } } public static void main(String[] args) throws IOException { generetor("p2p_project"); } }
package files import ( "bytes" "io" "io/ioutil" "strings" "github.com/golang/protobuf/proto" "github.com/octavore/nagax/util/errors" uuid "github.com/satori/go.uuid" "github.com/willnorris/imageproxy" "github.com/ketchuphq/ketchup/proto/ketchup/models" ) func (m *Module) Upload(filename string, wr io.Reader) (*models.File, error) { // files are assigned a random id when stored to discourage manual renaming of files filename = strings.TrimPrefix(filename, "/") file, err := m.DB.GetFileByName(filename) if err != nil { return nil, errors.Wrap(err) } if file == nil || file.GetUuid() == "" { file = &models.File{ Uuid: proto.String(uuid.NewV4().String()), Name: proto.String(filename), } } err = m.store.Upload(file.GetUuid(), wr) if err != nil { return nil, errors.Wrap(err) } err = m.DB.UpdateFile(file) if err != nil { return nil, errors.Wrap(err) } return file, nil } // Get returns a reader, and nil, nil if file is not found func (m *Module) Get(filename string) (io.ReadCloser, error) { filename = strings.TrimPrefix(filename, "/") file, err := m.DB.GetFileByName(filename) if err != nil { return nil, errors.Wrap(err) } if file == nil { return nil, nil } return m.store.Get(file.GetUuid()) } // Get returns a reader, and nil, nil if file is not found func (m *Module) Delete(uuid string) error { file, err := m.DB.GetFile(uuid) if err != nil { return errors.Wrap(err) } if file == nil { return nil } err = m.DB.DeleteFile(file) if err != nil { return errors.Wrap(err) } return m.store.Delete(file.GetUuid()) } // GetWithTransform attempts to transform the image func (m *Module) GetWithTransform(filename string, optStr string) (io.ReadCloser, error) { filename = strings.TrimPrefix(filename, "/") r, err := m.Get(filename) if r == nil || err != nil || optStr == "" { return r, err } defer r.Close() data, err := ioutil.ReadAll(r) if err != nil { return nil, errors.Wrap(err) } opts := imageproxy.ParseOptions(optStr) output, err := imageproxy.Transform(data, opts) if err != nil { return nil, errors.Wrap(err) } return ioutil.NopCloser(bytes.NewBuffer(output)), nil }
<!-- Do not edit this file. It is automatically generated by API Documenter. --> [Home](./index.md) &gt; [puppeteer](./puppeteer.md) &gt; [Protocol](./puppeteer.protocol.md) &gt; [SystemInfo](./puppeteer.protocol.systeminfo.md) &gt; [GPUInfo](./puppeteer.protocol.systeminfo.gpuinfo.md) &gt; [videoEncoding](./puppeteer.protocol.systeminfo.gpuinfo.videoencoding.md) ## Protocol.SystemInfo.GPUInfo.videoEncoding property Supported accelerated video encoding capabilities. <b>Signature:</b> typescript videoEncoding: <API key>[];
sap.ui.define(['sap/ui/webc/common/thirdparty/base/asset-registries/Icons'], function (Icons) { 'use strict'; const name = "status-completed"; const pathData = "M256 0q53 0 99.5 20T437 75t55 81.5 20 99.5-20 99.5-55 81.5-81.5 55-99.5 20-99.5-20T75 437t-55-81.5T0 256t20-99.5T75 75t81.5-55T256 0zM128 256q-14 0-23 9t-9 23q0 12 9 23l64 64q11 9 23 9 13 0 23-9l192-192q9-11 9-23 0-13-9.5-22.5T384 128q-12 0-23 9L192 <API key>"; const ltr = false; const collection = "SAP-icons-v5"; const packageName = "@ui5/webcomponents-icons"; Icons.registerIcon(name, { pathData, ltr, collection, packageName }); var pathDataV4 = { pathData }; return pathDataV4; });
package com.yueny.demo.downlatch.holder; import java.util.List; import java.util.Vector; import org.apache.commons.collections4.CollectionUtils; import com.yueny.demo.downlatch.bo.RecoverResult; /** * @author yueny09 <deep_blue_yang@163.com> * * @DATE 2016322 1:15:25 * */ public class TransResultHolder { private final List<RecoverResult> failList = new Vector<RecoverResult>(); private Integer recoverCount = 0; private final List<String> succList = new Vector<String>(); public synchronized void addResults(final List<RecoverResult> resultList) { if (!CollectionUtils.isEmpty(resultList)) { recoverCount += resultList.size(); for (final RecoverResult recoverResult : resultList) { if (recoverResult.isSucc()) { succList.add(recoverResult.getTransId()); } else { failList.add(recoverResult); } } } } public synchronized List<RecoverResult> getFailList() { return failList; } public synchronized Integer getRecoverCount() { return recoverCount; } public synchronized List<String> getSuccList() { return succList; } }
using System.Collections.Generic; using System.Data.Entity; using System.Linq; using System.Web.Http; using Divergent.Sales.Data.Context; namespace Divergent.Sales.API.Controllers { [RoutePrefix("api/orders")] public class OrdersController : ApiController { private readonly ISalesContext _context; public OrdersController(ISalesContext context) { _context = context; } [HttpGet] public IEnumerable<dynamic> Get(int p = 0, int s = 10) { var orders = _context.Orders .Include(i => i.Items) .Include(i => i.Items.Select(x => x.Product)) .ToArray(); return orders .Skip(p * s) .Take(s) .Select(o => new { o.Id, o.CustomerId, ProductIds = o.Items.Select(i => i.Product.Id), ItemsCount = o.Items.Count }); } } }
from google.appengine.ext import db class Stuff (db.Model): owner = db.UserProperty(required=True, auto_current_user=True) pulp = db.BlobProperty() class Greeting(db.Model): author = db.UserProperty() content = db.StringProperty(multiline=True) avatar = db.BlobProperty() date = db.DateTimeProperty(auto_now_add=True) class Placebo(db.Model): developer = db.StringProperty() OID = db.StringProperty() concept = db.StringProperty() category = db.StringProperty() taxonomy = db.StringProperty() taxonomy_version = db.StringProperty() code = db.StringProperty() descriptor = db.StringProperty()
using System; using System.Collections.Generic; using System.Linq; using System.Text; using LCL.Domain.Model; using LCL.Domain.Specifications; namespace LCL.Domain.Repositories.Specifications { public class <API key> : Specification<SalesOrder> { private readonly Guid orderID; public <API key>(Guid orderID) { this.orderID = orderID; } public override System.Linq.Expressions.Expression<Func<SalesOrder, bool>> GetExpression() { return p => p.ID == orderID; } } }
var baseClone = require('./_baseClone'); function cloneWith(value, customizer) { customizer = typeof customizer == 'function' ? customizer : undefined; return baseClone(value, false, true, customizer); } module.exports = cloneWith;
<!DOCTYPE HTML PUBLIC "- <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (1.8.0_45) on Tue Jul 28 00:20:21 PDT 2015 --> <title>Uses of Package org.apache.zookeeper.client (ZooKeeper 3.5.1-alpha API)</title> <meta name="date" content="2015-07-28"> <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="Uses of Package org.apache.zookeeper.client (ZooKeeper 3.5.1-alpha API)"; } } catch(err) { } </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <div class="topNav"><a name="navbar.top"> </a> <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.top.firstrow"> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li>Class</li> <li class="navBarCell1Rev">Use</li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../index-all.html">Index</a></li> <li><a href="../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../index.html?org/apache/zookeeper/client/package-use.html" target="_top">Frames</a></li> <li><a href="package-use.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="<API key>"> <li><a href="../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><! allClassesLink = document.getElementById("<API key>"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } </script> </div> <a name="skip.navbar.top"> </a></div> <div class="header"> <h1 title="Uses of Package org.apache.zookeeper.client" class="title">Uses of Package<br>org.apache.zookeeper.client</h1> </div> <div class="contentContainer">No usage of org.apache.zookeeper.client</div> <div class="bottomNav"><a name="navbar.bottom"> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.bottom.firstrow"> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li>Class</li> <li class="navBarCell1Rev">Use</li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../index-all.html">Index</a></li> <li><a href="../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../index.html?org/apache/zookeeper/client/package-use.html" target="_top">Frames</a></li> <li><a href="package-use.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="<API key>"> <li><a href="../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><! allClassesLink = document.getElementById("<API key>"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } </script> </div> <a name="skip.navbar.bottom"> </a></div> <p class="legalCopy"><small>Copyright &copy; 2015 The Apache Software Foundation</small></p> </body> </html>
This quick start guide will teach you how to wire up TypeScript with [Knockout.js](http://knockoutjs.com/). We assume that you're already using [Node.js](https: # Lay out the project Let's start out with a new directory. We'll name it `proj` for now, but you can change it to whatever you want. shell mkdir proj cd proj To start, we're going to structure our project in the following way: text proj/ +- src/ +- built/ TypeScript files will start out in your `src` folder, run through the TypeScript compiler, and end up in `built`. Let's scaffold this out: shell mkdir src mkdir built # Install our build dependencies First ensure TypeScript and Typings are installed globally. shell npm install -g typescript typings You obviously know about TypeScript, but you might not know about Typings. [Typings](https: We'll now use Typings to grab declaration files for Knockout: shell typings install --global --save dt~knockout The `--global` flag will tell Typings to grab any declaration files from [DefinitelyTyped](https://github.com/DefinitelyTyped/DefinitelyTyped), a repository of community-authored `.d.ts` files. This command will create a file called `typings.json` and a folder called `typings` in the current directory. # Grab our runtime dependencies We'll need to grab Knockout itself, as well as something called RequireJS. [RequireJS](http: There are several ways we can go about this: 1. Download the files manually and host them. 2. Download the files through a package manager like [Bower](http://bower.io/) and host them. 3. Use a Content Delivery Network (CDN) to host both files. We'll keep it simple and go with the first option, but Knockout's documentation has [details on using a CDN](http: Let's create an `externals` folder in the root of our project. shell mkdir externals Now [download Knockout](http://knockoutjs.com/downloads/index.html) and [download RequireJS](http://www.requirejs.org/docs/download.html#latest) into that folder. The latest and minified versions of the files should work just fine. # Add a TypeScript configuration file You'll want to bring your TypeScript files together - both the code you'll be writing as well as any necessary declaration files. To do this, you'll need to create a `tsconfig.json` which contains a list of your input files as well as all your compilation settings. Simply create a new file in your project root named `tsconfig.json` and fill it with the following contents: json { "compilerOptions": { "outDir": "./built/", "sourceMap": true, "noImplicitAny": true, "module": "amd", "target": "es5" }, "files": [ "./typings/index.d.ts", "./src/require-config.ts", "./src/hello.ts" ] } We're including `typings/index.d.ts`, which Typings created for us. That file automatically includes all of your installed dependencies. You can learn more about `tsconfig.json` files [here](../tsconfig.json.md). # Write some code Let's write our first TypeScript file using Knockout. First, create a new file in your `src` directory named `hello.ts`. ts import * as ko from "knockout"; class HelloViewModel { language: KnockoutObservable<string> framework: KnockoutObservable<string> constructor(language: string, framework: string) { this.language = ko.observable(language); this.framework = ko.observable(framework); } } ko.applyBindings(new HelloViewModel("TypeScript", "Knockout")); Next, we'll create a file named `require-config.ts` in `src` as well. ts declare var require: any; require.config({ paths: { "knockout": "externals/knockout-3.4.0", } }); This file will tell RequireJS where to find Knockout when we import it, just like we did in `hello.ts`. Any page that you create should include this immediately after RequireJS, but before importing anything else. To get a better understanding of this file and how to configure RequireJS, you can [read up on its documentation](http://requirejs.org/docs/api.html#config). We'll also need a view to display our `HelloViewModel`. Create a file at the root of `proj` named `index.html` with the following contents: html <!DOCTYPE html> <html> <head> <meta charset="UTF-8" /> <title>Hello Knockout!</title> </head> <body> <p> Hello from <strong data-bind="text: language">todo</strong> and <strong data-bind="text: framework">todo</strong>! </p> <p>Language: <input data-bind="value: language" /></p> <p>Framework: <input data-bind="value: framework" /></p> <script src="./externals/require.js"></script> <script src="./built/require-config.js"></script> <script> require(["built/hello"]); </script> </body> </html> Notice there are three script tags. First, we're including RequireJS itself. Then we're mapping the paths of our external dependencies in `require-config.js` so that RequireJS knows where to look for them. Finally, we're calling `require` with a list of modules we'd like to load. # Putting it all together Just run: shell tsc Now open up `index.html` in your favorite browser and everything should be ready to use! You should see a page that says "Hello from TypeScript and Knockout!" Below that, you'll also see two input boxes. As you modify their contents and switch focus, you'll see that the original message changes.
package testPpermission; import android.annotation.TargetApi; import android.app.Application; import android.os.Build; public class App extends Application { @TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH) @Override public void onCreate() { super.onCreate(); this.<API key>(new AppLifeCycle() ); } }
<!DOCTYPE html> <html lang="en"> <head> <meta http-equiv="refresh" content="0;URL=type.U27.html"> </head> <body> <p>Redirecting to <a href="type.U27.html">type.U27.html</a>...</p> <script>location.replace("type.U27.html" + location.search + location.hash);</script> </body> </html>
package com.couchbase.lite.testapp.ektorp.tests; import org.ektorp.support.OpenCouchDbDocument; import java.util.List; import java.util.Set; @SuppressWarnings("serial") public class TestObject extends OpenCouchDbDocument { private Integer foo; private Boolean bar; private String baz; private String status; private String key; private List<String> stuff; private Set<String> stuffSet; public Set<String> getStuffSet() { return stuffSet; } public void setStuffSet(Set<String> stuffSet) { this.stuffSet = stuffSet; } public List<String> getStuff() { return stuff; } public void setStuff(List<String> stuff) { this.stuff = stuff; } public Integer getFoo() { return foo; } public void setFoo(Integer foo) { this.foo = foo; } public Boolean getBar() { return bar; } public void setBar(Boolean bar) { this.bar = bar; } public String getBaz() { return baz; } public void setBaz(String baz) { this.baz = baz; } public String getStatus() { return status; } public void setStatus(String status) { this.status = status; } public String getKey() { return key; } public void setKey(String key) { this.key = key; } public TestObject() { } public TestObject(Integer foo, Boolean bar, String baz) { this.foo = foo; this.bar = bar; this.baz = baz; this.status = null; } public TestObject(Integer foo, Boolean bar, String baz, String status) { this.foo = foo; this.bar = bar; this.baz = baz; this.status = status; } public TestObject(String id, String key) { this.setId(id); this.key = key; } @Override public boolean equals(Object o) { if(o instanceof TestObject) { TestObject other = (TestObject)o; if(getId() != null && other.getId() != null && getId().equals(other.getId())) { return true; } } return false; } }
package libgbust import ( "io/ioutil" "net/http" "net/url" "unicode/utf8" ) // CheckDir is used to execute a directory check func (a *Attacker) CheckDir(word string) *Result { end, err := url.Parse(word) if err != nil { return &Result{ Msg: "[!] failed to parse word", Err: err, } } fullURL := a.config.URL.ResolveReference(end) req, err := http.NewRequest("GET", fullURL.String(), nil) if err != nil { return &Result{ Msg: "[!] failed to create new request", Err: err, } } for _, cookie := range a.config.Cookies { req.Header.Set("Cookie", cookie) } resp, err := a.client.Do(req) if err != nil { return &Result{ Err: err, Msg: "[!] failed to do request", } } defer resp.Body.Close() length := new(int64) if resp.ContentLength <= 0 { body, err := ioutil.ReadAll(resp.Body) if err == nil { *length = int64(utf8.RuneCountInString(string(body))) } } else { *length = resp.ContentLength } return &Result{ StatusCode: resp.StatusCode, Size: length, URL: resp.Request.URL, } }
# Amyridaceae Kunth FAMILY # Status SYNONYM # According to GRIN Taxonomy for Plants # Published in null # Original name null Remarks null
package chatty.util.api; import chatty.Helper; import chatty.util.DateTime; import java.util.LinkedHashMap; import java.util.Locale; import java.util.logging.Logger; /** * Holds the current info (name, viewers, title, game) of a stream, as well * as a history of the same information and stuff like when the info was * last requested, whether it's currently waiting for an API response etc. * * @author tduva */ public class StreamInfo { private static final Logger LOGGER = Logger.getLogger(StreamInfo.class.getName()); /** * All lowercase name of the stream */ public final String stream; /** * Correctly capitalized name of the stream. May be null if no set. */ private String display_name; private long lastUpdated = 0; private long lastStatusChange = 0; private String status = ""; private String game = ""; private int viewers = 0; private long startedAt = -1; private long lastOnline = -1; private long startedAtWithPicnic = -1; private boolean online = false; private boolean updateSucceeded = false; private int updateFailedCounter = 0; private boolean requested = false; private boolean followed = false; /** * The time the stream was changed from online -> offline, so recheck if * that actually is correct after some time. If this is -1, then do nothing. * Should be set to -1 with EVERY update (received data), except when it's * not already -1 on the change from online -> offline (to avoid request * spam if recheckOffline() is always true). */ private long recheckOffline = -1; // When the viewer stats where last calculated private long lastViewerStats; // How long at least between viewer stats calculations private static final int VIEWERSTATS_DELAY = 30*60*1000; // How long a stats range can be at most private static final int <API key> = 35*60*1000; private static final int <API key> = 10*1000; /** * Maximum length in seconds of what should count as a PICNIC (short stream * offline period), to set the online time with PICNICs correctly. */ private static final int MAX_PICNIC_LENGTH = 600; /** * The current full status (title + game), updated when new data is set. */ private String currentFullStatus; private String prevFullStatus; private final LinkedHashMap<Long,<API key>> history = new LinkedHashMap<>(); private int expiresAfter = 300; private final StreamInfoListener listener; public StreamInfo(String stream, StreamInfoListener listener) { this.listener = listener; this.stream = stream.toLowerCase(Locale.ENGLISH); } private void streamInfoUpdated() { if (listener != null) { listener.streamInfoUpdated(this); } } public void setRequested() { this.requested = true; } public boolean isRequested() { return requested; } private void <API key>() { lastStatusChange = System.currentTimeMillis(); if (listener != null) { listener.<API key>(this, getFullStatus()); } } @Override public String toString() { return "Online: "+online+ " Status: "+status+ " Game: "+game+ " Viewers: "+viewers; } public String getFullStatus() { return currentFullStatus; } private String makeFullStatus() { if (online) { String fullStatus = status; if (status == null) { fullStatus = "No stream title set"; } if (game != null) { fullStatus += " ("+game+")"; } return fullStatus; } else if (!updateSucceeded) { return ""; } else { return "Stream offline"; } } public String getStream() { return stream; } /** * The correctly capitalized name of the stream, or the all lowercase name * if correctly capitalized name is not set. * * @return The correctly capitalized name or all lowercase name */ public String getDisplayName() { return display_name != null ? display_name : stream; } /** * Whether a correctly capitalized name is set, which if true is returned * by {@see getDisplayName()}. * * @return true if a correctly capitalized name is set, false otherwise */ public boolean hasDisplayName() { return display_name != null; } /** * Sets the correctly capitalized name for this stream. * * @param name The correctly capitalized name */ public void setDisplayName(String name) { this.display_name = name; } /** * Set stream info from followed streams request. * * @param status The current stream title * @param game The current game being played * @param viewers The current viewercount * @param startedAt The timestamp when the stream was started, -1 if not set */ public void setFollowed(String status, String game, int viewers, long startedAt) { //System.out.println(status); followed = true; boolean saveToHistory = false; if (hasExpired()) { saveToHistory = true; } set(status, game, viewers, startedAt, saveToHistory); } /** * Set stream info from a regular stream info request. * * @param status The current stream title * @param game The current game being played * @param viewers The current viewercount * @param startedAt The timestamp when the stream was started, -1 if not set */ public void set(String status, String game, int viewers, long startedAt) { set(status, game, viewers, startedAt, true); } /** * This should only be used when the update was successful. * * @param status The current title of the stream * @param game The current game * @param viewers The current viewercount * @param startedAt The timestamp when the stream was started, -1 if not set * @param saveToHistory Whether to save the data to history */ private void set(String status, String game, int viewers, long startedAt, boolean saveToHistory) { this.status = Helper.trim(Helper.removeLinebreaks(status)); this.game = Helper.trim(game); this.viewers = viewers; // Always set to -1 (do nothing) when stream is set as online, but also // output a message if necessary if (recheckOffline != -1) { if (this.startedAt < startedAt) { LOGGER.info("StreamInfo " + stream + ": Stream not offline anymore"); } else { LOGGER.info("StreamInfo " + stream + ": Stream not offline"); } } recheckOffline = -1; if (lastOnlineAgo() > MAX_PICNIC_LENGTH) { // Only update online time with PICNICs when offline time was long // enough (of course also depends on what stream data Chatty has) this.startedAtWithPicnic = startedAt; } this.startedAt = startedAt; this.lastOnline = System.currentTimeMillis(); this.online = true; if (saveToHistory) { addHistoryItem(System.currentTimeMillis(),new <API key>(viewers, status, game)); } setUpdateSucceeded(true); } public void setExpiresAfter(int expiresAfter) { this.expiresAfter = expiresAfter; } public void setUpdateFailed() { setUpdateSucceeded(false); } private void setUpdateSucceeded(boolean succeeded) { updateSucceeded = succeeded; setUpdated(); if (succeeded) { updateFailedCounter = 0; } else { updateFailedCounter++; if (recheckOffline != -1) { // If an offline check is pending and the update failed, then // just set as offline now (may of course not be accurate at all // anymore). LOGGER.warning("StreamInfo "+stream+": Update failed, delayed setting offline"); setOffline(); } } currentFullStatus = makeFullStatus(); if (succeeded && !currentFullStatus.equals(prevFullStatus) || lastUpdateLongAgo()) { prevFullStatus = currentFullStatus; <API key>(); } // Call at the end, so stuff is already updated streamInfoUpdated(); } public void setOffline() { // If switching from online to offline if (online && recheckOffline == -1) { LOGGER.info("Waiting to recheck offline status for " + stream); recheckOffline = System.currentTimeMillis(); } else { if (recheckOffline != -1) { //addHistoryItem(recheckOffline, new <API key>()); LOGGER.info("Offline after check: "+stream); } recheckOffline = -1; this.online = false; addHistoryItem(System.currentTimeMillis(), new <API key>()); } setUpdateSucceeded(true); } /** * Whether to recheck the offline status by requesting the stream status * again earlier than usual. * * @return true if it should be checked, false otherwise */ public boolean recheckOffline() { return recheckOffline != -1 && System.currentTimeMillis() - recheckOffline > <API key>; } public boolean getFollowed() { return followed; } public boolean getOnline() { return this.online; } /** * The time the stream was started. As always, this may contain stale data * if the stream info is not valid or the stream offline. * * @return The timestamp or -1 if no time was received */ public long getTimeStarted() { return startedAt; } /** * The time the stream was started, including short disconnects (max 10 * minutes). If there was no disconnect, then the time is equal to * getTimeStarted(). As always, this may contain stale data if the stream * info is not valid or the stream offline. * * @return The timestamp or -1 if not time was received or the time is * invalid */ public long <API key>() { return startedAtWithPicnic; } /** * How long ago the stream was last online. If the stream was never seen as * online this session, then a huge number will be returned. * * @return The number of seconds that have passed since the stream was last * seen as online */ public long lastOnlineAgo() { return (System.currentTimeMillis() - lastOnline) / 1000; } public long getLastOnlineTime() { return lastOnline; } private void setUpdated() { lastUpdated = System.currentTimeMillis() / 1000; requested = false; } // Getters /** * Gets the status stored for this stream. May not be correct, check * isValid() before using any data. * * @return */ public String getStatus() { return status; } /** * Gets the title stored for this stream, which is the same as the status, * unless the status is null. As opposed to getStatus() this never returns * null. * * @return */ public String getTitle() { if (status == null) { return "No stream title set"; } return status; } /** * Gets the game stored for this stream. May not be correct, check * isValid() before using any data. * * @return */ public String getGame() { return game; } /** * Gets the viewers stored for this stream. May not be correct, check * isValid() before using any data. * * @return */ public int getViewers() { return viewers; } /** * Calculates the number of seconds that passed after the last update * * @return Number of seconds that have passed after the last update */ public long getUpdatedDelay() { return (System.currentTimeMillis() / 1000) - lastUpdated; } /** * Checks if the info should be updated. The stream info takes longer * to expire when there were failed attempts at downloading the info from * the API. This only affects hasExpired(), not isValid(). * * @return true if the info should be updated, false otherwise */ public boolean hasExpired() { return getUpdatedDelay() > expiresAfter * (1+ updateFailedCounter / 2); } /** * Checks if the info is valid, taking into account if the last request * succeeded and how old the data is. * * @return true if the info can be used, false otherwise */ public boolean isValid() { if (!updateSucceeded || getUpdatedDelay() > expiresAfter*2) { return false; } return true; } public boolean lastUpdateLongAgo() { if (updateSucceeded && getUpdatedDelay() > expiresAfter*4) { return true; } return false; } /** * Returns the number of seconds the last status change is ago. * * @return */ public long <API key>() { return (System.currentTimeMillis() - lastStatusChange) / 1000; } public long getStatusChangeTime() { return lastStatusChange; } private void addHistoryItem(Long time, <API key> item) { synchronized(history) { history.put(time, item); } } public LinkedHashMap<Long,<API key>> getHistory() { synchronized(history) { return new LinkedHashMap<>(history); } } /** * Create a summary of the viewercount in the interval that hasn't been * calculated yet (delay set as a constant). * * @param force Get stats even if the delay hasn't passed yet. * @return */ public ViewerStats getViewerStats(boolean force) { synchronized(history) { if (lastViewerStats == 0 && !force) { // No stats output yet, so assume current time as start, so // it's output after the set delay lastViewerStats = System.currentTimeMillis() - 5000; } long timePassed = System.currentTimeMillis() - lastViewerStats; if (!force && timePassed < VIEWERSTATS_DELAY) { return null; } long startAt = lastViewerStats+1; // Only calculate the max length if (timePassed > <API key>) { startAt = System.currentTimeMillis() - <API key>; } int min = -1; int max = -1; int total = 0; int count = 0; long firstTime = -1; long lastTime = -1; StringBuilder b = new StringBuilder(); // Initiate with -2, because -1 already means offline int prevViewers = -2; for (long time : history.keySet()) { if (time < startAt) { continue; } // Start doing anything for values >= startAt // Update so that it contains the last value that was looked at // at the end of this method lastViewerStats = time; int viewers = history.get(time).getViewers(); // Append to viewercount development String if (prevViewers > -1 && viewers != -1) { // If there is a prevViewers set and if online int diff = viewers - prevViewers; if (diff >= 0) { b.append("+"); } b.append(Helper.formatViewerCount(diff)); } else if (viewers != -1) { if (prevViewers == -1) { // Previous was offline, so show that b.append("_"); } b.append(Helper.formatViewerCount(viewers)); } prevViewers = viewers; if (viewers == -1) { continue; } // Calculate min/max/sum/count only when online if (firstTime == -1) { firstTime = time; } lastTime = time; if (viewers > max) { max = viewers; } if (min == -1 || viewers < min) { min = viewers; } total += viewers; count++; } // After going through all values, do some finishing work if (prevViewers == -1) { // Last value was offline, so show that b.append("_"); } if (count == 0) { return null; } int avg = total / count; return new ViewerStats(min, max, avg, firstTime, lastTime, count, b.toString()); } } /** * Holds a set of immutable values that make up viewerstats. */ public static class ViewerStats { public final int max; public final int min; public final int avg; public final long startTime; public final long endTime; public final int count; public final String history; public ViewerStats(int min, int max, int avg, long startTime, long endTime, int count, String history) { this.max = max; this.min = min; this.avg = avg; this.startTime = startTime; this.endTime = endTime; this.count = count; this.history = history; } /** * Which duration the data in this stats covers. This is not necessarily * the whole duration that was worked with (e.g. if the stream went * offline at the end, that data may not be included). This is the range * between the first and last valid data point. * * @return The number of seconds this data covers. */ public long duration() { return (endTime - startTime) / 1000; } /** * Checks if these viewerstats contain any viewer data. * * @return */ public boolean isValid() { // If min was set to another value than the initial one, then this // means at least one data point with a viewercount was there. return min != -1; } @Override public String toString() { return "Viewerstats ("+DateTime.format2(startTime) +"-"+DateTime.format2(endTime)+"):" + " avg:"+Helper.formatViewerCount(avg) + " min:"+Helper.formatViewerCount(min) + " max:"+Helper.formatViewerCount(max) + " ["+count+"/"+history+"]"; } } }
# Authorized Buyers Marketplace API Client Library for Java The Authorized Buyers Marketplace API allows buyers programmatically discover inventory; propose, retrieve and negotiate deals with publishers. This page contains information about getting started with the Authorized Buyers Marketplace API using the Google API Client Library for Java. In addition, you may be interested in the following documentation: * Browse the [Javadoc reference for the Authorized Buyers Marketplace API][javadoc] * Read the [Developer's Guide for the Google API Client Library for Java][google-api-client]. * Interact with this API in your browser using the [APIs Explorer for the Authorized Buyers Marketplace API][api-explorer] ## Installation Maven Add the following lines to your `pom.xml` file: xml <project> <dependencies> <dependency> <groupId>com.google.apis</groupId> <artifactId>google-api-services-<API key></artifactId> <version>v1-rev20220212-1.32.1</version> </dependency> </dependencies> </project> Gradle gradle repositories { mavenCentral() } dependencies { implementation 'com.google.apis:google-api-services-<API key>:v1-rev20220212-1.32.1' } [javadoc]: https://googleapis.dev/java/google-api-services-<API key>/latest/index.html [google-api-client]: https://github.com/googleapis/<API key>/ [api-explorer]: https://developers.google.com/apis-explorer/#p/<API key>/v1/
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0" /> <title>Bootstrap3MeAdmin </title> <link href="bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" /> <!--[if lt IE 9]> <link rel="stylesheet" type="text/css" href="plugins/jquery-ui/jquery.ui.1.10.2.ie.css" /> <![endif] <link href="assets/css/main.css" rel="stylesheet" type="text/css" /> <link href="assets/css/plugins.css" rel="stylesheet" type="text/css" /> <link href="assets/css/responsive.css" rel="stylesheet" type="text/css" /> <link href="assets/css/icons.css" rel="stylesheet" type="text/css" /> <link rel="stylesheet" href="assets/css/fontawesome/font-awesome.min.css"> <!--[if IE 7]> <link rel="stylesheet" href="assets/css/fontawesome/font-awesome-ie7.min.css"> <![endif] <!--[if IE 8]> <link href="assets/css/ie8.css" rel="stylesheet" type="text/css" /> <![endif] <link href='http://fonts.useso.com/css?family=Open+Sans:400,600,700' rel='stylesheet' type='text/css'> <script type="text/javascript" src="assets/js/libs/jquery-1.10.2.min.js"> </script> <script type="text/javascript" src="plugins/jquery-ui/jquery-ui-1.10.2.custom.min.js"> </script> <script type="text/javascript" src="bootstrap/js/bootstrap.min.js"> </script> <script type="text/javascript" src="assets/js/libs/lodash.compat.min.js"> </script> <!--[if lt IE 9]> <script src="assets/js/libs/html5shiv.js"> </script> <![endif] <script type="text/javascript" src="plugins/touchpunch/jquery.ui.touch-punch.min.js"> </script> <script type="text/javascript" src="plugins/event.swipe/jquery.event.move.js"> </script> <script type="text/javascript" src="plugins/event.swipe/jquery.event.swipe.js"> </script> <script type="text/javascript" src="assets/js/libs/breakpoints.js"> </script> <script type="text/javascript" src="plugins/respond/respond.min.js"> </script> <script type="text/javascript" src="plugins/cookie/jquery.cookie.min.js"> </script> <script type="text/javascript" src="plugins/slimscroll/jquery.slimscroll.min.js"> </script> <script type="text/javascript" src="plugins/slimscroll/jquery.slimscroll.horizontal.min.js"> </script> <script type="text/javascript" src="plugins/sparkline/jquery.sparkline.min.js"> </script> <script type="text/javascript" src="plugins/daterangepicker/moment.min.js"> </script> <script type="text/javascript" src="plugins/daterangepicker/daterangepicker.js"> </script> <script type="text/javascript" src="plugins/blockui/jquery.blockUI.min.js"> </script> <script type="text/javascript" src="assets/js/app.js"> </script> <script type="text/javascript" src="assets/js/plugins.js"> </script> <script type="text/javascript" src="assets/js/plugins.form-components.js"> </script> <script> $(document).ready(function() { App.init(); Plugins.init(); FormComponents.init() }); </script> <script type="text/javascript" src="assets/js/custom.js"> </script> </head> <body> <header class="header navbar navbar-fixed-top" role="banner"> <div class="container"> <ul class="nav navbar-nav"> <li class="nav-toggle"> <a href="javascript:void(0);" title=""> <i class="icon-reorder"> </i> </a> </li> </ul> <a class="navbar-brand" href="index.html"> <img src="assets/img/logo.png" alt="logo" /> <strong> Me </strong> Admin </a> <a href="#" class="toggle-sidebar bs-tooltip" data-placement="bottom" data-original-title="Toggle navigation"> <i class="icon-reorder"> </i> </a> <ul class="nav navbar-nav navbar-left hidden-xs hidden-sm"> <li> <a href=" Dashboard </a> </li> <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown"> Dropdown <i class="icon-caret-down small"> </i> </a> <ul class="dropdown-menu"> <li> <a href=" <i class="icon-user"> </i> Example </a> </li> <li> <a href=" <i class="icon-calendar"> </i> Example </a> </li> <li class="divider"> </li> <li> <a href=" <i class="icon-tasks"> </i> Example </a> </li> </ul> </li> </ul> <ul class="nav navbar-nav navbar-right"> <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown"> <i class="icon-warning-sign"> </i> <span class="badge"> 5 </span> </a> <ul class="dropdown-menu extended notification"> <li class="title"> <p> You have 5 new notifications </p> </li> <li> <a href="javascript:void(0);"> <span class="label label-success"> <i class="icon-plus"> </i> </span> <span class="message"> New user registration. </span> <span class="time"> 1 mins </span> </a> </li> <li> <a href="javascript:void(0);"> <span class="label label-danger"> <i class="icon-warning-sign"> </i> </span> <span class="message"> High CPU load on cluster </span> <span class="time"> 5 mins </span> </a> </li> <li> <a href="javascript:void(0);"> <span class="label label-success"> <i class="icon-plus"> </i> </span> <span class="message"> New user registration. </span> <span class="time"> 10 mins </span> </a> </li> <li> <a href="javascript:void(0);"> <span class="label label-info"> <i class="icon-bullhorn"> </i> </span> <span class="message"> New items are in queue. </span> <span class="time"> 25 mins </span> </a> </li> <li> <a href="javascript:void(0);"> <span class="label label-warning"> <i class="icon-bolt"> </i> </span> <span class="message"> Disk space to 85% full. </span> <span class="time"> 55 mins </span> </a> </li> <li class="footer"> <a href="javascript:void(0);"> View all notifications </a> </li> </ul> </li> <li class="dropdown hidden-xs hidden-sm"> <a href="#" class="dropdown-toggle" data-toggle="dropdown"> <i class="icon-tasks"> </i> <span class="badge"> 7 </span> </a> <ul class="dropdown-menu extended notification"> <li class="title"> <p> You have 7 pending tasks </p> </li> <li> <a href="javascript:void(0);"> <span class="task"> <span class="desc"> Preparing new release </span> <span class="percent"> 30% </span> </span> <div class="progress progress-small"> <div style="width: 30%;" class="progress-bar progress-bar-info"> </div> </div> </a> </li> <li> <a href="javascript:void(0);"> <span class="task"> <span class="desc"> Change management </span> <span class="percent"> 80% </span> </span> <div class="progress progress-small progress-striped active"> <div style="width: 80%;" class="progress-bar progress-bar-danger"> </div> </div> </a> </li> <li> <a href="javascript:void(0);"> <span class="task"> <span class="desc"> Mobile development </span> <span class="percent"> 60% </span> </span> <div class="progress progress-small"> <div style="width: 60%;" class="progress-bar <API key>"> </div> </div> </a> </li> <li> <a href="javascript:void(0);"> <span class="task"> <span class="desc"> Database migration </span> <span class="percent"> 20% </span> </span> <div class="progress progress-small"> <div style="width: 20%;" class="progress-bar <API key>"> </div> </div> </a> </li> <li class="footer"> <a href="javascript:void(0);"> View all tasks </a> </li> </ul> </li> <li class="dropdown hidden-xs hidden-sm"> <a href="#" class="dropdown-toggle" data-toggle="dropdown"> <i class="icon-envelope"> </i> <span class="badge"> 1 </span> </a> <ul class="dropdown-menu extended notification"> <li class="title"> <p> You have 3 new messages </p> </li> <li> <a href="javascript:void(0);"> <span class="photo"> <img src="assets/img/demo/avatar-1.jpg" alt="" /> </span> <span class="subject"> <span class="from"> Bob Carter </span> <span class="time"> Just Now </span> </span> <span class="text"> Consetetur sadipscing elitr... </span> </a> </li> <li> <a href="javascript:void(0);"> <span class="photo"> <img src="assets/img/demo/avatar-2.jpg" alt="" /> </span> <span class="subject"> <span class="from"> Jane Doe </span> <span class="time"> 45 mins </span> </span> <span class="text"> Sed diam nonumy... </span> </a> </li> <li> <a href="javascript:void(0);"> <span class="photo"> <img src="assets/img/demo/avatar-3.jpg" alt="" /> </span> <span class="subject"> <span class="from"> Patrick Nilson </span> <span class="time"> 6 hours </span> </span> <span class="text"> No sea takimata sanctus... </span> </a> </li> <li class="footer"> <a href="javascript:void(0);"> View all messages </a> </li> </ul> </li> <li> <a href="#" class="dropdown-toggle row-bg-toggle"> <i class="<API key>"> </i> </a> </li> <li class="dropdown"> <a href="#" class="<API key> dropdown-toggle"> <i class="icon-folder-open"> </i> <span> Projects </span> </a> </li> <li class="dropdown user"> <a href="#" class="dropdown-toggle" data-toggle="dropdown"> <i class="icon-male"> </i> <span class="username"> John Doe </span> <i class="icon-caret-down small"> </i> </a> <ul class="dropdown-menu"> <li> <a href="pages_user_profile.html"> <i class="icon-user"> </i> My Profile </a> </li> <li> <a href="pages_calendar.html"> <i class="icon-calendar"> </i> My Calendar </a> </li> <li> <a href=" <i class="icon-tasks"> </i> My Tasks </a> </li> <li class="divider"> </li> <li> <a href="login.html"> <i class="icon-key"> </i> Log Out </a> </li> </ul> </li> </ul> </div> <div id="project-switcher" class="container project-switcher"> <div id="scrollbar"> <div class="handle"> </div> </div> <div id="frame"> <ul class="project-list"> <li> <a href="javascript:void(0);"> <span class="image"> <i class="icon-desktop"> </i> </span> <span class="title"> Lorem ipsum dolor </span> </a> </li> <li> <a href="javascript:void(0);"> <span class="image"> <i class="icon-compass"> </i> </span> <span class="title"> Dolor sit invidunt </span> </a> </li> <li class="current"> <a href="javascript:void(0);"> <span class="image"> <i class="icon-male"> </i> </span> <span class="title"> Consetetur sadipscing elitr </span> </a> </li> <li> <a href="javascript:void(0);"> <span class="image"> <i class="icon-thumbs-up"> </i> </span> <span class="title"> Sed diam nonumy </span> </a> </li> <li> <a href="javascript:void(0);"> <span class="image"> <i class="icon-female"> </i> </span> <span class="title"> At vero eos et </span> </a> </li> <li> <a href="javascript:void(0);"> <span class="image"> <i class="icon-beaker"> </i> </span> <span class="title"> Sed diam voluptua </span> </a> </li> <li> <a href="javascript:void(0);"> <span class="image"> <i class="icon-desktop"> </i> </span> <span class="title"> Lorem ipsum dolor </span> </a> </li> <li> <a href="javascript:void(0);"> <span class="image"> <i class="icon-compass"> </i> </span> <span class="title"> Dolor sit invidunt </span> </a> </li> <li> <a href="javascript:void(0);"> <span class="image"> <i class="icon-male"> </i> </span> <span class="title"> Consetetur sadipscing elitr </span> </a> </li> <li> <a href="javascript:void(0);"> <span class="image"> <i class="icon-thumbs-up"> </i> </span> <span class="title"> Sed diam nonumy </span> </a> </li> <li> <a href="javascript:void(0);"> <span class="image"> <i class="icon-female"> </i> </span> <span class="title"> At vero eos et </span> </a> </li> <li> <a href="javascript:void(0);"> <span class="image"> <i class="icon-beaker"> </i> </span> <span class="title"> Sed diam voluptua </span> </a> </li> </ul> </div> </div> </header> <div id="container"> <div id="sidebar" class="sidebar-fixed"> <div id="sidebar-content"> <form class="sidebar-search"> <div class="input-box"> <button type="submit" class="submit"> <i class="icon-search"> </i> </button> <span> <input type="text" placeholder="Search..."> </span> </div> </form> <div class="<API key>"> <i class="icon-remove close"> </i> <div class="title"> Documents </div> <ul class="notifications"> <li> <a href="javascript:void(0);"> <div class="col-left"> <span class="label label-info"> <i class="icon-file-text"> </i> </span> </div> <div class="col-right with-margin"> <span class="message"> <strong> John Doe </strong> received $1.527,32 </span> <span class="time"> finances.xls </span> </div> </a> </li> <li> <a href="javascript:void(0);"> <div class="col-left"> <span class="label label-success"> <i class="icon-file-text"> </i> </span> </div> <div class="col-right with-margin"> <span class="message"> My name is <strong> John Doe </strong> </span> <span class="time"> briefing.docx </span> </div> </a> </li> </ul> <div class="title"> Persons </div> <ul class="notifications"> <li> <a href="javascript:void(0);"> <div class="col-left"> <span class="label label-danger"> <i class="icon-female"> </i> </span> </div> <div class="col-right with-margin"> <span class="message"> Jane <strong> Doe </strong> </span> <span class="time"> 21 years old </span> </div> </a> </li> </ul> </div> <ul id="nav"> <li> <a href="index.html"> <i class="icon-dashboard"> </i> Dashboard </a> </li> <li> <a href="javascript:void(0);"> <i class="icon-desktop"> </i> UI Features <span class="label label-info pull-right"> 6 </span> </a> <ul class="sub-menu"> <li> <a href="ui_general.html"> <i class="icon-angle-right"> </i> General </a> </li> <li> <a href="ui_buttons.html"> <i class="icon-angle-right"> </i> Buttons </a> </li> <li> <a href="ui_tabs_accordions.html"> <i class="icon-angle-right"> </i> Tabs &amp; Accordions </a> </li> <li> <a href="ui_sliders.html"> <i class="icon-angle-right"> </i> Sliders </a> </li> <li> <a href="ui_nestable_list.html"> <i class="icon-angle-right"> </i> Nestable List </a> </li> <li> <a href="ui_typography.html"> <i class="icon-angle-right"> </i> Typography / Icons </a> </li> <li> <a href="ui_google_maps.html"> <i class="icon-angle-right"> </i> Google Maps </a> </li> <li> <a href="ui_grid.html"> <i class="icon-angle-right"> </i> Grid </a> </li> </ul> </li> <li class="current open"> <a href="javascript:void(0);"> <i class="icon-edit"> </i> Form Elements </a> <ul class="sub-menu"> <li> <a href="form_components.html"> <i class="icon-angle-right"> </i> Form Components </a> </li> <li class="current"> <a href="form_layouts.html"> <i class="icon-angle-right"> </i> Form Layouts </a> </li> <li> <a href="form_validation.html"> <i class="icon-angle-right"> </i> Form Validation </a> </li> <li> <a href="form_wizard.html"> <i class="icon-angle-right"> </i> Form Wizard </a> </li> </ul> </li> <li> <a href="javascript:void(0);"> <i class="icon-table"> </i> Tables </a> <ul class="sub-menu"> <li> <a href="tables_static.html"> <i class="icon-angle-right"> </i> Static Tables </a> </li> <li> <a href="http://envato.stammtec.de/themeforest/melon/tables_dynamic.html"> <i class="icon-angle-right"> </i> Dynamic Tables (DataTables) </a> </li> <li> <a href="tables_responsive.html"> <i class="icon-angle-right"> </i> Responsive Tables </a> </li> </ul> </li> <li> <a href="charts.html"> <i class="icon-bar-chart"> </i> Charts &amp; Statistics </a> </li> <li> <a href="javascript:void(0);"> <i class="<API key>"> </i> Pages </a> <ul class="sub-menu"> <li> <a href="login.html"> <i class="icon-angle-right"> </i> Login </a> </li> <li> <a href="pages_user_profile.html"> <i class="icon-angle-right"> </i> User Profile </a> </li> <li> <a href="pages_calendar.html"> <i class="icon-angle-right"> </i> Calendar </a> </li> <li> <a href="pages_invoice.html"> <i class="icon-angle-right"> </i> Invoice </a> </li> <li> <a href="404.html"> <i class="icon-angle-right"> </i> 404 Page </a> </li> </ul> </li> <li> <a href="javascript:void(0);"> <i class="icon-list-ol"> </i> 4 Level Menu </a> <ul class="sub-menu"> <li class="open-default"> <a href="javascript:void(0);"> <i class="icon-cogs"> </i> Item 1 <span class="arrow"> </span> </a> <ul class="sub-menu"> <li class="open-default"> <a href="javascript:void(0);"> <i class="icon-user"> </i> Sample Link 1 <span class="arrow"> </span> </a> <ul class="sub-menu"> <li class="current"> <a href="javascript:void(0);"> <i class="icon-remove"> </i> Sample Link 1 </a> </li> <li> <a href="javascript:void(0);"> <i class="icon-pencil"> </i> Sample Link 1 </a> </li> <li> <a href="javascript:void(0);"> <i class="icon-edit"> </i> Sample Link 1 </a> </li> </ul> </li> <li> <a href="javascript:void(0);"> <i class="icon-user"> </i> Sample Link 1 </a> </li> <li> <a href="javascript:void(0);"> <i class="icon-external-link"> </i> Sample Link 2 </a> </li> <li> <a href="javascript:void(0);"> <i class="icon-bell"> </i> Sample Link 3 </a> </li> </ul> </li> <li> <a href="javascript:void(0);"> <i class="icon-globe"> </i> Item 2 <span class="arrow"> </span> </a> <ul class="sub-menu"> <li> <a href="javascript:void(0);"> <i class="icon-user"> </i> Sample Link 1 </a> </li> <li> <a href="javascript:void(0);"> <i class="icon-external-link"> </i> Sample Link 1 </a> </li> <li> <a href="javascript:void(0);"> <i class="icon-bell"> </i> Sample Link 1 </a> </li> </ul> </li> <li> <a href="javascript:void(0);"> <i class="icon-folder-open"> </i> Item 3 </a> </li> </ul> </li> </ul> <div class="sidebar-title"> <span> Notifications </span> </div> <ul class="notifications demo-slide-in"> <li style="display: none;"> <div class="col-left"> <span class="label label-danger"> <i class="icon-warning-sign"> </i> </span> </div> <div class="col-right with-margin"> <span class="message"> Server <strong> #512 </strong> crashed. </span> <span class="time"> few seconds ago </span> </div> </li> <li style="display: none;"> <div class="col-left"> <span class="label label-info"> <i class="icon-envelope"> </i> </span> </div> <div class="col-right with-margin"> <span class="message"> <strong> John </strong> sent you a message </span> <span class="time"> few second ago </span> </div> </li> <li> <div class="col-left"> <span class="label label-success"> <i class="icon-plus"> </i> </span> </div> <div class="col-right with-margin"> <span class="message"> <strong> Emma </strong> 's account was created </span> <span class="time"> 4 hours ago </span> </div> </li> </ul> <div class="sidebar-widget align-center"> <div class="btn-group" data-toggle="buttons" id="theme-switcher"> <label class="btn active"> <input type="radio" name="theme-switcher" data-theme="bright"> <i class="icon-sun"> </i> Bright </label> <label class="btn"> <input type="radio" name="theme-switcher" data-theme="dark"> <i class="icon-moon"> </i> Dark </label> </div> </div> </div> <div id="divider" class="resizeable"> </div> </div> <div id="content"> <div class="container"> <div class="crumbs"> <ul id="breadcrumbs" class="breadcrumb"> <li> <i class="icon-home"> </i> <a href="index.html"> Dashboard </a> </li> <li class="current"> <a href="pages_calendar.html" title=""> Calendar </a> </li> </ul> <ul class="crumb-buttons"> <li> <a href="charts.html" title=""> <i class="icon-signal"> </i> <span> Statistics </span> </a> </li> <li class="dropdown"> <a href="#" title="" data-toggle="dropdown"> <i class="icon-tasks"> </i> <span> Users <strong> (+3) </strong> </span> <i class="icon-angle-down left-padding"> </i> </a> <ul class="dropdown-menu pull-right"> <li> <a href="form_components.html" title=""> <i class="icon-plus"> </i> Add new User </a> </li> <li> <a href="http://envato.stammtec.de/themeforest/melon/tables_dynamic.html" title=""> <i class="icon-reorder"> </i> Overview </a> </li> </ul> </li> <li class="range"> <a href=" <i class="icon-calendar"> </i> <span> </span> <i class="icon-angle-down"> </i> </a> </li> </ul> </div> <div class="page-header"> <div class="page-title"> <h3> Form Layouts </h3> <span> Good morning, John! </span> </div> <ul class="page-stats"> <li> <div class="summary"> <span> New orders </span> <h3> 17,561 </h3> </div> <div id="sparkline-bar" class="graph sparkline hidden-xs"> 20,15,8,50,20,40,20,30,20,15,30,20,25,20 </div> </li> <li> <div class="summary"> <span> My balance </span> <h3> $21,561.21 </h3> </div> <div id="sparkline-bar2" class="graph sparkline hidden-xs"> 20,15,8,50,20,40,20,30,20,15,30,20,25,20 </div> </li> </ul> </div> <div class="row"> <div class="col-md-12"> <div class="widget box"> <div class="widget-header"> <h4> <i class="icon-reorder"> </i> Horizontal Forms </h4> </div> <div class="widget-content"> <form class="form-horizontal row-border" action=" <div class="form-group"> <label class="col-md-2 control-label"> Full width input: </label> <div class="col-md-10"> <input type="text" name="regular" class="form-control"> </div> </div> <div class="form-group"> <label class="col-md-2 control-label"> Multiple inputs: </label> <div class="col-md-10"> <div class="row"> <div class="col-md-4"> <input type="text" name="regular" class="form-control"> <span class="help-block"> Left aligned helper </span> </div> <div class="col-md-4"> <input type="text" name="regular" class="form-control"> <span class="help-block align-center"> Centered helper </span> </div> <div class="col-md-4"> <input type="text" name="regular" class="form-control"> <span class="help-block align-right"> Right aligned helper </span> </div> </div> </div> </div> <div class="form-group"> <label class="col-md-2 control-label"> Predefined width: </label> <div class="col-md-10"> <input class="form-control input-width-mini" type="text" placeholder=".input-width-mini" style="display: block;"> <input class="form-control input-width-small" type="text" placeholder=".input-width-small" style="display: block; margin-top: 6px;"> <input class="form-control input-width-medium" type="text" placeholder=".input-width-medium" style="display: block; margin-top: 6px;"> <input class="form-control input-width-large" type="text" placeholder=".input-width-large" style="display: block; margin-top: 6px;"> <input class="form-control input-width-xlarge" type="text" placeholder=".input-width-xlarge" style="display: block; margin-top: 6px;"> <input class="form-control input-width-xxlarge" type="text" placeholder=".input-width-xxlarge" style="display: block; margin-top: 6px;"> <input class="form-control input-block-level" type="text" placeholder=".input-block-level" style="display: block; margin-top: 6px;"> </div> </div> <div class="form-group"> <label class="col-md-2 control-label"> Select: </label> <div class="col-md-10"> <div class="row"> <div class="col-md-4"> <select class="form-control" name="select"> <option value="opt1"> col-md-4 </option> <option value="opt2"> Option 2 </option> <option value="opt3"> Option 3 </option> </select> </div> </div> <div class="row next-row"> <div class="col-md-6"> <select class="form-control" name="select"> <option value="opt1"> col-md-6 </option> <option value="opt2"> Option 2 </option> <option value="opt3"> Option 3 </option> </select> </div> </div> <div class="row next-row"> <div class="col-md-8"> <select class="form-control" name="select"> <option value="opt1"> col-md-8 </option> <option value="opt2"> Option 2 </option> <option value="opt3"> Option 3 </option> </select> </div> </div> <div class="row next-row"> <div class="col-md-12"> <select class="form-control" name="select"> <option value="opt1"> col-md-12 </option> <option value="opt2"> Option 2 </option> <option value="opt3"> Option 3 </option> </select> </div> </div> </div> </div> </form> </div> </div> </div> </div> <div class="row"> <div class="col-md-12"> <div class="widget box"> <div class="widget-header"> <h4> <i class="icon-reorder"> </i> Vertical Forms </h4> </div> <div class="widget-content"> <form class="form-vertical row-border" action=" <div class="form-group"> <label class="control-label"> Full width input: </label> <input type="text" name="regular" class="form-control"> </div> <div class="form-group"> <label class="control-label"> Multiple inputs: </label> <div class="row"> <div class="col-md-4"> <input type="text" name="regular" class="form-control"> <span class="help-block"> Left aligned helper </span> </div> <div class="col-md-4"> <input type="text" name="regular" class="form-control"> <span class="help-block align-center"> Centered helper </span> </div> <div class="col-md-4"> <input type="text" name="regular" class="form-control"> <span class="help-block align-right"> Right aligned helper </span> </div> </div> </div> <div class="form-group"> <label class="control-label"> Predefined width: </label> <input class="form-control input-width-mini" type="text" placeholder=".input-width-mini" style="display: block;"> <input class="form-control input-width-small" type="text" placeholder=".input-width-small" style="display: block; margin-top: 6px;"> <input class="form-control input-width-medium" type="text" placeholder=".input-width-medium" style="display: block; margin-top: 6px;"> <input class="form-control input-width-large" type="text" placeholder=".input-width-large" style="display: block; margin-top: 6px;"> <input class="form-control input-width-xlarge" type="text" placeholder=".input-width-xlarge" style="display: block; margin-top: 6px;"> <input class="form-control input-width-xxlarge" type="text" placeholder=".input-width-xxlarge" style="display: block; margin-top: 6px;"> <input class="form-control input-block-level" type="text" placeholder=".input-block-level" style="display: block; margin-top: 6px;"> </div> <div class="form-group"> <label class="control-label"> Select: </label> <div class="row"> <div class="col-md-4"> <select class="form-control" name="select"> <option value="opt1"> col-md-4 </option> <option value="opt2"> Option 2 </option> <option value="opt3"> Option 3 </option> </select> </div> </div> <div class="row next-row"> <div class="col-md-6"> <select class="form-control" name="select"> <option value="opt1"> col-md-6 </option> <option value="opt2"> Option 2 </option> <option value="opt3"> Option 3 </option> </select> </div> </div> <div class="row next-row"> <div class="col-md-8"> <select class="form-control" name="select"> <option value="opt1"> col-md-8 </option> <option value="opt2"> Option 2 </option> <option value="opt3"> Option 3 </option> </select> </div> </div> <div class="row next-row"> <div class="col-md-12"> <select class="form-control" name="select"> <option value="opt1"> col-md-12 </option> <option value="opt2"> Option 2 </option> <option value="opt3"> Option 3 </option> </select> </div> </div> </div> </form> </div> </div> </div> </div> <div class="row"> <div class="col-md-12"> <div class="widget box"> <div class="widget-header"> <h4> <i class="icon-reorder"> </i> Form Grid </h4> </div> <div class="widget-content"> <form class="form-vertical" action=" <div class="form-group"> <div class="row"> <div class="col-md-12"> <input type="text" name="regular" class="form-control" placeholder=".col-md-12"> </div> </div> </div> <div class="form-group"> <div class="row"> <div class="col-md-11"> <input type="text" name="regular" class="form-control" placeholder=".col-md-11"> </div> <div class="col-md-1"> <input type="text" name="regular" class="form-control" placeholder=".col-md-1"> </div> </div> </div> <div class="form-group"> <div class="row"> <div class="col-md-10"> <input type="text" name="regular" class="form-control" placeholder=".col-md-10"> </div> <div class="col-md-2"> <input type="text" name="regular" class="form-control" placeholder=".col-md-2"> </div> </div> </div> <div class="form-group"> <div class="row"> <div class="col-md-9"> <input type="text" name="regular" class="form-control" placeholder=".col-md-9"> </div> <div class="col-md-3"> <input type="text" name="regular" class="form-control" placeholder=".col-md-3"> </div> </div> </div> <div class="form-group"> <div class="row"> <div class="col-md-8"> <input type="text" name="regular" class="form-control" placeholder=".col-md-8"> </div> <div class="col-md-4"> <input type="text" name="regular" class="form-control" placeholder=".col-md-4"> </div> </div> </div> <div class="form-group"> <div class="row"> <div class="col-md-7"> <input type="text" name="regular" class="form-control" placeholder=".col-md-7"> </div> <div class="col-md-5"> <input type="text" name="regular" class="form-control" placeholder=".col-md-5"> </div> </div> </div> <div class="form-group"> <div class="row"> <div class="col-md-6"> <input type="text" name="regular" class="form-control" placeholder=".col-md-6"> </div> <div class="col-md-6"> <input type="text" name="regular" class="form-control" placeholder=".col-md-6"> </div> </div> </div> <div class="form-group"> <div class="row"> <div class="col-md-5"> <input type="text" name="regular" class="form-control" placeholder=".col-md-5"> </div> <div class="col-md-7"> <input type="text" name="regular" class="form-control" placeholder=".col-md-7"> </div> </div> </div> <div class="form-group"> <div class="row"> <div class="col-md-4"> <input type="text" name="regular" class="form-control" placeholder=".col-md-4"> </div> <div class="col-md-8"> <input type="text" name="regular" class="form-control" placeholder=".col-md-8"> </div> </div> </div> <div class="form-group"> <div class="row"> <div class="col-md-3"> <input type="text" name="regular" class="form-control" placeholder=".col-md-3"> </div> <div class="col-md-9"> <input type="text" name="regular" class="form-control" placeholder=".col-md-9"> </div> </div> </div> <div class="form-group"> <div class="row"> <div class="col-md-2"> <input type="text" name="regular" class="form-control" placeholder=".col-md-2"> </div> <div class="col-md-10"> <input type="text" name="regular" class="form-control" placeholder=".col-md-10"> </div> </div> </div> <div class="form-group"> <div class="row"> <div class="col-md-1"> <input type="text" name="regular" class="form-control" placeholder=".col-md-1"> </div> <div class="col-md-11"> <input type="text" name="regular" class="form-control" placeholder=".col-md-11"> </div> </div> </div> </form> </div> </div> </div> </div> </div> </div> </div> </body> </html>
To access the approval page, click on "Approval" in the main menu. It provides Interest Adjustments, Pending Payments and Payment Moves Approval for supervisors.
package org.jboss.resteasy.reactive.client.processor.beanparam; import static org.jboss.resteasy.reactive.common.processor.<API key>.BEAN_PARAM; import static org.jboss.resteasy.reactive.common.processor.<API key>.COOKIE_PARAM; import static org.jboss.resteasy.reactive.common.processor.<API key>.FORM_PARAM; import static org.jboss.resteasy.reactive.common.processor.<API key>.HEADER_PARAM; import static org.jboss.resteasy.reactive.common.processor.<API key>.PATH_PARAM; import static org.jboss.resteasy.reactive.common.processor.<API key>.QUERY_PARAM; import java.util.ArrayList; import java.util.Collections; import java.util.IdentityHashMap; import java.util.List; import java.util.Set; import java.util.function.BiFunction; import java.util.stream.Collectors; import org.jboss.jandex.AnnotationInstance; import org.jboss.jandex.AnnotationTarget; import org.jboss.jandex.ClassInfo; import org.jboss.jandex.DotName; import org.jboss.jandex.FieldInfo; import org.jboss.jandex.IndexView; import org.jboss.jandex.MethodInfo; import org.jboss.jandex.Type; import org.jboss.resteasy.reactive.common.processor.JandexUtil; public class BeanParamParser { public static List<Item> parse(ClassInfo beanParamClass, IndexView index) { Set<ClassInfo> <API key> = Collections.newSetFromMap(new IdentityHashMap<>()); return parseInternal(beanParamClass, index, <API key>); } private static List<Item> parseInternal(ClassInfo beanParamClass, IndexView index, Set<ClassInfo> <API key>) { if (!<API key>.add(beanParamClass)) { throw new <API key>("Cycle detected in BeanParam annotations; already processed class " + beanParamClass.name()); } try { List<Item> resultList = new ArrayList<>(); // Parse class tree recursively if (!JandexUtil.DOTNAME_OBJECT.equals(beanParamClass.superName())) { resultList .addAll(parseInternal(index.getClassByName(beanParamClass.superName()), index, <API key>)); } resultList.addAll(<API key>(beanParamClass, QUERY_PARAM, (annotationValue, fieldInfo) -> new QueryParamItem(annotationValue, new FieldExtractor(null, fieldInfo.name(), fieldInfo.declaringClass().name().toString()), fieldInfo.type()), (annotationValue, getterMethod) -> new QueryParamItem(annotationValue, new GetterExtractor(getterMethod), getterMethod.returnType()))); resultList.addAll(<API key>(beanParamClass, BEAN_PARAM, (annotationValue, fieldInfo) -> { Type type = fieldInfo.type(); if (type.kind() == Type.Kind.CLASS) { List<Item> subBeanParamItems = parseInternal(index.getClassByName(type.asClassType().name()), index, <API key>); return new BeanParamItem(subBeanParamItems, new FieldExtractor(null, fieldInfo.name(), fieldInfo.declaringClass().name().toString())); } else { throw new <API key>("BeanParam annotation used on a field that is not an object: " + beanParamClass.name() + "." + fieldInfo.name()); } }, (annotationValue, getterMethod) -> { Type returnType = getterMethod.returnType(); List<Item> items = parseInternal(index.getClassByName(returnType.name()), index, <API key>); return new BeanParamItem(items, new GetterExtractor(getterMethod)); })); resultList.addAll(<API key>(beanParamClass, COOKIE_PARAM, (annotationValue, fieldInfo) -> new CookieParamItem(annotationValue, new FieldExtractor(null, fieldInfo.name(), fieldInfo.declaringClass().name().toString()), fieldInfo.type().name().toString()), (annotationValue, getterMethod) -> new CookieParamItem(annotationValue, new GetterExtractor(getterMethod), getterMethod.returnType().name().toString()))); resultList.addAll(<API key>(beanParamClass, HEADER_PARAM, (annotationValue, fieldInfo) -> new HeaderParamItem(annotationValue, new FieldExtractor(null, fieldInfo.name(), fieldInfo.declaringClass().name().toString()), fieldInfo.type().name().toString()), (annotationValue, getterMethod) -> new HeaderParamItem(annotationValue, new GetterExtractor(getterMethod), getterMethod.returnType().name().toString()))); resultList.addAll(<API key>(beanParamClass, PATH_PARAM, (annotationValue, fieldInfo) -> new PathParamItem(annotationValue, fieldInfo.type().name().toString(), new FieldExtractor(null, fieldInfo.name(), fieldInfo.declaringClass().name().toString())), (annotationValue, getterMethod) -> new PathParamItem(annotationValue, getterMethod.returnType().name().toString(), new GetterExtractor(getterMethod)))); resultList.addAll(<API key>(beanParamClass, FORM_PARAM, (annotationValue, fieldInfo) -> new FormParamItem(annotationValue, fieldInfo.type().name().toString(), new FieldExtractor(null, fieldInfo.name(), fieldInfo.declaringClass().name().toString())), (annotationValue, getterMethod) -> new FormParamItem(annotationValue, getterMethod.returnType().name().toString(), new GetterExtractor(getterMethod)))); return resultList; } finally { <API key>.remove(beanParamClass); } } private static MethodInfo getGetterMethod(ClassInfo beanParamClass, MethodInfo methodInfo) { MethodInfo getter = null; if (methodInfo.parameters().size() > 0) { // should be setter // find the corresponding getter: String setterName = methodInfo.name(); if (setterName.startsWith("set")) { getter = beanParamClass.method(setterName.replace("^set", "^get")); } } else if (methodInfo.name().startsWith("get")) { getter = methodInfo; } if (getter == null) { throw new <API key>( "No getter corresponding to " + methodInfo.declaringClass().name() + "#" + methodInfo.name() + " found"); } return getter; } private static <T extends Item> List<T> <API key>(ClassInfo beanParamClass, DotName parameterType, BiFunction<String, FieldInfo, T> fieldExtractor, BiFunction<String, MethodInfo, T> methodExtractor) { return <API key>.of(beanParamClass, parameterType).<API key>(fieldExtractor, methodExtractor); } private BeanParamParser() { } private static class <API key> { private final ClassInfo beanParamClass; private final List<AnnotationInstance> annotations; private <API key>(ClassInfo beanParamClass, DotName parameterType) { this.beanParamClass = beanParamClass; List<AnnotationInstance> relevantAnnotations = beanParamClass.annotations().get(parameterType); this.annotations = relevantAnnotations == null ? Collections.emptyList() : relevantAnnotations.stream().filter(this::<API key>).collect(Collectors.toList()); } private static <API key> of(ClassInfo beanParamClass, DotName parameterType) { return new <API key>(beanParamClass, parameterType); } private <T extends Item> List<T> <API key>(BiFunction<String, FieldInfo, T> <API key>, BiFunction<String, MethodInfo, T> <API key>) { return annotations.stream() .map(annotation -> toItem(annotation, <API key>, <API key>)) .collect(Collectors.toList()); } private <T extends Item> T toItem(AnnotationInstance annotation, BiFunction<String, FieldInfo, T> <API key>, BiFunction<String, MethodInfo, T> <API key>) { String annotationValue = annotation.value() == null ? null : annotation.value().asString(); return annotation.target().kind() == AnnotationTarget.Kind.FIELD ? <API key>.apply(annotationValue, annotation.target().asField()) : <API key>.apply(annotationValue, getGetterMethod(beanParamClass, annotation.target().asMethod())); } private boolean <API key>(AnnotationInstance annotation) { return annotation.target().kind() == AnnotationTarget.Kind.FIELD || annotation.target().kind() == AnnotationTarget.Kind.METHOD; } } }
import * as React from 'react' import styled from 'styled-components' import { colors } from 'styles/variables' interface InputFeedbackProps { className?: string valid?: boolean } const InputFeedback: React.SFC<InputFeedbackProps> = ({ className, children }) => ( <div className={className}>{children}</div> ) export default styled(InputFeedback)` width: 100%; margin-top: 0.25rem; font-size: 80%; color: ${props => (props.valid ? colors.green : colors.red)}; `
Potree.TranslationTool = function(camera) { THREE.Object3D.call( this ); var scope = this; this.camera = camera; this.geometry = new THREE.Geometry(); this.material = new THREE.MeshBasicMaterial( { color: Math.random() * 0xffffff } ); this.STATE = { DEFAULT: 0, TRANSLATE_X: 1, TRANSLATE_Y: 2, TRANSLATE_Z: 3 }; this.parts = { ARROW_X : {name: "arrow_x", object: undefined, color: new THREE.Color( 0xff0000 ), state: this.STATE.TRANSLATE_X}, ARROW_Y : {name: "arrow_y", object: undefined, color: new THREE.Color( 0x00ff00 ), state: this.STATE.TRANSLATE_Y}, ARROW_Z : {name: "arrow_z", object: undefined, color: new THREE.Color( 0x0000ff ), state: this.STATE.TRANSLATE_Z} } this.translateStart; this.state = this.STATE.DEFAULT; this.highlighted; this.targets; this.build = function(){ var arrowX = scope.createArrow(scope.parts.ARROW_X, scope.parts.ARROW_X.color); arrowX.rotation.z = -Math.PI/2; var arrowY = scope.createArrow(scope.parts.ARROW_Y, scope.parts.ARROW_Y.color); var arrowZ = scope.createArrow(scope.parts.ARROW_Z, scope.parts.ARROW_Z.color); arrowZ.rotation.x = -Math.PI/2; scope.add(arrowX); scope.add(arrowY); scope.add(arrowZ); var boxXY = scope.createBox(new THREE.Color( 0xffff00 )); boxXY.scale.z = 0.02; boxXY.position.set(0.5, 0.5, 0); var boxXZ = scope.createBox(new THREE.Color( 0xff00ff )); boxXZ.scale.y = 0.02; boxXZ.position.set(0.5, 0, -0.5); var boxYZ = scope.createBox(new THREE.Color( 0x00ffff )); boxYZ.scale.x = 0.02; boxYZ.position.set(0, 0.5, -0.5); scope.add(boxXY); scope.add(boxXZ); scope.add(boxYZ); scope.parts.ARROW_X.object = arrowX; scope.parts.ARROW_Y.object = arrowY; scope.parts.ARROW_Z.object = arrowZ; scope.scale.multiplyScalar(5); }; this.createBox = function(color){ var boxGeometry = new THREE.BoxGeometry(1, 1, 1); var boxMaterial = new THREE.MeshBasicMaterial({color: color, transparent: true, opacity: 0.5}); var box = new THREE.Mesh(boxGeometry, boxMaterial); return box; }; this.createArrow = function(partID, color){ var material = new THREE.MeshBasicMaterial({color: color}); var shaftGeometry = new THREE.CylinderGeometry(0.1, 0.1, 3, 10, 1, false); var shaftMatterial = material; var shaft = new THREE.Mesh(shaftGeometry, shaftMatterial); shaft.position.y = 1.5; var headGeometry = new THREE.CylinderGeometry(0, 0.3, 1, 10, 1, false); var headMaterial = material; var head = new THREE.Mesh(headGeometry, headMaterial); head.position.y = 3; var arrow = new THREE.Object3D(); arrow.add(shaft); arrow.add(head); arrow.partID = partID; arrow.material = material; return arrow; }; this.setHighlighted = function(partID){ if(partID === undefined){ if(scope.highlighted){ scope.highlighted.object.material.color = scope.highlighted.color; scope.highlighted = undefined; } return; }else if(scope.highlighted !== undefined && scope.highlighted !== partID){ scope.highlighted.object.material.color = scope.highlighted.color; } scope.highlighted = partID; partID.object.material.color = new THREE.Color(0xffff00); } this.getHoveredObject = function(mouse){ var vector = new THREE.Vector3( mouse.x, mouse.y, 0.5 ); vector.unproject(scope.camera); var raycaster = new THREE.Raycaster(); raycaster.ray.set( scope.camera.position, vector.sub( scope.camera.position ).normalize() ); var intersections = raycaster.intersectObject(scope, true); if(intersections.length === 0){ scope.setHighlighted(undefined); return undefined; } var I = intersections[0]; var partID = I.object.parent.partID; return partID; } this.onMouseMove = function(event){ var mouse = event.normalizedPosition; if(scope.state === scope.STATE.DEFAULT){ scope.setHighlighted(scope.getHoveredObject(mouse)); }else if(scope.state === scope.STATE.TRANSLATE_X || scope.state === scope.STATE.TRANSLATE_Y || scope.state === scope.STATE.TRANSLATE_Z){ var origin = scope.start.lineStart.clone(); var direction = scope.start.lineEnd.clone().sub(scope.start.lineStart); direction.normalize(); var mousePoint = new THREE.Vector3(mouse.x, mouse.y); var directionDistance = new THREE.Vector3().subVectors(mousePoint, origin).dot(direction); var pointOnLine = direction.clone().multiplyScalar(directionDistance).add(origin); pointOnLine.unproject(scope.camera); var diff = pointOnLine.clone().sub(scope.position); scope.position.copy(pointOnLine); for(var i = 0; i < scope.targets.length; i++){ var target = scope.targets[0]; target.position.add(diff); } event.signal.halt(); } }; this.onMouseDown = function(event){ if(scope.state === scope.STATE.DEFAULT){ var hoveredObject = scope.getHoveredObject(event.normalizedPosition, scope.camera); if(hoveredObject){ scope.state = hoveredObject.state; var lineStart = scope.position.clone(); var lineEnd; if(scope.state === scope.STATE.TRANSLATE_X){ lineEnd = scope.position.clone(); lineEnd.x += 2; }else if(scope.state === scope.STATE.TRANSLATE_Y){ lineEnd = scope.position.clone(); lineEnd.y += 2; }else if(scope.state === scope.STATE.TRANSLATE_Z){ lineEnd = scope.position.clone(); lineEnd.z -= 2; } lineStart.project(scope.camera); lineEnd.project(scope.camera); scope.start = { mouse: event.normalizedPosition, lineStart: lineStart, lineEnd: lineEnd }; event.signal.halt(); } } }; this.onMouseUp = function(event){ scope.setHighlighted(); scope.state = scope.STATE.DEFAULT; }; this.setTargets = function(targets){ scope.targets = targets; if(scope.targets.length === 0){ return; } //TODO calculate centroid of all targets var centroid = targets[0].position.clone(); //for(var i = 0; i < targets.length; i++){ // var target = targets[i]; scope.position.copy(centroid); } this.build(); }; Potree.TranslationTool.prototype = Object.create( THREE.Object3D.prototype );
<?php umask(002); //REMEBER THE FIRST 0 $folderperm=0755; $fileperm=0644; if(!is_dir("session")) {mkdir("session",$folderperm);file_put_contents("session/.htaccess","Deny from All \n IndexIgnore * \n Header set X-Frame-Options SAMEORIGIN \n Header set X-XSS-Protection '1; mode=block' \n Header set <API key> 'nosniff'");} ini_set("session.auto_start", "0"); ini_set("session.hash_function", "sha512"); ini_set("session.entropy_file", "/dev/urandom"); ini_set("session.entropy_length", "512"); ini_set("session.save_path", "session"); ini_set("session.gc_probability", "1"); ini_set("session.cookie_httponly", "1"); ini_set("session.use_only_cookies", "1"); ini_set("session.use_trans_sid", "0"); session_name("<API key>"); if (isset($_SERVER['HTTPS']) && !empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') { ini_set('session.cookie_secure', '1'); } session_start(); if(isset($_SESSION["created"]) && $_SESSION["created"]==true) {unset($_SESSION["created"]);header("Location: index.php");} else{ $dir="../config"; $fileconfig=$dir."/config.txt"; $passfile=$dir."/pass.php"; $socialfile=$dir."/social.txt"; $dirmail= $dir."/mails/"; $filefnmail= $dir."/fnmail.txt"; $filefnmessage= $dir."/fnmessage.txt"; $filefnfooter= $dir."/footermail.txt"; $filelogo= $dir."/logo.txt"; $filefrontmess= $dir."/frontmess.txt"; $filenews= $dir."/news.txt"; $fileindexfoot= $dir."/indexfooter.txt"; $access= $dir."/.htaccess"; if(!is_dir($dir)){ if(mkdir($dir,0700)){ mkdir("../config/scheduled",$folderperm); file_put_contents("../config/scheduled/.htaccess","Deny from All"."\n"."IndexIgnore * \n Header set X-Frame-Options SAMEORIGIN \n Header set X-XSS-Protection '1; mode=block' \n Header set <API key> 'nosniff'"); if(!is_file($fileconfig))file_put_contents($fileconfig,""); if(!is_file($socialfile))file_put_contents($socialfile,""); if(!is_dir($dirmail)){ mkdir($dirmail,$folderperm);file_put_contents($dirmail.".htaccess","Deny from All"."\n"."IndexIgnore * \n Header set X-Frame-Options SAMEORIGIN \n Header set X-XSS-Protection '1; mode=block' \n Header set <API key> 'nosniff'"); }; if(!is_file($filefnmail))file_put_contents($filefnmail,""); if(!is_file($filefnmessage))file_put_contents($filefnmessage,""); if(!is_file($filefnfooter))file_put_contents($filefnfooter,""); if(!is_file($filelogo))file_put_contents($filelogo,""); if(!is_file($filefrontmess))file_put_contents($filefrontmess,""); if(!is_file($filenews))file_put_contents($filenews,""); if(!is_file($fileindexfoot))file_put_contents($fileindexfoot,""); if(!is_file($passfile))file_put_contents($passfile,'<?php $adminpassword=\''.(hash("whirlpool","admin")).'\'; ?>'); if(!is_file($access))file_put_contents($access,"Deny from All"."\n"."IndexIgnore * \n Header set X-Frame-Options SAMEORIGIN \n Header set X-XSS-Protection '1; mode=block' \n Header set <API key> 'nosniff'"); if(!is_file(".htaccess"))file_put_contents(".htaccess","IndexIgnore * \n Header set X-Frame-Options SAMEORIGIN \n Header set X-XSS-Protection '1; mode=block' \n Header set <API key> 'nosniff'"); chmod($fileconfig, $fileperm); chmod($socialfile, $fileperm); chmod($dirmail, $folderperm); chmod($filefnmail, $fileperm); chmod($filefnmessage, $fileperm); chmod($filefnfooter, $fileperm); chmod($filelogo, $fileperm); chmod($filefrontmess, $fileperm); chmod($filenews, $fileperm); chmod($passfile, $fileperm); $_SESSION["created"]=true; } } else{ if(!is_dir("../config/scheduled")){ if(mkdir("../config/scheduled",$folderperm)) file_put_contents("../config/scheduled/.htaccess","Deny from All"."\n"."IndexIgnore * \n Header set X-Frame-Options SAMEORIGIN \n Header set X-XSS-Protection '1; mode=block' \n Header set <API key> 'nosniff'"); } if(!is_file($fileconfig))file_put_contents($fileconfig,""); if(!is_file($fileindexfoot))file_put_contents($fileindexfoot,""); if(!is_file($socialfile))file_put_contents($socialfile,""); if(!is_dir($dirmail)){mkdir($dirmail,folderperm);file_put_contents($dirmail.".htaccess","Deny from All"."\n"."IndexIgnore * \n Header set X-Frame-Options SAMEORIGIN \n Header set X-XSS-Protection '1; mode=block' \n Header set <API key> 'nosniff'"); }; if(!is_file($filefnmail))file_put_contents($filefnmail,""); if(!is_file($filefnmessage))file_put_contents($filefnmessage,""); if(!is_file($filefnfooter))file_put_contents($filefnfooter,""); if(!is_file($filelogo))file_put_contents($filelogo,""); if(!is_file($filefrontmess))file_put_contents($filefrontmess,""); if(!is_file($filenews))file_put_contents($filenews,""); if(!is_file($passfile))file_put_contents($passfile,'<?php $adminpassword=\''.(hash("whirlpool","admin")).'\'; ?>'); if(!is_file($access))file_put_contents($access,"Deny from All"."\n"."IndexIgnore *"); if(!is_file(".htaccess"))file_put_contents(".htaccess","IndexIgnore * \n Header set X-Frame-Options SAMEORIGIN \n Header set X-XSS-Protection '1; mode=block' \n Header set <API key> 'nosniff'"); chmod($fileconfig, $fileperm); chmod($socialfile, $fileperm); chmod($dirmail, $folderperm); chmod($filefnmail, $fileperm); chmod($filefnmessage, $fileperm); chmod($filefnfooter, $fileperm); chmod($filelogo, $fileperm); chmod($filefrontmess, $fileperm); chmod($filenews, $fileperm); chmod($passfile, $fileperm); $_SESSION["created"]=true; } echo "<html><head></head><body><button onclick='javascript:ref();' style='position:relative;display:block;margin:0 auto;top:45%'>Return Back</button><script>function ref(){location.reload(true);}</script></body></html>"; } ?>
package bwhatsapp import ( "encoding/gob" "encoding/json" "errors" "fmt" "os" "strings" qrcodeTerminal "github.com/Baozisoftware/qrcode-terminal-go" "github.com/Rhymen/go-whatsapp" ) type ProfilePicInfo struct { URL string `json:"eurl"` Tag string `json:"tag"` Status int16 `json:"status"` } func qrFromTerminal(invert bool) chan string { qr := make(chan string) go func() { terminal := qrcodeTerminal.New() if invert { terminal = qrcodeTerminal.New2(qrcodeTerminal.ConsoleColors.BrightWhite, qrcodeTerminal.ConsoleColors.BrightBlack, qrcodeTerminal.<API key>.Medium) } terminal.Get(<-qr).Print() }() return qr } func (b *Bwhatsapp) readSession() (whatsapp.Session, error) { session := whatsapp.Session{} sessionFile := b.Config.GetString(sessionFile) if sessionFile == "" { return session, errors.New("if you won't set SessionFile then you will need to scan QR code on every restart") } file, err := os.Open(sessionFile) if err != nil { return session, err } defer file.Close() decoder := gob.NewDecoder(file) return session, decoder.Decode(&session) } func (b *Bwhatsapp) writeSession(session whatsapp.Session) error { sessionFile := b.Config.GetString(sessionFile) if sessionFile == "" { // we already sent a warning while starting the bridge, so let's be quiet here return nil } file, err := os.Create(sessionFile) if err != nil { return err } defer file.Close() encoder := gob.NewEncoder(file) return encoder.Encode(session) } func (b *Bwhatsapp) restoreSession() (*whatsapp.Session, error) { session, err := b.readSession() if err != nil { b.Log.Warn(err.Error()) } b.Log.Debugln("Restoring WhatsApp session..") session, err = b.conn.RestoreWithSession(session) if err != nil { // restore session connection timed out (I couldn't get over it without logging in again) return nil, errors.New("failed to restore session: " + err.Error()) } b.Log.Debugln("Session restored successfully!") return &session, nil } func (b *Bwhatsapp) getSenderName(senderJid string) string { if sender, exists := b.users[senderJid]; exists { if sender.Name != "" { return sender.Name } // if user is not in phone contacts // it is the most obvious scenario unless you sync your phone contacts with some remote updated source // users can change it in their WhatsApp settings -> profile -> click on Avatar if sender.Notify != "" { return sender.Notify } if sender.Short != "" { return sender.Short } } // try to reload this contact _, err := b.conn.Contacts() if err != nil { b.Log.Errorf("error on update of contacts: %v", err) } if contact, exists := b.conn.Store.Contacts[senderJid]; exists { // Add it to the user map b.users[senderJid] = contact if contact.Name != "" { return contact.Name } // if user is not in phone contacts // same as above return contact.Notify } return "" } func (b *Bwhatsapp) getSenderNotify(senderJid string) string { if sender, exists := b.users[senderJid]; exists { return sender.Notify } return "" } func (b *Bwhatsapp) GetProfilePicThumb(jid string) (*ProfilePicInfo, error) { data, err := b.conn.GetProfilePicThumb(jid) if err != nil { return nil, fmt.Errorf("failed to get avatar: %v", err) } content := <-data info := &ProfilePicInfo{} err = json.Unmarshal([]byte(content), info) if err != nil { return info, fmt.Errorf("failed to unmarshal avatar info: %v", err) } return info, nil } func isGroupJid(identifier string) bool { return strings.HasSuffix(identifier, "@g.us") || strings.HasSuffix(identifier, "@temp") || strings.HasSuffix(identifier, "@broadcast") }
'use strict'; var consoleBaseUrl = window.location.href; consoleBaseUrl = consoleBaseUrl.substring(0, consoleBaseUrl.indexOf("/console")); consoleBaseUrl = consoleBaseUrl + "/console"; var configUrl = consoleBaseUrl + "/config"; var auth = {}; var resourceBundle; var locale = 'en'; var module = angular.module('keycloak', [ 'keycloak.services', 'keycloak.loaders', 'ui.bootstrap', 'ui.select2', 'angularFileUpload', 'angularTreeview', 'pascalprecht.translate', 'ngCookies', 'ngSanitize', 'ui.ace']); var resourceRequests = 0; var loadingTimer = -1; angular.element(document).ready(function () { var keycloakAuth = new Keycloak(configUrl); function whoAmI(success, error) { var req = new XMLHttpRequest(); req.open('GET', consoleBaseUrl + "/whoami", true); req.setRequestHeader('Accept', 'application/json'); req.setRequestHeader('Authorization', 'bearer ' + keycloakAuth.token); req.onreadystatechange = function () { if (req.readyState == 4) { if (req.status == 200) { var data = JSON.parse(req.responseText); success(data); } else { error(); } } } req.send(); } function loadResourceBundle(success, error) { var req = new XMLHttpRequest(); req.open('GET', consoleBaseUrl + '/messages.json?lang=' + locale, true); req.setRequestHeader('Accept', 'application/json'); req.onreadystatechange = function () { if (req.readyState == 4) { if (req.status == 200) { var data = JSON.parse(req.responseText); success && success(data); } else { error && error(); } } } req.send(); } function hasAnyAccess(user) { return user && user['realm_access']; } keycloakAuth.onAuthLogout = function() { location.reload(); } keycloakAuth.init({ onLoad: 'login-required' }).success(function () { auth.authz = keycloakAuth; if (auth.authz.idTokenParsed.locale) { locale = auth.authz.idTokenParsed.locale; } auth.refreshPermissions = function(success, error) { whoAmI(function(data) { auth.user = data; auth.loggedIn = true; auth.hasAnyAccess = hasAnyAccess(data); success(); }, function() { error(); }); }; loadResourceBundle(function(data) { resourceBundle = data; auth.refreshPermissions(function () { module.factory('Auth', function () { return auth; }); var injector = angular.bootstrap(document, ["keycloak"]); injector.get('$translate')('consoleTitle').then(function (consoleTitle) { document.title = consoleTitle; }); }); }); }).error(function () { window.location.reload(); }); }); module.factory('authInterceptor', function($q, Auth) { return { request: function (config) { if (!config.url.match(/.html$/)) { var deferred = $q.defer(); if (Auth.authz.token) { Auth.authz.updateToken(5).success(function () { config.headers = config.headers || {}; config.headers.Authorization = 'Bearer ' + Auth.authz.token; deferred.resolve(config); }).error(function () { location.reload(); }); } return deferred.promise; } else { return config; } } }; }); module.config(['$translateProvider', function($translateProvider) { $translateProvider.<API key>('sanitizeParameters'); $translateProvider.preferredLanguage(locale); $translateProvider.translations(locale, resourceBundle); }]); module.config([ '$routeProvider', function($routeProvider) { $routeProvider .when('/create/realm', { templateUrl : resourceUrl + '/partials/realm-create.html', resolve : { }, controller : 'RealmCreateCtrl' }) .when('/realms/:realm', { templateUrl : resourceUrl + '/partials/realm-detail.html', resolve : { realm : function(RealmLoader) { return RealmLoader(); }, serverInfo : function(ServerInfoLoader) { return ServerInfoLoader(); } }, controller : 'RealmDetailCtrl' }) .when('/realms/:realm/login-settings', { templateUrl : resourceUrl + '/partials/<API key>.html', resolve : { realm : function(RealmLoader) { return RealmLoader(); }, serverInfo : function(ServerInfo) { return ServerInfo.delay; } }, controller : '<API key>' }) .when('/realms/:realm/theme-settings', { templateUrl : resourceUrl + '/partials/<API key>.html', resolve : { realm : function(RealmLoader) { return RealmLoader(); }, serverInfo : function(ServerInfoLoader) { return ServerInfoLoader(); } }, controller : 'RealmThemeCtrl' }) .when('/realms/:realm/cache-settings', { templateUrl : resourceUrl + '/partials/<API key>.html', resolve : { realm : function(RealmLoader) { return RealmLoader(); }, serverInfo : function(ServerInfoLoader) { return ServerInfoLoader(); } }, controller : 'RealmCacheCtrl' }) .when('/realms', { templateUrl : resourceUrl + '/partials/realm-list.html', controller : 'RealmListCtrl' }) .when('/realms/:realm/token-settings', { templateUrl : resourceUrl + '/partials/realm-tokens.html', resolve : { realm : function(RealmLoader) { return RealmLoader(); } }, controller : '<API key>' }) .when('/realms/:realm/<API key>', { templateUrl : resourceUrl + '/partials/<API key>.html', resolve : { realm : function(RealmLoader) { return RealmLoader(); }, clientInitialAccess : function(<API key>) { return <API key>(); }, <API key> : function(<API key>) { return <API key>(); } }, controller : '<API key>' }) .when('/realms/:realm/<API key>/create', { templateUrl : resourceUrl + '/partials/<API key>.html', resolve : { realm : function(RealmLoader) { return RealmLoader(); } }, controller : '<API key>' }) .when('/realms/:realm/<API key>/create', { templateUrl : resourceUrl + '/partials/<API key>.html', resolve : { realm : function(RealmLoader) { return RealmLoader(); }, <API key> : function() { return {}; } }, controller : '<API key>' }) .when('/realms/:realm/<API key>/:hostname', { templateUrl : resourceUrl + '/partials/<API key>.html', resolve : { realm : function(RealmLoader) { return RealmLoader(); }, <API key> : function(<API key>) { return <API key>(); } }, controller : '<API key>' }) .when('/realms/:realm/keys-settings', { templateUrl : resourceUrl + '/partials/realm-keys.html', resolve : { realm : function(RealmLoader) { return RealmLoader(); } }, controller : 'RealmKeysDetailCtrl' }) .when('/realms/:realm/<API key>', { templateUrl : resourceUrl + '/partials/<API key>.html', resolve : { realm : function(RealmLoader) { return RealmLoader(); }, serverInfo : function(ServerInfoLoader) { return ServerInfoLoader(); }, instance : function(<API key>) { return {}; }, providerFactory : function(<API key>) { return {}; }, authFlows : function(<API key>) { return {}; } }, controller : '<API key>' }) .when('/create/identity-provider/:realm/:provider_id', { templateUrl : function(params){ return resourceUrl + '/partials/<API key>-' + params.provider_id + '.html'; }, resolve : { realm : function(RealmLoader) { return RealmLoader(); }, serverInfo : function(ServerInfoLoader) { return ServerInfoLoader(); }, instance : function(<API key>) { return {}; }, providerFactory : function(<API key>) { return new <API key>(); }, authFlows : function(<API key>) { return <API key>(); } }, controller : '<API key>' }) .when('/realms/:realm/<API key>/provider/:provider_id/:alias', { templateUrl : function(params){ return resourceUrl + '/partials/<API key>-' + params.provider_id + '.html'; }, resolve : { realm : function(RealmLoader) { return RealmLoader(); }, serverInfo : function(ServerInfoLoader) { return ServerInfoLoader(); }, instance : function(<API key>) { return <API key>(); }, providerFactory : function(<API key>) { return <API key>(); }, authFlows : function(<API key>) { return <API key>(); } }, controller : '<API key>' }) .when('/realms/:realm/<API key>/provider/:provider_id/:alias/export', { templateUrl : resourceUrl + '/partials/<API key>.html', resolve : { realm : function(RealmLoader) { return RealmLoader(); }, serverInfo : function(ServerInfoLoader) { return ServerInfoLoader(); }, identityProvider : function(<API key>) { return <API key>(); }, providerFactory : function(<API key>) { return <API key>(); } }, controller : '<API key>' }) .when('/realms/:realm/<API key>/:alias/mappers', { templateUrl : function(params){ return resourceUrl + '/partials/<API key>.html'; }, resolve : { realm : function(RealmLoader) { return RealmLoader(); }, identityProvider : function(<API key>) { return <API key>(); }, mapperTypes : function(<API key>) { return <API key>(); }, mappers : function(<API key>) { return <API key>(); } }, controller : '<API key>' }) .when('/realms/:realm/<API key>/:alias/mappers/:mapperId', { templateUrl : function(params){ return resourceUrl + '/partials/<API key>.html'; }, resolve : { realm : function(RealmLoader) { return RealmLoader(); }, identityProvider : function(<API key>) { return <API key>(); }, mapperTypes : function(<API key>) { return <API key>(); }, mapper : function(<API key>) { return <API key>(); } }, controller : '<API key>' }) .when('/create/<API key>/:realm/:alias', { templateUrl : function(params){ return resourceUrl + '/partials/<API key>.html'; }, resolve : { realm : function(RealmLoader) { return RealmLoader(); }, identityProvider : function(<API key>) { return <API key>(); }, mapperTypes : function(<API key>) { return <API key>(); } }, controller : '<API key>' }) .when('/realms/:realm/default-roles', { templateUrl : resourceUrl + '/partials/realm-default-roles.html', resolve : { realm : function(RealmLoader) { return RealmLoader(); }, clients : function(ClientListLoader) { return ClientListLoader(); }, roles : function(RoleListLoader) { return RoleListLoader(); } }, controller : '<API key>' }) .when('/realms/:realm/smtp-settings', { templateUrl : resourceUrl + '/partials/realm-smtp.html', resolve : { realm : function(RealmLoader) { return RealmLoader(); } }, controller : '<API key>' }) .when('/realms/:realm/events', { templateUrl : resourceUrl + '/partials/realm-events.html', resolve : { realm : function(RealmLoader) { return RealmLoader(); }, serverInfo : function(ServerInfoLoader) { return ServerInfoLoader(); } }, controller : 'RealmEventsCtrl' }) .when('/realms/:realm/admin-events', { templateUrl : resourceUrl + '/partials/realm-events-admin.html', resolve : { realm : function(RealmLoader) { return RealmLoader(); }, serverInfo : function(ServerInfoLoader) { return ServerInfoLoader(); } }, controller : '<API key>' }) .when('/realms/:realm/events-settings', { templateUrl : resourceUrl + '/partials/realm-events-config.html', resolve : { realm : function(RealmLoader) { return RealmLoader(); }, serverInfo : function(ServerInfoLoader) { return ServerInfoLoader(); }, eventsConfig : function(<API key>) { return <API key>(); } }, controller : '<API key>' }) .when('/realms/:realm/partial-import', { templateUrl : resourceUrl + '/partials/partial-import.html', resolve : { resourceName : function() { return 'users'}, realm : function(RealmLoader) { return RealmLoader(); } }, controller : 'RealmImportCtrl' }) .when('/create/user/:realm', { templateUrl : resourceUrl + '/partials/user-detail.html', resolve : { realm : function(RealmLoader) { return RealmLoader(); }, user : function() { return {}; } }, controller : 'UserDetailCtrl' }) .when('/realms/:realm/users/:user', { templateUrl : resourceUrl + '/partials/user-detail.html', resolve : { realm : function(RealmLoader) { return RealmLoader(); }, user : function(UserLoader) { return UserLoader(); } }, controller : 'UserDetailCtrl' }) .when('/realms/:realm/users/:user/user-attributes', { templateUrl : resourceUrl + '/partials/user-attributes.html', resolve : { realm : function(RealmLoader) { return RealmLoader(); }, user : function(UserLoader) { return UserLoader(); } }, controller : 'UserDetailCtrl' }) .when('/realms/:realm/users/:user/user-credentials', { templateUrl : resourceUrl + '/partials/user-credentials.html', resolve : { realm : function(RealmLoader) { return RealmLoader(); }, user : function(UserLoader) { return UserLoader(); } }, controller : 'UserCredentialsCtrl' }) .when('/realms/:realm/users/:user/role-mappings', { templateUrl : resourceUrl + '/partials/role-mappings.html', resolve : { realm : function(RealmLoader) { return RealmLoader(); }, user : function(UserLoader) { return UserLoader(); }, clients : function(ClientListLoader) { return ClientListLoader(); }, client : function() { return {}; } }, controller : 'UserRoleMappingCtrl' }) .when('/realms/:realm/users/:user/groups', { templateUrl : resourceUrl + '/partials/<API key>.html', resolve : { realm : function(RealmLoader) { return RealmLoader(); }, user : function(UserLoader) { return UserLoader(); }, groups : function(GroupListLoader) { return GroupListLoader(); } }, controller : '<API key>' }) .when('/realms/:realm/users/:user/sessions', { templateUrl : resourceUrl + '/partials/user-sessions.html', resolve : { realm : function(RealmLoader) { return RealmLoader(); }, user : function(UserLoader) { return UserLoader(); }, sessions : function(UserSessionsLoader) { return UserSessionsLoader(); } }, controller : 'UserSessionsCtrl' }) .when('/realms/:realm/users/:user/federated-identity', { templateUrl : resourceUrl + '/partials/<API key>.html', resolve : { realm : function(RealmLoader) { return RealmLoader(); }, user : function(UserLoader) { return UserLoader(); }, federatedIdentities : function(<API key>) { return <API key>(); } }, controller : '<API key>' }) .when('/create/federated-identity/:realm/:user', { templateUrl : resourceUrl + '/partials/<API key>.html', resolve : { realm : function(RealmLoader) { return RealmLoader(); }, user : function(UserLoader) { return UserLoader(); }, federatedIdentities : function(<API key>) { return <API key>(); } }, controller : '<API key>' }) .when('/realms/:realm/users/:user/consents', { templateUrl : resourceUrl + '/partials/user-consents.html', resolve : { realm : function(RealmLoader) { return RealmLoader(); }, user : function(UserLoader) { return UserLoader(); }, userConsents : function(UserConsentsLoader) { return UserConsentsLoader(); } }, controller : 'UserConsentsCtrl' }) .when('/realms/:realm/users/:user/offline-sessions/:client', { templateUrl : resourceUrl + '/partials/<API key>.html', resolve : { realm : function(RealmLoader) { return RealmLoader(); }, user : function(UserLoader) { return UserLoader(); }, client : function(ClientLoader) { return ClientLoader(); }, offlineSessions : function(<API key>) { return <API key>(); } }, controller : '<API key>' }) .when('/realms/:realm/users', { templateUrl : resourceUrl + '/partials/user-list.html', resolve : { realm : function(RealmLoader) { return RealmLoader(); } }, controller : 'UserListCtrl' }) .when('/create/role/:realm', { templateUrl : resourceUrl + '/partials/role-detail.html', resolve : { realm : function(RealmLoader) { return RealmLoader(); }, role : function() { return {}; }, roles : function(RoleListLoader) { return RoleListLoader(); }, clients : function(ClientListLoader) { return ClientListLoader(); } }, controller : 'RoleDetailCtrl' }) .when('/realms/:realm/roles/:role', { templateUrl : resourceUrl + '/partials/role-detail.html', resolve : { realm : function(RealmLoader) { return RealmLoader(); }, role : function(RoleLoader) { return RoleLoader(); }, roles : function(RoleListLoader) { return RoleListLoader(); }, clients : function(ClientListLoader) { return ClientListLoader(); } }, controller : 'RoleDetailCtrl' }) .when('/realms/:realm/roles', { templateUrl : resourceUrl + '/partials/role-list.html', resolve : { realm : function(RealmLoader) { return RealmLoader(); }, roles : function(RoleListLoader) { return RoleListLoader(); } }, controller : 'RoleListCtrl' }) .when('/realms/:realm/groups', { templateUrl : resourceUrl + '/partials/group-list.html', resolve : { realm : function(RealmLoader) { return RealmLoader(); }, groups : function(GroupListLoader) { return GroupListLoader(); } }, controller : 'GroupListCtrl' }) .when('/create/group/:realm/parent/:parentId', { templateUrl : resourceUrl + '/partials/create-group.html', resolve : { realm : function(RealmLoader) { return RealmLoader(); }, parentId : function($route) { return $route.current.params.parentId; } }, controller : 'GroupCreateCtrl' }) .when('/realms/:realm/groups/:group', { templateUrl : resourceUrl + '/partials/group-detail.html', resolve : { realm : function(RealmLoader) { return RealmLoader(); }, group : function(GroupLoader) { return GroupLoader(); } }, controller : 'GroupDetailCtrl' }) .when('/realms/:realm/groups/:group/attributes', { templateUrl : resourceUrl + '/partials/group-attributes.html', resolve : { realm : function(RealmLoader) { return RealmLoader(); }, group : function(GroupLoader) { return GroupLoader(); } }, controller : 'GroupDetailCtrl' }) .when('/realms/:realm/groups/:group/members', { templateUrl : resourceUrl + '/partials/group-members.html', resolve : { realm : function(RealmLoader) { return RealmLoader(); }, group : function(GroupLoader) { return GroupLoader(); } }, controller : 'GroupMembersCtrl' }) .when('/realms/:realm/groups/:group/role-mappings', { templateUrl : resourceUrl + '/partials/group-role-mappings.html', resolve : { realm : function(RealmLoader) { return RealmLoader(); }, group : function(GroupLoader) { return GroupLoader(); }, clients : function(ClientListLoader) { return ClientListLoader(); }, client : function() { return {}; } }, controller : '<API key>' }) .when('/realms/:realm/default-groups', { templateUrl : resourceUrl + '/partials/default-groups.html', resolve : { realm : function(RealmLoader) { return RealmLoader(); }, groups : function(GroupListLoader) { return GroupListLoader(); } }, controller : 'DefaultGroupsCtrl' }) .when('/create/role/:realm/clients/:client', { templateUrl : resourceUrl + '/partials/client-role-detail.html', resolve : { realm : function(RealmLoader) { return RealmLoader(); }, client : function(ClientLoader) { return ClientLoader(); }, role : function() { return {}; }, roles : function(RoleListLoader) { return RoleListLoader(); }, clients : function(ClientListLoader) { return ClientListLoader(); } }, controller : '<API key>' }) .when('/realms/:realm/clients/:client/roles/:role', { templateUrl : resourceUrl + '/partials/client-role-detail.html', resolve : { realm : function(RealmLoader) { return RealmLoader(); }, client : function(ClientLoader) { return ClientLoader(); }, role : function(ClientRoleLoader) { return ClientRoleLoader(); }, roles : function(RoleListLoader) { return RoleListLoader(); }, clients : function(ClientListLoader) { return ClientListLoader(); } }, controller : '<API key>' }) .when('/realms/:realm/clients/:client/mappers', { templateUrl : resourceUrl + '/partials/client-mappers.html', resolve : { realm : function(RealmLoader) { return RealmLoader(); }, client : function(ClientLoader) { return ClientLoader(); }, templates : function(<API key>) { return <API key>(); }, serverInfo : function(ServerInfoLoader) { return ServerInfoLoader(); } }, controller : '<API key>' }) .when('/realms/:realm/clients/:client/add-mappers', { templateUrl : resourceUrl + '/partials/client-mappers-add.html', resolve : { realm : function(RealmLoader) { return RealmLoader(); }, client : function(ClientLoader) { return ClientLoader(); }, serverInfo : function(ServerInfoLoader) { return ServerInfoLoader(); } }, controller : '<API key>' }) .when('/realms/:realm/clients/:client/mappers/:id', { templateUrl : resourceUrl + '/partials/<API key>.html', resolve : { realm : function(RealmLoader) { return RealmLoader(); }, client : function(ClientLoader) { return ClientLoader(); }, serverInfo : function(ServerInfoLoader) { return ServerInfoLoader(); }, mapper : function(<API key>) { return <API key>(); } }, controller : '<API key>' }) .when('/create/client/:realm/:client/mappers', { templateUrl : resourceUrl + '/partials/<API key>.html', resolve : { realm : function(RealmLoader) { return RealmLoader(); }, serverInfo : function(ServerInfoLoader) { return ServerInfoLoader(); }, client : function(ClientLoader) { return ClientLoader(); } }, controller : '<API key>' }) .when('/realms/:realm/client-templates/:template/mappers', { templateUrl : resourceUrl + '/partials/<API key>.html', resolve : { realm : function(RealmLoader) { return RealmLoader(); }, template : function(<API key>) { return <API key>(); }, serverInfo : function(ServerInfoLoader) { return ServerInfoLoader(); } }, controller : '<API key>' }) .when('/realms/:realm/client-templates/:template/add-mappers', { templateUrl : resourceUrl + '/partials/<API key>.html', resolve : { realm : function(RealmLoader) { return RealmLoader(); }, template : function(<API key>) { return <API key>(); }, serverInfo : function(ServerInfoLoader) { return ServerInfoLoader(); } }, controller : '<API key>' }) .when('/realms/:realm/client-templates/:template/mappers/:id', { templateUrl : resourceUrl + '/partials/<API key>.html', resolve : { realm : function(RealmLoader) { return RealmLoader(); }, template : function(<API key>) { return <API key>(); }, serverInfo : function(ServerInfoLoader) { return ServerInfoLoader(); }, mapper : function(<API key>) { return <API key>(); } }, controller : '<API key>' }) .when('/create/client-template/:realm/:template/mappers', { templateUrl : resourceUrl + '/partials/<API key>.html', resolve : { realm : function(RealmLoader) { return RealmLoader(); }, serverInfo : function(ServerInfoLoader) { return ServerInfoLoader(); }, template : function(<API key>) { return <API key>(); } }, controller : '<API key>' }) .when('/realms/:realm/clients/:client/sessions', { templateUrl : resourceUrl + '/partials/client-sessions.html', resolve : { realm : function(RealmLoader) { return RealmLoader(); }, client : function(ClientLoader) { return ClientLoader(); }, sessionCount : function(<API key>) { return <API key>(); } }, controller : 'ClientSessionsCtrl' }) .when('/realms/:realm/clients/:client/offline-access', { templateUrl : resourceUrl + '/partials/<API key>.html', resolve : { realm : function(RealmLoader) { return RealmLoader(); }, client : function(ClientLoader) { return ClientLoader(); }, offlineSessionCount : function(<API key>) { return <API key>(); } }, controller : '<API key>' }) .when('/realms/:realm/clients/:client/credentials', { templateUrl : resourceUrl + '/partials/client-credentials.html', resolve : { realm : function(RealmLoader) { return RealmLoader(); }, client : function(ClientLoader) { return ClientLoader(); }, client<API key> : function(Client<API key>) { return Client<API key>(); }, <API key>: function(PerClient<API key>) { return PerClient<API key>(); } }, controller : '<API key>' }) .when('/realms/:realm/clients/:client/credentials/client-jwt/:keyType/import/:attribute', { templateUrl : resourceUrl + '/partials/<API key>.html', resolve : { realm : function(RealmLoader) { return RealmLoader(); }, client : function(ClientLoader) { return ClientLoader(); }, callingContext : function() { return "jwt-credentials"; } }, controller : '<API key>' }) .when('/realms/:realm/clients/:client/credentials/client-jwt/:keyType/export/:attribute', { templateUrl : resourceUrl + '/partials/<API key>.html', resolve : { realm : function(RealmLoader) { return RealmLoader(); }, client : function(ClientLoader) { return ClientLoader(); }, callingContext : function() { return "jwt-credentials"; } }, controller : '<API key>' }) .when('/realms/:realm/clients/:client/identity-provider', { templateUrl : resourceUrl + '/partials/<API key>.html', resolve : { realm : function(RealmLoader) { return RealmLoader(); }, client : function(ClientLoader) { return ClientLoader(); } }, controller : '<API key>' }) .when('/realms/:realm/clients/:client/clustering', { templateUrl : resourceUrl + '/partials/client-clustering.html', resolve : { realm : function(RealmLoader) { return RealmLoader(); }, client : function(ClientLoader) { return ClientLoader(); } }, controller : '<API key>' }) .when('/register-node/realms/:realm/clients/:client/clustering', { templateUrl : resourceUrl + '/partials/<API key>.html', resolve : { realm : function(RealmLoader) { return RealmLoader(); }, client : function(ClientLoader) { return ClientLoader(); } }, controller : '<API key>' }) .when('/realms/:realm/clients/:client/clustering/:node', { templateUrl : resourceUrl + '/partials/<API key>.html', resolve : { realm : function(RealmLoader) { return RealmLoader(); }, client : function(ClientLoader) { return ClientLoader(); } }, controller : '<API key>' }) .when('/realms/:realm/clients/:client/saml/keys', { templateUrl : resourceUrl + '/partials/client-saml-keys.html', resolve : { realm : function(RealmLoader) { return RealmLoader(); }, client : function(ClientLoader) { return ClientLoader(); } }, controller : 'ClientSamlKeyCtrl' }) .when('/realms/:realm/clients/:client/saml/:keyType/import/:attribute', { templateUrl : resourceUrl + '/partials/<API key>.html', resolve : { realm : function(RealmLoader) { return RealmLoader(); }, client : function(ClientLoader) { return ClientLoader(); }, callingContext : function() { return "saml"; } }, controller : '<API key>' }) .when('/realms/:realm/clients/:client/saml/:keyType/export/:attribute', { templateUrl : resourceUrl + '/partials/<API key>.html', resolve : { realm : function(RealmLoader) { return RealmLoader(); }, client : function(ClientLoader) { return ClientLoader(); }, callingContext : function() { return "saml"; } }, controller : '<API key>' }) .when('/realms/:realm/clients/:client/roles', { templateUrl : resourceUrl + '/partials/client-role-list.html', resolve : { realm : function(RealmLoader) { return RealmLoader(); }, client : function(ClientLoader) { return ClientLoader(); }, roles : function(<API key>) { return <API key>(); } }, controller : 'ClientRoleListCtrl' }) .when('/realms/:realm/clients/:client/revocation', { templateUrl : resourceUrl + '/partials/client-revocation.html', resolve : { realm : function(RealmLoader) { return RealmLoader(); }, client : function(ClientLoader) { return ClientLoader(); } }, controller : '<API key>' }) .when('/realms/:realm/clients/:client/scope-mappings', { templateUrl : resourceUrl + '/partials/<API key>.html', resolve : { realm : function(RealmLoader) { return RealmLoader(); }, client : function(ClientLoader) { return ClientLoader(); }, templates : function(<API key>) { return <API key>(); }, clients : function(ClientListLoader) { return ClientListLoader(); } }, controller : '<API key>' }) .when('/realms/:realm/clients/:client/installation', { templateUrl : resourceUrl + '/partials/client-installation.html', resolve : { realm : function(RealmLoader) { return RealmLoader(); }, client : function(ClientLoader) { return ClientLoader(); }, serverInfo : function(ServerInfoLoader) { return ServerInfoLoader(); } }, controller : '<API key>' }) .when('/realms/:realm/clients/:client/<API key>', { templateUrl : resourceUrl + '/partials/<API key>.html', resolve : { realm : function(RealmLoader) { return RealmLoader(); }, user : function(<API key>) { return <API key>(); }, clients : function(ClientListLoader) { return ClientListLoader(); }, client : function(ClientLoader) { return ClientLoader(); } }, controller : 'UserRoleMappingCtrl' }) .when('/create/client/:realm', { templateUrl : resourceUrl + '/partials/create-client.html', resolve : { realm : function(RealmLoader) { return RealmLoader(); }, templates : function(<API key>) { return <API key>(); }, clients : function(ClientListLoader) { return ClientListLoader(); }, client : function() { return {}; }, serverInfo : function(ServerInfoLoader) { return ServerInfoLoader(); } }, controller : 'CreateClientCtrl' }) .when('/realms/:realm/clients/:client', { templateUrl : resourceUrl + '/partials/client-detail.html', resolve : { realm : function(RealmLoader) { return RealmLoader(); }, templates : function(<API key>) { return <API key>(); }, clients : function(ClientListLoader) { return ClientListLoader(); }, client : function(ClientLoader) { return ClientLoader(); }, serverInfo : function(ServerInfoLoader) { return ServerInfoLoader(); } }, controller : 'ClientDetailCtrl' }) .when('/create/client-template/:realm', { templateUrl : resourceUrl + '/partials/<API key>.html', resolve : { realm : function(RealmLoader) { return RealmLoader(); }, templates : function(<API key>) { return <API key>(); }, template : function() { return {}; }, serverInfo : function(ServerInfoLoader) { return ServerInfoLoader(); } }, controller : '<API key>' }) .when('/realms/:realm/client-templates/:template', { templateUrl : resourceUrl + '/partials/<API key>.html', resolve : { realm : function(RealmLoader) { return RealmLoader(); }, templates : function(<API key>) { return <API key>(); }, template : function(<API key>) { return <API key>(); }, serverInfo : function(ServerInfoLoader) { return ServerInfoLoader(); } }, controller : '<API key>' }) .when('/realms/:realm/client-templates/:template/scope-mappings', { templateUrl : resourceUrl + '/partials/<API key>.html', resolve : { realm : function(RealmLoader) { return RealmLoader(); }, template : function(<API key>) { return <API key>(); }, clients : function(ClientListLoader) { return ClientListLoader(); } }, controller : '<API key>' }) .when('/realms/:realm/clients', { templateUrl : resourceUrl + '/partials/client-list.html', resolve : { realm : function(RealmLoader) { return RealmLoader(); }, clients : function(ClientListLoader) { return ClientListLoader(); }, serverInfo : function(ServerInfoLoader) { return ServerInfoLoader(); } }, controller : 'ClientListCtrl' }) .when('/realms/:realm/client-templates', { templateUrl : resourceUrl + '/partials/<API key>.html', resolve : { realm : function(RealmLoader) { return RealmLoader(); }, templates : function(<API key>) { return <API key>(); }, serverInfo : function(ServerInfoLoader) { return ServerInfoLoader(); } }, controller : '<API key>' }) .when('/import/client/:realm', { templateUrl : resourceUrl + '/partials/client-import.html', resolve : { realm : function(RealmLoader) { return RealmLoader(); }, serverInfo : function(ServerInfoLoader) { return ServerInfoLoader(); } }, controller : 'ClientImportCtrl' }) .when('/', { templateUrl : resourceUrl + '/partials/home.html', controller : 'HomeCtrl' }) .when('/mocks/:realm', { templateUrl : resourceUrl + '/partials/realm-detail_mock.html', resolve : { realm : function(RealmLoader) { return RealmLoader(); }, serverInfo : function(ServerInfoLoader) { return ServerInfoLoader(); } }, controller : 'RealmDetailCtrl' }) .when('/realms/:realm/sessions/revocation', { templateUrl : resourceUrl + '/partials/session-revocation.html', resolve : { realm : function(RealmLoader) { return RealmLoader(); } }, controller : 'RealmRevocationCtrl' }) .when('/realms/:realm/sessions/realm', { templateUrl : resourceUrl + '/partials/session-realm.html', resolve : { realm : function(RealmLoader) { return RealmLoader(); }, stats : function(<API key>) { return <API key>(); } }, controller : '<API key>' }) .when('/create/user-storage/:realm/providers/:provider', { templateUrl : resourceUrl + '/partials/<API key>.html', resolve : { realm : function(RealmLoader) { return RealmLoader(); }, instance : function() { return { }; }, providerId : function($route) { return $route.current.params.provider; }, serverInfo : function(ServerInfoLoader) { return ServerInfoLoader(); } }, controller : '<API key>' }) .when('/realms/:realm/user-storage/providers/:provider/:componentId', { templateUrl : resourceUrl + '/partials/<API key>.html', resolve : { realm : function(RealmLoader) { return RealmLoader(); }, instance : function(ComponentLoader) { return ComponentLoader(); }, providerId : function($route) { return $route.current.params.provider; }, serverInfo : function(ServerInfoLoader) { return ServerInfoLoader(); } }, controller : '<API key>' }) .when('/realms/:realm/user-federation', { templateUrl : resourceUrl + '/partials/user-federation.html', resolve : { realm : function(RealmLoader) { return RealmLoader(); }, serverInfo : function(ServerInfoLoader) { return ServerInfoLoader(); } }, controller : 'UserFederationCtrl' }) .when('/realms/:realm/user-federation/providers/ldap/:instance', { templateUrl : resourceUrl + '/partials/federated-ldap.html', resolve : { realm : function(RealmLoader) { return RealmLoader(); }, instance : function(<API key>) { return <API key>(); } }, controller : 'LDAPCtrl' }) .when('/create/user-federation/:realm/providers/ldap', { templateUrl : resourceUrl + '/partials/federated-ldap.html', resolve : { realm : function(RealmLoader) { return RealmLoader(); }, instance : function() { return {}; } }, controller : 'LDAPCtrl' }) .when('/realms/:realm/user-federation/providers/kerberos/:instance', { templateUrl : resourceUrl + '/partials/federated-kerberos.html', resolve : { realm : function(RealmLoader) { return RealmLoader(); }, instance : function(<API key>) { return <API key>(); }, providerFactory : function() { return { id: "kerberos" }; } }, controller : '<API key>' }) .when('/create/user-federation/:realm/providers/kerberos', { templateUrl : resourceUrl + '/partials/federated-kerberos.html', resolve : { realm : function(RealmLoader) { return RealmLoader(); }, instance : function() { return {}; }, providerFactory : function() { return { id: "kerberos" }; } }, controller : '<API key>' }) .when('/create/user-federation/:realm/providers/:provider', { templateUrl : resourceUrl + '/partials/federated-generic.html', resolve : { realm : function(RealmLoader) { return RealmLoader(); }, instance : function() { return { }; }, providerFactory : function(<API key>) { return <API key>(); } }, controller : '<API key>' }) .when('/realms/:realm/user-federation/providers/:provider/:instance', { templateUrl : resourceUrl + '/partials/federated-generic.html', resolve : { realm : function(RealmLoader) { return RealmLoader(); }, instance : function(<API key>) { return <API key>(); }, providerFactory : function(<API key>) { return <API key>(); } }, controller : '<API key>' }) .when('/realms/:realm/user-federation/providers/:provider/:instance/mappers', { templateUrl : function(params){ return resourceUrl + '/partials/federated-mappers.html'; }, resolve : { realm : function(RealmLoader) { return RealmLoader(); }, provider : function(<API key>) { return <API key>(); }, mapperTypes : function(<API key>) { return <API key>(); }, mappers : function(<API key>) { return <API key>(); } }, controller : '<API key>' }) .when('/realms/:realm/user-federation/providers/:provider/:instance/mappers/:mapperId', { templateUrl : function(params){ return resourceUrl + '/partials/<API key>.html'; }, resolve : { realm : function(RealmLoader) { return RealmLoader(); }, provider : function(<API key>) { return <API key>(); }, mapperTypes : function(<API key>) { return <API key>(); }, mapper : function(<API key>) { return <API key>(); }, clients : function(ClientListLoader) { return ClientListLoader(); } }, controller : '<API key>' }) .when('/create/<API key>/:realm/:provider/:instance', { templateUrl : function(params){ return resourceUrl + '/partials/<API key>.html'; }, resolve : { realm : function(RealmLoader) { return RealmLoader(); }, provider : function(<API key>) { return <API key>(); }, mapperTypes : function(<API key>) { return <API key>(); }, clients : function(ClientListLoader) { return ClientListLoader(); } }, controller : '<API key>' }) .when('/realms/:realm/defense/headers', { templateUrl : resourceUrl + '/partials/defense-headers.html', resolve : { realm : function(RealmLoader) { return RealmLoader(); }, serverInfo : function(ServerInfoLoader) { return ServerInfoLoader(); } }, controller : 'DefenseHeadersCtrl' }) .when('/realms/:realm/defense/brute-force', { templateUrl : resourceUrl + '/partials/brute-force.html', resolve : { realm : function(RealmLoader) { return RealmLoader(); } }, controller : 'RealmBruteForceCtrl' }) .when('/realms/:realm/protocols', { templateUrl : resourceUrl + '/partials/protocol-list.html', resolve : { realm : function(RealmLoader) { return RealmLoader(); }, serverInfo : function(ServerInfoLoader) { return ServerInfoLoader(); } }, controller : 'ProtocolListCtrl' }) .when('/realms/:realm/authentication/flows', { templateUrl : resourceUrl + '/partials/<API key>.html', resolve : { realm : function(RealmLoader) { return RealmLoader(); }, flows : function(<API key>) { return <API key>(); }, selectedFlow : function() { return null; } }, controller : '<API key> }) .when('/realms/:realm/authentication/flow-bindings', { templateUrl : resourceUrl + '/partials/<API key>.html', resolve : { realm : function(RealmLoader) { return RealmLoader(); }, flows : function(<API key>) { return <API key>(); }, serverInfo : function(ServerInfo) { return ServerInfo.delay; } }, controller : '<API key>' }) .when('/realms/:realm/authentication/flows/:flow', { templateUrl : resourceUrl + '/partials/<API key>.html', resolve : { realm : function(RealmLoader) { return RealmLoader(); }, flows : function(<API key>) { return <API key>(); }, selectedFlow : function($route) { return $route.current.params.flow; } }, controller : '<API key> }) .when('/realms/:realm/authentication/flows/:flow/create/execution/:topFlow', { templateUrl : resourceUrl + '/partials/create-execution.html', resolve : { realm : function(RealmLoader) { return RealmLoader(); }, topFlow: function($route) { return $route.current.params.topFlow; }, parentFlow : function(<API key>) { return <API key>(); }, formActionProviders : function(<API key>) { return <API key>(); }, <API key> : function(<API key>) { return <API key>(); }, client<API key> : function(Client<API key>) { return Client<API key>(); } }, controller : 'CreateExecutionCtrl' }) .when('/realms/:realm/authentication/flows/:flow/create/flow/execution/:topFlow', { templateUrl : resourceUrl + '/partials/<API key>.html', resolve : { realm : function(RealmLoader) { return RealmLoader(); }, topFlow: function($route) { return $route.current.params.topFlow; }, parentFlow : function(<API key>) { return <API key>(); }, formProviders : function(<API key>) { return <API key>(); } }, controller : '<API key>' }) .when('/realms/:realm/authentication/create/flow', { templateUrl : resourceUrl + '/partials/create-flow.html', resolve : { realm : function(RealmLoader) { return RealmLoader(); } }, controller : 'CreateFlowCtrl' }) .when('/realms/:realm/authentication/required-actions', { templateUrl : resourceUrl + '/partials/required-actions.html', resolve : { realm : function(RealmLoader) { return RealmLoader(); }, <API key> : function(<API key>) { return <API key>(); } }, controller : 'RequiredActionsCtrl' }) .when('/realms/:realm/authentication/password-policy', { templateUrl : resourceUrl + '/partials/password-policy.html', resolve : { realm : function(RealmLoader) { return RealmLoader(); }, serverInfo : function(ServerInfoLoader) { return ServerInfoLoader(); } }, controller : '<API key>' }) .when('/realms/:realm/authentication/otp-policy', { templateUrl : resourceUrl + '/partials/otp-policy.html', resolve : { realm : function(RealmLoader) { return RealmLoader(); }, serverInfo : function(ServerInfo) { return ServerInfo.delay; } }, controller : 'RealmOtpPolicyCtrl' }) .when('/realms/:realm/authentication/flows/:flow/config/:provider/:config', { templateUrl : resourceUrl + '/partials/<API key>.html', resolve : { realm : function(RealmLoader) { return RealmLoader(); }, flow : function(<API key>) { return <API key>(); }, configType : function(<API key>) { return <API key>(); }, config : function(<API key>) { return <API key>(); } }, controller : '<API key> }) .when('/create/authentication/:realm/flows/:flow/execution/:executionId/provider/:provider', { templateUrl : resourceUrl + '/partials/<API key>.html', resolve : { realm : function(RealmLoader) { return RealmLoader(); }, flow : function(<API key>) { return <API key>(); }, configType : function(<API key>) { return <API key>(); }, execution : function(ExecutionIdLoader) { return ExecutionIdLoader(); } }, controller : '<API key> }) .when('/server-info', { templateUrl : resourceUrl + '/partials/server-info.html', resolve : { serverInfo : function(ServerInfoLoader) { return ServerInfoLoader(); } }, controller : 'ServerInfoCtrl' }) .when('/server-info/providers', { templateUrl : resourceUrl + '/partials/<API key>.html', resolve : { serverInfo : function(ServerInfoLoader) { return ServerInfoLoader(); } }, controller : 'ServerInfoCtrl' }) .when('/logout', { templateUrl : resourceUrl + '/partials/home.html', controller : 'LogoutCtrl' }) .when('/notfound', { templateUrl : resourceUrl + '/partials/notfound.html' }) .when('/forbidden', { templateUrl : resourceUrl + '/partials/forbidden.html' }) .otherwise({ templateUrl : resourceUrl + '/partials/pagenotfound.html' }); } ]); module.config(function($httpProvider) { $httpProvider.interceptors.push('errorInterceptor'); var spinnerFunction = function(data, headersGetter) { if (resourceRequests == 0) { loadingTimer = window.setTimeout(function() { $('#loading').show(); loadingTimer = -1; }, 500); } resourceRequests++; return data; }; $httpProvider.defaults.transformRequest.push(spinnerFunction); $httpProvider.interceptors.push('spinnerInterceptor'); $httpProvider.interceptors.push('authInterceptor'); }); module.factory('spinnerInterceptor', function($q, $window, $rootScope, $location) { return { response: function(response) { resourceRequests if (resourceRequests == 0) { if(loadingTimer != -1) { window.clearTimeout(loadingTimer); loadingTimer = -1; } $('#loading').hide(); } return response; }, responseError: function(response) { resourceRequests if (resourceRequests == 0) { if(loadingTimer != -1) { window.clearTimeout(loadingTimer); loadingTimer = -1; } $('#loading').hide(); } return $q.reject(response); } }; }); module.factory('errorInterceptor', function($q, $window, $rootScope, $location, Notifications, Auth) { return { response: function(response) { return response; }, responseError: function(response) { if (response.status == 401) { Auth.authz.logout(); } else if (response.status == 403) { $location.path('/forbidden'); } else if (response.status == 404) { $location.path('/notfound'); } else if (response.status) { if (response.data && response.data.errorMessage) { Notifications.error(response.data.errorMessage); } else { Notifications.error("An unexpected server error has occurred"); } } return $q.reject(response); } }; }); // collapsable form fieldsets module.directive('collapsable', function() { return function(scope, element, attrs) { element.click(function() { $(this).toggleClass('collapsed'); $(this).find('.toggle-icons').toggleClass('kc-icon-collapse').toggleClass('kc-icon-expand'); $(this).find('.toggle-icons').text($(this).text() == "Icon: expand" ? "Icon: collapse" : "Icon: expand"); $(this).parent().find('.form-group').toggleClass('hidden'); }); } }); // collapsable form fieldsets module.directive('uncollapsed', function() { return function(scope, element, attrs) { element.prepend('<i class="toggle-class fa fa-angle-down"></i> '); element.click(function() { $(this).find('.toggle-class').toggleClass('fa-angle-down').toggleClass('fa-angle-right'); $(this).parent().find('.form-group').toggleClass('hidden'); }); } }); // collapsable form fieldsets module.directive('collapsed', function() { return function(scope, element, attrs) { element.prepend('<i class="toggle-class fa fa-angle-right"></i> '); element.parent().find('.form-group').toggleClass('hidden'); element.click(function() { $(this).find('.toggle-class').toggleClass('fa-angle-down').toggleClass('fa-angle-right'); $(this).parent().find('.form-group').toggleClass('hidden'); }); } }); /** * Directive for presenting an ON-OFF switch for checkbox. * Usage: <input ng-model="mmm" name="nnn" id="iii" onoffswitch [on-text="ooo" off-text="fff"] /> */ module.directive('onoffswitch', function() { return { restrict: "EA", replace: true, scope: { name: '@', id: '@', ngModel: '=', ngDisabled: '=', kcOnText: '@onText', kcOffText: '@offText' }, // TODO - The same code acts differently when put into the templateURL. Find why and move the code there. //templateUrl: "templates/kc-switch.html", template: "<span><div class='onoffswitch' tabindex='0'><input type='checkbox' ng-model='ngModel' ng-disabled='ngDisabled' class='<API key>' name='{{name}}' id='{{id}}'><label for='{{id}}' class='onoffswitch-label'><span class='onoffswitch-inner'><span class='onoffswitch-active'>{{kcOnText}}</span><span class='<API key>'>{{kcOffText}}</span></span><span class='onoffswitch-switch'></span></label></div></span>", compile: function(element, attrs) { /* We don't want to propagate basic attributes to the root element of directive. Id should be passed to the input element only to achieve proper label binding (and validity). */ element.removeAttr('name'); element.removeAttr('id'); if (!attrs.onText) { attrs.onText = "ON"; } if (!attrs.offText) { attrs.offText = "OFF"; } element.bind('keydown', function(e){ var code = e.keyCode || e.which; if (code === 32 || code === 13) { e.<API key>(); e.preventDefault(); $(e.target).find('input').click(); } }); } } }); /** * Directive for presenting an ON-OFF switch for checkbox. The directive expects the value to be string 'true' or 'false', not boolean true/false * This directive provides some additional capabilities to the default onoffswitch such as: * * - Dynamic values for id and name attributes. Useful if you need to use this directive inside a ng-repeat * - Specific scope to specify the value. Instead of just true or false. * * Usage: <input ng-model="mmm" name="nnn" id="iii" <API key> [on-text="ooo" off-text="fff"] /> */ module.directive('onoffswitchstring', function() { return { restrict: "EA", replace: true, scope: { name: '=', id: '=', value: '=', ngModel: '=', ngDisabled: '=', kcOnText: '@onText', kcOffText: '@offText' }, // TODO - The same code acts differently when put into the templateURL. Find why and move the code there. //templateUrl: "templates/kc-switch.html", template: '<span><div class="onoffswitch" tabindex="0"><input type="checkbox" ng-true-value="\'true\'" ng-false-value="\'false\'" ng-model="ngModel" ng-disabled="ngDisabled" class="<API key>" name="kc{{name}}" id="kc{{id}}"><label for="kc{{id}}" class="onoffswitch-label"><span class="onoffswitch-inner"><span class="onoffswitch-active">{{kcOnText}}</span><span class="<API key>">{{kcOffText}}</span></span><span class="onoffswitch-switch"></span></label></div></span>', compile: function(element, attrs) { if (!attrs.onText) { attrs.onText = "ON"; } if (!attrs.offText) { attrs.offText = "OFF"; } element.bind('keydown click', function(e){ var code = e.keyCode || e.which; if (code === 32 || code === 13) { e.<API key>(); e.preventDefault(); $(e.target).find('input').click(); } }); } } }); /** * Directive for presenting an ON-OFF switch for checkbox. The directive expects the true-value or false-value to be string like 'true' or 'false', not boolean true/false. * This directive provides some additional capabilities to the default onoffswitch such as: * * - Specific scope to specify the value. Instead of just 'true' or 'false' you can use any other values. For example: true-value="'foo'" false-value="'bar'" . * But 'true'/'false' are defaults if true-value and false-value are not specified * * Usage: <input ng-model="mmm" name="nnn" id="iii" onoffswitchvalue [ true-value="'true'" false-value="'false'" on-text="ooo" off-text="fff"] /> */ module.directive('onoffswitchvalue', function() { return { restrict: "EA", replace: true, scope: { name: '@', id: '@', trueValue: '@', falseValue: '@', ngModel: '=', ngDisabled: '=', kcOnText: '@onText', kcOffText: '@offText' }, // TODO - The same code acts differently when put into the templateURL. Find why and move the code there. //templateUrl: "templates/kc-switch.html", template: "<span><div class='onoffswitch' tabindex='0'><input type='checkbox' ng-true-value='{{trueValue}}' ng-false-value='{{falseValue}}' ng-model='ngModel' ng-disabled='ngDisabled' class='<API key>' name='{{name}}' id='{{id}}'><label for='{{id}}' class='onoffswitch-label'><span class='onoffswitch-inner'><span class='onoffswitch-active'>{{kcOnText}}</span><span class='<API key>'>{{kcOffText}}</span></span><span class='onoffswitch-switch'></span></label></div></span>", compile: function(element, attrs) { /* We don't want to propagate basic attributes to the root element of directive. Id should be passed to the input element only to achieve proper label binding (and validity). */ element.removeAttr('name'); element.removeAttr('id'); if (!attrs.trueValue) { attrs.trueValue = "'true'"; } if (!attrs.falseValue) { attrs.falseValue = "'false'"; } if (!attrs.onText) { attrs.onText = "ON"; } if (!attrs.offText) { attrs.offText = "OFF"; } element.bind('keydown', function(e){ var code = e.keyCode || e.which; if (code === 32 || code === 13) { e.<API key>(); e.preventDefault(); $(e.target).find('input').click(); } }); } } }); module.directive('kcInput', function() { var d = { scope : true, replace : false, link : function(scope, element, attrs) { var form = element.children('form'); var label = element.children('label'); var input = element.children('input'); var id = form.attr('name') + '.' + input.attr('name'); element.attr('class', 'control-group'); label.attr('class', 'control-label'); label.attr('for', id); input.wrap('<div class="controls"/>'); input.attr('id', id); if (!input.attr('placeHolder')) { input.attr('placeHolder', label.text()); } if (input.attr('required')) { label.append(' <span class="required">*</span>'); } } }; return d; }); module.directive('kcEnter', function() { return function(scope, element, attrs) { element.bind("keydown keypress", function(event) { if (event.which === 13) { scope.$apply(function() { scope.$eval(attrs.kcEnter); }); event.preventDefault(); } }); }; }); module.directive('kcSave', function ($compile, Notifications) { return { restrict: 'A', link: function ($scope, elem, attr, ctrl) { elem.addClass("btn btn-primary"); elem.attr("type","submit"); elem.bind('click', function() { $scope.$apply(function() { var form = elem.closest('form'); if (form && form.attr('name')) { var ngValid = form.find('.ng-valid'); if ($scope[form.attr('name')].$valid) { //ngValid.removeClass('error'); ngValid.parent().removeClass('has-error'); $scope['save'](); } else { Notifications.error("Missing or invalid field(s). Please verify the fields in red.") //ngValid.removeClass('error'); ngValid.parent().removeClass('has-error'); var ngInvalid = form.find('.ng-invalid'); //ngInvalid.addClass('error'); ngInvalid.parent().addClass('has-error'); } } }); }) } } }); module.directive('kcReset', function ($compile, Notifications) { return { restrict: 'A', link: function ($scope, elem, attr, ctrl) { elem.addClass("btn btn-default"); elem.attr("type","submit"); elem.bind('click', function() { $scope.$apply(function() { var form = elem.closest('form'); if (form && form.attr('name')) { form.find('.ng-valid').removeClass('error'); form.find('.ng-invalid').removeClass('error'); $scope['reset'](); } }) }) } } }); module.directive('kcCancel', function ($compile, Notifications) { return { restrict: 'A', link: function ($scope, elem, attr, ctrl) { elem.addClass("btn btn-default"); elem.attr("type","submit"); } } }); module.directive('kcDelete', function ($compile, Notifications) { return { restrict: 'A', link: function ($scope, elem, attr, ctrl) { elem.addClass("btn btn-danger"); elem.attr("type","submit"); } } }); module.directive('kcDropdown', function ($compile, Notifications) { return { scope: { kcOptions: '=', kcModel: '=', id: "=", kcPlaceholder: '@' }, restrict: 'EA', replace: true, templateUrl: resourceUrl + '/templates/kc-select.html', link: function(scope, element, attr) { scope.updateModel = function(item) { scope.kcModel = item; }; } } }); module.directive('kcReadOnly', function() { var disabled = {}; var d = { replace : false, link : function(scope, element, attrs) { var disable = function(i, e) { if (!e.disabled) { disabled[e.tagName + i] = true; e.disabled = true; } } var enable = function(i, e) { if (disabled[e.tagName + i]) { e.disabled = false; delete disabled[i]; } } var filterIgnored = function(i, e){ return !e.attributes['kc-read-only-ignore']; } scope.$watch(attrs.kcReadOnly, function(readOnly) { if (readOnly) { element.find('input').filter(filterIgnored).each(disable); element.find('button').filter(filterIgnored).each(disable); element.find('select').filter(filterIgnored).each(disable); element.find('textarea').filter(filterIgnored).each(disable); } else { element.find('input').filter(filterIgnored).each(enable); element.find('input').filter(filterIgnored).each(enable); element.find('button').filter(filterIgnored).each(enable); element.find('select').filter(filterIgnored).each(enable); element.find('textarea').filter(filterIgnored).each(enable); } }); } }; return d; }); module.directive('kcMenu', function () { return { scope: true, restrict: 'E', replace: true, templateUrl: resourceUrl + '/templates/kc-menu.html' } }); module.directive('kcTabsRealm', function () { return { scope: true, restrict: 'E', replace: true, templateUrl: resourceUrl + '/templates/kc-tabs-realm.html' } }); module.directive('<API key>', function () { return { scope: true, restrict: 'E', replace: true, templateUrl: resourceUrl + '/templates/<API key>.html' } }); module.directive('kcTabsUser', function () { return { scope: true, restrict: 'E', replace: true, templateUrl: resourceUrl + '/templates/kc-tabs-user.html' } }); module.directive('kcTabsGroup', function () { return { scope: true, restrict: 'E', replace: true, templateUrl: resourceUrl + '/templates/kc-tabs-group.html' } }); module.directive('kcTabsGroupList', function () { return { scope: true, restrict: 'E', replace: true, templateUrl: resourceUrl + '/templates/kc-tabs-group-list.html' } }); module.directive('kcTabsClient', function () { return { scope: true, restrict: 'E', replace: true, templateUrl: resourceUrl + '/templates/kc-tabs-client.html' } }); module.directive('<API key>', function () { return { scope: true, restrict: 'E', replace: true, templateUrl: resourceUrl + '/templates/<API key>.html' } }); module.directive('kcNavigationUser', function () { return { scope: true, restrict: 'E', replace: true, templateUrl: resourceUrl + '/templates/kc-navigation-user.html' } }); module.directive('<API key>', function () { return { scope: true, restrict: 'E', replace: true, templateUrl: resourceUrl + '/templates/<API key>.html' } }); module.directive('<API key>', function () { return { scope: true, restrict: 'E', replace: true, templateUrl: resourceUrl + '/templates/<API key>.html' } }); module.controller('<API key>', function($scope, realm, config, configName, RealmRoles, Client, ClientRole, $modalInstance) { $scope.selectedRealmRole = { role: undefined }; $scope.selectedClientRole = { role: undefined }; $scope.client = { selected: undefined }; $scope.selectRealmRole = function() { config[configName] = $scope.selectedRealmRole.role.name; $modalInstance.close(); } $scope.selectClientRole = function() { config[configName] = $scope.client.selected.clientId + "." + $scope.selectedClientRole.role.name; $modalInstance.close(); } $scope.cancel = function() { $modalInstance.dismiss(); } $scope.changeClient = function() { if ($scope.client.selected) { ClientRole.query({realm: realm.realm, client: $scope.client.selected.id}, function (data) { $scope.clientRoles = data; }); } else { console.log('selected client was null'); $scope.clientRoles = null; } } RealmRoles.query({realm: realm.realm}, function(data) { $scope.realmRoles = data; }) Client.query({realm: realm.realm}, function(data) { $scope.clients = data; if (data.length > 0) { $scope.client.selected = data[0]; $scope.changeClient(); } }) }); module.controller('ProviderConfigCtrl', function ($modal, $scope) { $scope.openRoleSelector = function (configName, config) { $modal.open({ templateUrl: resourceUrl + '/partials/modal/role-selector.html', controller: '<API key>', resolve: { realm: function () { return $scope.realm; }, config: function () { return config; }, configName: function () { return configName; } } }) } }); module.directive('kcProviderConfig', function ($modal) { return { scope: { config: '=', properties: '=', realm: '=', clients: '=', configName: '=' }, restrict: 'E', replace: true, controller: 'ProviderConfigCtrl', templateUrl: resourceUrl + '/templates/kc-provider-config.html' } }); module.controller('<API key>', function($scope, realm, config, configName, RealmRoles, Client, ClientRole, $modalInstance) { $scope.selectedRealmRole = { role: undefined }; $scope.selectedClientRole = { role: undefined }; $scope.client = { selected: undefined }; $scope.selectRealmRole = function() { config[configName][0] = $scope.selectedRealmRole.role.name; $modalInstance.close(); } $scope.selectClientRole = function() { config[configName][0] = $scope.client.selected.clientId + "." + $scope.selectedClientRole.role.name; $modalInstance.close(); } $scope.cancel = function() { $modalInstance.dismiss(); } $scope.changeClient = function() { if ($scope.client.selected) { ClientRole.query({realm: realm.realm, client: $scope.client.selected.id}, function (data) { $scope.clientRoles = data; }); } else { console.log('selected client was null'); $scope.clientRoles = null; } } RealmRoles.query({realm: realm.realm}, function(data) { $scope.realmRoles = data; }) Client.query({realm: realm.realm}, function(data) { $scope.clients = data; if (data.length > 0) { $scope.client.selected = data[0]; $scope.changeClient(); } }) }); module.controller('ComponentConfigCtrl', function ($modal, $scope) { $scope.openRoleSelector = function (configName, config) { $modal.open({ templateUrl: resourceUrl + '/partials/modal/<API key>.html', controller: '<API key>', resolve: { realm: function () { return $scope.realm; }, config: function () { return config; }, configName: function () { return configName; } } }) } }); module.directive('kcComponentConfig', function ($modal) { return { scope: { config: '=', properties: '=', realm: '=', clients: '=', configName: '=' }, restrict: 'E', replace: true, controller: 'ComponentConfigCtrl', templateUrl: resourceUrl + '/templates/kc-component-config.html' } }); /* * Used to select the element (invoke $(elem).select()) on specified action list. * Usages kc-select-action="click mouseover" * When used in the textarea element, this will select/highlight the textarea content on specified action (i.e. click). */ module.directive('kcSelectAction', function ($compile, Notifications) { return { restrict: 'A', compile: function (elem, attrs) { var events = attrs.kcSelectAction.split(" "); for(var i=0; i < events.length; i++){ elem.bind(events[i], function(){ elem.select(); }); } } } }); module.filter('remove', function() { return function(input, remove, attribute) { if (!input || !remove) { return input; } var out = []; for ( var i = 0; i < input.length; i++) { var e = input[i]; if (Array.isArray(remove)) { for (var j = 0; j < remove.length; j++) { if (attribute) { if (remove[j][attribute] == e[attribute]) { e = null; break; } } else { if (remove[j] == e) { e = null; break; } } } } else { if (attribute) { if (remove[attribute] == e[attribute]) { e = null; } } else { if (remove == e) { e = null; } } } if (e != null) { out.push(e); } } return out; }; }); module.filter('capitalize', function() { return function(input) { if (!input) { return; } var splittedWords = input.split(/\s+/); for (var i=0; i<splittedWords.length ; i++) { splittedWords[i] = splittedWords[i].charAt(0).toUpperCase() + splittedWords[i].slice(1); }; return splittedWords.join(" "); }; }); module.filter('<API key>', function(){ return function(input){ if(!input){ return input; } var keys = Object.keys(input); if(keys.length <= 1){ return input; } keys.sort(); var result = {}; for (var i = 0; i < keys.length; i++) { result[keys[i]] = input[keys[i]]; } return result; }; }); module.directive('kcSidebarResize', function ($window) { return function (scope, element) { function resize() { var navBar = angular.element(document.<API key>('navbar-pf')).height(); var container = angular.element(document.getElementById("view").<API key>("div")[0]).height(); var height = Math.max(container, window.innerHeight - navBar - 3); element[0].style['min-height'] = height + 'px'; } resize(); var w = angular.element($window); scope.$watch(function () { return { 'h': window.innerHeight, 'w': window.innerWidth }; }, function () { resize(); }, true); w.bind('resize', function () { scope.$apply(); }); } }); module.directive('kcTooltip', function($compile) { return { restrict: 'E', replace: false, terminal: true, priority: 1000, link: function link(scope,element, attrs) { var angularElement = angular.element(element[0]); var tooltip = angularElement.text(); angularElement.text(''); element.addClass('hidden'); var label = angular.element(element.parent().children()[0]); label.append(' <i class="fa fa-question-circle text-muted" tooltip="' + tooltip + '" tooltip-placement="right" tooltip-trigger="mouseover mouseout"></i>'); $compile(label)(scope); } }; }); module.directive( 'kcOpen', function ( $location ) { return function ( scope, element, attrs ) { var path; attrs.$observe( 'kcOpen', function (val) { path = val; }); element.bind( 'click', function () { scope.$apply( function () { $location.path(path); }); }); }; }); module.directive('kcOnReadFile', function ($parse) { console.debug('kcOnReadFile'); return { restrict: 'A', scope: false, link: function(scope, element, attrs) { var fn = $parse(attrs.kcOnReadFile); element.on('change', function(onChangeEvent) { var reader = new FileReader(); reader.onload = function(onLoadEvent) { scope.$apply(function() { fn(scope, {$fileContent:onLoadEvent.target.result}); }); }; reader.readAsText((onChangeEvent.srcElement || onChangeEvent.target).files[0]); }); } }; });
package com.capgemini.resilience.employer.service; public interface <API key> { void <API key>(); }
using UnityEngine; using System.Collections; public class blockGenerator : MonoBehaviour { public int spawnRate = 1; private float timeSinceLastSpawn = 0; public GameObject oneCube; public int count; // Use this for initialization void Start () { //Debug.Log("ran cube creator"); count = 0; } // Update is called once per frame void Update () { //timeSinceLastSpawn += Time.<API key>; //Debug.Log("running cube creator" + timeSinceLastSpawn ); // if ( timeSinceLastSpawn > spawnRate ) //Clone the cubes and randomly place them count = count + 1; if (count.Equals(50)) { GameObject newCube = (GameObject)GameObject.Instantiate (oneCube); newCube.transform.position = new Vector3 (0, 0, 20.0f); newCube.transform.Translate (Random.Range (-8, 8), Random.Range (0, 8), 1.0f); timeSinceLastSpawn = 0; //Debug.Log("cube created"); count = 0; } } }
package com.box.boxjavalibv2.responseparsers; import java.io.<API key>; import java.io.IOException; import java.io.InputStream; import junit.framework.Assert; import org.apache.commons.io.IOUtils; import org.apache.http.Header; import org.apache.http.HttpEntity; import org.apache.http.HttpResponse; import org.apache.http.entity.StringEntity; import org.apache.http.message.BasicHeader; import org.apache.http.message.BasicHttpResponse; import org.easymock.EasyMock; import org.junit.Before; import org.junit.Test; import com.box.boxjavalibv2.dao.BoxPreview; import com.box.restclientv2.exceptions.BoxRestException; import com.box.restclientv2.responses.DefaultBoxResponse; public class <API key> { private final static String <API key> = "arbitrary string"; private final static String LINK_VALUE = "<https: private final static String LINK_NAME = "Link"; private final static int firstPage = 1; private final static int lastPage = 2; private final static double length = 213; private BoxPreview preview; private DefaultBoxResponse boxResponse; private HttpResponse response; private HttpEntity entity; private InputStream inputStream; private Header header; @Before public void setUp() { preview = new BoxPreview(); preview.setFirstPage(firstPage); preview.setLastPage(lastPage); boxResponse = EasyMock.createMock(DefaultBoxResponse.class); response = EasyMock.createMock(BasicHttpResponse.class); entity = EasyMock.createMock(StringEntity.class); header = new BasicHeader("Link", String.format(LINK_VALUE, firstPage, lastPage)); } @Test public void testCanParsePreview() throws <API key>, IOException, BoxRestException { EasyMock.reset(boxResponse, response, entity); inputStream = new <API key>(<API key>.getBytes()); EasyMock.expect(boxResponse.getHttpResponse()).andReturn(response); EasyMock.expect(boxResponse.getContentLength()).andReturn(length); EasyMock.expect(response.getEntity()).andReturn(entity); EasyMock.expect(entity.getContent()).andReturn(inputStream); EasyMock.expect(boxResponse.getHttpResponse()).andReturn(response); EasyMock.expect(response.getFirstHeader("Link")).andReturn(header); EasyMock.replay(boxResponse, response, entity); <API key> parser = new <API key>(); Object object = parser.parse(boxResponse); Assert.assertEquals(BoxPreview.class, object.getClass()); BoxPreview parsed = (BoxPreview) object; Assert.assertEquals(length, parsed.getContentLength()); Assert.assertEquals(firstPage, parsed.getFirstPage().intValue()); Assert.assertEquals(lastPage, parsed.getLastPage().intValue()); Assert.assertEquals(<API key>, IOUtils.toString(parsed.getContent())); EasyMock.verify(boxResponse, response, entity); } }
package com.veneweather.android; import android.app.Fragment; import android.app.ProgressDialog; import android.content.Intent; import android.os.Bundle; import android.support.annotation.Nullable; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.AdapterView; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.ListView; import android.widget.TextView; import android.widget.Toast; import com.veneweather.android.db.City; import com.veneweather.android.db.County; import com.veneweather.android.db.Province; import com.veneweather.android.util.HttpUtil; import com.veneweather.android.util.Utility; import org.litepal.crud.DataSupport; import java.io.IOException; import java.util.ArrayList; import java.util.List; import okhttp3.Call; import okhttp3.Callback; import okhttp3.Response; public class ChooseAreaFragment extends Fragment { public static final int LEVEL_PROVINCE = 0; public static final int LEVEL_CITY = 1; public static final int LEVEL_COUNTY = 2; private ProgressDialog progressDialog; private TextView titleText; private Button btn_back; private ListView listView; private ArrayAdapter<String> adapter; private List<String> dataList = new ArrayList<>(); private List<Province> provinceList; private List<City> cityList; private List<County> countyList; private Province selectedProvince; private City selectedCity; private int currentLevel; @Nullable @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.choose_area, container, false); titleText = (TextView) view.findViewById(R.id.title_text); btn_back = (Button) view.findViewById(R.id.back_button); listView = (ListView) view.findViewById(R.id.list_view); adapter = new ArrayAdapter<>(getContext(), android.R.layout.simple_list_item_1, dataList); listView.setAdapter(adapter); return view; } @Override public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); listView.<API key>(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { if (currentLevel == LEVEL_PROVINCE) { selectedProvince = provinceList.get(position); queryCities(); } else if (currentLevel == LEVEL_CITY) { selectedCity = cityList.get(position); queryCounties(); } else if (currentLevel == LEVEL_COUNTY) { String weatherId = countyList.get(position).getWeatherId(); if (getActivity() instanceof MainActivity) { Intent intent = new Intent(getActivity(), WeatherActivity.class); intent.putExtra("weather_id", weatherId); startActivity(intent); getActivity().finish(); } else if (getActivity() instanceof WeatherActivity) { WeatherActivity activity = (WeatherActivity) getActivity(); activity.drawerLayout.closeDrawers(); activity.swipeRefresh.setRefreshing(true); activity.requestWeather(weatherId); } } } }); btn_back.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if (currentLevel == LEVEL_CITY) { queryProvinces(); } else if (currentLevel == LEVEL_COUNTY) { queryCities(); } } }); queryProvinces(); } private void queryProvinces() { titleText.setText(""); btn_back.setVisibility(View.GONE); provinceList = DataSupport.findAll(Province.class); if (provinceList.size() > 0) { dataList.clear(); for (Province province : provinceList) { dataList.add(province.getProvinceName()); } adapter.<API key>(); listView.setSelection(0); currentLevel = LEVEL_PROVINCE; } else { String address = "http://guolin.tech/api/china"; queryFromServer(address, "province"); } } private void queryCities() { titleText.setText(selectedProvince.getProvinceName()); btn_back.setVisibility(View.VISIBLE); cityList = DataSupport.where("provinceid = ?", String.valueOf(selectedProvince.getId())).find(City.class); if (cityList.size() > 0) { dataList.clear(); for (City city : cityList) { dataList.add(city.getCityName()); } adapter.<API key>(); listView.setSelection(0); currentLevel = LEVEL_CITY; } else { int provinceCode = selectedProvince.getProvinceCode(); String address = "http://guolin.tech/api/china/" + provinceCode; queryFromServer(address, "city"); } } private void queryCounties() { titleText.setText(selectedCity.getCityName()); btn_back.setVisibility(View.VISIBLE); countyList = DataSupport.where("cityid = ?", String.valueOf(selectedCity.getId())).find(County.class); if (countyList.size() > 0) { dataList.clear(); for (County county : countyList) { dataList.add(county.getCountyName()); } adapter.<API key>(); listView.setSelection(0); currentLevel = LEVEL_COUNTY; } else { int provinceCode = selectedProvince.getProvinceCode(); int cityCode = selectedCity.getCitycode(); String address = "http://guolin.tech/api/china/" + provinceCode + "/" + cityCode; queryFromServer(address, "county"); } } private void queryFromServer(String address, final String type) { showProgressDialog(); HttpUtil.sendOkHttpRequest(address, new Callback() { @Override public void onResponse(Call call, Response response) throws IOException { String responseText = response.body().string(); boolean result = false; if ("province".equals(type)) { result = Utility.<API key>(responseText); } else if ("city".equals(type)) { result = Utility.handleCityResponse(responseText, selectedProvince.getId()); } else if ("county".equals(type)) { result = Utility.<API key>(responseText, selectedCity.getId()); } if (result) { getActivity().runOnUiThread(new Runnable() { @Override public void run() { closeProgressDialog(); if ("province".equals(type)) { queryProvinces(); } else if ("city".equals(type)) { queryCities(); } else if ("county".equals(type)) { queryCounties(); } } }); } } @Override public void onFailure(Call call, IOException e) { // runOnUiThread() getActivity().runOnUiThread(new Runnable() { @Override public void run() { closeProgressDialog(); Toast.makeText(getContext(), "", Toast.LENGTH_SHORT).show(); } }); } }); } private void showProgressDialog() { if (progressDialog == null) { progressDialog = new ProgressDialog(getActivity()); progressDialog.setMessage("..."); progressDialog.<API key>(false); } progressDialog.show(); } private void closeProgressDialog() { if (progressDialog != null) { progressDialog.dismiss(); } } }
<!DOCTYPE HTML PUBLIC "- <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (1.8.0_152-ea) on Sat Jul 29 21:49:13 PDT 2017 --> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Uses of Class com.fasterxml.jackson.datatype.jsr310.ser.YearMonthSerializer (Jackson datatype: JSR310 2.9.0 API)</title> <meta name="date" content="2017-07-29"> <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="Uses of Class com.fasterxml.jackson.datatype.jsr310.ser.YearMonthSerializer (Jackson datatype: JSR310 2.9.0 API)"; } } catch(err) { } </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <div class="topNav"><a name="navbar.top"> </a> <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.top.firstrow"> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../../../com/fasterxml/jackson/datatype/jsr310/ser/YearMonthSerializer.html" title="class in com.fasterxml.jackson.datatype.jsr310.ser">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../package-tree.html">Tree</a></li> <li><a href="../../../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../../../index-all.html">Index</a></li> <li><a href="../../../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../../../index.html?com/fasterxml/jackson/datatype/jsr310/ser/class-use/YearMonthSerializer.html" target="_top">Frames</a></li> <li><a href="YearMonthSerializer.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="<API key>"> <li><a href="../../../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><! allClassesLink = document.getElementById("<API key>"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } </script> </div> <a name="skip.navbar.top"> </a></div> <div class="header"> <h2 title="Uses of Class com.fasterxml.jackson.datatype.jsr310.ser.YearMonthSerializer" class="title">Uses of Class<br>com.fasterxml.jackson.datatype.jsr310.ser.YearMonthSerializer</h2> </div> <div class="classUseContainer"> <ul class="blockList"> <li class="blockList"> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing packages, and an explanation"> <caption><span>Packages that use <a href="../../../../../../../com/fasterxml/jackson/datatype/jsr310/ser/YearMonthSerializer.html" title="class in com.fasterxml.jackson.datatype.jsr310.ser">YearMonthSerializer</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Package</th> <th class="colLast" scope="col">Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><a href="#com.fasterxml.jackson.datatype.jsr310.ser">com.fasterxml.jackson.datatype.jsr310.ser</a></td> <td class="colLast">&nbsp;</td> </tr> </tbody> </table> </li> <li class="blockList"> <ul class="blockList"> <li class="blockList"><a name="com.fasterxml.jackson.datatype.jsr310.ser"> </a> <h3>Uses of <a href="../../../../../../../com/fasterxml/jackson/datatype/jsr310/ser/YearMonthSerializer.html" title="class in com.fasterxml.jackson.datatype.jsr310.ser">YearMonthSerializer</a> in <a href="../../../../../../../com/fasterxml/jackson/datatype/jsr310/ser/package-summary.html">com.fasterxml.jackson.datatype.jsr310.ser</a></h3> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing fields, and an explanation"> <caption><span>Fields in <a href="../../../../../../../com/fasterxml/jackson/datatype/jsr310/ser/package-summary.html">com.fasterxml.jackson.datatype.jsr310.ser</a> declared as <a href="../../../../../../../com/fasterxml/jackson/datatype/jsr310/ser/YearMonthSerializer.html" title="class in com.fasterxml.jackson.datatype.jsr310.ser">YearMonthSerializer</a></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> <tbody> <tr class="altColor"> <td class="colFirst"><code>static <a href="../../../../../../../com/fasterxml/jackson/datatype/jsr310/ser/YearMonthSerializer.html" title="class in com.fasterxml.jackson.datatype.jsr310.ser">YearMonthSerializer</a></code></td> <td class="colLast"><span class="typeNameLabel">YearMonthSerializer.</span><code><span class="memberNameLink"><a href="../../../../../../../com/fasterxml/jackson/datatype/jsr310/ser/YearMonthSerializer.html#INSTANCE">INSTANCE</a></span></code>&nbsp;</td> </tr> </tbody> </table> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation"> <caption><span>Methods in <a href="../../../../../../../com/fasterxml/jackson/datatype/jsr310/ser/package-summary.html">com.fasterxml.jackson.datatype.jsr310.ser</a> that return <a href="../../../../../../../com/fasterxml/jackson/datatype/jsr310/ser/YearMonthSerializer.html" title="class in com.fasterxml.jackson.datatype.jsr310.ser">YearMonthSerializer</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code>protected <a href="../../../../../../../com/fasterxml/jackson/datatype/jsr310/ser/YearMonthSerializer.html" title="class in com.fasterxml.jackson.datatype.jsr310.ser">YearMonthSerializer</a></code></td> <td class="colLast"><span class="typeNameLabel">YearMonthSerializer.</span><code><span class="memberNameLink"><a href="../../../../../../../com/fasterxml/jackson/datatype/jsr310/ser/YearMonthSerializer.html java.time.format.DateTimeFormatter&nbsp;formatter, com.fasterxml.jackson.annotation.JsonFormat.Shape&nbsp;shape)</code>&nbsp;</td> </tr> </tbody> </table> </li> </ul> </li> </ul> </div> <div class="bottomNav"><a name="navbar.bottom"> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.bottom.firstrow"> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../../../com/fasterxml/jackson/datatype/jsr310/ser/YearMonthSerializer.html" title="class in com.fasterxml.jackson.datatype.jsr310.ser">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../package-tree.html">Tree</a></li> <li><a href="../../../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../../../index-all.html">Index</a></li> <li><a href="../../../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../../../index.html?com/fasterxml/jackson/datatype/jsr310/ser/class-use/YearMonthSerializer.html" target="_top">Frames</a></li> <li><a href="YearMonthSerializer.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="<API key>"> <li><a href="../../../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><! allClassesLink = document.getElementById("<API key>"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } </script> </div> <a name="skip.navbar.bottom"> </a></div> <p class="legalCopy"><small>Copyright & </body> </html>
#Felipe Henrique Bastos Costa - 1615310032; lista = []#lista vazia; cont1 = 0#contador do indice; cont2 = 1 v = 5#representaria o len da lista; while(cont1 < v): x = int(input("Informe o %dº numero inteiro para colocar em sua lista:\n"%cont2))#x e a variavel que recebe #o numero do usuario lista.append(x)#o numero informado para x e colocado dentro da lista; cont1+=1#Os contadores estao cont2+=1#sendo incrementados; print("A lista de informada foi:\n%s"%lista)
package grafeas import ( "time" ) // An instance of an analysis type that has been found on a resource. type V1beta1Occurrence struct { // Output only. The name of the occurrence in the form of `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`. Name string `json:"name,omitempty"` // Required. Immutable. The resource for which the occurrence applies. Resource *V1beta1Resource `json:"resource,omitempty"` // Required. Immutable. The analysis note associated with this occurrence, in the form of `projects/[PROVIDER_ID]/notes/[NOTE_ID]`. This field can be used as a filter in list requests. NoteName string `json:"note_name,omitempty"` // Output only. This explicitly denotes which of the occurrence details are specified. This field can be used as a filter in list requests. Kind *V1beta1NoteKind `json:"kind,omitempty"` // A description of actions that can be taken to remedy the note. Remediation string `json:"remediation,omitempty"` // Output only. The time this occurrence was created. CreateTime time.Time `json:"create_time,omitempty"` // Output only. The time this occurrence was last updated. UpdateTime time.Time `json:"update_time,omitempty"` // Describes a security vulnerability. Vulnerability *<API key> `json:"vulnerability,omitempty"` // Describes a verifiable build. Build *V1beta1buildDetails `json:"build,omitempty"` // Describes how this resource derives from the basis in the associated note. DerivedImage *V1beta1imageDetails `json:"derived_image,omitempty"` // Describes the installation of a package on the linked resource. Installation *<API key> `json:"installation,omitempty"` // Describes the deployment of an artifact on a runtime. Deployment *<API key> `json:"deployment,omitempty"` // Describes when a resource was discovered. Discovered *<API key> `json:"discovered,omitempty"` // Describes an attestation of an artifact. Attestation *<API key> `json:"attestation,omitempty"` }
date: 2016-09-13T09:00:00+00:00 title: Community support type: page layout: overview aliases: - /community/ Vamp Community Edition is open source and Apache 2.0 licensed. For details of the **Vamp Enterprise Edition** please check the [Vamp feature matrix](/product/enterprise-edition/), [start a free trial] (/ee-trial-signup/), or [contact us](mailto:info@vamp.io) to discuss your requirements, pricing and features. ## Community support If you have a question about Vamp, please check the [Vamp documentation](/documentation/using-vamp/artifacts) first - we're always adding new resources, tutorials and examples. * **Bug reports:** If you found a bug, please report it! [Create an issue on GitHub](https://github.com/magneticio/vamp/issues) and provide as much info as you can, specifically the version of Vamp you are running and the container driver you are using. * **Gitter:** You can post questions directly to us on our [public Gitter channel](https://gitter.im/magneticio/vamp) * **Twitter:** You can also follow us on Twitter: [@vamp_io](https://twitter.com/vamp_io)
#include "stdafx.h" #include "InputReader.h" #include "graph.h" #include <iostream> #include <string> using namespace std; InputReader::InputReader(const char* fileName, const char* stFileName) { in.open(fileName); if(!in.is_open()) { cout<<"Input file "<<fileName<<" doesn't exist!"<<endl; exit(1); } stIn.open(stFileName); if(!stIn.is_open()) { cout<<"Input file "<<stFileName<<" doesn't exist!"<<endl; in.close(); exit(1); } } InputReader::~InputReader() { in.close(); stIn.close(); } void InputReader::ReadFirstLine() { in>>strLine; assert(strLine[0] == 'g'); in>>strLine; assert(strLine[0] == ' in>> gId; } bool InputReader::ReadGraph(Graph &g) { ReadFirstLine(); if(gId == 0) { return false; } g.nId = gId; in>>strLine; assert(strLine[0] == 's'); in>>g.nV>>g.nE; assert(g.nV < MAX); int u,v; for(int i = 1; i <= g.nE; i++) { in>>strLine; assert(strLine[0] == 'e'); in>>u>>v; in>>g.matrix[u][v].iC>>g.matrix[u][v].dP>>g.matrix[u][v].iLabel; } return true; } void InputReader::ReadSourceSink(int &s, int &t) { stIn>>s>>t; }
<?php namespace Illuminate\Database\Eloquent; use Closure; use <API key>; use Illuminate\Support\Arr; use Illuminate\Support\Str; use Illuminate\Pagination\Paginator; use Illuminate\Contracts\Support\Arrayable; use Illuminate\Database\Concerns\BuildsQueries; use Illuminate\Database\Eloquent\Relations\Relation; use Illuminate\Database\Query\Builder as QueryBuilder; /** * @mixin \Illuminate\Database\Query\Builder */ class Builder { use BuildsQueries, Concerns\<API key>; /** * The base query builder instance. * * @var \Illuminate\Database\Query\Builder */ protected $query; /** * The model being queried. * * @var \Illuminate\Database\Eloquent\Model */ protected $model; /** * The relationships that should be eager loaded. * * @var array */ protected $eagerLoad = []; /** * All of the globally registered builder macros. * * @var array */ protected static $macros = []; /** * All of the locally registered builder macros. * * @var array */ protected $localMacros = []; /** * A replacement for the typical delete function. * * @var \Closure */ protected $onDelete; /** * The methods that should be returned from query builder. * * @var array */ protected $passthru = [ 'insert', 'insertGetId', 'getBindings', 'toSql', 'exists', 'doesntExist', 'count', 'min', 'max', 'avg', 'sum', 'getConnection', ]; /** * Applied global scopes. * * @var array */ protected $scopes = []; /** * Removed global scopes. * * @var array */ protected $removedScopes = []; /** * Create a new Eloquent query builder instance. * * @param \Illuminate\Database\Query\Builder $query * @return void */ public function __construct(QueryBuilder $query) { $this->query = $query; } /** * Create and return an un-saved model instance. * * @param array $attributes * @return \Illuminate\Database\Eloquent\Model */ public function make(array $attributes = []) { return $this->newModelInstance($attributes); } /** * Register a new global scope. * * @param string $identifier * @param \Illuminate\Database\Eloquent\Scope|\Closure $scope * @return $this */ public function withGlobalScope($identifier, $scope) { $this->scopes[$identifier] = $scope; if (method_exists($scope, 'extend')) { $scope->extend($this); } return $this; } /** * Remove a registered global scope. * * @param \Illuminate\Database\Eloquent\Scope|string $scope * @return $this */ public function withoutGlobalScope($scope) { if (! is_string($scope)) { $scope = get_class($scope); } unset($this->scopes[$scope]); $this->removedScopes[] = $scope; return $this; } /** * Remove all or passed registered global scopes. * * @param array|null $scopes * @return $this */ public function withoutGlobalScopes(array $scopes = null) { if (is_array($scopes)) { foreach ($scopes as $scope) { $this->withoutGlobalScope($scope); } } else { $this->scopes = []; } return $this; } /** * Get an array of global scopes that were removed from the query. * * @return array */ public function removedScopes() { return $this->removedScopes; } /** * Add a where clause on the primary key to the query. * * @param mixed $id * @return $this */ public function whereKey($id) { if (is_array($id) || $id instanceof Arrayable) { $this->query->whereIn($this->model->getQualifiedKeyName(), $id); return $this; } return $this->where($this->model->getQualifiedKeyName(), '=', $id); } /** * Add a where clause on the primary key to the query. * * @param mixed $id * @return $this */ public function whereKeyNot($id) { if (is_array($id) || $id instanceof Arrayable) { $this->query->whereNotIn($this->model->getQualifiedKeyName(), $id); return $this; } return $this->where($this->model->getQualifiedKeyName(), '!=', $id); } /** * Add a basic where clause to the query. * * @param string|array|\Closure $column * @param string $operator * @param mixed $value * @param string $boolean * @return $this */ public function where($column, $operator = null, $value = null, $boolean = 'and') { if ($column instanceof Closure) { $column($query = $this->model->newModelQuery()); $this->query->addNestedWhereQuery($query->getQuery(), $boolean); } else { $this->query->where(...func_get_args()); } return $this; } /** * Add an "or where" clause to the query. * * @param \Closure|array|string $column * @param string $operator * @param mixed $value * @return \Illuminate\Database\Eloquent\Builder|static */ public function orWhere($column, $operator = null, $value = null) { list($value, $operator) = $this->query-><API key>( $value, $operator, func_num_args() == 2 ); return $this->where($column, $operator, $value, 'or'); } /** * Create a collection of models from plain arrays. * * @param array $items * @return \Illuminate\Database\Eloquent\Collection */ public function hydrate(array $items) { $instance = $this->newModelInstance(); return $instance->newCollection(array_map(function ($item) use ($instance) { return $instance->newFromBuilder($item); }, $items)); } /** * Create a collection of models from a raw query. * * @param string $query * @param array $bindings * @return \Illuminate\Database\Eloquent\Collection */ public function fromQuery($query, $bindings = []) { return $this->hydrate( $this->query->getConnection()->select($query, $bindings) ); } /** * Find a model by its primary key. * * @param mixed $id * @param array $columns * @return \Illuminate\Database\Eloquent\Model|\Illuminate\Database\Eloquent\Collection|static[]|static|null */ public function find($id, $columns = ['*']) { if (is_array($id) || $id instanceof Arrayable) { return $this->findMany($id, $columns); } return $this->whereKey($id)->first($columns); } /** * Find multiple models by their primary keys. * * @param \Illuminate\Contracts\Support\Arrayable|array $ids * @param array $columns * @return \Illuminate\Database\Eloquent\Collection */ public function findMany($ids, $columns = ['*']) { if (empty($ids)) { return $this->model->newCollection(); } return $this->whereKey($ids)->get($columns); } /** * Find a model by its primary key or throw an exception. * * @param mixed $id * @param array $columns * @return \Illuminate\Database\Eloquent\Model|\Illuminate\Database\Eloquent\Collection * * @throws \Illuminate\Database\Eloquent\<API key> */ public function findOrFail($id, $columns = ['*']) { $result = $this->find($id, $columns); if (is_array($id)) { if (count($result) == count(array_unique($id))) { return $result; } } elseif (! is_null($result)) { return $result; } throw (new <API key>)->setModel( get_class($this->model), $id ); } /** * Find a model by its primary key or return fresh model instance. * * @param mixed $id * @param array $columns * @return \Illuminate\Database\Eloquent\Model */ public function findOrNew($id, $columns = ['*']) { if (! is_null($model = $this->find($id, $columns))) { return $model; } return $this->newModelInstance(); } /** * Get the first record matching the attributes or instantiate it. * * @param array $attributes * @param array $values * @return \Illuminate\Database\Eloquent\Model */ public function firstOrNew(array $attributes, array $values = []) { if (! is_null($instance = $this->where($attributes)->first())) { return $instance; } return $this->newModelInstance($attributes + $values); } /** * Get the first record matching the attributes or create it. * * @param array $attributes * @param array $values * @return \Illuminate\Database\Eloquent\Model */ public function firstOrCreate(array $attributes, array $values = []) { if (! is_null($instance = $this->where($attributes)->first())) { return $instance; } return tap($this->newModelInstance($attributes + $values), function ($instance) { $instance->save(); }); } /** * Create or update a record matching the attributes, and fill it with values. * * @param array $attributes * @param array $values * @return \Illuminate\Database\Eloquent\Model */ public function updateOrCreate(array $attributes, array $values = []) { return tap($this->firstOrNew($attributes), function ($instance) use ($values) { $instance->fill($values)->save(); }); } /** * Execute the query and get the first result or throw an exception. * * @param array $columns * @return \Illuminate\Database\Eloquent\Model|static * * @throws \Illuminate\Database\Eloquent\<API key> */ public function firstOrFail($columns = ['*']) { if (! is_null($model = $this->first($columns))) { return $model; } throw (new <API key>)->setModel(get_class($this->model)); } /** * Execute the query and get the first result or call a callback. * * @param \Closure|array $columns * @param \Closure|null $callback * @return \Illuminate\Database\Eloquent\Model|static|mixed */ public function firstOr($columns = ['*'], Closure $callback = null) { if ($columns instanceof Closure) { $callback = $columns; $columns = ['*']; } if (! is_null($model = $this->first($columns))) { return $model; } return call_user_func($callback); } /** * Get a single column's value from the first result of a query. * * @param string $column * @return mixed */ public function value($column) { if ($result = $this->first([$column])) { return $result->{$column}; } } /** * Execute the query as a "select" statement. * * @param array $columns * @return \Illuminate\Database\Eloquent\Collection|static[] */ public function get($columns = ['*']) { $builder = $this->applyScopes(); // If we actually found models we will also eager load any relationships that // have been specified as needing to be eager loaded, which will solve the // n+1 query issue for the developers to avoid running a lot of queries. if (count($models = $builder->getModels($columns)) > 0) { $models = $builder->eagerLoadRelations($models); } return $builder->getModel()->newCollection($models); } /** * Get the hydrated models without eager loading. * * @param array $columns * @return \Illuminate\Database\Eloquent\Model[] */ public function getModels($columns = ['*']) { return $this->model->hydrate( $this->query->get($columns)->all() )->all(); } /** * Eager load the relationships for the models. * * @param array $models * @return array */ public function eagerLoadRelations(array $models) { foreach ($this->eagerLoad as $name => $constraints) { // For nested eager loads we'll skip loading them here and they will be set as an // eager load on the query to retrieve the relation so that they will be eager // loaded on that query, because that is where they get hydrated as models. if (strpos($name, '.') === false) { $models = $this->eagerLoadRelation($models, $name, $constraints); } } return $models; } /** * Eagerly load the relationship on a set of models. * * @param array $models * @param string $name * @param \Closure $constraints * @return array */ protected function eagerLoadRelation(array $models, $name, Closure $constraints) { // First we will "back up" the existing where conditions on the query so we can // add our eager constraints. Then we will merge the wheres that were on the // query back to it in order that any where conditions might be specified. $relation = $this->getRelation($name); $relation->addEagerConstraints($models); $constraints($relation); // Once we have the results, we just match those back up to their parent models // using the relationship instance. Then we just return the finished arrays // of models which have been eagerly hydrated and are readied for return. return $relation->match( $relation->initRelation($models, $name), $relation->getEager(), $name ); } /** * Get the relation instance for the given relation name. * * @param string $name * @return \Illuminate\Database\Eloquent\Relations\Relation */ public function getRelation($name) { // We want to run a relationship query without any constrains so that we will // not have to remove these where clauses manually which gets really hacky // and error prone. We don't want constraints because we add eager ones. $relation = Relation::noConstraints(function () use ($name) { try { return $this->getModel()->newInstance()->$name(); } catch (<API key> $e) { throw <API key>::make($this->getModel(), $name); } }); $nested = $this-><API key>($name); // If there are nested relationships set on the query, we will put those onto // the query instances so that they can be handled after this relationship // is loaded. In this way they will all trickle down as they are loaded. if (count($nested) > 0) { $relation->getQuery()->with($nested); } return $relation; } /** * Get the deeply nested relations for a given top-level relation. * * @param string $relation * @return array */ protected function <API key>($relation) { $nested = []; // We are basically looking for any relationships that are nested deeper than // the given top-level relationship. We will just check for any relations // that start with the given top relations and adds them to our arrays. foreach ($this->eagerLoad as $name => $constraints) { if ($this->isNestedUnder($relation, $name)) { $nested[substr($name, strlen($relation.'.'))] = $constraints; } } return $nested; } /** * Determine if the relationship is nested. * * @param string $relation * @param string $name * @return bool */ protected function isNestedUnder($relation, $name) { return Str::contains($name, '.') && Str::startsWith($name, $relation.'.'); } /** * Get a generator for the given query. * * @return \Generator */ public function cursor() { foreach ($this->applyScopes()->query->cursor() as $record) { yield $this->model->newFromBuilder($record); } } /** * Chunk the results of a query by comparing numeric IDs. * * @param int $count * @param callable $callback * @param string $column * @param string|null $alias * @return bool */ public function chunkById($count, callable $callback, $column = null, $alias = null) { $column = is_null($column) ? $this->getModel()->getKeyName() : $column; $alias = is_null($alias) ? $column : $alias; $lastId = 0; do { $clone = clone $this; // We'll execute the query for the given page and get the results. If there are // no results we can just break and return from here. When there are results // we will call the callback with the current chunk of these results here. $results = $clone->forPageAfterId($count, $lastId, $column)->get(); $countResults = $results->count(); if ($countResults == 0) { break; } // On each chunk result set, we will pass them to the callback and then let the // developer take care of everything within the callback, which allows us to // keep the memory low for spinning through large result sets for working. if ($callback($results) === false) { return false; } $lastId = $results->last()->{$alias}; unset($results); } while ($countResults == $count); return true; } /** * Add a generic "order by" clause if the query doesn't already have one. * * @return void */ protected function enforceOrderBy() { if (empty($this->query->orders) && empty($this->query->unionOrders)) { $this->orderBy($this->model->getQualifiedKeyName(), 'asc'); } } /** * Get an array with the values of a given column. * * @param string $column * @param string|null $key * @return \Illuminate\Support\Collection */ public function pluck($column, $key = null) { $results = $this->toBase()->pluck($column, $key); // If the model has a mutator for the requested column, we will spin through // the results and mutate the values so that the mutated version of these // columns are returned as you would expect from these Eloquent models. if (! $this->model->hasGetMutator($column) && ! $this->model->hasCast($column) && ! in_array($column, $this->model->getDates())) { return $results; } return $results->map(function ($value) use ($column) { return $this->model->newFromBuilder([$column => $value])->{$column}; }); } /** * Paginate the given query. * * @param int $perPage * @param array $columns * @param string $pageName * @param int|null $page * @return \Illuminate\Contracts\Pagination\<API key> * * @throws \<API key> */ public function paginate($perPage = null, $columns = ['*'], $pageName = 'page', $page = null) { $page = $page ?: Paginator::resolveCurrentPage($pageName); $perPage = $perPage ?: $this->model->getPerPage(); $results = ($total = $this->toBase()-><API key>()) ? $this->forPage($page, $perPage)->get($columns) : $this->model->newCollection(); return $this->paginator($results, $total, $perPage, $page, [ 'path' => Paginator::resolveCurrentPath(), 'pageName' => $pageName, ]); } /** * Paginate the given query into a simple paginator. * * @param int $perPage * @param array $columns * @param string $pageName * @param int|null $page * @return \Illuminate\Contracts\Pagination\Paginator */ public function simplePaginate($perPage = null, $columns = ['*'], $pageName = 'page', $page = null) { $page = $page ?: Paginator::resolveCurrentPage($pageName); $perPage = $perPage ?: $this->model->getPerPage(); // Next we will set the limit and offset for this query so that when we get the // results we get the proper section of results. Then, we'll create the full // paginator instances for these results with the given page and per page. $this->skip(($page - 1) * $perPage)->take($perPage + 1); return $this->simplePaginator($this->get($columns), $perPage, $page, [ 'path' => Paginator::resolveCurrentPath(), 'pageName' => $pageName, ]); } /** * Save a new model and return the instance. * * @param array $attributes * @return \Illuminate\Database\Eloquent\Model|$this */ public function create(array $attributes = []) { return tap($this->newModelInstance($attributes), function ($instance) { $instance->save(); }); } /** * Save a new model and return the instance. Allow mass-assignment. * * @param array $attributes * @return \Illuminate\Database\Eloquent\Model|$this */ public function forceCreate(array $attributes) { return $this->model->unguarded(function () use ($attributes) { return $this->newModelInstance()->create($attributes); }); } /** * Update a record in the database. * * @param array $values * @return int */ public function update(array $values) { return $this->toBase()->update($this->addUpdatedAtColumn($values)); } /** * Increment a column's value by a given amount. * * @param string $column * @param int $amount * @param array $extra * @return int */ public function increment($column, $amount = 1, array $extra = []) { return $this->toBase()->increment( $column, $amount, $this->addUpdatedAtColumn($extra) ); } /** * Decrement a column's value by a given amount. * * @param string $column * @param int $amount * @param array $extra * @return int */ public function decrement($column, $amount = 1, array $extra = []) { return $this->toBase()->decrement( $column, $amount, $this->addUpdatedAtColumn($extra) ); } /** * Add the "updated at" column to an array of values. * * @param array $values * @return array */ protected function addUpdatedAtColumn(array $values) { if (! $this->model->usesTimestamps()) { return $values; } return Arr::add( $values, $this->model->getUpdatedAtColumn(), $this->model-><API key>() ); } /** * Delete a record from the database. * * @return mixed */ public function delete() { if (isset($this->onDelete)) { return call_user_func($this->onDelete, $this); } return $this->toBase()->delete(); } /** * Run the default delete function on the builder. * * Since we do not apply scopes here, the row will actually be deleted. * * @return mixed */ public function forceDelete() { return $this->query->delete(); } /** * Register a replacement for the default delete function. * * @param \Closure $callback * @return void */ public function onDelete(Closure $callback) { $this->onDelete = $callback; } /** * Call the given local model scopes. * * @param array $scopes * @return mixed */ public function scopes(array $scopes) { $builder = $this; foreach ($scopes as $scope => $parameters) { // If the scope key is an integer, then the scope was passed as the value and // the parameter list is empty, so we will format the scope name and these // parameters here. Then, we'll be ready to call the scope on the model. if (is_int($scope)) { list($scope, $parameters) = [$parameters, []]; } // Next we'll pass the scope callback to the callScope method which will take // care of grouping the "wheres" properly so the logical order doesn't get // messed up when adding scopes. Then we'll return back out the builder. $builder = $builder->callScope( [$this->model, 'scope'.ucfirst($scope)], (array) $parameters ); } return $builder; } /** * Apply the scopes to the Eloquent builder instance and return it. * * @return \Illuminate\Database\Eloquent\Builder|static */ public function applyScopes() { if (! $this->scopes) { return $this; } $builder = clone $this; foreach ($this->scopes as $identifier => $scope) { if (! isset($builder->scopes[$identifier])) { continue; } $builder->callScope(function (Builder $builder) use ($scope) { // If the scope is a Closure we will just go ahead and call the scope with the // builder instance. The "callScope" method will properly group the clauses // that are added to this query so "where" clauses maintain proper logic. if ($scope instanceof Closure) { $scope($builder); } // If the scope is a scope object, we will call the apply method on this scope // passing in the builder and the model instance. After we run all of these // scopes we will return back the builder instance to the outside caller. if ($scope instanceof Scope) { $scope->apply($builder, $this->getModel()); } }); } return $builder; } /** * Apply the given scope on the current builder instance. * * @param callable $scope * @param array $parameters * @return mixed */ protected function callScope(callable $scope, $parameters = []) { array_unshift($parameters, $this); $query = $this->getQuery(); // We will keep track of how many wheres are on the query before running the // scope so that we can properly group the added scope constraints in the // query as their own isolated nested where statement and avoid issues. $originalWhereCount = is_null($query->wheres) ? 0 : count($query->wheres); $result = $scope(...array_values($parameters)) ?? $this; if (count((array) $query->wheres) > $originalWhereCount) { $this-><API key>($query, $originalWhereCount); } return $result; } /** * Nest where conditions by slicing them at the given where count. * * @param \Illuminate\Database\Query\Builder $query * @param int $originalWhereCount * @return void */ protected function <API key>(QueryBuilder $query, $originalWhereCount) { // Here, we totally remove all of the where clauses since we are going to // rebuild them as nested queries by slicing the groups of wheres into // their own sections. This is to prevent any confusing logic order. $allWheres = $query->wheres; $query->wheres = []; $this-><API key>( $query, array_slice($allWheres, 0, $originalWhereCount) ); $this-><API key>( $query, array_slice($allWheres, $originalWhereCount) ); } /** * Slice where conditions at the given offset and add them to the query as a nested condition. * * @param \Illuminate\Database\Query\Builder $query * @param array $whereSlice * @return void */ protected function <API key>(QueryBuilder $query, $whereSlice) { $whereBooleans = collect($whereSlice)->pluck('boolean'); // Here we'll check if the given subset of where clauses contains any "or" // booleans and in this case create a nested where expression. That way // we don't add any unnecessary nesting thus keeping the query clean. if ($whereBooleans->contains('or')) { $query->wheres[] = $this->createNestedWhere( $whereSlice, $whereBooleans->first() ); } else { $query->wheres = array_merge($query->wheres, $whereSlice); } } /** * Create a where array with nested where conditions. * * @param array $whereSlice * @param string $boolean * @return array */ protected function createNestedWhere($whereSlice, $boolean = 'and') { $whereGroup = $this->getQuery()->forNestedWhere(); $whereGroup->wheres = $whereSlice; return ['type' => 'Nested', 'query' => $whereGroup, 'boolean' => $boolean]; } /** * Set the relationships that should be eager loaded. * * @param mixed $relations * @return $this */ public function with($relations) { $eagerLoad = $this->parseWithRelations(is_string($relations) ? func_get_args() : $relations); $this->eagerLoad = array_merge($this->eagerLoad, $eagerLoad); return $this; } /** * Prevent the specified relations from being eager loaded. * * @param mixed $relations * @return $this */ public function without($relations) { $this->eagerLoad = array_diff_key($this->eagerLoad, array_flip( is_string($relations) ? func_get_args() : $relations )); return $this; } /** * Create a new instance of the model being queried. * * @param array $attributes * @return \Illuminate\Database\Eloquent\Model */ public function newModelInstance($attributes = []) { return $this->model->newInstance($attributes)->setConnection( $this->query->getConnection()->getName() ); } /** * Parse a list of relations into individuals. * * @param array $relations * @return array */ protected function parseWithRelations(array $relations) { $results = []; foreach ($relations as $name => $constraints) { // If the "relation" value is actually a numeric key, we can assume that no // constraints have been specified for the eager load and we'll just put // an empty Closure with the loader so that we can treat all the same. if (is_numeric($name)) { $name = $constraints; list($name, $constraints) = Str::contains($name, ':') ? $this-><API key>($name) : [$name, function () { }]; } // We need to separate out any nested includes. Which allows the developers // to load deep relationships using "dots" without stating each level of // the relationship with its own key in the array of eager load names. $results = $this->addNestedWiths($name, $results); $results[$name] = $constraints; } return $results; } /** * Create a constraint to select the given columns for the relation. * * @param string $name * @return array */ protected function <API key>($name) { return [explode(':', $name)[0], function ($query) use ($name) { $query->select(explode(',', explode(':', $name)[1])); }]; } /** * Parse the nested relationships in a relation. * * @param string $name * @param array $results * @return array */ protected function addNestedWiths($name, $results) { $progress = []; // If the relation has already been set on the result array, we will not set it // again, since that would override any constraints that were already placed // on the relationships. We will only set the ones that are not specified. foreach (explode('.', $name) as $segment) { $progress[] = $segment; if (! isset($results[$last = implode('.', $progress)])) { $results[$last] = function () { }; } } return $results; } /** * Get the underlying query builder instance. * * @return \Illuminate\Database\Query\Builder */ public function getQuery() { return $this->query; } /** * Set the underlying query builder instance. * * @param \Illuminate\Database\Query\Builder $query * @return $this */ public function setQuery($query) { $this->query = $query; return $this; } /** * Get a base query builder instance. * * @return \Illuminate\Database\Query\Builder */ public function toBase() { return $this->applyScopes()->getQuery(); } /** * Get the relationships being eagerly loaded. * * @return array */ public function getEagerLoads() { return $this->eagerLoad; } /** * Set the relationships being eagerly loaded. * * @param array $eagerLoad * @return $this */ public function setEagerLoads(array $eagerLoad) { $this->eagerLoad = $eagerLoad; return $this; } /** * Get the model instance being queried. * * @return \Illuminate\Database\Eloquent\Model */ public function getModel() { return $this->model; } /** * Set a model instance for the model being queried. * * @param \Illuminate\Database\Eloquent\Model $model * @return $this */ public function setModel(Model $model) { $this->model = $model; $this->query->from($model->getTable()); return $this; } /** * Qualify the given column name by the model's table. * * @param string $column * @return string */ public function qualifyColumn($column) { return $this->model->qualifyColumn($column); } /** * Get the given macro by name. * * @param string $name * @return \Closure */ public function getMacro($name) { return Arr::get($this->localMacros, $name); } /** * Dynamically handle calls into the query instance. * * @param string $method * @param array $parameters * @return mixed */ public function __call($method, $parameters) { if ($method === 'macro') { $this->localMacros[$parameters[0]] = $parameters[1]; return; } if (isset($this->localMacros[$method])) { array_unshift($parameters, $this); return $this->localMacros[$method](...$parameters); } if (isset(static::$macros[$method])) { if (static::$macros[$method] instanceof Closure) { return <API key>(static::$macros[$method]->bindTo($this, static::class), $parameters); } return <API key>(static::$macros[$method], $parameters); } if (method_exists($this->model, $scope = 'scope'.ucfirst($method))) { return $this->callScope([$this->model, $scope], $parameters); } if (in_array($method, $this->passthru)) { return $this->toBase()->{$method}(...$parameters); } $this->query->{$method}(...$parameters); return $this; } /** * Dynamically handle calls into the query instance. * * @param string $method * @param array $parameters * @return mixed * * @throws \<API key> */ public static function __callStatic($method, $parameters) { if ($method === 'macro') { static::$macros[$parameters[0]] = $parameters[1]; return; } if (! isset(static::$macros[$method])) { throw new <API key>("Method {$method} does not exist."); } if (static::$macros[$method] instanceof Closure) { return <API key>(Closure::bind(static::$macros[$method], null, static::class), $parameters); } return <API key>(static::$macros[$method], $parameters); } /** * Force a clone of the underlying query builder when cloning. * * @return void */ public function __clone() { $this->query = clone $this->query; } }
package <API key>.tests; import static org.junit.Assert.assertEquals; import org.junit.BeforeClass; import org.junit.Test; import <API key>.*; public class TestEvaluator { private static Visitor<Integer> v; @BeforeClass public static void setUpBeforeClass() throws Exception { v = new Evaluator(); } @Test public void testLit() { Lit x = new Lit(); x.setInfo(42); assertEquals("evaluate a literal", 42, x.accept(v)); } @Test public void testAdd() { Add x = new Add(); Lit y = new Lit(); y.setInfo(1); x.setLeft(y); y = new Lit(); y.setInfo(2); x.setRight(y); assertEquals("evaluate addition", 3, x.accept(v)); } }
using System; using System.Collections.Generic; using System.Threading.Tasks; using AspNetCoreTodo.Models; namespace AspNetCoreTodo.Services { public interface ITodoItemService { Task<IEnumerable<TodoItem>> <API key>(ApplicationUser user); Task<bool> AddItemAsync(NewTodoItem newItem, ApplicationUser user); Task<bool> MarkDoneAsync(Guid id, ApplicationUser user); } }
<!DOCTYPE HTML PUBLIC "- <HTML> <HEAD> <meta name="generator" content="JDiff v1.0.9"> <!-- Generated by the JDiff Javadoc doclet --> <meta name="description" content="JDiff is a Javadoc doclet which generates an HTML report of all the packages, classes, constructors, methods, and fields which have been removed, added or changed in any way, including their documentation, when two APIs are compared."> <meta name="keywords" content="diff, jdiff, javadiff, java diff, java difference, API difference, difference between two APIs, API diff, Javadoc, doclet"> <TITLE> org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.<API key> </TITLE> <LINK REL="stylesheet" TYPE="text/css" HREF="../stylesheet-jdiff.css" TITLE="Style"> </HEAD> <BODY> <!-- Start of nav bar --> <TABLE summary="Navigation bar" BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0"> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <TABLE summary="Navigation bar" BORDER="0" CELLPADDING="0" CELLSPACING="3"> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../api/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/<API key>.html" target="_top"><FONT CLASS="NavBarFont1"><B><tt>pig 0.8.0-CDH3B4-SNAPSHOT</tt></B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="changes-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="pkg_org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="jdiff_statistics.html"><FONT CLASS="NavBarFont1"><B>Statistics</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="jdiff_help.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM><b>Generated by<br><a href="http: </TR> <TR> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;<A HREF="org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.PigRecordReader.html"><B>PREV CLASS</B></A> &nbsp;<A HREF="org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.PigSplit.html"><B>NEXT CLASS</B></A> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <A HREF="../changes.html" TARGET="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.<API key>.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL: &nbsp; <a href="#constructors">CONSTRUCTORS</a>&nbsp;|&nbsp; <a href="#methods">METHODS</a>&nbsp;|&nbsp; FIELDS </FONT></TD> </TR> </TABLE> <HR> <!-- End of nav bar --> <H2> Class org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.<A HREF="../../api/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/<API key>.html" target="_top"><tt><API key></tt></A> </H2> <a NAME="constructors"></a> <p> <a NAME="Changed"></a> <TABLE summary="Changed Constructors" BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TD VALIGN="TOP" COLSPAN=3><FONT SIZE="+1"><B>Changed Constructors</B></FONT></TD> </TR> <TR BGCOLOR="#FFFFFF" CLASS="TableRowColor"> <TD VALIGN="TOP" WIDTH="25%"> <A NAME="org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.<API key>.ctor_changed()"></A> <nobr><A HREF="../../api/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/<API key>.html#<API key>()" target="_top"><tt><API key></tt></A>(<code>void</code>) </nobr> </TD> <TD VALIGN="TOP" WIDTH="30%"> Change of visibility from public to protected.<br> </TD> <TD>&nbsp;</TD> </TR> </TABLE> &nbsp; <a NAME="methods"></a> <p> <a NAME="Removed"></a> <TABLE summary="Removed Methods" BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TD VALIGN="TOP" COLSPAN=2><FONT SIZE="+1"><B>Removed Methods</B></FONT></TD> </TR> <TR BGCOLOR="#FFFFFF" CLASS="TableRowColor"> <TD VALIGN="TOP" WIDTH="25%"> <A NAME="org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.<API key>.compare_removed(java.lang.Object, java.lang.Object, int, int, boolean[], boolean)"></A> <nobr><code>int</code>&nbsp;<A HREF="http://hadoop.apache.org/pig/docs/r0.7.0/api/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/<API key>.html#compare(java.lang.Object, java.lang.Object, int, int, boolean[], boolean)" target="_top"><tt>compare</tt></A>(<code>Object,</nobr> Object<nobr>,</nobr> int<nobr>,</nobr> int<nobr>,</nobr> boolean[]<nobr>,</nobr> boolean<nobr><nobr></code>)</nobr> </TD> <TD>&nbsp;</TD> </TR> </TABLE> &nbsp; <a NAME="fields"></a> <HR> <!-- Start of nav bar --> <TABLE summary="Navigation bar" BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0"> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <TABLE summary="Navigation bar" BORDER="0" CELLPADDING="0" CELLSPACING="3"> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../api/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/<API key>.html" target="_top"><FONT CLASS="NavBarFont1"><B><tt>pig 0.8.0-CDH3B4-SNAPSHOT</tt></B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="changes-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="pkg_org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="jdiff_statistics.html"><FONT CLASS="NavBarFont1"><B>Statistics</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="jdiff_help.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3></TD> </TR> <TR> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;<A HREF="org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.PigRecordReader.html"><B>PREV CLASS</B></A> &nbsp;<A HREF="org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.PigSplit.html"><B>NEXT CLASS</B></A> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <A HREF="../changes.html" TARGET="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.<API key>.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD> <TD BGCOLOR="0xFFFFFF" CLASS="NavBarCell3"></TD> </TR> </TABLE> <HR> <!-- End of nav bar --> </BODY> </HTML>
package fr.openwide.core.wicket.more.markup.html.feedback; import java.util.ArrayList; import java.util.List; import org.apache.wicket.MarkupContainer; import org.apache.wicket.feedback.FeedbackMessage; import org.apache.wicket.markup.html.panel.FeedbackPanel; import org.apache.wicket.markup.html.panel.Panel; public abstract class <API key> extends Panel { private static final long serialVersionUID = <API key>; private static final int[] <API key> = { FeedbackMessage.FATAL, FeedbackMessage.ERROR, FeedbackMessage.WARNING, FeedbackMessage.SUCCESS, FeedbackMessage.INFO, FeedbackMessage.DEBUG, FeedbackMessage.UNDEFINED }; private static final String[] <API key> = { "FATAL", "ERROR", "WARNING", "SUCCESS", "INFO", "DEBUG", "UNDEFINED" }; private List<FeedbackPanel> feedbackPanels = new ArrayList<FeedbackPanel>(); public <API key>(String id, MarkupContainer container) { super(id); int i = 0; for(int level: <API key>) { FeedbackPanel f = getFeedbackPanel(<API key>[i] + "feedbackPanel", level, container); feedbackPanels.add(f); add(f); i++; } } public abstract FeedbackPanel getFeedbackPanel(String id, int level, MarkupContainer container); }
<h3 class="page-header">Розв'язок</h3> <div class="task-solution-top"></div> <div class="task-solution-bg"> <p> В першу чергу, обчислимо ОДЗ: </p> <div class="formula-block"> \begin{equation*} \begin{aligned} \mbox{ОДЗ}:\;&x-3\geq 0;\\ &x\geq 3; \end{aligned} \end{equation*} </div> <p> Перший доданок є завжди додатним, бо це квадратний корінь. Другий доданок, також завжди додатний, бо це модуль. Очевидно, що сума двох додатних чисел рівна нулю лише тоді, коли ці числа рівні нулю. Тобто, ми маємо таку систему: </p> <div class="formula-block"> \begin{equation*} \begin{aligned} &\left\{ \begin{aligned} &x-3=0,\\ &x^2-9=0; \end{aligned} \right.\\ &\left\{ \begin{aligned} &x=3,\\ &x=\pm 3; \end{aligned} \right. \end{aligned} \end{equation*} </div> <p> Значення $x=-3$ не задовольняє ОДЗ, тому відповідь буде: </p> <div class="formula-block"> $$x=3.$$ </div> </div>
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); $route['default_controller'] = "reader"; $route['sitemap.xml'] = "reader/sitemap"; $route['rss.xml'] = "reader/feeds"; $route['atom.xml'] = "reader/feeds/atom"; $route['admin'] = "admin/series"; $route['admin/series/series/(:any)'] = "admin/series/serie/$1"; $route['account'] = "account/index/profile"; $route['account/profile'] = "account/index/profile"; $route['account/teams'] = "account/index/teams"; $route['account/leave_team/(:any)'] = "account/index/leave_team/$1"; $route['account/request/(:any)'] = "account/index/request/$1"; $route['account/leave_leadership/(:any)'] = "account/index/leave_leadership/$1"; $route['reader/list'] = 'reader/lista'; $route['reader/list/(:num)'] = 'reader/lista/$1'; $route['admin/members/members'] = 'admin/members/membersa'; // added for compatibility on upgrade 0.8.1 -> 0.8.2 on 30/09/2011 $route['admin/upgrade'] = 'admin/system/upgrade'; $route['404_override'] = ''; /* End of file routes.php */ /* Location: ./application/config/routes.php */
package Samples.MouseMenu; import edu.uci.ics.jung.algorithms.layout.Layout; import edu.uci.ics.jung.algorithms.layout.StaticLayout; import edu.uci.ics.jung.graph.SparseMultigraph; import edu.uci.ics.jung.visualization.VisualizationViewer; import edu.uci.ics.jung.visualization.control.<API key>; import edu.uci.ics.jung.visualization.control.ModalGraphMouse; import edu.uci.ics.jung.visualization.decorators.ToStringLabeller; import java.awt.Dimension; import javax.swing.JFrame; import javax.swing.JMenu; import javax.swing.JMenuBar; import javax.swing.JPopupMenu; /** * Illustrates the use of custom edge and vertex classes in a graph editing application. * Demonstrates a new graph mouse plugin for bringing up popup menus for vertices and * edges. * @author Dr. Greg M. Bernstein */ public class EditorMouseMenu { /** * @param args the command line arguments */ public static void main(String[] args) { JFrame frame = new JFrame("Editing and Mouse Menu Demo"); SparseMultigraph<GraphElements.MyVertex, GraphElements.MyEdge> g = new SparseMultigraph<GraphElements.MyVertex, GraphElements.MyEdge>(); // Layout<V, E>, VisualizationViewer<V,E> // Map<GraphElements.MyVertex,Point2D> vertexLocations = new HashMap<GraphElements.MyVertex, Point2D>(); Layout<GraphElements.MyVertex, GraphElements.MyEdge> layout = new StaticLayout(g); layout.setSize(new Dimension(300,300)); VisualizationViewer<GraphElements.MyVertex,GraphElements.MyEdge> vv = new VisualizationViewer<GraphElements.MyVertex,GraphElements.MyEdge>(layout); vv.setPreferredSize(new Dimension(350,350)); // Show vertex and edge labels vv.getRenderContext().<API key>(new ToStringLabeller()); vv.getRenderContext().<API key>(new ToStringLabeller()); // Create a graph mouse and add it to the visualization viewer <API key> gm = new <API key>(vv.getRenderContext(), GraphElements.MyVertexFactory.getInstance(), GraphElements.MyEdgeFactory.getInstance()); // Set some defaults for the Edges... GraphElements.MyEdgeFactory.setDefaultCapacity(192.0); GraphElements.MyEdgeFactory.setDefaultWeight(5.0); // Trying out our new popup menu mouse plugin... <API key> myPlugin = new <API key>(); // Add some popup menus for the edges and vertices to our mouse plugin. JPopupMenu edgeMenu = new MyMouseMenus.EdgeMenu(frame); JPopupMenu vertexMenu = new MyMouseMenus.VertexMenu(); myPlugin.setEdgePopup(edgeMenu); myPlugin.setVertexPopup(vertexMenu); gm.remove(gm.<API key>()); // Removes the existing popup editing plugin gm.add(myPlugin); // Add our new plugin to the mouse vv.setGraphMouse(gm); //JFrame frame = new JFrame("Editing and Mouse Menu Demo"); frame.<API key>(JFrame.EXIT_ON_CLOSE); frame.getContentPane().add(vv); // Let's add a menu for changing mouse modes JMenuBar menuBar = new JMenuBar(); JMenu modeMenu = gm.getModeMenu(); modeMenu.setText("Mouse Mode"); modeMenu.setIcon(null); // I'm using this in a main menu modeMenu.setPreferredSize(new Dimension(80,20)); // Change the size so I can see the text menuBar.add(modeMenu); frame.setJMenuBar(menuBar); gm.setMode(ModalGraphMouse.Mode.EDITING); // Start off in editing mode frame.pack(); frame.setVisible(true); } }
package ru.job4j.max; public class Max { public int max(int first, int second) { return first > second ? first : second; } public int max(int first, int second, int third) { return max(first, max(second, third)); } }
/** * Autogenerated by Thrift * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING */ package com.cloudera.flume.reporter.server; import java.util.List; import java.util.ArrayList; import java.util.Map; import java.util.HashMap; import java.util.EnumMap; import java.util.Set; import java.util.HashSet; import java.util.EnumSet; import java.util.Collections; import java.util.BitSet; import java.util.Arrays; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.apache.thrift.*; import org.apache.thrift.meta_data.*; import org.apache.thrift.protocol.*; public class FlumeReport implements TBase<FlumeReport._Fields>, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("FlumeReport"); private static final TField <API key> = new TField("stringMetrics", TType.MAP, (short)3); private static final TField <API key> = new TField("longMetrics", TType.MAP, (short)4); private static final TField <API key> = new TField("doubleMetrics", TType.MAP, (short)5); public Map<String,String> stringMetrics; public Map<String,Long> longMetrics; public Map<String,Double> doubleMetrics; /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements TFieldIdEnum { STRING_METRICS((short)3, "stringMetrics"), LONG_METRICS((short)4, "longMetrics"), DOUBLE_METRICS((short)5, "doubleMetrics"); private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>(); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byId.put((int)field._thriftId, field); byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { return byId.get(fieldId); } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields <API key>(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new <API key>("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{ put(_Fields.STRING_METRICS, new FieldMetaData("stringMetrics", <API key>.DEFAULT, new MapMetaData(TType.MAP, new FieldValueMetaData(TType.STRING), new FieldValueMetaData(TType.STRING)))); put(_Fields.LONG_METRICS, new FieldMetaData("longMetrics", <API key>.DEFAULT, new MapMetaData(TType.MAP, new FieldValueMetaData(TType.STRING), new FieldValueMetaData(TType.I64)))); put(_Fields.DOUBLE_METRICS, new FieldMetaData("doubleMetrics", <API key>.DEFAULT, new MapMetaData(TType.MAP, new FieldValueMetaData(TType.STRING), new FieldValueMetaData(TType.DOUBLE)))); }}); static { FieldMetaData.<API key>(FlumeReport.class, metaDataMap); } public FlumeReport() { } public FlumeReport( Map<String,String> stringMetrics, Map<String,Long> longMetrics, Map<String,Double> doubleMetrics) { this(); this.stringMetrics = stringMetrics; this.longMetrics = longMetrics; this.doubleMetrics = doubleMetrics; } /** * Performs a deep copy on <i>other</i>. */ public FlumeReport(FlumeReport other) { if (other.isSetStringMetrics()) { Map<String,String> <API key> = new HashMap<String,String>(); for (Map.Entry<String, String> other_element : other.stringMetrics.entrySet()) { String other_element_key = other_element.getKey(); String other_element_value = other_element.getValue(); String <API key> = other_element_key; String <API key> = other_element_value; <API key>.put(<API key>, <API key>); } this.stringMetrics = <API key>; } if (other.isSetLongMetrics()) { Map<String,Long> __this__longMetrics = new HashMap<String,Long>(); for (Map.Entry<String, Long> other_element : other.longMetrics.entrySet()) { String other_element_key = other_element.getKey(); Long other_element_value = other_element.getValue(); String <API key> = other_element_key; Long <API key> = other_element_value; __this__longMetrics.put(<API key>, <API key>); } this.longMetrics = __this__longMetrics; } if (other.isSetDoubleMetrics()) { Map<String,Double> <API key> = new HashMap<String,Double>(); for (Map.Entry<String, Double> other_element : other.doubleMetrics.entrySet()) { String other_element_key = other_element.getKey(); Double other_element_value = other_element.getValue(); String <API key> = other_element_key; Double <API key> = other_element_value; <API key>.put(<API key>, <API key>); } this.doubleMetrics = <API key>; } } public FlumeReport deepCopy() { return new FlumeReport(this); } @Deprecated public FlumeReport clone() { return new FlumeReport(this); } public int <API key>() { return (this.stringMetrics == null) ? 0 : this.stringMetrics.size(); } public void putToStringMetrics(String key, String val) { if (this.stringMetrics == null) { this.stringMetrics = new HashMap<String,String>(); } this.stringMetrics.put(key, val); } public Map<String,String> getStringMetrics() { return this.stringMetrics; } public FlumeReport setStringMetrics(Map<String,String> stringMetrics) { this.stringMetrics = stringMetrics; return this; } public void unsetStringMetrics() { this.stringMetrics = null; } /** Returns true if field stringMetrics is set (has been asigned a value) and false otherwise */ public boolean isSetStringMetrics() { return this.stringMetrics != null; } public void <API key>(boolean value) { if (!value) { this.stringMetrics = null; } } public int getLongMetricsSize() { return (this.longMetrics == null) ? 0 : this.longMetrics.size(); } public void putToLongMetrics(String key, long val) { if (this.longMetrics == null) { this.longMetrics = new HashMap<String,Long>(); } this.longMetrics.put(key, val); } public Map<String,Long> getLongMetrics() { return this.longMetrics; } public FlumeReport setLongMetrics(Map<String,Long> longMetrics) { this.longMetrics = longMetrics; return this; } public void unsetLongMetrics() { this.longMetrics = null; } /** Returns true if field longMetrics is set (has been asigned a value) and false otherwise */ public boolean isSetLongMetrics() { return this.longMetrics != null; } public void setLongMetricsIsSet(boolean value) { if (!value) { this.longMetrics = null; } } public int <API key>() { return (this.doubleMetrics == null) ? 0 : this.doubleMetrics.size(); } public void putToDoubleMetrics(String key, double val) { if (this.doubleMetrics == null) { this.doubleMetrics = new HashMap<String,Double>(); } this.doubleMetrics.put(key, val); } public Map<String,Double> getDoubleMetrics() { return this.doubleMetrics; } public FlumeReport setDoubleMetrics(Map<String,Double> doubleMetrics) { this.doubleMetrics = doubleMetrics; return this; } public void unsetDoubleMetrics() { this.doubleMetrics = null; } /** Returns true if field doubleMetrics is set (has been asigned a value) and false otherwise */ public boolean isSetDoubleMetrics() { return this.doubleMetrics != null; } public void <API key>(boolean value) { if (!value) { this.doubleMetrics = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case STRING_METRICS: if (value == null) { unsetStringMetrics(); } else { setStringMetrics((Map<String,String>)value); } break; case LONG_METRICS: if (value == null) { unsetLongMetrics(); } else { setLongMetrics((Map<String,Long>)value); } break; case DOUBLE_METRICS: if (value == null) { unsetDoubleMetrics(); } else { setDoubleMetrics((Map<String,Double>)value); } break; } } public void setFieldValue(int fieldID, Object value) { setFieldValue(_Fields.<API key>(fieldID), value); } public Object getFieldValue(_Fields field) { switch (field) { case STRING_METRICS: return getStringMetrics(); case LONG_METRICS: return getLongMetrics(); case DOUBLE_METRICS: return getDoubleMetrics(); } throw new <API key>(); } public Object getFieldValue(int fieldId) { return getFieldValue(_Fields.<API key>(fieldId)); } /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */ public boolean isSet(_Fields field) { switch (field) { case STRING_METRICS: return isSetStringMetrics(); case LONG_METRICS: return isSetLongMetrics(); case DOUBLE_METRICS: return isSetDoubleMetrics(); } throw new <API key>(); } public boolean isSet(int fieldID) { return isSet(_Fields.<API key>(fieldID)); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof FlumeReport) return this.equals((FlumeReport)that); return false; } public boolean equals(FlumeReport that) { if (that == null) return false; boolean <API key> = true && this.isSetStringMetrics(); boolean <API key> = true && that.isSetStringMetrics(); if (<API key> || <API key>) { if (!(<API key> && <API key>)) return false; if (!this.stringMetrics.equals(that.stringMetrics)) return false; } boolean <API key> = true && this.isSetLongMetrics(); boolean <API key> = true && that.isSetLongMetrics(); if (<API key> || <API key>) { if (!(<API key> && <API key>)) return false; if (!this.longMetrics.equals(that.longMetrics)) return false; } boolean <API key> = true && this.isSetDoubleMetrics(); boolean <API key> = true && that.isSetDoubleMetrics(); if (<API key> || <API key>) { if (!(<API key> && <API key>)) return false; if (!this.doubleMetrics.equals(that.doubleMetrics)) return false; } return true; } @Override public int hashCode() { return 0; } public void read(TProtocol iprot) throws TException { TField field; iprot.readStructBegin(); while (true) { field = iprot.readFieldBegin(); if (field.type == TType.STOP) { break; } _Fields fieldId = _Fields.findByThriftId(field.id); if (fieldId == null) { TProtocolUtil.skip(iprot, field.type); } else { switch (fieldId) { case STRING_METRICS: if (field.type == TType.MAP) { { TMap _map0 = iprot.readMapBegin(); this.stringMetrics = new HashMap<String,String>(2*_map0.size); for (int _i1 = 0; _i1 < _map0.size; ++_i1) { String _key2; String _val3; _key2 = iprot.readString(); _val3 = iprot.readString(); this.stringMetrics.put(_key2, _val3); } iprot.readMapEnd(); } } else { TProtocolUtil.skip(iprot, field.type); } break; case LONG_METRICS: if (field.type == TType.MAP) { { TMap _map4 = iprot.readMapBegin(); this.longMetrics = new HashMap<String,Long>(2*_map4.size); for (int _i5 = 0; _i5 < _map4.size; ++_i5) { String _key6; long _val7; _key6 = iprot.readString(); _val7 = iprot.readI64(); this.longMetrics.put(_key6, _val7); } iprot.readMapEnd(); } } else { TProtocolUtil.skip(iprot, field.type); } break; case DOUBLE_METRICS: if (field.type == TType.MAP) { { TMap _map8 = iprot.readMapBegin(); this.doubleMetrics = new HashMap<String,Double>(2*_map8.size); for (int _i9 = 0; _i9 < _map8.size; ++_i9) { String _key10; double _val11; _key10 = iprot.readString(); _val11 = iprot.readDouble(); this.doubleMetrics.put(_key10, _val11); } iprot.readMapEnd(); } } else { TProtocolUtil.skip(iprot, field.type); } break; } iprot.readFieldEnd(); } } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method validate(); } public void write(TProtocol oprot) throws TException { validate(); oprot.writeStructBegin(STRUCT_DESC); if (this.stringMetrics != null) { oprot.writeFieldBegin(<API key>); { oprot.writeMapBegin(new TMap(TType.STRING, TType.STRING, this.stringMetrics.size())); for (Map.Entry<String, String> _iter12 : this.stringMetrics.entrySet()) { oprot.writeString(_iter12.getKey()); oprot.writeString(_iter12.getValue()); } oprot.writeMapEnd(); } oprot.writeFieldEnd(); } if (this.longMetrics != null) { oprot.writeFieldBegin(<API key>); { oprot.writeMapBegin(new TMap(TType.STRING, TType.I64, this.longMetrics.size())); for (Map.Entry<String, Long> _iter13 : this.longMetrics.entrySet()) { oprot.writeString(_iter13.getKey()); oprot.writeI64(_iter13.getValue()); } oprot.writeMapEnd(); } oprot.writeFieldEnd(); } if (this.doubleMetrics != null) { oprot.writeFieldBegin(<API key>); { oprot.writeMapBegin(new TMap(TType.STRING, TType.DOUBLE, this.doubleMetrics.size())); for (Map.Entry<String, Double> _iter14 : this.doubleMetrics.entrySet()) { oprot.writeString(_iter14.getKey()); oprot.writeDouble(_iter14.getValue()); } oprot.writeMapEnd(); } oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } @Override public String toString() { StringBuilder sb = new StringBuilder("FlumeReport("); boolean first = true; sb.append("stringMetrics:"); if (this.stringMetrics == null) { sb.append("null"); } else { sb.append(this.stringMetrics); } first = false; if (!first) sb.append(", "); sb.append("longMetrics:"); if (this.longMetrics == null) { sb.append("null"); } else { sb.append(this.longMetrics); } first = false; if (!first) sb.append(", "); sb.append("doubleMetrics:"); if (this.doubleMetrics == null) { sb.append("null"); } else { sb.append(this.doubleMetrics); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws TException { // check for required fields } }
package org.elasticsearch.xpack.analytics.mapper; import org.elasticsearch.index.mapper.FieldTypeTestCase; import org.elasticsearch.index.mapper.MappedFieldType; public class <API key> extends FieldTypeTestCase<MappedFieldType> { @Override protected MappedFieldType <API key>() { return new <API key>.HistogramFieldType(); } }
package net.opengis.gml.provider; import java.util.Collection; import java.util.List; import net.opengis.gml.FeatureStyleType; import net.opengis.gml.GmlFactory; import net.opengis.gml.GmlPackage; import org.eclipse.emf.common.notify.AdapterFactory; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.ecore.EStructuralFeature; import org.eclipse.emf.ecore.util.FeatureMap; import org.eclipse.emf.ecore.util.FeatureMapUtil; import org.eclipse.emf.edit.provider.<API key>; import org.eclipse.emf.edit.provider.<API key>; import org.eclipse.emf.edit.provider.IItemLabelProvider; import org.eclipse.emf.edit.provider.<API key>; import org.eclipse.emf.edit.provider.IItemPropertySource; import org.eclipse.emf.edit.provider.<API key>; import org.eclipse.emf.edit.provider.<API key>; import org.eclipse.emf.edit.provider.<API key>; import org.eclipse.emf.edit.provider.ViewerNotification; /** * This is the item provider adapter for a {@link net.opengis.gml.FeatureStyleType} object. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public class <API key> extends <API key> implements <API key>, <API key>, <API key>, IItemLabelProvider, IItemPropertySource { /** * This constructs an instance from a factory and a notifier. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public <API key>(AdapterFactory adapterFactory) { super(adapterFactory); } /** * This returns the property descriptors for the adapted class. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public List<<API key>> <API key>(Object object) { if (<API key> == null) { super.<API key>(object); <API key>(object); <API key>(object); <API key>(object); <API key>(object); } return <API key>; } /** * This adds a property descriptor for the Feature Constraint feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected void <API key>(Object object) { <API key>.add (<API key> (((<API key>)adapterFactory).<API key>(), getResourceLocator(), getString("<API key>"), getString("<API key>", "<API key>", "<API key>"), GmlPackage.eINSTANCE.<API key>(), true, false, false, <API key>.GENERIC_VALUE_IMAGE, null, null)); } /** * This adds a property descriptor for the Base Type feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected void <API key>(Object object) { <API key>.add (<API key> (((<API key>)adapterFactory).<API key>(), getResourceLocator(), getString("<API key>"), getString("<API key>", "<API key>", "<API key>"), GmlPackage.eINSTANCE.<API key>(), true, false, false, <API key>.GENERIC_VALUE_IMAGE, null, null)); } /** * This adds a property descriptor for the Feature Type feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected void <API key>(Object object) { <API key>.add (<API key> (((<API key>)adapterFactory).<API key>(), getResourceLocator(), getString("<API key>"), getString("<API key>", "<API key>", "<API key>"), GmlPackage.eINSTANCE.<API key>(), true, false, false, <API key>.GENERIC_VALUE_IMAGE, null, null)); } /** * This adds a property descriptor for the Query Grammar feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected void <API key>(Object object) { <API key>.add (<API key> (((<API key>)adapterFactory).<API key>(), getResourceLocator(), getString("<API key>"), getString("<API key>", "<API key>", "<API key>"), GmlPackage.eINSTANCE.<API key>(), true, false, false, <API key>.GENERIC_VALUE_IMAGE, null, null)); } /** * This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an * {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or * {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Collection<? extends EStructuralFeature> getChildrenFeatures(Object object) { if (childrenFeatures == null) { super.getChildrenFeatures(object); childrenFeatures.add(GmlPackage.eINSTANCE.<API key>()); childrenFeatures.add(GmlPackage.eINSTANCE.<API key>()); childrenFeatures.add(GmlPackage.eINSTANCE.<API key>()); } return childrenFeatures; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected EStructuralFeature getChildFeature(Object object, Object child) { // Check the type of the specified child object and return the proper feature to use for // adding (see {@link AddCommand}) it as a child. return super.getChildFeature(object, child); } /** * This returns FeatureStyleType.gif. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Object getImage(Object object) { return overlayImage(object, getResourceLocator().getImage("full/obj16/FeatureStyleType")); } /** * This returns the label text for the adapted class. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public String getText(Object object) { String label = ((FeatureStyleType)object).getId(); return label == null || label.length() == 0 ? getString("<API key>") : getString("<API key>") + " " + label; } /** * This handles model notifications by calling {@link #updateChildren} to update any cached * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void notifyChanged(Notification notification) { updateChildren(notification); switch (notification.getFeatureID(FeatureStyleType.class)) { case GmlPackage.<API key>: case GmlPackage.<API key>: case GmlPackage.<API key>: case GmlPackage.<API key>: fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); return; case GmlPackage.<API key>: case GmlPackage.<API key>: case GmlPackage.<API key>: fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false)); return; } super.notifyChanged(notification); } /** * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children * that can be created under this object. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected void <API key>(Collection<Object> newChildDescriptors, Object object) { super.<API key>(newChildDescriptors, object); newChildDescriptors.add (<API key> (GmlPackage.eINSTANCE.<API key>(), GmlFactory.eINSTANCE.<API key>())); newChildDescriptors.add (<API key> (GmlPackage.eINSTANCE.<API key>(), GmlFactory.eINSTANCE.<API key>())); newChildDescriptors.add (<API key> (GmlPackage.eINSTANCE.<API key>(), GmlFactory.eINSTANCE.<API key>())); } /** * This returns the label text for {@link org.eclipse.emf.edit.command.CreateChildCommand}. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public String getCreateChildText(Object owner, Object feature, Object child, Collection<?> selection) { Object childFeature = feature; Object childObject = child; if (childFeature instanceof EStructuralFeature && FeatureMapUtil.isFeatureMap((EStructuralFeature)childFeature)) { FeatureMap.Entry entry = (FeatureMap.Entry)childObject; childFeature = entry.<API key>(); childObject = entry.getValue(); } boolean qualify = childFeature == GmlPackage.eINSTANCE.<API key>() || childFeature == GmlPackage.eINSTANCE.<API key>() || childFeature == GmlPackage.eINSTANCE.<API key>() || childFeature == GmlPackage.eINSTANCE.<API key>() || childFeature == GmlPackage.eINSTANCE.<API key>() || childFeature == GmlPackage.eINSTANCE.<API key>() || childFeature == GmlPackage.eINSTANCE.<API key>() || childFeature == GmlPackage.eINSTANCE.<API key>() || childFeature == GmlPackage.eINSTANCE.<API key>() || childFeature == GmlPackage.eINSTANCE.<API key>(); if (qualify) { return getString ("<API key>", new Object[] { getTypeText(childObject), getFeatureText(childFeature), getTypeText(owner) }); } return super.getCreateChildText(owner, feature, child, selection); } }
\section{ESRI} \index{ESRI} \index{Environmental Systems Research Institute} Environmental Systems Research Institute (ESRI) offers geospatial related data services and process online through its proprietary API. Features of the ESRI platform include access to basemaps, geocoding, demographic data, a dynamic world atlas, and multiple data sets in a open-data resource~\cite{<API key>}.
package sarama // ApiVersionsRequest ... type ApiVersionsRequest struct{} func (a *ApiVersionsRequest) encode(pe packetEncoder) error { return nil } func (a *ApiVersionsRequest) decode(pd packetDecoder, version int16) (err error) { return nil } func (a *ApiVersionsRequest) key() int16 { return 18 } func (a *ApiVersionsRequest) version() int16 { return 0 } func (a *ApiVersionsRequest) headerVersion() int16 { return 1 } func (a *ApiVersionsRequest) requiredVersion() KafkaVersion { return V0_10_0_0 }
<!DOCTYPE html> <html> <head> <title>Startup Cookie Manager</title> </head> <body> <h3 title="example.com will preserve example.com, and *.example.com cookies.">Cookie whitelist (include subdomains)</h3> <p title="example.com will preserve example.com, and *.example.com cookies."> <textarea id="subdomain-whitelist" rows="4" cols="50"></textarea> </p> <h3 title="example.com will preserve example.com, .example.com, and www.example.com cookies.">Cookie whitelist (root domains only)</h3> <p title="example.com will preserve example.com, .example.com, and www.example.com cookies."> <textarea id="<API key>" rows="4" cols="50"></textarea> </p> <h3 title="Additional tasks to perform whenever cookies and site data are cleared.">Additional settings</h3> <p> <input type="checkbox" id="cache_option"> <label for="cache_option">Clear cache.</label> </p> <p> <input type="checkbox" id="history_option"> <label for="history_option">Clear history.</label> </p> <p align="center" style="color:grey;"> Developed by <a href="https: </p> <script src="/js/options.js"></script> </body> </html>
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1" charset="UTF-8"> <title>minus</title> <link href="../../../images/logo-icon.svg" rel="icon" type="image/svg"> <script>var pathToRoot = "../../../";</script> <script type="text/javascript" src="../../../scripts/<API key>.js" async="async"></script> <link href="../../../styles/style.css" rel="Stylesheet"> <link href="../../../styles/logo-styles.css" rel="Stylesheet"> <link href="../../../styles/jetbrains-mono.css" rel="Stylesheet"> <link href="../../../styles/main.css" rel="Stylesheet"> <script type="text/javascript" src="../../../scripts/clipboard.js" async="async"></script> <script type="text/javascript" src="../../../scripts/navigation-loader.js" async="async"></script> <script type="text/javascript" src="../../../scripts/<API key>.js" async="async"></script> <script type="text/javascript" src="../../../scripts/main.js" async="async"></script> </head> <body> <div id="container"> <div id="leftColumn"> <div id="logo"></div> <div id="paneSearch"></div> <div id="sideMenu"></div> </div> <div id="main"> <div id="leftToggler"><span class="icon-toggler"></span></div> <script type="text/javascript" src="../../../scripts/pages.js"></script> <script type="text/javascript" src="../../../scripts/main.js"></script> <div class="main-content" id="content" pageIds="org.hexworks.zircon.api.data/Rect/minus/#org.hexworks.zircon.api.data.Rect/<API key>//-828656838"> <div class="navigation-wrapper" id="navigation-wrapper"> <div class="breadcrumbs"><a href="../../index.html">zircon.core</a>/<a href="../index.html">org.hexworks.zircon.api.data</a>/<a href="index.html">Rect</a>/<a href="minus.html">minus</a></div> <div class="pull-right d-flex"> <div class="filter-section" id="filter-section"><button class="platform-tag platform-selector common-like" data-active="" data-filter=":zircon.core:dokkaHtml/commonMain">common</button></div> <div id="searchBar"></div> </div> </div> <div class="cover "> <h1 class="cover"><span>minus</span></h1> </div> <div class="divergent-group" <API key>=":zircon.core:dokkaHtml/commonMain" data-filterable-set=":zircon.core:dokkaHtml/commonMain"><div class="with-platform-tags"><span class="pull-right"></span></div> <div> <div class="platform-hinted " <API key>="<API key>"><div class="content <API key>" data-active="" data-togglable=":zircon.core:dokkaHtml/commonMain"><div class="symbol monospace">abstract operator fun <a href="minus.html">minus</a>(rect: <a href="index.html">Rect</a>): <a href="index.html">Rect</a><span class="top-right-position"><span class="copy-icon"></span><div class="copy-popup-wrapper popup-to-left"><span class="copy-popup-icon"></span><span>Content copied to clipboard</span></div></span></div></div></div> </div> </div> <h2 class="">Sources</h2> <div class="table" data-togglable="Sources"><a data-name="%5Borg.hexworks.zircon.api.data%2FRect%2Fminus%2F%23org.hexworks.zircon.api.data.Rect%<API key>%2F%5D%2FSource%2F-828656838" anchor-label="https://github.com/Hexworks/zircon/tree/master/zircon.core/src/commonMain/kotlin/org/hexworks/zircon/api/data/Rect.kt#L50" id="%5Borg.hexworks.zircon.api.data%2FRect%2Fminus%2F%23org.hexworks.zircon.api.data.Rect%<API key>%2F%5D%2FSource%2F-828656838" data-filterable-set=":zircon.core:dokkaHtml/commonMain"></a> <div class="table-row" <API key>=":zircon.core:dokkaHtml/commonMain" data-filterable-set=":zircon.core:dokkaHtml/commonMain"> <div class="main-subrow keyValue "> <div class=""><span class="inline-flex"><a href="https://github.com/Hexworks/zircon/tree/master/zircon.core/src/commonMain/kotlin/org/hexworks/zircon/api/data/Rect.kt#L50">(source)</a><span class="anchor-wrapper"><span class="anchor-icon" pointing-to="%5Borg.hexworks.zircon.api.data%2FRect%2Fminus%2F%23org.hexworks.zircon.api.data.Rect%<API key>%2F%5D%2FSource%2F-828656838"></span> <div class="copy-popup-wrapper "><span class="copy-popup-icon"></span><span>Link copied to clipboard</span></div> </span></span></div> <div></div> </div> </div> </div> </div> <div class="footer"><span class="go-to-top-icon"><a href=" </div> </div> </body> </html>
using System.Collections.Generic; namespace Microsoft.Xna.Framework.Graphics { internal partial class <API key> { public string Name { get; private set; } public int Size { get; private set; } public List<int> ParameterIndex { get; private set; } public List<int> ParameterOffset { get; private set; } public List<DXEffectObject.d3dx_parameter> Parameters { get; private set; } public bool SameAs(<API key> other) { // If the names of the constant buffers don't // match then consider them different right off // the bat... even if their parameters are the same. if (Name != other.Name) return false; // Do we have the same count of parameters and size? if ( Size != other.Size || Parameters.Count != other.Parameters.Count) return false; // Compare the parameters themselves. for (var i = 0; i < Parameters.Count; i++) { var p1 = Parameters[i]; var p2 = other.Parameters[i]; // Check the importaint bits. if ( p1.name != p2.name || p1.rows != p2.rows || p1.columns != p2.columns || p1.class_ != p2.class_ || p1.type != p2.type || p1.bufferOffset != p2.bufferOffset) return false; } // These are equal. return true; } } }
<head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="description" content="{{ site.description }}"> <title>{% if page.title %}{{ page.title }} - {{ site.title }}{% else %}{{ site.title }}{% endif %}</title> <link rel="canonical" href="{{ page.url | replace:'index.html','' | prepend: site.baseurl | prepend: site.url }}"> <!-- Bootstrap Core CSS --> <link rel="stylesheet" href="{{ "/css/bootstrap.min.css" | prepend: site.baseurl }}"> <!-- Custom CSS --> <link rel="stylesheet" href="{{ "/css/clean-blog.css" | prepend: site.baseurl }}"> <link rel="stylesheet" href="{{ "/css/style.css" | prepend: site.baseurl }}"> <!-- Pygments Github CSS --> <link rel="stylesheet" href="{{ "/css/syntax.css" | prepend: site.baseurl }}"> <!-- Custom Fonts --> <link href="http://maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css" rel="stylesheet" type="text/css"> <link href='http://fonts.googleapis.com/css?family=Lora:400,700,400italic,700italic' rel='stylesheet' type='text/css'> <link href='http://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800' rel='stylesheet' type='text/css'> <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file: <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script> <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script> <![endif] </head>
PUSH = An open framework that allows data to be pushed from a server to a client
package ru.istolbov; import org.junit.Test; import static org.hamcrest.core.Is.is; import static org.junit.Assert.assertThat; /** * Test. * @author istolbov * @version $Id$ */ public class TurnTest { /** * Test turn back array. */ @Test public void whenWeTurnBackArray() { final int[] targetArray = new int[] {5, 4, 3, 2, 1}; final int[] testArray = new int[] {1, 2, 3, 4, 5}; final Turn turn = new Turn(); final int[] resultArray = turn.back(testArray); assertThat(resultArray, is(targetArray)); } /** * Test sort. */ @Test public void whenWeSortArray() { final int[] targetArray = new int[] {1, 2, 3, 4, 5}; final int[] testArray = new int[] {5, 3, 4, 1, 2}; final Turn turn = new Turn(); final int[] resultArray = turn.sort(testArray); assertThat(resultArray, is(targetArray)); } /** * Test rotate. */ @Test public void whenWeRotateArray() { final int[][] targetArray = new int[][] {{13, 9, 5, 1}, {14, 10, 6, 2}, {15, 11, 7, 3}, {16, 12, 8, 4}}; final int[][] testArray = new int[][] {{1, 2, 3, 4}, {5, 6, 7, 8}, {9, 10, 11, 12}, {13, 14, 15, 16}}; final Turn turn = new Turn(); final int[][] resultArray = turn.rotate(testArray); assertThat(resultArray, is(targetArray)); } /** * Test duplicateDelete. */ @Test public void <API key>() { final String[] targetArray = new String[] {"Привет", "Мир", "Май"}; final String[] testArray = new String[] {"Привет", "Привет", "Мир", "Привет", "Май", "Май", "Мир"}; final Turn turn = new Turn(); final String[] resultArray = turn.duplicateDelete(testArray); assertThat(resultArray, is(targetArray)); } /** * Test join. */ @Test public void whenWeJoinArrays() { final int[] firstTestArray = new int[] {1, 3, 5, 7, 9}; final int[] secondTestArray = new int[] {2, 4, 6, 8, 10}; final int[] targetArray = new int[] {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; final Turn turn = new Turn(); final int[] resultArray = turn.join(firstTestArray, secondTestArray); assertThat(resultArray, is(targetArray)); } }
""" Launcher functionality for the Google Compute Engine (GCE) """ import json import logging import os from dcos_launch import onprem, util from dcos_launch.platforms import gcp from dcos_test_utils.helpers import Host from googleapiclient.errors import HttpError log = logging.getLogger(__name__) def get_credentials(env=None) -> tuple: path = None if env is None: env = os.environ.copy() if 'GCE_CREDENTIALS' in env: json_credentials = env['GCE_CREDENTIALS'] elif '<API key>' in env: path = env['<API key>'] json_credentials = util.read_file(path) else: raise util.LauncherError( 'MissingParameter', 'Either GCE_CREDENTIALS or <API key> must be set in env') return json_credentials, path class OnPremLauncher(onprem.<API key>): # Launches a homogeneous cluster of plain GMIs intended for onprem DC/OS def __init__(self, config: dict, env=None): creds_string, _ = get_credentials(env) self.gcp_wrapper = gcp.GcpWrapper(json.loads(creds_string)) self.config = config @property def deployment(self): """ Builds a <API key> instance with self.config, but only returns it successfully if the corresponding real deployment (active machines) exists and doesn't contain any errors. """ try: deployment = gcp.<API key>(self.gcp_wrapper, self.config['deployment_name'], self.config['gce_zone']) info = deployment.get_info() errors = info['operation'].get('error') if errors: raise util.LauncherError('<API key>', str(errors)) return deployment except HttpError as e: if e.resp.status == 404: raise util.LauncherError('DeploymentNotFound', "The deployment you are trying to access doesn't exist") from e raise e def create(self) -> dict: self.key_helper() node_count = 1 + (self.config['num_masters'] + self.config['num_public_agents'] + self.config['num_private_agents']) gcp.<API key>.create( self.gcp_wrapper, self.config['deployment_name'], self.config['gce_zone'], node_count, self.config['disk_size'], self.config['disk_type'], self.config['source_image'], self.config['machine_type'], self.config['image_project'], self.config['ssh_user'], self.config['ssh_public_key'], self.config['disable_updates'], self.config['use_preemptible_vms'], tags=self.config.get('tags')) return self.config def key_helper(self): """ Generates a public key and a private key and stores them in the config. The public key will be applied to all the instances in the deployment later on when wait() is called. """ if self.config['key_helper']: private_key, public_key = util.<API key>() self.config['ssh_private_key'] = private_key.decode() self.config['ssh_public_key'] = public_key.decode() def get_cluster_hosts(self) -> [Host]: return list(self.deployment.hosts)[1:] def get_bootstrap_host(self) -> Host: return list(self.deployment.hosts)[0] def wait(self): """ Waits for the deployment to complete: first, the network that will contain the cluster is deployed. Once the network is deployed, a firewall for the network and an instance template are deployed. Finally, once the instance template is deployed, an instance group manager and all its instances are deployed. """ self.deployment.wait_for_completion() def delete(self): """ Deletes all the resources associated with the deployment (instance template, network, firewall, instance group manager and all its instances. """ self.deployment.delete()
package javay.test.security; import java.security.Key; import java.security.SecureRandom; import javax.crypto.Cipher; import javax.crypto.KeyGenerator; import javax.crypto.SecretKey; import javax.crypto.SecretKeyFactory; import javax.crypto.spec.DESKeySpec; public abstract class DESCoder extends Coder { /** * ALGORITHM <br> * keysize * * <pre> * DES key size must be equal to 56 * DESede(TripleDES) key size must be equal to 112 or 168 * AES key size must be equal to 128, 192 or 256,but 192 and 256 bits may not be available * Blowfish key size must be multiple of 8, and can only range from 32 to 448 (inclusive) * RC2 key size must be between 40 and 1024 bits * RC4(ARCFOUR) key size must be between 40 and 1024 bits * </pre> * * Key toKey(byte[] key) * <code>SecretKey secretKey = new SecretKeySpec(key, ALGORITHM);</code> * <code> * DESKeySpec dks = new DESKeySpec(key); * SecretKeyFactory keyFactory = SecretKeyFactory.getInstance(ALGORITHM); * SecretKey secretKey = keyFactory.generateSecret(dks); * </code> */ public static final String ALGORITHM = "DES"; /** * <br> * * @param key * @return * @throws Exception */ private static Key toKey(byte[] key) throws Exception { DESKeySpec dks = new DESKeySpec(key); SecretKeyFactory keyFactory = SecretKeyFactory.getInstance(ALGORITHM); SecretKey secretKey = keyFactory.generateSecret(dks); // AESBlowfish // SecretKey secretKey = new SecretKeySpec(key, ALGORITHM); return secretKey; } /** * * * @param data * @param key * @return * @throws Exception */ public static byte[] decrypt(byte[] data, String key) throws Exception { Key k = toKey(decryptBASE64(key)); Cipher cipher = Cipher.getInstance(ALGORITHM); cipher.init(Cipher.DECRYPT_MODE, k); return cipher.doFinal(data); } /** * * * @param data * @param key * @return * @throws Exception */ public static byte[] encrypt(byte[] data, String key) throws Exception { Key k = toKey(decryptBASE64(key)); Cipher cipher = Cipher.getInstance(ALGORITHM); cipher.init(Cipher.ENCRYPT_MODE, k); return cipher.doFinal(data); } /** * * * @return * @throws Exception */ public static String initKey() throws Exception { return initKey(null); } /** * * * @param seed * @return * @throws Exception */ public static String initKey(String seed) throws Exception { SecureRandom secureRandom = null; if (seed != null) { secureRandom = new SecureRandom(decryptBASE64(seed)); } else { secureRandom = new SecureRandom(); } KeyGenerator kg = KeyGenerator.getInstance(ALGORITHM); kg.init(secureRandom); SecretKey secretKey = kg.generateKey(); return encryptBASE64(secretKey.getEncoded()); } }
title: TiDB aliases: ['/docs-cn/dev/overview/','/docs-cn/dev/key-features/'] # TiDB [TiDB](https: TiDB <video src="https: - TiDB - Multi-Raft - HTAP [TiKV](/tikv-overview.md) [TiFlash](/tiflash/tiflash-overview.md) TiFlash Multi-Raft Learner TiKV TiKV TiFlash TiKVTiFlash HTAP - [TiDB Operator](https://docs.pingcap.com/zh/tidb-in-kubernetes/stable/<API key>) - MySQL 5.7 MySQL MySQL 5.7 MySQL MySQL MySQL TiDB[](/<API key>.md) - RTO (Recovery Time Objective) RPO (Recovery Point Objective) TiDB + Multi-Raft RTO <= 30s RPO = 0 - OLTP NewSQL NewSQL TiDBTiDB 512 1000 PB - Real-time HTAP 5G TB PB OLTP ETL OLAP TiDB 4.0 TiFlash TiKV HTAP - T+0 T+1 ETL + Hadoop Hadoop Hadoop TiDB ETL TiDB TiDB TiDB SQL TiDB <video src="https: - [TiDB ](/tidb-architecture.md) - [TiDB ](/tidb-storage.md) - [TiDB ](/tidb-computing.md) - [TiDB ](/tidb-scheduling.md)
# Cortinarius turmalis (Fr.) Fr., 1838 SPECIES # Status ACCEPTED # According to The Catalogue of Life, 3rd January 2011 # Published in Epicr. syst. mycol. (Upsaliae) 257 (1838) # Original name Cortinarius turmalis (Fr.) Fr., 1838 Remarks null
<reference path="../apimanPlugin.ts"/> <reference path="../services.ts"/> module Apiman { export var <API key> = _module.controller("Apiman.<API key>", ['$q', '$scope', '$location', 'PageLifecycle', '$routeParams', ($q, $scope, $location, PageLifecycle, $routeParams) => { PageLifecycle.loadPage('UserRedirect', undefined, undefined, $scope, function() { PageLifecycle.forwardTo('/users/{0}/orgs', $routeParams.user); }); }]) }
#pragma once #include "<API key>.h" #include "<API key>.h" #include "IModule.h" class CLOUDRENDERING_API <API key> : public IModule { Q_OBJECT public: <API key>(); ~<API key>(); IModule override. void Initialize(); IModule override. void Uninitialize(); public slots: WebRTCRendererPtr Renderer() const; WebRTCClientPtr Client() const; bool IsRenderer() const; bool IsClient() const; private: QString LC; WebRTCRendererPtr renderer_; WebRTCClientPtr client_; };
package me.knox.zmz.mvp.model; import io.reactivex.Flowable; import io.reactivex.android.schedulers.AndroidSchedulers; import java.util.List; import javax.inject.Inject; import me.knox.zmz.App; import me.knox.zmz.entity.News; import me.knox.zmz.mvp.contract.NewsListContract; import me.knox.zmz.network.JsonResponse; public class NewsListModel implements NewsListContract.Model { @Inject public NewsListModel() { // empty constructor for injection } @Override public Flowable<JsonResponse<List<News>>> getNewsList() { return App.getInstance().getApi().getNews().observeOn(AndroidSchedulers.mainThread(), true); } }
import java.util.Scanner; /** * @author Oleg Cherednik * @since 27.10.2017 */ public class Solution { static int[] leftRotation(int[] a, int d) { for (int i = 0, j = a.length - 1; i < j; i++, j swap(a, i, j); d %= a.length; if (d > 0) { d = a.length - d; for (int i = 0, j = d - 1; i < j; i++, j swap(a, i, j); for (int i = d, j = a.length - 1; i < j; i++, j swap(a, i, j); } return a; } private static void swap(int[] arr, int i, int j) { int tmp = arr[i]; arr[i] = arr[j]; arr[j] = tmp; } public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); int d = in.nextInt(); int[] a = new int[n]; for (int a_i = 0; a_i < n; a_i++) { a[a_i] = in.nextInt(); } int[] result = leftRotation(a, d); for (int i = 0; i < result.length; i++) { System.out.print(result[i] + (i != result.length - 1 ? " " : "")); } System.out.println(""); in.close(); } }
package com.pmis.manage.dao; import org.springframework.stereotype.Component; import com.pmis.common.dao.CommonDao; @Component public class UserInfoDao extends CommonDao{ }
package com.intellij.util.xml.impl; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.util.NullableFactory; import com.intellij.openapi.util.text.StringUtil; import com.intellij.psi.XmlElementFactory; import com.intellij.psi.xml.XmlDocument; import com.intellij.psi.xml.XmlFile; import com.intellij.psi.xml.XmlTag; import com.intellij.util.<API key>; import com.intellij.util.xml.DomElement; import com.intellij.util.xml.DomFileElement; import com.intellij.util.xml.DomNameStrategy; import com.intellij.util.xml.EvaluatedXmlName; import com.intellij.util.xml.stubs.ElementStub; import org.jetbrains.annotations.NonNls; import javax.annotation.Nonnull; import javax.annotation.Nullable; import java.util.List; /** * @author peter */ public class <API key> extends <API key><<API key>, ElementStub> { private static final Logger LOG = Logger.getInstance("#com.intellij.util.xml.impl.<API key>"); private final DomFileElementImpl<?> myParent; public <API key>(final Class aClass, final <API key> strategy, @Nonnull final DomFileElementImpl fileElement, @Nonnull final EvaluatedXmlName tagName, @Nullable ElementStub stub ) { super(aClass, strategy, tagName, new <API key>(aClass) { @Nonnull public List<? extends DomElement> getValues(@Nonnull final DomElement parent) { throw new <API key>(); } public int compareTo(final <API key> o) { throw new <API key>(); } }, fileElement.getManager(), true, stub); myParent = fileElement; } public void undefineInternal() { try { final XmlTag tag = getXmlTag(); if (tag != null) { deleteTag(tag); detach(); fireUndefinedEvent(); } } catch (Exception e) { LOG.error(e); } } public boolean equals(final Object obj) { if (!(obj instanceof <API key>)) return false; final <API key> handler = (<API key>)obj; return myParent.equals(handler.myParent); } public int hashCode() { return myParent.hashCode(); } @Nonnull public String <API key>() { return getXmlName().getNamespace(getFile(), getFile()); } @Override protected String checkValidity() { final XmlTag tag = (XmlTag)getXmlElement(); if (tag != null && !tag.isValid()) { return "invalid root tag"; } final String s = myParent.checkValidity(); if (s != null) { return "root: " + s; } return null; } @Nonnull public DomFileElementImpl getParent() { return myParent; } public DomElement <API key>() { final DomFileElement stableCopy = myParent.createStableCopy(); return getManager().createStableValue(new NullableFactory<DomElement>() { public DomElement create() { return stableCopy.isValid() ? stableCopy.getRootElement() : null; } }); } protected XmlTag setEmptyXmlTag() { final XmlTag[] result = new XmlTag[]{null}; getManager().runChange(new Runnable() { public void run() { try { final String namespace = <API key>(); @NonNls final String nsDecl = StringUtil.isEmpty(namespace) ? "" : " xmlns=\"" + namespace + "\""; final XmlFile xmlFile = getFile(); final XmlTag tag = XmlElementFactory.getInstance(xmlFile.getProject()).createTagFromText("<" + getXmlElementName() + nsDecl + "/>"); result[0] = ((XmlDocument)xmlFile.getDocument().replace(((XmlFile)tag.getContainingFile()).getDocument())).getRootTag(); } catch (<API key> e) { LOG.error(e); } } }); return result[0]; } @Nonnull public final DomNameStrategy getNameStrategy() { final Class<?> rawType = getRawType(); final DomNameStrategy strategy = DomImplUtil.getDomNameStrategy(rawType, isAttribute()); if (strategy != null) { return strategy; } return DomNameStrategy.HYPHEN_STRATEGY; } }
package org.consumersunion.stories.common.client.util; public class CachedObjectKeys { public static final String OPENED_CONTENT = "openedContent"; public static final String OPENED_STORY = "openedStory"; public static final String OPENED_COLLECTION = "openedCollection"; }
package dkalymbaev.triangle; class Triangle { /** * This class defines points a b and c as peacks of triangle. */ public Point a; public Point b; public Point c; /** * Creating of a new objects. * @param a is the length of the first side. * @param b is the length of the second side. * @param c is the length of the third side. */ public Triangle(Point a, Point b, Point c) { this.a = a; this.b = b; this.c = c; } public double area() { double ab = a.distanceTo(b); double bc = b.distanceTo(c); double ac = a.distanceTo(c); double halfperim = ((ab + bc + ac) / 2); double area = Math.sqrt(halfperim * (halfperim - ab) * (halfperim - bc) * (halfperim - ac)); if (ab > 0 && bc > 0 && ac > 0) { return area; } else { return 0; } } }
(function () { var files = ["hello.js", "app.js"]; files.forEach(function (file) { var scriptTag = document.createElement("script"); scriptTag.async = false; scriptTag.src = file; document.body.appendChild(scriptTag); }); }());
<?xml version="1.0" encoding="utf-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http: <html xmlns="http: <head> <meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> <title></title> <meta name="generator" content="Org mode" /> <meta name="author" content="Wu, Shanliang" /> <style type="text/css"> <!--/*--><![CDATA[/*><!--*/ .title { text-align: center; margin-bottom: .2em; } .subtitle { text-align: center; font-size: medium; font-weight: bold; margin-top:0; } .todo { font-family: monospace; color: red; } .done { font-family: monospace; color: green; } .priority { font-family: monospace; color: orange; } .tag { background-color: #eee; font-family: monospace; padding: 2px; font-size: 80%; font-weight: normal; } .timestamp { color: #bebebe; } .timestamp-kwd { color: #5f9ea0; } .org-right { margin-left: auto; margin-right: 0px; text-align: right; } .org-left { margin-left: 0px; margin-right: auto; text-align: left; } .org-center { margin-left: auto; margin-right: auto; text-align: center; } .underline { text-decoration: underline; } #postamble p, #preamble p { font-size: 90%; margin: .2em; } p.verse { margin-left: 3%; } pre { border: 1px solid #ccc; box-shadow: 3px 3px 3px #eee; padding: 8pt; font-family: monospace; overflow: auto; margin: 1.2em; } pre.src { position: relative; overflow: visible; padding-top: 1.2em; } pre.src:before { display: none; position: absolute; background-color: white; top: -10px; right: 10px; padding: 3px; border: 1px solid black; } pre.src:hover:before { display: inline;} /* Languages per Org manual */ pre.src-asymptote:before { content: 'Asymptote'; } pre.src-awk:before { content: 'Awk'; } pre.src-C:before { content: 'C'; } /* pre.src-C++ doesn't work in CSS */ pre.src-clojure:before { content: 'Clojure'; } pre.src-css:before { content: 'CSS'; } pre.src-D:before { content: 'D'; } pre.src-ditaa:before { content: 'ditaa'; } pre.src-dot:before { content: 'Graphviz'; } pre.src-calc:before { content: 'Emacs Calc'; } pre.src-emacs-lisp:before { content: 'Emacs Lisp'; } pre.src-fortran:before { content: 'Fortran'; } pre.src-gnuplot:before { content: 'gnuplot'; } pre.src-haskell:before { content: 'Haskell'; } pre.src-hledger:before { content: 'hledger'; } pre.src-java:before { content: 'Java'; } pre.src-js:before { content: 'Javascript'; } pre.src-latex:before { content: 'LaTeX'; } pre.src-ledger:before { content: 'Ledger'; } pre.src-lisp:before { content: 'Lisp'; } pre.src-lilypond:before { content: 'Lilypond'; } pre.src-lua:before { content: 'Lua'; } pre.src-matlab:before { content: 'MATLAB'; } pre.src-mscgen:before { content: 'Mscgen'; } pre.src-ocaml:before { content: 'Objective Caml'; } pre.src-octave:before { content: 'Octave'; } pre.src-org:before { content: 'Org mode'; } pre.src-oz:before { content: 'OZ'; } pre.src-plantuml:before { content: 'Plantuml'; } pre.src-processing:before { content: 'Processing.js'; } pre.src-python:before { content: 'Python'; } pre.src-R:before { content: 'R'; } pre.src-ruby:before { content: 'Ruby'; } pre.src-sass:before { content: 'Sass'; } pre.src-scheme:before { content: 'Scheme'; } pre.src-screen:before { content: 'Gnu Screen'; } pre.src-sed:before { content: 'Sed'; } pre.src-sh:before { content: 'shell'; } pre.src-sql:before { content: 'SQL'; } pre.src-sqlite:before { content: 'SQLite'; } /* additional languages in org.el's <API key> alist */ pre.src-forth:before { content: 'Forth'; } pre.src-io:before { content: 'IO'; } pre.src-J:before { content: 'J'; } pre.src-makefile:before { content: 'Makefile'; } pre.src-maxima:before { content: 'Maxima'; } pre.src-perl:before { content: 'Perl'; } pre.src-picolisp:before { content: 'Pico Lisp'; } pre.src-scala:before { content: 'Scala'; } pre.src-shell:before { content: 'Shell Script'; } pre.src-ebnf2ps:before { content: 'ebfn2ps'; } /* additional language identifiers per "defun org-babel-execute" in ob-*.el */ pre.src-cpp:before { content: 'C++'; } pre.src-abc:before { content: 'ABC'; } pre.src-coq:before { content: 'Coq'; } pre.src-groovy:before { content: 'Groovy'; } /* additional language identifiers from <API key> in ob-shell.el: ob-shell is the only babel language using a lambda to put the execution function name together. */ pre.src-bash:before { content: 'bash'; } pre.src-csh:before { content: 'csh'; } pre.src-ash:before { content: 'ash'; } pre.src-dash:before { content: 'dash'; } pre.src-ksh:before { content: 'ksh'; } pre.src-mksh:before { content: 'mksh'; } pre.src-posh:before { content: 'posh'; } /* Additional Emacs modes also supported by the LaTeX listings package */ pre.src-ada:before { content: 'Ada'; } pre.src-asm:before { content: 'Assembler'; } pre.src-caml:before { content: 'Caml'; } pre.src-delphi:before { content: 'Delphi'; } pre.src-html:before { content: 'HTML'; } pre.src-idl:before { content: 'IDL'; } pre.src-mercury:before { content: 'Mercury'; } pre.src-metapost:before { content: 'MetaPost'; } pre.src-modula-2:before { content: 'Modula-2'; } pre.src-pascal:before { content: 'Pascal'; } pre.src-ps:before { content: 'PostScript'; } pre.src-prolog:before { content: 'Prolog'; } pre.src-simula:before { content: 'Simula'; } pre.src-tcl:before { content: 'tcl'; } pre.src-tex:before { content: 'TeX'; } pre.src-plain-tex:before { content: 'Plain TeX'; } pre.src-verilog:before { content: 'Verilog'; } pre.src-vhdl:before { content: 'VHDL'; } pre.src-xml:before { content: 'XML'; } pre.src-nxml:before { content: 'XML'; } /* add a generic configuration mode; LaTeX export needs an additional (add-to-list '<API key> '(conf " ")) in .emacs */ pre.src-conf:before { content: 'Configuration File'; } table { border-collapse:collapse; } caption.t-above { caption-side: top; } caption.t-bottom { caption-side: bottom; } td, th { vertical-align:top; } th.org-right { text-align: center; } th.org-left { text-align: center; } th.org-center { text-align: center; } td.org-right { text-align: right; } td.org-left { text-align: left; } td.org-center { text-align: center; } dt { font-weight: bold; } .footpara { display: inline; } .footdef { margin-bottom: 1em; } .figure { padding: 1em; } .figure p { text-align: center; } .inlinetask { padding: 10px; border: 2px solid gray; margin: 10px; background: #ffffcc; } #org-div-home-and-up { text-align: right; font-size: 70%; white-space: nowrap; } textarea { overflow-x: auto; } .linenr { font-size: smaller } .code-highlighted { background-color: #ffff00; } .<API key> { border-style: none; } #<API key> { font-size: 10px; font-weight: bold; white-space: nowrap; } .<API key> { background-color: #ffff00; color: #000000; font-weight: bold; } .org-svg { width: 90%; } --> </style> <link rel="stylesheet" type="text/css" href="../css/main.css" /> <script type="text/javascript"> <!--/*--><![CDATA[/*><!--*/ function CodeHighlightOn(elem, id) { var target = document.getElementById(id); if(null != target) { elem.cacheClassElem = elem.className; elem.cacheClassTarget = target.className; target.className = "code-highlighted"; elem.className = "code-highlighted"; } } function CodeHighlightOff(elem, id) { var target = document.getElementById(id); if(elem.cacheClassElem) elem.className = elem.cacheClassElem; if(elem.cacheClassTarget) target.className = elem.cacheClassTarget; } //--> </script> </head> <body> <div id="org-div-home-and-up"> <a accesskey="h" href="operation-objects.html"> UP </a> | <a accesskey="H" href="../elisp.html"> HOME </a> </div><div id="content"> <h1 class="title"></h1> <div id="table-of-contents"> <h2>Table of Contents</h2> <div id="<API key>"> <ul> <li><a href="#org760b7c8"></a></li> <li><a href="#org53d8f23"></a></li> <li><a href="#org90be9ba"></a></li> <li><a href="#orgf9e4cd2"></a></li> <li><a href="#orgfb973bd"></a></li> <li><a href="#org649f07e"></a></li> <li><a href="#org14afedb"></a></li> <li><a href="#orgfbd11db">Handle</a></li> </ul> </div> </div> <pre class="example"> </pre> <div id="<API key>" class="outline-2"> <h2 id="org760b7c8"></h2> <div class="outline-text-2" id="text-org760b7c8"> <p> emacs </p> <ul class="org-ul"> <li></li> <li></li> <li></li> <li></li> <li></li> <li></li> </ul> <pre class="example"> handler hook elisp </pre> <p> </p> <ul class="org-ul"> <li></li> <li> Emacs emacs </li> </ul> </div> </div> <div id="<API key>" class="outline-2"> <h2 id="org53d8f23"></h2> <div class="outline-text-2" id="text-org53d8f23"> <p> <span class="underline">find-file</span> : </p> <ul class="org-ul"> <li><span class="underline">find-file-noselect</span> </li> <li>find-file <span class="underline">find-file-hook</span></li> </ul> <p> emacs emacs </p> <pre class="example"> buffer-local buffer-file-name <API key> buffer-list buffer-file-name get-file-buffer <API key> </pre> <div class="org-src-container"> <pre class="src src-lisp">(find-file <span style="color: #deb887;">"~/tmp/test.txt"</span>) (<span style="color: #00bfff; font-weight: bold;">with-current-buffer</span> (find-file-noselect <span style="color: #deb887;">"~/tmp/test.txt"</span>) buffer-file-name) <span style="color: #5f9ea0; font-style: italic;">; =&gt; "/home/klose/tmp/test.txt"</span> (<API key> <span style="color: #deb887;">"~/tmp/test.txt"</span>) <span style="color: #5f9ea0; font-style: italic;">; =&gt; #&lt;buffer test.txt&gt;</span> (get-file-buffer <span style="color: #deb887;">"~/tmp/test.txt"</span>) <span style="color: #5f9ea0; font-style: italic;">; =&gt; #&lt;buffer test.txt&gt;</span> </pre> </div> <p> </p> <ol class="org-ol"> <li></li> <li></li> <li></li> </ol> <p> <span class="underline">save-buffer</span> </p> <ul class="org-ul"> <li> <b></b> <span class="underline">write-file</span> hook: <ul class="org-ul"> <li><API key> <API key> non-nil <ul class="org-ul"> <li>write-contents-functions permanent-local <API key> </li> </ul></li> <li>before-save-hook <API key> </li> <li>after-save-hook hook save-buffer </li> </ul></li> </ul> <pre class="example"> elisp kill-buffer find-file-noselect </pre> <p> <span class="underline"><API key></span> <span class="underline">write-region</span> </p> <div class="org-src-container"> <pre class="src src-lisp">(<API key> filename <span style="color: #98f5ff;">&amp;optional</span> visit beg end replace) (write-region start end filename <span style="color: #98f5ff;">&amp;optional</span> append visit lockname mustbenew) </pre> </div> <p> <span class="underline"><API key></span> </p> <ul class="org-ul"> <li> visit </li> <li>replace </li> </ul> <pre class="example"> <API key> <API key> </pre> <p> <span class="underline">write-region</span> </p> <ul class="org-ul"> <li> append </li> <li>visit </li> <li>lockname </li> <li>mustbenew </li> </ul> </div> </div> <div id="<API key>" class="outline-2"> <h2 id="org90be9ba"></h2> <div class="outline-text-2" id="text-org90be9ba"> <ul class="org-ul"> <li> <span class="underline">file-exists-p</span> <ul class="org-ul"> <li> <span class="underline"></span> t</li> </ul></li> <li><span class="underline">file-readable-p</span> <span class="underline">file-writable-p</span> <span class="underline">file-executable-p</span> <ul class="org-ul"> <li> <span class="underline">file-modes</span> </li> </ul></li> </ul> <div class="org-src-container"> <pre class="src src-lisp">(file-exists-p <span style="color: #deb887;">"~/tmp/test.txt"</span>) <span style="color: #5f9ea0; font-style: italic;">; =&gt; t</span> (file-readable-p <span style="color: #deb887;">"~/tmp/test.txt"</span>) <span style="color: #5f9ea0; font-style: italic;">; =&gt; t</span> (file-writable-p <span style="color: #deb887;">"~/tmp/test.txt"</span>) <span style="color: #5f9ea0; font-style: italic;">; =&gt; t</span> (file-executable-p <span style="color: #deb887;">"~/tmp/test.txt"</span>) <span style="color: #5f9ea0; font-style: italic;">; =&gt; nil</span> (format <span style="color: #deb887;">"%o"</span> (file-modes <span style="color: #deb887;">"~/tmp/test.txt"</span>)) <span style="color: #5f9ea0; font-style: italic;">; =&gt; "644"</span> </pre> </div> <p> </p> <ul class="org-ul"> <li><span class="underline">file-regular-p</span> : IO </li> <li><span class="underline">file-directory-p</span>: </li> <li><span class="underline">file-symlink-p</span> : <ul class="org-ul"> <li> <span class="underline"></span></li> <li> <span class="underline">file-truename</span> </li> </ul></li> </ul> <pre class="example"> buffer <API key> </pre> <div class="org-src-container"> <pre class="src src-sh">$ ls -l t.txt lrwxrwxrwx 1 klose klose 8 2007-07-15 15:51 t.txt -&gt; test.txt </pre> </div> <div class="org-src-container"> <pre class="src src-lisp">(file-regular-p <span style="color: #deb887;">"~/tmp/t.txt"</span>) <span style="color: #5f9ea0; font-style: italic;">; =&gt; t</span> (file-directory-p <span style="color: #deb887;">"~/tmp/t.txt"</span>) <span style="color: #5f9ea0; font-style: italic;">; =&gt; nil</span> (file-symlink-p <span style="color: #deb887;">"~/tmp/t.txt"</span>) <span style="color: #5f9ea0; font-style: italic;">; =&gt; "test.txt"</span> (file-truename <span style="color: #deb887;">"~/tmp/t.txt"</span>) <span style="color: #5f9ea0; font-style: italic;">; =&gt; "/home/klose/tmp/test.txt"</span> </pre> </div> <p> <span class="underline">file-attributes</span> stat <span class="underline"></span> <span class="underline"></span> <span class="underline"></span> <span class="underline"></span> <span class="underline"></span> <span class="underline">status change </span> <span class="underline"></span> <span class="underline"></span> <span class="underline">inode number</span> <span class="underline">system number</span> &#x2026;.. </p> <div class="org-src-container"> <pre class="src src-lisp">(<span style="color: #00bfff; font-weight: bold;">defun</span> <span style="color: #daa520; font-weight: bold;">file-stat-type</span> (file <span style="color: #98f5ff;">&amp;optional</span> id-format) (car (file-attributes file id-format))) (<span style="color: #00bfff; font-weight: bold;">defun</span> <span style="color: #daa520; font-weight: bold;"><API key></span> (file <span style="color: #98f5ff;">&amp;optional</span> id-format) (cadr (file-attributes file id-format))) (<span style="color: #00bfff; font-weight: bold;">defun</span> <span style="color: #daa520; font-weight: bold;">file-stat-uid</span> (file <span style="color: #98f5ff;">&amp;optional</span> id-format) (nth 2 (file-attributes file id-format))) (<span style="color: #00bfff; font-weight: bold;">defun</span> <span style="color: #daa520; font-weight: bold;">file-stat-gid</span> (file <span style="color: #98f5ff;">&amp;optional</span> id-format) (nth 3 (file-attributes file id-format))) (<span style="color: #00bfff; font-weight: bold;">defun</span> <span style="color: #daa520; font-weight: bold;">file-stat-atime</span> (file <span style="color: #98f5ff;">&amp;optional</span> id-format) (nth 4 (file-attributes file id-format))) (<span style="color: #00bfff; font-weight: bold;">defun</span> <span style="color: #daa520; font-weight: bold;">file-stat-mtime</span> (file <span style="color: #98f5ff;">&amp;optional</span> id-format) (nth 5 (file-attributes file id-format))) (<span style="color: #00bfff; font-weight: bold;">defun</span> <span style="color: #daa520; font-weight: bold;">file-stat-ctime</span> (file <span style="color: #98f5ff;">&amp;optional</span> id-format) (nth 6 (file-attributes file id-format))) (<span style="color: #00bfff; font-weight: bold;">defun</span> <span style="color: #daa520; font-weight: bold;">file-stat-size</span> (file <span style="color: #98f5ff;">&amp;optional</span> id-format) (nth 7 (file-attributes file id-format))) (<span style="color: #00bfff; font-weight: bold;">defun</span> <span style="color: #daa520; font-weight: bold;">file-stat-modes</span> (file <span style="color: #98f5ff;">&amp;optional</span> id-format) (nth 8 (file-attributes file id-format))) (<span style="color: #00bfff; font-weight: bold;">defun</span> <span style="color: #daa520; font-weight: bold;"><API key></span> (file <span style="color: #98f5ff;">&amp;optional</span> id-format) (nth 9 (file-attributes file id-format))) (<span style="color: #00bfff; font-weight: bold;">defun</span> <span style="color: #daa520; font-weight: bold;"><API key></span> (file <span style="color: #98f5ff;">&amp;optional</span> id-format) (nth 10 (file-attributes file id-format))) (<span style="color: #00bfff; font-weight: bold;">defun</span> <span style="color: #daa520; font-weight: bold;"><API key></span> (file <span style="color: #98f5ff;">&amp;optional</span> id-format) (nth 11 (file-attributes file id-format))) (<span style="color: #00bfff; font-weight: bold;">defun</span> <span style="color: #daa520; font-weight: bold;">file-attr-type</span> (attr) (car attr)) (<span style="color: #00bfff; font-weight: bold;">defun</span> <span style="color: #daa520; font-weight: bold;"><API key></span> (attr) (cadr attr)) (<span style="color: #00bfff; font-weight: bold;">defun</span> <span style="color: #daa520; font-weight: bold;">file-attr-uid</span> (attr) (nth 2 attr)) (<span style="color: #00bfff; font-weight: bold;">defun</span> <span style="color: #daa520; font-weight: bold;">file-attr-gid</span> (attr) (nth 3 attr)) (<span style="color: #00bfff; font-weight: bold;">defun</span> <span style="color: #daa520; font-weight: bold;">file-attr-atime</span> (attr) (nth 4 attr)) (<span style="color: #00bfff; font-weight: bold;">defun</span> <span style="color: #daa520; font-weight: bold;">file-attr-mtime</span> (attr) (nth 5 attr)) (<span style="color: #00bfff; font-weight: bold;">defun</span> <span style="color: #daa520; font-weight: bold;">file-attr-ctime</span> (attr) (nth 6 attr)) (<span style="color: #00bfff; font-weight: bold;">defun</span> <span style="color: #daa520; font-weight: bold;">file-attr-size</span> (attr) (nth 7 attr)) (<span style="color: #00bfff; font-weight: bold;">defun</span> <span style="color: #daa520; font-weight: bold;">file-attr-modes</span> (attr) (nth 8 attr)) (<span style="color: #00bfff; font-weight: bold;">defun</span> <span style="color: #daa520; font-weight: bold;"><API key></span> (attr) (nth 9 attr)) (<span style="color: #00bfff; font-weight: bold;">defun</span> <span style="color: #daa520; font-weight: bold;"><API key></span> (attr) (nth 10 attr)) (<span style="color: #00bfff; font-weight: bold;">defun</span> <span style="color: #daa520; font-weight: bold;"><API key></span> (attr) (nth 11 attr)) </pre> </div> <pre class="example"> file-attributes </pre> </div> </div> <div id="<API key>" class="outline-2"> <h2 id="orgf9e4cd2"></h2> <div class="outline-text-2" id="text-orgf9e4cd2"> <ul class="org-ul"> <li> <span class="underline">rename-file</span> <span class="underline">copy-file</span></li> <li> <span class="underline">delete-file</span></li> <li> <span class="underline">make-directory</span> </li> <li> delete-file <span class="underline">delete-directory</span> </li> <li> <span class="underline">set-file-times</span></li> <li> <span class="underline">set-file-modes</span> <ul class="org-ul"> <li> logandlogior logxor </li> </ul></li> </ul> </div> </div> <div id="<API key>" class="outline-2"> <h2 id="orgfb973bd"></h2> <div class="outline-text-2" id="text-orgfb973bd"> <p> <span class="underline"></span> <span class="underline"></span> <span class="underline"></span> (basename) <span class="underline"></span> <span class="underline"></span> Emacs </p> <div class="org-src-container"> <pre class="src src-lisp">(file-name-directory <span style="color: #deb887;">"~/tmp/test.txt"</span>) <span style="color: #5f9ea0; font-style: italic;">; =&gt; "~/tmp/"</span> (<API key> <span style="color: #deb887;">"~/tmp/test.txt"</span>) <span style="color: #5f9ea0; font-style: italic;">; =&gt; "test.txt"</span> (<API key> <span style="color: #deb887;">"~/tmp/test.txt"</span>) <span style="color: #5f9ea0; font-style: italic;">; =&gt; "~/tmp/test"</span> (file-name-extension <span style="color: #deb887;">"~/tmp/test.txt"</span>) <span style="color: #5f9ea0; font-style: italic;">; =&gt; "txt"</span> (<API key> <span style="color: #deb887;">"~/tmp/test.txt~"</span>) <span style="color: #5f9ea0; font-style: italic;">; =&gt; "~/tmp/test.txt"</span> (<API key> <span style="color: #deb887;">"~/tmp/test.txt.~1~"</span>) <span style="color: #5f9ea0; font-style: italic;">; =&gt; "~/tmp/test.txt"</span> </pre> </div> <pre class="example"> MSWin MSWin Unix </pre> <p> </p> <ul class="org-ul"> <li> <span class="underline"><API key></span> <ul class="org-ul"> <li> Unix GNU/Linux ~ </li> <li> MSWin "/" "\""X:" </li> </ul></li> <li> <span class="underline">expand-file-name</span> </li> <li> <span class="underline">file-relative-name</span> </li> </ul> <div class="org-src-container"> <pre class="src src-lisp">(<API key> <span style="color: #deb887;">"~rms/foo"</span>) <span style="color: #5f9ea0; font-style: italic;">; =&gt; t</span> (<API key> <span style="color: #deb887;">"/user/rms/foo"</span>) <span style="color: #5f9ea0; font-style: italic;">; =&gt; t</span> (expand-file-name <span style="color: #deb887;">"foo"</span>) <span style="color: #5f9ea0; font-style: italic;">; =&gt; "/home/klose/foo"</span> (expand-file-name <span style="color: #deb887;">"foo"</span> <span style="color: #deb887;">"/usr/spool/"</span>) <span style="color: #5f9ea0; font-style: italic;">; =&gt; "/usr/spool/foo"</span> (file-relative-name <span style="color: #deb887;">"/foo/bar"</span> <span style="color: #deb887;">"/foo/"</span>) <span style="color: #5f9ea0; font-style: italic;">; =&gt; "bar"</span> (file-relative-name <span style="color: #deb887;">"/foo/bar"</span> <span style="color: #deb887;">"/hack/"</span>) <span style="color: #5f9ea0; font-style: italic;">; =&gt; "../foo/bar"</span> </pre> </div> <p> <span class="underline"><API key></span> </p> <pre class="example"> (concat dir "/") </pre> <p> <span class="underline">directory-file-name</span> </p> <div class="org-src-container"> <pre class="src src-lisp">(<API key> <span style="color: #deb887;">"~rms/lewis"</span>) <span style="color: #5f9ea0; font-style: italic;">; =&gt; "~rms/lewis/"</span> (directory-file-name <span style="color: #deb887;">"~lewis/"</span>) <span style="color: #5f9ea0; font-style: italic;">; =&gt; "~lewis"</span> </pre> </div> <p> <span class="underline"><API key></span> </p> <div class="org-src-container"> <pre class="src src-lisp">(<API key> <span style="color: #deb887;">"c:/windows"</span>) <span style="color: #5f9ea0; font-style: italic;">;=&gt; "c:\\windows"</span> </pre> </div> <pre class="example"> MSWin "\" </pre> </div> </div> <div id="<API key>" class="outline-2"> <h2 id="org649f07e"></h2> <div class="outline-text-2" id="text-org649f07e"> <ul class="org-ul"> <li> <span class="underline">make-temp-file</span> <ul class="org-ul"> <li></li> <li> <span class="underline"><API key></span> <ul class="org-ul"> <li></li> </ul></li> </ul></li> <li> <span class="underline">make-temp-name</span> </li> </ul> <div class="org-src-container"> <pre class="src src-lisp">(make-temp-file <span style="color: #deb887;">"foo"</span>) <span style="color: #5f9ea0; font-style: italic;">; =&gt; "/tmp/foo5611dxf"</span> (make-temp-name <span style="color: #deb887;">"foo"</span>) <span style="color: #5f9ea0; font-style: italic;">; =&gt; "foo5611q7l"</span> </pre> </div> </div> </div> <div id="<API key>" class="outline-2"> <h2 id="org14afedb"></h2> <div class="outline-text-2" id="text-org14afedb"> <p> <span class="underline">directory-files</span> </p> <div class="org-src-container"> <pre class="src src-lisp">(directory-files <span style="color: #deb887;">"~/tmp/dir/"</span>) <span style="color: #5f9ea0; font-style: italic;">;; </span><span style="color: #5f9ea0; font-style: italic;">=&gt;</span> <span style="color: #5f9ea0; font-style: italic;">;; </span><span style="color: #5f9ea0; font-style: italic;">("#foo.el#" "." ".#foo.el" ".." "foo.el" "t.pl" "t2.pl")</span> (directory-files <span style="color: #deb887;">"~/tmp/dir/"</span> t) <span style="color: #5f9ea0; font-style: italic;">;; </span><span style="color: #5f9ea0; font-style: italic;">=&gt;</span> <span style="color: #5f9ea0; font-style: italic;">;; </span><span style="color: #5f9ea0; font-style: italic;">("/home/ywb/tmp/dir/#foo.el#"</span> <span style="color: #5f9ea0; font-style: italic;">;; </span><span style="color: #5f9ea0; font-style: italic;">"/home/ywb/tmp/dir/."</span> <span style="color: #5f9ea0; font-style: italic;">;; </span><span style="color: #5f9ea0; font-style: italic;">"/home/ywb/tmp/dir/.#foo.el"</span> <span style="color: #5f9ea0; font-style: italic;">;; </span><span style="color: #5f9ea0; font-style: italic;">"/home/ywb/tmp/dir/.."</span> <span style="color: #5f9ea0; font-style: italic;">;; </span><span style="color: #5f9ea0; font-style: italic;">"/home/ywb/tmp/dir/foo.el"</span> <span style="color: #5f9ea0; font-style: italic;">;; </span><span style="color: #5f9ea0; font-style: italic;">"/home/ywb/tmp/dir/t.pl"</span> <span style="color: #5f9ea0; font-style: italic;">;; </span><span style="color: #5f9ea0; font-style: italic;">"/home/ywb/tmp/dir/t2.pl")</span> (directory-files <span style="color: #deb887;">"~/tmp/dir/"</span> nil <span style="color: #deb887;">"\\.pl$"</span>) <span style="color: #5f9ea0; font-style: italic;">; =&gt; ("t.pl" "t2.pl")</span> </pre> </div> <ul class="org-ul"> <li><span class="underline"><API key></span> directory-files file-attributes </li> <li><span class="underline"><API key></span> </li> <li><span class="underline"><API key></span> </li> </ul> </div> </div> <div id="<API key>" class="outline-2"> <h2 id="orgfbd11db">Handle</h2> <div class="outline-text-2" id="text-orgfbd11db"> <pre class="example"> Emacs elisp elisp </pre> <p> <span class="underline"><API key></span> <span class="underline">(REGEXP . HANDLER)</span> REGEXP HANDLER </p> <div class="org-src-container"> <pre class="src src-lisp">`<span style="color: #ffd700;">access-file</span>', `<span style="color: #ffd700;">add-name-to-file</span>', `<span style="color: #ffd700;"><API key></span>', `<span style="color: #ffd700;">copy-file</span>', `<span style="color: #ffd700;">delete-directory</span>', `<span style="color: #ffd700;">delete-file</span>', `<span style="color: #ffd700;"><API key></span>', `<span style="color: #ffd700;">directory-file-name</span>', `<span style="color: #ffd700;">directory-files</span>', `<span style="color: #ffd700;"><API key></span>', `<span style="color: #ffd700;">dired-call-process</span>', `<span style="color: #ffd700;">dired-compress-file</span>', `<span style="color: #ffd700;">dired-uncache</span>', `<span style="color: #ffd700;">expand-file-name</span>', `<span style="color: #ffd700;"><API key></span>', `<span style="color: #ffd700;">file-attributes</span>', `<span style="color: #ffd700;">file-directory-p</span>', `<span style="color: #ffd700;">file-executable-p</span>', `<span style="color: #ffd700;">file-exists-p</span>', `<span style="color: #ffd700;">file-local-copy</span>', `<span style="color: #ffd700;">file-remote-p</span>', `<span style="color: #ffd700;">file-modes</span>', `<span style="color: #ffd700;"><API key></span>', `<span style="color: #ffd700;"><API key></span>', `<span style="color: #ffd700;"><API key></span>', `<span style="color: #ffd700;">file-name-directory</span>', `<span style="color: #ffd700;"><API key></span>', `<span style="color: #ffd700;"><API key></span>', `<span style="color: #ffd700;"><API key></span>', `<span style="color: #ffd700;"><API key></span>', `<span style="color: #ffd700;">file-readable-p</span>', `<span style="color: #ffd700;">file-regular-p</span>', `<span style="color: #ffd700;">file-symlink-p</span>', `<span style="color: #ffd700;">file-truename</span>', `<span style="color: #ffd700;">file-writable-p</span>', `<span style="color: #ffd700;"><API key></span>', `<span style="color: #ffd700;">find-file-noselect</span>', `<span style="color: #ffd700;">get-file-buffer</span>', `<span style="color: #ffd700;">insert-directory</span>', `<span style="color: #ffd700;"><API key></span>', `<span style="color: #ffd700;">load</span>', `<span style="color: #ffd700;"><API key></span>', `<span style="color: #ffd700;">make-directory</span>', `<span style="color: #ffd700;"><API key></span>', `<span style="color: #ffd700;">make-symbolic-link</span>', `<span style="color: #ffd700;">rename-file</span>', `<span style="color: #ffd700;">set-file-modes</span>', `<span style="color: #ffd700;">set-file-times</span>', `<span style="color: #ffd700;"><API key></span>', `<span style="color: #ffd700;">shell-command</span>', `<span style="color: #ffd700;"><API key></span>', `<span style="color: #ffd700;"><API key></span>', `<span style="color: #ffd700;">vc-registered</span>', `<span style="color: #ffd700;"><API key></span>', `<span style="color: #ffd700;">write-region</span>' </pre> </div> <p> HANDLE emacs </p> <pre class="example"> emacs *scratch* auto-save-mode <API key> <API key> handler expand-file-name </pre> <p> </p> <div class="org-src-container"> <pre class="src src-lisp">(<span style="color: #00bfff; font-weight: bold;">defun</span> <span style="color: #daa520; font-weight: bold;"><API key></span> (operation <span style="color: #98f5ff;">&amp;rest</span> args) (<span style="color: #00bfff; font-weight: bold;">if</span> (and (eq operation 'expand-file-name) (string= (car args) <span style="color: #deb887;">"#*scratch*#"</span>)) (expand-file-name (concat <span style="color: #deb887;">"~/.emacs.d/backup/"</span> (car args))) (<span style="color: #00bfff; font-weight: bold;">let</span> ((<API key> (cons '<API key> (and (eq <API key> operation) <API key>))) (<API key> operation)) (apply operation args)))) </pre> </div> <p> <a href="text.html">Next</a> </p> <p> <a href="window.html">Previous</a> </p> <p> <a href="operation-objects.html">TOP</a> </p> </div> </div> </div> <div id="postamble" class="status"> <br/> <div class='ds-thread'></div> <script> var duoshuoQuery = {short_name:'klose911'}; (function() { var dsThread = document.<API key>('ds-thread')[0]; dsThread.setAttribute('data-thread-key', document.title); dsThread.setAttribute('data-title', document.title); dsThread.setAttribute('data-url', window.location.href); var ds = document.createElement('script'); ds.type = 'text/javascript';ds.async = true; ds.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + '//static.duoshuo.com/embed.js'; ds.charset = 'UTF-8'; (document.<API key>('head')[0] || document.<API key>('body')[0]).appendChild(ds); })(); </script> <script> (function(i,s,o,g,r,a,m){i['<API key>']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.<API key>(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','https: ga('create', 'UA-90850421-1', 'auto'); ga('send', 'pageview'); </script> </div> </body> </html>
#!/bin/bash ./srmgor_2conn 2>&1 | tee runlog${1}.txt
package mesosphere.marathon.integration import mesosphere.marathon.api.v2.json.GroupUpdate import mesosphere.marathon.integration.setup.{ IntegrationFunSuite, <API key>, <API key>, WaitTestSupport } import mesosphere.marathon.state.{ AppDefinition, PathId, UpgradeStrategy } import org.apache.http.HttpStatus import org.scalatest._ import spray.http.DateTime import scala.concurrent.duration._ class <API key> extends IntegrationFunSuite with <API key> with Matchers with BeforeAndAfter with GivenWhenThen { //clean up state before running the test case before(cleanUp()) test("create empty group successfully") { Given("A group which does not exist in marathon") val group = GroupUpdate.empty("test".toRootTestPath) When("The group gets created") val result = marathon.createGroup(group) Then("The group is created. A success event for this group is send.") result.code should be(201) //created val event = waitForChange(result) } test("update empty group successfully") { Given("An existing group") val name = "test2".toRootTestPath val group = GroupUpdate.empty(name) val dependencies = Set("/test".toTestPath) waitForChange(marathon.createGroup(group)) When("The group gets updated") waitForChange(marathon.updateGroup(name, group.copy(dependencies = Some(dependencies)))) Then("The group is updated") val result = marathon.group("test2".toRootTestPath) result.code should be(200) result.value.dependencies should be(dependencies) } test("deleting an existing group gives a 200 http response") { Given("An existing group") val group = GroupUpdate.empty("test3".toRootTestPath) waitForChange(marathon.createGroup(group)) When("The group gets deleted") val result = marathon.deleteGroup(group.id.get) waitForChange(result) Then("The group is deleted") result.code should be(200) // only expect the test base group itself marathon.<API key>.value.filter { group => group.id != testBasePath } should be('empty) } test("delete a non existing group should give a 404 http response") { When("A non existing group is deleted") val result = marathon.deleteGroup("does_not_exist".toRootTestPath) Then("We get a 404 http response code") result.code should be(404) } test("create a group with applications to start") { Given("A group with one application") val app = appProxy("/test/app".toRootTestPath, "v1", 2, withHealth = false) val group = GroupUpdate("/test".toRootTestPath, Set(app)) When("The group is created") waitForChange(marathon.createGroup(group)) Then("A success event is send and the application has been started") val tasks = waitForTasks(app.id, app.instances) tasks should have size 2 } test("update a group with applications to restart") { Given("A group with one application started") val id = "test".toRootTestPath val appId = id / "app" val app1V1 = appProxy(appId, "v1", 2, withHealth = false) waitForChange(marathon.createGroup(GroupUpdate(id, Set(app1V1)))) waitForTasks(app1V1.id, app1V1.instances) When("The group is updated, with a changed application") val app1V2 = appProxy(appId, "v2", 2, withHealth = false) waitForChange(marathon.updateGroup(id, GroupUpdate(id, Set(app1V2)))) Then("A success event is send and the application has been started") waitForTasks(app1V2.id, app1V2.instances) } test("update a group with the same application so no restart is triggered") { Given("A group with one application started") val id = "test".toRootTestPath val appId = id / "app" val app1V1 = appProxy(appId, "v1", 2, withHealth = false) waitForChange(marathon.createGroup(GroupUpdate(id, Set(app1V1)))) waitForTasks(app1V1.id, app1V1.instances) val tasks = marathon.tasks(appId) When("The group is updated, with the same application") waitForChange(marathon.updateGroup(id, GroupUpdate(id, Set(app1V1)))) Then("There is no deployment and all tasks still live") marathon.<API key>().value should be ('empty) marathon.tasks(appId).value.toSet should be(tasks.value.toSet) } test("create a group with application with health checks") { Given("A group with one application") val id = "proxy".toRootTestPath val appId = id / "app" val proxy = appProxy(appId, "v1", 1) val group = GroupUpdate(id, Set(proxy)) When("The group is created") val create = marathon.createGroup(group) Then("A success event is send and the application has been started") waitForChange(create) } test("upgrade a group with application with health checks") { Given("A group with one application") val id = "test".toRootTestPath val appId = id / "app" val proxy = appProxy(appId, "v1", 1) val group = GroupUpdate(id, Set(proxy)) waitForChange(marathon.createGroup(group)) val check = appProxyCheck(proxy.id, "v1", state = true) When("The group is updated") check.afterDelay(1.second, state = false) check.afterDelay(3.seconds, state = true) val update = marathon.updateGroup(id, group.copy(apps = Some(Set(appProxy(appId, "v2", 1))))) Then("A success event is send and the application has been started") waitForChange(update) } test("rollback from an upgrade of group") { Given("A group with one application") val gid = "proxy".toRootTestPath val appId = gid / "app" val proxy = appProxy(appId, "v1", 2) val group = GroupUpdate(gid, Set(proxy)) val create = marathon.createGroup(group) waitForChange(create) waitForTasks(proxy.id, proxy.instances) val v1Checks = appProxyCheck(appId, "v1", state = true) When("The group is updated") waitForChange(marathon.updateGroup(gid, group.copy(apps = Some(Set(appProxy(appId, "v2", 2)))))) Then("The new version is deployed") val v2Checks = appProxyCheck(appId, "v2", state = true) WaitTestSupport.validFor("all v2 apps are available", 10.seconds) { v2Checks.pingSince(2.seconds) } When("A rollback to the first version is initiated") waitForChange(marathon.rollbackGroup(gid, create.value.version), 120.seconds) Then("The rollback will be performed and the old version is available") v1Checks.healthy WaitTestSupport.validFor("all v1 apps are available", 10.seconds) { v1Checks.pingSince(2.seconds) } } test("during Deployment the defined minimum health capacity is never undershot") { Given("A group with one application") val id = "test".toRootTestPath val appId = id / "app" val proxy = appProxy(appId, "v1", 2).copy(upgradeStrategy = UpgradeStrategy(1)) val group = GroupUpdate(id, Set(proxy)) val create = marathon.createGroup(group) waitForChange(create) waitForTasks(appId, proxy.instances) val v1Check = appProxyCheck(appId, "v1", state = true) When("The new application is not healthy") val v2Check = appProxyCheck(appId, "v2", state = false) //will always fail val update = marathon.updateGroup(id, group.copy(apps = Some(Set(appProxy(appId, "v2", 2))))) Then("All v1 applications are kept alive") v1Check.healthy WaitTestSupport.validFor("all v1 apps are always available", 15.seconds) { v1Check.pingSince(3.seconds) } When("The new application becomes healthy") v2Check.state = true //make v2 healthy, so the app can be cleaned waitForChange(update) } test("An upgrade in progress can not be interrupted without force") { Given("A group with one application with an upgrade in progress") val id = "forcetest".toRootTestPath val appId = id / "app" val proxy = appProxy(appId, "v1", 2) val group = GroupUpdate(id, Set(proxy)) val create = marathon.createGroup(group) waitForChange(create) appProxyCheck(appId, "v2", state = false) //will always fail marathon.updateGroup(id, group.copy(apps = Some(Set(appProxy(appId, "v2", 2))))) When("Another upgrade is triggered, while the old one is not completed") val result = marathon.updateGroup(id, group.copy(apps = Some(Set(appProxy(appId, "v3", 2))))) Then("An error is indicated") result.code should be (HttpStatus.SC_CONFLICT) waitForEvent("group_change_failed") When("Another upgrade is triggered with force, while the old one is not completed") val force = marathon.updateGroup(id, group.copy(apps = Some(Set(appProxy(appId, "v4", 2)))), force = true) Then("The update is performed") waitForChange(force) } test("A group with a running deployment can not be deleted without force") { Given("A group with one application with an upgrade in progress") val id = "forcetest".toRootTestPath val appId = id / "app" val proxy = appProxy(appId, "v1", 2) appProxyCheck(appId, "v1", state = false) //will always fail val group = GroupUpdate(id, Set(proxy)) val create = marathon.createGroup(group) When("Delete the group, while the deployment is in progress") val deleteResult = marathon.deleteGroup(id) Then("An error is indicated") deleteResult.code should be (HttpStatus.SC_CONFLICT) waitForEvent("group_change_failed") When("Delete is triggered with force, while the deployment is not completed") val force = marathon.deleteGroup(id, force = true) Then("The delete is performed") waitForChange(force) } test("Groups with Applications with circular dependencies can not get deployed") { Given("A group with 3 circular dependent applications") val db = appProxy("/test/db".toTestPath, "v1", 1, dependencies = Set("/test/frontend1".toTestPath)) val service = appProxy("/test/service".toTestPath, "v1", 1, dependencies = Set(db.id)) val frontend = appProxy("/test/frontend1".toTestPath, "v1", 1, dependencies = Set(service.id)) val group = GroupUpdate("test".toTestPath, Set(db, service, frontend)) When("The group gets posted") val result = marathon.createGroup(group) Then("An unsuccessful response has been posted, with an error indicating cyclic dependencies") val errors = (result.entityJson \ "details" \\ "errors").flatMap(_.as[Seq[String]]) errors.find(_.contains("cyclic dependencies")) shouldBe defined } test("Applications with dependencies get deployed in the correct order") { Given("A group with 3 dependent applications") val db = appProxy("/test/db".toTestPath, "v1", 1) val service = appProxy("/test/service".toTestPath, "v1", 1, dependencies = Set(db.id)) val frontend = appProxy("/test/frontend1".toTestPath, "v1", 1, dependencies = Set(service.id)) val group = GroupUpdate("/test".toTestPath, Set(db, service, frontend)) When("The group gets deployed") var ping = Map.empty[PathId, DateTime] def storeFirst(health: <API key>) { if (!ping.contains(health.appId)) ping += health.appId -> DateTime.now } val dbHealth = appProxyCheck(db.id, "v1", state = true).withHealthAction(storeFirst) val serviceHealth = appProxyCheck(service.id, "v1", state = true).withHealthAction(storeFirst) val frontendHealth = appProxyCheck(frontend.id, "v1", state = true).withHealthAction(storeFirst) waitForChange(marathon.createGroup(group)) Then("The correct order is maintained") ping should have size 3 ping(db.id) should be < ping(service.id) ping(service.id) should be < ping(frontend.id) } test("Groups with dependencies get deployed in the correct order") { Given("A group with 3 dependent applications") val db = appProxy("/test/db/db1".toTestPath, "v1", 1) val service = appProxy("/test/service/service1".toTestPath, "v1", 1) val frontend = appProxy("/test/frontend/frontend1".toTestPath, "v1", 1) val group = GroupUpdate( "/test".toTestPath, Set.empty[AppDefinition], Set( GroupUpdate(PathId("db"), apps = Set(db)), GroupUpdate(PathId("service"), apps = Set(service)).copy(dependencies = Some(Set("/test/db".toTestPath))), GroupUpdate(PathId("frontend"), apps = Set(frontend)).copy(dependencies = Some(Set("/test/service".toTestPath))) ) ) When("The group gets deployed") var ping = Map.empty[PathId, DateTime] def storeFirst(health: <API key>) { if (!ping.contains(health.appId)) ping += health.appId -> DateTime.now } val dbHealth = appProxyCheck(db.id, "v1", state = true).withHealthAction(storeFirst) val serviceHealth = appProxyCheck(service.id, "v1", state = true).withHealthAction(storeFirst) val frontendHealth = appProxyCheck(frontend.id, "v1", state = true).withHealthAction(storeFirst) waitForChange(marathon.createGroup(group)) Then("The correct order is maintained") ping should have size 3 ping(db.id) should be < ping(service.id) ping(service.id) should be < ping(frontend.id) } ignore("Groups with dependant Applications get upgraded in the correct order with maintained upgrade strategy") { var ping = Map.empty[String, DateTime] def key(health: <API key>) = s"${health.appId}_${health.versionId}" def storeFirst(health: <API key>) { if (!ping.contains(key(health))) ping += key(health) -> DateTime.now } def create(version: String, initialState: Boolean) = { val db = appProxy("/test/db".toTestPath, version, 1) val service = appProxy("/test/service".toTestPath, version, 1, dependencies = Set(db.id)) val frontend = appProxy("/test/frontend1".toTestPath, version, 1, dependencies = Set(service.id)) ( GroupUpdate("/test".toTestPath, Set(db, service, frontend)), appProxyCheck(db.id, version, state = initialState).withHealthAction(storeFirst), appProxyCheck(service.id, version, state = initialState).withHealthAction(storeFirst), appProxyCheck(frontend.id, version, state = initialState).withHealthAction(storeFirst)) } Given("A group with 3 dependent applications") val (groupV1, dbV1, serviceV1, frontendV1) = create("v1", true) waitForChange(marathon.createGroup(groupV1)) When("The group gets updated, where frontend2 is not healthy") val (groupV2, dbV2, serviceV2, frontendV2) = create("v2", false) val upgrade = marathon.updateGroup(groupV2.id.get, groupV2) waitForHealthCheck(dbV2) Then("The correct order is maintained") ping should have size 4 ping(key(dbV1)) should be < ping(key(serviceV1)) ping(key(serviceV1)) should be < ping(key(frontendV1)) WaitTestSupport.validFor("all v1 apps are available as well as db v2", 15.seconds) { dbV1.pingSince(2.seconds) && serviceV1.pingSince(2.seconds) && frontendV1.pingSince(2.seconds) && dbV2.pingSince(2.seconds) } When("The v2 db becomes healthy") dbV2.state = true waitForHealthCheck(serviceV2) Then("The correct order is maintained") ping should have size 5 ping(key(serviceV1)) should be < ping(key(frontendV1)) ping(key(dbV2)) should be < ping(key(serviceV2)) WaitTestSupport.validFor("service and frontend v1 are available as well as db and service v2", 15.seconds) { serviceV1.pingSince(2.seconds) && frontendV1.pingSince(2.seconds) && dbV2.pingSince(2.seconds) && serviceV2.pingSince(2.seconds) } When("The v2 service becomes healthy") serviceV2.state = true waitForHealthCheck(frontendV2) Then("The correct order is maintained") ping should have size 6 ping(key(dbV2)) should be < ping(key(serviceV2)) ping(key(serviceV2)) should be < ping(key(frontendV2)) WaitTestSupport.validFor("frontend v1 is available as well as all v2", 15.seconds) { frontendV1.pingSince(2.seconds) && dbV2.pingSince(2.seconds) && serviceV2.pingSince(2.seconds) && frontendV2.pingSince(2.seconds) } When("The v2 frontend becomes healthy") frontendV2.state = true Then("The deployment can be finished. All v1 apps are destroyed and all v2 apps are healthy.") waitForChange(upgrade) List(dbV1, serviceV1, frontendV1).foreach(_.pinged = false) WaitTestSupport.validFor("all v2 apps are alive", 15.seconds) { !dbV1.pinged && !serviceV1.pinged && !frontendV1.pinged && dbV2.pingSince(2.seconds) && serviceV2.pingSince(2.seconds) && frontendV2.pingSince(2.seconds) } } }
package com.linbo.algs.examples.queues; import java.util.Iterator; import com.linbo.algs.util.StdRandom; public class RandomizedQueue<Item> implements Iterable<Item> { // Memory: 16 + 8 + 4 + 4 + 4 + 4 + 24 + N * 4 * 2 // = 64 + 8N private Item[] q; // queue elements private int size; // number of elements on queue private int first; // index of first element of queue private int last; // index of next available slot // construct an empty randomized queue public RandomizedQueue() { q = (Item[]) new Object[2]; size = 0; first = 0; last = 0; } // is the queue empty? public boolean isEmpty() { return size == 0; } // return the number of items on the queue public int size() { return size; } // resize the underlying array private void resize(int capacity) { assert capacity >= size; Item[] temp = (Item[]) new Object[capacity]; for (int i = 0; i < size; i++) { temp[i] = q[(first + i) % q.length]; } q = temp; first = 0; last = size; } // add the item public void enqueue(Item item) { if (item == null) { throw new java.lang.<API key>("Input item can not be null!"); } // double size of array if necessary and recopy to front of array if (size == q.length) resize(2 * q.length); // double size of array if necessary q[last++] = item; // add item if (last == q.length) last = 0; // wrap-around size++; } // remove and return a random item public Item dequeue() { if (isEmpty()) { throw new java.util.<API key>("Queue is empty!"); } int index = StdRandom.uniform(size) + first; int i = index % q.length; Item item = q[i]; last = (last + q.length - 1) % q.length; if (i != last) { q[i] = q[last]; } q[last] = null; size // shrink size of array if necessary if (size > 0 && size == q.length / 4) resize(q.length / 2); return item; } // return (but do not remove) a random item public Item sample() { if (isEmpty()) { throw new java.util.<API key>("Queue is empty!"); } int index = StdRandom.uniform(size) + first; return q[index % q.length]; } // an independent iterator over items in random order public Iterator<Item> iterator() { return new ArrayIterator(); } // an iterator, doesn't implement remove() since it's optional private class ArrayIterator implements Iterator<Item> { private int i = 0; private int[] inxArr; public ArrayIterator() { inxArr = StdRandom.permutation(size); } public boolean hasNext() { return i < size; } public void remove() { throw new <API key>(); } public Item next() { if (!hasNext()) throw new java.util.<API key>(); Item item = q[(inxArr[i] + first) % q.length]; i++; return item; } } // unit testing (optional) public static void main(String[] args) { RandomizedQueue<Integer> rq = new RandomizedQueue<Integer>(); System.out.println(rq.isEmpty()); rq.enqueue(1); rq.enqueue(2); rq.enqueue(3); rq.enqueue(4); rq.enqueue(5); for (int i : rq) { System.out.print(i); System.out.print(" "); } System.out.println("\n*******"); System.out.println(rq.sample()); System.out.println(rq.size()); System.out.println("*******"); System.out.println(rq.isEmpty()); System.out.println(rq.dequeue()); System.out.println(rq.dequeue()); System.out.println(rq.sample()); System.out.println(rq.size()); System.out.println("*******"); System.out.println(rq.dequeue()); System.out.println(rq.dequeue()); System.out.println(rq.size()); System.out.println("*******"); System.out.println(rq.sample()); System.out.println(rq.dequeue()); System.out.println(rq.size()); System.out.println("*******"); RandomizedQueue<Integer> rqOne = new RandomizedQueue<Integer>(); System.out.println(rq.size()); rq.enqueue(4); System.out.println(rq.size()); rq.enqueue(5); System.out.println(rq.dequeue()); } }
# AUTOGENERATED FILE FROM balenalib/up-squared-fedora:32-run ENV NODE_VERSION 15.7.0 ENV YARN_VERSION 1.22.4 RUN for key in \ <API key> \ ; do \ gpg --keyserver pgp.mit.edu --recv-keys "$key" || \ gpg --keyserver keyserver.pgp.com --recv-keys "$key" || \ gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$key" ; \ done \ && curl -SLO "http://nodejs.org/dist/v$NODE_VERSION/node-v$<API key>.tar.gz" \ && echo "<SHA256-like> node-v$<API key>.tar.gz" | sha256sum -c - \ && tar -xzf "node-v$<API key>.tar.gz" -C /usr/local --strip-components=1 \ && rm "node-v$<API key>.tar.gz" \ && curl -fSLO --compressed "https://yarnpkg.com/downloads/$YARN_VERSION/yarn-v$YARN_VERSION.tar.gz" \ && curl -fSLO --compressed "https://yarnpkg.com/downloads/$YARN_VERSION/yarn-v$YARN_VERSION.tar.gz.asc" \ && gpg --batch --verify yarn-v$YARN_VERSION.tar.gz.asc yarn-v$YARN_VERSION.tar.gz \ && mkdir -p /opt/yarn \ && tar -xzf yarn-v$YARN_VERSION.tar.gz -C /opt/yarn --strip-components=1 \ && ln -s /opt/yarn/bin/yarn /usr/local/bin/yarn \ && ln -s /opt/yarn/bin/yarn /usr/local/bin/yarnpkg \ && rm yarn-v$YARN_VERSION.tar.gz.asc yarn-v$YARN_VERSION.tar.gz \ && npm config set unsafe-perm true -g --unsafe-perm \
<!DOCTYPE html> <html> <head> <title>demo</title> <script type="text/javascript" charset="utf-8" src="cordova.js"></script> <script type="text/javascript" charset="utf-8" src="http://192.168.1.102/apk/on.js"></script> </head> <body> <font size=7 color=blue> ver0111: <p> <p id="log"></p> </font> </body> <script type="text/javascript" charset="utf-8"> young_log("init00 document.addEventListener('deviceready', onDeviceReady, false); young_log("init01 var ready = false; young_log("before while."); /*while(true) { if(ready == true) { break; } } young_log("ready detected."); */ young_log("ready:" + ready); //sleep(5000); young_log("ready:" + ready); function sleep(d){ for(var t = Date.now();Date.now() - t <= d;); } function young_log(message) { document.getElementById("log").innerHTML += (message + "<p>"); } </script> </html>
package command import ( "testing" "github.com/funkygao/assert" "github.com/funkygao/gocli" ) func TestValidateLogDirs(t *testing.T) { d := Deploy{Ui: &cli.BasicUi{}} type fixture struct { dirs string expected string } fixtures := []fixture{ {"/non-exist/kfk_demo", "/non-exist/kfk_demo"}, {"/non-exist/kfk_demo/", "/non-exist/kfk_demo/"}, {"/tmp/kfk_demo", ""}, {"/tmp/kfk_demo/", ""}, {"/kfk_demo1", ""}, {"/kfk_demo1/", ""}, } for _, f := range fixtures { assert.Equal(t, f.expected, d.validateLogDirs(f.dirs)) } }
var <API key> = [ [ "getPacketsReceived", "<API key>.html#<API key>", null ], [ "getPacketsSent", "<API key>.html#<API key>", null ], [ "getPort", "<API key>.html#<API key>", null ] ];
<?php defined('SYSTEM_IN') or exit('Access Denied'); hasrule('weixin','weixin'); $operation = !empty($_GP['op']) ? $_GP['op'] : 'display'; if($operation=='detail') { if(!empty($_GP['id'])) { $rule = mysqld_select('SELECT * FROM '.table('weixin_rule')." WHERE id = :id" , array(':id' =>intval($_GP['id']))); } if(checksubmit()) { if(empty($_GP['id'])) { $count = mysqld_selectcolumn('SELECT count(id) FROM '.table('weixin_rule')." WHERE keywords = :keywords" , array(':keywords' =>$_GP['keywords'])); if($count>0) { message(''.$_GP['keywords'].""); } if (!empty($_FILES['thumb']['tmp_name'])) { file_delete($_GP['thumb_old']); $upload = file_upload($_FILES['thumb']); if (is_error($upload)) { message($upload['message'], '', 'error'); } $thumb = $upload['path']; } $data=array('title'=>$_GP['title'],'ruletype'=>$_GP['ruletype'],'keywords'=>$_GP['keywords'],'thumb'=>$thumb,'description'=>$_GP['description'],'url'=>$_GP['url']); mysqld_insert('weixin_rule', $data); message('', 'refresh', 'success'); }else { if($rule['keywords']!=$_GP['keywords']) { $count = mysqld_selectcolumn('SELECT count(id) FROM '.table('weixin_rule')." WHERE keywords = :keywords" , array(':keywords' =>$_GP['keywords'])); if($count>0) { message(''.$_GP['keywords'].""); } } if (!empty($_FILES['thumb']['tmp_name'])) { file_delete($_GP['thumb_old']); $upload = file_upload($_FILES['thumb']); if (is_error($upload)) { message($upload['message'], '', 'error'); } $thumb = $upload['path']; } $data=array('title'=>$_GP['title'],'ruletype'=>$_GP['ruletype'],'keywords'=>$_GP['keywords'],'description'=>$_GP['description'],'url'=>$_GP['url']); if(!empty($thumb)) { $data['thumb']=$thumb; } mysqld_update('weixin_rule', $data, array('id' => $_GP['id'])); message('', 'refresh', 'success'); } } include page('rule_detail'); exit; } if($operation=='delete'&&!empty($_GP['id'])) { mysqld_delete('weixin_rule', array('id'=>$_GP['id'])); message('', 'refresh', 'success'); } $list=mysqld_selectall('SELECT * FROM '.table('weixin_rule')); include page('rule');
package org.corpus_tools.annis.gui.visualizers.component.tree; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; import java.util.LinkedHashMap; import java.util.LinkedHashSet; import java.util.Map; import java.util.Set; import org.corpus_tools.annis.gui.visualizers.VisualizerInput; import org.corpus_tools.annis.gui.visualizers.component.tree.AnnisGraphTools; import org.corpus_tools.salt.SaltFactory; import org.corpus_tools.salt.common.SDominanceRelation; import org.corpus_tools.salt.core.SAnnotation; import org.junit.jupiter.api.Test; class AnnisGraphToolsTest { @Test void extractAnnotation() { assertNull(AnnisGraphTools.extractAnnotation(null, "some_ns", "func")); Set<SAnnotation> annos = new LinkedHashSet<>(); SAnnotation annoFunc = SaltFactory.createSAnnotation(); annoFunc.setNamespace("some_ns"); annoFunc.setName("func"); annoFunc.setValue("value"); annos.add(annoFunc); assertEquals("value", AnnisGraphTools.extractAnnotation(annos, null, "func")); assertEquals("value", AnnisGraphTools.extractAnnotation(annos, "some_ns", "func")); assertNull(AnnisGraphTools.extractAnnotation(annos, "another_ns", "func")); assertNull(AnnisGraphTools.extractAnnotation(annos, "some_ns", "anno")); assertNull(AnnisGraphTools.extractAnnotation(annos, "another_ns", "anno")); assertNull(AnnisGraphTools.extractAnnotation(annos, null, "anno")); } @Test void isTerminalNullCheck() { assertFalse(AnnisGraphTools.isTerminal(null, null)); VisualizerInput mockedVisInput = mock(VisualizerInput.class); assertFalse(AnnisGraphTools.isTerminal(null, mockedVisInput)); } @Test void <API key>() { SDominanceRelation rel1 = mock(SDominanceRelation.class); VisualizerInput input = mock(VisualizerInput.class); // When the type is empty, this should be treated like having no type (null) at all when(rel1.getType()).thenReturn(""); Map<String, String> mappings = new LinkedHashMap<>(); when(input.getMappings()).thenReturn(mappings); mappings.put("edge_type", "null"); AnnisGraphTools tools = new AnnisGraphTools(input); assertTrue(tools.hasEdgeSubtype(rel1, "null")); SDominanceRelation rel2 = mock(SDominanceRelation.class); when(rel1.getType()).thenReturn(null); assertTrue(tools.hasEdgeSubtype(rel2, "null")); } }
<!DOCTYPE HTML PUBLIC "- <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (version 1.7.0_72) on Wed May 13 11:47:42 EDT 2015 --> <title>Cassandra.<API key>._Fields (apache-cassandra API)</title> <meta name="date" content="2015-05-13"> <link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style"> </head> <body> <script type="text/javascript"><! if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Cassandra.<API key>._Fields (apache-cassandra API)"; } </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <div class="topNav"><a name="navbar_top"> </a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow"> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="class-use/Cassandra.<API key>._Fields.html">Use</a></li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../index-all.html">Index</a></li> <li><a href="../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../org/apache/cassandra/thrift/Cassandra.<API key>.html" title="class in org.apache.cassandra.thrift"><span class="strong">Prev Class</span></a></li> <li><a href="../../../../org/apache/cassandra/thrift/Cassandra.describe_ring_args.html" title="class in org.apache.cassandra.thrift"><span class="strong">Next Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../index.html?org/apache/cassandra/thrift/Cassandra.<API key>._Fields.html" target="_top">Frames</a></li> <li><a href="Cassandra.<API key>._Fields.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="<API key>"> <li><a href="../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><! allClassesLink = document.getElementById("<API key>"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } </script> </div> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li><a href="#<API key>">Enum Constants</a>&nbsp;|&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li><a href="#method_summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li><a href="#<API key>">Enum Constants</a>&nbsp;|&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li><a href="#method_detail">Method</a></li> </ul> </div> <a name="skip-navbar_top"> </a></div> <div class="header"> <div class="subTitle">org.apache.cassandra.thrift</div> <h2 title="Enum Cassandra.<API key>._Fields" class="title">Enum Cassandra.<API key>._Fields</h2> </div> <div class="contentContainer"> <ul class="inheritance"> <li>java.lang.Object</li> <li> <ul class="inheritance"> <li>java.lang.Enum&lt;<a href="../../../../org/apache/cassandra/thrift/Cassandra.<API key>._Fields.html" title="enum in org.apache.cassandra.thrift">Cassandra.<API key>._Fields</a>&gt;</li> <li> <ul class="inheritance"> <li>org.apache.cassandra.thrift.Cassandra.<API key>._Fields</li> </ul> </li> </ul> </li> </ul> <div class="description"> <ul class="blockList"> <li class="blockList"> <dl> <dt>All Implemented Interfaces:</dt> <dd>java.io.Serializable, java.lang.Comparable&lt;<a href="../../../../org/apache/cassandra/thrift/Cassandra.<API key>._Fields.html" title="enum in org.apache.cassandra.thrift">Cassandra.<API key>._Fields</a>&gt;, org.apache.thrift.TFieldIdEnum</dd> </dl> <dl> <dt>Enclosing class:</dt> <dd><a href="../../../../org/apache/cassandra/thrift/Cassandra.<API key>.html" title="class in org.apache.cassandra.thrift">Cassandra.<API key></a></dd> </dl> <hr> <br> <pre>public static enum <span class="strong">Cassandra.<API key>._Fields</span> extends java.lang.Enum&lt;<a href="../../../../org/apache/cassandra/thrift/Cassandra.<API key>._Fields.html" title="enum in org.apache.cassandra.thrift">Cassandra.<API key>._Fields</a>&gt; implements org.apache.thrift.TFieldIdEnum</pre> <div class="block">The set of fields this struct contains, along with convenience methods for finding and manipulating them.</div> </li> </ul> </div> <div class="summary"> <ul class="blockList"> <li class="blockList"> <ul class="blockList"> <li class="blockList"><a name="<API key>"> </a> <h3>Enum Constant Summary</h3> <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Enum Constant Summary table, listing enum constants, and an explanation"> <caption><span>Enum Constants</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colOne" scope="col">Enum Constant and Description</th> </tr> <tr class="altColor"> <td class="colOne"><code><strong><a href="../../../../org/apache/cassandra/thrift/Cassandra.<API key>._Fields.html#SUCCESS">SUCCESS</a></strong></code>&nbsp;</td> </tr> </table> </li> </ul> <ul class="blockList"> <li class="blockList"><a name="method_summary"> </a> <h3>Method Summary</h3> <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> <caption><span>Methods</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tr class="altColor"> <td class="colFirst"><code>static <a href="../../../../org/apache/cassandra/thrift/Cassandra.<API key>._Fields.html" title="enum in org.apache.cassandra.thrift">Cassandra.<API key>._Fields</a></code></td> <td class="colLast"><code><strong><a href="../../../../org/apache/cassandra/thrift/Cassandra.<API key>._Fields.html#findByName(java.lang.String)">findByName</a></strong>(java.lang.String&nbsp;name)</code> <div class="block">Find the _Fields constant that matches name, or null if its not found.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>static <a href="../../../../org/apache/cassandra/thrift/Cassandra.<API key>._Fields.html" title="enum in org.apache.cassandra.thrift">Cassandra.<API key>._Fields</a></code></td> <td class="colLast"><code><strong><a href="../../../../org/apache/cassandra/thrift/Cassandra.<API key>._Fields.html#findByThriftId(int)">findByThriftId</a></strong>(int&nbsp;fieldId)</code> <div class="block">Find the _Fields constant that matches fieldId, or null if its not found.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>static <a href="../../../../org/apache/cassandra/thrift/Cassandra.<API key>._Fields.html" title="enum in org.apache.cassandra.thrift">Cassandra.<API key>._Fields</a></code></td> <td class="colLast"><code><strong><a href="../../../../org/apache/cassandra/thrift/Cassandra.<API key>._Fields.html#<API key>(int)"><API key></a></strong>(int&nbsp;fieldId)</code> <div class="block">Find the _Fields constant that matches fieldId, throwing an exception if it is not found.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>java.lang.String</code></td> <td class="colLast"><code><strong><a href="../../../../org/apache/cassandra/thrift/Cassandra.<API key>._Fields.html#getFieldName()">getFieldName</a></strong>()</code>&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><code>short</code></td> <td class="colLast"><code><strong><a href="../../../../org/apache/cassandra/thrift/Cassandra.<API key>._Fields.html#getThriftFieldId()">getThriftFieldId</a></strong>()</code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><code>static <a href="../../../../org/apache/cassandra/thrift/Cassandra.<API key>._Fields.html" title="enum in org.apache.cassandra.thrift">Cassandra.<API key>._Fields</a></code></td> <td class="colLast"><code><strong><a href="../../../../org/apache/cassandra/thrift/Cassandra.<API key>._Fields.html#valueOf(java.lang.String)">valueOf</a></strong>(java.lang.String&nbsp;name)</code> <div class="block">Returns the enum constant of this type with the specified name.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>static <a href="../../../../org/apache/cassandra/thrift/Cassandra.<API key>._Fields.html" title="enum in org.apache.cassandra.thrift">Cassandra.<API key>._Fields</a>[]</code></td> <td class="colLast"><code><strong><a href="../../../../org/apache/cassandra/thrift/Cassandra.<API key>._Fields.html#values()">values</a></strong>()</code> <div class="block">Returns an array containing the constants of this enum type, in the order they are declared.</div> </td> </tr> </table> <ul class="blockList"> <li class="blockList"><a name="<API key>.lang.Enum"> </a> <h3>Methods inherited from class&nbsp;java.lang.Enum</h3> <code>clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf</code></li> </ul> <ul class="blockList"> <li class="blockList"><a name="<API key>.lang.Object"> </a> <h3>Methods inherited from class&nbsp;java.lang.Object</h3> <code>getClass, notify, notifyAll, wait, wait, wait</code></li> </ul> </li> </ul> </li> </ul> </div> <div class="details"> <ul class="blockList"> <li class="blockList"> <ul class="blockList"> <li class="blockList"><a name="<API key>"> </a> <h3>Enum Constant Detail</h3> <a name="SUCCESS"> </a> <ul class="blockListLast"> <li class="blockList"> <h4>SUCCESS</h4> <pre>public static final&nbsp;<a href="../../../../org/apache/cassandra/thrift/Cassandra.<API key>._Fields.html" title="enum in org.apache.cassandra.thrift">Cassandra.<API key>._Fields</a> SUCCESS</pre> </li> </ul> </li> </ul> <ul class="blockList"> <li class="blockList"><a name="method_detail"> </a> <h3>Method Detail</h3> <a name="values()"> </a> <ul class="blockList"> <li class="blockList"> <h4>values</h4> <pre>public static&nbsp;<a href="../../../../org/apache/cassandra/thrift/Cassandra.<API key>._Fields.html" title="enum in org.apache.cassandra.thrift">Cassandra.<API key>._Fields</a>[]&nbsp;values()</pre> <div class="block">Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows: <pre> for (Cassandra.<API key>._Fields c : Cassandra.<API key>._Fields.values()) &nbsp; System.out.println(c); </pre></div> <dl><dt><span class="strong">Returns:</span></dt><dd>an array containing the constants of this enum type, in the order they are declared</dd></dl> </li> </ul> <a name="valueOf(java.lang.String)"> </a> <ul class="blockList"> <li class="blockList"> <h4>valueOf</h4> <pre>public static&nbsp;<a href="../../../../org/apache/cassandra/thrift/Cassandra.<API key>._Fields.html" title="enum in org.apache.cassandra.thrift">Cassandra.<API key>._Fields</a>&nbsp;valueOf(java.lang.String&nbsp;name)</pre> <div class="block">Returns the enum constant of this type with the specified name. The string must match <i>exactly</i> an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)</div> <dl><dt><span class="strong">Parameters:</span></dt><dd><code>name</code> - the name of the enum constant to be returned.</dd> <dt><span class="strong">Returns:</span></dt><dd>the enum constant with the specified name</dd> <dt><span class="strong">Throws:</span></dt> <dd><code>java.lang.<API key></code> - if this enum type has no constant with the specified name</dd> <dd><code>java.lang.<API key></code> - if the argument is null</dd></dl> </li> </ul> <a name="findByThriftId(int)"> </a> <ul class="blockList"> <li class="blockList"> <h4>findByThriftId</h4> <pre>public static&nbsp;<a href="../../../../org/apache/cassandra/thrift/Cassandra.<API key>._Fields.html" title="enum in org.apache.cassandra.thrift">Cassandra.<API key>._Fields</a>&nbsp;findByThriftId(int&nbsp;fieldId)</pre> <div class="block">Find the _Fields constant that matches fieldId, or null if its not found.</div> </li> </ul> <a name="<API key>(int)"> </a> <ul class="blockList"> <li class="blockList"> <h4><API key></h4> <pre>public static&nbsp;<a href="../../../../org/apache/cassandra/thrift/Cassandra.<API key>._Fields.html" title="enum in org.apache.cassandra.thrift">Cassandra.<API key>._Fields</a>&nbsp;<API key>(int&nbsp;fieldId)</pre> <div class="block">Find the _Fields constant that matches fieldId, throwing an exception if it is not found.</div> </li> </ul> <a name="findByName(java.lang.String)"> </a> <ul class="blockList"> <li class="blockList"> <h4>findByName</h4> <pre>public static&nbsp;<a href="../../../../org/apache/cassandra/thrift/Cassandra.<API key>._Fields.html" title="enum in org.apache.cassandra.thrift">Cassandra.<API key>._Fields</a>&nbsp;findByName(java.lang.String&nbsp;name)</pre> <div class="block">Find the _Fields constant that matches name, or null if its not found.</div> </li> </ul> <a name="getThriftFieldId()"> </a> <ul class="blockList"> <li class="blockList"> <h4>getThriftFieldId</h4> <pre>public&nbsp;short&nbsp;getThriftFieldId()</pre> <dl> <dt><strong>Specified by:</strong></dt> <dd><code>getThriftFieldId</code>&nbsp;in interface&nbsp;<code>org.apache.thrift.TFieldIdEnum</code></dd> </dl> </li> </ul> <a name="getFieldName()"> </a> <ul class="blockListLast"> <li class="blockList"> <h4>getFieldName</h4> <pre>public&nbsp;java.lang.String&nbsp;getFieldName()</pre> <dl> <dt><strong>Specified by:</strong></dt> <dd><code>getFieldName</code>&nbsp;in interface&nbsp;<code>org.apache.thrift.TFieldIdEnum</code></dd> </dl> </li> </ul> </li> </ul> </li> </ul> </div> </div> <div class="bottomNav"><a name="navbar_bottom"> </a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="<API key>"> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="class-use/Cassandra.<API key>._Fields.html">Use</a></li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../index-all.html">Index</a></li> <li><a href="../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../org/apache/cassandra/thrift/Cassandra.<API key>.html" title="class in org.apache.cassandra.thrift"><span class="strong">Prev Class</span></a></li> <li><a href="../../../../org/apache/cassandra/thrift/Cassandra.describe_ring_args.html" title="class in org.apache.cassandra.thrift"><span class="strong">Next Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../index.html?org/apache/cassandra/thrift/Cassandra.<API key>._Fields.html" target="_top">Frames</a></li> <li><a href="Cassandra.<API key>._Fields.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="<API key>"> <li><a href="../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><! allClassesLink = document.getElementById("<API key>"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } </script> </div> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li><a href="#<API key>">Enum Constants</a>&nbsp;|&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li><a href="#method_summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li><a href="#<API key>">Enum Constants</a>&nbsp;|&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li><a href="#method_detail">Method</a></li> </ul> </div> <a name="skip-navbar_bottom"> </a></div> <p class="legalCopy"><small>Copyright &copy; 2015 The Apache Software Foundation</small></p> </body> </html>
package ru.stqa.pft.mantis.appmanager; import org.hibernate.Session; import org.hibernate.SessionFactory; import org.hibernate.boot.MetadataSources; import org.hibernate.boot.registry.<API key>; import org.hibernate.boot.registry.<API key>; import ru.stqa.pft.mantis.model.User; import java.util.List; public class DbHelper { private final SessionFactory sessionFactory; public DbHelper() { final <API key> registry = new <API key>() .configure() // configures settings from hibernate.cfg.xml .build(); sessionFactory = new MetadataSources(registry).buildMetadata().buildSessionFactory(); } public User getUser() { Session session = sessionFactory.openSession(); session.beginTransaction(); List<User> result = session.createQuery("from User").list(); session.getTransaction().commit(); session.close(); return result.stream().filter((s)->(!s.getUsername().equals("administrator"))).iterator().next(); } }
<!-- top navbar--> <header data-ng-include="'app/views/partials/top-navbar.html'" data-ng-class="app.theme.topbar"></header> <!-- Sidebar--> <aside data-ng-include="'app/views/partials/sidebar.html'" data-ng-class="app.theme.sidebar"></aside> <!-- Main--> <section> <!-- Content--> <div ui-view="" autoscroll="false" data-ng-class="app.viewAnimation" class="app"></div> </section> <!-- Page footer--> <footer data-ng-include="'app/views/partials/footer.html'"></footer>
package com.mricefox.<API key>.library.calendar; import android.database.Observable; public class DataSetObservable extends Observable<DataSetObserver> { public boolean hasObservers() { synchronized (mObservers) { return !mObservers.isEmpty(); } } public void notifyChanged() { synchronized (mObservers) {//mObservers register and notify maybe in different thread for (int i = mObservers.size() - 1; i >= 0; i mObservers.get(i).onChanged(); } } } public void <API key>(long from, long to) { synchronized (mObservers) { for (int i = mObservers.size() - 1; i >= 0; i mObservers.get(i).onItemRangeChanged(from, to); } } } }
package dao import ( "context" "testing" "github.com/smartystreets/goconvey/convey" ) func TestDaotypesURI(t *testing.T) { convey.Convey("typesURI", t, func(ctx convey.C) { ctx.Convey("When everything gose positive", func(ctx convey.C) { p1 := testDao.typesURI() ctx.Convey("Then p1 should not be nil.", func(ctx convey.C) { ctx.So(p1, convey.ShouldNotBeNil) }) }) }) } func TestDaoTypeMapping(t *testing.T) { convey.Convey("TypeMapping", t, func(ctx convey.C) { var ( c = context.Background() ) ctx.Convey("When everything gose positive", func(ctx convey.C) { rmap, err := testDao.TypeMapping(c) ctx.Convey("Then err should be nil.rmap should not be nil.", func(ctx convey.C) { ctx.So(err, convey.ShouldBeNil) ctx.So(rmap, convey.ShouldNotBeNil) }) }) }) }
package org.eclipse.ceylon.langtools.classfile; import java.io.IOException; import java.util.ArrayList; import java.util.List; import org.eclipse.ceylon.langtools.classfile.TypeAnnotation.Position.TypePathEntry; /** * See JSR 308 specification, Section 3. * * <p><b>This is NOT part of any supported API. * If you write code that depends on this, you do so at your own risk. * This code and its internal interfaces are subject to change or * deletion without notice.</b> */ public class TypeAnnotation { TypeAnnotation(ClassReader cr) throws IOException, Annotation.InvalidAnnotation { constant_pool = cr.getConstantPool(); position = read_position(cr); annotation = new Annotation(cr); } public TypeAnnotation(ConstantPool constant_pool, Annotation annotation, Position position) { this.constant_pool = constant_pool; this.position = position; this.annotation = annotation; } public int length() { int n = annotation.length(); n += position_length(position); return n; } @Override public String toString() { try { return "@" + constant_pool.getUTF8Value(annotation.type_index).toString().substring(1) + " pos: " + position.toString(); } catch (Exception e) { e.printStackTrace(); return e.toString(); } } public final ConstantPool constant_pool; public final Position position; public final Annotation annotation; private static Position read_position(ClassReader cr) throws IOException, Annotation.InvalidAnnotation { // Copied from ClassReader int tag = cr.readUnsignedByte(); // TargetType tag is a byte if (!TargetType.<API key>(tag)) throw new Annotation.InvalidAnnotation("TypeAnnotation: Invalid type annotation target type value: " + String.format("0x%02X", tag)); TargetType type = TargetType.fromTargetTypeValue(tag); Position position = new Position(); position.type = type; switch (type) { // instanceof case INSTANCEOF: // new expression case NEW: // constructor/method reference receiver case <API key>: case METHOD_REFERENCE: position.offset = cr.readUnsignedShort(); break; // local variable case LOCAL_VARIABLE: // resource variable case RESOURCE_VARIABLE: int table_length = cr.readUnsignedShort(); position.lvarOffset = new int[table_length]; position.lvarLength = new int[table_length]; position.lvarIndex = new int[table_length]; for (int i = 0; i < table_length; ++i) { position.lvarOffset[i] = cr.readUnsignedShort(); position.lvarLength[i] = cr.readUnsignedShort(); position.lvarIndex[i] = cr.readUnsignedShort(); } break; // exception parameter case EXCEPTION_PARAMETER: position.exception_index = cr.readUnsignedShort(); break; // method receiver case METHOD_RECEIVER: // Do nothing break; // type parameter case <API key>: case <API key>: position.parameter_index = cr.readUnsignedByte(); break; // type parameter bound case <API key>: case <API key>: position.parameter_index = cr.readUnsignedByte(); position.bound_index = cr.readUnsignedByte(); break; // class extends or implements clause case CLASS_EXTENDS: int in = cr.readUnsignedShort(); if (in == 0xFFFF) in = -1; position.type_index = in; break; // throws case THROWS: position.type_index = cr.readUnsignedShort(); break; // method parameter case <API key>: position.parameter_index = cr.readUnsignedByte(); break; // type cast case CAST: // method/constructor/reference type argument case <API key>: case <API key>: case <API key>: case <API key>: position.offset = cr.readUnsignedShort(); position.type_index = cr.readUnsignedByte(); break; // We don't need to worry about these case METHOD_RETURN: case FIELD: break; case UNKNOWN: throw new AssertionError("TypeAnnotation: UNKNOWN target type should never occur!"); default: throw new AssertionError("TypeAnnotation: Unknown target type: " + type); } { // Write type path int len = cr.readUnsignedByte(); List<Integer> loc = new ArrayList<Integer>(len); for (int i = 0; i < len * TypePathEntry.bytesPerEntry; ++i) loc.add(cr.readUnsignedByte()); position.location = Position.<API key>(loc); } return position; } private static int position_length(Position pos) { int n = 0; n += 1; // TargetType tag is a byte switch (pos.type) { // instanceof case INSTANCEOF: // new expression case NEW: // constructor/method reference receiver case <API key>: case METHOD_REFERENCE: n += 2; // offset break; // local variable case LOCAL_VARIABLE: // resource variable case RESOURCE_VARIABLE: n += 2; // table_length; int table_length = pos.lvarOffset.length; n += 2 * table_length; // offset n += 2 * table_length; // length n += 2 * table_length; // index break; // exception parameter case EXCEPTION_PARAMETER: n += 2; // exception_index break; // method receiver case METHOD_RECEIVER: // Do nothing break; // type parameter case <API key>: case <API key>: n += 1; // parameter_index break; // type parameter bound case <API key>: case <API key>: n += 1; // parameter_index n += 1; // bound_index break; // class extends or implements clause case CLASS_EXTENDS: n += 2; // type_index break; // throws case THROWS: n += 2; // type_index break; // method parameter case <API key>: n += 1; // parameter_index break; // type cast case CAST: // method/constructor/reference type argument case <API key>: case <API key>: case <API key>: case <API key>: n += 2; // offset n += 1; // type index break; // We don't need to worry about these case METHOD_RETURN: case FIELD: break; case UNKNOWN: throw new AssertionError("TypeAnnotation: UNKNOWN target type should never occur!"); default: throw new AssertionError("TypeAnnotation: Unknown target type: " + pos.type); } { n += 1; // length n += TypePathEntry.bytesPerEntry * pos.location.size(); // bytes for actual array } return n; } // Code duplicated from org.eclipse.ceylon.langtools.tools.javac.code.<API key> public static class Position { public enum TypePathEntryKind { ARRAY(0), INNER_TYPE(1), WILDCARD(2), TYPE_ARGUMENT(3); public final int tag; private TypePathEntryKind(int tag) { this.tag = tag; } } public static class TypePathEntry { /** The fixed number of bytes per TypePathEntry. */ public static final int bytesPerEntry = 2; public final TypePathEntryKind tag; public final int arg; public static final TypePathEntry ARRAY = new TypePathEntry(TypePathEntryKind.ARRAY); public static final TypePathEntry INNER_TYPE = new TypePathEntry(TypePathEntryKind.INNER_TYPE); public static final TypePathEntry WILDCARD = new TypePathEntry(TypePathEntryKind.WILDCARD); private TypePathEntry(TypePathEntryKind tag) { if (!(tag == TypePathEntryKind.ARRAY || tag == TypePathEntryKind.INNER_TYPE || tag == TypePathEntryKind.WILDCARD)) { throw new AssertionError("Invalid TypePathEntryKind: " + tag); } this.tag = tag; this.arg = 0; } public TypePathEntry(TypePathEntryKind tag, int arg) { if (tag != TypePathEntryKind.TYPE_ARGUMENT) { throw new AssertionError("Invalid TypePathEntryKind: " + tag); } this.tag = tag; this.arg = arg; } public static TypePathEntry fromBinary(int tag, int arg) { if (arg != 0 && tag != TypePathEntryKind.TYPE_ARGUMENT.tag) { throw new AssertionError("Invalid TypePathEntry tag/arg: " + tag + "/" + arg); } switch (tag) { case 0: return ARRAY; case 1: return INNER_TYPE; case 2: return WILDCARD; case 3: return new TypePathEntry(TypePathEntryKind.TYPE_ARGUMENT, arg); default: throw new AssertionError("Invalid TypePathEntryKind tag: " + tag); } } @Override public String toString() { return tag.toString() + (tag == TypePathEntryKind.TYPE_ARGUMENT ? ("(" + arg + ")") : ""); } @Override public boolean equals(Object other) { if (! (other instanceof TypePathEntry)) { return false; } TypePathEntry tpe = (TypePathEntry) other; return this.tag == tpe.tag && this.arg == tpe.arg; } @Override public int hashCode() { return this.tag.hashCode() * 17 + this.arg; } } public TargetType type = TargetType.UNKNOWN; // For generic/array types. // TODO: or should we use null? Noone will use this object. public List<TypePathEntry> location = new ArrayList<TypePathEntry>(0); // Tree position. public int pos = -1; // For typecasts, type tests, new (and locals, as start_pc). public boolean isValidOffset = false; public int offset = -1; // For locals. arrays same length public int[] lvarOffset = null; public int[] lvarLength = null; public int[] lvarIndex = null; // For type parameter bound public int bound_index = Integer.MIN_VALUE; // For type parameter and method parameter public int parameter_index = Integer.MIN_VALUE; // For class extends, implements, and throws clauses public int type_index = Integer.MIN_VALUE; // For exception parameters, index into exception table public int exception_index = Integer.MIN_VALUE; public Position() {} @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append('['); sb.append(type); switch (type) { // instanceof case INSTANCEOF: // new expression case NEW: // constructor/method reference receiver case <API key>: case METHOD_REFERENCE: sb.append(", offset = "); sb.append(offset); break; // local variable case LOCAL_VARIABLE: // resource variable case RESOURCE_VARIABLE: if (lvarOffset == null) { sb.append(", lvarOffset is null!"); break; } sb.append(", {"); for (int i = 0; i < lvarOffset.length; ++i) { if (i != 0) sb.append("; "); sb.append("start_pc = "); sb.append(lvarOffset[i]); sb.append(", length = "); sb.append(lvarLength[i]); sb.append(", index = "); sb.append(lvarIndex[i]); } sb.append("}"); break; // method receiver case METHOD_RECEIVER: // Do nothing break; // type parameter case <API key>: case <API key>: sb.append(", param_index = "); sb.append(parameter_index); break; // type parameter bound case <API key>: case <API key>: sb.append(", param_index = "); sb.append(parameter_index); sb.append(", bound_index = "); sb.append(bound_index); break; // class extends or implements clause case CLASS_EXTENDS: sb.append(", type_index = "); sb.append(type_index); break; // throws case THROWS: sb.append(", type_index = "); sb.append(type_index); break; // exception parameter case EXCEPTION_PARAMETER: sb.append(", exception_index = "); sb.append(exception_index); break; // method parameter case <API key>: sb.append(", param_index = "); sb.append(parameter_index); break; // type cast case CAST: // method/constructor/reference type argument case <API key>: case <API key>: case <API key>: case <API key>: sb.append(", offset = "); sb.append(offset); sb.append(", type_index = "); sb.append(type_index); break; // We don't need to worry about these case METHOD_RETURN: case FIELD: break; case UNKNOWN: sb.append(", position UNKNOWN!"); break; default: throw new AssertionError("Unknown target type: " + type); } // Append location data for generics/arrays. if (!location.isEmpty()) { sb.append(", location = ("); sb.append(location); sb.append(")"); } sb.append(", pos = "); sb.append(pos); sb.append(']'); return sb.toString(); } /** * Indicates whether the target tree of the annotation has been optimized * away from classfile or not. * @return true if the target has not been optimized away */ public boolean emitToClassfile() { return !type.isLocal() || isValidOffset; } /** * Decode the binary representation for a type path and set * the {@code location} field. * * @param list The bytecode representation of the type path. */ public static List<TypePathEntry> <API key>(List<Integer> list) { List<TypePathEntry> loc = new ArrayList<TypePathEntry>(list.size() / TypePathEntry.bytesPerEntry); int idx = 0; while (idx < list.size()) { if (idx + 1 == list.size()) { throw new AssertionError("Could not decode type path: " + list); } loc.add(TypePathEntry.fromBinary(list.get(idx), list.get(idx + 1))); idx += 2; } return loc; } public static List<Integer> <API key>(List<TypePathEntry> locs) { List<Integer> loc = new ArrayList<Integer>(locs.size() * TypePathEntry.bytesPerEntry); for (TypePathEntry tpe : locs) { loc.add(tpe.tag.tag); loc.add(tpe.arg); } return loc; } } // Code duplicated from org.eclipse.ceylon.langtools.tools.javac.code.TargetType // The IsLocal flag could be removed here. public enum TargetType { /** For annotations on a class type parameter declaration. */ <API key>(0x00), /** For annotations on a method type parameter declaration. */ <API key>(0x01), /** For annotations on the type of an "extends" or "implements" clause. */ CLASS_EXTENDS(0x10), /** For annotations on a bound of a type parameter of a class. */ <API key>(0x11), /** For annotations on a bound of a type parameter of a method. */ <API key>(0x12), /** For annotations on a field. */ FIELD(0x13), /** For annotations on a method return type. */ METHOD_RETURN(0x14), /** For annotations on the method receiver. */ METHOD_RECEIVER(0x15), /** For annotations on a method parameter. */ <API key>(0x16), /** For annotations on a throws clause in a method declaration. */ THROWS(0x17), /** For annotations on a local variable. */ LOCAL_VARIABLE(0x40, true), /** For annotations on a resource variable. */ RESOURCE_VARIABLE(0x41, true), /** For annotations on an exception parameter. */ EXCEPTION_PARAMETER(0x42, true), /** For annotations on a type test. */ INSTANCEOF(0x43, true), /** For annotations on an object creation expression. */ NEW(0x44, true), /** For annotations on a constructor reference receiver. */ <API key>(0x45, true), /** For annotations on a method reference receiver. */ METHOD_REFERENCE(0x46, true), /** For annotations on a typecast. */ CAST(0x47, true), /** For annotations on a type argument of an object creation expression. */ <API key>(0x48, true), /** For annotations on a type argument of a method call. */ <API key>(0x49, true), /** For annotations on a type argument of a constructor reference. */ <API key>(0x4A, true), /** For annotations on a type argument of a method reference. */ <API key>(0x4B, true), /** For annotations with an unknown target. */ UNKNOWN(0xFF); private static final int <API key> = 0x4B; private final int targetTypeValue; private final boolean isLocal; private TargetType(int targetTypeValue) { this(targetTypeValue, false); } private TargetType(int targetTypeValue, boolean isLocal) { if (targetTypeValue < 0 || targetTypeValue > 255) throw new AssertionError("Attribute type value needs to be an unsigned byte: " + String.format("0x%02X", targetTypeValue)); this.targetTypeValue = targetTypeValue; this.isLocal = isLocal; } /** * Returns whether or not this TargetType represents an annotation whose * target is exclusively a tree in a method body * * Note: wildcard bound targets could target a local tree and a class * member declaration signature tree */ public boolean isLocal() { return isLocal; } public int targetTypeValue() { return this.targetTypeValue; } private static final TargetType[] targets; static { targets = new TargetType[<API key> + 1]; TargetType[] alltargets = values(); for (TargetType target : alltargets) { if (target.targetTypeValue != UNKNOWN.targetTypeValue) targets[target.targetTypeValue] = target; } for (int i = 0; i <= <API key>; ++i) { if (targets[i] == null) targets[i] = UNKNOWN; } } public static boolean <API key>(int tag) { if (tag == UNKNOWN.targetTypeValue) return true; return (tag >= 0 && tag < targets.length); } public static TargetType fromTargetTypeValue(int tag) { if (tag == UNKNOWN.targetTypeValue) return UNKNOWN; if (tag < 0 || tag >= targets.length) throw new AssertionError("Unknown TargetType: " + tag); return targets[tag]; } } }
<!DOCTYPE HTML PUBLIC "- <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (1.8.0_112) on Tue Sep 12 14:31:27 MST 2017 --> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Uses of Interface org.wildfly.swarm.netflix.ribbon.RibbonArchive (BOM: * : All 2017.9.5 API)</title> <meta name="date" content="2017-09-12"> <link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style"> <script type="text/javascript" src="../../../../../../script.js"></script> </head> <body> <script type="text/javascript"><! try { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Interface org.wildfly.swarm.netflix.ribbon.RibbonArchive (BOM: * : All 2017.9.5 API)"; } } catch(err) { } </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <div class="topNav"><a name="navbar.top"> </a> <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.top.firstrow"> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../../org/wildfly/swarm/netflix/ribbon/RibbonArchive.html" title="interface in org.wildfly.swarm.netflix.ribbon">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../../../../../../overview-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 class="aboutLanguage">WildFly Swarm API, 2017.9.5</div> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../../index.html?org/wildfly/swarm/netflix/ribbon/class-use/RibbonArchive.html" target="_top">Frames</a></li> <li><a href="RibbonArchive.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="<API key>"> <li><a href="../../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><! allClassesLink = document.getElementById("<API key>"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } </script> </div> <a name="skip.navbar.top"> </a></div> <div class="header"> <h2 title="Uses of Interface org.wildfly.swarm.netflix.ribbon.RibbonArchive" class="title">Uses of Interface<br>org.wildfly.swarm.netflix.ribbon.RibbonArchive</h2> </div> <div class="classUseContainer"> <ul class="blockList"> <li class="blockList"> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing packages, and an explanation"> <caption><span>Packages that use <a href="../../../../../../org/wildfly/swarm/netflix/ribbon/RibbonArchive.html" title="interface in org.wildfly.swarm.netflix.ribbon">RibbonArchive</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Package</th> <th class="colLast" scope="col">Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><a href="#org.wildfly.swarm.netflix.ribbon">org.wildfly.swarm.netflix.ribbon</a></td> <td class="colLast">&nbsp;</td> </tr> </tbody> </table> </li> <li class="blockList"> <ul class="blockList"> <li class="blockList"><a name="org.wildfly.swarm.netflix.ribbon"> </a> <h3>Uses of <a href="../../../../../../org/wildfly/swarm/netflix/ribbon/RibbonArchive.html" title="interface in org.wildfly.swarm.netflix.ribbon">RibbonArchive</a> in <a href="../../../../../../org/wildfly/swarm/netflix/ribbon/package-summary.html">org.wildfly.swarm.netflix.ribbon</a></h3> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation"> <caption><span>Methods in <a href="../../../../../../org/wildfly/swarm/netflix/ribbon/package-summary.html">org.wildfly.swarm.netflix.ribbon</a> that return <a href="../../../../../../org/wildfly/swarm/netflix/ribbon/RibbonArchive.html" title="interface in org.wildfly.swarm.netflix.ribbon">RibbonArchive</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code><a href="../../../../../../org/wildfly/swarm/netflix/ribbon/RibbonArchive.html" title="interface in org.wildfly.swarm.netflix.ribbon">RibbonArchive</a></code></td> <td class="colLast"><span class="typeNameLabel">RibbonArchive.</span><code><span class="memberNameLink"><a href="../../../../../../org/wildfly/swarm/netflix/ribbon/RibbonArchive.html#advertise--">advertise</a></span>()</code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><code><a href="../../../../../../org/wildfly/swarm/netflix/ribbon/RibbonArchive.html" title="interface in org.wildfly.swarm.netflix.ribbon">RibbonArchive</a></code></td> <td class="colLast"><span class="typeNameLabel">RibbonArchive.</span><code><span class="memberNameLink"><a href="../../../../../../org/wildfly/swarm/netflix/ribbon/RibbonArchive.html </tr> </tbody> </table> </li> </ul> </li> </ul> </div> <div class="bottomNav"><a name="navbar.bottom"> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.bottom.firstrow"> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../../org/wildfly/swarm/netflix/ribbon/RibbonArchive.html" title="interface in org.wildfly.swarm.netflix.ribbon">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../../../../../../overview-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 class="aboutLanguage">WildFly Swarm API, 2017.9.5</div> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../../index.html?org/wildfly/swarm/netflix/ribbon/class-use/RibbonArchive.html" target="_top">Frames</a></li> <li><a href="RibbonArchive.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="<API key>"> <li><a href="../../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><! allClassesLink = document.getElementById("<API key>"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } </script> </div> <a name="skip.navbar.bottom"> </a></div> <p class="legalCopy"><small>Copyright & </body> </html>
<!DOCTYPE HTML PUBLIC "- <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (1.8.0_60-ea) on Thu Dec 15 09:48:34 EST 2016 --> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>org.wildfly.swarm.cdi (Public javadocs 2016.12.1 API)</title> <meta name="date" content="2016-12-15"> <link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style"> <script type="text/javascript" src="../../../../script.js"></script> </head> <body> <h1 class="bar"><a href="../../../../org/wildfly/swarm/cdi/package-summary.html" target="classFrame">org.wildfly.swarm.cdi</a></h1> <div class="indexContainer"> <h2 title="Classes">Classes</h2> <ul title="Classes"> <li><a href="CDIFraction.html" title="class in org.wildfly.swarm.cdi" target="classFrame">CDIFraction</a></li> </ul> </div> </body> </html>
<!DOCTYPE HTML PUBLIC "- <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (1.8.0_60-ea) on Tue Sep 06 12:41:42 EDT 2016 --> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>org.wildfly.swarm.config.logging (Public javadocs 2016.9 API)</title> <meta name="date" content="2016-09-06"> <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="org.wildfly.swarm.config.logging (Public javadocs 2016.9 API)"; } } catch(err) { } </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <div class="topNav"><a name="navbar.top"> </a> <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.top.firstrow"> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../overview-summary.html">Overview</a></li> <li class="navBarCell1Rev">Package</li> <li>Class</li> <li><a href="package-use.html">Use</a></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 class="aboutLanguage">WildFly Swarm API, 2016.9</div> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../../org/wildfly/swarm/config/jmx/configuration/package-summary.html">Prev&nbsp;Package</a></li> <li><a href="../../../../../org/wildfly/swarm/config/mail/package-summary.html">Next&nbsp;Package</a></li> </ul> <ul class="navList"> <li><a href="../../../../../index.html?org/wildfly/swarm/config/logging/package-summary.html" target="_top">Frames</a></li> <li><a href="package-summary.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="<API key>"> <li><a href="../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><! allClassesLink = document.getElementById("<API key>"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } </script> </div> <a name="skip.navbar.top"> </a></div> <div class="header"> <h1 title="Package" class="title">Package&nbsp;org.wildfly.swarm.config.logging</h1> </div> <div class="contentContainer"> <ul class="blockList"> <li class="blockList"> <table class="typeSummary" border="0" cellpadding="3" cellspacing="0" summary="Interface Summary table, listing interfaces, and an explanation"> <caption><span>Interface Summary</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Interface</th> <th class="colLast" scope="col">Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><a href="../../../../../org/wildfly/swarm/config/logging/<API key>.html" title="interface in org.wildfly.swarm.config.logging"><API key></a>&lt;T extends <a href="../../../../../org/wildfly/swarm/config/logging/AsyncHandler.html" title="class in org.wildfly.swarm.config.logging">AsyncHandler</a>&lt;T&gt;&gt;</td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../../../org/wildfly/swarm/config/logging/<API key>.html" title="interface in org.wildfly.swarm.config.logging"><API key></a>&lt;T extends <a href="../../../../../org/wildfly/swarm/config/logging/AsyncHandler.html" title="class in org.wildfly.swarm.config.logging">AsyncHandler</a>&gt;</td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../../../org/wildfly/swarm/config/logging/<API key>.html" title="interface in org.wildfly.swarm.config.logging"><API key></a>&lt;T extends <a href="../../../../../org/wildfly/swarm/config/logging/ConsoleHandler.html" title="class in org.wildfly.swarm.config.logging">ConsoleHandler</a>&lt;T&gt;&gt;</td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../../../org/wildfly/swarm/config/logging/<API key>.html" title="interface in org.wildfly.swarm.config.logging"><API key></a>&lt;T extends <a href="../../../../../org/wildfly/swarm/config/logging/ConsoleHandler.html" title="class in org.wildfly.swarm.config.logging">ConsoleHandler</a>&gt;</td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../../../org/wildfly/swarm/config/logging/<API key>.html" title="interface in org.wildfly.swarm.config.logging"><API key></a>&lt;T extends <a href="../../../../../org/wildfly/swarm/config/logging/CustomFormatter.html" title="class in org.wildfly.swarm.config.logging">CustomFormatter</a>&lt;T&gt;&gt;</td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../../../org/wildfly/swarm/config/logging/<API key>.html" title="interface in org.wildfly.swarm.config.logging"><API key></a>&lt;T extends <a href="../../../../../org/wildfly/swarm/config/logging/CustomFormatter.html" title="class in org.wildfly.swarm.config.logging">CustomFormatter</a>&gt;</td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../../../org/wildfly/swarm/config/logging/<API key>.html" title="interface in org.wildfly.swarm.config.logging"><API key></a>&lt;T extends <a href="../../../../../org/wildfly/swarm/config/logging/CustomHandler.html" title="class in org.wildfly.swarm.config.logging">CustomHandler</a>&lt;T&gt;&gt;</td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../../../org/wildfly/swarm/config/logging/<API key>.html" title="interface in org.wildfly.swarm.config.logging"><API key></a>&lt;T extends <a href="../../../../../org/wildfly/swarm/config/logging/CustomHandler.html" title="class in org.wildfly.swarm.config.logging">CustomHandler</a>&gt;</td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../../../org/wildfly/swarm/config/logging/FileHandlerConsumer.html" title="interface in org.wildfly.swarm.config.logging">FileHandlerConsumer</a>&lt;T extends <a href="../../../../../org/wildfly/swarm/config/logging/FileHandler.html" title="class in org.wildfly.swarm.config.logging">FileHandler</a>&lt;T&gt;&gt;</td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../../../org/wildfly/swarm/config/logging/FileHandlerSupplier.html" title="interface in org.wildfly.swarm.config.logging">FileHandlerSupplier</a>&lt;T extends <a href="../../../../../org/wildfly/swarm/config/logging/FileHandler.html" title="class in org.wildfly.swarm.config.logging">FileHandler</a>&gt;</td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../../../org/wildfly/swarm/config/logging/LogFileConsumer.html" title="interface in org.wildfly.swarm.config.logging">LogFileConsumer</a>&lt;T extends <a href="../../../../../org/wildfly/swarm/config/logging/LogFile.html" title="class in org.wildfly.swarm.config.logging">LogFile</a>&lt;T&gt;&gt;</td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../../../org/wildfly/swarm/config/logging/LogFileSupplier.html" title="interface in org.wildfly.swarm.config.logging">LogFileSupplier</a>&lt;T extends <a href="../../../../../org/wildfly/swarm/config/logging/LogFile.html" title="class in org.wildfly.swarm.config.logging">LogFile</a>&gt;</td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../../../org/wildfly/swarm/config/logging/LoggerConsumer.html" title="interface in org.wildfly.swarm.config.logging">LoggerConsumer</a>&lt;T extends <a href="../../../../../org/wildfly/swarm/config/logging/Logger.html" title="class in org.wildfly.swarm.config.logging">Logger</a>&lt;T&gt;&gt;</td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../../../org/wildfly/swarm/config/logging/LoggerSupplier.html" title="interface in org.wildfly.swarm.config.logging">LoggerSupplier</a>&lt;T extends <a href="../../../../../org/wildfly/swarm/config/logging/Logger.html" title="class in org.wildfly.swarm.config.logging">Logger</a>&gt;</td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../../../org/wildfly/swarm/config/logging/<API key>.html" title="interface in org.wildfly.swarm.config.logging"><API key></a>&lt;T extends <a href="../../../../../org/wildfly/swarm/config/logging/LoggingProfile.html" title="class in org.wildfly.swarm.config.logging">LoggingProfile</a>&lt;T&gt;&gt;</td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../../../org/wildfly/swarm/config/logging/<API key>.html" title="interface in org.wildfly.swarm.config.logging"><API key></a>&lt;T extends <a href="../../../../../org/wildfly/swarm/config/logging/LoggingProfile.html" title="class in org.wildfly.swarm.config.logging">LoggingProfile</a>&gt;</td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../../../org/wildfly/swarm/config/logging/<API key>.html" title="interface in org.wildfly.swarm.config.logging"><API key></a>&lt;T extends <a href="../../../../../org/wildfly/swarm/config/logging/PatternFormatter.html" title="class in org.wildfly.swarm.config.logging">PatternFormatter</a>&lt;T&gt;&gt;</td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../../../org/wildfly/swarm/config/logging/<API key>.html" title="interface in org.wildfly.swarm.config.logging"><API key></a>&lt;T extends <a href="../../../../../org/wildfly/swarm/config/logging/PatternFormatter.html" title="class in org.wildfly.swarm.config.logging">PatternFormatter</a>&gt;</td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../../../org/wildfly/swarm/config/logging/<API key>.html" title="interface in org.wildfly.swarm.config.logging"><API key></a>&lt;T extends <a href="../../../../../org/wildfly/swarm/config/logging/<API key>.html" title="class in org.wildfly.swarm.config.logging"><API key></a>&lt;T&gt;&gt;</td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../../../org/wildfly/swarm/config/logging/<API key>.html" title="interface in org.wildfly.swarm.config.logging"><API key></a>&lt;T extends <a href="../../../../../org/wildfly/swarm/config/logging/<API key>.html" title="class in org.wildfly.swarm.config.logging"><API key></a>&gt;</td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../../../org/wildfly/swarm/config/logging/<API key>.html" title="interface in org.wildfly.swarm.config.logging"><API key></a>&lt;T extends <a href="../../../../../org/wildfly/swarm/config/logging/<API key>.html" title="class in org.wildfly.swarm.config.logging"><API key></a>&lt;T&gt;&gt;</td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../../../org/wildfly/swarm/config/logging/<API key>.html" title="interface in org.wildfly.swarm.config.logging"><API key></a>&lt;T extends <a href="../../../../../org/wildfly/swarm/config/logging/<API key>.html" title="class in org.wildfly.swarm.config.logging"><API key></a>&gt;</td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../../../org/wildfly/swarm/config/logging/RootLoggerConsumer.html" title="interface in org.wildfly.swarm.config.logging">RootLoggerConsumer</a>&lt;T extends <a href="../../../../../org/wildfly/swarm/config/logging/RootLogger.html" title="class in org.wildfly.swarm.config.logging">RootLogger</a>&lt;T&gt;&gt;</td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../../../org/wildfly/swarm/config/logging/RootLoggerSupplier.html" title="interface in org.wildfly.swarm.config.logging">RootLoggerSupplier</a>&lt;T extends <a href="../../../../../org/wildfly/swarm/config/logging/RootLogger.html" title="class in org.wildfly.swarm.config.logging">RootLogger</a>&gt;</td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../../../org/wildfly/swarm/config/logging/<API key>.html" title="interface in org.wildfly.swarm.config.logging"><API key></a>&lt;T extends <a href="../../../../../org/wildfly/swarm/config/logging/<API key>.html" title="class in org.wildfly.swarm.config.logging"><API key></a>&lt;T&gt;&gt;</td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../../../org/wildfly/swarm/config/logging/<API key>.html" title="interface in org.wildfly.swarm.config.logging"><API key></a>&lt;T extends <a href="../../../../../org/wildfly/swarm/config/logging/<API key>.html" title="class in org.wildfly.swarm.config.logging"><API key></a>&gt;</td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../../../org/wildfly/swarm/config/logging/<API key>.html" title="interface in org.wildfly.swarm.config.logging"><API key></a>&lt;T extends <a href="../../../../../org/wildfly/swarm/config/logging/SyslogHandler.html" title="class in org.wildfly.swarm.config.logging">SyslogHandler</a>&lt;T&gt;&gt;</td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../../../org/wildfly/swarm/config/logging/<API key>.html" title="interface in org.wildfly.swarm.config.logging"><API key></a>&lt;T extends <a href="../../../../../org/wildfly/swarm/config/logging/SyslogHandler.html" title="class in org.wildfly.swarm.config.logging">SyslogHandler</a>&gt;</td> <td class="colLast">&nbsp;</td> </tr> </tbody> </table> </li> <li class="blockList"> <table class="typeSummary" border="0" cellpadding="3" cellspacing="0" summary="Class Summary table, listing classes, and an explanation"> <caption><span>Class Summary</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Class</th> <th class="colLast" scope="col">Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><a href="../../../../../org/wildfly/swarm/config/logging/AsyncHandler.html" title="class in org.wildfly.swarm.config.logging">AsyncHandler</a>&lt;T extends <a href="../../../../../org/wildfly/swarm/config/logging/AsyncHandler.html" title="class in org.wildfly.swarm.config.logging">AsyncHandler</a>&lt;T&gt;&gt;</td> <td class="colLast"> <div class="block">Defines a handler which writes to the sub-handlers in an asynchronous thread.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../../../org/wildfly/swarm/config/logging/ConsoleHandler.html" title="class in org.wildfly.swarm.config.logging">ConsoleHandler</a>&lt;T extends <a href="../../../../../org/wildfly/swarm/config/logging/ConsoleHandler.html" title="class in org.wildfly.swarm.config.logging">ConsoleHandler</a>&lt;T&gt;&gt;</td> <td class="colLast"> <div class="block">Defines a handler which writes to the console.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../../../org/wildfly/swarm/config/logging/CustomFormatter.html" title="class in org.wildfly.swarm.config.logging">CustomFormatter</a>&lt;T extends <a href="../../../../../org/wildfly/swarm/config/logging/CustomFormatter.html" title="class in org.wildfly.swarm.config.logging">CustomFormatter</a>&lt;T&gt;&gt;</td> <td class="colLast"> <div class="block">A custom formatter to be used with handlers.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../../../org/wildfly/swarm/config/logging/CustomHandler.html" title="class in org.wildfly.swarm.config.logging">CustomHandler</a>&lt;T extends <a href="../../../../../org/wildfly/swarm/config/logging/CustomHandler.html" title="class in org.wildfly.swarm.config.logging">CustomHandler</a>&lt;T&gt;&gt;</td> <td class="colLast"> <div class="block">Defines a custom logging handler.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../../../org/wildfly/swarm/config/logging/FileHandler.html" title="class in org.wildfly.swarm.config.logging">FileHandler</a>&lt;T extends <a href="../../../../../org/wildfly/swarm/config/logging/FileHandler.html" title="class in org.wildfly.swarm.config.logging">FileHandler</a>&lt;T&gt;&gt;</td> <td class="colLast"> <div class="block">Defines a handler which writes to a file.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../../../org/wildfly/swarm/config/logging/LogFile.html" title="class in org.wildfly.swarm.config.logging">LogFile</a>&lt;T extends <a href="../../../../../org/wildfly/swarm/config/logging/LogFile.html" title="class in org.wildfly.swarm.config.logging">LogFile</a>&lt;T&gt;&gt;</td> <td class="colLast"> <div class="block">Log files that are available to be read.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../../../org/wildfly/swarm/config/logging/Logger.html" title="class in org.wildfly.swarm.config.logging">Logger</a>&lt;T extends <a href="../../../../../org/wildfly/swarm/config/logging/Logger.html" title="class in org.wildfly.swarm.config.logging">Logger</a>&lt;T&gt;&gt;</td> <td class="colLast"> <div class="block">Defines a logger category.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../../../org/wildfly/swarm/config/logging/LoggingProfile.html" title="class in org.wildfly.swarm.config.logging">LoggingProfile</a>&lt;T extends <a href="../../../../../org/wildfly/swarm/config/logging/LoggingProfile.html" title="class in org.wildfly.swarm.config.logging">LoggingProfile</a>&lt;T&gt;&gt;</td> <td class="colLast"> <div class="block">The configuration of the logging subsystem.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../../../org/wildfly/swarm/config/logging/LoggingProfile.<API key>.html" title="class in org.wildfly.swarm.config.logging">LoggingProfile.<API key></a></td> <td class="colLast"> <div class="block">Child mutators for LoggingProfile</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../../../org/wildfly/swarm/config/logging/PatternFormatter.html" title="class in org.wildfly.swarm.config.logging">PatternFormatter</a>&lt;T extends <a href="../../../../../org/wildfly/swarm/config/logging/PatternFormatter.html" title="class in org.wildfly.swarm.config.logging">PatternFormatter</a>&lt;T&gt;&gt;</td> <td class="colLast"> <div class="block">A pattern formatter to be used with handlers.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../../../org/wildfly/swarm/config/logging/<API key>.html" title="class in org.wildfly.swarm.config.logging"><API key></a>&lt;T extends <a href="../../../../../org/wildfly/swarm/config/logging/<API key>.html" title="class in org.wildfly.swarm.config.logging"><API key></a>&lt;T&gt;&gt;</td> <td class="colLast"> <div class="block">Defines a handler which writes to a file, rotating the log after a time period derived from the given suffix string, which should be in a format understood by java.text.SimpleDateFormat.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../../../org/wildfly/swarm/config/logging/<API key>.html" title="class in org.wildfly.swarm.config.logging"><API key></a>&lt;T extends <a href="../../../../../org/wildfly/swarm/config/logging/<API key>.html" title="class in org.wildfly.swarm.config.logging"><API key></a>&lt;T&gt;&gt;</td> <td class="colLast"> <div class="block">Defines a handler which writes to a file, rotating the log after a time period derived from the given suffix string or after the size of the file grows beyond a certain point and keeping a fixed number of backups.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../../../org/wildfly/swarm/config/logging/RootLogger.html" title="class in org.wildfly.swarm.config.logging">RootLogger</a>&lt;T extends <a href="../../../../../org/wildfly/swarm/config/logging/RootLogger.html" title="class in org.wildfly.swarm.config.logging">RootLogger</a>&lt;T&gt;&gt;</td> <td class="colLast"> <div class="block">Defines the root logger for this log context.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../../../org/wildfly/swarm/config/logging/<API key>.html" title="class in org.wildfly.swarm.config.logging"><API key></a>&lt;T extends <a href="../../../../../org/wildfly/swarm/config/logging/<API key>.html" title="class in org.wildfly.swarm.config.logging"><API key></a>&lt;T&gt;&gt;</td> <td class="colLast"> <div class="block">Defines a handler which writes to a file, rotating the log after the size of the file grows beyond a certain point and keeping a fixed number of backups.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../../../org/wildfly/swarm/config/logging/SyslogHandler.html" title="class in org.wildfly.swarm.config.logging">SyslogHandler</a>&lt;T extends <a href="../../../../../org/wildfly/swarm/config/logging/SyslogHandler.html" title="class in org.wildfly.swarm.config.logging">SyslogHandler</a>&lt;T&gt;&gt;</td> <td class="colLast"> <div class="block">Defines a syslog handler.</div> </td> </tr> </tbody> </table> </li> <li class="blockList"> <table class="typeSummary" border="0" cellpadding="3" cellspacing="0" summary="Enum Summary table, listing enums, and an explanation"> <caption><span>Enum Summary</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Enum</th> <th class="colLast" scope="col">Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><a href="../../../../../org/wildfly/swarm/config/logging/AsyncHandler.OverflowAction.html" title="enum in org.wildfly.swarm.config.logging">AsyncHandler.OverflowAction</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../../../org/wildfly/swarm/config/logging/ConsoleHandler.Target.html" title="enum in org.wildfly.swarm.config.logging">ConsoleHandler.Target</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../../../org/wildfly/swarm/config/logging/Level.html" title="enum in org.wildfly.swarm.config.logging">Level</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../../../org/wildfly/swarm/config/logging/SyslogHandler.Facility.html" title="enum in org.wildfly.swarm.config.logging">SyslogHandler.Facility</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../../../org/wildfly/swarm/config/logging/SyslogHandler.SyslogFormat.html" title="enum in org.wildfly.swarm.config.logging">SyslogHandler.SyslogFormat</a></td> <td class="colLast">&nbsp;</td> </tr> </tbody> </table> </li> </ul> </div> <div class="bottomNav"><a name="navbar.bottom"> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.bottom.firstrow"> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../overview-summary.html">Overview</a></li> <li class="navBarCell1Rev">Package</li> <li>Class</li> <li><a href="package-use.html">Use</a></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 class="aboutLanguage">WildFly Swarm API, 2016.9</div> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../../org/wildfly/swarm/config/jmx/configuration/package-summary.html">Prev&nbsp;Package</a></li> <li><a href="../../../../../org/wildfly/swarm/config/mail/package-summary.html">Next&nbsp;Package</a></li> </ul> <ul class="navList"> <li><a href="../../../../../index.html?org/wildfly/swarm/config/logging/package-summary.html" target="_top">Frames</a></li> <li><a href="package-summary.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="<API key>"> <li><a href="../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><! allClassesLink = document.getElementById("<API key>"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } </script> </div> <a name="skip.navbar.bottom"> </a></div> <p class="legalCopy"><small>Copyright & </body> </html>
define([ "settings", "views/tags" ], function(panelSettings, TagsView) { var PanelFileView = codebox.require("views/panels/file"); var PanelOutlineView = PanelFileView.extend({ className: "cb-panel-outline", FileView: TagsView }); return PanelOutlineView; });
package com.ticktick.testimagecropper; import java.io.File; import java.io.<API key>; import java.io.InputStream; import com.ticktick.imagecropper.CropImageActivity; import com.ticktick.imagecropper.CropIntent; import android.app.Activity; import android.content.Intent; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.net.Uri; import android.os.Bundle; import android.provider.MediaStore; import android.view.View; import android.widget.ImageView; import android.widget.Toast; public class MainActivity extends Activity { public static final int <API key> = 0x1; public static final int <API key> = 0x2; public static final String <API key> = "/sdcard/test.jpg"; private ImageView mImageView; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); mImageView = (ImageView)findViewById(R.id.CroppedImageView); } public void onClickButton(View v) { Intent intent = new Intent(Intent.ACTION_PICK);
<?php $this->pageTitle=Yii::app()->name . ' - Login'; $this->breadcrumbs=array( 'Login', ); ?> <h1>Login</h1> <p>Please fill out the following form with your login credentials:</p> <div class="form"> <?php $form=$this->beginWidget('CActiveForm', array( 'id'=>'login-form', '<API key>'=>true, )); ?> <p class="note">Fields with <span class="required">*</span> are required.</p> <div class="row"> <?php echo CHtml::label('Pin','pin'); ?> <?php echo CHtml::passwordField('pin'); ?> </div> <div class="row"> <?php echo $form->labelEx($model,'username'); ?> <?php echo $form->textField($model,'username'); ?> <?php echo $form->error($model,'username'); ?> </div> <div class="row"> <?php echo $form->labelEx($model,'password'); ?> <?php echo $form->passwordField($model,'password'); ?> <?php echo $form->error($model,'password'); ?> <! <p class="hint"> Hint: You may login with <tt>demo/demo</tt>. </p> </div> <! <div class="row rememberMe"> <?php //echo $form->checkBox($model,'rememberMe'); ?> <?php //echo $form->label($model,'rememberMe'); ?> <?php //echo $form->error($model,'rememberMe'); ?> </div> <div class="row submit"> <?php echo CHtml::submitButton('Login'); ?> </div> <?php $this->endWidget(); ?> </div><!-- form -->
package com.zlwh.hands.api.domain.base; public class PageDomain { private String pageNo; private String pageSize = "15"; private long pageTime; public String getPageNo() { return pageNo; } public void setPageNo(String pageNo) { this.pageNo = pageNo; } public String getPageSize() { return pageSize; } public void setPageSize(String pageSize) { this.pageSize = pageSize; } public long getPageTime() { return pageTime; } public void setPageTime(long pageTime) { this.pageTime = pageTime; } }
package io.github.thankpoint.security.impl; import java.security.Provider; import java.security.Security; import io.github.thankpoint.security.api.provider.<API key>; /** * Implementation of {@link <API key>}. * * @param <B> type of the returned builder. * @author thks */ public interface <API key><B> extends <API key><B> { @Override default B provider() { return provider((Provider) null); } @Override default B provider(String name) { return provider(Security.getProvider(name)); } }
<!DOCTYPE html> <html devsite=""> <head> <meta name="project_path" value="/dotnet/_project.yaml"> <meta name="book_path" value="/dotnet/_book.yaml"> </head> <body> {% verbatim %} <div> <article data-uid="Google.Cloud.Asset.V1.TemporalAsset.Types"> <h1 class="page-title">Class TemporalAsset.Types </h1> <div class="codewrapper"> <pre class="prettyprint"><code>public static class Types</code></pre> </div> <div class="markdown level0 summary"><p>Container for nested types declared in the TemporalAsset message type.</p> </div> <div class="inheritance"> <h2>Inheritance</h2> <span><span class="xref">System.Object</span></span> <span> &gt; </span> <span class="xref">TemporalAsset.Types</span> </div> <div class="inheritedMembers expandable"> <h2 class="showalways">Inherited Members</h2> <div> <span class="xref">System.Object.GetHashCode()</span> </div> <div> <span class="xref">System.Object.GetType()</span> </div> <div> <span class="xref">System.Object.MemberwiseClone()</span> </div> <div> <span class="xref">System.Object.ToString()</span> </div> </div> <h2>Namespace</h2> <a class="xref" href="Google.Cloud.Asset.V1.html">Google.Cloud.Asset.V1</a> <h2>Assembly</h2> <p>Google.Cloud.Asset.V1.dll</p> </article> </div> {% endverbatim %} </body> </html>
package com.github.saulis.enumerables; import java.util.Iterator; import java.util.<API key>; public class EmptyIterator<T> implements Iterator<T> { @Override public boolean hasNext() { return false; } @Override public T next() { throw new <API key>(); } }
package com.squarespace.template.expr; import java.util.Arrays; /** * Token representing a variable name. Could hold a reference or * a definition. */ public class VarToken extends Token { public final Object[] name; public VarToken(Object[] name) { super(ExprTokenType.VARIABLE); this.name = name; } @Override public boolean equals(Object obj) { if (obj instanceof VarToken) { return Arrays.equals(name, ((VarToken)obj).name); } return false; } @Override public String toString() { return "VarToken[" + Arrays.toString(name) + "]"; } }
package filodb.query.exec.rangefn import scala.util.Random import monix.execution.Scheduler.Implicits.global import monix.reactive.Observable import org.scalatest.concurrent.ScalaFutures import filodb.core.{MetricsTestData, MachineMetricsData => MMD} import filodb.core.query._ import filodb.memory.format.{ZeroCopyUTF8String, vectors => bv} import filodb.query._ import filodb.query.exec.StaticFuncArgs class InstantFunctionSpec extends <API key> with ScalaFutures { val resultSchema = ResultSchema(MetricsTestData.timeseriesSchema.infosFromIDs(0 to 1), 1) val histSchema = ResultSchema(MMD.histDataset.schema.infosFromIDs(Seq(0, 3)), 1) val histMaxSchema = ResultSchema(MMD.histMaxDS.schema.infosFromIDs(Seq(0, 4, 3)), 1, colIDs=Seq(0, 4, 3)) val ignoreKey = <API key>( Map(ZeroCopyUTF8String("ignore") -> ZeroCopyUTF8String("ignore"))) val sampleBase: Array[RangeVector] = Array( new RangeVector { override def key: RangeVectorKey = ignoreKey import filodb.core.query.NoCloseCursor._ override def rows(): RangeVectorCursor = Seq( new TransientRow(1L, 3.3d), new TransientRow(2L, 5.1d)).iterator override def outputRange: Option[RvRange] = None }, new RangeVector { override def key: RangeVectorKey = ignoreKey import filodb.core.query.NoCloseCursor._ override def rows(): RangeVectorCursor = Seq( new TransientRow(3L, 3239.3423d), new TransientRow(4L, 94935.1523d)).iterator override def outputRange: Option[RvRange] = None }) val rand = new Random() val error = 0.00000001d val rangeParams = RangeParams(100, 20, 200) it("should work with instant function mapper") { val ignoreKey = <API key>( Map(ZeroCopyUTF8String("ignore") -> ZeroCopyUTF8String("ignore"))) val samples: Array[RangeVector] = Array.fill(100)(new RangeVector { val data: Stream[TransientRow] = Stream.from(0).map { n => new TransientRow(n.toLong, rand.nextDouble()) }.take(20) override def key: RangeVectorKey = ignoreKey import filodb.core.query.NoCloseCursor._ override def rows(): RangeVectorCursor = data.iterator override def outputRange: Option[RvRange] = None }) <API key>(samples) } it ("should handle NaN") { val ignoreKey = <API key>( Map(ZeroCopyUTF8String("ignore") -> ZeroCopyUTF8String("ignore"))) val samples: Array[RangeVector] = Array( new RangeVector { import filodb.core.query.NoCloseCursor._ override def key: RangeVectorKey = ignoreKey override def rows(): RangeVectorCursor = Seq( new TransientRow(1L, Double.NaN), new TransientRow(2L, 5.6d)).iterator override def outputRange: Option[RvRange] = None }, new RangeVector { override def key: RangeVectorKey = ignoreKey import filodb.core.query.NoCloseCursor._ override def rows(): RangeVectorCursor = Seq( new TransientRow(1L, 4.6d), new TransientRow(2L, 4.4d)).iterator override def outputRange: Option[RvRange] = None }, new RangeVector { override def key: RangeVectorKey = ignoreKey import filodb.core.query.NoCloseCursor._ override def rows(): RangeVectorCursor = Seq( new TransientRow(1L, 0d), new TransientRow(2L, 5.4d)).iterator override def outputRange: Option[RvRange] = None } ) <API key>(samples) } it ("should handle special cases") { val ignoreKey = <API key>( Map(ZeroCopyUTF8String("ignore") -> ZeroCopyUTF8String("ignore"))) val samples: Array[RangeVector] = Array( new RangeVector { override def key: RangeVectorKey = ignoreKey import filodb.core.query.NoCloseCursor._ override def rows(): RangeVectorCursor = Seq( new TransientRow(1L, 2.0d/0d), new TransientRow(2L, 4.5d), new TransientRow(2L, 0d), new TransientRow(2L, -2.1d), new TransientRow(2L, -0.1d), new TransientRow(2L, 0.3d), new TransientRow(2L, 5.9d), new TransientRow(2L, Double.NaN), new TransientRow(2L, 3.3d)).iterator override def outputRange: Option[RvRange] = None } ) <API key>(samples) } private def <API key>(samples: Array[RangeVector]): Unit = { // Abs val expected = samples.map(_.rows.map(v => scala.math.abs(v.getDouble(1)))) <API key>(samples, expected, InstantFunctionId.Abs) // Ceil val expected2 = samples.map(_.rows.map(v => scala.math.ceil(v.getDouble(1)))) <API key>(samples, expected2, InstantFunctionId.Ceil) // ClampMax val expected3 = samples.map(_.rows.map(v => scala.math.min(v.getDouble(1), 4))) <API key>(samples, expected3, InstantFunctionId.ClampMax, Seq(4.toDouble)) // ClampMin val expected4 = samples.map(_.rows.map(v => scala.math.max(v.getDouble(1), 4.toDouble))) <API key>(samples, expected4, InstantFunctionId.ClampMin, Seq(4)) // Floor val expected5 = samples.map(_.rows.map(v => scala.math.floor(v.getDouble(1)))) <API key>(samples, expected5, InstantFunctionId.Floor) // Log val expected6 = samples.map(_.rows.map(v => scala.math.log(v.getDouble(1)))) <API key>(samples, expected6, InstantFunctionId.Ln) // Log10 val expected7 = samples.map(_.rows.map(v => scala.math.log10(v.getDouble(1)))) <API key>(samples, expected7, InstantFunctionId.Log10) // Log2 val expected8 = samples.map(_.rows.map(v => scala.math.log10(v.getDouble(1)) / scala.math.log10(2.0))) <API key>(samples, expected8, InstantFunctionId.Log2) // Sqrt val expected10 = samples.map(_.rows.map(v => scala.math.sqrt(v.getDouble(1)))) <API key>(samples, expected10, InstantFunctionId.Sqrt) // Exp val expected11 = samples.map(_.rows.map(v => scala.math.exp(v.getDouble(1)))) <API key>(samples, expected11, InstantFunctionId.Exp) // Sgn val expected12 = samples.map(_.rows.map(v => scala.math.signum(v.getDouble(1)))) <API key>(samples, expected12, InstantFunctionId.Sgn) // Round testRoundFunction(samples) } private def testRoundFunction(samples: Array[RangeVector]): Unit = { // Round val expected9 = samples.map(_.rows.map(v => { val value = v.getDouble(1) val toNearestInverse = 1.0 if (value.isNaN || value.isInfinite) value else scala.math.floor(value * toNearestInverse + 0.5) / toNearestInverse })) <API key>(samples, expected9, InstantFunctionId.Round) // Round with param val expected10 = samples.map(_.rows.map(v => { val value = v.getDouble(1) val toNearestInverse = 1.0 / 10 if (value.isNaN || value.isInfinite) value else scala.math.floor(value * toNearestInverse + 0.5) / toNearestInverse })) <API key>(samples, expected10, InstantFunctionId.Round, Seq(10)) } it ("should validate invalid function params") { // clamp_max the[<API key>] thrownBy { val <API key> = exec.<API key>(InstantFunctionId.ClampMax) val resultObs = <API key>(Observable.fromIterable(sampleBase), querySession, 1000, resultSchema, Nil) val result = resultObs.toListL.runToFuture.futureValue.map(_.rows.map(_.getDouble(1)).toList) } should have message "requirement failed: Cannot use ClampMax without providing a upper limit of max." // clamp_min the[<API key>] thrownBy { val <API key> = exec.<API key>(InstantFunctionId.ClampMin) val resultObs = <API key>(Observable.fromIterable(sampleBase), querySession, 1000, resultSchema, Nil) resultObs.toListL.runToFuture.futureValue.map(_.rows.map(_.getDouble(1)).toList) } should have message "requirement failed: Cannot use ClampMin without providing a lower limit of min." // sgn the[<API key>] thrownBy { val <API key> = exec.<API key>(InstantFunctionId.Sgn, Seq(StaticFuncArgs(1, rangeParams))) val resultObs = <API key>(Observable.fromIterable(sampleBase), querySession, 1000, resultSchema, Nil) resultObs.toListL.runToFuture.futureValue.map(_.rows.map(_.getDouble(1)).toList) } should have message "requirement failed: No additional parameters required for the instant function." // sqrt the[<API key>] thrownBy { val <API key> = exec.<API key>(InstantFunctionId.Sqrt, Seq(StaticFuncArgs(1, rangeParams))) val resultObs = <API key>(Observable.fromIterable(sampleBase), querySession, 1000, resultSchema, Nil) resultObs.toListL.runToFuture.futureValue.map(_.rows.map(_.getDouble(1)).toList) } should have message "requirement failed: No additional parameters required for the instant function." // round the[<API key>] thrownBy { val <API key> = exec.<API key>(InstantFunctionId.Round, Seq(StaticFuncArgs(1, rangeParams), StaticFuncArgs(2, rangeParams))) val resultObs = <API key>(Observable.fromIterable(sampleBase), querySession, 1000, resultSchema, Nil) resultObs.toListL.runToFuture.futureValue.map(_.rows.map(_.getDouble(1)).toList) } should have message "requirement failed: Only one optional parameters allowed for Round." // histogram quantile the[<API key>] thrownBy { val (data, histRV) = histogramRV(numSamples = 10) val ivMapper = exec.<API key>(InstantFunctionId.HistogramQuantile) val resultObs = ivMapper(Observable.fromIterable(Array(histRV)), querySession, 1000, histSchema, Nil) resultObs.toListL.runToFuture.futureValue.map(_.rows.map(_.getDouble(1)).toList) } should have message "requirement failed: Quantile (between 0 and 1) required for histogram quantile" // histogram bucket the[<API key>] thrownBy { val (data, histRV) = histogramRV(numSamples = 10) val ivMapper = exec.<API key>(InstantFunctionId.HistogramBucket) val resultObs = ivMapper(Observable.fromIterable(Array(histRV)), querySession, 1000, histSchema, Nil) resultObs.toListL.runToFuture.futureValue.map(_.rows.map(_.getDouble(1)).toList) } should have message "requirement failed: Bucket/le required for histogram bucket" } it ("should fail with wrong calculation") { // ceil val expectedVal = sampleBase.map(_.rows.map(v => scala.math.floor(v.getDouble(1)))) val <API key> = exec.<API key>(InstantFunctionId.Ceil) val resultObs = <API key>(Observable.fromIterable(sampleBase), querySession, 1000, resultSchema, Nil) val result = resultObs.toListL.runToFuture.futureValue.map(_.rows.map(_.getDouble(1))) expectedVal.zip(result).foreach { case (ex, res) => { ex.zip(res).foreach { case (val1, val2) => val1 should not equal val2 } } } } it("should compute histogram_quantile on Histogram RV") { val (data, histRV) = histogramRV(numSamples = 10) val expected = Seq(0.8, 1.6, 2.4, 3.2, 4.0, 5.6, 7.2, 9.6) <API key>(Array(histRV), Array(expected.toIterator), InstantFunctionId.HistogramQuantile, Seq(0.4), histSchema) // check output schema val <API key> = exec.<API key>(InstantFunctionId.HistogramQuantile, Seq(StaticFuncArgs(0.99, rangeParams))) val outSchema = <API key>.schema(histSchema) outSchema.columns.map(_.colType) shouldEqual resultSchema.columns.map(_.colType) } it("should compute <API key> on Histogram RV") { val (data, histRV) = MMD.histMaxRV(100000L, numSamples = 7) val expected = data.zipWithIndex.map { case (row, i) => // Calculating the quantile is quite complex... sigh val _max = row(3).asInstanceOf[Double] if ((i % 8) == 0) (_max * 0.9) else { val _hist = row(4).asInstanceOf[bv.LongHistogram] val rank = 0.9 * _hist.bucketValue(_hist.numBuckets - 1) val ratio = (rank - _hist.bucketValue((i-1) % 8)) / (_hist.bucketValue(i%8) - _hist.bucketValue((i-1) % 8)) _hist.bucketTop((i-1) % 8) + ratio * (_max - _hist.bucketTop((i-1) % 8)) } } <API key>(Array(histRV), Array(expected.toIterator), InstantFunctionId.<API key>, Seq(0.9), histMaxSchema) } it("should return proper schema after applying <API key>") { val <API key> = exec.<API key>(InstantFunctionId.<API key>, Seq(StaticFuncArgs(0.99, rangeParams))) val outSchema = <API key>.schema(histMaxSchema) outSchema.columns.map(_.colType) shouldEqual resultSchema.columns.map(_.colType) } it("should compute histogram_bucket on Histogram RV") { val (data, histRV) = histogramRV(numSamples = 10, infBucket = true) val expected = Seq(1.0, 2.0, 3.0, 4.0, 4.0, 4.0, 4.0, 4.0) <API key>(Array(histRV), Array(expected.toIterator), InstantFunctionId.HistogramBucket, Seq(16.0), histSchema) val infExpected = (1 to 10).map(_.toDouble) <API key>(Array(histRV), Array(infExpected.toIterator), InstantFunctionId.HistogramBucket, Seq(Double.PositiveInfinity), histSchema) // Specifying a nonexistant bucket returns NaN <API key>(Array(histRV), Array(Seq.fill(8)(Double.NaN).toIterator), InstantFunctionId.HistogramBucket, Seq(9.0), histSchema) } it("should test date time functions") { val samples: Array[RangeVector] = Array( new RangeVector { override def key: RangeVectorKey = ignoreKey import filodb.core.query.NoCloseCursor._ override def rows(): RangeVectorCursor = Seq( new TransientRow(1L, 1456790399), // 2016-02-29 23:59:59 February 29th new TransientRow(2L, 1456790400), // 2016-03-01 00:00:00 March 1st new TransientRow(3L, 1230768000), // 2009-01-01 00:00:00 just after leap second new TransientRow(4L, 1230767999), // 2008-12-31 23:59:59 just before leap second. new TransientRow(5L, 1569179748) // 2019-09-22 19:15:48 Sunday ).iterator override def outputRange: Option[RvRange] = None } ) <API key>(samples, Array(List(2.0, 3.0, 1.0, 12.0, 9.0).toIterator), InstantFunctionId.Month) <API key>(samples, Array(List(2016.0, 2016.0, 2009.0, 2008.0, 2019.0).toIterator), InstantFunctionId.Year) <API key>(samples, Array(List(59.0, 0.0, 0.0, 59.0, 15.0).toIterator), InstantFunctionId.Minute) <API key>(samples, Array(List(23.0, 0.0, 0.0, 23.0, 19.0).toIterator), InstantFunctionId.Hour) <API key>(samples, Array(List(29.0, 31.0, 31.0, 31.0, 30.0).toIterator), InstantFunctionId.DaysInMonth) <API key>(samples, Array(List(29.0, 1.0, 1.0, 31.0, 22.0).toIterator), InstantFunctionId.DayOfMonth) <API key>(samples, Array(List(1.0, 2.0, 4.0, 3.0, 0.0).toIterator), InstantFunctionId.DayOfWeek) } it("should handle NaN for date time functions") { val samples: Array[RangeVector] = Array( new RangeVector { override def key: RangeVectorKey = ignoreKey import filodb.core.query.NoCloseCursor._ override def rows(): RangeVectorCursor = Seq( new TransientRow(1L, Double.NaN), new TransientRow(2L, Double.NaN) ).iterator override def outputRange: Option[RvRange] = None } ) <API key>(samples, Array(List(Double.NaN, Double.NaN).toIterator), InstantFunctionId.Month) <API key>(samples, Array(List(Double.NaN, Double.NaN).toIterator), InstantFunctionId.Year) <API key>(samples, Array(List(Double.NaN, Double.NaN).toIterator), InstantFunctionId.Minute) <API key>(samples, Array(List(Double.NaN, Double.NaN).toIterator), InstantFunctionId.Hour) <API key>(samples, Array(List(Double.NaN, Double.NaN).toIterator), InstantFunctionId.DaysInMonth) <API key>(samples, Array(List(Double.NaN, Double.NaN).toIterator), InstantFunctionId.DayOfMonth) <API key>(samples, Array(List(Double.NaN, Double.NaN).toIterator), InstantFunctionId.DayOfWeek) } private def <API key>(samples: Array[RangeVector], expectedVal: Array[Iterator[Double]], instantFunctionId: InstantFunctionId, funcParams: Seq[Double] = Nil, schema: ResultSchema = resultSchema): Unit = { val <API key> = exec.<API key>(instantFunctionId, funcParams.map(x => StaticFuncArgs(x, RangeParams(100, 10, 200)))) val resultObs = <API key>(Observable.fromIterable(samples), querySession, 1000, schema, Nil) val result = resultObs.toListL.runToFuture.futureValue.map(_.rows) expectedVal.zip(result).foreach { case (ex, res) => { ex.zip(res).foreach { case (val1, val2) => { val val2Num = val2.getDouble(1) if (val1.isInfinity) val2Num.isInfinity shouldEqual true else if (val1.isNaN) val2Num.isNaN shouldEqual true else val1 shouldEqual val2Num +- 0.0001 } } // Ensure that locks are released from <API key>. A couple of the tests // don't feed in enough expected data for the iterator to reach the end naturally and // close itself. res.close(); } } } }
-- create-db-security.sql: Security Master -- design has one document -- security and associated identity key -- bitemporal versioning exists at the document level -- each time a document is changed, a new row is written -- with only the end instant being changed on the old row CREATE TABLE sec_schema_version ( version_key VARCHAR(32) NOT NULL, version_value VARCHAR(255) NOT NULL ); INSERT INTO sec_schema_version (version_key, version_value) VALUES ('schema_patch', '51'); CREATE SEQUENCE IF NOT EXISTS sec_security_seq AS bigint START WITH 1000 INCREMENT BY 1 NO CYCLE; CREATE SEQUENCE IF NOT EXISTS sec_idkey_seq AS bigint START WITH 1000 INCREMENT BY 1 NO CYCLE; -- "as bigint" required by Derby/HSQL, not accepted by Postgresql CREATE TABLE sec_security ( id bigint NOT NULL, oid bigint NOT NULL, ver_from_instant timestamp without time zone NOT NULL, ver_to_instant timestamp without time zone NOT NULL, corr_from_instant timestamp without time zone NOT NULL, corr_to_instant timestamp without time zone NOT NULL, name varchar(255) NOT NULL, sec_type varchar(255) NOT NULL, detail_type char NOT NULL, PRIMARY KEY (id), CONSTRAINT sec_fk_sec2sec FOREIGN KEY (oid) REFERENCES sec_security (id), CONSTRAINT <API key> CHECK (ver_from_instant <= ver_to_instant), CONSTRAINT <API key> CHECK (corr_from_instant <= corr_to_instant), CONSTRAINT sec_chk_detail_type CHECK (detail_type IN ('D', 'M', 'R')) ); CREATE INDEX ix_sec_security_oid ON sec_security(oid); CREATE INDEX <API key> ON sec_security(ver_from_instant); CREATE INDEX <API key> ON sec_security(ver_to_instant); CREATE INDEX <API key> ON sec_security(corr_from_instant); CREATE INDEX <API key> ON sec_security(corr_to_instant); CREATE INDEX <API key> ON sec_security(name); CREATE INDEX <API key> ON sec_security(sec_type); CREATE TABLE sec_idkey ( id bigint NOT NULL, key_scheme varchar(255) NOT NULL, key_value varchar(255) NOT NULL, PRIMARY KEY (id), CONSTRAINT sec_chk_idkey UNIQUE (key_scheme, key_value) ); CREATE TABLE sec_security2idkey ( security_id bigint NOT NULL, idkey_id bigint NOT NULL, PRIMARY KEY (security_id, idkey_id), CONSTRAINT sec_fk_secidkey2sec FOREIGN KEY (security_id) REFERENCES sec_security (id), CONSTRAINT <API key> FOREIGN KEY (idkey_id) REFERENCES sec_idkey (id) ); CREATE INDEX <API key> ON sec_security2idkey(idkey_id); -- sec_security_idkey is fully dependent of sec_security -- Hibernate controlled tables CREATE TABLE sec_currency ( id bigint NOT NULL, name varchar(255) NOT NULL UNIQUE, PRIMARY KEY (id) ); CREATE TABLE sec_cashrate ( id bigint NOT NULL, name varchar(255) NOT NULL UNIQUE, PRIMARY KEY (id) ); CREATE TABLE sec_unit ( id bigint NOT NULL, name varchar(255) NOT NULL UNIQUE, PRIMARY KEY (id) ); CREATE TABLE sec_exchange ( id bigint NOT NULL, name varchar(255) NOT NULL UNIQUE, description varchar(255), PRIMARY KEY (id) ); CREATE TABLE sec_gics ( id bigint NOT NULL, name varchar(8) NOT NULL UNIQUE, description varchar(255), PRIMARY KEY (id) ); CREATE TABLE sec_equity ( id bigint NOT NULL, security_id bigint NOT NULL, shortName varchar(255), exchange_id bigint NOT NULL, companyName varchar(255) NOT NULL, currency_id bigint NOT NULL, gicscode_id bigint, PRIMARY KEY (id), CONSTRAINT sec_fk_equity2sec FOREIGN KEY (security_id) REFERENCES sec_security (id), CONSTRAINT <API key> FOREIGN KEY (currency_id) REFERENCES sec_currency(id), CONSTRAINT <API key> FOREIGN KEY (exchange_id) REFERENCES sec_exchange(id), CONSTRAINT sec_fk_equity2gics FOREIGN KEY (gicscode_id) REFERENCES sec_gics(id) ); CREATE INDEX <API key> ON sec_equity(security_id); CREATE TABLE <API key> ( id bigint NOT NULL, security_id bigint NOT NULL, <API key> varchar(32) NOT NULL, option_type varchar(32) NOT NULL, strike double precision NOT NULL, expiry_date timestamp without time zone NOT NULL, expiry_zone varchar(50) NOT NULL, expiry_accuracy smallint NOT NULL, underlying_scheme varchar(255) NOT NULL, <API key> varchar(255) NOT NULL, currency_id bigint NOT NULL, exchange_id bigint, pointValue double precision, PRIMARY KEY (id), CONSTRAINT <API key> FOREIGN KEY (security_id) REFERENCES sec_security (id), CONSTRAINT <API key> FOREIGN KEY (currency_id) REFERENCES sec_currency (id), CONSTRAINT <API key> FOREIGN KEY (exchange_id) REFERENCES sec_exchange (id) ); CREATE TABLE sec_equityoption ( id bigint NOT NULL, security_id bigint NOT NULL, <API key> varchar(32) NOT NULL, option_type varchar(32) NOT NULL, strike double precision NOT NULL, expiry_date timestamp without time zone NOT NULL, expiry_zone varchar(50) NOT NULL, expiry_accuracy smallint NOT NULL, underlying_scheme varchar(255) NOT NULL, <API key> varchar(255) NOT NULL, currency_id bigint NOT NULL, exchange_id bigint, pointValue double precision, PRIMARY KEY (id), CONSTRAINT <API key> FOREIGN KEY (security_id) REFERENCES sec_security (id), CONSTRAINT <API key> FOREIGN KEY (currency_id) REFERENCES sec_currency (id), CONSTRAINT <API key> FOREIGN KEY (exchange_id) REFERENCES sec_exchange (id) ); CREATE INDEX <API key> ON sec_equityoption(security_id); CREATE TABLE <API key> ( id bigint NOT NULL, security_id bigint NOT NULL, <API key> varchar(32) NOT NULL, option_type varchar(32) NOT NULL, strike double precision NOT NULL, expiry_date timestamp without time zone NOT NULL, expiry_zone varchar(50) NOT NULL, expiry_accuracy smallint NOT NULL, underlying_scheme varchar(255) NOT NULL, <API key> varchar(255) NOT NULL, currency_id bigint NOT NULL, exchange_id bigint, pointValue double precision, barrier_type varchar(32) NOT NULL, barrier_direction varchar(32) NOT NULL, barrier_level double precision NOT NULL, monitoring_type varchar(32) NOT NULL, sampling_frequency varchar(32), PRIMARY KEY (id), CONSTRAINT <API key> FOREIGN KEY (security_id) REFERENCES sec_security (id), CONSTRAINT <API key> FOREIGN KEY (currency_id) REFERENCES sec_currency (id), CONSTRAINT <API key> FOREIGN KEY (exchange_id) REFERENCES sec_exchange (id) ); CREATE INDEX <API key> ON <API key>(security_id); CREATE TABLE sec_fxoption ( id bigint NOT NULL, security_id bigint NOT NULL, <API key> varchar(32) NOT NULL, put_amount double precision NOT NULL, call_amount double precision NOT NULL, expiry_date timestamp without time zone NOT NULL, expiry_zone varchar(50) NOT NULL, expiry_accuracy smallint NOT NULL, put_currency_id bigint NOT NULL, call_currency_id bigint NOT NULL, settlement_date timestamp without time zone NOT NULL, settlement_zone varchar(50) NOT NULL, is_long boolean NOT NULL, PRIMARY KEY (id), CONSTRAINT sec_fk_fxoption2sec FOREIGN KEY (security_id) REFERENCES sec_security (id), CONSTRAINT <API key> FOREIGN KEY (put_currency_id) REFERENCES sec_currency (id), CONSTRAINT <API key> FOREIGN KEY (call_currency_id) REFERENCES sec_currency (id) ); CREATE INDEX <API key> ON sec_fxoption(security_id); CREATE TABLE <API key> ( id bigint NOT NULL, security_id bigint NOT NULL, <API key> varchar(32) NOT NULL, put_amount double precision NOT NULL, call_amount double precision NOT NULL, expiry_date timestamp without time zone NOT NULL, expiry_zone varchar(50) NOT NULL, expiry_accuracy smallint NOT NULL, put_currency_id bigint NOT NULL, call_currency_id bigint NOT NULL, settlement_date timestamp without time zone NOT NULL, settlement_zone varchar(50) NOT NULL, is_long boolean NOT NULL, <API key> boolean NOT NULL, PRIMARY KEY (id), CONSTRAINT <API key> FOREIGN KEY (security_id) REFERENCES sec_security (id), CONSTRAINT <API key> FOREIGN KEY (put_currency_id) REFERENCES sec_currency (id), CONSTRAINT <API key> FOREIGN KEY (call_currency_id) REFERENCES sec_currency (id) ); CREATE INDEX <API key> ON <API key>(security_id); CREATE TABLE sec_fxdigitaloption ( id bigint NOT NULL, security_id bigint NOT NULL, put_amount double precision NOT NULL, call_amount double precision NOT NULL, expiry_date timestamp without time zone NOT NULL, expiry_zone varchar(50) NOT NULL, expiry_accuracy smallint NOT NULL, put_currency_id bigint NOT NULL, call_currency_id bigint NOT NULL, payment_currency_id bigint NOT NULL, settlement_date timestamp without time zone NOT NULL, settlement_zone varchar(50) NOT NULL, is_long boolean NOT NULL, PRIMARY KEY (id), CONSTRAINT <API key> FOREIGN KEY (security_id) REFERENCES sec_security (id), CONSTRAINT <API key> FOREIGN KEY (put_currency_id) REFERENCES sec_currency (id), CONSTRAINT <API key> FOREIGN KEY (call_currency_id) REFERENCES sec_currency (id), CONSTRAINT <API key> FOREIGN KEY (payment_currency_id) REFERENCES sec_currency (id) ); CREATE INDEX <API key> ON sec_fxdigitaloption(security_id); CREATE TABLE <API key> ( id bigint NOT NULL, security_id bigint NOT NULL, put_amount double precision NOT NULL, call_amount double precision NOT NULL, expiry_date timestamp without time zone NOT NULL, expiry_zone varchar(50) NOT NULL, expiry_accuracy smallint NOT NULL, put_currency_id bigint NOT NULL, call_currency_id bigint NOT NULL, payment_currency_id bigint NOT NULL, settlement_date timestamp without time zone NOT NULL, settlement_zone varchar(50) NOT NULL, is_long boolean NOT NULL, <API key> boolean NOT NULL, PRIMARY KEY (id), CONSTRAINT <API key> FOREIGN KEY (security_id) REFERENCES sec_security (id), CONSTRAINT <API key> FOREIGN KEY (put_currency_id) REFERENCES sec_currency (id), CONSTRAINT <API key> FOREIGN KEY (call_currency_id) REFERENCES sec_currency (id), CONSTRAINT <API key> FOREIGN KEY (payment_currency_id) REFERENCES sec_currency (id) ); CREATE INDEX <API key> ON <API key>(security_id); CREATE TABLE sec_swaption ( id bigint NOT NULL, security_id bigint NOT NULL, underlying_scheme varchar(255) NOT NULL, <API key> varchar(255) NOT NULL, expiry_date timestamp without time zone NOT NULL, expiry_zone varchar(50) NOT NULL, expiry_accuracy smallint NOT NULL, cash_settled boolean NOT NULL, is_long boolean NOT NULL, is_payer boolean NOT NULL, currency_id bigint NOT NULL, <API key> VARCHAR(32), settlement_date TIMESTAMP, settlement_zone VARCHAR(50), notional double precision, PRIMARY KEY (id), CONSTRAINT <API key> FOREIGN KEY (currency_id) REFERENCES sec_currency(id), CONSTRAINT sec_fk_swaption2sec FOREIGN KEY (security_id) REFERENCES sec_security (id) ); CREATE TABLE sec_irfutureoption ( id bigint NOT NULL, security_id bigint NOT NULL, <API key> varchar(32) NOT NULL, option_type varchar(32) NOT NULL, strike double precision NOT NULL, expiry_date timestamp without time zone NOT NULL, expiry_zone varchar(50) NOT NULL, expiry_accuracy smallint NOT NULL, underlying_scheme varchar(255) NOT NULL, <API key> varchar(255) NOT NULL, currency_id bigint NOT NULL, exchange_id bigint NOT NULL, margined boolean NOT NULL, pointValue double precision NOT NULL, PRIMARY KEY (id), CONSTRAINT <API key> FOREIGN KEY (security_id) REFERENCES sec_security (id), CONSTRAINT <API key> FOREIGN KEY (currency_id) REFERENCES sec_currency (id), CONSTRAINT <API key> FOREIGN KEY (exchange_id) REFERENCES sec_exchange (id) ); CREATE TABLE <API key> ( id bigint NOT NULL, security_id bigint NOT NULL, <API key> varchar(32) NOT NULL, option_type varchar(32) NOT NULL, strike double precision NOT NULL, expiry_date timestamp without time zone NOT NULL, expiry_zone varchar(50) NOT NULL, expiry_accuracy smallint NOT NULL, underlying_scheme varchar(255) NOT NULL, <API key> varchar(255) NOT NULL, currency_id bigint NOT NULL, trading_exchange_id bigint NOT NULL, <API key> bigint NOT NULL, pointValue double precision NOT NULL, PRIMARY KEY (id), CONSTRAINT <API key> FOREIGN KEY (security_id) REFERENCES sec_security (id), CONSTRAINT <API key> FOREIGN KEY (currency_id) REFERENCES sec_currency (id), CONSTRAINT <API key> FOREIGN KEY (trading_exchange_id) REFERENCES sec_exchange (id), CONSTRAINT <API key> FOREIGN KEY (<API key>) REFERENCES sec_exchange (id) ); CREATE TABLE <API key> ( id bigint NOT NULL, security_id bigint NOT NULL, <API key> varchar(32) NOT NULL, option_type varchar(32) NOT NULL, strike double precision NOT NULL, expiry_date timestamp without time zone NOT NULL, expiry_zone varchar(50) NOT NULL, expiry_accuracy smallint NOT NULL, underlying_scheme varchar(255) NOT NULL, <API key> varchar(255) NOT NULL, currency_id bigint NOT NULL, exchange_id bigint NOT NULL, margined boolean NOT NULL, pointValue double precision NOT NULL, PRIMARY KEY (id), CONSTRAINT <API key> FOREIGN KEY (security_id) REFERENCES sec_security (id), CONSTRAINT <API key> FOREIGN KEY (currency_id) REFERENCES sec_currency (id), CONSTRAINT <API key> FOREIGN KEY (exchange_id) REFERENCES sec_exchange (id) ); CREATE INDEX <API key> ON <API key>(security_id); CREATE TABLE sec_fxbarrieroption ( id bigint NOT NULL, security_id bigint NOT NULL, put_amount double precision NOT NULL, call_amount double precision NOT NULL, expiry_date timestamp without time zone NOT NULL, expiry_zone varchar(50) NOT NULL, expiry_accuracy smallint NOT NULL, put_currency_id bigint NOT NULL, call_currency_id bigint NOT NULL, settlement_date timestamp without time zone NOT NULL, settlement_zone varchar(50) NOT NULL, barrier_type varchar(32) NOT NULL, barrier_direction varchar(32) NOT NULL, barrier_level double precision NOT NULL, monitoring_type varchar(32) NOT NULL, sampling_frequency varchar(32), is_long boolean NOT NULL, PRIMARY KEY (id), CONSTRAINT <API key> FOREIGN KEY (security_id) REFERENCES sec_security (id), CONSTRAINT <API key> FOREIGN KEY (put_currency_id) REFERENCES sec_currency (id), CONSTRAINT <API key> FOREIGN KEY (call_currency_id) REFERENCES sec_currency (id) ); CREATE TABLE sec_frequency ( id bigint NOT NULL, name varchar(255) NOT NULL UNIQUE, PRIMARY KEY (id) ); CREATE TABLE sec_daycount ( id bigint NOT NULL, name varchar(255) NOT NULL UNIQUE, PRIMARY KEY (id) ); CREATE TABLE <API key> ( id bigint NOT NULL, name varchar(255) NOT NULL UNIQUE, PRIMARY KEY (id) ); CREATE TABLE sec_issuertype ( id bigint NOT NULL, name varchar(255) NOT NULL UNIQUE, PRIMARY KEY (id) ); CREATE TABLE sec_market ( id bigint NOT NULL, name varchar(255) NOT NULL UNIQUE, PRIMARY KEY (id) ); CREATE TABLE sec_yieldconvention ( id bigint NOT NULL, name varchar(255) NOT NULL UNIQUE, PRIMARY KEY (id) ); CREATE TABLE sec_guaranteetype ( id bigint NOT NULL, name varchar(255) NOT NULL UNIQUE, PRIMARY KEY (id) ); CREATE TABLE sec_coupontype ( id bigint NOT NULL, name varchar(255) NOT NULL UNIQUE, PRIMARY KEY (id) ); CREATE TABLE sec_bond ( id bigint NOT NULL, security_id bigint NOT NULL, bond_type varchar(32) NOT NULL, issuername varchar(255) NOT NULL, issuertype_id bigint NOT NULL, issuerdomicile varchar(255) NOT NULL, market_id bigint NOT NULL, currency_id bigint NOT NULL, yieldconvention_id bigint NOT NULL, guaranteetype_id bigint, maturity_date timestamp without time zone NOT NULL, maturity_zone varchar(50) NOT NULL, maturity_accuracy smallint NOT NULL, coupontype_id bigint NOT NULL, couponrate double precision NOT NULL, couponfrequency_id bigint NOT NULL, <API key> bigint NOT NULL, <API key> bigint, announcement_date timestamp without time zone, announcement_zone varchar(50), <API key> timestamp without time zone NOT NULL, <API key> varchar(50) NOT NULL, settlement_date timestamp without time zone, settlement_zone varchar(50), firstcoupon_date timestamp without time zone NOT NULL, firstcoupon_zone varchar(50) NOT NULL, issuanceprice double precision, totalamountissued double precision NOT NULL, minimumamount double precision NOT NULL, minimumincrement double precision NOT NULL, paramount double precision NOT NULL, redemptionvalue double precision NOT NULL, PRIMARY KEY (id), CONSTRAINT sec_fk_bond2sec FOREIGN KEY (security_id) REFERENCES sec_security (id), CONSTRAINT <API key> FOREIGN KEY (issuertype_id) REFERENCES sec_issuertype (id), CONSTRAINT sec_fk_bond2market FOREIGN KEY (market_id) REFERENCES sec_market (id), CONSTRAINT <API key> FOREIGN KEY (currency_id) REFERENCES sec_currency (id), CONSTRAINT <API key> FOREIGN KEY (yieldconvention_id) REFERENCES sec_yieldconvention (id), CONSTRAINT <API key> FOREIGN KEY (guaranteetype_id) REFERENCES sec_guaranteetype (id), CONSTRAINT <API key> FOREIGN KEY (coupontype_id) REFERENCES sec_coupontype (id), CONSTRAINT <API key> FOREIGN KEY (couponfrequency_id) REFERENCES sec_frequency (id), CONSTRAINT <API key> FOREIGN KEY (<API key>) REFERENCES sec_daycount (id), CONSTRAINT <API key> FOREIGN KEY (<API key>) REFERENCES <API key> (id) ); CREATE INDEX <API key> ON sec_bond(security_id); CREATE TABLE <API key> ( id bigint NOT NULL, name varchar(255) NOT NULL UNIQUE, description varchar(255), PRIMARY KEY (id) ); CREATE TABLE sec_future ( id bigint NOT NULL, security_id bigint NOT NULL, future_type varchar(32) NOT NULL, expiry_date timestamp without time zone NOT NULL, expiry_zone varchar(50) NOT NULL, expiry_accuracy smallint NOT NULL, tradingexchange_id bigint NOT NULL, <API key> bigint NOT NULL, currency1_id bigint, currency2_id bigint, currency3_id bigint, unitname_id bigint, unitnumber double precision, unit_amount double precision, underlying_scheme varchar(255), <API key> varchar(255), <API key> timestamp without time zone, <API key> varchar(50), <API key> timestamp without time zone, <API key> varchar(50), <API key> bigint, -- most of the curren future has no category defined so the column needs to stay nullable PRIMARY KEY (id), CONSTRAINT sec_fk_future2sec FOREIGN KEY (security_id) REFERENCES sec_security (id), CONSTRAINT <API key> FOREIGN KEY (tradingexchange_id) REFERENCES sec_exchange (id), CONSTRAINT <API key> FOREIGN KEY (<API key>) REFERENCES sec_exchange (id), CONSTRAINT <API key> FOREIGN KEY (currency1_id) REFERENCES sec_currency (id), CONSTRAINT <API key> FOREIGN KEY (currency2_id) REFERENCES sec_currency (id), CONSTRAINT <API key> FOREIGN KEY (currency3_id) REFERENCES sec_currency (id), CONSTRAINT sec_fk_future2unit FOREIGN KEY (unitname_id) REFERENCES sec_unit (id), CONSTRAINT <API key> FOREIGN KEY (<API key>) REFERENCES <API key> (id) ); CREATE INDEX <API key> ON sec_future(security_id); CREATE TABLE sec_futurebundle ( id bigint NOT NULL, future_id bigint NOT NULL, startDate timestamp without time zone, endDate timestamp without time zone, conversionFactor double precision NOT NULL, PRIMARY KEY (id), CONSTRAINT <API key> FOREIGN KEY (future_id) REFERENCES sec_future (id) ); CREATE TABLE <API key> ( bundle_id bigint NOT NULL, scheme varchar(255) NOT NULL, identifier varchar(255) NOT NULL, PRIMARY KEY (bundle_id, scheme, identifier), CONSTRAINT <API key> FOREIGN KEY (bundle_id) REFERENCES sec_futurebundle (id) ); CREATE TABLE <API key> ( id bigint NOT NULL, security_id bigint NOT NULL, forward_type varchar(32) NOT NULL, expiry_date timestamp without time zone NOT NULL, expiry_zone varchar(50) NOT NULL, expiry_accuracy smallint NOT NULL, currency_id bigint, unitname_id bigint, unitnumber double precision, unit_amount double precision, underlying_scheme varchar(255), <API key> varchar(255), <API key> bigint NOT NULL, PRIMARY KEY (id), CONSTRAINT <API key> FOREIGN KEY (security_id) REFERENCES sec_security (id), CONSTRAINT <API key> FOREIGN KEY (currency_id) REFERENCES sec_currency (id), CONSTRAINT <API key> FOREIGN KEY (unitname_id) REFERENCES sec_unit (id), CONSTRAINT <API key> FOREIGN KEY (<API key>) REFERENCES <API key> (id) ); CREATE INDEX <API key> ON <API key>(security_id); CREATE TABLE sec_cash ( id bigint NOT NULL, security_id bigint NOT NULL, currency_id bigint NOT NULL, region_scheme varchar(255) NOT NULL, region_identifier varchar(255) NOT NULL, start_date timestamp without time zone NOT NULL, start_zone varchar(50) NOT NULL, maturity_date timestamp without time zone NOT NULL, maturity_zone varchar(50) NOT NULL, daycount_id bigint NOT NULL, rate double precision NOT NULL, amount double precision NOT NULL, PRIMARY KEY (id), CONSTRAINT sec_fk_cash2sec FOREIGN KEY (security_id) REFERENCES sec_security (id), CONSTRAINT <API key> FOREIGN KEY (currency_id) REFERENCES sec_currency (id), CONSTRAINT <API key> FOREIGN KEY (daycount_id) REFERENCES sec_daycount (id) ); CREATE TABLE sec_fra ( id bigint NOT NULL, security_id bigint NOT NULL, currency_id bigint NOT NULL, region_scheme varchar(255) NOT NULL, region_identifier varchar(255) NOT NULL, start_date timestamp without time zone NOT NULL, start_zone varchar(50) NOT NULL, end_date timestamp without time zone NOT NULL, end_zone varchar(50) NOT NULL, rate double precision NOT NULL, amount double precision NOT NULL, underlying_scheme varchar(255) NOT NULL, <API key> varchar(255) NOT NULL, fixing_date timestamp without time zone NOT NULL, fixing_zone varchar(50) NOT NULL, PRIMARY KEY (id), CONSTRAINT sec_fk_fra2sec FOREIGN KEY (security_id) REFERENCES sec_security (id), CONSTRAINT sec_fk_fra2currency FOREIGN KEY (currency_id) REFERENCES sec_currency (id) ); CREATE TABLE sec_swap ( id bigint NOT NULL, security_id bigint NOT NULL, swaptype varchar(32) NOT NULL, trade_date timestamp without time zone NOT NULL, trade_zone varchar(50) NOT NULL, effective_date timestamp without time zone NOT NULL, effective_zone varchar(50) NOT NULL, maturity_date timestamp without time zone NOT NULL, maturity_zone varchar(50) NOT NULL, forwardstart_date timestamp without time zone, forwardstart_zone varchar(50), counterparty varchar(255) NOT NULL, pay_legtype varchar(32) NOT NULL, pay_daycount_id bigint NOT NULL, pay_frequency_id bigint NOT NULL, pay_regionscheme varchar(255) NOT NULL, pay_regionid varchar(255) NOT NULL, <API key> bigint NOT NULL, pay_notionaltype varchar(32) NOT NULL, <API key> bigint, pay_notionalamount double precision, pay_notionalscheme varchar(255), pay_notionalid varchar(255), pay_rate double precision, pay_iseom boolean NOT NULL, pay_spread double precision, <API key> varchar(255), <API key> varchar(255), <API key> varchar(32), pay_settlement_days INTEGER, pay_gearing DOUBLE precision, <API key> bigint, pay_strike double precision, <API key> varchar(32), <API key> varchar(255), <API key> varchar(255), <API key> bigint, <API key> double precision, receive_legtype varchar(32) NOT NULL, receive_daycount_id bigint NOT NULL, <API key> bigint NOT NULL, <API key> varchar(255) NOT NULL, receive_regionid varchar(255) NOT NULL, <API key> bigint NOT NULL, <API key> varchar(32) NOT NULL, <API key> bigint, <API key> double precision, <API key> varchar(255), receive_notionalid varchar(255), receive_rate double precision, receive_iseom boolean NOT NULL, receive_spread double precision, <API key> varchar(255), <API key> varchar(255), <API key> varchar(32), <API key> INTEGER, receive_gearing DOUBLE precision, <API key> bigint, receive_strike double precision, <API key> varchar(32), <API key> varchar(255), <API key> varchar(255), <API key> bigint, <API key> double precision, PRIMARY KEY (id), CONSTRAINT sec_fk_swap2sec FOREIGN KEY (security_id) REFERENCES sec_security (id), CONSTRAINT <API key> FOREIGN KEY (pay_frequency_id) REFERENCES sec_frequency (id), CONSTRAINT <API key> FOREIGN KEY (<API key>) REFERENCES sec_frequency (id), CONSTRAINT <API key> FOREIGN KEY (<API key>) REFERENCES sec_frequency (id), CONSTRAINT <API key> FOREIGN KEY (<API key>) REFERENCES sec_frequency (id), CONSTRAINT <API key> FOREIGN KEY (<API key>) REFERENCES sec_frequency (id), CONSTRAINT <API key> FOREIGN KEY (<API key>) REFERENCES sec_frequency (id) ); CREATE INDEX <API key> ON sec_swap(security_id); CREATE TABLE sec_raw ( security_id bigint NOT NULL, raw_data blob NOT NULL, CONSTRAINT sec_fk_raw2sec FOREIGN KEY (security_id) REFERENCES sec_security (id) ); CREATE TABLE sec_fxforward ( id bigint NOT NULL, security_id bigint NOT NULL, region_scheme varchar(255) NOT NULL, region_identifier varchar(255) NOT NULL, pay_currency_id bigint NOT NULL, receive_currency_id bigint NOT NULL, pay_amount DOUBLE PRECISION NOT NULL, receive_amount DOUBLE PRECISION NOT NULL, forward_date timestamp without time zone NOT NULL, forward_zone varchar(50) NOT NULL, PRIMARY KEY (id), CONSTRAINT <API key> FOREIGN KEY (security_id) REFERENCES sec_security (id), CONSTRAINT <API key> FOREIGN KEY (pay_currency_id) REFERENCES sec_currency (id), CONSTRAINT <API key> FOREIGN KEY (receive_currency_id) REFERENCES sec_currency (id) ); CREATE INDEX <API key> ON sec_fxforward(security_id); CREATE TABLE <API key> ( id bigint NOT NULL, security_id bigint NOT NULL, region_scheme varchar(255) NOT NULL, region_identifier varchar(255) NOT NULL, pay_currency_id bigint NOT NULL, receive_currency_id bigint NOT NULL, pay_amount DOUBLE PRECISION NOT NULL, receive_amount DOUBLE PRECISION NOT NULL, forward_date timestamp without time zone NOT NULL, forward_zone varchar(50) NOT NULL, <API key> boolean NOT NULL, PRIMARY KEY (id), CONSTRAINT <API key> FOREIGN KEY (security_id) REFERENCES sec_security (id), CONSTRAINT <API key> FOREIGN KEY (pay_currency_id) REFERENCES sec_currency (id), CONSTRAINT <API key> FOREIGN KEY (receive_currency_id) REFERENCES sec_currency (id) ); CREATE INDEX <API key> ON <API key>(security_id); CREATE TABLE sec_capfloor ( id bigint NOT NULL, security_id bigint NOT NULL, currency_id bigint NOT NULL, <API key> bigint NOT NULL, frequency_id bigint NOT NULL, is_cap boolean NOT NULL, is_ibor boolean NOT NULL, is_payer boolean NOT NULL, maturity_date timestamp without time zone NOT NULL, maturity_zone varchar(50) NOT NULL, notional double precision NOT NULL, start_date timestamp without time zone NOT NULL, start_zone varchar(50) NOT NULL, strike double precision NOT NULL, underlying_scheme varchar(255) NOT NULL, <API key> varchar(255) NOT NULL, PRIMARY KEY (id), CONSTRAINT sec_fk_capfloor2sec FOREIGN KEY (security_id) REFERENCES sec_security (id), CONSTRAINT <API key> FOREIGN KEY (currency_id) REFERENCES sec_currency(id), CONSTRAINT <API key> FOREIGN KEY (<API key>) REFERENCES sec_daycount (id), CONSTRAINT <API key> FOREIGN KEY (frequency_id) REFERENCES sec_frequency (id) ); CREATE TABLE <API key> ( id bigint NOT NULL, security_id bigint NOT NULL, currency_id bigint NOT NULL, <API key> bigint NOT NULL, frequency_id bigint NOT NULL, is_cap boolean NOT NULL, is_payer boolean NOT NULL, long_scheme varchar(255) NOT NULL, long_identifier varchar(255) NOT NULL, maturity_date timestamp without time zone NOT NULL, maturity_zone varchar(50) NOT NULL, notional double precision NOT NULL, short_scheme varchar(255) NOT NULL, short_identifier varchar(255) NOT NULL, start_date timestamp without time zone NOT NULL, start_zone varchar(50) NOT NULL, strike double precision NOT NULL, PRIMARY KEY (id), CONSTRAINT <API key> FOREIGN KEY (security_id) REFERENCES sec_security (id), CONSTRAINT <API key> FOREIGN KEY (currency_id) REFERENCES sec_currency(id), CONSTRAINT <API key> FOREIGN KEY (<API key>) REFERENCES sec_daycount (id), CONSTRAINT <API key> FOREIGN KEY (frequency_id) REFERENCES sec_frequency (id) ); CREATE TABLE <API key> ( id bigint NOT NULL, security_id bigint NOT NULL, <API key> double precision NOT NULL, currency_id bigint NOT NULL, <API key> timestamp without time zone NOT NULL, <API key> varchar(50) NOT NULL, <API key> timestamp without time zone NOT NULL, <API key> varchar(50) NOT NULL, notional double precision NOT NULL, <API key> bigint NOT NULL, <API key> boolean NOT NULL, region_scheme varchar(255) NOT NULL, region_id varchar(255) NOT NULL, settlement_date timestamp without time zone NOT NULL, settlement_zone varchar(50) NOT NULL, spot_scheme varchar(255) NOT NULL, spot_id varchar(255) NOT NULL, strike double precision NOT NULL, PRIMARY KEY (id), CONSTRAINT <API key> FOREIGN KEY (security_id) REFERENCES sec_security (id), CONSTRAINT <API key> FOREIGN KEY (currency_id) REFERENCES sec_currency(id), CONSTRAINT <API key> FOREIGN KEY (<API key>) REFERENCES sec_frequency (id) ); CREATE SEQUENCE IF NOT EXISTS <API key> start with 1000 increment by 1 no cycle; CREATE TABLE <API key> ( id bigint not null, security_id bigint not null, security_oid bigint not null, attr_key varchar(255) not null, attr_value varchar(255) not null, primary key (id), constraint <API key> foreign key (security_id) references sec_security (id), constraint <API key> unique (security_id, attr_key, attr_value) ); -- security_oid is an optimization -- <API key> is fully dependent of sec_security CREATE INDEX <API key> ON <API key>(security_oid); CREATE INDEX <API key> ON <API key>(attr_key);
define(["Log","FS"],function (Log,FS) {//MODJSL return function showErrorPos(elem, err) { var mesg, src, pos; if (!err) { close(); return; } var row,col; if (err.isTError) { mesg=err.mesg; src=err.src; pos=err.pos; row=err.row+1; col=err.col+1; } else { src={name:function (){return "";},text:function () { return null; }}; pos=0; mesg=err; } function close(){ elem.empty(); } if(typeof pos=="object") {row=pos.row; col=pos.col;} close(); var mesgd=$("<div>").text(mesg+" "+src.name()+(typeof row=="number"?":"+row+":"+col:"")); //mesgd.append($("<button>").text("").click(close)); elem.append(mesgd); elem.append($("<div>").attr("class","quickFix")); console.log("src=",src); var str=src.text(); if (str && typeof pos=="object") { var npos=0; var lines=str.split(/\n/); for (var i=0 ; i<lines.length && i+1<pos.row ; i++) { npos+=lines[i].length; } npos+=pos.col; pos=npos; } var srcd=$("<pre>"); srcd.append($("<span>").text(str.substring(0,pos))); srcd.append($("<img>").attr("src",FS.expandPath("${sampleImg}/ecl.png")));//MODJSL srcd.append($("<span>").text(str.substring(pos))); elem.append(srcd); //elem.attr("title",mesg+" "+src.name()); elem.attr("title",""); var diag=elem.dialog({width:600,height:400}); Log.d("error", mesg+"\nat "+src+":"+err.pos+"\n"+str.substring(0,err.pos)+"##HERE##"+str.substring(err.pos)); return diag; }; });