answer
stringlengths
15
1.25M
# AUTOGENERATED FILE FROM balenalib/etcher-pro-debian:jessie-run ENV NODE_VERSION 14.15.4 ENV YARN_VERSION 1.22.4 RUN buildDeps='curl libatomic1' \ && set -x \ && for key in \ <API key> \ ; do \ gpg --batch --keyserver pgp.mit.edu --recv-keys "$key" || \ gpg --batch --keyserver keyserver.pgp.com --recv-keys "$key" || \ gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key" ; \ done \ && apt-get update && apt-get install -y $buildDeps --<API key> \
// Code generated by go-swagger; DO NOT EDIT. package name_services // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command import ( "context" "net/http" "time" "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" "github.com/go-openapi/strfmt" "github.com/netapp/trident/storage_drivers/ontap/api/rest/models" ) // <API key> creates a new <API key> object, // with the default timeout for this client. // Default values are not hydrated, since defaults are normally applied by the API server side. // To enforce default values in parameter, use SetDefaults or WithDefaults. func <API key>() *<API key> { return &<API key>{ timeout: cr.DefaultTimeout, } } // <API key> creates a new <API key> object // with the ability to set a timeout on a request. func <API key>(timeout time.Duration) *<API key> { return &<API key>{ timeout: timeout, } } // <API key> creates a new <API key> object // with the ability to set a context for a request. func <API key>(ctx context.Context) *<API key> { return &<API key>{ Context: ctx, } } // <API key> creates a new <API key> object // with the ability to set a custom HTTPClient for a request. func <API key>(client *http.Client) *<API key> { return &<API key>{ HTTPClient: client, } } /* <API key> contains all the parameters to send to the API endpoint for the local host modify operation. Typically these are written to a http.Request. */ type <API key> struct { /* Address. The IP address. */ <API key> string /* Info. Info specification */ Info *models.LocalHost /* OwnerUUID. UUID of the owner to which this object belongs. */ <API key> string timeout time.Duration Context context.Context HTTPClient *http.Client } // WithDefaults hydrates default values in the local host modify params (not the query body). // All values with no default are reset to their zero value. func (o *<API key>) WithDefaults() *<API key> { o.SetDefaults() return o } // SetDefaults hydrates default values in the local host modify params (not the query body). // All values with no default are reset to their zero value. func (o *<API key>) SetDefaults() { // no default values defined for this parameter } // WithTimeout adds the timeout to the local host modify params func (o *<API key>) WithTimeout(timeout time.Duration) *<API key> { o.SetTimeout(timeout) return o } // SetTimeout adds the timeout to the local host modify params func (o *<API key>) SetTimeout(timeout time.Duration) { o.timeout = timeout } // WithContext adds the context to the local host modify params func (o *<API key>) WithContext(ctx context.Context) *<API key> { o.SetContext(ctx) return o } // SetContext adds the context to the local host modify params func (o *<API key>) SetContext(ctx context.Context) { o.Context = ctx } // WithHTTPClient adds the HTTPClient to the local host modify params func (o *<API key>) WithHTTPClient(client *http.Client) *<API key> { o.SetHTTPClient(client) return o } // SetHTTPClient adds the HTTPClient to the local host modify params func (o *<API key>) SetHTTPClient(client *http.Client) { o.HTTPClient = client } // <API key> adds the address to the local host modify params func (o *<API key>) <API key>(address string) *<API key> { o.<API key>(address) return o } // <API key> adds the address to the local host modify params func (o *<API key>) <API key>(address string) { o.<API key> = address } // WithInfo adds the info to the local host modify params func (o *<API key>) WithInfo(info *models.LocalHost) *<API key> { o.SetInfo(info) return o } // SetInfo adds the info to the local host modify params func (o *<API key>) SetInfo(info *models.LocalHost) { o.Info = info } // <API key> adds the ownerUUID to the local host modify params func (o *<API key>) <API key>(ownerUUID string) *<API key> { o.<API key>(ownerUUID) return o } // <API key> adds the ownerUuid to the local host modify params func (o *<API key>) <API key>(ownerUUID string) { o.<API key> = ownerUUID } // WriteToRequest writes these params to a swagger request func (o *<API key>) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { if err := r.SetTimeout(o.timeout); err != nil { return err } var res []error // path param address if err := r.SetPathParam("address", o.<API key>); err != nil { return err } if o.Info != nil { if err := r.SetBodyParam(o.Info); err != nil { return err } } // path param owner.uuid if err := r.SetPathParam("owner.uuid", o.<API key>); err != nil { return err } if len(res) > 0 { return errors.<API key>(res...) } return nil }
from parsl.channels import SSHChannel from parsl.providers import SlurmProvider from parsl.launchers import SrunLauncher from parsl.config import Config from parsl.executors.ipp import IPyParallelExecutor from parsl.executors.ipp_controller import Controller # This is an example config, make sure to # replace the specific values below with the literal values # (e.g., 'USERNAME' -> 'your_username') config = Config( executors=[ IPyParallelExecutor( label='comet_ipp_multinode', provider=SlurmProvider( 'debug', channel=SSHChannel( hostname='comet.sdsc.xsede.org', username='USERNAME', # Please replace USERNAME with your username script_dir='/home/USERNAME/parsl_scripts', # Please replace USERNAME with your username ), launcher=SrunLauncher(), scheduler_options='', # Input your scheduler_options if needed worker_init='', # Input your worker_init if needed walltime="00:10:00", init_blocks=1, max_blocks=1, nodes_per_block=2, ), controller=Controller(public_ip='PUBLIC_IP'), # Please replace PUBLIC_IP with your public ip ) ], )
package org.restler.http.security.authentication; public interface <API key> { /** * Returns the last authentication token assigned to the context. * * @return a token */ Object <API key>(); }
<html dir="LTR"> <head> <meta http-equiv="Content-Type" content="text/html; charset=Windows-1252" /> <meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5" /> <title>ILogger.IsEnabledFor Method</title> <xml> </xml> <link rel="stylesheet" type="text/css" href="MSDN.css" /> </head> <body id="bodyID" class="dtBODY"> <div id="nsbanner"> <div id="bannerrow1"> <table class="bannerparthead" cellspacing="0"> <tr id="hdr"> <td class="runninghead">log4net SDK Reference</td> <td class="product"> </td> </tr> </table> </div> <div id="TitleRow"> <h1 class="dtH1">ILogger.IsEnabledFor Method </h1> </div> </div> <div id="nstext"> <p> Checks if this logger is enabled for a given <a href="log4net.Core.Level.html">Level</a> passed as parameter. </p> <div class="syntax"> <span class="lang">[Visual Basic]</span> <br />Function IsEnabledFor( _<br />   ByVal <i>level</i> As <a href="log4net.Core.Level.html">Level</a> _<br />) As <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/<API key>.asp">Boolean</a></div> <div class="syntax"> <span class="lang">[C#]</span> <br /> <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/<API key>.asp">bool</a> IsEnabledFor(<br />   <a href="log4net.Core.Level.html">Level</a> <i>level</i><br />);</div> <h4 class="dtH4">Parameters</h4> <dl> <dt> <i>level</i> </dt> <dd>The level to check.</dd> </dl> <h4 class="dtH4">Return Value</h4> <p> <code>true</code> if this logger is enabled for <code>level</code>, otherwise <code>false</code>. </p> <h4 class="dtH4">Remarks</h4> <p> Test if this logger is going to log events of the specified <i>level</i>. </p> <h4 class="dtH4">See Also</h4><p><a href="log4net.Core.ILogger.html">ILogger Interface</a> | <a href="log4net.Core.html">log4net.Core Namespace</a></p><hr /><div id="footer"><p><a href="http: </body> </html>
export default { "<API key>": "100:", // File lock dialog duration "15_min_duration": "15", // File lock dialog duration "1_day_duration": "1", // File lock dialog duration "1_hour_duration": "1", // File lock dialog duration "1_month_duration": "1" }
/** * <API key>.java * * This file was auto-generated from WSDL * by the Apache Axis 1.4 Mar 02, 2009 (07:08:06 PST) WSDL2Java emitter. */ package com.google.api.ads.dfp.axis.v201602; public class <API key> implements java.io.Serializable { private java.lang.String _value_; private static java.util.HashMap _table_ = new java.util.HashMap(); // Constructor protected <API key>(java.lang.String value) { _value_ = value; _table_.put(_value_,this); } public static final java.lang.String _OPTIONAL = "OPTIONAL"; public static final java.lang.String _AT_LEAST_ONE = "AT_LEAST_ONE"; public static final java.lang.String _ALL = "ALL"; public static final java.lang.String _UNKNOWN = "UNKNOWN"; public static final <API key> OPTIONAL = new <API key>(_OPTIONAL); public static final <API key> AT_LEAST_ONE = new <API key>(_AT_LEAST_ONE); public static final <API key> ALL = new <API key>(_ALL); public static final <API key> UNKNOWN = new <API key>(_UNKNOWN); public java.lang.String getValue() { return _value_;} public static <API key> fromValue(java.lang.String value) throws java.lang.<API key> { <API key> enumeration = (<API key>) _table_.get(value); if (enumeration==null) throw new java.lang.<API key>(); return enumeration; } public static <API key> fromString(java.lang.String value) throws java.lang.<API key> { return fromValue(value); } public boolean equals(java.lang.Object obj) {return (obj == this);} public int hashCode() { return toString().hashCode();} public java.lang.String toString() { return _value_;} public java.lang.Object readResolve() throws java.io.<API key> { return fromValue(_value_);} public static org.apache.axis.encoding.Serializer getSerializer( java.lang.String mechType, java.lang.Class _javaType, javax.xml.namespace.QName _xmlType) { return new org.apache.axis.encoding.ser.EnumSerializer( _javaType, _xmlType); } public static org.apache.axis.encoding.Deserializer getDeserializer( java.lang.String mechType, java.lang.Class _javaType, javax.xml.namespace.QName _xmlType) { return new org.apache.axis.encoding.ser.EnumDeserializer( _javaType, _xmlType); } // Type metadata private static org.apache.axis.description.TypeDesc typeDesc = new org.apache.axis.description.TypeDesc(<API key>.class); static { typeDesc.setXmlType(new javax.xml.namespace.QName("https: } /** * Return type metadata object */ public static org.apache.axis.description.TypeDesc getTypeDesc() { return typeDesc; } }
using Assets.Scripts.Utilities.Health; using Assets.Scripts.Utilities.Mana; namespace Assets.Scripts { class BaseAliveObject : BaseObject { protected BaseHealth Health; public float CurrentHealth { get { return Health.CurrentHealth; } } public bool IsAlive { get { return Health.CurrentHealth > 0; } } public float MaxHealth = 0; protected BaseMana Mana; public float MaxMana; public float CurrentMana { get { return Mana.CurrentMana; } } protected override void Start() { base.Start(); Health = new BaseHealth(MaxHealth); Mana = new BaseMana(MaxMana); } public bool ReceiveDamage(float damage) { Health.Damage(damage); return true; } public bool IncreaseHealth(float health) { Health.Increase(health); return true; } public bool ReduceMana(float mana) { Mana.Reduce(mana); return true; } public bool IncreaseMana(float mana) { Mana.Increase(mana); return true; } } }
package com.<API key>;// TODO change pkg name before uploading import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.util.Log; import android.view.View; import android.widget.Toast; public class Solution extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); findViewById(R.id.btnCoffee).setOnClickListener(new View.OnClickListener() { public void onClick(View v) { Intent intent = new Intent(Solution.this, CoffeeList.class); <API key>(intent, 0); } }); } @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { Log.d("test", "onActivityResult() resultCode:" + resultCode + " data:" + data); if (data != null && data.hasExtra("Order")) Toast.makeText(this, data.getStringExtra("Order") + " ordered.", Toast. LENGTH_LONG).show(); else Toast.makeText(this, "Nothing ordered!", Toast.LENGTH_LONG).show(); } }
package com.blankj.utilcode.util; import android.annotation.SuppressLint; import android.app.Activity; import android.app.Application; import android.os.Bundle; import android.support.annotation.NonNull; import java.util.LinkedList; import java.util.List; public final class Utils { @SuppressLint("StaticFieldLeak") private static Application sApplication; static List<Activity> sActivityList = new LinkedList<>(); @SuppressLint("StaticFieldLeak") static Activity sTopActivity; private static Application.<API key> mCallbacks = new Application.<API key>() { @Override public void onActivityCreated(Activity activity, Bundle bundle) { sActivityList.add(activity); } @Override public void onActivityStarted(Activity activity) { } @Override public void onActivityResumed(Activity activity) { sTopActivity = activity; } @Override public void onActivityPaused(Activity activity) { } @Override public void onActivityStopped(Activity activity) { } @Override public void <API key>(Activity activity, Bundle bundle) { } @Override public void onActivityDestroyed(Activity activity) { sActivityList.remove(activity); } }; private Utils() { throw new <API key>("u can't instantiate me..."); } /** * * * @param app */ public static void init(@NonNull final Application app) { Utils.sApplication = app; app.<API key>(mCallbacks); } /** * Application * * @return Application */ public static Application getApp() { if (sApplication != null) return sApplication; throw new <API key>("u should init first"); } }
using System; using System.Xml.Serialization; namespace Aop.Api.Domain { <summary> <API key> Data Structure. </summary> [Serializable] public class <API key> : AopObject { <summary> </summary> [XmlElement("begin_date")] public string BeginDate { get; set; } <summary> /30 </summary> [XmlElement("end_date")] public string EndDate { get; set; } } }
/* global define, window, setInterval: false */ define(['../TrackingInfo', '../Stopwatch'], function(TrackingInfo, Stopwatch) { 'use strict'; /** * Automatically collects and persists resource timing data * to any registered collectors. This includes anything * downloaded by the site or by the user during his session. * @class Network */ return function Network(persist) { /** * Returns an array any <API key> instances * collected by the web browser during the user's session. * @function Network.getEntries * @returns {Array} An array of <API key> instances * collected by the browser. If the browser does not implement * the HTML5 Performance API, the array will always be empty. */ Network.getEntries = function getEntries() { return timings.concat(); }; var timings = [], lastLength = 0, resourceCounts = {}, perf = window.performance, navStart = Stopwatch.navigationStart, isInvalidTiming = function isInvalid(timing) { return timing.responseEnd < timing.requestStart || timing.responseEnd < timing.startTime; }, getTimingInfo = function getTimingInfo(timing) { return new TrackingInfo({ type: 'network', label: timing.name, start: navStart + timing.startTime, stop: navStart + timing.responseEnd, category: timing.initiatorType, count: resourceCounts[timing.name] = (resourceCounts[timing.name] || 0) + 1, data: { // see https://www.w3.org/TR/resource-timing-2/#<API key> // for more information about the various size properties below size: timing.transferSize, // NOTE: not all browsers provide transferSize encodedSize: timing.encodedBodySize, // NOTE: not all browsers provide encodedBodySize decodedSize: timing.decodedBodySize, // NOTE: not all browsers provide decodedBodySize cachedOrLocal: timing.fetchStart === timing.connectEnd, blockTime: Math.max(0, (timing.requestStart || timing.fetchStart) - timing.startTime), stages: { fetch: { start: navStart + timing.fetchStart, end: navStart + timing.domainLookupStart, duration: timing.domainLookupStart - timing.fetchStart }, dns: { start: navStart + timing.domainLookupStart, end: navStart + timing.domainLookupEnd, duration: timing.domainLookupEnd - timing.domainLookupStart }, tcp: { start: navStart + timing.connectStart, end: navStart + timing.connectEnd, duration: timing.connectEnd - timing.connectStart }, request: { start: navStart + timing.requestStart, end: navStart + timing.responseStart, duration: timing.responseStart - timing.requestStart }, response: { start: navStart + timing.responseStart, end: navStart + timing.responseEnd, duration: timing.responseEnd - timing.responseStart } } } }); }, collectTimings = function <API key>() { /* IE 11/Edge will add resource timing entries before the request has completed. This can seriously throw off our data. We need to ignore these entries somehow until they're complete, without ignoring them on subsequent checks once they've finally finished. Also, keeping these values around could cause entries to be dropped once IE reaches its cached resource limit (around 150 entries) and the "<API key>" event fires. */ var entries = perf.getEntriesByType('resource').slice(lastLength); if (entries.some(isInvalidTiming)) { return; // if any timings are invalid, exit early // NOTE: // this method is invoked every second, so once IE // finally settles down (or the cache limit is // reached), we will eventually send the timings } entries = entries.map(getTimingInfo); entries.forEach(persist); timings = timings.concat(entries); lastLength += entries.length; }; if (!!perf && !!perf.getEntriesByType) { var bufferFull = function bufferFull() { collectTimings(); perf.<API key> && perf.<API key>(); perf.<API key> && perf.<API key>(); lastLength = 0; }; perf.<API key> = perf.<API key> = bufferFull; setInterval(collectTimings, 1000); } return Network; }; });
<!DOCTYPE HTML PUBLIC "- <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (1.8.0_151) on Sun Mar 17 11:03:40 MST 2019 --> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Uses of Interface org.wildfly.swarm.config.undertow.servlet_container.<API key> (BOM: * : All 2.4.0.Final API)</title> <meta name="date" content="2019-03-17"> <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.config.undertow.servlet_container.<API key> (BOM: * : All 2.4.0.Final 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/config/undertow/servlet_container/<API key>.html" title="interface in org.wildfly.swarm.config.undertow.servlet_container">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">Thorntail API, 2.4.0.Final</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/config/undertow/servlet_container/class-use/<API key>.html" target="_top">Frames</a></li> <li><a href="<API key>.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.config.undertow.servlet_container.<API key>" class="title">Uses of Interface<br>org.wildfly.swarm.config.undertow.servlet_container.<API key></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/config/undertow/servlet_container/<API key>.html" title="interface in org.wildfly.swarm.config.undertow.servlet_container"><API key></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.config.undertow">org.wildfly.swarm.config.undertow</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.config.undertow"> </a> <h3>Uses of <a href="../../../../../../../org/wildfly/swarm/config/undertow/servlet_container/<API key>.html" title="interface in org.wildfly.swarm.config.undertow.servlet_container"><API key></a> in <a href="../../../../../../../org/wildfly/swarm/config/undertow/package-summary.html">org.wildfly.swarm.config.undertow</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/config/undertow/package-summary.html">org.wildfly.swarm.config.undertow</a> with parameters of type <a href="../../../../../../../org/wildfly/swarm/config/undertow/servlet_container/<API key>.html" title="interface in org.wildfly.swarm.config.undertow.servlet_container"><API key></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/config/undertow/ServletContainer.html" title="type parameter in ServletContainer">T</a></code></td> <td class="colLast"><span class="typeNameLabel">ServletContainer.</span><code><span class="memberNameLink"><a href="../../../../../../../org/wildfly/swarm/config/undertow/ServletContainer.html#<API key>.wildfly.swarm.config.undertow.servlet_container.<API key>-"><API key></a></span>(<a href="../../../../../../../org/wildfly/swarm/config/undertow/servlet_container/<API key>.html" title="interface in org.wildfly.swarm.config.undertow.servlet_container"><API key></a>&nbsp;supplier)</code> <div class="block">Session persistence sessions</div> </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="../../../../../../../org/wildfly/swarm/config/undertow/servlet_container/<API key>.html" title="interface in org.wildfly.swarm.config.undertow.servlet_container">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">Thorntail API, 2.4.0.Final</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/config/undertow/servlet_container/class-use/<API key>.html" target="_top">Frames</a></li> <li><a href="<API key>.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>
# -*- coding: utf-8 -*- """ Implements a Class for Representing a Simulated Senate Election. """ from collections import Counter from random import random from random import seed as set_seed from time import asctime from time import localtime from aus_senate_audit.senate_election.<API key> import BaseSenateElection class <API key>(BaseSenateElection): """ Implements a class for representing a simulated senate election. :ivar int <API key>: The number of ballots to add to the growing sample during each audit stage. NOTE: The :attr:`_candidates` and :attr:`_candidate_ids` instance attributes are set as a [1, ..., :attr:`_m`]. """ TYPE = 'Simulated' DEFAULT_ID = 'SimulatedElection{}' def __init__(self, seed, n, m, <API key>): """ Initializes a :class:`<API key>` object. The number of seats in a simulated senate election is equal to the floor of the number of candidates in the election divided by two. :param int seed: The starting value for the random number generator. :param int n: The total number of ballots cast in the election. :param int m: The total number of candidates in the election. :param int <API key>: The number of ballots to add to the growing sample during each audit stage. """ super(<API key>, self).__init__() self._n = n self._m = m self._seats = int(self._m / 2) self._candidates = list(range(1, self._m + 1)) self._candidate_ids = list(range(1, self._m + 1)) self._election_id = <API key>.DEFAULT_ID.format(asctime(localtime())) self.<API key> = <API key> set_seed(seed) # Set the initial value of the RNG. def draw_ballots(self): """ Adds simulated ballots to the sample of ballots drawn thus far. These ballots are biased so (1, 2, ..., m) is likely to be the winner. More precisely, each ballot candidate `i` is given a value `i + v * U` where `U = uniform(0, 1)` and `v` is the level of noise. Then the candidates are sorted into increasing order by these values. Note that the total number of ballots drawn may not exceed the total number of cast votes, :attr:`_n`. """ v = self._m / 2.0 # Noise level to control position variance. batch_size = min(self.<API key>, self._n - self._num_ballots_drawn) for _ in range(batch_size): candidate_values = [(i + v * random(), cid) for i, cid in enumerate(self._candidate_ids)] ballot = tuple(cid for val, cid in sorted(candidate_values)) self.add_ballot(ballot, 1) def get_outcome(self, ballot_weights): """ Returns the outcome of a senate election with the given ballot weights. The social choice function used in the simulated senate election is Borda count. :param :class:`Counter` ballot_weights: A mapping from a ballot type to the number of ballots drawn of that type. :returns: The IDs of the candidates elected to the available seats, sorted in lexicographical order. :rtype: tuple """ counter = Counter() for ballot, weight in ballot_weights.items(): for i, cid in enumerate(ballot): counter[cid] += weight * i # Get the :attr:`_seat` candidates with the lowest Borda counts in increasing order. winners = counter.most_common()[-self._seats:][::-1] return tuple(sorted([cid for cid, count in winners]))
package com.fruits.jdkapi.nio.reactor; /** * @author TomHornson@hotmail.com * */ import java.io.IOException; import java.nio.ByteBuffer; import java.nio.channels.SelectionKey; import java.nio.channels.Selector; import java.nio.channels.SocketChannel; import com.fruits.jdkapi.nio.NIOConstants; import com.fruits.jdkapi.nio.multireactor.ResizableByteBuffer; public class SocketIOHandler implements Runnable { private ByteBuffer output = ByteBuffer.wrap("Handshake completed.".getBytes(NIOConstants.CHARSET)); public static final int MAX_INPUT_BUFF = 1024; private final SocketChannel socketChannel; private final SelectionKey selectionKey; private ResizableByteBuffer input = new ResizableByteBuffer(); private ByteBuffer buf = ByteBuffer.allocateDirect(MAX_INPUT_BUFF); public static final int READING = 0, SENDING = 1; private int state = READING; public SocketIOHandler(Selector selector, SocketChannel socketChannel) throws IOException { this.socketChannel = socketChannel; socketChannel.configureBlocking(false); selectionKey = socketChannel.register(selector, 0); selectionKey.attach(this); selectionKey.interestOps(SelectionKey.OP_READ); selector.wakeup(); } private boolean inputCompleted() { ByteBuffer buf = input.getBuffer(); int size = buf.position(); if (size >= 2) { // is there something wrong? char c1 = (char) buf.get(size - 1); char c2 = (char) buf.get(size - 2); if (c1 == '\n' && c2 == '\r') return true; } return false; } private boolean outputCompleted() { return true; } private void process() { } /* * TODO: use ThreadPool. */ public void run() { try { if (state == READING) { read(); } else if (state == SENDING) { send(); } } catch (IOException e) { e.printStackTrace(); close(); } finally { } } void read() throws IOException { buf.clear(); socketChannel.read(buf); input.put(buf); if (inputCompleted()) { process(); state = SENDING; // usually also do first write now selectionKey.interestOps(SelectionKey.OP_WRITE); } } void send() throws IOException { // TODO: may be , there is a bug because of the dispersion of the buffers. socketChannel.write((ByteBuffer) input.getBuffer().flip()); socketChannel.write(output); if (outputCompleted()) { // how to do ending work? close(); } } private void close() { selectionKey.cancel(); try { if ((null != socketChannel) && socketChannel.isOpen()) socketChannel.close(); } catch (IOException e) { e.printStackTrace(); } } }
# AUTOGENERATED FILE FROM balenalib/generic-debian:jessie-run ENV NODE_VERSION 15.10.0 ENV YARN_VERSION 1.22.4 RUN buildDeps='curl libatomic1' \ && set -x \ && for key in \ <API key> \ ; do \ gpg --batch --keyserver pgp.mit.edu --recv-keys "$key" || \ gpg --batch --keyserver keyserver.pgp.com --recv-keys "$key" || \ gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key" ; \ done \ && apt-get update && apt-get install -y $buildDeps --<API key> \
# Azure Virtual Machine Extension for Docker This repository contains source code for the Microsoft Azure Docker Virtual Machine Extension. The source code is meant to be used by Microsoft Azure employees publishing the extension and the source code is open sourced under Apache 2.0 License for reference. You can read the User Guide below. * [Learn more: Azure Virtual Machine Extensions](https://azure.microsoft.com/en-us/documentation/articles/<API key>/) * [How to use: Docker VM Extension](http://azure.microsoft.com/en-us/documentation/articles/<API key>/) Docker VM extension can: - Install latest stable version of Docker Engine on your Linux VM - If provided, configures Docker daemon to listen on specified port, with given certs - If provided, launches the given containers using docker-compose # User Guide ## 1. Configuration schema 1.1. Public configuration keys Schema for the public configuration file for the Docker Extension looks like this: * `docker`: (optional, JSON object) * `port`: (optional, string) the port Docker listens on * `options`: (optional, string array) command line options passed to the Docker engine * `compose`: (optional, JSON object) the compose.yml file to be used, [converted to JSON][yaml-to-json]. If you are considering to embed secrets as environment variables in this section, please see the `"environment"` key described below. A minimal simple configuration would be an empty json object (`{}`) or a more advanced one like this: json { "docker":{ "port": "2376", "options": ["-D", "--dns=8.8.8.8"] }, "compose": { "cache" : { "image" : "memcached", "ports" : ["11211:11211"] }, "blog": { "image": "ghost", "ports": ["80:2368"] } } } > **NOTE:** It is not suggested to specify `"port"` unless you are going to specify `"certs"` configuration (described below) as well. This can open up the Docker engine to public internet without authentication. 1.2. Protected configuration keys Schema for the protected configuration file stores the secrets that are passed to the Docker engine looks like this: * `environment`: (optional, JSON object) Key value pairs to store environment variables to be passed to `docker-compose` securely. By using this, you can avoid embedding secrets in the unencrypted `"compose"` section. * `certs`: (optional, JSON object) * `ca`: (required, string): base64 encoded CA certificate, passed to the engine as `--tlscacert` * `cert`: (required, string): base64 encoded TLS certificate, passed to the engine as `--tlscert` * `key`: (required, string): base64 encoded TLS key, passed to the engine as `--tlskey` * `login`: (optional, JSON object) login credentials to log in to a Docker Registry * `server`: (string, optional) registry server, if not specified, logs in to Docker Hub * `username`: (string, required) * `password`: (string, required) * `email`: (string, required) In order to encode your existing Docker certificates to base64, you can run: $ cat ~/.docker/ca.pem | base64 An advanced configuration that configures TLS for Docker engine and logs in to Docker Hub account would look like this: json { "environment" : { "SECRET_ENV": "<<secret-value>>", "MYSQL_ROOT_<API key> }, "certs": { "ca": "<<base64 encoded ~/docker/ca.pem>>", "cert": "<<base64 encoded ~/docker/cert.pem>>", "key": "<<base64 encoded ~/docker/key.pem>>" }, "login": { "username": "myusername", "password": "mypassword", "email": "name@example.com" } } ## 2. Deploying the Extension to a VM Using [**Azure CLI**][azure-cli]: Once you have a VM created on Azure and configured your `pub.json` and `prot.json` (in section 1.1 and 1.2 above), you can add the Docker Extension to the virtual machine by running: $ azure vm extension set 'yourVMname' DockerExtension Microsoft.Azure.Extensions '1.1' \ --public-config-path pub.json \ --private-config-path prot.json In the command above, you can change version with `'*'` to use latest version available, or `'1.*'` to get newest version that does not introduce non- breaking schema changes. To learn the latest version available, run: $ azure vm extension list You can also omit `--public-config-path` and/or `--private-config-path` if you do not want to configure those settings. ## 3. Using Docker Extension in ARM templates You can provision Docker Extension in [Azure Resource templates](https://azure.microsoft.com/en-us/documentation/articles/<API key>/) by specifying it just like a resource in your template. The configuration keys go to `"settings"` section and (optionally) protected keys go to `"protectedSettings"` section. Example resource definition: json { "type": "Microsoft.Compute/virtualMachines/extensions", "name": "[concat(variables('vmName'), '/DockerExtension'))]", "apiVersion": "2015-05-01-preview", "location": "[parameters('location')]", "dependsOn": [ "[concat('Microsoft.Compute/virtualMachines/', variables('vmName'))]" ], "properties": { "publisher": "Microsoft.Azure.Extensions", "type": "DockerExtension", "typeHandlerVersion": "1.1", "<API key>": true, "settings": {}, "protectedSettings": {} } } You can find various usages of this at the following gallery templates: * https://github.com/Azure/<API key>/blob/master/<API key>/azuredeploy.json * https://github.com/Azure/<API key>/tree/master/<API key> * https://github.com/Azure/<API key>/tree/master/<API key> Supported Linux Distributions - CoreOS - Ubuntu 13 and higher - CentOS 7.1 and higher - Red Hat Enterprise Linux (RHEL) 7.1 and higher Other Linux distributions are currently not supported and extension is expected to fail on unsupported distributions. Debugging After adding the extension, it can usually take a few minutes for the extension to make it to the VM, install docker and do other things. You can see the operation log of the extension at the `/var/log/azure/<<extension version>>/docker-extension.log` file. Changelog # 1.1.1601140348 (2016-01-13) - Fix: eliminate redundant restarts of docker-engine on CoreOS if configuration is not changed. # 1.1.1601070410 (2016-01-06) - Fix: eliminate redundant restarting of docker-engine. This avoids restart of docker-engine service (and thus containers) when (1) VM boots (2) waagent calls extension's enable command in case of GoalState changes such as Load Balancer updates. - Fix: Write .status file before forking into background in 'enable' command. This is a workaround for waagent 2.1.x. # 1.1.1512180541 (2015-12-17) - Security fix: prevent clear-text registry credentials from being logged. # 1.1.1512090359 (2015-12-08) - Introduced secure delivery of secrets through "environment" section of protected configuration to be passed to docker-compose. Users do not have to embed secrets in the "compose" section anymore. # 1.0.1512030601 (2015-12-02) - Added support for CentOS and Red Hat Enterprise Linux (RHEL). # 1.0.1512020618 (2015-12-01) - Bumped docker-compose version from v1.4.1 to v1.5.1. - Added retry logic around installation as a mitigation for a VM scale set issue. # 1.0.1510142311 (2015-10-14) - Configured docker-compose timeout to 15 minutes to prevent big images from failing to be pulled down intermittently due to network conditions. # 1.0.1509171835 (2015-09-18) - Move 'install' stage to 'enable' step so that installation is not killed by 5-minute waagent timeout on slow regions and distros (such as Ubuntu LTS) with many missing dependency packages. - Bump docker-compose to v1.4.0 from v1.3.2. - Extension now uninstalls docker-compose on 'uninstall' stage. # 1.0.1509160543 (2015-09-16) - Workaround for undesirable behavior in WALA: Write .seqnum file to /tmp to prevent multiple simultaneous calls to the extension with the same sequence number. # 1.0.1508121604 (2015-08-12) - Replaced '--daemon' flag with daemon due to breaking behavior introduced in docker-1.8.0 release. # 1.0.1507232004 (2015-07-23) - Updating the apt package name for uninstall step. # 1.0.1507151643 (2015-07-15) - Bump docker-compose to v1.3.2 from v1.2.0. (gh # 1.0.1507110733 (2015-07-11) - Workaround for a bug caused from docker-compose to crash with error 'write /dev/stderr: broken pipe' # 1.0.1507101636 (2015-07-10) - Bug fix (gh#38). Blocking on install step instead of forking and running in background. # 1.0.1507020203 (2015-07-01) - Better docker-compose integration and prevent duplicate container creations between reboots. - Fork and run in background install/enable steps to avoid waagent time limits. # 1.0.1506280321 (2015-06-27) - "certs" that are not base64-encoded are also accepted now. This provides more backwards compatibility with the existing format in the old extension. - Docker certs are now overwritten on every 'enable' run using the extension configuration. - Placed certs server-cert.pem/server-key.pem are renamed to cert.pem/key.pem to be consistent with Docker's nomenclature. The change should be automatically picked up upon reboot. # 1.0.1506141804 (2015-06-14) - Privacy Policy link update # 1.0.1506090235 (2015-06-09) - Bug fix # 1.0.1506041832 (2015-06-04) - Initial release [yaml-to-json]: http://yamltojson.com/ [azure-cli]: https://azure.microsoft.com/en-us/documentation/articles/xplat-cli/
<?php defined('BASEPATH') OR exit('No direct script access allowed'); // sidebar $lang['widgets:available_title'] = 'Widgets disponibles'; $lang['widgets:widget_area_wrapper'] = 'Zones disponibles'; $lang['widgets:instructions'] = 'Glisser-déposer pour installer le widget'; $lang['widgets:instances'] = 'Instances'; $lang['widgets:areas'] = 'Zones'; // Widgets $lang['widgets:widget'] = 'Widget'; $lang['widgets:widget_author'] = 'Auteur'; $lang['widgets:widget_short_name'] = 'Nom court'; $lang['widgets:widget_version'] = 'Version'; $lang['widgets:status_label'] = 'Statut'; $lang['widgets:inactive_title'] = 'Widgets désactivés'; $lang['widgets:active_title'] = 'Widgets activés'; // Widget area titles $lang['widgets:add_area'] = 'Ajouter une zone widget'; $lang['widgets:delete_area'] = 'Supprimer une zone de widget'; $lang['widgets:edit_area'] = 'Editer une zone widget'; // Widget area field names $lang['widgets:widget_area'] = 'Zone'; $lang['widgets:widget_area_title'] = 'Nome de la zone'; $lang['widgets:widget_area_slug'] = 'Nom court'; $lang['widgets:view_code'] = 'Voir le code'; $lang['widgets:instance_title'] = 'Titre'; $lang['widgets:show_title'] = 'Afficher le titre du Widget&nbsp;?'; $lang['widgets:tag_title'] = 'Tag'; $lang['widgets:<API key>'] = 'Il n\'y a aucun widget disponible.';
import {Observable} from '../Observable'; import {Operator} from '../Operator'; import {Subscriber} from '../Subscriber'; import {Subscription} from '../Subscription'; /** * Returns an Observable that emits all items emitted by the source Observable that are distinct by comparison from previous items. * If a comparator function is provided, then it will be called for each item to test for whether or not that value should be emitted. * If a comparator function is not provided, an equality check is used by default. * As the internal HashSet of this operator grows larger and larger, care should be taken in the domain of inputs this operator may see. * An optional paramter is also provided such that an Observable can be provided to queue the internal HashSet to flush the values it holds. * @param {function} [compare] optional comparison function called to test if an item is distinct from previous items in the source. * @param {Observable} [flushes] optional Observable for flushing the internal HashSet of the operator. * @returns {Observable} an Observable that emits items from the source Observable with distinct values. */ export function distinct<T>(compare?: (x: T, y: T) => boolean, flushes?: Observable<any>) { return this.lift(new DistinctOperator(compare, flushes)); } class DistinctOperator<T, R> implements Operator<T, R> { constructor(private compare: (x: T, y: T) => boolean, private flushes: Observable<any>) { } call(subscriber: Subscriber<T>): Subscriber<T> { return new DistinctSubscriber(subscriber, this.compare, this.flushes); } } export class DistinctSubscriber<T> extends Subscriber<T> { private values: any[] = []; private flushSubscription: Subscription; constructor(destination: Subscriber<T>, compare: (x: T, y: T) => boolean, flushes: Observable<any>) { super(destination); if (typeof compare === 'function') { this.compare = compare; } if (flushes) { this.add(this.flushSubscription = flushes.subscribe(new FlushSubscriber(this))); } } flush() { this.values.length = 0; } private compare(x: T, y: T): boolean { return x === y; } protected _next(value: T): void { let found = false; const values = this.values; const len = values.length; try { for (let i = 0; i < len; i++) { if (this.compare(values[i], value)) { found = true; return; } } } catch (err) { this.destination.error(err); return; } this.values.push(value); this.destination.next(value); } protected _complete(): void { super._complete(); } unsubscribe(): void { super.unsubscribe(); } } export class FlushSubscriber extends Subscriber<any> { constructor(private parent: DistinctSubscriber<any>) { super(); } next() { this.parent.flush(); } complete() { // noop } error(err: any) { this.parent.error(err); } }
from cloudman.cloudman.models import <API key>,TopLevelAllocation,<API key> from cloudman.cloudman.models import ProjectAllocation,Project,ProjectMetadata,<API key>,GroupAllocation from cloudman.cloudman.models import <API key> from cloudman.cloudman.commonFunctions import getKSI2K,getPercent,<API key> from settings import * #Will export all the allocation in cloudman starting from top level allocation def <API key>(resolve): # Create the <ALLOCATION> base element global resolvegroup resolvegroup = resolve alloc = {'PROJECT_ALL': []} prjObjList = Project.objects.all() for prObj in prjObjList: project_name = prObj.name project_attr = genProject(project_name) project_attr['<API key>'] = [] for tpAllocNode in <API key>(project_name): project_attr['<API key>'].append(tpAllocNode) alloc['PROJECT_ALL'].append({'PROJECT':project_attr}) return alloc #Will export all the allocation in cloudman starting from top level allocation def <API key>(resolve): # Create the <ALLOCATION> base element global resolvegroup resolvegroup = resolve alloc = {'<API key>': []} #get all <API key> as list top_alloc_node = genTopAlloc() for node in top_alloc_node: alloc['<API key>'].append(node) #add the <API key> to main tree return alloc def <API key>(project_name): node_list = [] tpAllocNameList = ProjectAllocation.objects.filter(project__name = project_name).values_list('<API key>',flat =True).distinct() for tpAllocName in tpAllocNameList: tpAllocList = TopLevelAllocation.objects.filter(name = tpAllocName).select_related(depth=1) for alloc in tpAllocList: tp_alloc_name = alloc.name attribute = {} attribute['NAME'] = tp_alloc_name attribute['GROUP'] = str(alloc.group.name) attribute['KSI2K'] = str(alloc.hepspec * float(KSI2K)) attribute['HS06'] = str(alloc.hepspec) zone_alloc_node = genZoneAlloc(tp_alloc_name) resource_type_node = <API key>(tp_alloc_name) attribute['ZONE_ALLOCATION'] = zone_alloc_node attribute['<API key>'] = resource_type_node attribute['MEMORY'] = str(alloc.memory) attribute['STORAGE'] = str(alloc.storage) attribute['BANDWIDTH'] = str(alloc.bandwidth) proj_alloc_list = genProjAlloc(tp_alloc_name,False) attribute['<API key>'] = proj_alloc_list child = {'<API key>':attribute} node_list.append(child) return node_list #this will create the list of all the <API key> node def genTopAlloc(): node_list = [] tpAllocList = TopLevelAllocation.objects.select_related(depth=1) for alloc in tpAllocList: tp_alloc_name = alloc.name attribute = {} attribute['NAME'] = tp_alloc_name attribute['GROUP'] = str(alloc.group.name) attribute['KSI2K'] = str(getKSI2K(alloc.hepspec)) attribute['HS06'] = str(alloc.hepspec) attribute['MEMORY'] = str(alloc.memory) attribute['STORAGE'] = str(alloc.storage) attribute['BANDWIDTH'] = str(alloc.bandwidth) zone_alloc = genZoneAlloc(tp_alloc_name) attribute['ZONE_ALLOCATION'] = zone_alloc resource_type = <API key>(tp_alloc_name) attribute['<API key>'] = resource_type proj_alloc = genProjAlloc(tp_alloc_name) attribute['<API key>'] = proj_alloc child = {'<API key>':attribute} node_list.append(child) return node_list #this will create all the project_allocation for a given <API key> def genProjAlloc(tp_alloc_name,showprojectinfo=True): alloc_list = ProjectAllocation.objects.filter(<API key> = tp_alloc_name).select_related(depth=1) prj_alloc_list = [] for alloc in alloc_list: alloc_name = alloc.name attribute = {} attribute['NAME'] = alloc_name attribute['GROUP'] = str(alloc.group.name) project_name = alloc.project.name if showprojectinfo: attribute['PROJECT'] = genProject(project_name) attribute['<API key>'] = <API key>(alloc_name) hepspec = alloc.hepspec tp_alloc_hepspec = alloc.<API key>.hepspec hepspec_percent = str(getPercent(hepspec ,tp_alloc_hepspec )) attribute['KSI2K'] = str(getKSI2K(hepspec)) attribute['HS06'] = str(hepspec) attribute['HS06PERCENT'] = str(hepspec_percent) attribute['MEMORY'] = str(alloc.memory) attribute['STORAGE'] = str(alloc.storage) attribute['BANDWIDTH'] = str(alloc.bandwidth) child = {'PROJECT_ALLOCATION':attribute} gp_alloc_list = genGroupAlloc(alloc_name) #get the group_allocation for this project_allocation attribute['<API key>'] = gp_alloc_list prj_alloc_list.append(child) return prj_alloc_list ##will generate the Group allocation for the given project allocation it will return the list of group allocation node def genGroupAlloc(alloc_name,top_group = True): if top_group: grpAllocObj_list = GroupAllocation.objects.filter(<API key> = alloc_name).select_related('group') else: grpAllocObj_list = GroupAllocation.objects.filter(<API key> = alloc_name).select_related('group') grp_alloc_list = [] for alloc in grpAllocObj_list: grpalloc_name = alloc.name hepspec = alloc.hepspec if top_group: parent_hepspec = alloc.project_allocation.hepspec else: parent_hepspec = alloc.<API key>.hepspec attribute ={} attribute['NAME'] = grpalloc_name attribute['GROUP'] = str(alloc.group.name) attribute['KSI2K'] = str(getKSI2K(alloc.hepspec)) attribute['HS06'] = str(alloc.hepspec) attribute['HS06PERCENT'] = str(getPercent(hepspec,parent_hepspec)) attribute['MEMORY'] = str(alloc.memory) attribute['STORAGE'] = str(alloc.storage) attribute['BANDWIDTH'] = str(alloc.bandwidth) attribute['<API key>'] = <API key>(grpalloc_name) attribute['<API key>'] = genGroupAlloc(grpalloc_name,False) child = {'GROUP_ALLOCATION':attribute} grp_alloc_list.append(child) return grp_alloc_list ##will create and return the MetaData child for the given group_allocation def <API key>(gp_alloc_name): node = [] <API key> = <API key>.objects.filter(<API key> = gp_alloc_name) for gpAllocMeta in <API key>: attribute = {} attrname = gpAllocMeta.attribute value = gpAllocMeta.value if attrname.lower() == 'EGROUP'.lower() and resolvegroup.lower() !='no': if resolvegroup.lower() =='yes' or resolvegroup.lower() =='': user_list = <API key>(value) egrp_resolve_attr = {} egrp_resolve_attr['NAME'] = 'USER_LIST_LDAP' egrp_resolve_attr['VALUE'] = user_list egroup_child = {'METADATA':egrp_resolve_attr} node.append(egroup_child) if resolvegroup.lower() =='': attribute['NAME'] = attrname attribute['VALUE'] = value child = {'METADATA':attribute} node.append(child) else: attribute['NAME'] = attrname attribute['VALUE'] = value child = {'METADATA':attribute} node.append(child) return node ##will create and return the MetaData child for the given group_allocation def <API key>(prj_alloc_name): node = [] alloc_list = <API key>.objects.filter(<API key> = prj_alloc_name) for prjAllocMeta in alloc_list: attribute = {} attribute['NAME'] = str(prjAllocMeta.attribute) attribute['VALUE'] = str(prjAllocMeta.value) child = {'METADATA':attribute} node.append(child) return node this will generate the project information def genProject(project_name): projectInfo = Project.objects.get(name__iexact = project_name) description = projectInfo.description admin_group = projectInfo.admin_group attribute = {} attribute['NAME'] = project_name attribute['DESCRIPTION'] = description attribute['ADMINGROUP'] = admin_group attribute['PROJECT_METADATA'] = genProjectMetaData(project_name) return attribute ##will create and return the MetaData for the given project def genProjectMetaData(project_name): prj_metadatalist = [] metadata_list = ProjectMetadata.objects.filter(project__name = project_name) for metadata in metadata_list: attribute = {} attribute['NAME'] = str(metadata.attribute) attribute['VALUE'] = str(metadata.value) child = {'METADATA':attribute} prj_metadatalist.append(child) return prj_metadatalist #this will create all allowed resource type for this <API key> def <API key>(tp_alloc_name): node = [] <API key> = <API key>.objects.filter(<API key> = tp_alloc_name).order_by('resource_type__name') for oneRow in <API key>: attribute = {} attribute['NAME'] = str(oneRow.resource_type.name) attribute['ZONE'] = str(oneRow.zone.name) attribute['CLASS'] = str(oneRow.resource_type.resource_class ) attribute['HS06'] = str(oneRow.resource_type.hepspecs ) attribute['MEMORY'] = str(oneRow.resource_type.memory ) attribute['STORAGE'] = str(oneRow.resource_type.storage ) attribute['BANDWIDTH'] = str(oneRow.resource_type.bandwidth ) attribute['REGION'] = str(oneRow.zone.region.name) child = {'RESOURCE_TYPE':attribute} node.append(child) return node # this will create the list of all the zone allocation for the <API key> def genZoneAlloc(tp_alloc_name): node = [] allocZonesInfo = <API key>.objects.filter(<API key> = tp_alloc_name).order_by('zone__name') for oneZone in allocZonesInfo: attribute = {} attribute['NAME'] = str(oneZone.zone.name) hs06 = oneZone.hepspec attribute['HS06'] = str(hs06) attribute['KSI2K'] = str(getKSI2K(hs06)) attribute['MEMORY'] = str(oneZone.memory) attribute['STORAGE'] = str(oneZone.storage) attribute['BANDWIDTH'] = str(oneZone.bandwidth) attribute['REGION'] = str(oneZone.zone.region.name) child = {'ZONE':attribute} node.append(child) return node
package com.store.catalog.model; import com.store.catalog.common.exception.CheckException; import org.apache.commons.lang3.builder.EqualsBuilder; import org.apache.commons.lang3.builder.HashCodeBuilder; import org.apache.commons.lang3.builder.ToStringBuilder; public final class Customer implements AbstractBean { public static final String INVALID_PASSWORD = "Invalid password"; public static final String PASSWORD_DONT_MATCH = "Invalid password"; private static final long serialVersionUID = <API key>; // = Attributes = private Long id; private String firstname; private String password; private String lastname; private String telephone; private String email; // = Constructors = public Customer() { } public Customer(final Long id, final String firstname, final String lastname) { setId(id); setFirstname(firstname); setLastname(lastname); } // = Getters and Setters = public Long getId() { return id; } public void setId(final Long id) { this.id = id; } public String getFirstname() { return firstname; } public void setFirstname(final String firstname) { this.firstname = firstname; } public String getLastname() { return lastname; } public void setLastname(final String lastname) { this.lastname = lastname; } public String getPassword() { return password; } public void setPassword(final String password) { this.password = password; } public String getTelephone() { return telephone; } public void setTelephone(final String telephone) { this.telephone = telephone; } public String getEmail() { return email; } public void setEmail(final String email) { this.email = email; } // = Business methods = /** * Given a password, this method throws an exception if the @param * is null or empty. Then it checks if the @param matches the customer.password * * @param password1 * @throws CheckException thrown if the password is null, empty or different than the one * store in database */ public void matchPassword(final String password1) throws CheckException { throw new RuntimeException("not yet implemented"); } public String toString() { return ToStringBuilder.reflectionToString(this); } public boolean equals(Object obj) { return EqualsBuilder.reflectionEquals(this, obj); } public int hashCode(Object obj) { return new HashCodeBuilder() .append(id) .append(firstname) .append(lastname) .append(password) .append(telephone) .append(email) .hashCode(); } }
author: "Y. Yang and M. Maheswaran" title: "Heuristics for Resource Provisioning in Computing Utilities Using Dedicated and Non-Dedicated Resources" journal: "1st Workshop on Dynamic Provisioning and Resource Management" location: "(held in conjunction with International Conference on High Performance Computing) (CD-Rom Proceedings), Bangalore, India" date: 2004-12-01
Test Document Generator/Permutator for Apache OpenOffice === OpenOffice contains a word processor (Writer), a spreadsheet (Calc), a presentation application (Impress), a drawing application (Draw), a formula editor (Math), and a database management application (Base). OpenOffice's default file format is the OpenDocument Format (ODF), an ISO/IEC standard, which originated with OpenOffice.org. It can also read a wide variety of other file formats, with particular attention to those from Microsoft Office. Apache OpenOffice is developed for Linux, OS X and Windows, with ports to other operating systems. It is distributed under the Apache License. A continuing challenge in testing software is an efficient way to generate test cases, in particularly in case of Apache Open Office, generating test cases like various text styles, border styles, alignment etc... A complete test would require creation of large number of test case manually. This project indents to generate all possible test cases or documents using open source libraries in java like Apache ODF Toolkit and Apache POI. Here the goal is to produce a software that is able to permutated all possible combinations of test cases with minimum head ache to the tester, but he should be able to design the test case generated. The software is indented to produce a subset of X*Y*Z sets of test case.
<?php use DTS\eBaySDK\Trading\Types\<API key>; class <API key> extends \<API key> { private $obj; protected function setUp() { $this->obj = new <API key>(); } public function testCanBeCreated() { $this->assertInstanceOf('\DTS\eBaySDK\Trading\Types\<API key>', $this->obj); } public function <API key>() { $this->assertInstanceOf('\DTS\eBaySDK\Trading\Types\AbstractRequestType', $this->obj); } }
package com.hwh.dao.impl; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.orm.hibernate4.HibernateTemplate; import org.springframework.stereotype.Component; import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Transactional; import com.hwh.dao.ManagerDAO; import com.hwh.model.Manager; import com.hwh.model.Purview; @Component public class ManagerDAOImpl implements ManagerDAO { @Autowired private HibernateTemplate hibernateTemplate; @Override public Manager getManager(Manager manager) { String hql= "from com.hwh.model.Manager mng where mng.name='"+manager.getName() +"' and mng.password='"+manager.getPassword()+"'"; List<Manager> mngs=(List<Manager>) this.hibernateTemplate.find(hql); if(mngs.size()==0) return null; return mngs.get(0); } @Override public Manager getManagerByID(int id) { String hql= "from com.hwh.model.Manager mng where mng.id="+id; List<Manager> mngs=(List<Manager>) this.hibernateTemplate.find(hql); if(mngs.size()==0) return null; return mngs.get(0); } @Override @Transactional public List<Manager> managerQuery() { List<Manager> mngs=(List<Manager>) this.hibernateTemplate.find("from com.hwh.model.Manager"); return mngs; } @Override @Transactional public void managerDel(int id) { Manager mng=this.getManagerByID(id); this.hibernateTemplate.delete(mng); } @Override @Transactional public void managerAdd(Manager manager) { this.hibernateTemplate.save(manager); Purview purview = new Purview(); purview.setId(manager.getId()); this.hibernateTemplate.save(purview); } @Override @Transactional public void managerAlter(Manager manager) { this.hibernateTemplate.update(manager); } }
#!/bin/bash set -e rm -rf bazel-bin/tools read -ra BAZEL_BUILD_OPTIONS <<< "${BAZEL_BUILD_OPTIONS:-}" BAZEL_BUILD_OPTIONS+=("--<API key>=all") TOOLS="$(dirname "$(dirname "$(realpath "$0")")")" # to satisfy dependency on run_command export PYTHONPATH="$TOOLS" # protoxform fix test cases PROTO_TARGETS=() protos=$(bazel query "labels(srcs, labels(deps, //tools/testdata/protoxform:fix_protos))") while read -r line; do PROTO_TARGETS+=("$line"); done \ "$protos" bazel build "${BAZEL_BUILD_OPTIONS[@]}" --//tools/api_proto_plugin:<API key>=//tools/testdata/protoxform:fix_protos \ //tools/testdata/protoxform:fix_protos --aspects //tools/protoxform:protoxform.bzl%protoxform_aspect --output_groups=proto bazel build "${BAZEL_BUILD_OPTIONS[@]}" //tools/protoxform:protoprint ./tools/protoxform/<API key>.py fix "${PROTO_TARGETS[@]}" # protoxform freeze test cases PROTO_TARGETS=() protos=$(bazel query "labels(srcs, labels(deps, //tools/testdata/protoxform:freeze_protos))") while read -r line; do PROTO_TARGETS+=("$line"); done \ "$protos" bazel build "${BAZEL_BUILD_OPTIONS[@]}" --//tools/api_proto_plugin:<API key>=//tools/testdata/protoxform:freeze_protos \ --//tools/api_proto_plugin:extra_args=freeze \ //tools/testdata/protoxform:freeze_protos --aspects //tools/protoxform:protoxform.bzl%protoxform_aspect --output_groups=proto bazel build "${BAZEL_BUILD_OPTIONS[@]}" //tools/protoxform:protoprint ./tools/protoxform/<API key>.py freeze "${PROTO_TARGETS[@]}"
package com.report.web.admin.filter; import java.io.IOException; import java.io.PrintWriter; import java.util.HashMap; import java.util.Map; import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; import org.apache.shiro.SecurityUtils; import org.apache.shiro.subject.Subject; import org.apache.shiro.web.filter.AccessControlFilter; import org.apache.shiro.web.util.WebUtils; import com.alibaba.fastjson.JSON; import com.report.common.dal.common.enums.<API key>; import com.report.common.dal.common.exception.ReportException; import com.report.common.model.SessionUtil; import com.report.web.admin.shiro.ShiroFilterUtils; import lombok.extern.slf4j.Slf4j; /** * * * @author lishun * @since 2017330 11:43:30 */ @Slf4j public class SimpleAuthFilter extends AccessControlFilter { @Override protected boolean isAccessAllowed(ServletRequest request, ServletResponse response, Object mappedValue) throws ReportException { try { String accNo = null == SessionUtil.getUserInfo() ? null : SessionUtil.getUserInfo().getMember().getAccNo(); log.debug("username[{}] mappedValue[{}] SimpleAuthFilter isAccessAllowed ", accNo, mappedValue); Map<String, String> resultMap = new HashMap<String, String>(); if (!SecurityUtils.getSubject().isAuthenticated()) { // Ajax if (ShiroFilterUtils.isAjax(request)) { log.debug(",Ajax"); resultMap.put("user_status", "300"); resultMap.put("message", ""); out(response, resultMap); } log.debug("username[{}] SimpleAuthFilter isAccessAllowed false", accNo); return Boolean.FALSE; } log.debug("username[{}] SimpleAuthFilter isAccessAllowed true", accNo); } catch (Exception e) { log.error("SimpleAuthFilter isAccessAllowed Exception", e); throw new ReportException(<API key>.SYSTEM_EXCEPTION); } return Boolean.TRUE; } @Override protected boolean onAccessDenied(ServletRequest request, ServletResponse response) throws Exception { log.debug("username[{}] SimpleAuthFilter denied,,"); Subject subject = SecurityUtils.getSubject(); subject.logout(); /** * Request,Request,. * URL,/admin/index.html,.,/admin/ * index.html, * /user/login.shtml?redirectUrl=/admin/index.html. * shiro.<code>WebUtils.getSavedRequest(request);</code> * {@link UserLoginController.submitLogin(...)} * <code>String url = WebUtils.getSavedRequest(request).getRequestUrl();</code> */ WebUtils.saveRequest(request); WebUtils.issueRedirect(request, response, "/toLogin.htm"); return false; } private void out(ServletResponse hresponse, Map<String, String> resultMap) throws IOException { hresponse.<API key>("UTF-8"); PrintWriter out = hresponse.getWriter(); out.println(JSON.toJSONString(resultMap)); out.flush(); out.close(); } }
package com.ibm.janusgraph.utils.generator.bean; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; public class EdgeMapBean { public Map<String, Object> maps = new HashMap<>(); public EdgeMapBean(String labelName){ this.maps.put("[EdgeLabel]", labelName); // Map<String, String> subMap = new HashMap<>(); // Map<String, String> subMap2 = new HashMap<>(); // subMap.put("Left", labelName + ".node_id"); // this.maps.put("[edge_left]", subMap); // subMap2.put("Right", labelName + ".node_id"); // this.maps.put("[edge_right]", subMap2); } }
import java.util.*; import java.util.regex.*; import java.text.*; import java.math.*; import java.awt.geom.*; import static java.lang.Math.*; import static java.util.Arrays.*; public class StreetWalking { public long minTime(int XX, int YY, int walkTime, int sneakTime) { long X = (long) XX; long Y = (long) YY; if (X == Y && X == 0L) return 0L; if (X > Y) { long tmp = X; X = Y; Y = tmp; } //manhatthan if (2 * walkTime < sneakTime) { return walkTime * (X + Y); } //diagonal + walk if (sneakTime > walkTime) { return X * sneakTime + (Y - X) * walkTime; } //parity for whole sneaks if ((X + Y) % 2L == 0L) { return Y * sneakTime; } else { return (long) (Y - 1) * sneakTime + walkTime; } } } //Powered by [KawigiEdit] 2.0!
using System.Data.Entity; using System.Data.Entity.ModelConfiguration.Conventions; using startupconnector.Models; namespace startupconnector.DAL { public class StartupConnectorDB : DbContext { public StartupConnectorDB() : base("StartupConnectorDB") { } public DbSet<StartupCard> StartupCards { get; set; } protected override void OnModelCreating(DbModelBuilder modelBuilder) { modelBuilder.Conventions.Remove<<API key>>(); } } }
layout: post title: SVN in Practice date: 2018-11-27 09:14:43 +0800 categories: [Devops] tags: [devops, in-practice, sh] published: true excerpt: SVN # svncommitis scheduled for addition, but is missing SVN/"add" SVN "missing" revert all $ svn info * any list {:toc}
<!DOCTYPE html> <html xmlns="http: <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <link rel="SHORTCUT ICON" href="../../../../../img/clover.ico" /> <link rel="stylesheet" href="../../../../../aui/css/aui.min.css" media="all"/> <link rel="stylesheet" href="../../../../../aui/css/aui-experimental.min.css" media="all"/> <!--[if IE 9]><link rel="stylesheet" href="../../../../../aui/css/aui-ie9.min.css" media="all"/><![endif]--> <style type="text/css" media="all"> @import url('../../../../../style.css'); @import url('../../../../../tree.css'); </style> <script src="../../../../../jquery-1.8.3.min.js" type="text/javascript"></script> <script src="../../../../../aui/js/aui.min.js" type="text/javascript"></script> <script src="../../../../../aui/js/aui-experimental.min.js" type="text/javascript"></script> <script src="../../../../../aui/js/aui-soy.min.js" type="text/javascript"></script> <script src="../../../../../package-nodes-tree.js" type="text/javascript"></script> <script src="../../../../../clover-tree.js" type="text/javascript"></script> <script src="../../../../../clover.js" type="text/javascript"></script> <script src="../../../../../clover-descriptions.js" type="text/javascript"></script> <script src="../../../../../cloud.js" type="text/javascript"></script> <title>ABA Route Transit Number Validator 1.0.1-SNAPSHOT</title> </head> <body> <div id="page"> <header id="header" role="banner"> <nav class="aui-header <API key>" role="navigation"> <div class="aui-header-inner"> <div class="aui-header-primary"> <h1 id="logo" class="aui-header-logo <API key>"> <a href="http://openclover.org" title="Visit OpenClover home page"><span class="<API key>">OpenClover</span></a> </h1> </div> <div class="<API key>"> <ul class="aui-nav"> <li id="system-help-menu"> <a class="aui-nav-link" title="Open online documentation" target="_blank" href="http://openclover.org/documentation"> <span class="aui-icon aui-icon-small aui-iconfont-help">&#160;Help</span> </a> </li> </ul> </div> </div> </nav> </header> <div class="aui-page-panel"> <div class="<API key>"> <div class="aui-page-panel-nav <API key>"> <div class="<API key>" style="margin-bottom: 20px;"> <div class="<API key>"> <a href="http://cardatechnologies.com" target="_top"> <div class="aui-avatar aui-avatar-large aui-avatar-project"> <div class="aui-avatar-inner"> <img src="../../../../../img/clover_logo_large.png" alt="Clover icon"/> </div> </div> </a> </div> <div class="<API key>" > <h1> <a href="http://cardatechnologies.com" target="_top"> ABA Route Transit Number Validator 1.0.1-SNAPSHOT </a> </h1> </div> </div> <nav class="aui-navgroup <API key>"> <div class="aui-navgroup-inner"> <ul class="aui-nav"> <li class=""> <a href="../../../../../dashboard.html">Project overview</a> </li> </ul> <div class="aui-nav-heading <API key>"> <strong>Packages</strong> </div> <div class="aui-nav project-packages"> <form method="get" action="#" class="aui <API key>"> <input type="text" autocomplete="off" class="package-filter text" placeholder="Type to filter packages..." name="package-filter" id="package-filter" title="Start typing package name (or part of the name) to search through the tree. Use arrow keys and the Enter key to navigate."/> </form> <p class="<API key> hidden"> <small>No results found.</small> </p> <div class="<API key>" data-root-relative="../../../../../" data-package-name="com.cardatechnologies.utils.validators.abaroutevalidator"> <div class="<API key>"></div> <div class="<API key>"></div> </div> </div> </div> </nav> </div> <section class="<API key>"> <div class="<API key>"> <div class="<API key>"><ol class="aui-nav aui-nav-breadcrumbs"> <li><a href="../../../../../dashboard.html"> Project Clover database Sat Aug 7 2021 12:29:33 MDT</a></li> <li><a href="test-pkg-summary.html">Package com.cardatechnologies.utils.validators.abaroutevalidator</a></li> <li><a href="<API key>.html">Class <API key></a></li> </ol></div> <h1 class="aui-h2-clover"> Test <API key> </h1> <table class="aui"> <thead> <tr> <th>Test</th> <th><label title="The test result. Either a Pass, Fail or Error.">Status</label></th> <th><label title="When the test execution was started">Start time</label></th> <th><label title="The total time in seconds taken to run this test.">Time (seconds)</label></th> <th><label title="A failure or error message if the test is not successful.">Message</label></th> </tr> </thead> <tbody> <tr> <td> <a href="../../../../../com/cardatechnologies/utils/validators/abaroutevalidator/<API key>.html?line=3160#src-3160" ><API key></a> </td> <td> <span class="sortValue">1</span><span class="aui-lozenge aui-lozenge-success">PASS</span> </td> <td> 7 Aug 12:38:28 </td> <td> 0.0 </td> <td> <div></div> <div class="errorMessage"></div> </td> </tr> </tbody> </table> <div>&#160;</div> <table class="aui aui-table-sortable"> <thead> <tr> <th style="white-space:nowrap;"><label title="A class that was directly hit by this test.">Target Class</label></th> <th colspan="4"><label title="The percentage of coverage contributed by each single test.">Coverage contributed by</label> <API key></th> </tr> </thead> <tbody> <tr> <td> <span class="sortValue">com.cardatechnologies.utils.validators.abaroutevalidator.AbaRouteValidator</span> &#160;&#160;<a href="../../../../../com/cardatechnologies/utils/validators/abaroutevalidator/AbaRouteValidator.html?id=9334#AbaRouteValidator" title="AbaRouteValidator" name="sl-47">com.cardatechnologies.utils.validators.abaroutevalidator.AbaRouteValidator</a> </td> <td> <span class="sortValue">0.7352941</span>73.5% </td> <td class="align-middle" style="width: 100%" colspan="3"> <div> <div title="73.5% Covered" style="min-width:40px;" class="barNegative contribBarNegative contribBarNegative"><div class="barPositive contribBarPositive contribBarPositive" style="width:73.5%"></div></div></div> </td> </tr> </tbody> </table> </div> <!-- class="<API key>" --> <footer id="footer" role="contentinfo"> <section class="footer-body"> <ul> <li> Report generated by <a target="_new" href="http://openclover.org">OpenClover</a> v 4.4.1 on Sat Aug 7 2021 12:49:26 MDT using coverage data from Sat Aug 7 2021 12:47:23 MDT. </li> </ul> <ul> <li>OpenClover is free and open-source software. </li> </ul> </section> </footer> </section> <!-- class="<API key>" --> </div> <!-- class="<API key>" --> </div> <!-- class="aui-page-panel" --> </div> <!-- id="page" --> </body> </html>
<!DOCTYPE HTML PUBLIC "- <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (1.8.0_60-ea) on Mon Jun 27 14:13:42 EDT 2016 --> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Uses of Interface org.wildfly.swarm.config.jca.<API key> (WildFly Swarm: Public javadocs 1.0.0.Final API)</title> <meta name="date" content="2016-06-27"> <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.config.jca.<API key> (WildFly Swarm: Public javadocs 1.0.0.Final 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/config/jca/<API key>.html" title="interface in org.wildfly.swarm.config.jca">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, 1.0.0.Final</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/config/jca/class-use/<API key>.html" target="_top">Frames</a></li> <li><a href="<API key>.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.config.jca.<API key>" class="title">Uses of Interface<br>org.wildfly.swarm.config.jca.<API key></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/config/jca/<API key>.html" title="interface in org.wildfly.swarm.config.jca"><API key></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.config">org.wildfly.swarm.config</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.config"> </a> <h3>Uses of <a href="../../../../../../org/wildfly/swarm/config/jca/<API key>.html" title="interface in org.wildfly.swarm.config.jca"><API key></a> in <a href="../../../../../../org/wildfly/swarm/config/package-summary.html">org.wildfly.swarm.config</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/config/package-summary.html">org.wildfly.swarm.config</a> with parameters of type <a href="../../../../../../org/wildfly/swarm/config/jca/<API key>.html" title="interface in org.wildfly.swarm.config.jca"><API key></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/config/JCA.html" title="type parameter in JCA">T</a></code></td> <td class="colLast"><span class="typeNameLabel">JCA.</span><code><span class="memberNameLink"><a href="../../../../../../org/wildfly/swarm/config/JCA.html#<API key>.wildfly.swarm.config.jca.<API key>-">archiveValidation</a></span>(<a href="../../../../../../org/wildfly/swarm/config/jca/<API key>.html" title="interface in org.wildfly.swarm.config.jca"><API key></a>&nbsp;supplier)</code> <div class="block">Archive validation for resource adapters</div> </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="../../../../../../org/wildfly/swarm/config/jca/<API key>.html" title="interface in org.wildfly.swarm.config.jca">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, 1.0.0.Final</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/config/jca/class-use/<API key>.html" target="_top">Frames</a></li> <li><a href="<API key>.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>
.label-field-pair label { color:#444444; display:block; float:left; font-size:14px; font-weight:600; margin:0 100px 10px; padding-top:10px; width:250px; }
## Overview twoscreen is an Android example app that lets you load images on your phone and display them on a second screen (TV) using the Android Presentation API. This is how Chromecast enabled apps work. The Presentation API lets your app control every aspect of the remote display independently from the Android device display. In twoscreen you can navigate between the image grid and the image pager selecting images and only the selected image appears on the TV. This is my first Android app. The goal was to show photos from my Android phone on the large screen of my TV. I took several Android code samples and worked them into a simple app. Think GridView + Pager + Glide + Presentation --> TV screen Screenshots ![Grid View](screenshots/gridview-500.png) ![Pager View](screenshots/pager-500.png) ![Casting to TV](screenshots/twoscreen-tv-500.jpg) Using the App 1. Get the code: `git clone https://github.com/debun8/twoscreen.git` 2. Import into Android Studio 3. Build and run on your Android device 4. Start the mirroring session on your Android device. Assuming you have a Chromecast do the following: - For a Google device (EG Nexus 5x) go to System Settings and Cast Screen - For other devices (EG Samsung Galaxy 5) run the Android Chromecast app - In either case pick your Chromecast device and connect to it. That starts mirroring. 5. Once the device is connected, if twoscreen is active the image you see on your Android device will appear on the TV. 6. If mirroring stops working for any reason, just disconnect and reconnect. Comments on the Project - **Note on Mirroring** - Mirroring is known by different names on various devices, usually some variant of screen mirroring. I got the Presentation working with Chromecast, Roku 3 and Amazon TV. Chromecast worked the best by far and was better integrated into my two devices. - **About Glide** - [Glide](https://github.com/bumptech/glide) is an image loading and caching library that handles everything related to downloading and displaying images efficiently with minimal programming effort. It handles downloading, decoding, resampling, caching on disk and in memory, transforming, drawing into a view and behind the scenes cache management, plus more... Glide works really well and is pretty straightforward once you get the hang of it. Developed By [Dave Allen](https://github.com/debun8) Credits - Photos - Romain Guy. http: License Apache 2.0 See the LICENSE file for details
<!DOCTYPE HTML PUBLIC "- <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (version 1.7.0_75) on Wed Jun 10 23:20:35 IST 2015 --> <meta http-equiv="Content-Type" content="text/html" charset="utf-8"> <title>Uses of Class org.apache.solr.cloud.Overseer (Solr 5.2.1 API)</title> <meta name="date" content="2015-06-10"> <link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style"> </head> <body> <script type="text/javascript"><! if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Class org.apache.solr.cloud.Overseer (Solr 5.2.1 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><a href="../../../../../org/apache/solr/cloud/Overseer.html" title="class in org.apache.solr.cloud">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="../../../../../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/solr/cloud/class-use/Overseer.html" target="_top">Frames</a></li> <li><a href="Overseer.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="<API key>"> <li><a href="../../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><! allClassesLink = document.getElementById("<API key>"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } </script> </div> <a name="skip-navbar_top"> </a></div> <div class="header"> <h2 title="Uses of Class org.apache.solr.cloud.Overseer" class="title">Uses of Class<br>org.apache.solr.cloud.Overseer</h2> </div> <div class="classUseContainer"> <ul class="blockList"> <li class="blockList"> <table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing packages, and an explanation"> <caption><span>Packages that use <a href="../../../../../org/apache/solr/cloud/Overseer.html" title="class in org.apache.solr.cloud">Overseer</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.apache.solr.cloud">org.apache.solr.cloud</a></td> <td class="colLast"> <div class="block">Classes for dealing with ZooKeeper when operating in <a href="http://wiki.apache.org/solr/SolrCloud">SolrCloud</a> mode.</div> </td> </tr> </tbody> </table> </li> <li class="blockList"> <ul class="blockList"> <li class="blockList"><a name="org.apache.solr.cloud"> </a> <h3>Uses of <a href="../../../../../org/apache/solr/cloud/Overseer.html" title="class in org.apache.solr.cloud">Overseer</a> in <a href="../../../../../org/apache/solr/cloud/package-summary.html">org.apache.solr.cloud</a></h3> <table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing fields, and an explanation"> <caption><span>Fields in <a href="../../../../../org/apache/solr/cloud/package-summary.html">org.apache.solr.cloud</a> declared as <a href="../../../../../org/apache/solr/cloud/Overseer.html" title="class in org.apache.solr.cloud">Overseer</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>protected <a href="../../../../../org/apache/solr/cloud/Overseer.html" title="class in org.apache.solr.cloud">Overseer</a></code></td> <td class="colLast"><span class="strong">ZkController.</span><code><strong><a href="../../../../../org/apache/solr/cloud/ZkController.html#overseer">overseer</a></strong></code>&nbsp;</td> </tr> </tbody> </table> <table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation"> <caption><span>Methods in <a href="../../../../../org/apache/solr/cloud/package-summary.html">org.apache.solr.cloud</a> that return <a href="../../../../../org/apache/solr/cloud/Overseer.html" title="class in org.apache.solr.cloud">Overseer</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/apache/solr/cloud/Overseer.html" title="class in org.apache.solr.cloud">Overseer</a></code></td> <td class="colLast"><span class="strong">ZkController.</span><code><strong><a href="../../../../../org/apache/solr/cloud/ZkController.html#getOverseer()">getOverseer</a></strong>()</code>&nbsp;</td> </tr> </tbody> </table> <table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing constructors, and an explanation"> <caption><span>Constructors in <a href="../../../../../org/apache/solr/cloud/package-summary.html">org.apache.solr.cloud</a> with parameters of type <a href="../../../../../org/apache/solr/cloud/Overseer.html" title="class in org.apache.solr.cloud">Overseer</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colOne" scope="col">Constructor and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colLast"><code><strong><a href="../../../../../org/apache/solr/cloud/<API key>.html#<API key>(org.apache.solr.common.cloud.ZkStateReader,%20java.lang.String,%20org.apache.solr.handler.component.ShardHandler,%20java.lang.String,%20org.apache.solr.cloud.Overseer.Stats,%20org.apache.solr.cloud.Overseer)"><API key></a></strong>(<a href="../../../../../../solr-solrj/org/apache/solr/common/cloud/ZkStateReader.html?is-external=true" title="class or interface in org.apache.solr.common.cloud">ZkStateReader</a>&nbsp;zkStateReader, <a href="http://download.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;myId, <a href="../../../../../org/apache/solr/handler/component/ShardHandler.html" title="class in org.apache.solr.handler.component">ShardHandler</a>&nbsp;shardHandler, <a href="http://download.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;adminPath, <a href="../../../../../org/apache/solr/cloud/Overseer.Stats.html" title="class in org.apache.solr.cloud">Overseer.Stats</a>&nbsp;stats, <a href="../../../../../org/apache/solr/cloud/Overseer.html" title="class in org.apache.solr.cloud">Overseer</a>&nbsp;overseer)</code>&nbsp;</td> </tr> </tbody> </table> </li> </ul> </li> </ul> </div> <div class="bottomNav"><a name="navbar_bottom"> </a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="<API key>"> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../org/apache/solr/cloud/Overseer.html" title="class in org.apache.solr.cloud">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="../../../../../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/solr/cloud/class-use/Overseer.html" target="_top">Frames</a></li> <li><a href="Overseer.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="<API key>"> <li><a href="../../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><! allClassesLink = document.getElementById("<API key>"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } </script> </div> <a name="skip-navbar_bottom"> </a></div> <p class="legalCopy"><small> <i>Copyright &copy; 2000-2015 Apache Software Foundation. All Rights Reserved.</i> <script src='../../../../../prettify.js' type='text/javascript'></script> <script type='text/javascript'> (function(){ var oldonload = window.onload; if (typeof oldonload != 'function') { window.onload = prettyPrint; } else { window.onload = function() { oldonload(); prettyPrint(); } } })(); </script> </small></p> </body> </html>
package javax.swing.text; import java.awt.*; import java.lang.ref.SoftReference; import javax.swing.event.*; /** * View of plain text (text with only one font and color) * that does line-wrapping. This view expects that its * associated element has child elements that represent * the lines it should be wrapping. It is implemented * as a vertical box that contains logical line views. * The logical line views are nested classes that render * the logical line as multiple physical line if the logical * line is too wide to fit within the allocation. The * line views draw upon the outer class for its state * to reduce their memory requirements. * <p> * The line views do all of their rendering through the * <code>drawLine</code> method which in turn does all of * its rendering through the <code>drawSelectedText</code> * and <code>drawUnselectedText</code> methods. This * enables subclasses to easily specialize the rendering * without concern for the layout aspects. * * @author Timothy Prinzing * @see View */ public class WrappedPlainView extends BoxView implements TabExpander { /** * Creates a new WrappedPlainView. Lines will be wrapped * on character boundaries. * * @param elem the element underlying the view */ public WrappedPlainView(Element elem) { this(elem, false); } /** * Creates a new WrappedPlainView. Lines can be wrapped on * either character or word boundaries depending upon the * setting of the wordWrap parameter. * * @param elem the element underlying the view * @param wordWrap should lines be wrapped on word boundaries? */ public WrappedPlainView(Element elem, boolean wordWrap) { super(elem, Y_AXIS); this.wordWrap = wordWrap; } /** * Returns the tab size set for the document, defaulting to 8. * * @return the tab size */ protected int getTabSize() { Integer i = (Integer) getDocument().getProperty(PlainDocument.tabSizeAttribute); int size = (i != null) ? i.intValue() : 8; return size; } /** * Renders a line of text, suppressing whitespace at the end * and expanding any tabs. This is implemented to make calls * to the methods <code>drawUnselectedText</code> and * <code>drawSelectedText</code> so that the way selected and * unselected text are rendered can be customized. * * @param p0 the starting document location to use >= 0 * @param p1 the ending document location to use >= p1 * @param g the graphics context * @param x the starting X position >= 0 * @param y the starting Y position >= 0 * @see #drawUnselectedText * @see #drawSelectedText */ protected void drawLine(int p0, int p1, Graphics g, int x, int y) { Element lineMap = getElement(); Element line = lineMap.getElement(lineMap.getElementIndex(p0)); Element elem; try { if (line.isLeaf()) { drawText(line, p0, p1, g, x, y); } else { // this line contains the composed text. int idx = line.getElementIndex(p0); int lastIdx = line.getElementIndex(p1); for(; idx <= lastIdx; idx++) { elem = line.getElement(idx); int start = Math.max(elem.getStartOffset(), p0); int end = Math.min(elem.getEndOffset(), p1); x = drawText(elem, start, end, g, x, y); } } } catch (<API key> e) { throw new StateInvariantError("Can't render: " + p0 + "," + p1); } } private int drawText(Element elem, int p0, int p1, Graphics g, int x, int y) throws <API key> { p1 = Math.min(getDocument().getLength(), p1); AttributeSet attr = elem.getAttributes(); if (Utilities.<API key>(attr)) { g.setColor(unselected); x = Utilities.drawComposedText(this, attr, g, x, y, p0-elem.getStartOffset(), p1-elem.getStartOffset()); } else { if (sel0 == sel1 || selected == unselected) { // no selection, or it is invisible x = drawUnselectedText(g, x, y, p0, p1); } else if ((p0 >= sel0 && p0 <= sel1) && (p1 >= sel0 && p1 <= sel1)) { x = drawSelectedText(g, x, y, p0, p1); } else if (sel0 >= p0 && sel0 <= p1) { if (sel1 >= p0 && sel1 <= p1) { x = drawUnselectedText(g, x, y, p0, sel0); x = drawSelectedText(g, x, y, sel0, sel1); x = drawUnselectedText(g, x, y, sel1, p1); } else { x = drawUnselectedText(g, x, y, p0, sel0); x = drawSelectedText(g, x, y, sel0, p1); } } else if (sel1 >= p0 && sel1 <= p1) { x = drawSelectedText(g, x, y, p0, sel1); x = drawUnselectedText(g, x, y, sel1, p1); } else { x = drawUnselectedText(g, x, y, p0, p1); } } return x; } /** * Renders the given range in the model as normal unselected * text. * * @param g the graphics context * @param x the starting X coordinate >= 0 * @param y the starting Y coordinate >= 0 * @param p0 the beginning position in the model >= 0 * @param p1 the ending position in the model >= p0 * @return the X location of the end of the range >= 0 * @exception <API key> if the range is invalid */ protected int drawUnselectedText(Graphics g, int x, int y, int p0, int p1) throws <API key> { g.setColor(unselected); Document doc = getDocument(); Segment segment = SegmentCache.getSharedSegment(); doc.getText(p0, p1 - p0, segment); int ret = Utilities.drawTabbedText(this, segment, x, y, g, this, p0); SegmentCache.<API key>(segment); return ret; } /** * Renders the given range in the model as selected text. This * is implemented to render the text in the color specified in * the hosting component. It assumes the highlighter will render * the selected background. * * @param g the graphics context * @param x the starting X coordinate >= 0 * @param y the starting Y coordinate >= 0 * @param p0 the beginning position in the model >= 0 * @param p1 the ending position in the model >= p0 * @return the location of the end of the range. * @exception <API key> if the range is invalid */ protected int drawSelectedText(Graphics g, int x, int y, int p0, int p1) throws <API key> { g.setColor(selected); Document doc = getDocument(); Segment segment = SegmentCache.getSharedSegment(); doc.getText(p0, p1 - p0, segment); int ret = Utilities.drawTabbedText(this, segment, x, y, g, this, p0); SegmentCache.<API key>(segment); return ret; } /** * Gives access to a buffer that can be used to fetch * text from the associated document. * * @return the buffer */ protected final Segment getLineBuffer() { if (lineBuffer == null) { lineBuffer = new Segment(); } return lineBuffer; } /** * This is called by the nested wrapped line * views to determine the break location. This can * be reimplemented to alter the breaking behavior. * It will either break at word or character boundaries * depending upon the break argument given at * construction. */ protected int <API key>(int p0, int p1) { int p; Segment segment = SegmentCache.getSharedSegment(); loadText(segment, p0, p1); int currentWidth = getWidth(); if (wordWrap) { p = p0 + Utilities.getBreakLocation(segment, metrics, tabBase, tabBase + currentWidth, this, p0); } else { p = p0 + Utilities.getTabbedTextOffset(segment, metrics, tabBase, tabBase + currentWidth, this, p0, false); } SegmentCache.<API key>(segment); return p; } /** * Loads all of the children to initialize the view. * This is called by the <code>setParent</code> method. * Subclasses can reimplement this to initialize their * child views in a different manner. The default * implementation creates a child view for each * child element. * * @param f the view factory */ protected void loadChildren(ViewFactory f) { Element e = getElement(); int n = e.getElementCount(); if (n > 0) { View[] added = new View[n]; for (int i = 0; i < n; i++) { added[i] = new WrappedLine(e.getElement(i)); } replace(0, 0, added); } } /** * Update the child views in response to a * document event. */ void updateChildren(DocumentEvent e, Shape a) { Element elem = getElement(); DocumentEvent.ElementChange ec = e.getChange(elem); if (ec != null) { // the structure of this element changed. Element[] removedElems = ec.getChildrenRemoved(); Element[] addedElems = ec.getChildrenAdded(); View[] added = new View[addedElems.length]; for (int i = 0; i < addedElems.length; i++) { added[i] = new WrappedLine(addedElems[i]); } replace(ec.getIndex(), removedElems.length, added); // should damge a little more intelligently. if (a != null) { preferenceChanged(null, true, true); getContainer().repaint(); } } // update font metrics which may be used by the child views updateMetrics(); } /** * Load the text buffer with the given range * of text. This is used by the fragments * broken off of this view as well as this * view itself. */ final void loadText(Segment segment, int p0, int p1) { try { Document doc = getDocument(); doc.getText(p0, p1 - p0, segment); } catch (<API key> bl) { throw new StateInvariantError("Can't get line text"); } } final void updateMetrics() { Component host = getContainer(); Font f = host.getFont(); metrics = host.getFontMetrics(f); tabSize = getTabSize() * metrics.charWidth('m'); } /** * Returns the next tab stop position after a given reference position. * This implementation does not support things like centering so it * ignores the tabOffset argument. * * @param x the current position >= 0 * @param tabOffset the position within the text stream * that the tab occurred at >= 0. * @return the tab stop, measured in points >= 0 */ public float nextTabStop(float x, int tabOffset) { if (tabSize == 0) return x; int ntabs = ((int) x - tabBase) / tabSize; return tabBase + ((ntabs + 1) * tabSize); } /** * Renders using the given rendering surface and area * on that surface. This is implemented to stash the * selection positions, selection colors, and font * metrics for the nested lines to use. * * @param g the rendering surface to use * @param a the allocated region to render into * * @see View#paint */ public void paint(Graphics g, Shape a) { Rectangle alloc = (Rectangle) a; tabBase = alloc.x; JTextComponent host = (JTextComponent) getContainer(); sel0 = host.getSelectionStart(); sel1 = host.getSelectionEnd(); unselected = (host.isEnabled()) ? host.getForeground() : host.<API key>(); Caret c = host.getCaret(); selected = c.isSelectionVisible() && host.getHighlighter() != null ? host.<API key>() : unselected; g.setFont(host.getFont()); // superclass paints the children super.paint(g, a); } /** * Sets the size of the view. This should cause * layout of the view along the given axis, if it * has any layout duties. * * @param width the width >= 0 * @param height the height >= 0 */ public void setSize(float width, float height) { updateMetrics(); if ((int) width != getWidth()) { // invalidate the view itself since the childrens // desired widths will be based upon this views width. preferenceChanged(null, true, true); widthChanging = true; } super.setSize(width, height); widthChanging = false; } /** * Determines the preferred span for this view along an * axis. This is implemented to provide the superclass * behavior after first making sure that the current font * metrics are cached (for the nested lines which use * the metrics to determine the height of the potentially * wrapped lines). * * @param axis may be either View.X_AXIS or View.Y_AXIS * @return the span the view would like to be rendered into. * Typically the view is told to render into the span * that is returned, although there is no guarantee. * The parent may choose to resize or break the view. * @see View#getPreferredSpan */ public float getPreferredSpan(int axis) { updateMetrics(); return super.getPreferredSpan(axis); } /** * Determines the minimum span for this view along an * axis. This is implemented to provide the superclass * behavior after first making sure that the current font * metrics are cached (for the nested lines which use * the metrics to determine the height of the potentially * wrapped lines). * * @param axis may be either View.X_AXIS or View.Y_AXIS * @return the span the view would like to be rendered into. * Typically the view is told to render into the span * that is returned, although there is no guarantee. * The parent may choose to resize or break the view. * @see View#getMinimumSpan */ public float getMinimumSpan(int axis) { updateMetrics(); return super.getMinimumSpan(axis); } /** * Determines the maximum span for this view along an * axis. This is implemented to provide the superclass * behavior after first making sure that the current font * metrics are cached (for the nested lines which use * the metrics to determine the height of the potentially * wrapped lines). * * @param axis may be either View.X_AXIS or View.Y_AXIS * @return the span the view would like to be rendered into. * Typically the view is told to render into the span * that is returned, although there is no guarantee. * The parent may choose to resize or break the view. * @see View#getMaximumSpan */ public float getMaximumSpan(int axis) { updateMetrics(); return super.getMaximumSpan(axis); } /** * Gives notification that something was inserted into the * document in a location that this view is responsible for. * This is implemented to simply update the children. * * @param e the change information from the associated document * @param a the current allocation of the view * @param f the factory to use to rebuild if the view has children * @see View#insertUpdate */ public void insertUpdate(DocumentEvent e, Shape a, ViewFactory f) { updateChildren(e, a); Rectangle alloc = ((a != null) && isAllocationValid()) ? getInsideAllocation(a) : null; int pos = e.getOffset(); View v = getViewAtPosition(pos, alloc); if (v != null) { v.insertUpdate(e, alloc, f); } } /** * Gives notification that something was removed from the * document in a location that this view is responsible for. * This is implemented to simply update the children. * * @param e the change information from the associated document * @param a the current allocation of the view * @param f the factory to use to rebuild if the view has children * @see View#removeUpdate */ public void removeUpdate(DocumentEvent e, Shape a, ViewFactory f) { updateChildren(e, a); Rectangle alloc = ((a != null) && isAllocationValid()) ? getInsideAllocation(a) : null; int pos = e.getOffset(); View v = getViewAtPosition(pos, alloc); if (v != null) { v.removeUpdate(e, alloc, f); } } /** * Gives notification from the document that attributes were changed * in a location that this view is responsible for. * * @param e the change information from the associated document * @param a the current allocation of the view * @param f the factory to use to rebuild if the view has children * @see View#changedUpdate */ public void changedUpdate(DocumentEvent e, Shape a, ViewFactory f) { updateChildren(e, a); } FontMetrics metrics; Segment lineBuffer; boolean widthChanging; int tabBase; int tabSize; boolean wordWrap; int sel0; int sel1; Color unselected; Color selected; /** * Simple view of a line that wraps if it doesn't * fit withing the horizontal space allocated. * This class tries to be lightweight by carrying little * state of it's own and sharing the state of the outer class * with it's sibblings. */ class WrappedLine extends View { WrappedLine(Element elem) { super(elem); lineCount = -1; } /** * Determines the preferred span for this view along an * axis. * * @param axis may be either X_AXIS or Y_AXIS * @return the span the view would like to be rendered into. * Typically the view is told to render into the span * that is returned, although there is no guarantee. * The parent may choose to resize or break the view. * @see View#getPreferredSpan */ public float getPreferredSpan(int axis) { switch (axis) { case View.X_AXIS: float width = getWidth(); if (width == Integer.MAX_VALUE) { // We have been initially set to MAX_VALUE, but we don't // want this as our preferred. return 100f; } return width; case View.Y_AXIS: if (lineCount < 0 || widthChanging) { breakLines(getStartOffset()); } return lineCount * metrics.getHeight(); default: throw new <API key>("Invalid axis: " + axis); } } /** * Renders using the given rendering surface and area on that * surface. The view may need to do layout and create child * views to enable itself to render into the given allocation. * * @param g the rendering surface to use * @param a the allocated region to render into * @see View#paint */ public void paint(Graphics g, Shape a) { Rectangle alloc = (Rectangle) a; int y = alloc.y + metrics.getAscent(); int x = alloc.x; JTextComponent host = (JTextComponent)getContainer(); Highlighter h = host.getHighlighter(); LayeredHighlighter dh = (h instanceof LayeredHighlighter) ? (LayeredHighlighter)h : null; int start = getStartOffset(); int end = getEndOffset(); int p0 = start; int[] lineEnds = getLineEnds(); for (int i = 0; i < lineCount; i++) { int p1 = (lineEnds == null) ? end : start + lineEnds[i]; if (dh != null) { int hOffset = (p1 == end) ? (p1 - 1) : p1; dh.<API key>(g, p0, hOffset, a, host, this); } drawLine(p0, p1, g, x, y); p0 = p1; y += metrics.getHeight(); } } /** * Provides a mapping from the document model coordinate space * to the coordinate space of the view mapped to it. * * @param pos the position to convert * @param a the allocated region to render into * @return the bounding box of the given position is returned * @exception <API key> if the given position does not represent a * valid location in the associated document * @see View#modelToView */ public Shape modelToView(int pos, Shape a, Position.Bias b) throws <API key> { Rectangle alloc = a.getBounds(); alloc.height = metrics.getHeight(); alloc.width = 1; int p0 = getStartOffset(); if (pos < p0 || pos > getEndOffset()) { throw new <API key>("Position out of range", pos); } int testP = (b == Position.Bias.Forward) ? pos : Math.max(p0, pos - 1); int line = 0; int[] lineEnds = getLineEnds(); if (lineEnds != null) { line = findLine(testP - p0); if (line > 0) { p0 += lineEnds[line - 1]; } alloc.y += alloc.height * line; } if (pos > p0) { Segment segment = SegmentCache.getSharedSegment(); loadText(segment, p0, pos); alloc.x += Utilities.getTabbedTextWidth(segment, metrics, alloc.x, WrappedPlainView.this, p0); SegmentCache.<API key>(segment); } return alloc; } /** * Provides a mapping from the view coordinate space to the logical * coordinate space of the model. * * @param fx the X coordinate * @param fy the Y coordinate * @param a the allocated region to render into * @return the location within the model that best represents the * given point in the view * @see View#viewToModel */ public int viewToModel(float fx, float fy, Shape a, Position.Bias[] bias) { // PENDING(prinz) implement bias properly bias[0] = Position.Bias.Forward; Rectangle alloc = (Rectangle) a; int x = (int) fx; int y = (int) fy; if (y < alloc.y) { // above the area covered by this icon, so the the position // is assumed to be the start of the coverage for this view. return getStartOffset(); } else if (y > alloc.y + alloc.height) { // below the area covered by this icon, so the the position // is assumed to be the end of the coverage for this view. return getEndOffset() - 1; } else { // positioned within the coverage of this view vertically, // so we figure out which line the point corresponds to. // if the line is greater than the number of lines contained, then // simply use the last line as it represents the last possible place // we can position to. alloc.height = metrics.getHeight(); int line = (alloc.height > 0 ? (y - alloc.y) / alloc.height : lineCount - 1); if (line >= lineCount) { return getEndOffset() - 1; } else { int p0 = getStartOffset(); int p1; if (lineCount == 1) { p1 = getEndOffset(); } else { int[] lineEnds = getLineEnds(); p1 = p0 + lineEnds[line]; if (line > 0) { p0 += lineEnds[line - 1]; } } if (x < alloc.x) { // point is to the left of the line return p0; } else if (x > alloc.x + alloc.width) { // point is to the right of the line return p1 - 1; } else { // Determine the offset into the text Segment segment = SegmentCache.getSharedSegment(); loadText(segment, p0, p1); int n = Utilities.getTabbedTextOffset(segment, metrics, alloc.x, x, WrappedPlainView.this, p0); SegmentCache.<API key>(segment); return Math.min(p0 + n, p1 - 1); } } } } public void insertUpdate(DocumentEvent e, Shape a, ViewFactory f) { update(e, a); } public void removeUpdate(DocumentEvent e, Shape a, ViewFactory f) { update(e, a); } private void update(DocumentEvent ev, Shape a) { int oldCount = lineCount; breakLines(ev.getOffset()); if (oldCount != lineCount) { WrappedPlainView.this.preferenceChanged(this, false, true); // have to repaint any views after the receiver. getContainer().repaint(); } else if (a != null) { Component c = getContainer(); Rectangle alloc = (Rectangle) a; c.repaint(alloc.x, alloc.y, alloc.width, alloc.height); } } /** * Returns line cache. If the cache was GC'ed, recreates it. * If there's no cache, returns null */ final int[] getLineEnds() { if (lineCache == null) { return null; } else { int[] lineEnds = lineCache.get(); if (lineEnds == null) { // Cache was GC'ed, so rebuild it return breakLines(getStartOffset()); } else { return lineEnds; } } } /** * Creates line cache if text breaks into more than one physical line. * @param startPos position to start breaking from * @return the cache created, ot null if text breaks into one line */ final int[] breakLines(int startPos) { int[] lineEnds = (lineCache == null) ? null : lineCache.get(); int[] oldLineEnds = lineEnds; int start = getStartOffset(); int lineIndex = 0; if (lineEnds != null) { lineIndex = findLine(startPos - start); if (lineIndex > 0) { lineIndex } } int p0 = (lineIndex == 0) ? start : start + lineEnds[lineIndex - 1]; int p1 = getEndOffset(); while (p0 < p1) { int p = <API key>(p0, p1); p0 = (p == p0) ? ++p : p; // 4410243 if (lineIndex == 0 && p0 >= p1) { // do not use cache if there's only one line lineCache = null; lineEnds = null; lineIndex = 1; break; } else if (lineEnds == null || lineIndex >= lineEnds.length) { // we have 2+ lines, and the cache is not big enough // we try to estimate total number of lines double growFactor = ((double)(p1 - start) / (p0 - start)); int newSize = (int)Math.ceil((lineIndex + 1) * growFactor); newSize = Math.max(newSize, lineIndex + 2); int[] tmp = new int[newSize]; if (lineEnds != null) { System.arraycopy(lineEnds, 0, tmp, 0, lineIndex); } lineEnds = tmp; } lineEnds[lineIndex++] = p0 - start; } lineCount = lineIndex; if (lineCount > 1) { // check if the cache is too big int maxCapacity = lineCount + lineCount / 3; if (lineEnds.length > maxCapacity) { int[] tmp = new int[maxCapacity]; System.arraycopy(lineEnds, 0, tmp, 0, lineCount); lineEnds = tmp; } } if (lineEnds != null && lineEnds != oldLineEnds) { lineCache = new SoftReference<int[]>(lineEnds); } return lineEnds; } /** * Binary search in the cache for line containing specified offset * (which is relative to the beginning of the view). This method * assumes that cache exists. */ private int findLine(int offset) { int[] lineEnds = lineCache.get(); if (offset < lineEnds[0]) { return 0; } else if (offset > lineEnds[lineCount - 1]) { return lineCount; } else { return findLine(lineEnds, offset, 0, lineCount - 1); } } private int findLine(int[] array, int offset, int min, int max) { if (max - min <= 1) { return max; } else { int mid = (max + min) / 2; return (offset < array[mid]) ? findLine(array, offset, min, mid) : findLine(array, offset, mid, max); } } int lineCount; SoftReference<int[]> lineCache = null; } }
using BoletoNet.EDI.Banco; using BoletoNet.Excecoes; using System; using System.Collections.Generic; using System.Linq; using System.Web.UI; [assembly: WebResource("BoletoNet.Imagens.748.jpg", "image/jpg")] namespace BoletoNet { <Author> Samuel Schmidt - Sicredi Nordeste RS / Felipe Eduardo - RS </Author> internal class Banco_Sicredi : AbstractBanco, IBanco { private static Dictionary<int, string> <API key> = new Dictionary<int, string>() { { 1, "Com Registro" }, { 3, "Sem Registro" } }; private HeaderRetorno header; <author> Classe responsavel em criar os campos do Banco Sicredi. </author> internal Banco_Sicredi() { this.Codigo = 748; this.Digito = "X"; this.Nome = "Banco Sicredi"; } public override void ValidaBoleto(Boleto boleto) { if (boleto.Cedente.ContaBancaria.Agencia.Length < 4) boleto.Cedente.ContaBancaria.Agencia = Utils.FormatCode(boleto.Cedente.ContaBancaria.Agencia, 4); if (boleto.Cedente.ContaBancaria.Conta.Length < 5) boleto.Cedente.ContaBancaria.Conta = Utils.FormatCode(boleto.Cedente.ContaBancaria.Conta, 5); //Atribui o nome do banco ao local de pagamento if (boleto.LocalPagamento == "Até o vencimento, preferencialmente no ") boleto.LocalPagamento += Nome; else boleto.LocalPagamento = "PAGÁVEL PREFERENCIALMENTE NAS COOPERATIVAS DE CRÉDITO DO SICREDI"; if (boleto.DataProcessamento == DateTime.MinValue) // diegomodolo (diego.ribeiro@nectarnet.com.br) boleto.DataProcessamento = DateTime.Now; if (boleto.DataDocumento == DateTime.MinValue) // diegomodolo (diego.ribeiro@nectarnet.com.br) boleto.DataDocumento = DateTime.Now; string <API key> = "formato AAAAPPCCCCC, onde: AAAA = Número da agência, PP = Posto do beneficiário, CCCCC = Código do beneficiário"; var codigoCedente = Utils.FormatCode(boleto.Cedente.Codigo, 11); if (string.IsNullOrEmpty(codigoCedente)) throw new BoletoNetException("Código do cedente deve ser informado, " + <API key>); var conta = boleto.Cedente.ContaBancaria.Conta; if (boleto.Cedente.ContaBancaria != null && (!codigoCedente.StartsWith(boleto.Cedente.ContaBancaria.Agencia) || !(codigoCedente.EndsWith(conta) || codigoCedente.EndsWith(conta.Substring(0, conta.Length - 1))))) boleto.Cedente.Codigo = string.Format("{0}{1}{2}", boleto.Cedente.ContaBancaria.Agencia, boleto.Cedente.ContaBancaria.OperacaConta, boleto.Cedente.Codigo); if (string.IsNullOrEmpty(boleto.Carteira)) throw new BoletoNetException("Tipo de carteira é obrigatório. " + <API key>()); if (!CarteiraValida(boleto.Carteira)) throw new BoletoNetException("Carteira informada é inválida. Informe " + <API key>()); var Length_NN = boleto.NossoNumero.Length; switch (Length_NN) { case 9: boleto.NossoNumero = boleto.NossoNumero.Substring(0, Length_NN - 1); boleto.DigitoNossoNumero = <API key>(boleto); boleto.NossoNumero += boleto.DigitoNossoNumero; break; case 8: boleto.DigitoNossoNumero = <API key>(boleto); boleto.NossoNumero += boleto.DigitoNossoNumero; break; case 6: boleto.NossoNumero = DateTime.Now.ToString("yy") + boleto.NossoNumero; boleto.DigitoNossoNumero = <API key>(boleto); boleto.NossoNumero += boleto.DigitoNossoNumero; break; default: throw new <API key>("Nosso número inválido"); } FormataCodigoBarra(boleto); if (boleto.CodigoBarra.Codigo.Length != 44) throw new BoletoNetException("Código de barras é inválido"); <API key>(boleto); FormataNossoNumero(boleto); } private string <API key>() { return string.Join(", ", <API key>.Select(o => string.Format("“{0}” – {1}", o.Key, o.Value))); } private bool CarteiraValida(string carteira) { int tipoCarteira; if (int.TryParse(carteira, out tipoCarteira)) { return <API key>.ContainsKey(tipoCarteira); } return false; } public override void FormataNossoNumero(Boleto boleto) { string nossoNumero = boleto.NossoNumero; if (nossoNumero == null || nossoNumero.Length != 9) { throw new Exception("Erro ao tentar formatar nosso número, verifique o tamanho do campo"); } try { boleto.NossoNumero = string.Format("{0}/{1}-{2}", nossoNumero.Substring(0, 2), nossoNumero.Substring(2, 6), nossoNumero.Substring(8)); } catch (Exception ex) { throw new Exception("Erro ao formatar nosso número", ex); } } public override void <API key>(Boleto boleto) { throw new <API key>("Função do fomata número do documento não implementada."); } public override void <API key>(Boleto boleto) { //041M2.1AAAd1 CCCCC.CCNNNd2 NNNNN.041XXd3 V FFFF9999999999 string campo1 = "7489" + boleto.CodigoBarra.Codigo.Substring(19, 5); int d1 = Mod10Sicredi(campo1); campo1 = FormataCampoLD(campo1) + d1.ToString(); string campo2 = boleto.CodigoBarra.Codigo.Substring(24, 10); int d2 = Mod10Sicredi(campo2); campo2 = FormataCampoLD(campo2) + d2.ToString(); string campo3 = boleto.CodigoBarra.Codigo.Substring(34, 10); int d3 = Mod10Sicredi(campo3); campo3 = FormataCampoLD(campo3) + d3.ToString(); string campo4 = boleto.CodigoBarra.Codigo.Substring(4, 1); string campo5 = boleto.CodigoBarra.Codigo.Substring(5, 14); boleto.CodigoBarra.LinhaDigitavel = campo1 + " " + campo2 + " " + campo3 + " " + campo4 + " " + campo5; } private string FormataCampoLD(string campo) { return string.Format("{0}.{1}", campo.Substring(0, 5), campo.Substring(5)); } public override void FormataCodigoBarra(Boleto boleto) { string valorBoleto = boleto.ValorBoleto.ToString("f").Replace(",", "").Replace(".", ""); valorBoleto = Utils.FormatCode(valorBoleto, 10); var codigoCobranca = 1; string cmp_livre = codigoCobranca + boleto.Carteira + Utils.FormatCode(boleto.NossoNumero, 9) + Utils.FormatCode(boleto.Cedente.Codigo, 11) + "10"; string dv_cmpLivre = digSicredi(cmp_livre).ToString(); var codigoTemp = GerarCodigoDeBarras(boleto, valorBoleto, cmp_livre, dv_cmpLivre); boleto.CodigoBarra.CampoLivre = cmp_livre; boleto.CodigoBarra.FatorVencimento = FatorVencimento(boleto); boleto.CodigoBarra.Moeda = 9; boleto.CodigoBarra.ValorDocumento = valorBoleto; int _dacBoleto = digSicredi(codigoTemp); if (_dacBoleto == 0 || _dacBoleto > 9) _dacBoleto = 1; boleto.CodigoBarra.Codigo = GerarCodigoDeBarras(boleto, valorBoleto, cmp_livre, dv_cmpLivre, _dacBoleto); } private string GerarCodigoDeBarras(Boleto boleto, string valorBoleto, string cmp_livre, string dv_cmpLivre, int? dv_geral = null) { return string.Format("{0}{1}{2}{3}{4}{5}{6}", Utils.FormatCode(Codigo.ToString(), 3), boleto.Moeda, dv_geral.HasValue ? dv_geral.Value.ToString() : string.Empty, FatorVencimento(boleto), valorBoleto, cmp_livre, dv_cmpLivre); } //public bool RegistroByCarteira(Boleto boleto) // bool valida = false; // if (boleto.Carteira == "112" // || boleto.Carteira == "115" // || boleto.Carteira == "104" // || boleto.Carteira == "147" // || boleto.Carteira == "188" // || boleto.Carteira == "108" // || boleto.Carteira == "109" // || boleto.Carteira == "150" // || boleto.Carteira == "121") // valida = true; // return valida; public override string GerarDetalheRemessa(Boleto boleto, int numeroRegistro, TipoArquivo tipoArquivo) { try { string _detalhe = " "; //base.GerarDetalheRemessa(boleto, numeroRegistro, tipoArquivo); switch (tipoArquivo) { case TipoArquivo.CNAB240: _detalhe = <API key>(boleto, numeroRegistro, tipoArquivo); break; case TipoArquivo.CNAB400: _detalhe = <API key>(boleto, numeroRegistro, tipoArquivo); break; case TipoArquivo.Outro: throw new Exception("Tipo de arquivo inexistente."); } return _detalhe; } catch (Exception ex) { throw new Exception("Erro durante a geração do DETALHE arquivo de REMESSA.", ex); } } public override string GerarHeaderRemessa(string numeroConvenio, Cedente cedente, TipoArquivo tipoArquivo, int <API key>, Boleto boletos) { throw new <API key>("Função não implementada."); } public string <API key>(Boleto boleto, int numeroRegistro, TipoArquivo tipoArquivo) { try { string detalhe = Utils.FormatCode(Codigo.ToString(), "0", 3, true); detalhe += Utils.FormatCode("", "0", 4, true); detalhe += "3"; detalhe += Utils.FormatCode(numeroRegistro.ToString(), 5); detalhe += "P 01"; detalhe += Utils.FormatCode(boleto.Cedente.ContaBancaria.Agencia, 5); detalhe += "0"; detalhe += Utils.FormatCode(boleto.Cedente.ContaBancaria.Conta, 12); detalhe += boleto.Cedente.ContaBancaria.DigitoConta; detalhe += " "; detalhe += Utils.FormatCode(boleto.NossoNumero.Replace("/", "").Replace("-", ""), 20); detalhe += "1"; detalhe += (Convert.ToInt16(boleto.Carteira) == 1 ? "1" : "2"); detalhe += "122"; detalhe += Utils.FormatCode(boleto.NumeroDocumento, 15); detalhe += boleto.DataVencimento.ToString("ddMMyyyy"); string valorBoleto = boleto.ValorBoleto.ToString("f").Replace(",", "").Replace(".", ""); valorBoleto = Utils.FormatCode(valorBoleto, 13); detalhe += valorBoleto; detalhe += "00000 99A"; detalhe += boleto.DataDocumento.ToString("ddMMyyyy"); detalhe += "200000000"; valorBoleto = boleto.JurosMora.ToString("f").Replace(",", "").Replace(".", ""); valorBoleto = Utils.FormatCode(valorBoleto, 13); detalhe += valorBoleto; detalhe += "1"; detalhe += boleto.DataDesconto.ToString("ddMMyyyy"); valorBoleto = boleto.ValorDesconto.ToString("f").Replace(",", "").Replace(".", ""); valorBoleto = Utils.FormatCode(valorBoleto, 13); detalhe += valorBoleto; detalhe += Utils.FormatCode("", 26); detalhe += Utils.FormatCode("", " ", 25); detalhe += "0001060090000000000 "; detalhe = Utils.<API key>(detalhe); return detalhe; } catch (Exception e) { throw new Exception("Erro ao gerar DETALHE do arquivo CNAB240.", e); } } public override string GerarHeaderRemessa(Cedente cedente, TipoArquivo tipoArquivo, int <API key>) { return GerarHeaderRemessa("0", cedente, tipoArquivo, <API key>); } public override string GerarHeaderRemessa(string numeroConvenio, Cedente cedente, TipoArquivo tipoArquivo, int <API key>) { try { string _header = " "; base.GerarHeaderRemessa("0", cedente, tipoArquivo, <API key>); switch (tipoArquivo) { case TipoArquivo.CNAB240: _header = <API key>(cedente); break; case TipoArquivo.CNAB400: _header = <API key>(0, cedente, <API key>); break; case TipoArquivo.Outro: throw new Exception("Tipo de arquivo inexistente."); } return _header; } catch (Exception ex) { throw new Exception("Erro durante a geração do HEADER do arquivo de REMESSA.", ex); } } private string <API key>(Cedente cedente, int <API key>) { try { return <API key>(cedente); } catch (Exception e) { throw new Exception("Erro ao gerar HEADER DO LOTE do arquivo de remessa.", e); } } public override string <API key>(string numeroConvenio, Cedente cedente, int <API key>, TipoArquivo tipoArquivo) { try { string header = " "; switch (tipoArquivo) { case TipoArquivo.CNAB240: header = <API key>(cedente, <API key>); break; case TipoArquivo.CNAB400: break; case TipoArquivo.Outro: throw new Exception("Tipo de arquivo inexistente."); } return header; } catch (Exception ex) { throw new Exception("Erro durante a geração do HEADER DO LOTE do arquivo de REMESSA.", ex); } } public string <API key>(Cedente cedente) { try { string header = "748"; header += "0000"; header += "0"; header += Utils.FormatCode("", " ", 9); header += (cedente.CPFCNPJ.Length == 11 ? "1" : "2"); header += Utils.FormatCode(cedente.CPFCNPJ, "0", 14, true); header += Utils.FormatCode(cedente.Convenio.ToString(), " ", 20); header += Utils.FormatCode(cedente.ContaBancaria.Agencia, "0", 5, true); header += " "; header += Utils.FormatCode(cedente.ContaBancaria.Conta, "0", 12, true); header += cedente.ContaBancaria.DigitoConta; header += " "; header += Utils.FormatCode(cedente.Nome, " ", 30); header += Utils.FormatCode("SICREDI", " ", 30); header += Utils.FormatCode("", " ", 10); header += Utils.FormatCode(cedente.Nome, " ", 30); header += "1"; header += DateTime.Now.ToString("ddMMyyyyHHmmss"); header += Utils.FormatCode("", "0", 6); header += "081"; header += "01600"; header += Utils.FormatCode("", " ", 69); header = Utils.<API key>(header); return header; } catch (Exception ex) { throw new Exception("Erro ao gerar HEADER do arquivo de remessa do CNAB240.", ex); } } public override string GerarTrailerRemessa(int numeroRegistro, TipoArquivo tipoArquivo, Cedente cedente, decimal vltitulostotal) { try { string _trailer = " "; switch (tipoArquivo) { case TipoArquivo.CNAB240: _trailer = <API key>(numeroRegistro); break; case TipoArquivo.CNAB400: _trailer = <API key>(numeroRegistro, cedente); break; case TipoArquivo.Outro: throw new Exception("Tipo de arquivo inexistente."); } return _trailer; } catch (Exception ex) { throw new Exception("", ex); } } public string <API key>(int numeroRegistro) { try { string complemento = new string(' ', 205); string _trailer; _trailer = "74899999"; _trailer += Utils.FormatCode("", " ", 9); _trailer += Utils.FormatCode("", 6); _trailer += Utils.FormatCode(numeroRegistro.ToString(), 6); _trailer += Utils.FormatCode("", 6); _trailer += complemento; _trailer = Utils.<API key>(_trailer); return _trailer; } catch (Exception ex) { throw new Exception("Erro durante a geração do registro TRAILER do arquivo de REMESSA.", ex); } } #endregion public int Mod10Sicredi(string seq) { int d, s = 0, p = 2, b = 2, r; for (int i = seq.Length - 1; i >= 0; i { r = (Convert.ToInt32(seq.Substring(i, 1)) * p); if (r > 9) r = SomaDezena(r); s = s + r; if (p < b) p++; else p } d = Multiplo10(s); return d; } public int SomaDezena(int dezena) { string d = dezena.ToString(); int d1 = Convert.ToInt32(d.Substring(0, 1)); int d2 = Convert.ToInt32(d.Substring(1)); return d1 + d2; } public int digSicredi(string seq) { int d, s = 0, p = 2, b = 9; for (int i = seq.Length - 1; i >= 0; i { s = s + (Convert.ToInt32(seq.Substring(i, 1)) * p); if (p < b) p = p + 1; else p = 2; } d = 11 - (s % 11); if (d > 9) d = 0; return d; } public string <API key>(Boleto boleto) { string codigoCedente = boleto.Cedente.Codigo; string nossoNumero = boleto.NossoNumero; string seq = string.Concat(codigoCedente, nossoNumero); // = aaaappcccccyybnnnnn int d, s = 0, p = 2, b = 9; //Atribui os pesos de {2..9} for (int i = seq.Length - 1; i >= 0; i { s = s + (Convert.ToInt32(seq.Substring(i, 1)) * p); if (p < b) p = p + 1; else p = 2; } d = 11 - (s % 11); if (d > 9) d = 0; return d.ToString(); } <summary> Efetua as Validações dentro da classe Boleto, para garantir a geração da remessa </summary> public override bool ValidarRemessa(TipoArquivo tipoArquivo, string numeroConvenio, IBanco banco, Cedente cedente, Boletos boletos, int <API key>, out string mensagem) { bool vRetorno = true; string vMsg = string.Empty; switch (tipoArquivo) { case TipoArquivo.CNAB240: //vRetorno = <API key>(numeroConvenio, banco, cedente, boletos, <API key>, out vMsg); break; case TipoArquivo.CNAB400: vRetorno = <API key>(numeroConvenio, banco, cedente, boletos, <API key>, out vMsg); break; case TipoArquivo.Outro: throw new Exception("Tipo de arquivo inexistente."); } mensagem = vMsg; return vRetorno; } #region CNAB 400 - sidneiklein public bool <API key>(string numeroConvenio, IBanco banco, Cedente cedente, Boletos boletos, int <API key>, out string mensagem) { bool vRetorno = true; string vMsg = string.Empty; if (banco == null) { vMsg += String.Concat("Remessa: O Banco é Obrigatório!", Environment.NewLine); vRetorno = false; } if (cedente == null) { vMsg += String.Concat("Remessa: O Cedente/Beneficiário é Obrigatório!", Environment.NewLine); vRetorno = false; } if (boletos == null || boletos.Count.Equals(0)) { vMsg += String.Concat("Remessa: Deverá existir ao menos 1 boleto para geração da remessa!", Environment.NewLine); vRetorno = false; } #endregion foreach (Boleto boleto in boletos) { if (boleto.Remessa == null) { vMsg += String.Concat("Boleto: ", boleto.NumeroDocumento, "; Remessa: Informe as diretrizes de remessa!", Environment.NewLine); vRetorno = false; } else { //if (String.IsNullOrEmpty(boleto.Remessa.CodigoOcorrencia)) // vRetorno = false; if (String.IsNullOrEmpty(boleto.NumeroDocumento)) { vMsg += String.Concat("Boleto: ", boleto.NumeroDocumento, "; Remessa: Informe um Número de Documento!", Environment.NewLine); vRetorno = false; } else if (String.IsNullOrEmpty(boleto.Remessa.TipoDocumento)) { // Para o Sicredi, defini o Tipo de Documento sendo: // A = 'A' - SICREDI com Registro vMsg += String.Concat("Boleto: ", boleto.NumeroDocumento.Trim(), "; Remessa: Informe o Tipo Documento!", Environment.NewLine); vRetorno = false; } else if (!boleto.Remessa.TipoDocumento.Equals("A") && !boleto.Remessa.TipoDocumento.Equals("C1") && !boleto.Remessa.TipoDocumento.Equals("C2")) { vMsg += String.Concat("Boleto: ", boleto.NumeroDocumento.Trim(), "; Remessa: Tipo de Documento Inválido! Deverão ser: A = SICREDI com Registro; C1 = SICREDI sem Registro Impressão Completa pelo Sicredi; C2 = SICREDI sem Registro Pedido de bloquetos pré-impressos", Environment.NewLine); vRetorno = false; } //else if (boleto.Remessa.TipoDocumento.Equals("06") && !String.IsNullOrEmpty(boleto.NossoNumero)) // vRetorno = false; else if (!boleto.EspecieDocumento.Codigo.Equals("A") && !boleto.EspecieDocumento.Codigo.Equals("B") && //B - Duplicata Rural; !boleto.EspecieDocumento.Codigo.Equals("C") && !boleto.EspecieDocumento.Codigo.Equals("D") && !boleto.EspecieDocumento.Codigo.Equals("E") && //E - Nota de Seguros; !boleto.EspecieDocumento.Codigo.Equals("F") && !boleto.EspecieDocumento.Codigo.Equals("H") && !boleto.EspecieDocumento.Codigo.Equals("I") && !boleto.EspecieDocumento.Codigo.Equals("J") && !boleto.EspecieDocumento.Codigo.Equals("O") && !boleto.EspecieDocumento.Codigo.Equals("K") ) { vMsg += String.Concat("Boleto: ", boleto.NumeroDocumento.Trim(), "; Remessa: Informe o Código da EspécieDocumento! São Aceitas:{A,B,C,D,E,F,H,I,J,O,K}", Environment.NewLine); vRetorno = false; } else if (!boleto.Sacado.CPFCNPJ.Length.Equals(11) && !boleto.Sacado.CPFCNPJ.Length.Equals(14)) { vMsg += String.Concat("Boleto: ", boleto.NumeroDocumento.Trim(), "; Remessa: Cpf/Cnpj diferente de 11/14 caracteres!", Environment.NewLine); vRetorno = false; } else if (!boleto.NossoNumero.Length.Equals(8)) { vMsg += String.Concat("Boleto: ", boleto.NumeroDocumento.Trim(), "; Remessa: O Nosso Número diferente de 8 caracteres!", Environment.NewLine); vRetorno = false; } else if (!boleto.TipoImpressao.Equals("A") && !boleto.TipoImpressao.Equals("B")) { vMsg += String.Concat("Boleto: ", boleto.NumeroDocumento.Trim(), "; Tipo de Impressão deve conter A - Normal ou B - Carnê", Environment.NewLine); vRetorno = false; } else if (string.IsNullOrEmpty(boleto.Sacado.Endereco.CEP)) { vMsg += String.Concat("Boleto: ", boleto.NumeroDocumento.Trim(), "; CEP do Sacado inválido!", Environment.NewLine); vRetorno = false; } #endregion } #endregion } mensagem = vMsg; return vRetorno; } public string <API key>(int numeroConvenio, Cedente cedente, int <API key>) { try { TRegistroEDI reg = new TRegistroEDI(); reg.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.<API key>, 0001, 001, 0, "0", ' ')); //001-001 reg.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.<API key>, 0002, 001, 0, "1", ' ')); //002-002 reg.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.<API key>, 0003, 007, 0, "REMESSA", ' ')); //003-009 reg.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.<API key>, 0010, 002, 0, "01", ' ')); //010-011 reg.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.<API key>, 0012, 015, 0, "COBRANCA", ' ')); //012-026 reg.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.<API key>, 0027, 005, 0, cedente.ContaBancaria.Conta, ' ')); //027-031 reg.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.<API key>, 0032, 014, 0, cedente.CPFCNPJ, ' ')); //032-045 reg.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.<API key>, 0046, 031, 0, "", ' ')); //046-076 reg.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.<API key>, 0077, 003, 0, "748", ' ')); //077-079 reg.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.<API key>, 0080, 015, 0, "SICREDI", ' ')); //080-094 reg.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.<API key>, 0095, 008, 0, DateTime.Now, ' ')); //095-102 reg.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.<API key>, 0103, 008, 0, "", ' ')); //103-110 reg.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.<API key>, 0111, 007, 0, <API key>.ToString(), '0')); //111-117 reg.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.<API key>, 0118, 273, 0, "", ' ')); //118-390 reg.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.<API key>, 0391, 004, 0, "2.00", ' ')); //391-394 reg.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.<API key>, 0395, 006, 0, "000001", ' ')); //395-400 reg.CodificarLinha(); string vLinha = reg.LinhaRegistro; string _header = Utils.<API key>(vLinha); return _header; } catch (Exception ex) { throw new Exception("Erro ao gerar HEADER do arquivo de remessa do CNAB400.", ex); } } public string <API key>(Boleto boleto, int numeroRegistro, TipoArquivo tipoArquivo) { base.GerarDetalheRemessa(boleto, numeroRegistro, tipoArquivo); return <API key>(boleto, numeroRegistro, tipoArquivo); } public string <API key>(Boleto boleto, int numeroRegistro, TipoArquivo tipoArquivo) { try { TRegistroEDI reg = new TRegistroEDI(); reg.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.<API key>, 0001, 001, 0, "1", ' ')); //001-001 reg.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.<API key>, 0002, 001, 0, "A", ' ')); //002-002 'A' - SICREDI com Registro reg.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.<API key>, 0003, 001, 0, "A", ' ')); //003-003 'A' - Simples reg.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.<API key>, 0004, 001, 0, boleto.TipoImpressao, ' ')); reg.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.<API key>, 0005, 012, 0, string.Empty, ' ')); //005-016 reg.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.<API key>, 0017, 001, 0, "A", ' ')); //017-017 Tipo de moeda: 'A' - REAL reg.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.<API key>, 0018, 001, 0, "A", ' ')); //018-018 Tipo de desconto: 'A' - VALOR string CodJuros = "A"; decimal ValorOuPercJuros = 0; if (boleto.JurosMora > 0) { CodJuros = "A"; ValorOuPercJuros = boleto.JurosMora; } else if (boleto.PercJurosMora > 0) { CodJuros = "B"; ValorOuPercJuros = boleto.PercJurosMora; } #endregion reg.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.<API key>, 0019, 001, 0, CodJuros, ' ')); //019-019 Tipo de juros: 'A' - VALOR / 'B' PERCENTUAL reg.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.<API key>, 0020, 028, 0, string.Empty, ' ')); //020-047 string NossoNumero = boleto.NossoNumero.Replace("/", "").Replace("-", ""); // AA/BXXXXX-D string <API key> = NossoNumero; if (string.IsNullOrEmpty(boleto.DigitoNossoNumero) || NossoNumero.Length < 9) { boleto.DigitoNossoNumero = <API key>(boleto); <API key> = NossoNumero + boleto.DigitoNossoNumero; } reg.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.<API key>, 0048, 009, 0, <API key>, '0')); //048-056 #endregion reg.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.<API key>, 0057, 006, 0, string.Empty, ' ')); //057-062 reg.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.<API key>, 0063, 008, 0, boleto.DataProcessamento, ' ')); //063-070 reg.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.<API key>, 0071, 001, 0, string.Empty, ' ')); //071-071 reg.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.<API key>, 0072, 001, 0, "N", ' ')); reg.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.<API key>, 0073, 001, 0, string.Empty, ' ')); //073-073 reg.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.<API key>, 0074, 001, 0, "B", ' ')); if (boleto.TipoImpressao.Equals("A")) { reg.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.<API key>, 0075, 002, 0, 0, '0')); //075-076 reg.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.<API key>, 0077, 002, 0, 0, '0')); //077-078 } else if (boleto.TipoImpressao.Equals("B")) { reg.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.<API key>, 0075, 002, 0, boleto.NumeroParcela, '0')); //075-076 reg.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.<API key>, 0077, 002, 0, boleto.TotalParcela, '0')); //077-078 } reg.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.<API key>, 0079, 004, 0, string.Empty, ' ')); //079-082 reg.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.<API key>, 0083, 010, 2, boleto.<API key>, '0')); //083-092 reg.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.<API key>, 0093, 004, 2, boleto.PercMulta, '0')); //093-096 reg.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.<API key>, 0097, 012, 0, string.Empty, ' ')); //097-108 reg.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.<API key>, 0109, 002, 0, <API key>(boleto), ' ')); reg.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.<API key>, 0111, 010, 0, boleto.NumeroDocumento, ' ')); //111-120 reg.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.<API key>, 0121, 006, 0, boleto.DataVencimento, ' ')); //121-126 reg.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.<API key>, 0127, 013, 2, boleto.ValorBoleto, '0')); //127-139 reg.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.<API key>, 0140, 009, 0, string.Empty, ' ')); //140-148 var especieDoc = boleto.EspecieDocumento ?? new <API key>("A"); #endregion reg.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.<API key>, 0149, 001, 0, especieDoc.Codigo, ' ')); //149-149 reg.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.<API key>, 0150, 001, 0, boleto.Aceite, ' ')); //150-150 reg.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.<API key>, 0151, 006, 0, boleto.DataProcessamento, ' ')); //151-156 string vInstrucao1 = "00"; string vInstrucao2 = "00"; foreach (IInstrucao instrucao in boleto.Instrucoes) { switch ((<API key>)instrucao.Codigo) { case <API key>.<API key>: vInstrucao1 = "00"; vInstrucao2 = "00"; break; case <API key>.PedidoProtesto: vInstrucao1 = "06"; vInstrucao2 = Utils.FitStringLength(instrucao.QuantidadeDias.ToString(), 2, 2, '0', 0, true, true, true); break; } } reg.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.<API key>, 0157, 002, 0, vInstrucao1, '0')); //157-158 reg.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.<API key>, 0159, 002, 0, vInstrucao2, '0')); //159-160 #endregion reg.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.<API key>, 0161, 013, 2, ValorOuPercJuros, '0')); //161-173 Valor/% de juros por dia de atraso #region DataDesconto string vDataDesconto = "000000"; if (!boleto.DataDesconto.Equals(DateTime.MinValue)) vDataDesconto = boleto.DataDesconto.ToString("ddMMyy"); #endregion reg.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.<API key>, 0174, 006, 0, vDataDesconto, '0')); //174-179 reg.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.<API key>, 0180, 013, 2, boleto.ValorDesconto, '0')); //180-192 reg.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.<API key>, 0193, 013, 0, 0, '0')); //193-205 reg.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.<API key>, 0206, 013, 2, boleto.Abatimento, '0')); //206-218 string vCpfCnpjSac = "0"; if (boleto.Sacado.CPFCNPJ.Length.Equals(11)) vCpfCnpjSac = "1"; else if (boleto.Sacado.CPFCNPJ.Length.Equals(14)) vCpfCnpjSac = "2"; #endregion reg.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.<API key>, 0219, 001, 0, vCpfCnpjSac, '0')); //219-219 reg.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.<API key>, 0220, 001, 0, "0", '0')); //220-220 reg.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.<API key>, 0221, 014, 0, boleto.Sacado.CPFCNPJ, '0')); //221-234 reg.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.<API key>, 0235, 040, 0, boleto.Sacado.Nome.ToUpper(), ' ')); //235-274 reg.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.<API key>, 0275, 040, 0, boleto.Sacado.Endereco.<API key>.ToUpper(), ' ')); //275-314 reg.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.<API key>, 0315, 005, 0, 0, '0')); //315-319 reg.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.<API key>, 0320, 006, 0, 0, '0')); //320-325 reg.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.<API key>, 0326, 001, 0, string.Empty, ' ')); //326-326 reg.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.<API key>, 0327, 008, 0, boleto.Sacado.Endereco.CEP, '0')); //327-334 reg.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.<API key>, 0335, 005, 1, 0, '0')); //335-339 reg.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.<API key>, 0340, 014, 0, string.Empty, ' ')); //340-353 reg.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.<API key>, 0354, 041, 0, string.Empty, ' ')); //354-394 reg.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.<API key>, 0395, 006, 0, numeroRegistro, '0')); //395-400 reg.CodificarLinha(); string _detalhe = Utils.<API key>(reg.LinhaRegistro); return _detalhe; } catch (Exception ex) { throw new Exception("Erro ao gerar DETALHE do arquivo CNAB400.", ex); } } public string <API key>(int numeroRegistro, Cedente cedente) { try { TRegistroEDI reg = new TRegistroEDI(); reg.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.<API key>, 0001, 001, 0, "9", ' ')); //001-001 reg.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.<API key>, 0002, 001, 0, "1", ' ')); //002-002 reg.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.<API key>, 0003, 003, 0, "748", ' ')); //003-006 reg.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.<API key>, 0006, 005, 0, cedente.ContaBancaria.Conta, ' ')); //006-010 reg.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.<API key>, 0011, 384, 0, string.Empty, ' ')); //011-394 reg.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.<API key>, 0395, 006, 0, numeroRegistro, '0')); //395-400 reg.CodificarLinha(); string vLinha = reg.LinhaRegistro; string _trailer = Utils.<API key>(vLinha); return _trailer; } catch (Exception ex) { throw new Exception("Erro durante a geração do registro TRAILER do arquivo de REMESSA.", ex); } } private string LerMotivoRejeicao(string codigorejeicao) { var rejeicao = String.Empty; if (codigorejeicao.Length >= 2) { #region LISTA DE MOTIVOS List<String> ocorrencias = new List<string>(); ocorrencias.Add("01-Código do banco inválido"); ocorrencias.Add("02-Código do registro detalhe inválido"); ocorrencias.Add("03-Código da ocorrência inválido"); ocorrencias.Add("04-Código de ocorrência não permitida para a carteira"); ocorrencias.Add("05-Código de ocorrência não numérico"); ocorrencias.Add("07-Cooperativa/agência/conta/dígito inválidos"); ocorrencias.Add("08-Nosso número inválido"); ocorrencias.Add("09-Nosso número duplicado"); ocorrencias.Add("10-Carteira inválida"); ocorrencias.Add("14-Título protestado"); ocorrencias.Add("15-Cooperativa/carteira/agência/conta/nosso número inválidos"); ocorrencias.Add("16-Data de vencimento inválida"); ocorrencias.Add("17-Data de vencimento anterior à data de emissão"); ocorrencias.Add("18-Vencimento fora do prazo de operação"); ocorrencias.Add("20-Valor do título inválido"); ocorrencias.Add("21-Espécie do título inválida"); ocorrencias.Add("22-Espécie não permitida para a carteira"); ocorrencias.Add("24-Data de emissão inválida"); ocorrencias.Add("29-Valor do desconto maior/igual ao valor do título"); ocorrencias.Add("31-Concessão de desconto - existe desconto anterior"); ocorrencias.Add("33-Valor do abatimento inválido"); ocorrencias.Add("34-Valor do abatimento maior/igual ao valor do título"); ocorrencias.Add("36-Concessão de abatimento - existe abatimento anterior"); ocorrencias.Add("38-Prazo para protesto inválido"); ocorrencias.Add("39-Pedido para protesto não permitido para o título"); ocorrencias.Add("40-Título com ordem de protesto emitida"); ocorrencias.Add("41-Pedido cancelamento/sustação sem instrução de protesto"); ocorrencias.Add("44-Cooperativa de crédito/agência beneficiária não prevista"); ocorrencias.Add("45-Nome do pagador inválido"); ocorrencias.Add("46-Tipo/número de inscrição do pagador inválidos"); ocorrencias.Add("47-Endereço do pagador não informado"); ocorrencias.Add("48-CEP irregular"); ocorrencias.Add("49-Número de Inscrição do pagador/avalista inválido"); ocorrencias.Add("50-Pagador/avalista não informado"); ocorrencias.Add("60-Movimento para título não cadastrado"); ocorrencias.Add("63-Entrada para título já cadastrado"); ocorrencias.Add("A -Aceito"); ocorrencias.Add("A1-Praça do pagador não cadastrada."); ocorrencias.Add("A2-Tipo de cobrança do título divergente com a praça do pagador."); ocorrencias.Add("A3-Cooperativa/agência depositária divergente: atualiza o cadastro de praças da Coop./agência beneficiária"); ocorrencias.Add("A4-Beneficiário não cadastrado ou possui CGC/CIC inválido"); ocorrencias.Add("A5-Pagador não cadastrado"); ocorrencias.Add("A6-Data da instrução/ocorrência inválida"); ocorrencias.Add("A7-Ocorrência não pode ser comandada"); ocorrencias.Add("A8-Recebimento da liquidação fora da rede Sicredi - via compensação eletrônica"); ocorrencias.Add("B4-Tipo de moeda inválido"); ocorrencias.Add("B5-Tipo de desconto/juros inválido"); ocorrencias.Add("B6-Mensagem padrão não cadastrada"); ocorrencias.Add("B7-Seu número inválido"); ocorrencias.Add("B8-Percentual de multa inválido"); ocorrencias.Add("B9-Valor ou percentual de juros inválido"); ocorrencias.Add("C1-Data limite para concessão de desconto inválida"); ocorrencias.Add("C2-Aceite do título inválido"); ocorrencias.Add("C3-Campo alterado na instrução “31 – alteração de outros dados” inválido"); ocorrencias.Add("C4-Título ainda não foi confirmado pela centralizadora"); ocorrencias.Add("C5-Título rejeitado pela centralizadora"); ocorrencias.Add("C6-Título já liquidado"); ocorrencias.Add("C7-Título já baixado"); ocorrencias.Add("C8-Existe mesma instrução pendente de confirmação para este título"); ocorrencias.Add("C9-Instrução prévia de concessão de abatimento não existe ou não confirmada"); ocorrencias.Add("D -Desprezado"); ocorrencias.Add("D1-Título dentro do prazo de vencimento (em dia);"); ocorrencias.Add("D2-Espécie de documento não permite protesto de título"); ocorrencias.Add("D3-Título possui instrução de baixa pendente de confirmação"); ocorrencias.Add("D4-Quantidade de mensagens padrão excede o limite permitido"); ocorrencias.Add("D5-Quantidade inválida no pedido de boletos pré-impressos da cobrança sem registro"); ocorrencias.Add("D6-Tipo de impressão inválida para cobrança sem registro"); ocorrencias.Add("D7-Cidade ou Estado do pagador não informado"); ocorrencias.Add("D8-Seqüência para composição do nosso número do ano atual esgotada"); ocorrencias.Add("D9-Registro mensagem para título não cadastrado"); ocorrencias.Add("E2-Registro complementar ao cadastro do título da cobrança com e sem registro não cadastrado"); ocorrencias.Add("E3-Tipo de postagem inválido, diferente de S, N e branco"); ocorrencias.Add("E4-Pedido de boletos pré-impressos"); ocorrencias.Add("E5-Confirmação/rejeição para pedidos de boletos não cadastrado"); ocorrencias.Add("E6-Pagador/avalista não cadastrado"); ocorrencias.Add("E7-Informação para atualização do valor do título para protesto inválido"); ocorrencias.Add("E8-Tipo de impressão inválido, diferente de A, B e branco"); ocorrencias.Add("E9-Código do pagador do título divergente com o código da cooperativa de crédito"); ocorrencias.Add("F1-Liquidado no sistema do cliente"); ocorrencias.Add("F2-Baixado no sistema do cliente"); ocorrencias.Add("F3-Instrução inválida, este título está caucionado/descontado"); ocorrencias.Add("F4-Instrução fixa com caracteres inválidos"); ocorrencias.Add("F6-Nosso número / número da parcela fora de seqüência – total de parcelas inválido"); ocorrencias.Add("F7-Falta de comprovante de prestação de serviço"); ocorrencias.Add("F8-Nome do beneficiário incompleto / incorreto."); ocorrencias.Add("F9-CNPJ / CPF incompatível com o nome do pagador / Sacador Avalista"); ocorrencias.Add("G1-CNPJ / CPF do pagador Incompatível com a espécie"); ocorrencias.Add("G2-Título aceito: sem a assinatura do pagador"); ocorrencias.Add("G3-Título aceito: rasurado ou rasgado"); ocorrencias.Add("G4-Título aceito: falta título (cooperativa/ag. beneficiária deverá enviá-lo);"); ocorrencias.Add("G5-Praça de pagamento incompatível com o endereço"); ocorrencias.Add("G6-Título aceito: sem endosso ou beneficiário irregular"); ocorrencias.Add("G7-Título aceito: valor por extenso diferente do valor numérico"); ocorrencias.Add("G8-Saldo maior que o valor do título"); ocorrencias.Add("G9-Tipo de endosso inválido"); ocorrencias.Add("H1-Nome do pagador incompleto / Incorreto"); ocorrencias.Add("H2-Sustação judicial"); ocorrencias.Add("H3-Pagador não encontrado"); ocorrencias.Add("H4-Alteração de carteira"); ocorrencias.Add("H5-Recebimento de liquidação fora da rede Sicredi – VLB Inferior – Via Compensação"); ocorrencias.Add("H6-Recebimento de liquidação fora da rede Sicredi – VLB Superior – Via Compensação"); ocorrencias.Add("H7-Espécie de documento necessita beneficiário ou avalista PJ"); ocorrencias.Add("H8-Recebimento de liquidação fora da rede Sicredi – Contingência Via Compe"); ocorrencias.Add("H9-Dados do título não conferem com disquete"); ocorrencias.Add("I1-Pagador e Sacador Avalista são a mesma pessoa"); ocorrencias.Add("I2-Aguardar um dia útil após o vencimento para protestar"); ocorrencias.Add("I3-Data do vencimento rasurada"); ocorrencias.Add("I4-Vencimento – extenso não confere com número"); ocorrencias.Add("I5-Falta data de vencimento no título"); ocorrencias.Add("I6-DM/DMI sem comprovante autenticado ou declaração"); ocorrencias.Add("I7-Comprovante ilegível para conferência e microfilmagem"); ocorrencias.Add("I8-Nome solicitado não confere com emitente ou pagador"); ocorrencias.Add("I9-Confirmar se são 2 emitentes. Se sim, indicar os dados dos 2"); ocorrencias.Add("J1-Endereço do pagador igual ao do pagador ou do portador"); ocorrencias.Add("J2-Endereço do apresentante incompleto ou não informado"); ocorrencias.Add("J3-Rua/número inexistente no endereço"); ocorrencias.Add("J4-Falta endosso do favorecido para o apresentante"); ocorrencias.Add("J5-Data da emissão rasurada"); ocorrencias.Add("J6-Falta assinatura do pagador no título"); ocorrencias.Add("J7-Nome do apresentante não informado/incompleto/incorreto"); ocorrencias.Add("J8-Erro de preenchimento do titulo"); ocorrencias.Add("J9-Titulo com direito de regresso vencido"); ocorrencias.Add("K1-Titulo apresentado em duplicidade"); ocorrencias.Add("K2-Titulo já protestado"); ocorrencias.Add("K3-Letra de cambio vencida – falta aceite do pagador"); ocorrencias.Add("K4-Falta declaração de saldo assinada no título"); ocorrencias.Add("K5-Contrato de cambio – Falta conta gráfica"); ocorrencias.Add("K6-Ausência do documento físico"); ocorrencias.Add("K7-Pagador falecido"); ocorrencias.Add("K8-Pagador apresentou quitação do título"); ocorrencias.Add("K9-Título de outra jurisdição territorial"); ocorrencias.Add("L1-Título com emissão anterior a concordata do pagador"); ocorrencias.Add("L2-Pagador consta na lista de falência"); ocorrencias.Add("L3-Apresentante não aceita publicação de edital"); ocorrencias.Add("L4-Dados do Pagador em Branco ou inválido"); ocorrencias.Add("L5-Código do Pagador na agência beneficiária está duplicado"); ocorrencias.Add("M1-Reconhecimento da dívida pelo pagador"); ocorrencias.Add("M2-Não reconhecimento da dívida pelo pagador"); ocorrencias.Add("M3-Inclusão de desconto 2 e desconto 3 inválida"); ocorrencias.Add("X0-Pago com cheque"); ocorrencias.Add("X1-Regularização centralizadora – Rede Sicredi"); ocorrencias.Add("X2-Regularização centralizadora – Compensação"); ocorrencias.Add("X3-Regularização centralizadora – Banco correspondente"); ocorrencias.Add("X4-Regularização centralizadora - VLB Inferior - via compensação"); ocorrencias.Add("X5-Regularização centralizadora - VLB Superior - via compensação"); ocorrencias.Add("X6-Pago com cheque – bloqueado 24 horas"); ocorrencias.Add("X7-Pago com cheque – bloqueado 48 horas"); ocorrencias.Add("X8-Pago com cheque – bloqueado 72 horas"); ocorrencias.Add("X9-Pago com cheque – bloqueado 96 horas"); ocorrencias.Add("XA-Pago com cheque – bloqueado 120 horas"); ocorrencias.Add("XB-Pago com cheque – bloqueado 144 horas"); #endregion var ocorrencia = (from s in ocorrencias where s.Substring(0, 2) == codigorejeicao.Substring(0, 2) select s).FirstOrDefault(); if (ocorrencia != null) rejeicao = ocorrencia; } return rejeicao; } private string <API key>(string codigorejeicao) { var rejeicao = String.Empty; if (codigorejeicao.Length >= 2) { #region LISTA DE MOTIVOS List<String> ocorrencias = new List<string>(); ocorrencias.Add("03-Tarifa de sustação"); ocorrencias.Add("04-Tarifa de protesto"); ocorrencias.Add("08-Tarifa de custas de protesto"); ocorrencias.Add("A9-Tarifa de manutenção de título vencido"); ocorrencias.Add("B1-Tarifa de baixa da carteira"); ocorrencias.Add("B3-Tarifa de registro de entrada do título"); ocorrencias.Add("F5-Tarifa de entrada na rede Sicredi"); ocorrencias.Add("S4-Tarifa de Inclusão Negativação"); ocorrencias.Add("S5-Tarifa de Exclusão Negativação"); #endregion var ocorrencia = (from s in ocorrencias where s.Substring(0, 2) == codigorejeicao.Substring(0, 2) select s).FirstOrDefault(); if (ocorrencia != null) rejeicao = ocorrencia; } return rejeicao; } public override DetalheRetorno <API key>(string registro) { try { <API key> reg = new <API key>(); reg.LinhaRegistro = registro; reg.DecodificarLinha(); //Passa para o detalhe as propriedades de reg; DetalheRetorno detalhe = new DetalheRetorno(registro); detalhe.<API key> = Utils.ToInt32(reg.<API key>); //Filler1 //TipoCobranca //<API key> detalhe.NomeSacado = reg.<API key>; //BoletoDDA //Filler2 #region NossoNumeroSicredi detalhe.NossoNumeroComDV = reg.NossoNumeroSicredi; detalhe.NossoNumero = reg.NossoNumeroSicredi.Substring(0, reg.NossoNumeroSicredi.Length - 1); detalhe.DACNossoNumero = reg.NossoNumeroSicredi.Substring(reg.NossoNumeroSicredi.Length - 1); //DV do Nosso Numero #endregion //Filler3 detalhe.CodigoOcorrencia = Utils.ToInt32(reg.Ocorrencia); int dataOcorrencia = Utils.ToInt32(reg.DataOcorrencia); detalhe.DataOcorrencia = Utils.ToDateTime(dataOcorrencia.ToString(" detalhe.DescricaoOcorrencia = new CodigoMovimento(748, detalhe.CodigoOcorrencia).Descricao; detalhe.NumeroDocumento = reg.SeuNumero; //Filler4 if (!String.IsNullOrEmpty(reg.DataVencimento)) { int dataVencimento = Utils.ToInt32(reg.DataVencimento); detalhe.DataVencimento = Utils.ToDateTime(dataVencimento.ToString(" } decimal valorTitulo = Convert.ToInt64(reg.ValorTitulo); detalhe.ValorTitulo = valorTitulo / 100; //Filler5 if (!String.IsNullOrEmpty(reg.DespesasCobranca)) { decimal valorDespesa = Convert.ToUInt64(reg.DespesasCobranca); detalhe.ValorDespesa = valorDespesa / 100; } //Outras despesas Custas de Protesto (Valor Outras Despesas) if (!String.IsNullOrEmpty(reg.<API key>)) { decimal valorOutrasDespesas = Convert.ToUInt64(reg.<API key>); detalhe.ValorOutrasDespesas = valorOutrasDespesas / 100; } //Filler6 decimal valorAbatimento = Convert.ToUInt64(reg.AbatimentoConcedido); detalhe.ValorAbatimento = valorAbatimento / 100; //Desconto Concedido (Valor Desconto Concedido) decimal valorDesconto = Convert.ToUInt64(reg.DescontoConcedido); detalhe.Descontos = valorDesconto / 100; //Valor Pago decimal valorPago = Convert.ToUInt64(reg.<API key>); detalhe.ValorPago = valorPago / 100; //Juros Mora decimal jurosMora = Convert.ToUInt64(reg.JurosMora); detalhe.JurosMora = jurosMora / 100; //Filler7 //SomenteOcorrencia19 //Filler8 detalhe.<API key> = reg.MotivoOcorrencia; int dataCredito = Utils.ToInt32(reg.<API key>); detalhe.DataCredito = Utils.ToDateTime(dataCredito.ToString(" //Filler9 detalhe.NumeroSequencial = Utils.ToInt32(reg.<API key>); #region NAO RETORNADOS PELO SICREDI detalhe.OutrosCreditos = 0; detalhe.OrigemPagamento = String.Empty; detalhe.<API key> = reg.MotivoOcorrencia; detalhe.IOF = 0; if (detalhe.CodigoOcorrencia == 28) { detalhe.MotivosRejeicao = <API key>(detalhe.<API key>); } else { detalhe.MotivosRejeicao = LerMotivoRejeicao(detalhe.<API key>); } detalhe.NumeroCartorio = 0; detalhe.NumeroProtocolo = string.Empty; detalhe.CodigoInscricao = 0; detalhe.NumeroInscricao = string.Empty; detalhe.Agencia = 0; detalhe.Conta = header.Conta; detalhe.DACConta = header.DACConta; detalhe.NumeroControle = string.Empty; detalhe.IdentificacaoTitulo = string.Empty; //Banco Cobrador detalhe.CodigoBanco = 0; detalhe.AgenciaCobradora = 0; #endregion return detalhe; } catch (Exception ex) { throw new Exception("Erro ao ler detalhe do arquivo de RETORNO / CNAB 400.", ex); } } public override HeaderRetorno <API key>(string registro) { try { header = new HeaderRetorno(registro); header.TipoRegistro = Utils.ToInt32(registro.Substring(000, 1)); header.CodigoRetorno = Utils.ToInt32(registro.Substring(001, 1)); header.LiteralRetorno = registro.Substring(002, 7); header.CodigoServico = Utils.ToInt32(registro.Substring(009, 2)); header.LiteralServico = registro.Substring(011, 15); string _conta = registro.Substring(026, 5); header.Conta = Utils.ToInt32(_conta.Substring(0, _conta.Length - 1)); header.DACConta = Utils.ToInt32(_conta.Substring(_conta.Length - 1)); header.<API key> = registro.Substring(031, 14); header.CodigoBanco = Utils.ToInt32(registro.Substring(076, 3)); header.NomeBanco = registro.Substring(079, 15); header.DataGeracao = Utils.ToDateTime(Utils.ToInt32(registro.Substring(094, 8)).ToString(" header.<API key> = Utils.ToInt32(registro.Substring(110, 7)); header.Versao = registro.Substring(390, 5); header.NumeroSequencial = Utils.ToInt32(registro.Substring(394, 6)); return header; } catch (Exception ex) { throw new Exception("Erro ao ler header do arquivo de RETORNO / CNAB 400.", ex); } } #endregion public override long <API key>(long convenio, string nossoNumero) { long num; if (nossoNumero.Length >= 8 && long.TryParse(nossoNumero.Substring(0, 8), out num)) { return num; } throw new BoletoNetException("Nosso número é inválido!"); } } }
#include "unique_store.hpp" #include "buffer_type.hpp" namespace vespalib::datastore { using namespace btree; <API key>(AtomicEntryRef, NoAggregated, uniquestore::<API key>::INTERNAL_SLOTS); <API key>(AtomicEntryRef, BTreeNoLeafData, NoAggregated, uniquestore::<API key>::LEAF_SLOTS); }
# encoding: UTF-8 # This file is auto-generated from the current state of the database. Instead # of editing this file, please use the migrations feature of Active Record to # incrementally modify your database, and then regenerate this schema definition. # Note that this schema.rb definition is the authoritative source for your # database schema. If you need to create the application database on another # system, you should be using db:schema:load, not running all the migrations # from scratch. The latter is a flawed and unsustainable approach (the more migrations # you'll amass, the slower it'll run and the greater likelihood for issues). # It's strongly recommended that you check this file into your version control system. ActiveRecord::Schema.define(version: 20160404034541) do create_table "users", force: :cascade do |t| t.string "email" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.string "password_hash" t.string "password_salt" t.string "role" t.string "username" t.text "description" t.string "skype" t.string "photo_file_name" t.string "photo_content_type" t.integer "photo_file_size" t.datetime "photo_updated_at" end end
package com.mesosphere.sdk.specification.yaml; import com.github.mustachejava.<API key>; import com.github.mustachejava.Mustache; import com.github.mustachejava.MustacheFactory; import com.mesosphere.sdk.offer.CommonTaskUtils; import org.apache.commons.collections.map.HashedMap; import org.apache.commons.io.FileUtils; import com.mesosphere.sdk.specification.DefaultServiceSpec; import static com.mesosphere.sdk.specification.yaml.<API key>.*; import static org.mockito.Mockito.when; import com.mesosphere.sdk.testutils.<API key>; import com.mesosphere.sdk.testutils.TestConstants; import org.junit.Assert; import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.junit.contrib.java.lang.system.<API key>; import org.mockito.Mock; import org.mockito.MockitoAnnotations; import java.io.File; import java.io.StringReader; import java.io.StringWriter; import java.io.Writer; import java.util.ArrayList; import java.util.HashMap; import java.util.Map; import java.util.function.Function; public class <API key> { @Rule public final <API key> <API key> = <API key>.<API key>(); @Mock private FileReader mockFileReader; @Before public void beforeEach() { MockitoAnnotations.initMocks(this); } @Test public void <API key>() throws Exception { ClassLoader classLoader = getClass().getClassLoader(); File file = new File(classLoader.getResource("valid-exhaustive.yml").getFile()); when(mockFileReader.read("config-one.conf.mustache")).thenReturn("hello"); when(mockFileReader.read("config-two.xml.mustache")).thenReturn("hey"); when(mockFileReader.read("config-three.conf.mustache")).thenReturn("hi"); DefaultServiceSpec serviceSpec = generateServiceSpec(<API key>(file), mockFileReader); Assert.assertNotNull(serviceSpec); Assert.assertEquals(TestConstants.PORT_API_VALUE, Integer.valueOf(serviceSpec.getApiPort())); } @Test public void testMustache() throws Exception { final Map<String, String> env = new HashMap<String, String>() {{ put("DISKS", "PATH,/mnt/data_1,data-1,1000;PATH,/mnt/data_2,data-2,1000;PATH,/mnt/data_3,data-3,1000"); put("<API key>", "DISKS"); put("<API key>", "outputDisks"); }}; Writer w = new StringWriter(); MustacheFactory mf = new <API key>(); String template = "{{#ParseDisks}}{{/ParseDisks}}\n" + "{{#outputDisks}}\n" + "{{Path}}: \n" + " type: {{Type}}\n" + " path: {{Path}}\n" + " root: {{Root}}\n" + " size: {{Size}}\n" + "{{/outputDisks}}"; Writer w2 = CommonTaskUtils.executeMustache(w, template, env); System.out.println(w2.toString()); } @Test public void <API key>() throws Exception { ClassLoader classLoader = getClass().getClassLoader(); File file = new File(classLoader.getResource("valid-exhaustive.yml").getFile()); RawServiceSpec rawServiceSpec = <API key>(file); Assert.assertNotNull(rawServiceSpec); Assert.assertEquals(TestConstants.PORT_API_VALUE, rawServiceSpec.getScheduler().getApiPort()); } @Test public void <API key>() throws Exception { ClassLoader classLoader = getClass().getClassLoader(); File file = new File(classLoader.getResource("valid-exhaustive.yml").getFile()); String yaml = FileUtils.readFileToString(file); RawServiceSpec rawServiceSpec = <API key>(yaml); Assert.assertNotNull(rawServiceSpec); Assert.assertEquals(TestConstants.PORT_API_VALUE, rawServiceSpec.getScheduler().getApiPort()); } }
{% extends 'core/wide.html' %} {% load staticfiles %} {% load compress %} {% load i18n %} {% block headextra %} {% compress css %} <link rel="stylesheet" type="text/x-scss" href="{% static 'tap/css/examples.scss' %}" /> {% endcompress css %} {% endblock %} {% block htmlargs %}version="XHTML+RDFa 1.1" xmlns="http: {% block bodyargs %}vocab="ivo://ivoa.net/std/DALI-examples"{% endblock %} {% block wide %} <h1>{% trans 'Examples' %}</h1> {% for example in examples %} <div id="example-{{ example.id }}" resource="#example-{{ example.id }}" typeof="example" class="<API key>"> <h2 property="name">{{ example.name }}</h2> <p property="description">{{ example.description }}</p> <pre property="query">{{ example.query_string }}</pre> </div> {% endfor %} {% endblock %}
"""Script to add DNS records to TinyDNS""" import logging import os import subprocess DEFAULT_NS_TTL = 600 DEFAULT_TTL = 60 DEFAULT_WEIGHT = 10 DEFAULT_PRIORITY = 10 _LOGGER = logging.getLogger(__name__) class TinyDnsClient(object): """Helper class to call tinyDNS""" def __init__(self, dns_path): self.dns_path = dns_path self.dns_data = os.path.join(dns_path, 'data') def process_number(self, number): """Process number for TinyDNS records. Represents number in 3 length octals. If number is larger than 256, the first octal represents multiples of 256 and the second represents the leftover.""" high_number = 0 if number - 256 >= 0: high_number = int(number / 256) number -= high_number * 256 output = r'\%.3o' % high_number output += r'\%.3o' % number return output def process_target(self, target): """Replaces the periods in target record with a 3 length octal representing the length of the block""" output = "" target_blocks = target.split('.') for block in target_blocks: output += r'\%.3o' % len(block) + block return output def add_ns(self, record, addr, ttl=DEFAULT_NS_TTL): """Add a Name Server record""" ns_format = '.%s:%s:a:%d\n' with open(self.dns_data, 'a') as f: f.write(ns_format % (record, addr, ttl)) def add_srv(self, record, target, port, prio=DEFAULT_PRIORITY, weight=DEFAULT_WEIGHT, ttl=DEFAULT_TTL): """Add a SRV record""" # 33 indicates SRV record # \000 indicates end of target name srv_format = r':%s:33:%s%s%s%s\000:%d' prio = self.process_number(prio) weight = self.process_number(weight) port = self.process_number(port) target = self.process_target(target) with open(self.dns_data, 'a') as f: f.write(srv_format % (record, prio, weight, port, target, ttl)) f.write('\n') def make_cdb(self): """Calls the make file used by TinyDNS to create the data.cdb file used to find DNS records""" subprocess.Popen(['make'], stdout=subprocess.PIPE, cwd=self.dns_path) def clear_records(self): """Clear all stored records""" open(self.dns_data, 'w').close()
# KubernetesJsClient.<API key> ## Properties Name | Type | Description | Notes **group** | **String** | Group to map volume access to Default is no group | [optional] **readOnly** | **Boolean** | ReadOnly here will force the Quobyte volume to be mounted with read-only permissions. Defaults to false. | [optional] **registry** | **String** | Registry represents a single or multiple Quobyte Registry services specified as a string as host:port pair (multiple entries are separated with commas) which acts as the central registry for volumes | **user** | **String** | User to map volume access to Defaults to serivceaccount user | [optional] **volume** | **String** | Volume is a string that references an already created Quobyte volume by name. |
<!DOCTYPE html> <html> <head> <title>Calculation Graph</title> <script src="https://cdnjs.cloudflare.com/ajax/libs/vis/4.7.0/vis.min.js"></script> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/vis/4.7.0/vis.min.css"> <script src="<API key>.js"></script> </head> <body> <div id="graph"></div> <script type="text/javascript"> // create a network var container = document.getElementById('graph'); var data = { nodes: nodes, edges: edges }; var options = { height: '900px', nodes: { shape: 'box' }, edges: { arrows: {to: {scaleFactor: 1}}, smooth: { enabled: true, type: 'curvedCW', roundness: 0.1 } }, layout: { hierarchical: { enabled: false, direction: 'LR', sortMethod: 'directed' } }, physics: { enabled: true, solver: 'forceAtlas2Based' }, interaction: {dragNodes: true} }; var network = new vis.Network(container, data, options); network.on("<API key>", function (params) { this.setOptions({physics:{enabled: false}}); }); </script> </body> </html>
<!DOCTYPE HTML PUBLIC "- <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc --> <title>WebdavFileSystem.StreamToFileWriter (xenon-2.3.0 2.6.1 API for Xenon developers)</title> <link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style"> <script type="text/javascript" src="../../../../../../script.js"></script> </head> <body> <script type="text/javascript"><! try { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="WebdavFileSystem.StreamToFileWriter (xenon-2.3.0 2.6.1 API for Xenon developers)"; } } catch(err) { } var methods = {"i0":10}; var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]}; var altColor = "altColor"; var rowColor = "rowColor"; var tableTab = "tableTab"; var activeTableTab = "activeTableTab"; </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <div class="topNav"><a name="navbar.top"> </a> <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.top.firstrow"> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../../index-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="../../../../../../nl/esciencecenter/xenon/adaptors/filesystems/webdav/WebdavFileSystem.html" title="class in nl.esciencecenter.xenon.adaptors.filesystems.webdav"><span class="typeNameLink">Prev&nbsp;Class</span></a></li> <li>Next&nbsp;Class</li> </ul> <ul class="navList"> <li><a href="../../../../../../index.html?nl/esciencecenter/xenon/adaptors/filesystems/webdav/WebdavFileSystem.StreamToFileWriter.html" target="_top">Frames</a></li> <li><a href="WebdavFileSystem.StreamToFileWriter.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> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li><a href="#nested.classes.inherited.from.class.java.lang.Thread">Nested</a>&nbsp;|&nbsp;</li> <li><a href="#field.summary">Field</a>&nbsp;|&nbsp;</li> <li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#method.summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li><a href="#field.detail">Field</a>&nbsp;|&nbsp;</li> <li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#method.detail">Method</a></li> </ul> </div> <a name="skip.navbar.top"> </a></div> <div class="header"> <div class="subTitle">nl.esciencecenter.xenon.adaptors.filesystems.webdav</div> <h2 title="Class WebdavFileSystem.StreamToFileWriter" class="title">Class WebdavFileSystem.StreamToFileWriter</h2> </div> <div class="contentContainer"> <ul class="inheritance"> <li>java.lang.Object</li> <li> <ul class="inheritance"> <li>java.lang.Thread</li> <li> <ul class="inheritance"> <li>nl.esciencecenter.xenon.adaptors.filesystems.webdav.WebdavFileSystem.StreamToFileWriter</li> </ul> </li> </ul> </li> </ul> <div class="description"> <ul class="blockList"> <li class="blockList"> <dl> <dt>All Implemented Interfaces:</dt> <dd>java.lang.Runnable</dd> </dl> <dl> <dt>Enclosing class:</dt> <dd><a href="../../../../../../nl/esciencecenter/xenon/adaptors/filesystems/webdav/WebdavFileSystem.html" title="class in nl.esciencecenter.xenon.adaptors.filesystems.webdav">WebdavFileSystem</a></dd> </dl> <hr> <br> <pre>class <span class="typeNameLabel">WebdavFileSystem.StreamToFileWriter</span> extends java.lang.Thread</pre> </li> </ul> </div> <div class="summary"> <ul class="blockList"> <li class="blockList"> <ul class="blockList"> <li class="blockList"><a name="nested.class.summary"> </a> <h3>Nested Class Summary</h3> <ul class="blockList"> <li class="blockList"><a name="nested.classes.inherited.from.class.java.lang.Thread"> </a> <h3>Nested classes/interfaces inherited from class&nbsp;java.lang.Thread</h3> <code>java.lang.Thread.State, java.lang.Thread.<API key></code></li> </ul> </li> </ul> <ul class="blockList"> <li class="blockList"><a name="field.summary"> </a> <h3>Field Summary</h3> <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation"> <caption><span>Fields</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Field and Description</th> </tr> <tr class="altColor"> <td class="colFirst"><code>private java.io.InputStream</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../nl/esciencecenter/xenon/adaptors/filesystems/webdav/WebdavFileSystem.StreamToFileWriter.html#in">in</a></span></code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><code>private java.lang.String</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../nl/esciencecenter/xenon/adaptors/filesystems/webdav/WebdavFileSystem.StreamToFileWriter.html#url">url</a></span></code>&nbsp;</td> </tr> </table> <ul class="blockList"> <li class="blockList"><a name="fields.inherited.from.class.java.lang.Thread"> </a> <h3>Fields inherited from class&nbsp;java.lang.Thread</h3> <code>MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY</code></li> </ul> </li> </ul> <ul class="blockList"> <li class="blockList"><a name="constructor.summary"> </a> <h3>Constructor Summary</h3> <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation"> <caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colOne" scope="col">Constructor and Description</th> </tr> <tr class="altColor"> <td class="colOne"><code><span class="memberNameLink"><a href="../../../../../../nl/esciencecenter/xenon/adaptors/filesystems/webdav/WebdavFileSystem.StreamToFileWriter.html#<API key>.lang.String-java.io.InputStream-">StreamToFileWriter</a></span>(java.lang.String&nbsp;url, java.io.InputStream&nbsp;in)</code>&nbsp;</td> </tr> </table> </li> </ul> <ul class="blockList"> <li class="blockList"><a name="method.summary"> </a> <h3>Method Summary</h3> <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> <caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tr id="i0" class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../nl/esciencecenter/xenon/adaptors/filesystems/webdav/WebdavFileSystem.StreamToFileWriter.html#run--">run</a></span>()</code>&nbsp;</td> </tr> </table> <ul class="blockList"> <li class="blockList"><a name="methods.inherited.from.class.java.lang.Thread"> </a> <h3>Methods inherited from class&nbsp;java.lang.Thread</h3> <code>activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, <API key>, <API key>, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, <API key>, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, <API key>, setDaemon, <API key>, setName, setPriority, <API key>, sleep, sleep, start, stop, stop, suspend, toString, yield</code></li> </ul> <ul class="blockList"> <li class="blockList"><a name="methods.inherited.from.class.java.lang.Object"> </a> <h3>Methods inherited from class&nbsp;java.lang.Object</h3> <code>equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait</code></li> </ul> </li> </ul> </li> </ul> </div> <div class="details"> <ul class="blockList"> <li class="blockList"> <ul class="blockList"> <li class="blockList"><a name="field.detail"> </a> <h3>Field Detail</h3> <a name="url"> </a> <ul class="blockList"> <li class="blockList"> <h4>url</h4> <pre>private final&nbsp;java.lang.String url</pre> </li> </ul> <a name="in"> </a> <ul class="blockListLast"> <li class="blockList"> <h4>in</h4> <pre>private final&nbsp;java.io.InputStream in</pre> </li> </ul> </li> </ul> <ul class="blockList"> <li class="blockList"><a name="constructor.detail"> </a> <h3>Constructor Detail</h3> <a name="<API key>.lang.String-java.io.InputStream-"> </a> <ul class="blockListLast"> <li class="blockList"> <h4>StreamToFileWriter</h4> <pre>StreamToFileWriter(java.lang.String&nbsp;url, java.io.InputStream&nbsp;in)</pre> </li> </ul> </li> </ul> <ul class="blockList"> <li class="blockList"><a name="method.detail"> </a> <h3>Method Detail</h3> <a name="run </a> <ul class="blockListLast"> <li class="blockList"> <h4>run</h4> <pre>public&nbsp;void&nbsp;run()</pre> <dl> <dt><span class="<API key>">Specified by:</span></dt> <dd><code>run</code>&nbsp;in interface&nbsp;<code>java.lang.Runnable</code></dd> <dt><span class="<API key>">Overrides:</span></dt> <dd><code>run</code>&nbsp;in class&nbsp;<code>java.lang.Thread</code></dd> </dl> </li> </ul> </li> </ul> </li> </ul> </div> </div> <div class="bottomNav"><a name="navbar.bottom"> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.bottom.firstrow"> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../../index-all.html">Index</a></li> <li><a href="../../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../../../nl/esciencecenter/xenon/adaptors/filesystems/webdav/WebdavFileSystem.html" title="class in nl.esciencecenter.xenon.adaptors.filesystems.webdav"><span class="typeNameLink">Prev&nbsp;Class</span></a></li> <li>Next&nbsp;Class</li> </ul> <ul class="navList"> <li><a href="../../../../../../index.html?nl/esciencecenter/xenon/adaptors/filesystems/webdav/WebdavFileSystem.StreamToFileWriter.html" target="_top">Frames</a></li> <li><a href="WebdavFileSystem.StreamToFileWriter.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> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li><a href="#nested.classes.inherited.from.class.java.lang.Thread">Nested</a>&nbsp;|&nbsp;</li> <li><a href="#field.summary">Field</a>&nbsp;|&nbsp;</li> <li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#method.summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li><a href="#field.detail">Field</a>&nbsp;|&nbsp;</li> <li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#method.detail">Method</a></li> </ul> </div> <a name="skip.navbar.bottom"> </a></div> </body> </html>
# Data architecture Design pattern for a data architecture. To put it simple, this is a standard to build a scalable & universal data architecture. ## Requirements * work in multiple environments (node and browser) * scalable and interchangable ## Definitions * app: an application (node server, or client browser) that requires data from a store. * client: the user's system (the browser) * server: the website server (node js) * store: a repository for storing and retrieving data * memory store: A store that caches in memory. * persistant store: A store that accesses data from a file or database. * Fetch: intermediary between an app and a dispatcher. Fetch needs to be universal for use on Node servers and browsers. * dispatcher: intermediary between stores and clients * repository: the place where information is stored. Could be a simple in memory array, sql db, json file, etc. ## Examples SPA webapp with server side rendering # Example 1: server side rendering 1. User goes to a website to read an article 2. The browser will request the webpage 3. The server will build the page using RiotJs. 4. RiotJs performs a fetch of the information. (Fetch realizes it's on a Node server and interprets the request to the proper dispatcher) 5. (The servers dispatcher has two stores, a memory store and a persistant store) The dispatcher will make a request to the memory store for the article. 6. The memory store checks its repository and doesn't have the information. It returns an error (404 NOT FOUND) to the dispatcher. 7. The dispatcher makes a request to the persistent store for the article. 8. The persistent store checks its repository and has the article. 9. The persistent store returns the article to the dispatcher. 10. The dispatcher performs a request to the memory store to store the article in memory. 11. The memory store receives the request and saves the article to its repository. (the memory store returns a success response. The dispatcher doesn't care, it has already moved on.) 12. The dispatcher returns the information to the controller. 13. The controller returns the information to RiotJs. 14. RiotJs inputs the information into the view. 15. RiotJs sends the HTML to the client. # Example 2: client side rendering 1. User is on the blog home with a list of articles. The webapp (RiotJs) has loaded. 2. User follows a link to another page to read an article. (RiotJs client side routing kicks in) 3. RiotJs makes a fetch request for the article. (Fetch realizes it's on a browser and interprets the request to the proper dispatcher) 4. (The client dispatcher has two stores, a memory store and a peristant store on a server across HTTP) The dispatcher will make a request to the memory store for the article. 5. The memory store checks its repository and doesn't have the information. It returns an error (404 NOT FOUND) to the dispatcher. 6. The dispatcher makes a request to the persistent store for the article (sending a JSON request to a Node server). 7. The Node server receives the request. 8. The Node server performs the same actions from *example 1*. It will pass the request to the dispatcher. The dispatcher will check each store looking for the information. The dispatcher will return the article to the client dispatcher. 9. The client will receive the article. 10. The memory store receives the request and saves the article to its repository. (the memory store returns a success response. The dispatcher doesn't care, it has already moved on.) 11. The dispatcher returns the information to the controller. 12. The controller returns the information to RiotJs. 13. RiotJs inputs the information into the view. Additional considerations The examples above did not account for: * authentication * models & schemas * queries * RiotJs is starting both systems. But I may chose Angular, or something else. DIfferent frameworks will require different libraries Extended Definitions * app: an application that requires data from a store. Apps may be located in web browsers or NodeJs servers. * client: the user's system (the browser) * server: the website server (node js) * store: a repository for storing and retrieving data * memory store: A store that caches in memory. * persistant store: A store that accesses data from a file or database. * Fetch: intermediary between an app and a dispatcher. Fetch needs to be universal for use on Node servers and browsers. * dispatcher: intermediary between stores and clients * repository: the place where information is stored. Could be a simple in memory array, sql db, json file, etc. * catalog: AKA query catalog. A list of queries that can be performed. The catalog should be shared between all services. * Service: generic meaning each piece (store, dispatcher, app, etc) * controller: An API for an app to communicate with the datastore architecture. A controller will expose the datastores to the app. Different endpoints may need to be generated for different frameworks. * store tunnel: When 2 stores communicate with one another they create a store tunnel. if a client needs information from a server the client will use a local store to communicate with a remote store. * gateway store: a store who routes requests and responses to another store (typically a reverse proxy store) * reverse proxy store: a store who accepts messages and delivers them to a dispatcher. * downstream store: dispatchers will use two stores (1 memory store & 1 persistant store). The simple idea of: if not in memory, check persistant. If in the persistant store, save it to the memory store. Workflows The following are workflows that will need to take place for the above examples to work # Overview App -> controller -> dispatcher -> stores Apps comminicate with controllers. Controllers communicate with dispatchers. Dispatchers communicate with stores. ## Controller app api -> autheticate -> validate -> select dispatcher based on environment -> dispatcher Controllers will get queries from the catalog and expose the api to the app. When a method on the api is called the controller will authenticate the user, validate any parameters, then pass the request to the proper dispatcher. When the dispatcher completes, the controller will pass the information back to the app. ## dispatcher controller api -> check stores -> return data | or error The dispatcher will expose an api to the controller. The dispatcher will then check each store until it find the data (or runs out of stores to check). Then returns the data to the controller. Because the controller and dispatcher share a query catalog the controller can simply pass a query id and callback. ## store dispatcher api -> translation -> repository The store will receive a dispatcher request and translate the query to the repository's language. Special stores may also communicate to one another. Responsibilities # Controller * Universal: The controller is responsible for making an app universal (NodeJs / browser). The controller will need to detect the environment and select the proper dispatcher. * API: The controller will expose an API to the app. Each method exposed by the controller is a query. * The following are generic queries: * find: get one item. * select: get multiple items. * create: create an item. * update: update an item. * delete: delete an item. * Additional queries: The controller will need to access the query catalog. The controller should expose additional queries from the catalog to the app. # Query A query will be a class. Each query will use a generic interface (class Query). class Query will be extended by generic queries: find, select, create, update, delete. * authentication: A query can have a built in authentication mechanism. That may require the user to be assigned a role, or be a specific customer, etc. * validate: A query can validate information that's passed to it
package tweetharvest import ( "time" "golang.org/x/net/context" "google.golang.org/appengine/datastore" "google.golang.org/appengine/log" ) const tweetKey string = "Tweets" const tweetKeyID string = "default_tweetstore" //GetAllNewTweets queries the datastore and gets all tweets created since the last // time given func GetAllNewTweets(since time.Time, c context.Context) LinkTweets { log.Infof(c, "Getting all tweets newer than: %v", since) q := datastore.NewQuery(linkTweetKind).Ancestor(getTweetKey(c)).Filter("CreatedTime >", since) out := make(LinkTweets, 0, 15) q.GetAll(c, &out) return out } func getNewestTweet(c context.Context) time.Time { var latest LinkTweet //Get just the key for the newest tweet q := datastore.NewQuery(linkTweetKind).Order("-CreatedTime").Project("CreatedTime").Limit(1) q.GetAll(c, latest) i := q.Run(c) i.Next(&latest) time, _ := latest.CreatedAtTime() return time } // guestbookKey returns the key used for all guestbook entries. func getTweetKey(c context.Context) *datastore.Key { // The string "default_guestbook" here could be varied to have multiple guestbooks. return datastore.NewKey(c, tweetKey, tweetKeyID, 0, nil) } //<API key> returns a LinkTweet from the DataStore that has the given TweetID func <API key>(tweetID int64, c context.Context) *LinkTweet { q := datastore.NewQuery(linkTweetKind). Filter("TweetID =", tweetID). Limit(1) iterator := q.Run(c) linkTweet := &LinkTweet{} _, err := iterator.Next(linkTweet) if err != nil { return nil } return linkTweet }
//>>built define("dojox/editor/plugins/nls/nb/Preview",{preview:"Forh\u00e5ndsvis"}); //# sourceMappingURL=Preview.js.map
using System.Collections; using System.Collections.Generic; using UnityEngine; public abstract class MovingObject : MonoBehaviour { public bool isMoving = false; public float moveTime = 0.1f; public LayerMask blockingLayer; private BoxCollider2D boxCollider; private Rigidbody2D rigidBody; private float inverseMoveTime; protected virtual void Start () { boxCollider = GetComponent<BoxCollider2D>(); rigidBody = GetComponent<Rigidbody2D>(); inverseMoveTime = 1.0f / moveTime; } protected bool Move(int xDir, int yDir, out RaycastHit2D hit) { Vector2 start = transform.position; Vector2 end = start + new Vector2(xDir, yDir); boxCollider.enabled = false; hit = Physics2D.Linecast(start, end, blockingLayer); boxCollider.enabled = true; if (hit.transform == null) { StartCoroutine(SmoothMovement(end)); return true; } return false; } protected IEnumerator SmoothMovement(Vector2 end) { isMoving = true; Vector2 distance = new Vector2(transform.position.x - end.x, transform.position.y - end.y); float sqrDistance = distance.sqrMagnitude; while (sqrDistance > float.Epsilon) { var newPosition = Vector3.MoveTowards(rigidBody.position, end, inverseMoveTime * Time.deltaTime); rigidBody.MovePosition(newPosition); distance = new Vector2(transform.position.x - end.x, transform.position.y - end.y); sqrDistance = distance.sqrMagnitude; yield return null; } isMoving = false; } protected virtual bool AttemptMove(int xDir, int yDir) { RaycastHit2D hit; bool canMove = Move(xDir, yDir, out hit); if (hit.transform == null) return true; if (!canMove) OnCantMove(hit.transform); return false; } protected abstract void OnCantMove(Transform transform); }
# standard library modules, , , import logging # version, , represent versions and specifications, internal from yotta.lib import version # access_common, , things shared between different component access modules, internal from yotta.lib import access_common logger = logging.getLogger('access') # a GitCloneVersion represents a version in a git clone. (the version may be # different from the checked out version in the working_copy, but should be a # version that exists as a tag in the working_copy) class GitCloneVersion(version.Version): def __init__(self, semver, tag, working_copy): self.working_copy = working_copy self.tag = tag super(GitCloneVersion, self).__init__(semver) def unpackInto(self, directory): # vcs, , represent version controlled directories, internal from yotta.lib import vcs # fsutils, , misc filesystem utils, internal from yotta.lib import fsutils logger.debug('unpack version %s from git repo %s to %s' % (self.version, self.working_copy.directory, directory)) tag = self.tag fsutils.rmRf(directory) vcs.Git.cloneToDirectory(self.working_copy.directory, directory, tag) self.working_copy.remove() class GitWorkingCopy(object): def __init__(self, vcs): self.vcs = vcs self.directory = vcs.workingDirectory() def remove(self): self.vcs.remove() self.directory = None def availableVersions(self): ''' return a list of GitCloneVersion objects for tags which are valid semantic version idenfitifiers. ''' r = [] for t in self.vcs.tags(): logger.debug("available version tag: %s", t) # ignore empty tags: if not len(t.strip()): continue try: r.append(GitCloneVersion(t, t, self)) except ValueError: logger.debug('invalid version tag: %s', t) return r def availableTags(self): ''' return a list of GitCloneVersion objects for all tags ''' return [GitCloneVersion('', t, self) for t in self.vcs.tags()] def availableBranches(self): ''' return a list of GitCloneVersion objects for the tip of each branch ''' return [GitCloneVersion('', b, self) for b in self.vcs.branches()] def tipVersion(self): return GitCloneVersion('', '', self) def commitVersion(self, spec): ''' return a <API key> object for a specific commit if valid ''' import re commit_match = re.match('^[a-f0-9]{7,40}$', spec, re.I) if commit_match: return GitCloneVersion('', spec, self) return None class GitComponent(access_common.RemoteComponent): def __init__(self, url, tag_or_branch=None, semantic_spec=None): logging.debug('create git component for url:%s version spec:%s' % (url, semantic_spec or tag_or_branch)) self.url = url # !!! TODO: handle non-semantic spec self.spec = semantic_spec self.tag_or_branch = tag_or_branch @classmethod def createFromSource(cls, vs, name=None): ''' returns a git component for any git:// url, or None if this is not a git component. Normally version will be empty, unless the original url was of the form 'git://...#version', which can be used to grab a particular tag or branch, or ...#>=1.2.3, which can be used to specify semantic version specifications on tags. ''' return GitComponent(vs.location, vs.spec, vs.semantic_spec) def versionSpec(self): return self.spec def tagOrBranchSpec(self): return self.tag_or_branch # clone the remote repository: this is necessary to find out what tagged # versions are available. # The clone is created in /tmp, and is not automatically deleted, but the # returned version object maintains a handle to it, so that when a specific # version is requested it can be retrieved from the temporary clone, # instead of from the remote origin. def clone(self): # vcs, , represent version controlled directories, internal from yotta.lib import vcs clone = vcs.Git.cloneToTemporaryDir(self.url) clone.fetchAllBranches() return GitWorkingCopy(clone) @classmethod def remoteType(cls): return 'git'
<?php //000000086400a:1:{i:1;a:2:{s:7:"role_id";s:1:"1";s:9:"role_name";s:15:"";}} ?>
package org.nightcrawler.infrastructure.crawler.retriever; import java.net.URL; import java.util.function.Function; import org.asynchttpclient.AsyncHandler; import org.asynchttpclient.AsyncHttpClient; import org.asynchttpclient.Response; import org.nightcrawler.domain.crawler.retriever.PageRetriever; import org.nightcrawler.domain.crawler.strategy.<API key>; /** * Retrieves data with a given HTTP client. * * @author Adam Polomski * */ public class AsyncPageRetriever<P> extends PageRetriever<P> { private final AsyncHttpClient asyncHttpClient; private final Function<<API key><P>, AsyncHandler<Response>> <API key>; public AsyncPageRetriever(final AsyncHttpClient asyncHttpClient, final Function<<API key><P>, AsyncHandler<Response>> <API key>) { this.asyncHttpClient = asyncHttpClient; this.<API key> = <API key>; } @Override public void crawl(final URL url, final <API key><P> strategyBuilder) { asyncHttpClient.prepareGet(url.toString()).execute(<API key>.apply(strategyBuilder)); } }
<!DOCTYPE HTML PUBLIC "- <!-- NewPage --> <html lang="ru"> <head> <title>Uses of Class org.apache.poi.ss.usermodel.charts.LayoutMode (POI API Documentation)</title> <link rel="stylesheet" type="text/css" href="../../../../../../../stylesheet.css" title="Style"> </head> <body> <script type="text/javascript"><! if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Class org.apache.poi.ss.usermodel.charts.LayoutMode (POI API Documentation)"; } </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <div class="topNav"><a name="navbar_top"> </a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow"> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../../../org/apache/poi/ss/usermodel/charts/LayoutMode.html" title="enum in org.apache.poi.ss.usermodel.charts">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?org/apache/poi/ss/usermodel/charts/class-use/LayoutMode.html" target="_top">Frames</a></li> <li><a href="LayoutMode.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="<API key>"> <li><a href="../../../../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><! allClassesLink = document.getElementById("<API key>"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } </script> </div> <a name="skip-navbar_top"> </a></div> <div class="header"> <h2 title="Uses of Class org.apache.poi.ss.usermodel.charts.LayoutMode" class="title">Uses of Class<br>org.apache.poi.ss.usermodel.charts.LayoutMode</h2> </div> <div class="classUseContainer"> <ul class="blockList"> <li class="blockList"> <table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing packages, and an explanation"> <caption><span>Packages that use <a href="../../../../../../../org/apache/poi/ss/usermodel/charts/LayoutMode.html" title="enum in org.apache.poi.ss.usermodel.charts">LayoutMode</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.apache.poi.ss.usermodel.charts">org.apache.poi.ss.usermodel.charts</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="#org.apache.poi.xssf.usermodel.charts">org.apache.poi.xssf.usermodel.charts</a></td> <td class="colLast">&nbsp;</td> </tr> </tbody> </table> </li> <li class="blockList"> <ul class="blockList"> <li class="blockList"><a name="org.apache.poi.ss.usermodel.charts"> </a> <h3>Uses of <a href="../../../../../../../org/apache/poi/ss/usermodel/charts/LayoutMode.html" title="enum in org.apache.poi.ss.usermodel.charts">LayoutMode</a> in <a href="../../../../../../../org/apache/poi/ss/usermodel/charts/package-summary.html">org.apache.poi.ss.usermodel.charts</a></h3> <table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation"> <caption><span>Methods in <a href="../../../../../../../org/apache/poi/ss/usermodel/charts/package-summary.html">org.apache.poi.ss.usermodel.charts</a> that return <a href="../../../../../../../org/apache/poi/ss/usermodel/charts/LayoutMode.html" title="enum in org.apache.poi.ss.usermodel.charts">LayoutMode</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/apache/poi/ss/usermodel/charts/LayoutMode.html" title="enum in org.apache.poi.ss.usermodel.charts">LayoutMode</a></code></td> <td class="colLast"><span class="strong">ManualLayout.</span><code><strong><a href="../../../../../../../org/apache/poi/ss/usermodel/charts/ManualLayout.html#getHeightMode()">getHeightMode</a></strong>()</code> <div class="block">Returns current height mode of this</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code><a href="../../../../../../../org/apache/poi/ss/usermodel/charts/LayoutMode.html" title="enum in org.apache.poi.ss.usermodel.charts">LayoutMode</a></code></td> <td class="colLast"><span class="strong">ManualLayout.</span><code><strong><a href="../../../../../../../org/apache/poi/ss/usermodel/charts/ManualLayout.html#getWidthMode()">getWidthMode</a></strong>()</code> <div class="block">Returns current width mode of this manual layout.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code><a href="../../../../../../../org/apache/poi/ss/usermodel/charts/LayoutMode.html" title="enum in org.apache.poi.ss.usermodel.charts">LayoutMode</a></code></td> <td class="colLast"><span class="strong">ManualLayout.</span><code><strong><a href="../../../../../../../org/apache/poi/ss/usermodel/charts/ManualLayout.html#getXMode()">getXMode</a></strong>()</code> <div class="block">Returns current x-coordinnate layout mode.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code><a href="../../../../../../../org/apache/poi/ss/usermodel/charts/LayoutMode.html" title="enum in org.apache.poi.ss.usermodel.charts">LayoutMode</a></code></td> <td class="colLast"><span class="strong">ManualLayout.</span><code><strong><a href="../../../../../../../org/apache/poi/ss/usermodel/charts/ManualLayout.html#getYMode()">getYMode</a></strong>()</code> <div class="block">Returns current y-coordinate layout mode.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>static <a href="../../../../../../../org/apache/poi/ss/usermodel/charts/LayoutMode.html" title="enum in org.apache.poi.ss.usermodel.charts">LayoutMode</a></code></td> <td class="colLast"><span class="strong">LayoutMode.</span><code><strong><a href="../../../../../../../org/apache/poi/ss/usermodel/charts/LayoutMode.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="rowColor"> <td class="colFirst"><code>static <a href="../../../../../../../org/apache/poi/ss/usermodel/charts/LayoutMode.html" title="enum in org.apache.poi.ss.usermodel.charts">LayoutMode</a>[]</code></td> <td class="colLast"><span class="strong">LayoutMode.</span><code><strong><a href="../../../../../../../org/apache/poi/ss/usermodel/charts/LayoutMode.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> </tbody> </table> <table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation"> <caption><span>Methods in <a href="../../../../../../../org/apache/poi/ss/usermodel/charts/package-summary.html">org.apache.poi.ss.usermodel.charts</a> with parameters of type <a href="../../../../../../../org/apache/poi/ss/usermodel/charts/LayoutMode.html" title="enum in org.apache.poi.ss.usermodel.charts">LayoutMode</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>void</code></td> <td class="colLast"><span class="strong">ManualLayout.</span><code><strong><a href="../../../../../../../org/apache/poi/ss/usermodel/charts/ManualLayout.html#setHeightMode(org.apache.poi.ss.usermodel.charts.LayoutMode)">setHeightMode</a></strong>(<a href="../../../../../../../org/apache/poi/ss/usermodel/charts/LayoutMode.html" title="enum in org.apache.poi.ss.usermodel.charts">LayoutMode</a>&nbsp;mode)</code> <div class="block">Specifies how to interpret the Height element for this manual layout.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><span class="strong">ManualLayout.</span><code><strong><a href="../../../../../../../org/apache/poi/ss/usermodel/charts/ManualLayout.html#setWidthMode(org.apache.poi.ss.usermodel.charts.LayoutMode)">setWidthMode</a></strong>(<a href="../../../../../../../org/apache/poi/ss/usermodel/charts/LayoutMode.html" title="enum in org.apache.poi.ss.usermodel.charts">LayoutMode</a>&nbsp;mode)</code> <div class="block">Specifies how to interpret the Width element for this manual layout.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><span class="strong">ManualLayout.</span><code><strong><a href="../../../../../../../org/apache/poi/ss/usermodel/charts/ManualLayout.html#setXMode(org.apache.poi.ss.usermodel.charts.LayoutMode)">setXMode</a></strong>(<a href="../../../../../../../org/apache/poi/ss/usermodel/charts/LayoutMode.html" title="enum in org.apache.poi.ss.usermodel.charts">LayoutMode</a>&nbsp;mode)</code> <div class="block">Sets the x-coordinate layout mode.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><span class="strong">ManualLayout.</span><code><strong><a href="../../../../../../../org/apache/poi/ss/usermodel/charts/ManualLayout.html#setYMode(org.apache.poi.ss.usermodel.charts.LayoutMode)">setYMode</a></strong>(<a href="../../../../../../../org/apache/poi/ss/usermodel/charts/LayoutMode.html" title="enum in org.apache.poi.ss.usermodel.charts">LayoutMode</a>&nbsp;mode)</code> <div class="block">Sets the y-coordinate layout mode.</div> </td> </tr> </tbody> </table> </li> <li class="blockList"><a name="org.apache.poi.xssf.usermodel.charts"> </a> <h3>Uses of <a href="../../../../../../../org/apache/poi/ss/usermodel/charts/LayoutMode.html" title="enum in org.apache.poi.ss.usermodel.charts">LayoutMode</a> in <a href="../../../../../../../org/apache/poi/xssf/usermodel/charts/package-summary.html">org.apache.poi.xssf.usermodel.charts</a></h3> <table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation"> <caption><span>Methods in <a href="../../../../../../../org/apache/poi/xssf/usermodel/charts/package-summary.html">org.apache.poi.xssf.usermodel.charts</a> that return <a href="../../../../../../../org/apache/poi/ss/usermodel/charts/LayoutMode.html" title="enum in org.apache.poi.ss.usermodel.charts">LayoutMode</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/apache/poi/ss/usermodel/charts/LayoutMode.html" title="enum in org.apache.poi.ss.usermodel.charts">LayoutMode</a></code></td> <td class="colLast"><span class="strong">XSSFManualLayout.</span><code><strong><a href="../../../../../../../org/apache/poi/xssf/usermodel/charts/XSSFManualLayout.html#getHeightMode()">getHeightMode</a></strong>()</code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><code><a href="../../../../../../../org/apache/poi/ss/usermodel/charts/LayoutMode.html" title="enum in org.apache.poi.ss.usermodel.charts">LayoutMode</a></code></td> <td class="colLast"><span class="strong">XSSFManualLayout.</span><code><strong><a href="../../../../../../../org/apache/poi/xssf/usermodel/charts/XSSFManualLayout.html#getWidthMode()">getWidthMode</a></strong>()</code>&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><code><a href="../../../../../../../org/apache/poi/ss/usermodel/charts/LayoutMode.html" title="enum in org.apache.poi.ss.usermodel.charts">LayoutMode</a></code></td> <td class="colLast"><span class="strong">XSSFManualLayout.</span><code><strong><a href="../../../../../../../org/apache/poi/xssf/usermodel/charts/XSSFManualLayout.html#getXMode()">getXMode</a></strong>()</code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><code><a href="../../../../../../../org/apache/poi/ss/usermodel/charts/LayoutMode.html" title="enum in org.apache.poi.ss.usermodel.charts">LayoutMode</a></code></td> <td class="colLast"><span class="strong">XSSFManualLayout.</span><code><strong><a href="../../../../../../../org/apache/poi/xssf/usermodel/charts/XSSFManualLayout.html#getYMode()">getYMode</a></strong>()</code>&nbsp;</td> </tr> </tbody> </table> <table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation"> <caption><span>Methods in <a href="../../../../../../../org/apache/poi/xssf/usermodel/charts/package-summary.html">org.apache.poi.xssf.usermodel.charts</a> with parameters of type <a href="../../../../../../../org/apache/poi/ss/usermodel/charts/LayoutMode.html" title="enum in org.apache.poi.ss.usermodel.charts">LayoutMode</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>void</code></td> <td class="colLast"><span class="strong">XSSFManualLayout.</span><code><strong><a href="../../../../../../../org/apache/poi/xssf/usermodel/charts/XSSFManualLayout.html#setHeightMode(org.apache.poi.ss.usermodel.charts.LayoutMode)">setHeightMode</a></strong>(<a href="../../../../../../../org/apache/poi/ss/usermodel/charts/LayoutMode.html" title="enum in org.apache.poi.ss.usermodel.charts">LayoutMode</a>&nbsp;mode)</code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><span class="strong">XSSFManualLayout.</span><code><strong><a href="../../../../../../../org/apache/poi/xssf/usermodel/charts/XSSFManualLayout.html#setWidthMode(org.apache.poi.ss.usermodel.charts.LayoutMode)">setWidthMode</a></strong>(<a href="../../../../../../../org/apache/poi/ss/usermodel/charts/LayoutMode.html" title="enum in org.apache.poi.ss.usermodel.charts">LayoutMode</a>&nbsp;mode)</code>&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><span class="strong">XSSFManualLayout.</span><code><strong><a href="../../../../../../../org/apache/poi/xssf/usermodel/charts/XSSFManualLayout.html#setXMode(org.apache.poi.ss.usermodel.charts.LayoutMode)">setXMode</a></strong>(<a href="../../../../../../../org/apache/poi/ss/usermodel/charts/LayoutMode.html" title="enum in org.apache.poi.ss.usermodel.charts">LayoutMode</a>&nbsp;mode)</code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><span class="strong">XSSFManualLayout.</span><code><strong><a href="../../../../../../../org/apache/poi/xssf/usermodel/charts/XSSFManualLayout.html#setYMode(org.apache.poi.ss.usermodel.charts.LayoutMode)">setYMode</a></strong>(<a href="../../../../../../../org/apache/poi/ss/usermodel/charts/LayoutMode.html" title="enum in org.apache.poi.ss.usermodel.charts">LayoutMode</a>&nbsp;mode)</code>&nbsp;</td> </tr> </tbody> </table> </li> </ul> </li> </ul> </div> <div class="bottomNav"><a name="navbar_bottom"> </a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="<API key>"> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../../../org/apache/poi/ss/usermodel/charts/LayoutMode.html" title="enum in org.apache.poi.ss.usermodel.charts">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?org/apache/poi/ss/usermodel/charts/class-use/LayoutMode.html" target="_top">Frames</a></li> <li><a href="LayoutMode.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="<API key>"> <li><a href="../../../../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><! allClassesLink = document.getElementById("<API key>"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } </script> </div> <a name="skip-navbar_bottom"> </a></div> <p class="legalCopy"><small> <i>Copyright 2014 The Apache Software Foundation or its licensors, as applicable.</i> </small></p> </body> </html>
extern crate llvm_opt; use llvm_opt::{P}; #[derive(Clone, Copy, Debug)] pub struct X; #[inline(never)] fn calc(v: f32) -> P<X> { let a = P::<X>::new(v * 1.234_f32); let b = P::<X>::new(5.0_f32); a / b } fn main() { let v: f32 = std::env::args().nth(1).unwrap().parse().unwrap(); let c = calc(v); println!("{:?}", c.get_value()); }
package au.gov.amsa.geo.adhoc; import java.io.BufferedWriter; import java.io.File; import java.io.<API key>; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStreamWriter; import java.text.DecimalFormat; import java.util.ArrayList; import java.util.List; import java.util.concurrent.atomic.AtomicInteger; import java.util.regex.Pattern; import com.github.davidmoten.rx.Schedulers; import au.gov.amsa.risky.format.BinaryFixes; import au.gov.amsa.util.Files; import rx.Observable; public class <API key> { public static void main(String[] args) throws <API key>, IOException { long t = System.currentTimeMillis(); File out = new File("target/positions.txt"); out.delete(); try (BufferedWriter writer = new BufferedWriter( new OutputStreamWriter(new FileOutputStream(out)))) { Pattern pattern = Pattern.compile(".*\\.track"); List<File> list = new ArrayList<File>(); list.addAll(Files.find(new File("/media/an/<API key>/2014"), pattern)); list.addAll(Files.find(new File("/media/an/<API key>/2015"), pattern)); list.addAll(Files.find(new File("/media/an/<API key>/2016"), pattern)); Observable.from(list) .concatMap(BinaryFixes::from) .count() .doOnNext(System.out::println) .toBlocking() .subscribe(); } System.out.println((System.currentTimeMillis() - t) + "ms"); } }
<br/><hr><br/> <p>Rumus menghitung b : </p> <img src ="images/rumusb.jpg" width="600px" height="150px" /> <br><br><br> <table> <tr> <th></th> <th></th> <th>(<?php echo $sigman; ?>)</th> <th>(<?php echo $sigmaxy; ?>)</th> <th>-</th> <th>(<?php echo $sigmax; ?>)</th> <th>x</th> <th>(<?php echo $sigma1y; ?>)</th> </tr> <tr> <td>b</td> <td>=</td> <td colspan="6"> </tr> <tr> <td></td> <td></td> <td></td> <td>(<?php echo $sigman; ?>)</td> <td>(<?php echo $sigmaxx; ?>)</td> <td>-</td> <td>(<?php echo $sigmax2; ?>)</td> <td></td> </tr> </table> <br><br> <h4> Nilai b = <?php echo $nilaib; ?></h4>
package org.hibernate.test.util; import junit.framework.TestCase; import junit.framework.Test; import junit.framework.TestSuite; import org.hibernate.util.StringHelper; /** * todo: describe StringHelperTest * * @author Steve Ebersole */ public class StringHelperTest extends TestCase { public StringHelperTest(String string) { super( string ); } public void testAliasGeneration() { assertSimpleAlias( "xyz", "xyz_" ); assertSimpleAlias( "_xyz", "xyz_" ); assertSimpleAlias( "!xyz", "xyz_" ); assertSimpleAlias( "<API key>", "abcdefghij_" ); } private void assertSimpleAlias(String source, String expected) { assertEquals( expected, StringHelper.generateAlias( source ) ); } public static Test suite() { return new TestSuite( StringHelperTest.class ); } }
layout: docs title: "{{ title|striptags|e }}{{ titlesuffix }}" {%- macro relbar() %} <div class="related"> <h3>{{ _('Navigation') }}</h3> <ul> {%- for rellink in rellinks %} <li class="right" {% if loop.first %}style="margin-right: 10px"{% endif %}> <a href="{{ pathto(rellink[0]) }}" title="{{ rellink[1]|striptags|e }}" {{ accesskey(rellink[2]) }}>{{ rellink[3] }}</a> {%- if not loop.first %}{{ reldelim2 }}{% endif %}</li> {%- endfor %} {%- block rootrellink %} <li><a href="{{ pathto(master_doc) }}">{{ shorttitle|e }}</a>{{ reldelim1 }}</li> {%- endblock %} {%- for parent in parents %} <li><a href="{{ parent.link|e }}" {% if loop.last %}{{ accesskey("U") }}{% endif %}>{{ parent.title }}</a>{{ reldelim1 }}</li> {%- endfor %} {%- block relbaritems %} {% endblock %} </ul> </div> {%- endmacro %} {%- macro sidebar() %} <div class="sphinxsidebar"> <div class="<API key>"> {%- block sidebarlogo %} {%- if logo %} <p class="logo"><a href="{{ pathto(master_doc) }}"> <img class="logo" src="{{ pathto('_static/' + logo, 1) }}" alt="Logo"/> </a></p> {%- endif %} {%- endblock %} {%- if sidebars != None %} {#- new style sidebar: explicitly include/exclude templates #} {%- for sidebartemplate in sidebars %} {%- include sidebartemplate %} {%- endfor %} {%- else %} {#- old style sidebars: using blocks -- should be deprecated #} {%- block sidebartoc %} {%- include "localtoc.html" %} {%- endblock %} {%- block sidebarrel %} {%- include "relations.html" %} {%- endblock %} {%- block sidebarsourcelink %} {%- include "sourcelink.html" %} {%- endblock %} {%- if customsidebar %} {%- include customsidebar %} {%- endif %} {%- block sidebarsearch %} {%- include "searchbox.html" %} {%- endblock %} {%- endif %} </div> </div> {%- endmacro %} <div class="container mtb"> <div class="row"> <div class="col-lg-4"> {{ sidebar() }} </div> <div class="col-lg-8"> {% block body %} {% endblock %} </div> </div> </div>
package com.github.jobson.scripting.functions; import com.github.jobson.TestHelpers; import org.junit.Test; import static org.assertj.core.api.Assertions.assertThat; public final class <API key> { @Test(expected = RuntimeException.class) public void <API key>() throws Exception { final ToStringFunction f = new ToStringFunction(); f.call(new Object(), new Object()); } @Test public void <API key>() { final ToStringFunction f = new ToStringFunction(); final Integer input = TestHelpers.randomIntBetween(50, 100000); final Object output = f.call(input); assertThat(output).isInstanceOf(String.class); assertThat(output).isEqualTo(input.toString()); } }
<!DOCTYPE HTML PUBLIC "- <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (1.8.0_60-ea) on Wed Jan 04 17:08:06 EST 2017 --> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Advertise (Public javadocs 2017.1.1 API)</title> <meta name="date" content="2017-01-04"> <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="Advertise (Public javadocs 2017.1.1 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="navBarCell1Rev">Class</li> <li><a href="class-use/Advertise.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, 2017.1.1</div> </div> <div class="subNav"> <ul class="navList"> <li>Prev&nbsp;Class</li> <li><a href="../../../../org/wildfly/swarm/topology/AdvertisementHandle.html" title="interface in org.wildfly.swarm.topology"><span class="typeNameLink">Next&nbsp;Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../index.html?org/wildfly/swarm/topology/Advertise.html" target="_top">Frames</a></li> <li><a href="Advertise.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> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li><a href="#annotation.type.required.element.summary">Required</a>&nbsp;|&nbsp;</li> <li>Optional</li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li><a href="#annotation.type.element.detail">Element</a></li> </ul> </div> <a name="skip.navbar.top"> </a></div> <div class="header"> <div class="subTitle">org.wildfly.swarm.topology</div> <h2 title="Annotation Type Advertise" class="title">Annotation Type Advertise</h2> </div> <div class="contentContainer"> <div class="description"> <ul class="blockList"> <li class="blockList"> <hr> <br> <pre><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Retention.html?is-external=true" title="class or interface in java.lang.annotation">@Retention</a>(<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Retention.html?is-external=true <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Target.html?is-external=true" title="class or interface in java.lang.annotation">@Target</a>(<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Target.html?is-external=true <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Repeatable.html?is-external=true" title="class or interface in java.lang.annotation">@Repeatable</a>(<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Repeatable.html?is-external=true#value--" title="class or interface in java.lang.annotation">value</a>=<a href="../../../../org/wildfly/swarm/topology/Advertises.html" title="annotation in org.wildfly.swarm.topology">Advertises.class</a>) public @interface <span class="memberNameLabel">Advertise</span></pre> <dl> <dt><span class="simpleTagLabel">Author:</span></dt> <dd>Bob McWhirter</dd> </dl> </li> </ul> </div> <div class="summary"> <ul class="blockList"> <li class="blockList"> <ul class="blockList"> <li class="blockList"><a name="annotation.type.required.element.summary"> </a> <h3>Required Element Summary</h3> <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Required Element Summary table, listing required elements, and an explanation"> <caption><span>Required Elements</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Required Element and Description</th> </tr> <tr class="altColor"> <td class="colFirst"><code><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/wildfly/swarm/topology/Advertise.html#value--">value</a></span></code>&nbsp;</td> </tr> </table> </li> </ul> </li> </ul> </div> <div class="details"> <ul class="blockList"> <li class="blockList"> <ul class="blockList"> <li class="blockList"><a name="annotation.type.element.detail"> </a> <h3>Element Detail</h3> <a name="value </a> <ul class="blockListLast"> <li class="blockList"> <h4>value</h4> <pre>public abstract&nbsp;<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;value</pre> </li> </ul> </li> </ul> </li> </ul> </div> </div> <div class="bottomNav"><a name="navbar.bottom"> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.bottom.firstrow"> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="class-use/Advertise.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, 2017.1.1</div> </div> <div class="subNav"> <ul class="navList"> <li>Prev&nbsp;Class</li> <li><a href="../../../../org/wildfly/swarm/topology/AdvertisementHandle.html" title="interface in org.wildfly.swarm.topology"><span class="typeNameLink">Next&nbsp;Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../index.html?org/wildfly/swarm/topology/Advertise.html" target="_top">Frames</a></li> <li><a href="Advertise.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> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li><a href="#annotation.type.required.element.summary">Required</a>&nbsp;|&nbsp;</li> <li>Optional</li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li><a href="#annotation.type.element.detail">Element</a></li> </ul> </div> <a name="skip.navbar.bottom"> </a></div> <p class="legalCopy"><small>Copyright & </body> </html>
package com.rn_coursera; import com.facebook.react.ReactActivity; import com.facebook.react.ReactPackage; import com.facebook.react.shell.MainReactPackage; import java.util.Arrays; import java.util.List; public class MainActivity extends ReactActivity { /** * Returns the name of the main component registered from JavaScript. * This is used to schedule rendering of the component. */ @Override protected String <API key>() { return "RN_Coursera"; } /** * Returns whether dev mode should be enabled. * This enables e.g. the dev menu. */ @Override protected boolean <API key>() { return BuildConfig.DEBUG; } /** * A list of packages used by the app. If the app uses additional views * or modules besides the default ones, add more packages here. */ @Override protected List<ReactPackage> getPackages() { return Arrays.<ReactPackage>asList( new MainReactPackage() ); } }
<?php namespace Command\Serve; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; class ServeCommand extends Command { protected $command = 'serve'; protected $description = "Serve the application on the PHP development server"; protected $commandOptionName = "cap"; // should be specified like "app:greet John --cap" protected $<API key> = 'If set, it will greet in uppercase letters'; protected function configure() { $this ->setName($this->command) ->setDescription($this->description) ->addOption( 'host', null, InputOption::VALUE_OPTIONAL, 'Desired host', '127.0.0.1' ) ->addOption( 'port', null, InputOption::VALUE_OPTIONAL, 'Desired port', '8000' ) ; } protected function execute(InputInterface $input, OutputInterface $output){ $host = $input->getOption('host'); $port = $input->getOption('port'); chdir(BASE_PATH."/public/"); $output->writeln("<info>App development server started:</info> <http://{$host}:{$port}>"); passthru($this->serverCommand($host, $port)); } protected function serverCommand($host, $port){ return sprintf('%s -S %s:%s %s/server.php', ProcessUtils::escapeArgument((new PhpExecutableFinder)->find(false)), $host, $port, BASE_PATH ); } }
""" urls.py URL dispatch, route mappings """ from flask.ext import restful from mail_safe_test import app from mail_safe_test.resources.oauth import login, oauth_callback, logout, verify from mail_safe_test.resources.user import UserAPI, AdminUserAPI, AdminUserListAPI from mail_safe_test.resources.contact import ContactListAPI, ContactAPI from mail_safe_test.resources.doc import DocListAPI, DocAPI from mail_safe_test.resources.link import Link from mail_safe_test.resources.mail import Mail app.add_url_rule('/login/', endpoint='login', view_func = login, methods=['GET']) app.add_url_rule('/login/oauth2callback/', endpoint='authorized', view_func = oauth_callback, methods=['GET', 'POST']) app.add_url_rule('/logout/', endpoint='logout', view_func=logout, methods=['GET']) app.add_url_rule('/verify/', endpoint='verify', view_func=verify, methods=['GET']) app.api = restful.Api(app) app.api.add_resource(AdminUserAPI, '/admin/user/<string:key_id>/', endpoint='/admin/user/') app.api.add_resource(AdminUserListAPI, '/admin/users/', endpoint='/admin/users/') app.api.add_resource(DocAPI, '/user/doc/<string:key_id>/', endpoint='/user/doc/') app.api.add_resource(DocListAPI, '/user/docs/', endpoint='/user/docs/') # Login requied. # TODO(gdb): Add contact list for users. app.api.add_resource(UserAPI, '/user/', endpoint='/user/') app.api.add_resource(ContactAPI, '/user/contact/<string:key_id>/', endpoint='/user/contact/') #PUT add, remove list app.api.add_resource(ContactListAPI, '/user/contacts/', endpoint='/user/contacts/') #POST with list #app.api.add_resource(ListAPI, '/user/list/<string:key_id>', endpoint='/user/list/') # GET contacts in this list # DELETE a list #app.api.add_resource(ListListAPI, '/user/lists/', endpoint='/user/lists/') # GET all lists # POST a new list # DELETE all lists app.api.add_resource(Mail, '/user/mail/', endpoint='/user/mail') # POST to send mail (doc, list/all) # Login not required. app.api.add_resource(Link, '/auth/<string:key_id>/', endpoint='/auth/') # GET sends text message app.api.add_resource(Link, '/link/<string:key_id>', endpoint='/link/') # GET - 403's # POST with OTP # TODO(gdb): support oauth. # POST with oauth header
"use strict"; /*jslint browser: true, onevar: true, undef: true, nomen: true, bitwise: true, regexp: true, newcap: true, immed: true, strict: true */ /*global window: false, jQuery: false */ // Munge the primitives - Paul Irish tip var TRUE = true, FALSE = false, NULL = null; (function($, window, undefined) { // Option object sanitizer function sanitizeOptions(opts) { if(!opts) { return FALSE; } try { if('metadata' in opts && 'object' !== typeof opts.metadata) { opts.metadata = { type: opts.metadata }; } if('content' in opts) { if('object' !== typeof opts.content || opts.content.jquery) { opts.content = { text: opts.content }; } var noContent = $.isFunction(opts.content.text) ? opts.content.text() : opts.content.text || FALSE; if((!noContent && !noContent.attr) || noContent.length < 1 || ('object' === typeof noContent && !noContent.jquery)) { opts.content.text = FALSE; } if('title' in opts.content && 'object' !== typeof opts.content.title) { opts.content.title = { text: opts.content.title }; } } if('position' in opts) { if('object' !== typeof opts.position) { opts.position = { my: opts.position, at: opts.position }; } if('object' !== typeof opts.position.adjust) { opts.position.adjust = {}; } if('undefined' !== typeof opts.position.adjust.screen) { opts.position.adjust.screen = !!opts.position.adjust.screen; } } if('show' in opts) { if('object' !== typeof opts.show) { opts.show = { event: opts.show }; } if('object' !== typeof opts.show) { if(opts.show.jquery) { opts.show = { target: opts.show }; } else { opts.show = { event: opts.show }; } } } if('hide' in opts) { if('object' !== typeof opts.hide) { if(opts.hide.jquery) { opts.hide = { target: opts.hide }; } else { opts.hide = { event: opts.hide }; } } } if('style' in opts && 'object' !== typeof opts.style) { opts.style = { classes: opts.style }; } } catch (e) {} // Sanitize plugin options $.each($.fn.qtip.plugins, function() { if(this.sanitize) { this.sanitize(opts); } }); } /* * Core plugin implementation */ function QTip(target, options, id) { // Declare this reference var self = this; // Setup class attributes self.id = id; self.rendered = FALSE; self.elements = { target: target }; self.cache = { event: {}, target: NULL, disabled: FALSE }; self.timers = {}; self.options = options; self.plugins = {}; /* * Private core functions */ function convertNotation(notation) { var actual, option, i; // Split notation into array actual = notation.split('.'); // Locate required option option = options[ actual[0] ]; for(i = 1; i < actual.length; i+=1) { if(typeof option[ actual[i] ] === 'object' && !option[ actual[i] ].jquery) { option = option[ actual[i] ]; } else{ break; } } return [option, actual[i] ]; } function calculate(detail) { var tooltip = self.elements.tooltip, accessible = '<API key>', show = (!tooltip.is(':visible')) ? TRUE : FALSE, returned = FALSE; // Make sure tooltip is rendered and if not, return if(!self.rendered) { return FALSE; } // Show and hide tooltip to make sure properties are returned correctly if(show) { tooltip.addClass(accessible); } switch(detail) { case 'dimensions': // Find initial dimensions returned = { height: tooltip.outerHeight(), width: tooltip.outerWidth() }; break; case 'position': returned = tooltip.offset(); break; } if(show) { tooltip.removeClass(accessible); } return returned; } // IE max-width/min-width simulator function function updateWidth(newWidth) { var tooltip = self.elements.tooltip, max, min; // Make sure tooltip is rendered and the browser is IE. If not, return if(!self.rendered || !$.browser.msie) { return FALSE; } // Determine actual width tooltip.css({ width: 'auto', maxWidth: 'none' }); newWidth = calculate('dimensions').width; tooltip.css({ maxWidth: '' }); // Parse and simulate max and min width max = parseInt(tooltip.css('max-width'), 10) || 0; min = parseInt(tooltip.css('min-width'), 10) || 0; newWidth = Math.min( Math.max(newWidth, min), max ); // Set the new calculated width and if width has not numerical, grab new pixel width tooltip.width(newWidth); } function removeTitle() { var elems = self.elements; if(elems.title) { elems.titlebar.remove(); elems.titlebar = elems.title = elems.button = NULL; elems.tooltip.removeAttr('aria-labelledby'); } } function createTitle() { var elems = self.elements, button = options.content.title.button; // Destroy previous title element, if present if(elems.titlebar) { removeTitle(); } // Create title bar and title elements elems.titlebar = $('<div />', { 'class': 'ui-tooltip-titlebar ' + (options.style.widget ? 'ui-widget-header' : '') }) .append( elems.title = $('<div />', { 'id': 'ui-tooltip-'+id+'-title', 'class': 'ui-tooltip-title', 'html': options.content.title.text }) ) .prependTo(elems.wrapper); // Create title close buttons if enabled if(button) { // Use custom button if one was supplied by user, else use default if(button.jquery) { elems.button = button; } else if('string' === typeof button) { elems.button = $('<a />', { 'html': button }); } else { elems.button = $('<a />', { 'class': 'ui-state-default' }) .append( $('<span />', { 'class': 'ui-icon ui-icon-close' }) ); } // Setup event handlers elems.button .prependTo(elems.titlebar) .attr('role', 'button') .addClass('ui-tooltip-' + (button === TRUE ? 'close' : 'button')) .hover(function(event){ $(this).toggleClass('ui-state-hover', event.type === 'mouseenter'); }) .click(function() { if(!elems.tooltip.hasClass('ui-state-disabled')) { self.hide(); } return FALSE; }) .bind('mousedown keydown mouseup keyup mouseout', function(event) { $(this).toggleClass('ui-state-active ui-state-focus', (/down$/i).test(event.type)); }); } } function updateTitle(content) { // Make sure tooltip is rendered and if not, return if(!self.rendered) { return FALSE; } // If title isn't already created, create it now if(!self.elements.title && content) { createTitle(); self.reposition(); } else if(!content) { removeTitle(); } else { // Set the new content self.elements.title.html(content); } } function updateContent(content) { // Make sure tooltip is rendered and content is defined. If not return if(!self.rendered || !content) { return FALSE; } // Use function to parse content if($.isFunction(content)) { content = content(); } // Append new content if its a DOM array and show it if hidden if(content.jquery && content.length > 0) { self.elements.content.append(content.css({ display: 'block' })); } // Content is a regular string, insert the new content else { self.elements.content.html(content); } // Update width and position updateWidth(); self.reposition(self.cache.event); // Show the tooltip if rendering is taking place if(self.rendered < 0) { // Show tooltip on ready if(options.show.ready || self.rendered === -2) { self.show(self.cache.event); } // Set rendered status to TRUE self.rendered = TRUE; } return self; } function assignEvents(show, hide, tooltip, doc) { var namespace = '.qtip-'+id, targets = { show: options.show.target, hide: options.hide.target, tooltip: self.elements.tooltip }, events = { show: String(options.show.event).split(' '), hide: String(options.hide.event).split(' ') }, IE6 = $.browser.msie && (/^6\.[0-9]/).test($.browser.version); // Define show event method function showMethod(event) { if(targets.tooltip.hasClass('ui-state-disabled')) { return FALSE; } // If set, hide tooltip when inactive for delay period targets.show.trigger('qtip-'+id+'-inactive'); // Clear hide timers clearTimeout(self.timers.show); clearTimeout(self.timers.hide); // Start show timer self.timers.show = setTimeout(function(){ self.show(event); }, options.show.delay); } // Define hide method function hideMethod(event) { if(targets.tooltip.hasClass('ui-state-disabled')) { return FALSE; } // Check if new target was actually the tooltip element var ontoTooltip = $(event.relatedTarget).parents('.qtip.ui-tooltip')[0] == targets.tooltip[0]; // Clear timers and stop animation queue clearTimeout(self.timers.show); clearTimeout(self.timers.hide); // Prevent hiding if tooltip is fixed and event target is the tooltip. Or if mouse positioning is enabled and cursor momentarily overlaps if((options.position.target === 'mouse' && ontoTooltip) || (options.hide.fixed && (/mouse(out|leave|move)/).test(event.type) && ontoTooltip)) { // Prevent default and popagation event.stopPropagation(); event.preventDefault(); return FALSE; } // If tooltip has displayed, start hide timer targets.tooltip.stop(TRUE, TRUE); self.timers.hide = setTimeout(function(){ self.hide(event); }, options.hide.delay); } // Define inactive method function inactiveMethod(event) { if(targets.tooltip.hasClass('ui-state-disabled')) { return FALSE; } // Clear timer clearTimeout(self.timers.inactive); self.timers.inactive = setTimeout(function(){ self.hide(event); }, options.hide.inactive); } function repositionMethod(event) { // Only update position if tooltip is visible if(self.elements.tooltip.is(':visible')) { self.reposition(event); } } // Check if the tooltip is 'fixed' if(tooltip && options.hide.fixed) { // Add tooltip as a hide target targets.hide = targets.hide.add(targets.tooltip); // Clear hide timer on tooltip hover to prevent it from closing targets.tooltip.bind('mouseover'+namespace, function() { if(!targets.tooltip.hasClass('ui-state-disabled')) { clearTimeout(self.timers.hide); } }); } // Assign hide events if(hide) { // Check if the tooltip hides when inactive if('number' === typeof options.hide.inactive) { // Bind inactive method to target as a custom event targets.show.bind('qtip-'+id+'-inactive', inactiveMethod); // Define events which reset the 'inactive' event handler $.each($.fn.qtip.inactiveEvents, function(index, type){ targets.hide.add(self.elements.tooltip).bind(type+namespace+'-inactive', inactiveMethod); }); } // Apply hide events $.each(events.hide, function(index, type) { var showIndex = $.inArray(type, events.show); // Both events and targets are identical, apply events using a toggle if((showIndex > -1 && $(targets.hide).add(targets.show).length === $(targets.hide).length) || type === 'unfocus') { targets.show.bind(type+namespace, function(event) { if(targets.tooltip.is(':visible')) { hideMethod(event); } else{ showMethod(event); } }); // Don't bind the event again delete events.show[ showIndex ]; } // Events are not identical, bind normally else{ targets.hide.bind(type+namespace, hideMethod); } }); } // Apply show events if(show) { $.each(events.show, function(index, type) { targets.show.bind(type+namespace, showMethod); }); // Focus the tooltip on mouseover targets.tooltip.bind('mouseover'+namespace, function(){ self.focus(); }); } // Apply document events if(doc) { // Adjust positions of the tooltip on window resize if enabled if(options.position.adjust.resize || options.position.adjust.screen) { $(window).bind('resize'+namespace, repositionMethod); } // Adjust tooltip position on scroll if screen adjustment is enabled if(options.position.adjust.screen || (IE6 && targets.tooltip.css('position') === 'fixed')) { $(document).bind('scroll'+namespace, repositionMethod); } // Hide tooltip on document mousedown if unfocus events are enabled if((/unfocus/i).test(options.hide.event)) { $(document).bind('mousedown'+namespace, function(event) { var tooltip = self.elements.tooltip; if($(event.target).parents('.qtip.ui-tooltip').length === 0 && $(event.target).add(target).length > 1 && tooltip.is(':visible') && !tooltip.hasClass('ui-state-disabled')) { self.hide(); } }); } // If mouse is the target, update tooltip position on document mousemove if(options.position.target === 'mouse') { $(document).bind('mousemove'+namespace, function(event) { // Update the tooltip position only if the tooltip is visible and adjustment is enabled if(options.position.adjust.mouse && !targets.tooltip.hasClass('ui-state-disabled') && targets.tooltip.is(':visible')) { self.reposition(event); } }); } } } function unassignEvents(show, hide, tooltip, doc) { doc = parseInt(doc, 10) !== 0; var namespace = '.qtip-'+id, targets = { show: show ? options.show.target : $('<div/>'), hide: hide ? options.hide.target : $('<div/>'), tooltip: tooltip ? self.elements.tooltip : $('<div/>') }, events = { show: String(options.show.event).split(' '), hide: String(options.hide.event).split(' ') }; // Check if tooltip is rendered if(self.rendered) { // Remove show events $.each(events.show, function(index, type){ targets.show.unbind(type+namespace); }); targets.show.unbind('mousemove'+namespace) .unbind('mouseout'+namespace) .unbind('qtip-'+id+'-inactive'); // Remove hide events $.each(events.hide, function(index, type) { targets.hide.add(targets.tooltip).unbind(type+namespace); }); $.each($.fn.qtip.inactiveEvents, function(index, type){ targets.hide.add(tooltip ? self.elements.content : NULL).unbind(type+namespace+'-inactive'); }); targets.hide.unbind('mouseout'+namespace); // Remove tooltip events targets.tooltip.unbind('mouseover'+namespace); // Remove document events if(doc) { $(window).unbind('resize'+namespace); $(document).unbind('mousedown'+namespace+' mousemove'+namespace); } } // Tooltip isn't yet rendered, remove render event else if(show) { targets.show.unbind(events.show+namespace+'-create'); } } /* * Public API methods */ $.extend(self, { render: function(show) { var elements = self.elements; // If tooltip has already been rendered, exit if(self.rendered) { return FALSE; } // Call API method and set rendered status self.rendered = show ? -2 : -1; // -1: rendering -2: rendering and show when done // Create initial tooltip elements elements.tooltip = $('<div/>') .attr({ id: 'ui-tooltip-'+id, role: 'tooltip' }) .addClass('qtip ui-tooltip ui-helper-reset '+options.style.classes) .toggleClass('ui-widget', options.style.widget) .toggleClass('ui-state-disabled', self.cache.disabled) .css('z-index', $.fn.qtip.zindex + $('div.qtip.ui-tooltip').length) .data('qtip', self) .appendTo(options.position.container); // Append to container element elements.wrapper = $('<div />').addClass('ui-tooltip-wrapper').appendTo(elements.tooltip); elements.content = $('<div />').addClass('ui-tooltip-content') .attr('id', 'ui-tooltip-'+id+'-content') .addClass('ui-tooltip-content') .toggleClass('ui-widget-content', options.style.widget) .appendTo(elements.wrapper); // Create title if enabled if(options.content.title.text) { createTitle(); } // Initialize plugins and apply border $.each($.fn.qtip.plugins, function() { if(this.initialize === 'render') { this(self); } }); // Assign events assignEvents(1, 1, 1, 1); $.each(options.events, function(name, callback) { elements.tooltip.bind('tooltip'+name, callback); }); // Catch remove events on target element to destroy tooltip target.bind('remove.qtip', function(){ self.destroy(); }); // Set the tooltips content updateContent(options.content.text); // Call API method and if return value is FALSE, halt elements.tooltip.trigger('tooltiprender', [self.hash()]); return self; }, get: function(notation) { var result, option; switch(notation.toLowerCase()) { case 'offset': result = calculate('position'); break; case 'dimensions': result = calculate('dimensions'); break; default: option = convertNotation(notation.toLowerCase()); result = (option[0].precedance) ? option[0].string() : (option[0].jquery) ? option[0] : option[0][ option[1] ]; break; } return result; }, set: function(notation, value) { var option = convertNotation(notation.toLowerCase()), previous, category, rule, checks = { builtin: { // Content checks '^content.text': function(){ updateContent(value); }, '^content.title.text': function(){ updateTitle(value); }, // Position checks '^position.container$': function(){ if(self.rendered === TRUE) { self.elements.tooltip.appendTo(value); self.reposition(); } }, '^position.(my|at)$': function(){ // Parse new corner value into Corner objecct var corner = (/my$/i).test(notation) ? 'my' : 'at'; if('string' === typeof value) { options.position[corner] = new $.fn.qtip.plugins.Corner(value); } }, '^position.(my|at|adjust|target)': function(){ if(self.rendered) { self.reposition(); } }, // Show & hide checks '^(show|hide).(event|target|fixed)': function(obj, opt, val, prev) { var args = (notation.search(/fixed/i) > -1) ? [0, [0,1,1,1]] : (notation.search(/hide/i) < 0) ? ['show', [1,0,0,0]] : ['hide', [0,1,0,0]]; if(args[0]) { obj[opt] = prev; } unassignEvents.apply(self, args[1]); if(args[0]) { obj[opt] = val; } assignEvents.apply(self, args[1]); } } }; // Merge active plugin checks $.each(self.plugins, function(name) { if('object' === typeof this.checks) { checks[name] = this.checks; } }); // Set new option value previous = option[0][ option[1] ]; option[0][ option[1] ] = value; // Re-sanitize options sanitizeOptions(options); // Execute any valid callbacks for(category in checks) { for(rule in checks[category]) { if((new RegExp(rule, 'i')).test(notation)) { checks[category][rule].call(self, option[0], option[1], value, previous); } } } return self; }, toggle: function(state, event) { if(!self.rendered) { return FALSE; } var type = state ? 'show' : 'hide', tooltip = self.elements.tooltip, opts = options[type], visible = tooltip.is(':visible'), callback, ieStyle; // Detect state if valid one isn't provided if((typeof state).search('boolean|number')) { state = !tooltip.is(':visible'); } // Define after callback function after() { var attr = state ? 'attr' : 'removeAttr', opacity = (/^1|0$/).test($(this).css('opacity')); // Apply ARIA attributes when tooltip is shown if(self.elements.title){ target[attr]('aria-labelledby', 'ui-tooltip-'+id+'-title'); } target[attr]('aria-describedby', 'ui-tooltip-'+id+'-content'); // Prevent antialias from disappearing in IE7 by removing filter and opacity attribute if(state) { if($.browser.msie && $(this).get(0).style && opacity) { ieStyle = $(this).get(0).style; ieStyle.removeAttribute('filter'); ieStyle.removeAttribute('opacity'); } } else if(opacity) { $(this).hide(); } } // Return if element is already in correct state if((!visible && !state) || tooltip.is(':animated')) { return self; } // Attempt to prevent 'blinking' effect when tooltip and show target overlap if(event) { // Compare targets and events if(self.cache.event && (/over|enter/).test(event.type) && (/out|leave/).test(self.cache.event.type) && $(event.target).add(options.show.target).length < 2 && $(event.relatedTarget).parents('.qtip.ui-tooltip').length > 0){ return self; } // Cache event self.cache.event = $.extend({}, event); } // Call API methods callback = $.Event('tooltip'+type); callback.originalEvent = $.extend({}, event); tooltip.trigger(callback, [self.hash(), 90]); if(callback.isDefaultPrevented()){ return self; } // Execute state specific properties if(state) { // Check tooltip is full rendered if(self.rendered === TRUE) { self.focus(); // Focus the tooltip before show to prevent visual stacking self.reposition(event); // Update tooltip position } // Hide other tooltips if tooltip is solo if(opts.solo) { $(':not(.qtip.ui-tooltip)').qtip('hide'); } } else { // Clear show timer clearTimeout(self.timers.show); } // Set ARIA hidden status attribute tooltip.attr('aria-hidden', Boolean(!state)); // Clear animation queue tooltip.stop(TRUE, FALSE); // Use custom function if provided if($.isFunction(opts.effect)) { opts.effect.call(tooltip); tooltip.queue(function(){ after.call(this); $(this).dequeue(); }); } // If no effect type is supplied, use a simple toggle else if(opts.effect === FALSE) { tooltip[ type ](); after.call(tooltip); } // Use basic fade function else { tooltip.fadeTo(90, state ? 1 : 0, after); } // If inactive hide method is set, active it if(state) { opts.target.trigger('qtip-'+id+'-inactive'); } return self; }, show: function(event){ self.toggle(TRUE, event); }, hide: function(event){ self.toggle(FALSE, event); }, focus: function(event) { if(!self.rendered) { return FALSE; } var tooltip = self.elements.tooltip, curIndex = parseInt(tooltip.css('z-index'), 10), newIndex = $.fn.qtip.zindex + $('.qtip.ui-tooltip').length, focusClass = 'ui-tooltip-focus', callback, cachedEvent = $.extend({}, event); // Only update the z-index if it has changed and tooltip is not already focused if(!tooltip.hasClass(focusClass) && curIndex !== newIndex) { $('.qtip.ui-tooltip').each(function() { var api = $(this).qtip(), blur = $.Event('tooltipblur'), tooltip, elemIndex; if(!api || !api.rendered) { return TRUE; } tooltip = api.elements.tooltip; // Reduce all other tooltip z-index by 1 elemIndex = parseInt(tooltip.css('z-index'), 10); if(!isNaN(elemIndex)) { tooltip.css({ zIndex: elemIndex - 1 }); } // Set focused status to FALSE tooltip.removeClass(focusClass); // Trigger blur event blur.originalEvent = cachedEvent; tooltip.trigger(blur, [api, newIndex]); }); // Call API method callback = $.Event('tooltipfocus'); callback.originalEvent = cachedEvent; tooltip.trigger(callback, [self.hash(), newIndex]); // Set the new z-index and set focus status to TRUE if callback wasn't FALSE if(!callback.isDefaultPrevented()) { tooltip.css({ zIndex: newIndex }).addClass(focusClass); } } return self; }, reposition: function(event) { if(self.rendered === FALSE) { return FALSE; } var target = options.position.target, tooltip = self.elements.tooltip, posOptions = options.position, my = posOptions.my, at = posOptions.at, elemWidth = self.elements.tooltip.width(), elemHeight = self.elements.tooltip.height(), offsetParent = $(posOptions.container)[0], targetWidth = 0, targetHeight = 0, position = { left: 0, top: 0 }, callback = $.Event('tooltipmove'), adjust = { left: function(posLeft) { var targetLeft = target === 'mouse' ? event.pageX : target.offset().left, winScroll = $(window).scrollLeft(), winWidth = $(window).width(), myOffset = my.x === 'left' ? -elemWidth : my.x === 'right' ? elemWidth : elemWidth / 2, atOffset = at.x === 'left' ? targetWidth : at.x === 'right' ? -targetWidth : targetWidth / 2, adjustX = -2 * posOptions.adjust.x, adjustWidth = my.x !== at.x && at.x !== 'center' ? targetWidth : 0, newOffset = atOffset + myOffset + adjustX, overflowLeft = winScroll - posLeft, overflowRight = posLeft + elemWidth - winWidth - winScroll; if(overflowLeft > 0 && !(posLeft >= targetLeft && posLeft < targetLeft + targetWidth)) { position.left += newOffset - atOffset + adjustWidth; } else if(overflowRight > 0 && posLeft + elemWidth > targetLeft) { position.left += (my.x === 'center' ? -1 : 1) * (newOffset - atOffset - adjustWidth); } return position.left - posLeft; }, top: function(posTop) { var winScroll = $(window).scrollTop(), winHeight = $(window).height(), myOffset = my.y === 'top' ? -elemHeight : my.y === 'bottom' ? elemHeight : -elemHeight / 2, atOffset = at.y === 'top' ? targetHeight : at.y === 'bottom' ? -targetHeight : 0, adjustY = -2 * posOptions.adjust.y, adjustHeight = my.y !== at.y && at.y !== 'center' ? targetHeight : 0, newOffset = atOffset + myOffset + adjustY, overflowTop = winScroll - posTop, overflowBottom = posTop + elemHeight - winHeight - winScroll; if(overflowTop > 0) { position.top += my.y === 'center' ? -newOffset + atOffset : newOffset; } else if(overflowBottom > 0) { position.top += newOffset - atOffset - adjustHeight; } return position.top - posTop; } }; // Check if mouse was the target if(target === 'mouse') { // Force left top to allow flipping at = { x: 'left', y: 'top' }; // Use cached event if one isn't available for positioning if(!event) { event = self.cache.event; } position = { top: event.pageY, left: event.pageX }; } else { // Check if event targetting is being used if(target === 'event') { if(event && event.target && event.type !== 'scroll' && event.type !== 'resize') { target = self.cache.target = $(event.target); } else { target = self.cache.target; } } // Check if window or document is the target if(target[0] === document || target[0] === window) { targetWidth = target.width(); targetHeight = target.height(); position = { top: (tooltip.css('position') === 'fixed') ? 0 : target.scrollTop(), left: target.scrollLeft() }; } // Use Imagemap plugin if target is an AREA element else if(target.is('area') && $.fn.qtip.plugins.imagemap) { position = $.fn.qtip.plugins.imagemap(target, at); targetWidth = position.width; targetHeight = position.height; position = position.offset; } else { targetWidth = target.outerWidth(); targetHeight = target.outerHeight(); position = target.offset(); if(posOptions.adjust.offset) { do { position.left -= offsetParent.offsetLeft - offsetParent.scrollLeft; position.top -= offsetParent.offsetTop - offsetParent.scrollTop; } while (offsetParent = offsetParent.offsetParent); } } // Adjust position relative to target position.left += at.x === 'right' ? targetWidth : at.x === 'center' ? targetWidth / 2 : 0; position.top += at.y === 'bottom' ? targetHeight : at.y === 'center' ? targetHeight / 2 : 0; } // Adjust position relative to tooltip position.left += posOptions.adjust.x + (my.x === 'right' ? -elemWidth : my.x === 'center' ? -elemWidth / 2 : 0); position.top += posOptions.adjust.y + (my.y === 'bottom' ? -elemHeight : my.y === 'center' ? -elemHeight / 2 : 0); // Calculate collision offset values if(posOptions.adjust.screen && target[0] !== window && target[0] !== document.body) { position.adjusted = { left: adjust.left(position.left), top: adjust.top(position.top) }; } else { position.adjusted = { left: 0, top: 0 }; } // Make sure the tooltip doesn't extend the top/left window boundaries if(posOptions.container[0] == document.body) { if(position.top < 1) { position.top = 0; } if(position.left < 1) { position.left = 0; } } // Set tooltip position class tooltip.attr('class', function(i, val) { return $(this).attr('class').replace(/ui-tooltip-pos-\w+/i, ''); }) .addClass('ui-tooltip-pos-' + my.abbreviation()); // Call API method callback.originalEvent = $.extend({}, event); tooltip.trigger(callback, [self.hash(), position]); if(callback.isDefaultPrevented()){ return self; } delete position.adjust; // Use custom function if provided if(tooltip.is(':visible') && $.isFunction(posOptions.adjust.effect)) { posOptions.adjust.effect.call(tooltip, position); tooltip.queue(function() { // Reset attributes to avoid cross-browser rendering bugs $(this).css({ opacity: '', height: '' }); if($.browser.msie && $(this).get(0).style) { $(this).get(0).style.removeAttribute('filter'); } $(this).dequeue(); }); } else { tooltip.css(position); } return self; }, disable: function(state) { var tooltip = self.elements.tooltip; if(self.rendered) { tooltip.toggleClass('ui-state-disabled', state); } else { self.cache.disabled = !!state; } return self; }, destroy: function() { var elements = self.elements, oldtitle = elements.target.data('oldtitle'); // Destroy any associated plugins when rendered if(self.rendered) { $.each(self.plugins, function() { if(this.initialize === 'render') { this.destroy(); } }); } // Remove bound events unassignEvents(1, 1, 1, 1); // Remove api object and tooltip target.removeData('qtip'); if(self.rendered) { elements.tooltip.remove(); } // Reset old title attribute if removed if(oldtitle) { target.attr('title', oldtitle); } return target; }, hash: function() { var apiHash = $.extend({}, self); delete apiHash.cache; delete apiHash.timers; delete apiHash.options; delete apiHash.plugins; delete apiHash.render; delete apiHash.hash; return apiHash; } }); } // Initialization method function init(id, opts) { var obj, // Grab metadata from element if plugin is present metadata = ($(this).metadata) ? $(this).metadata(opts.metadata) : {}, // Create unique configuration object using metadata config = $.extend(TRUE, {}, opts, metadata), posOptions = config.position, // Use document body instead of document element if needed newTarget = $(this)[0] === document ? $(document.body) : $(this); // Setup missing content if none is detected if('boolean' === typeof config.content.text) { // Grab from supplied attribute if available if(config.content.attr !== FALSE && $(this).attr(config.content.attr)) { config.content.text = $(this).attr(config.content.attr); } // No valid content was found, abort render else { return FALSE; } } // Setup target options if(posOptions.container === FALSE) { posOptions.container = $(document.body); } if(posOptions.target === FALSE) { posOptions.target = newTarget; } if(config.show.target === FALSE) { config.show.target = newTarget; } if(config.hide.target === FALSE) { config.hide.target = newTarget; } // Convert position corner values into x and y strings posOptions.at = new $.fn.qtip.plugins.Corner(posOptions.at); posOptions.my = new $.fn.qtip.plugins.Corner(posOptions.my); // Destroy previous tooltip if overwrite is enabled, or skip element if not if($(this).data('qtip')) { if(config.overwrite) { $(this).qtip('destroy'); } else if(config.overwrite === FALSE) { return FALSE; } } // Initialize the tooltip and add API reference obj = new QTip($(this), config, id); $(this).data('qtip', obj); return obj; } // jQuery $.fn extension method $.fn.qtip = function(options, notation, newValue) { var command = String(options).toLowerCase(), // Parse command returned = FALSE, args = command === 'disable' ? [TRUE] : $.makeArray(arguments).splice(1), event = args[args.length - 1], opts; // Check for API request if((!options && $(this).data('qtip')) || command === 'api') { opts = $(this).eq(0).data('qtip'); return opts ? opts.hash() : undefined; } // Execute API command if present else if('string' === typeof options) { $(this).each(function() { var api = $(this).data('qtip'); if(!api) { return TRUE; } // Call APIcommand if((/option|set/).test(command) && notation) { if(newValue !== undefined) { api.set(notation, newValue); } else { returned = api.get(notation); } } else { // Render tooltip if not already rendered when tooltip is to be shown if(!api.rendered && (command === 'show' || command === 'toggle')) { if(event.timeStamp) { api.cache.event = event; } api.render(); } // Check for disable/enable commands else if(command === 'enable') { command = 'disable'; args = [FALSE]; } // Execute API command if(api[command]) { api[command].apply(api[command], args); } } }); return returned !== FALSE ? returned : $(this); } // No API commands. validate provided options and setup qTips else if('object' === typeof options) { // Sanitize options sanitizeOptions(options); // Build new sanitized options object opts = $.extend(TRUE, {}, $.fn.qtip.defaults, options); // Bind the qTips return $.fn.qtip.bind.call(this, opts); } }; // $.fn.qtip Bind method $.fn.qtip.bind = function(opts) { return $(this).each(function() { var id, self, options, targets, events, namespace; // Find next available ID, or use custom ID if provided id = (opts.id === FALSE || opts.id.length < 1 || $('#ui-tooltip-'+opts.id).length) ? $.fn.qtip.nextid++ : opts.id; // Setup events namespace namespace = '.qtip-'+id+'-create'; // Initialize the qTip self = init.call($(this), id, opts); if(self === FALSE) { return TRUE; } options = self.options; // Remove title attribute and store it if present if($(this).attr('title')) { $(this).data('oldtitle', $(this).attr('title')).removeAttr('title'); } // Initialize plugins $.each($.fn.qtip.plugins, function() { if(this.initialize === 'initialize') { this(self); } }); // Determine hide and show targets targets = { show: options.show.target, hide: options.hide.target }; events = { show: String(options.show.event).replace(' ', namespace+' ') + namespace, hide: String(options.hide.event).replace(' ', namespace+' ') + namespace }; // Define hoverIntent function function hoverIntent(event) { function render() { // Cache mouse coords,render and render the tooltip self.render(typeof event === 'object' || options.show.ready); // Unbind show and hide event targets.show.unbind(events.show); targets.hide.unbind(events.hide); } // Only continue if tooltip isn't disabled if(self.cache.disabled) { return FALSE; } // Cache the mouse data self.cache.event = $.extend({}, event); // Start the event sequence if(options.show.delay > 0) { self.timers.show = setTimeout(render, options.show.delay); if(events.show !== events.hide) { targets.hide.bind(events.hide, function(event){ clearTimeout(self.timers.show); }); } } else { render(); } } // Prerendering is enabled, create tooltip now if(options.show.ready || options.prerender || options.show.event === FALSE) { hoverIntent(); } // Prerendering is disabled, create tooltip on show event else { targets.show.bind(events.show, hoverIntent); } }); }; $.each({ /* Allow other plugins to successfully retrieve the title of an element with a qTip applied */ attr: function(attr) { var api = $(this).data('qtip'); return (arguments.length === 1 && attr === 'title' && api && api.rendered === TRUE) ? $(this).data('oldtitle') : NULL; }, /* Taken directly from jQuery 1.8.2 widget source code */ /* Trigger 'remove' event on all elements on removal if jQuery UI isn't present */ remove: $.ui ? NULL : function( selector, keepData ) { this.each(function() { if (!keepData) { if (!selector || $.filter( selector, [ this ] ).length) { $('*', this).add(this).each(function() { $(this).triggerHandler('remove'); }); } } }); } }, function(name, func) { if(!func) { return TRUE; } var old = $.fn[name]; $.fn[name] = function() { return func.apply(this, arguments) || old.apply(this, arguments); }; }); // Set global qTip properties $.fn.qtip.nextid = 0; $.fn.qtip.inactiveEvents = 'click dblclick mousedown mouseup mousemove mouseleave mouseenter'.split(' '); $.fn.qtip.zindex = 15000; // Setup base plugins $.fn.qtip.plugins = { // Corner object parser Corner: function(corner) { this.x = (String(corner).replace(/middle/i, 'center').match(/left|right|center/i) || ['false'])[0].toLowerCase(); this.y = (String(corner).replace(/middle/i, 'center').match(/top|bottom|center/i) || ['false'])[0].toLowerCase(); this.precedance = (corner.charAt(0).search(/^(t|b)/) > -1) ? 'y' : 'x'; this.string = function() { return this.precedance === 'y' ? this.y+this.x : this.x+this.y; }; this.abbreviation = function() { var x = this.x.substr(0,1), y = this.y.substr(0,1); return x === y ? x : (x === 'c' || (x !== 'c' && y !== 'c')) ? y + x : x + y; }; } }; // Define configuration defaults $.fn.qtip.defaults = { prerender: FALSE, id: FALSE, overwrite: TRUE, metadata: { type: 'class' }, content: { text: TRUE, attr: 'title', title: { text: FALSE, button: FALSE } }, position: { my: 'top left', at: 'bottom right', target: FALSE, container: FALSE, adjust: { x: 0, y: 0, mouse: TRUE, screen: FALSE, resize: TRUE, effect: TRUE, offset: FALSE } }, show: { target: FALSE, event: 'mouseenter', effect: TRUE, delay: 90, solo: FALSE, ready: FALSE }, hide: { target: FALSE, event: 'mouseleave', effect: TRUE, delay: 0, fixed: FALSE, inactive: FALSE }, style: { classes: '', widget: FALSE }, events: { render: $.noop, move: $.noop, show: $.noop, hide: $.noop, focus: $.noop, blur: $.noop } }; var PRELOAD = $(); function Ajax(qTip) { var self = this; self.checks = { '^content.ajax': function() { this.plugins.ajax.load(this.options.content.ajax); } }; $.extend(self, { init: function() { // Grab ajax options var ajax = qTip.options.content.ajax; // Load the remote content self.load(ajax); // Bind show event qTip.elements.tooltip.bind('tooltipshow.ajax', function() { // Update content if content.ajax.once is FALSE and the tooltip is rendered if(ajax.once === FALSE && qTip.rendered === TRUE) { self.load(ajax); } }); }, load: function(ajax) { // Define success and error handlers function successHandler(content, status) { // Call user-defined success handler if present if($.isFunction(ajax.success)) { var result = ajax.success.call(qTip.hash(), content, status); if(result === FALSE){ return; } } // Update content and remove preloaded iamges if present qTip.set('content.text', content); PRELOAD.remove(); } function errorHandler(xhr, status, error) { var content = status || error, result; // Call user-defined success handler if present if($.isFunction(ajax.error)) { result = ajax.error.call(qTip.hash(), xhr, status, error); if(result === FALSE){ return; } } // Update tooltip content to indicate error qTip.set('content.text', content); } // Setup $.ajax option object and process the request $.ajax( $.extend(TRUE, {}, ajax, { success: successHandler, error: errorHandler }) ); return self; }, destroy: function() { // Remove bound events qTip.elements.tooltip.unbind('tooltipshow.ajax'); } }); self.init(); } function preloadImages(url) { var id = 'qtip-preload'; if(!$('#'+id).length) { $('<div id="'+id+'" class="<API key>" />').appendTo(document.body); } if(!PRELOAD.length) { PRELOAD = $('<div />').appendTo('#'+id).load(url + ' img'); } } $.fn.qtip.plugins.ajax = function(qTip) { var api = qTip.plugins.ajax, opts = qTip.options.content; // Make sure the qTip uses the $.ajax functionality if(opts.ajax && opts.ajax.url) { // An API is already present, return it if(api) { return api; } // No API was found, create new instance else { qTip.plugins.ajax = new Ajax(qTip); return qTip.plugins.ajax; } } }; $.fn.qtip.plugins.ajax.initialize = 'render'; // Setup plugin sanitization $.fn.qtip.plugins.ajax.sanitize = function(opts) { // Parse options into correct syntax if(opts.content !== undefined) { if(opts.content.ajax !== undefined) { if(typeof opts.content.ajax !== 'object') { opts.content.ajax = { url: opts.content.ajax }; } if(opts.content.text === FALSE) { opts.content.text = 'Loading...'; } opts.content.ajax.once = Boolean(opts.content.ajax.once); opts.content.ajax.preload = Boolean(opts.content.ajax.preload); // Preload images if enabled if(opts.content.ajax.preload) { preloadImages(opts.content.ajax.url); } } } }; // Tip coordinates calculator function calculateTip(corner, width, height) { var width2 = Math.floor(width / 2), height2 = Math.floor(height / 2), // Define tip coordinates in terms of height and width values tips = { bottomright: [[0,0], [width,height], [width,0]], bottomleft: [[0,0], [width,0], [0,height]], topright: [[0,height], [width,0], [width,height]], topleft: [[0,0], [0,height], [width,height]], topcenter: [[0,height], [width2,0], [width,height]], bottomcenter: [[0,0], [width,0], [width2,height]], rightcenter: [[0,0], [width,height2], [0,height]], leftcenter: [[width,0], [width,height], [0,height2]] }; // Set common side shapes tips.lefttop = tips.bottomright; tips.righttop = tips.bottomleft; tips.leftbottom = tips.topright; tips.rightbottom = tips.topleft; return tips[corner]; } function Tip(qTip, command) { var self = this, opts = qTip.options.style.tip, elems = qTip.elements, tooltip = elems.tooltip, wrapper = elems.wrapper, cache = { top: 0, left: 0, corner: { string: function(){} } }, size = { width: opts.width, height: opts.height }, color = { }, border = opts.border || 0, adjust = opts.adjust || 0, method = opts.method || FALSE; self.corner = NULL; self.mimic = NULL; self.checks = { '^position.my|style.tip.(corner|mimic|method|border)': function() { // Re-determine tip type and update border = opts.border; // Make sure a tip can be drawn if(self.detectCorner()) { // Create a new tip self.create(); self.detectColours(); self.update(); } else { self.tip.remove(); } // Only update the position if mouse isn't the target if(this.get('position.target') !== 'mouse') { this.reposition(); } }, '^style.tip.(height|width)': function() { // Re-set dimensions and redraw the tip size = { width: opts.width, height: opts.height }; self.create(); self.update(); // Reposition the tooltip qTip.reposition(); } }; // Tip position method function position(corner) { var tip = elems.tip, corners = ['left', 'right'], ieAdjust = { left: 0, right: 0, top: 0, bottom: 0 }, offset = 0; // Return if tips are disabled or tip is not yet rendered if(opts.corner === FALSE || !tip) { return FALSE; } // Inherit corner if not provided corner = corner || self.corner; // Reet initial position tip.css({ top: '', bottom: '', left: '', right: '', margin: '' }); // Setup corners to be adjusted corners[ corner.precedance === 'y' ? 'push' : 'unshift' ]('top', 'bottom'); if($.browser.msie) { ieAdjust = { top: (corner.precedance === 'y') ? 0 : 0, left: 0, bottom: (corner.precedance === 'y') ? 0 : 0, right: 0 }; } // Adjust primary corners switch(corner[ corner.precedance === 'y' ? 'x' : 'y' ]) { case 'center': tip.css(corners[0], '50%').css('margin-'+corners[0], -(size[ (corner.precedance === 'y') ? 'width' : 'height' ] / 2)); break; case corners[0]: tip.css(corners[0], ieAdjust[ corners[0] ] + adjust); break; case corners[1]: tip.css(corners[1], ieAdjust[ corners[1] ] + adjust); break; } // Determine adjustments offset = size[ (corner.precedance === 'x') ? 'width' : 'height' ]; if(border) { offset -= parseInt(wrapper.css('border-' + corner[ corner.precedance ] + '-width'), 10); } // Adjust secondary corners if(corner[corner.precedance] === corners[2]) { tip.css(corners[2], -ieAdjust[ corners[2] ] - offset); } else { tip.css(corners[3], ieAdjust[ corners[3] ] - offset); } } function reposition(event, api, position) { if(!elems.tip) { return; } var newCorner = $.extend({}, self.corner), newType = self.mimic.adjust ? $.extend({}, self.mimic) : null, precedance = newCorner.precedance === 'y' ? ['y', 'top', 'left', 'height'] : ['x', 'left', 'top', 'width'], adjusted = position.adjusted, offset = parseInt(wrapper.css('border-' + newCorner[ precedance[0] ] + '-width'), 10), walk = [newCorner, newType]; // Adjust tip corners $.each(walk, function() { if(adjusted.left) { this.x = this.x === 'center' ? (adjusted.left > 0 ? 'left' : 'right') : (this.x === 'left' ? 'right' : 'left'); } if(adjusted.top) { this.y = this.y === 'center' ? (adjusted.top > 0 ? 'top' : 'bottom') : (this.y === 'top' ? 'bottom' : 'top'); } }); // Adjust tooltip position if needed in relation to tip element position[ precedance[1] ] += (newCorner[ precedance[0] ] === precedance[1] ? 1 : -1) * (size[ precedance[3] ] - offset); position[ precedance[2] ] -= adjust; // Update and redraw the tip if needed if(newCorner.string() !== cache.corner.string() && (cache.top !== adjusted.top || cache.left !== adjusted.left)) { self.update(newCorner, newType); } // Cache overflow details cache.left = adjusted.left; cache.top = adjusted.top; cache.corner = newCorner; } $.extend(self, { init: function() { // Check if rendering method is possible and if not fall back if(method === TRUE) { method = $('<canvas />')[0].getContext ? 'canvas' : $.browser.msie && (self.mimic && ((/center/i).test(self.mimic.string())) || size.height !== size.width) ? 'vml' : 'polygon'; } else { if(method === 'canvas') { method = $.browser.msie ? 'vml' : !$('<canvas />')[0].getContext ? 'polygon' : 'canvas'; } else if(method === 'polygon') { method = $.browser.msie && (/center/i).test(self.mimic.string()) ? 'vml' : method; } } // Determine tip corner and type if(self.detectCorner()) { // Create a new tip self.create(); self.detectColours(); self.update(); // Bind update events tooltip.bind('tooltipmove.tip', reposition); } return self; }, detectCorner: function() { var corner = opts.corner, mimic = opts.mimic || corner, at = qTip.options.position.at, my = qTip.options.position.my; if(my.string) { my = my.string(); } // Detect corner and mimic properties if(corner === FALSE || (my === FALSE && at === FALSE)) { return FALSE; } else { if(corner === TRUE) { self.corner = new $.fn.qtip.plugins.Corner(my); } else if(!corner.string) { self.corner = new $.fn.qtip.plugins.Corner(corner); } if(mimic === TRUE) { self.mimic = new $.fn.qtip.plugins.Corner(my); } else if(!mimic.string) { self.mimic = new $.fn.qtip.plugins.Corner(mimic); self.mimic.precedance = self.corner.precedance; } } return self.corner.string() !== 'centercenter'; }, detectColours: function() { var tip = elems.tip, precedance = self.mimic[ self.mimic.precedance ], borderSide = 'border-' + precedance + '-color'; // Detect tip colours color.fill = tip.css('background-color', '').css('border', '').css('background-color') || 'transparent'; color.border = tip.get(0).style ? tip.get(0).style['border' + precedance.charAt(0) + precedance.substr(1) + 'Color'] : tip.css(borderSide) || 'transparent'; // Make sure colours are valid and reset background and border properties if((/rgba?\(0, 0, 0(, 0)?\)|transparent/i).test(color.fill)) { color.fill = wrapper.css(border ? 'background-color' : borderSide); } if(!color.border || (/rgba?\(0, 0, 0(, 0)?\)|transparent/i).test(color.border)) { color.border = wrapper.css(borderSide) || color.fill; } $('*', tip).add(tip).css('background-color', 'transparent').css('border', 0); }, create: function() { var width = size.width, height = size.height; // Create tip element and prepend to the tooltip if needed if(elems.tip){ elems.tip.remove(); } elems.tip = $('<div class="ui-tooltip-tip ui-widget-content"></div>').css(size).prependTo(tooltip); // Create tip element switch(method) { case 'canvas': elems.tip.append('<canvas height="'+height+'" width="'+width+'" />'); break; case 'vml': elems.tip.html('<vml:shape coordorigin="0 0" coordsize="'+width+' '+height+'" stroked="' + !!border + '" ' + ' style="behavior:url(#default#VML); display:inline-block; antialias:TRUE; position: absolute; ' + ' top:0; left:0; width:'+width+'px; height:'+height+'px; vertical-align:'+self.corner.y+';">' + '<vml:stroke weight="' + (border-2) + 'px" joinstyle="miter" miterlimit="10" ' + ' style="behavior:url(#default#VML); display:inline-block;" />' + '</vml:shape>'); break; case 'polygon': elems.tip.append('<div class="<API key>" />').append(border ? '<div class="<API key>" />' : ''); break; } return self; }, update: function(corner, mimic) { var tip = elems.tip, width = size.width, height = size.height, regular = 'px solid ', transparent = 'px dashed transparent', // Dashed IE6 border-transparency hack. Awesome! i = border > 0 ? 0 : 1, translate = Math.ceil(border / 2 + 0.5), factor, context, path, coords, inner; // Re-determine tip if not already set if(!mimic) { mimic = corner ? corner : self.mimic; } if(!corner) { corner = self.corner; } // Inherit tip corners from corner object if not present if(mimic.x === 'false') { mimic.x = corner.x; } if(mimic.y === 'false') { mimic.y = corner.y; } // Find inner child of tip element inner = tip.children(); // Create tip element switch(method) { case 'canvas': // Grab canvas context and clear it context = inner.get(0).getContext('2d'); context.clearRect(0,0,3000,3000); context.restore(); // Determine tip coordinates based on dimensions if(border) { coords = calculateTip(mimic.string(), width * 2, height * 2); // Setup additional border properties context.strokeStyle = color.border; context.lineWidth = border + 1; context.lineJoin = 'miter'; context.miterLimit = 100; // Save and translate canvas origin context.save(); context.translate( mimic.x === 'left' ? 0 : mimic.x === 'right' ? -width : -width / 2, mimic.y === 'top' ? 0 : mimic.y === 'bottom' ? -height : -height / 2 ); } else { coords = calculateTip(mimic.string(), width, height); } // Setup canvas properties context.fillStyle = color.fill; context.miterLimit = 0; // Draw the canvas tip (Delayed til after DOM creation) for(i; i < 2; i++) { context.<API key> = i && border ? 'destination-in' : 'source-over'; context.beginPath(); context.moveTo(coords[0][0], coords[0][1]); context.lineTo(coords[1][0], coords[1][1]); context.lineTo(coords[2][0], coords[2][1]); context.closePath(); context.fill(); if(!i) { context.stroke(); } } break; case 'vml': // Determine tip coordinates based on dimensions coords = calculateTip(mimic.string(), width, height); // Create coordize and tip path using tip coordinates path = 'm' + coords[0][0] + ',' + coords[0][1] + ' l' + coords[1][0] + ',' + coords[1][1] + ' ' + coords[2][0] + ',' + coords[2][1] + ' xe'; inner.attr({ 'path': path, 'fillcolor': color.fill }); if(border) { inner.children().attr('color', color.border); if(mimic.precedance === 'y') { inner.css('top', (mimic.y === 'top' ? 1 : -1) * (border - 2)); inner.css('left', (mimic.x === 'left' ? 1 : -2)); } else { inner.css('left', (mimic.x === 'left' ? 1 : -1) * (border - 2)); inner.css('top', (mimic.y === 'top' ? 1 : -2)); } } break; case 'polygon': // Determine border translations if(mimic.precedance === 'y') { factor = width > height ? 1.5 : width < height ? 5 : 2.2; translate = [ mimic.x === 'left' ? translate : mimic.x === 'right' ? -translate : 0, Math.floor(factor * translate * (mimic.y === 'bottom' ? -1 : 1) * (mimic.x === 'center' ? 0.8 : 1)) ]; } else { factor = width < height ? 1.5 : width > height ? 5 : 2.2; translate = [ Math.floor(factor * translate * (mimic.x === 'right' ? -1 : 1) * (mimic.y === 'center' ? 0.9 : 1)), mimic.y === 'top' ? translate : mimic.y === 'bottom' ? -translate : 0 ]; } inner.removeAttr('style').each(function(i) { // Determine what border corners/colors to set var toSet = { x: mimic.precedance === 'x' ? (mimic.x === 'left' ? 'right' : 'left') : mimic.x, y: mimic.precedance === 'y' ? (mimic.y === 'top' ? 'bottom' : 'top') : mimic.y }, path = mimic.x === 'center' ? ['left', 'right', toSet.y, height, width] : ['top', 'bottom', toSet.x, width, height], col = color[!i && border ? 'border' : 'fill']; if(i) { $(this).css({ 'position': 'absolute', 'z-index': 1, 'left': translate[0], 'top': translate[1] }); } // Setup borders based on corner values if(mimic.x === 'center' || mimic.y === 'center') { $(this).css('border-' + path[2], path[3] + regular + col) .css('border-' + path[0], Math.floor(path[4] / 2) + transparent) .css('border-' + path[1], Math.floor(path[4] / 2) + transparent); } else { $(this).css('border-width', Math.floor(height / 2) + 'px ' + Math.floor(width / 2) + 'px') .css('border-' + toSet.x, Math.floor(width / 2) + regular + col) .css('border-' + toSet.y, Math.floor(height / 2) + regular + col); } }); break; } // Update position position(corner); return self; }, destroy: function(unbind) { // Remove previous tip if present if(elems.tip) { elems.tip.remove(); } // Remove bound events tooltip.unbind('tooltipmove.tip'); } }); } $.fn.qtip.plugins.tip = function(qTip) { var api = qTip.plugins.tip, opts = qTip.options.style.tip; // Make sure tip options are present if(opts && opts.corner) { // An API is already present, if(api) { return api; } // No API was found, create new instance else { qTip.plugins.tip = new Tip(qTip); qTip.plugins.tip.init(); return qTip.plugins.tip; } } }; // Initialize tip on render $.fn.qtip.plugins.tip.initialize = 'render'; // Setup plugin sanitization options $.fn.qtip.plugins.tip.sanitize = function(opts) { if(opts.style === undefined) { opts.style = {}; } if(opts.style.tip === undefined) { opts.style.tip = { corner: TRUE }; } if(typeof opts.style.tip !== 'object'){ opts.style.tip = { corner: opts.style.tip || TRUE }; } if(typeof opts.style.tip.method !== 'string'){ opts.style.tip.method = TRUE; } if(!(/canvas|polygon/i).test(opts.style.tip.method)){ opts.style.tip.method = TRUE; } if(typeof opts.style.tip.width !== 'number'){ opts.style.tip.width = 12; } if(typeof opts.style.tip.height !== 'number'){ opts.style.tip.height = 12; } if(typeof opts.style.tip.border !== 'number'){ opts.style.tip.border = 4; } }; $.fn.qtip.plugins.imagemap = function(area, corner) { var shape = area.attr('shape').toLowerCase(), baseCoords = area.attr('coords').split(','), coords = [], imageOffset = $('img[usemap="#'+area.parent('map').attr('name')+'"]').offset(), result = { width: 0, height: 0, offset: { top: 1e10, right: 0, bottom: 0, left: 1e10 } }, i = 0, next = 0; // POLY area coordinate calculator // Special thanks to Ed Cradock for helping out with this. // Uses a binary search algorithm to find suitable coordinates. function polyCoordinates(result, coords) { var i = 0, compareX = 1, compareY = 1, realX = 0, realY = 0, newWidth = result.width, newHeight = result.height; // Use a binary search algorithm to locate most suitable coordinate (hopefully) while(newWidth > 0 && newHeight > 0 && compareX > 0 && compareY > 0) { newWidth = Math.floor(newWidth / 2); newHeight = Math.floor(newHeight / 2); if(corner.x === 'left'){ compareX = newWidth; } else if(corner.x === 'right'){ compareX = result.width - newWidth; } else{ compareX += Math.floor(newWidth / 2); } if(corner.y === 'top'){ compareY = newHeight; } else if(corner.y === 'bottom'){ compareY = result.height - newHeight; } else{ compareY += Math.floor(newHeight / 2); } i = coords.length; while(i { if(coords.length < 2){ break; } realX = coords[i][0] - result.offset.left; realY = coords[i][1] - result.offset.top; if((corner.x === 'left' && realX >= compareX) || (corner.x === 'right' && realX <= compareX) || (corner.x === 'center' && (realX < compareX || realX > (result.width - compareX))) || (corner.y === 'top' && realY >= compareY) || (corner.y === 'bottom' && realY <= compareY) || (corner.y === 'center' && (realY < compareY || realY > (result.height - compareY)))) { coords.splice(i, 1); } } } return { left: coords[0][0], top: coords[0][1] }; } // Parse coordinates into proper array if(shape === 'poly') { i = baseCoords.length; while(i { next = [ parseInt(baseCoords[--i], 10), parseInt(baseCoords[i+1], 10) ]; if(next[0] > result.offset.right){ result.offset.right = next[0]; } if(next[0] < result.offset.left){ result.offset.left = next[0]; } if(next[1] > result.offset.bottom){ result.offset.bottom = next[1]; } if(next[1] < result.offset.top){ result.offset.top = next[1]; } coords.push(next); } } else { coords = $.map(baseCoords, function(coord){ return parseInt(coord, 10); }); } // Calculate details switch(shape) { case 'rect': result = { width: Math.abs(coords[2] - coords[0]), height: Math.abs(coords[3] - coords[1]), offset: { left: coords[0], top: coords[1] } }; break; case 'circle': result = { width: coords[2] + 2, height: coords[2] + 2, offset: { left: coords[0], top: coords[1] } }; break; case 'poly': $.extend(result, { width: Math.abs(result.offset.right - result.offset.left), height: Math.abs(result.offset.bottom - result.offset.top) }); if(corner.string() === 'centercenter') { result.offset = { left: result.offset.left + (result.width / 2), top: result.offset.top + (result.height / 2) }; } else { result.offset = polyCoordinates(result, coords.slice()); } result.width = result.height = 0; break; } // Add image position to offset coordinates result.offset.left += imageOffset.left; result.offset.top += imageOffset.top; return result; }; function Modal(qTip, options) { var self = this, elems = qTip.elements, tooltip = elems.tooltip, namespace = '.qtipmodal', events = 'tooltipshow'+namespace+' tooltiphide'+namespace; // See if overlay is already present elems.overlay = $('#qtip-overlay'); $.extend(self, { init: function() { // Merge defaults with options options = $.extend(TRUE, $.fn.qtip.plugins.modal.defaults, options); // Check if the tooltip is modal tooltip.bind(events, function(event, api, duration) { var type = event.type.replace('tooltip', ''); if($.isFunction(options[type])) { options[type].call(elems.overlay, duration, api); } else { self[type](duration); } }); // Create the overlay if needed if(!elems.overlay.length) { self.create(); } // Hide tooltip on overlay click if enabled if(options.blur === TRUE) { elems.overlay.bind('click'+namespace+qTip.id, function(){ qTip.hide.call(qTip); }); } }, create: function() { // Create document overlay elems.overlay = $('<div />', { id: 'qtip-overlay', css: { position: 'absolute', top: 0, left: 0, display: 'none' } }) .appendTo(document.body); // Update position on window resize or scroll $(window).bind('resize'+namespace, function() { elems.overlay.css({ height: Math.max( $(window).height(), $(document).height() ), width: Math.max( $(window).width(), $(document).width() ) }); }) .trigger('resize'); }, toggle: function(state) { var overlay = elems.overlay, effect = qTip.options.show.modal.effect, type = state ? 'show': 'hide'; // Setop all animations overlay.stop(TRUE, FALSE); // Use custom function if provided if($.isFunction(effect)) { effect.call(overlay, state); } // If no effect type is supplied, use a simple toggle else if(effect === FALSE) { overlay[ type ](); } // Use basic fade function else { overlay.fadeTo(90, state ? 0.7 : 0, function() { if(!state) { $(this).hide(); } }); } }, show: function() { self.toggle(TRUE); }, hide: function() { self.toggle(FALSE); }, destroy: function() { var delBlanket = TRUE; // Check if any other modal tooltips are present $('*').each(function() { var api = $(this).data('qtip'); if(api && api.id !== qTip.id && api.options.show.modal) { // Another modal tooltip was present, leave overlay delBlanket = FALSE; return FALSE; } }); // Remove overlay if needed if(delBlanket) { elems.overlay.remove(); $(window).unbind('scroll'+namespace+' resize'+namespace); } else { elems.overlay.unbind('click'+namespace+qTip.id); } // Remove bound events tooltip.unbind(events); } }); self.init(); } $.fn.qtip.plugins.modal = function(qTip) { var api = qTip.plugins.modal, opts = qTip.options.show.modal; // An API is already present, if(api) { return api; } // No API was found, create new instance else if(typeof opts === 'object') { qTip.plugins.modal = new Modal(qTip, opts); return qTip.plugins.modal; } }; // Plugin needs to be initialized on render $.fn.qtip.plugins.modal.initialize = 'render'; $.fn.qtip.plugins.modal.sanitize = function(opts) { if(opts.show && opts.show.modal !== undefined) { if(typeof opts.show.modal !== 'object'){ opts.show.modal = { }; } } }; // Setup plugin defaults $.fn.qtip.plugins.modal.defaults = { effect: TRUE, blur: TRUE }; function BGIFrame(qTip) { var self = this, elems = qTip.elements, tooltip = elems.tooltip, namespace = '.bgiframe-' + qTip.id, events = 'tooltipmove'+namespace+' tooltipshow'+namespace; $.extend(self, { init: function() { // Create the BGIFrame element elems.bgiframe = $('<iframe class="ui-tooltip-bgiframe" frameborder="0" tabindex="-1" src="javascript:\'\';" ' + ' style="display:block; position:absolute; z-index:-1; filter:alpha(opacity=0);"></iframe>'); // Append the new element to the tooltip elems.bgiframe.appendTo(tooltip); // Update BGIFrame on tooltip move tooltip.bind(events, self.adjust); }, adjust: function() { var dimensions = qTip.calculate('dimensions'), // Determine current tooltip dimensions plugin = qTip.plugins.tip, tip = qTip.elements.tip, tipAdjust, offset; // Adjust border offset offset = parseInt(tooltip.css('border-left-width'), 10); offset = { left: -offset, top: -offset }; // Adjust for tips plugin if(plugin && tip) { tipAdjust = (plugin.corner.precedance === 'x') ? ['width', 'left'] : ['height', 'top']; offset[ tipAdjust[1] ] -= tip[ tipAdjust[0] ](); } // Update bgiframe elems.bgiframe.css(offset).css(dimensions); }, destroy: function() { // Remove iframe self.iframe.remove(); // Remove bound events tooltip.unbind(events); } }); self.init(); } $.fn.qtip.plugins.bgiframe = function(qTip) { // Proceed only if the browser is IE6 and offending elements are present if(!($.browser.msie && (/^6\.[0-9]/).test($.browser.version) && $('select, object').length)) { return FALSE; } // Retrieve previous API object var api = qTip.plugins.bgiframe; // An API is already present, if(api) { return api; } // No API was found, create new instance else { qTip.plugins.bgiframe = new BGIFrame(qTip); return qTip.plugins.bgiframe; } }; // Plugin needs to be initialized on render $.fn.qtip.plugins.bgiframe.initialize = 'render'; }(jQuery, window));
/*Import Global Compulsory CSS Files*/ @import url(app.css); @import url(ie8.css); @import url(blocks.css); @import url(plugins.css); /*Import CSS Plugins*/ @import url(plugins/animate.css); @import url(plugins/box-shadows.css); @import url(plugins/style-switcher.css); /*Import Headers*/ @import url(headers/header-default.css); /*Import Footers*/ @import url(footers/footer-v1.css); /*Import Google Font*/ @import url(http://fonts.googleapis.com/css?family=Open+Sans:300,400); body { color: #333; font-size: 13px; line-height: 1.6; } p, li, li a { color: #555; } a { color: #72c02c; text-decoration: none; } a, a:focus, a:hover, a:active { outline: 0 !important; } a:focus { text-decoration: none; } a:hover { color: #72c02c; text-decoration: underline; } .wrapper { background: #fff; } .boxed-layout { padding: 0; box-shadow: 0 0 5px #ccc; margin-left: auto !important; margin-right: auto !important; background: url(../img/patterns/15.png) repeat; } .parallax-bg { background: url(../img/blur/img1.jpg) 50% 0 repeat fixed; } /*Parallax Counter Block*/ .parallax-counter { padding: 60px 0; background: url(../img/bg/9.jpg) 50% 0 no-repeat fixed; } .parallax-counter h4 { color: #fff; font-size: 18px; } .parallax-counter .counters { color: #fff; padding: 20px 0; font-weight: 200; background: rgba(0,0,0,0.6); } /*Parallax Counter Block*/ .parallax-counter-v1 { padding: 60px 0; background: url(../img/patterns/5.png) repeat fixed; } .parallax-counter-v1 .counters { color: #fff; padding: 15px 0 10px; border: solid 1px #555; } .parallax-counter-v1 h4 { color: #bbb; font-size: 16px; text-transform: uppercase; } .parallax-counter-v1 span.counter { font-size: 42px; line-height: 48px; } .parallax-counter-v2 { position: relative; padding: 80px 0 60px; background: url(../img/patterns/16.png) repeat fixed; } .parallax-counter-v2:after { top: 0; left: 50%; content: " "; margin-left: -25px; position: absolute; border-top: 25px solid #fff; border-left: 25px solid transparent; border-right: 25px solid transparent; } .parallax-counter-v2:before { top: 0; left: 0; width: 100%; height: 100%; content: " "; position: absolute; background: rgba(0,0,0,0.02); } .parallax-counter-v2 .counters { padding: 20px 0; border-bottom: solid 2px #ddd; background: rgba(255,255,255,0.9); } .parallax-counter-v2 .counters h4, .parallax-counter-v2 .counters span { color: #555; font-weight: 200; font-family: 'Open Sans', sans-serif; } .parallax-counter-v2 .counters span { font-size: 36px; } .parallax-counter-v2 .counters h4 { font-size: 22px; text-transform: uppercase; } @media (max-width: 992px) { .parallax-counter-v2 .counters { margin-bottom: 0 !important; } } .parallax-team { background: url(../img/team/faces.jpg) 50% 0 repeat fixed; } .parallax-team, .parallax-team .title-box-v2 { position: relative; } .parallax-team:before { top: 0; left: 0; width: 100%; height: 100%; content: " "; position: absolute; background: rgba(255,255,255,0.9); } /*Purchase Block*/ .purchase { padding: 25px 0 30px; border-bottom: solid 1px #eee; background: url(../img/breadcrumbs.png) repeat; } .purchase p { margin-bottom: 0; } .purchase span { color: #666; display: block; font-size: 24px; line-height: 35px; font-weight: normal; margin-bottom: 12px; font-family: 'Open Sans', sans-serif; } .purchase .btn-buy { text-align: center; } .purchase .btn-buy a { margin-top: 27px; } .purchase .btn-buy a i { margin-right: 5px; } @media (max-width: 992px) { .purchase { text-align: center; } .purchase span { font-size: 22px; line-height: 29px; } .purchase .btn-buy a { margin-top: 25px; font-size: 16px; } } /*Service*/ .service { overflow: hidden; margin-bottom: 10px; padding: 15px 15px 10px; } .service:hover { background: #fcfcfc; box-shadow: 0 0 5px #ddd; -webkit-transition: box-shadow 0.2s ease-in-out; -moz-transition: box-shadow 0.2s ease-in-out; -o-transition: box-shadow 0.2s ease-in-out; transition: box-shadow 0.2s ease-in-out; } .service:hover i { color: #656565; } .service .desc { padding: 0 15px; overflow: hidden; } .service .desc h4 { font-size: 22px; line-height: 25px; } .service .service-icon { float: left; padding: 10px; color: #72c02c; font-size: 35px; text-align: center; -webkit-transition: all 0.4s ease-in-out; -moz-transition: all 0.4s ease-in-out; -o-transition: all 0.4s ease-in-out; transition: all 0.4s ease-in-out; } .service .service-icon.icon-cogs { font-size: 37px; } .service .service-icon.icon-plane { font-size: 43px; } /* Recent Work */ .recent-work a { text-align: center; background: #fcfcfc; display: inline-block; } .recent-work a:hover { text-decoration: none; } .recent-work a:hover strong { color: #555; } .recent-work em.overflow-hidden { display: block; } .recent-work a span { display: block; padding: 10px; border-bottom: solid 2px #eee; } .recent-work a strong { color: #555; display: block; } .recent-work a i { color: #777; } .recent-work a img { -webkit-transition: all 0.8s ease-in-out; -moz-transition: all 0.8s ease-in-out; -o-transition: all 0.8s ease-in-out; -ms-transition: all 0.8s ease-in-out; transition: all 0.8s ease-in-out; } .recent-work a:hover img { opacity: 0.8; -webkit-transform: scale(1.2) rotate(3deg); -moz-transform: scale(1.2) rotate(3deg); -o-transform: scale(1.0) rotate(3deg); -ms-transform: scale(1.2) rotate(3deg); transform: scale(1.2) rotate(3deg); } .recent-work a:hover span { border-bottom: solid 2px #72c02c; -webkit-transition: all 0.2s ease-in-out; -moz-transition: all 0.3s ease-in-out; -o-transition: all 0.2s ease-in-out; transition: all 0.3s ease-in-out; } /* Work */ .work { margin-top: 6px; } .work .details { padding: 10px; } .work .caption { display: block; padding-top: 5px; color: #585f69 !important; font-size: 18px !important; } .work .caption:hover { cursor: pointer; color: #444 !important; text-decoration: underline; } /*Thumb Headline*/ .thumb-headline h2 { color: #eee; font-size: 16px; } /*Footer Logo*/ .footer-logo { margin: 17px 0 20px; } /*Latest List*/ .latest-list li { padding: 8px 0; border-top: 1px solid #353535; } .latest-list li:first-child { padding-top: 0; border-top: none; } .latest-list li a { color: #eee; } .latest-list small { color: #999; display: block; } /*Link List*/ .link-list li { border-top: solid 1px #353535; } .link-list li:first-child { border-top: none !important; } .link-list a { color: #eee; font-size: 11px; padding: 6px 0px; display: inline-block; text-transform: uppercase; } .link-list li i { color: #bbb; float: right; margin-top: 10px; } /*Latest Tweets*/ .latest-tweets .latest-tweets-inner p { color: #555; font-size: 13px; } .latest-tweets .latest-tweets-inner a { /*color: #3498db;*/ text-decoration: none; } .latest-tweets .latest-tweets-inner a:hover { text-decoration: underline; } .latest-tweets .latest-tweets-inner i.fa { top: 2px; float: left; color: #bbb; color: #55acee; font-size: 18px; margin-right: 5px; position: relative; } .latest-tweets .latest-tweets-inner small { color: #777; display: block; } /*Social Icons*/ .social-icons { margin-top: 5px; } .social-icons li { margin: 0; } .social-icons li a { margin: 0 3px; } /*Default Breadcrumbs*/ .breadcrumbs { overflow: hidden; padding: 10px 0 6px; border-bottom: solid 1px #eee; background: url(../img/breadcrumbs.png) repeat; } .breadcrumbs h1 { color: #666; font-size: 22px; margin-top: 8px; } .breadcrumb { top: 10px; padding-right: 0; background: none; position: relative; } .breadcrumb a { color: #777; } .breadcrumb li.active, .breadcrumb li a:hover { color: #72c02c; text-decoration: none; } @media (max-width: 550px) { .breadcrumbs h1.pull-left, .breadcrumbs ul.pull-right { width: 100%; text-align: center; } .breadcrumbs h1.pull-left { margin-bottom: 0; } .breadcrumbs .breadcrumb { top: 0; margin-bottom: 10px; } } a.thumbnail { padding: 0; border: none; margin-bottom: 15px; } .thumbnail-style { padding: 7px; margin-bottom: 20px; } .thumbnail-style:hover { box-shadow: 0 0 8px #ddd; -webkit-transition: box-shadow 0.2s ease-in-out; -moz-transition: box-shadow 0.2s ease-in-out; -o-transition: box-shadow 0.2s ease-in-out; transition: box-shadow 0.2s ease-in-out; } .thumbnail h3, .thumbnail-style h3 { margin: 6px 0 8px 0; } .thumbnail h3 a, .thumbnail-style h3 a { color: #585f69; font-size: 18px; } .thumbnail h3 a:hover, .thumbnail-style h3 a:hover { color: #72c02c; text-decoration: none; } .thumbnail-style .thumbnail-img { position: relative; margin-bottom: 11px; } .thumbnail-style a.btn-more { right: -10px; bottom: 10px; color: #fff; padding: 1px 6px; position: absolute; background: #72c02c; display: inline-block; } .thumbnail-style a.btn-more:hover { text-decoration: none; box-shadow: 0 0 0 2px #5fb611; } .thumbnail-style:hover a.btn-more { right: 10px; } .thumbnail-kenburn img { left: 10px; margin-left: -10px; position: relative; -webkit-transition: all 0.8s ease-in-out; -moz-transition: all 0.8s ease-in-out; -o-transition: all 0.8s ease-in-out; -ms-transition: all 0.8s ease-in-out; transition: all 0.8s ease-in-out; } .thumbnail-kenburn:hover img { -webkit-transform: scale(1.2) rotate(2deg); -moz-transform: scale(1.2) rotate(2deg); -o-transform: scale(1.2) rotate(2deg); -ms-transform: scale(1.2) rotate(2deg); transform: scale(1.2) rotate(2deg); } /*Service Alternative Block*/ .service-alternative .service:hover { background: #76ca2c; -webkit-transition: all 0.4s ease-in-out; -moz-transition: all 0.4s ease-in-out; -o-transition: all 0.4s ease-in-out; transition: all 0.4s ease-in-out; } .service-alternative .service:hover i, .service-alternative .service:hover p, .service-alternative .service:hover h4 { color: #fff; } /*Servive Block Versions*/ .service-v1 h2 { margin: 15px 0 10px; font-size: 20px; line-height: 28px; } .service-v1 p { text-align: justify; } .posts .dl-horizontal a { color: #555; } .posts .dl-horizontal { margin-bottom: 15px; overflow: hidden; } .posts .dl-horizontal dt { width: 60px; float: left; } .posts .dl-horizontal dt img { width: 60px; height: 60px; padding: 2px; margin-top: 2px; border: solid 1px #ddd; } .posts .dl-horizontal dd { margin-left: 70px; } .posts .dl-horizontal dd p { margin: 0; } .posts .dl-horizontal dd a { font-size: 14px; line-height: 16px !important; } .posts .dl-horizontal dd a:hover { color: #72c02c; text-decoration: none; } .posts .dl-horizontal:hover dt img, .posts .dl-horizontal:hover dd a { color: #72c02c; border-color: #72c02c !important; -webkit-transition: all 0.2s ease-in-out; -moz-transition: all 0.2s ease-in-out; -o-transition: all 0.2s ease-in-out; transition: all 0.2s ease-in-out; } .team ul.team-socail { text-align: right; } .team ul.team-socail li { margin: 0 !important; padding: 0 !important; } .team ul.team-socail li a, .team ul.team-socail li a:hover { text-decoration: none; } .team ul.team-socail li i { color: #aaa; padding: 6px 7px; min-width: 30px; font-size: 18px; text-align: center; background: #f7f7f7; display: inline-block; } .team ul.team-socail li i:hover { color: #fff; background: #72c02c; -webkit-transition: all 0.2s ease-in-out; -moz-transition: all 0.2s ease-in-out; -o-transition: all 0.2s ease-in-out; transition: all 0.2s ease-in-out; } .team .thumbnail-style { padding: 12px; } .team .thumbnail-style img { margin-bottom: 7px; } .team .thumbnail-style h3 { margin-bottom: 5px; } .team .thumbnail-style:hover h3 a { color: #72c02c !important; } .team .thumbnail-style small { display: block; margin-top: 5px; font-size: 12px; } .about-me { overflow: hidden; } .about-me h2 { margin: 0; font-size: 20px; text-transform: uppercase; } .about-me span { color: #999; display: block; font-size: 14px; margin-bottom: 10px; } .about-me .social-icons { margin-top: 7px; } /*About My Goals*/ .about-my-goals h2 { text-transform: uppercase; } /*About Skills*/ .about-skills { padding: 40px 0; border-top: 1px solid #eee; border-bottom: 1px solid #eee; background: url(../img/breadcrumbs.png) repeat; } .gallery-page .thumbnail, .gallery-page .thumbnail:hover { padding: 0; border: none; box-shadow: none; } .gallery-page .thumbnails { margin-bottom:6px; } .privacy a { text-decoration: underline; } .privacy a:hover { color: #72c02c; text-decoration: none; } .portfolio-item h2 { color: #555; font-size: 24px; margin: 0 0 15px; } .portfolio-item li { padding: 3px 0; } .portfolio-item p a { text-decoration: underline; } .portfolio-item p a:hover { text-decoration: none; } /*Portfolio Item v1*/ .portfolio-item1 ul { margin: 10px 0 20px; } .portfolio-item1 li { font-size: 16px; margin-bottom: 3px; } .portfolio-item1 li i { font-size: 18px; margin-right: 4px; } /*Blog Tags*/ ul.blog-tags li { display: inline-block; } ul.blog-tags a { font-size :13px; padding: 2px 7px; background: #f7f7f7; margin: 0 3px 6px 0; display: inline-block; } ul.blog-tags a i { color: #666; } ul.blog-tags a:hover { background: #72c02c; } ul.blog-tags a:hover, ul.blog-tags a:hover i { color: #fff !important; text-decoration: none; -webkit-transition: all 0.2s ease-in-out; -moz-transition: all 0.2s ease-in-out; -o-transition: all 0.2s ease-in-out; transition: all 0.2s ease-in-out; } /*Blog Photo Stream*/ .blog-photos li { display: inline; } .blog-photos li img { width: 58px; height: 58px; margin: 0 2px 8px; } .blog-photos li img:hover { box-shadow: 0 0 0 2px #72c02c; } /*Blog Latest Tweets*/ .blog-twitter .blog-twitter-inner { padding: 10px; position: relative; background: #f7f7f7; margin-bottom: 10px; } .blog-twitter .blog-twitter-inner, .blog-twitter .blog-twitter-inner:after, .blog-twitter .blog-twitter-inner:before { transition: all 0.3s ease-in-out; -o-transition: all 0.3s ease-in-out; -ms-transition: all 0.3s ease-in-out; -moz-transition: all 0.3s ease-in-out; -webkit-transition: all 0.3s ease-in-out; } .blog-twitter .blog-twitter-inner:after, .blog-twitter .blog-twitter-inner:before { width: 0; height: 0; right: 0px; bottom: 0px; content: " "; display: block; position: absolute; } .blog-twitter .blog-twitter-inner:after { border-top: 15px solid #eee; border-right: 15px solid transparent; border-left: 0px solid transparent; border-left-style: inset; /*FF fixes*/ border-right-style: inset; /*FF fixes*/ } .blog-twitter .blog-twitter-inner:before { border-bottom: 15px solid #fff; border-right: 0 solid transparent; border-left: 15px solid transparent; border-left-style: inset; /*FF fixes*/ border-bottom-style: inset; /*FF fixes*/ } .blog-twitter .blog-twitter-inner:hover { border-color: #72c02c; border-top-color: #72c02c; } .blog-twitter .blog-twitter-inner:hover:after { border-top-color: #72c02c; } .blog-twitter .blog-twitter-inner span.twitter-time { color: #777; display: block; font-size: 11px; } .blog-twitter .blog-twitter-inner a { color: #72c02c; text-decoration: none; } .blog-twitter .blog-twitter-inner a:hover { text-decoration: underline; } .blog-twitter .blog-twitter-inner i.fa { top: 2px; color: #bbb; font-size: 18px; position: relative; } /*Choose Block*/ .who li { margin-bottom: 6px; } .who li i { color: #72c02c; font-size: 13px; min-width: 15px; margin-right: 8px; text-align: center; position: relative; } .who li:hover i, .who li:hover a { color: #777; } .who li:hover a:hover { text-decoration: none; } /*Slider Part*/ .<API key>.slider-promo { max-height: 460px !important; } .<API key> { padding: 25px 20px 20px; background: url(../img/bg-black.png) repeat; } .slider-promo-info span.big-size { color: #fff; display: block; font-size: 30px; margin-bottom: 25px; text-shadow: none !important; } .slider-promo-info p { color: #fff; font-size: 16px; margin-bottom: 0; } /*Promo Box*/ .promo-box { padding: 20px; margin: 25px 0 20px; text-align: center; } .promo-box i { display: block; font-size: 50px; } .promo-box p { font-size: 14px; margin-bottom: 0; } .promo-box strong, .promo-box strong a { color: #555; display: block; font-size: 20px; font-weight: 200; margin: 20px 0 15px; } .promo-box:hover strong, .promo-box:hover strong a { color: #72c02c; } /*Promo Service*/ .promo-service { margin-bottom: 20px; } .promo-service li { margin-bottom: 5px; } .promo-service a.btn-u { margin: 0 20px 10px 0; } /*Promo Elements*/ .title-box { font-size: 16px; text-align: center; padding: 10px 0 30px; border-bottom: solid 1px #eee; } .title-box .title-box-text { color: #555; display: block; font-size: 35px; font-weight: 200; } @media (max-width: 768px) { .title-box .title-box-text { font-size: 26px; line-height: 34px; margin-bottom: 10px; } .title-box p { font-size: 15px; } } .block-blockquote { margin: 20px 0; text-align: center; border: dashed 1px #ccc; } .<API key> { padding: 15px; } .block-blockquote p { font-size: 26px; margin-bottom: 0; } /*Info Blocks*/ .info-blocks { margin-bottom: 15px; } .info-blocks:hover i.icon-info-blocks { color: #72c02c; -webkit-transition:all 0.2s ease-in-out; -moz-transition:all 0.2s ease-in-out; -o-transition:all 0.2s ease-in-out; transition:all 0.2s ease-in-out; } .info-blocks i.icon-info-blocks { float: left; color: #777; font-size: 30px; min-width: 50px; margin-top: 10px; text-align: center; } .info-blocks .info-blocks-in { padding: 0 10px; overflow: hidden; } .info-blocks .info-blocks-in h3 { color: #555; font-size: 20px; line-height: 28px; } .info-blocks .info-blocks-in p { font-size: 12px; } .brand-page .btn { margin-bottom: 10px; } .form-page input, .form-page select { margin-bottom: 10px; } ul.labels-demo { margin: 5px 0; } ul.labels-demo li { list-style: none; display: inline-block; margin: 0 5px 2px 0; } .badge-sidebar { border-left: solid 1px #eee; } @media (max-width: 991px) { .badge-sidebar { border-left: none; } } .line-icon-page .item-box { width: 25%; float: left; height: 90px; text-align: center; padding: 20px 10px; margin: 0 -1px -1px 0; word-wrap: break-word; border: 1px solid #ddd; } @media (max-width: 768px) { .line-icon-page .item-box { height: 115px; } } @media (max-width: 450px) { .line-icon-page .item-box { height: 130px; } } .line-icon-page .item-box:hover { background: #fafafa; } .line-icon-page .item span { display: block; font-size: 28px; margin-bottom: 10px; } .line-icon-page .item:hover { color: #72c02c; } .icon-page-fa { margin-bottom: 20px; } .icon-page-fa .item-box { float: left; height: 100px; width: 16% !important; } .icon-page-fa .item { font-size: 12px; } .icon-page-fa .item i { color: #555; display: block; font-size: 24px; margin-bottom: 10px; } @media (max-width: 767px) { .icon-page-fa .item-box { width: 20% !important; } } @media (max-width: 600px) { .icon-page-fa .item-box { width: 30% !important; } } @media (max-width: 400px) { .icon-page-fa .item-box { width: 50% !important; } } /*Special styles for displaying the icons and their classes*/ .bs-glyphicons { padding-left: 0; list-style: none; overflow: hidden; padding-bottom: 1px; margin-bottom: 20px; } .bs-glyphicons li { width: 25%; float: left; height: 115px; padding: 10px; font-size: 11px; line-height: 1.4; text-align: center; margin: 0 -1px -1px 0; border: 1px solid #ddd; } .bs-glyphicons .glyphicon { display: block; font-size: 18px; margin: 5px auto 10px; } .bs-glyphicons li:hover { color: #72c02c; background-color: #fafafa; } @media (min-width: 768px) { .bs-glyphicons li { width: 12.5%; } } /*Glyphicons Pro*/ .demo-pro-glyphicons li { width: 170px; height: 100px; padding: 20px 10px 30px; } .demo-pro-glyphicons span { height: 40px; display: block; } .demo-pro-glyphicons span:before { color: #555; padding: 10px 62px; } .demo-pro-glyphicons span.glyphicons:before { font-size: 22px; } /*Glyphicons Pro Halflings*/ .demo-pro-glyphicons span.halflings { height: 30px; } .demo-pro-glyphicons span.halflings:before { padding: 10px 70px; } .map { width: 100%; height: 350px; border-top: solid 1px #eee; border-bottom: solid 1px #eee; } .map-box { height: 250px; } .map-box-space { margin-top: 15px; } .map-box-space1 { margin-top: 7px; } .service-or { overflow: hidden; position: relative; } .service-bg { width: 250px; padding: 60px; position: absolute; top: -10px; right: -100px; background-color: rgba(255,255,255,0.1); transform: rotate(55deg); -o-transform: rotate(55deg); -ms-transform: rotate(55deg); -moz-transform: rotate(55deg); -webkit-transform: rotate(55deg); } .service-block-v2 .service-block-in { padding: 20px 30px; text-align: center; margin-bottom: 15px; background: rgba(255,255,255,0.2); } .service-block-v2 .service-block-in img { width: 100%; margin-bottom: 15px; } .service-block-v2 .service-block-in i { font-size: 40px; } .service-block-v2 .service-block-in h4 { line-height: 25px; } .service-block-v2 .service-block-in p { margin-bottom: 20px; } .service-block-v2 .service-block-in i, .service-block-v2 .service-block-in h4, .service-block-v2 .service-block-in p { color: #fff; } .easy-block-v1 { position: relative; } .easy-block-v1 img { width: 100%; } .easy-block-v1 .overflow-h h3 { width: 60%; float: left; font-size: 18px; line-height: 24px; margin-bottom: 5px; } .easy-block-v1 .easy-block-v1-badge { left: 0px; top: 10px; z-index: 1; color: #fff; padding: 4px 10px; position: absolute; } .easy-block-v2 { overflow: hidden; position: relative; margin-bottom: 20px; } .easy-block-v2 img { width: 100%; } .easy-bg-v2 { top: 5px; color: #fff; width: 100px; padding: 5px; right: -32px; font-size: 13px; position: absolute; text-align: center; letter-spacing: 2px; transform: rotate(45deg); -o-transform: rotate(45deg); -ms-transform: rotate(45deg); -moz-transform: rotate(45deg); -webkit-transform: rotate(45deg); } .easy-block-v3 { text-align: left; background: #585f69; margin-bottom: 10px; padding: 30px 20px 20px; } .easy-block-v3.first { background: #696f77; } .easy-block-v3.second { background: #707780; } .easy-block-v3.third { background: #787f88; } .easy-block-v3 i { color: #fff; float: left; font-size: 30px; min-width: 45px; padding-top: 10px; } .easy-block-v3 .inner-faq-b { overflow: hidden; } .easy-block-v3 .inner-faq-b h2, .easy-block-v3 .inner-faq-b h3 { font-size: 21px; margin-bottom: 8px; } .easy-block-v3 .inner-faq-b h4 { color: #fff; font-size: 17px; margin-bottom: 2px; } .easy-block-v3 .inner-faq-b h2, .easy-block-v3 .inner-faq-b h3, .easy-block-v3 .inner-faq-b p { color: #fff; } .full-w-block { padding: 30px 0; background: #282828; } .full-w-block .info-blocks i, .full-w-block .info-blocks-in h3 { color: #fff; } .full-w-block .info-blocks-in p { color: #ccc; } .full-w-block .info-blocks:hover i.icon-info-blocks { color: #fff; } .team-v2 { position: relative; margin-bottom: 20px; } .team-v2 img { width: 100%; } .team-v2 .inner-team { padding: 20px; background: #fff; text-align: center; } .team-v2 .inner-team h3 { margin: 0; } .team-v2 .inner-team small { display: block; font-size: 12px; margin-bottom: 7px; } .team-v2 .inner-team p { font-size: 13px; } .team-v2 .inner-team hr { margin: 10px 0 15px; } .team-social { margin-bottom: 0; } .team-social li { padding: 0 2px; } .team-social li a { font-size: 14px; padding: 6px 4px; text-align: center; border-radius: 50% !important; } .team-social li i { min-width: 20px; } .team-social li a.fb { color: #4862a3; border: 1px solid #4862a3; } .team-social li a.tw { color: #159ceb; border: 1px solid #159ceb; } .team-social li a.gp { color: #dc4a38; border: 1px solid #dc4a38; } .team-social li a:hover { text-decoration: none; } .team-social li a.fb:hover { color: #fff; background: #4862a3; } .team-social li a.tw:hover { color: #fff; background: #159ceb; } .team-social li a.gp:hover { color: #fff; background: #dc4a38; } .simple-block { margin-bottom: 20px; } .simple-block img { width: 100%; } .simple-block p { text-align: center; } .simple-block .carousel-indicators { top: 10px; left: 65%; text-align: right; } .simple-block .carousel-indicators .active { background: #555; } .simple-block .carousel-indicators li { border-color: #555; } .simple-block .carousel-inner > .item { margin: 0; } .simple-block .responsive-video { margin-bottom: 3px; } .two-blocks { text-align: center; } .two-blocks-in { margin-bottom: 30px; } .two-blocks-in i { color: #fff; padding: 11px; font-size: 30px; min-width: 50px; text-align: center; background: #585f69; margin-bottom: 10px; display: inline-block; } .three-blocks { text-align: center; } .three-blocks-in { margin-bottom: 30px; } .three-blocks-in i { color: #777; padding: 9px 6px; font-size: 20px; min-width: 40px; margin-bottom: 10px; border: 1px solid #777; } .three-blocks-in h3 { font-size: 20px; margin-bottom: 7px; } /*Banner-info*/ .banner-info { margin-bottom: 10px; } .banner-info i { float: left; color: #fff; padding: 11px; /*min-width works with line-icon*/ min-width: 40px; font-size: 22px; text-align: center; margin: 7px 20px 0 0; } /*min-width works with FontAwesome*/ .banner-info i.fa { min-width: 46px; } .banner-info.light i { border: 1px solid #fff; } .banner-info.dark i { background: #585f69; } .banner-info h3 { font-size: 21px; margin-bottom: 5px; } .banner-info.light h3 { color: #fff; } .banner-info.light p { color: #eee; } /*Breadcrumb-V2*/ .breadcrumbs-v2 { text-align: center; position: relative; background: url(../img/bg/11.jpg) no-repeat center; } .breadcrumbs-v2-in { padding: 60px 0; position: relative; } .breadcrumbs-v2 h1 { color: #fff; text-transform: uppercase; } .breadcrumb-v2 li a, .breadcrumb-v2 li.active { color: #fff; } .breadcrumb-v2 li i { color: #fff; min-width: 19px; padding: 3px 7px; margin-right: 5px; text-align: center; border: 1px solid #fff; } /*Breadcrumbs-v3*/ .breadcrumbs-v3 { padding: 10px 0; background: #585f69; border-bottom: 1px solid #eee; } .breadcrumbs-v3 h1 { color: #fff; margin: 3px 0; font-size: 22px; font-weight: 200; } .breadcrumbs-v3 .breadcrumb { padding: 0; margin-top: 2px; margin-bottom: 0; } .breadcrumbs-v3 .breadcrumb li a { color: #fff; } /*Title-Box-V2*/ .title-box-v2 { text-align: center; margin-bottom: 40px; } .title-box-v2 h2 { font-size: 25px; text-transform: uppercase; } .title-box-v2 p { font-size: 13px; } /*remove padding from "Col-"*/ .no-space { padding: 0; } .no-space-left { padding-left: 0; padding-right: 15px !important; } .no-space-right { padding-right: 0; padding-left: 15px !important; } /*List Style v1*/ .list-style-v1 li { margin-bottom: 7px; } .list-style-v1 i { margin-right: 5px; } .social-contacts li { padding: 5px 0; border-top: 1px solid #ddd; } .social-contacts li:first-child { border-top: none; } .social-contacts li i { color: #777; font-size: 13px; min-width: 13px; margin-right: 12px; text-align: center; } .service-block-v3 { padding: 20px; } .service-block-v3 i { color: #fff; float: left; font-size: 50px; margin: 0 20px 20px 0; } .service-block-v3 .service-heading, .service-block-v3 .service-in small { color: #fff; opacity: 0.8; line-height: 1; } .service-block-v3 .service-in h4, .service-block-v3 .counter { color: #fff; } .service-block-v3 .service-heading { font-size: 16px; text-transform: uppercase; } .service-block-v3 .counter { display: block; line-height: 1; font-size: 30px; } .service-block-v3 .progress { margin-bottom: 7px; } /*Service Innner*/ .service-block-v3 .service-in small { font-size: 16px; text-transform: uppercase; } .service-block-v3 .service-in h4 { font-size: 16px; line-height: 0.8; margin-bottom: 0; } /*Statistics*/ .service-block-v3 .statistics .heading-xs { color: #fff; opacity: 0.8; } .service-block-v3 .statistics small { color: #fff; } .service-block-v3 .statistics .progress { background: #bbb; } .service-block-v3 .statistics .progress-bar-light { background: #fff; } .status-bar li { padding-left: 9px; border-left: 1px solid #eee; } .status-bar li:first-child { border-left: none; } .status-bar li i { color: #72c02c; margin-right: 5px; } .status-bar li a:hover { text-decoration: none; } .status-bar-in { padding: 10px; position: relative; background: #f0f0f0; } .status-bar-in:after { width: 0; height: 0; top: -10px; left: 50px; content: " "; display: block; position: absolute; border-bottom: 11px solid #f0f0f0; border-left: 11px solid transparent; border-right: 11px solid transparent; border-left-style: inset; /*FF fixes*/ border-right-style: inset; /*FF fixes*/ } /*Share List*/ .share-list { margin-bottom: 0; } .share-list li { padding-left: 20px; } .share-list li:first-child { padding-left: 0; } .share-list li i { color: #72c02c; margin-right: 5px; } .table-search-v1 .btn-u.dropdown-toggle { border-left: none; } .table-search-v1 .btn-group .btn-u { top: 4px; padding: 0 6px; position: relative; } .table-search-v1 thead { border-bottom: solid 1px #ddd; } .table-search-v1 td { vertical-align: middle !important; } .table-search-v1 td a { color: #555; } .table-search-v1 td span { display: block; } .table-search-v1 .star-vote { margin: 5px 0 0px; } .table-search-v1 .star-vote li { padding: 0; } .table-search-v1 .progress { margin-bottom: 0; } .table-search-v1 .m-marker a { font-size: 11px; } .table-search-v1 .m-marker i { float: left; min-width: 20px; font-size: 26px; } .table-search-v1 .m-marker .display-b { top: 3px; display: block; line-height: 10px; position: relative; } .table-search-v1 .td-width { width: 40%; } .table-search-v2 .btn-u.dropdown-toggle { border-left: none; } .table-search-v2 .btn-group .btn-u { top: 4px; padding: 0 6px; position: relative; } .table-search-v2 thead { border-bottom: solid 1px #ddd; } .table-search-v2 td { vertical-align: middle !important; } .table-search-v2 td img { width: 60px; height: 60px; margin: 0 auto; display: block; } .table-search-v2 .user-names span, .table-search-v2 .user-names small { display: block; text-align: center; } .table-search-v2 .user-names span { color: #555; font-size: 16px; position: relative; } .table-search-v2 .user-names small { color: #999; font-size: 13px; } .table-search-v2 td h3 { font-size: 16px; margin: 0 0 2px; } .table-search-v2 td a { color: #555; } .table-search-v2 td p { margin-bottom: 0; } .table-search-v2 td span { display: block; } .table-search-v2 td small { font-style: italic; } .table-search-v2 .s-icons { margin-bottom: 0; } .table-search-v2 .s-icons li { padding: 2px; } .table-search-v2 .table-buttons { margin: 0; } .table-search-v2 .table-buttons li { padding: 0; } .table-search-v2 .table-buttons .btn-u-sm { padding: 3px 6px; } .table-search-v2 .td-width { width: 55%; } .people-say img { float: left; width: 40px; height: auto; margin: 6px 10px 0 0; } .people-say .overflow-h span { font-weight: 700; } .people-say .overflow-h p { font-style: italic; line-height: 1.3; } .people-say .overflow-h small { text-align: right; font-style: italic; } .page-option-v1 p { color: #555; font-size: 16px; } img.img-mouse { width: 150px; height: auto; margin: 0 auto 60px; } /*Service Info*/ .service-info { position: relative; padding: 40px 0 50px; background: url(../img/patterns/17.png) repeat; } .service-info .info-description { overflow: hidden; } .service-info i.service-info-icon { color: #777; float: left; width: 50px; height: 50px; padding: 15px; font-size: 20px; line-height: 17px; margin-right: 20px; text-align: center; display: inline-block; border: 1px solid #777; } .service-info .info-description h3 { margin: 0 0 10px; } .service-info .info-description p { color: #777; } /*Project Details*/ .project-details li { color: #555; font-weight: 200; margin-bottom: 5px; } .project-details strong { min-width: 100px; display: inline-block; } .project-details a { text-decoration: underline; } .testimonials-bs { padding: 50px 0; background: url(../img/bg/16.jpg) 50% 0 repeat fixed; } .testimonials-bs .headline-center-v2 span.author { color: #777; font-size: 14px; } /*Removes Bootstrap carousel background images*/ .testimonials-bs .item { margin-bottom: 30px; } .testimonials-bs .carousel-arrow { text-align: center; } .testimonials-bs .carousel-control-v2 i { color: #888; width: 30px; height: 30px; padding: 2px; font-size: 22px; display: inline-block; border: 2px solid #888; } .testimonials-bs .carousel-control-v2 i:hover { color: #72c02c; border-color: #72c02c; text-decoration: none; transition: all 0.3s ease-in-out; -o-transition: all 0.3s ease-in-out; -moz-transition: all 0.3s ease-in-out; -webkit-transition: all 0.3s ease-in-out; } .testimonials-bs .carousel-control-v2.left, .testimonials-bs .carousel-control-v2.right { text-decoration: none; background-image: none; } /*Team v1*/ .team-v1 li > h3 { color: #555; }
package com.woorea.openstack.nova.model; import java.io.Serializable; import java.util.Calendar; import com.fasterxml.jackson.annotation.JsonRootName; @JsonRootName("cloudpipe") public class Cloudpipe implements Serializable { private String projectId; private String internalIp; private String publicIp; private String publicPort; private String state; private String instanceId; private Calendar createdAt; /** * @return the projectId */ public String getProjectId() { return projectId; } /** * @param projectId the projectId to set */ public void setProjectId(String projectId) { this.projectId = projectId; } /** * @return the internalIp */ public String getInternalIp() { return internalIp; } /** * @param internalIp the internalIp to set */ public void setInternalIp(String internalIp) { this.internalIp = internalIp; } /** * @return the publicIp */ public String getPublicIp() { return publicIp; } /** * @param publicIp the publicIp to set */ public void setPublicIp(String publicIp) { this.publicIp = publicIp; } /** * @return the publicPort */ public String getPublicPort() { return publicPort; } /** * @param publicPort the publicPort to set */ public void setPublicPort(String publicPort) { this.publicPort = publicPort; } /** * @return the state */ public String getState() { return state; } /** * @param state the state to set */ public void setState(String state) { this.state = state; } /** * @return the instanceId */ public String getInstanceId() { return instanceId; } /** * @param instanceId the instanceId to set */ public void setInstanceId(String instanceId) { this.instanceId = instanceId; } /** * @return the createdAt */ public Calendar getCreatedAt() { return createdAt; } /** * @param createdAt the createdAt to set */ public void setCreatedAt(Calendar createdAt) { this.createdAt = createdAt; } /* (non-Javadoc) * @see java.lang.Object#toString() */ @Override public String toString() { return "CloudPipe [projectId=" + projectId + ", internalIp=" + internalIp + ", publicIp=" + publicIp + ", publicPort=" + publicPort + ", state=" + state + ", instanceId=" + instanceId + ", createdAt=" + createdAt + "]"; } }
package JKernelMachines.fr.lip6.density; import java.util.ArrayList; /** * Density estimator based on training exemples. * @author dpicard * */ public interface DensityFunction<T> { public void train(T e); public void train(ArrayList<T> e); public double valueOf(T e); }
package org.dynmap.fabric_1_16_4.mixin; import net.minecraft.block.BlockState; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import net.minecraft.world.chunk.WorldChunk; import org.dynmap.fabric_1_16_4.event.BlockEvents; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.<API key>; @Mixin(WorldChunk.class) public abstract class WorldChunkMixin { @Shadow public abstract World getWorld(); @Inject(method = "setBlockState", at = @At("RETURN")) public void setBlockState(BlockPos pos, BlockState state, boolean moved, <API key><BlockState> info) { if (info.getReturnValue() != null) { BlockEvents.EVENT.invoker().onBlockEvent(this.getWorld(), pos); } } }
//File: $RCSfile: CoreExportWizard.java,v $ package org.xtuml.bp.io.core; import java.io.File; import java.io.<API key>; import java.lang.reflect.<API key>; import java.util.List; import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.Path; import org.eclipse.jface.dialogs.IDialogSettings; import org.eclipse.jface.dialogs.<API key>; import org.eclipse.jface.viewers.<API key>; import org.eclipse.jface.wizard.Wizard; import org.eclipse.ui.IExportWizard; import org.eclipse.ui.IWorkbench; import org.xtuml.bp.core.CorePlugin; import org.xtuml.bp.core.common.<API key>; import org.xtuml.bp.core.common.NonRootModelElement; import org.xtuml.bp.core.common.PersistenceManager; import org.xtuml.bp.core.util.UIUtil; // org.eclipse.jdt.internal.ui.jarpackager.JarPackageWizard was used // as an example to create this wizard. /** * This wizard exports the model in BP 6.1 format. * @see Wizard */ public abstract class CoreExportWizard extends Wizard implements IExportWizard { protected String m_windowTitle; protected Object m_domain; abstract protected CoreExportPage createExportPage(); abstract protected CoreExportPage getExportPage(); abstract protected CoreExport <API key>() throws <API key>; /* * (non-Javadoc) * Method declared on IWizard. */ public void addPages() { super.addPages(); CoreExportPage fExportPage = createExportPage(); addPage(fExportPage); } protected void prepare(){ <API key> metaData = PersistenceManager.<API key>(); iterateToLoad(metaData, null); } private void iterateToLoad(<API key> metaData, NonRootModelElement me){ List children = metaData.<API key>(me); for (Object child : children) { iterateToLoad(metaData, (NonRootModelElement)child); } } /** * @see Wizard#performFinish */ public boolean performFinish() { prepare(); // here's where the code is actually output IPath path = new Path(getExportPage().<API key>()); File fh = path.toFile(); boolean writeFile = true; if (fh.exists() && getExportPage().getOverwriteWarning()) writeFile = UIUtil.openQuestion(getShell(), "Confirm Replace", "The file '" + getExportPage().<API key>() + "' already exists. Do you want to overwrite it?", true ); if ( writeFile ) { if ( <API key>(path.removeLastSegments(1).toFile()) ) { try { try { new <API key>(getShell()).run(true, false, <API key>()); } catch (<API key> e) { // handle exception } catch (<API key> e) { fh.delete(); } return true; } catch( <API key> f ) { UIUtil.openError(getShell(), "File Not Found", "Unable to open file:\n\n" + f.getLocalizedMessage()); } } } return false; } IWorkbench m_workbench; protected <API key> m_selection; /* (non-Javadoc) * @see org.eclipse.ui.IWorkbenchWizard#init(org.eclipse.ui.IWorkbench, org.eclipse.jface.viewers.<API key>) */ public void init(IWorkbench workbench, <API key> selection) { m_workbench = workbench; m_selection = selection; setWindowTitle(m_windowTitle); <API key>(CorePlugin.getImageDescriptor("exportsql_wiz.gif"));//$NON-NLS-1$ } /* (non-Javadoc) * @see org.eclipse.jface.wizard.IWizard#getDialogSettings() */ public IDialogSettings getDialogSettings() { return CorePlugin.getDefault().getDialogSettings(); } /** * @return Returns the m_selection. */ public <API key> getSelection() { return m_selection; } /** * @return Returns the m_domain. */ public Object getDomain() { return m_domain; } /** * @param m_domain The m_domain to set. * m_domain can either be a Domain_c instance or a DomainProxy instance */ public void setDomain(Object m_domain) { this.m_domain = m_domain; } /** * Attempts to ensure that the specified directory exists on the local file system. * Answers a boolean indicating success. * * @return boolean * @param directory java.io.File */ protected boolean <API key>(File directory) { if (directory.exists() && !directory.isDirectory()) { UIUtil.openError(getShell(), "Directory Error", "Specified target exists, but is not a directory"); return false; } if (!directory.exists()) { if ( !UIUtil.openQuestion(getShell(), "Question", "Target directory does not exist. Would you like to create it?", true) ) return false; if (!directory.mkdirs()) { UIUtil.openError(getShell(), "Error", "Error creating directory."); return false; } } return true; } }
#ifndef MATCHALLDOCSQUERY_H #define MATCHALLDOCSQUERY_H #include "Query.h" namespace Lucene { A query that matches all documents. class LPPAPI MatchAllDocsQuery : public Query { public: @param normsField Field used for normalization factor (document boost). Null if nothing. MatchAllDocsQuery(const String& normsField = EmptyString); virtual ~MatchAllDocsQuery(); LUCENE_CLASS(MatchAllDocsQuery); protected: String normsField; public: using Query::toString; virtual WeightPtr createWeight(SearcherPtr searcher); virtual void extractTerms(SetTerm terms); virtual String toString(const String& field); virtual bool equals(LuceneObjectPtr other); virtual int32_t hashCode(); virtual LuceneObjectPtr clone(LuceneObjectPtr other = LuceneObjectPtr()); friend class MatchAllDocsWeight; }; } #endif
# -*- coding:utf-8 -*- from typing import List import tensorflow as tf import numpy as np from hanlp.components.<API key> import RNNLanguageModel from hanlp_common.constant import PAD from hanlp.utils.io_util import get_resource from hanlp.utils.tf_util import copy_mask, hanlp_register, <API key> from hanlp_common.util import infer_space_after @hanlp_register class <API key>(tf.keras.layers.Layer): def __init__(self, forward_model_path=None, backward_model_path=None, max_word_len=10, trainable=False, name=None, dtype=None, dynamic=True, **kwargs): assert dynamic, '<API key> works only in eager mode' super().__init__(trainable, name, dtype, dynamic, **kwargs) assert any([forward_model_path, backward_model_path]), 'At least one model is required' self.forward_model_path = forward_model_path self.backward_model_path = backward_model_path self.forward_model = self._load_lm(forward_model_path) if forward_model_path else None self.backward_model = self._load_lm(backward_model_path) if backward_model_path else None if trainable: self._fw = self.forward_model.model self._bw = self.backward_model.model for m in self._fw, self._bw: m.trainable = True self.supports_masking = True self.max_word_len = max_word_len def call(self, inputs, **kwargs): str_inputs = <API key>(inputs) outputs = self.embed(str_inputs) copy_mask(inputs, outputs) return outputs def _load_lm(self, filepath): filepath = get_resource(filepath) lm = RNNLanguageModel() lm.load(filepath) model: tf.keras.Sequential = lm.model for idx, layer in enumerate(model.layers): if isinstance(layer, tf.keras.layers.LSTM): lm.model = tf.keras.Sequential(model.layers[:idx + 1]) # discard dense layer return lm def embed(self, texts: List[List[str]]): """Embedding sentences (list of words) with contextualized string embedding Args: texts: List of words, not chars texts: List[List[str]]: Returns: """ fw = None if self.forward_model: fw = self._run_rnn(texts, model=self.forward_model) bw = None if self.backward_model: bw = self._run_rnn(texts, model=self.backward_model) if not all(x is not None for x in [fw, bw]): return fw if fw is not None else bw else: return tf.concat([fw, bw], axis=-1) def _run_rnn(self, texts, model): embeddings = [] inputs = [] offsets = [] tokenizer = model.transform.tokenize_func() backward = not model.config['forward'] for sent in texts: raw, off = self._get_raw_string(sent, tokenizer) inputs.append(raw) offsets.append(off) outputs = model.model_from_config.predict(model.transform.inputs_to_dataset(inputs)) if backward: outputs = tf.reverse(outputs, axis=[1]) maxlen = len(max(texts, key=len)) for hidden, off, sent in zip(outputs, offsets, texts): embed = [] for (start, end), word in zip(off, sent): embed.append(hidden[end - 1, :]) if len(embed) < maxlen: embed += [np.zeros_like(embed[-1])] * (maxlen - len(embed)) embeddings.append(np.stack(embed)) return tf.stack(embeddings) def _get_raw_string(self, sent: List[str], tokenizer): raw_string = [] offsets = [] whitespace_after = infer_space_after(sent) start = 0 for word, space in zip(sent, whitespace_after): chars = tokenizer(word) chars = chars[:self.max_word_len] if space: chars += [' '] end = start + len(chars) offsets.append((start, end)) start = end raw_string += chars return raw_string, offsets def get_config(self): config = { 'forward_model_path': self.forward_model_path, 'backward_model_path': self.backward_model_path, 'max_word_len': self.max_word_len, } base_config = super(<API key>, self).get_config() return dict(list(base_config.items()) + list(config.items())) @property def output_dim(self): dim = 0 for model in self.forward_model, self.backward_model: if model: dim += model.config['rnn_units'] return dim def <API key>(self, input_shape): return input_shape + self.output_dim def compute_mask(self, inputs, mask=None): return tf.not_equal(inputs, PAD)
package HTTPClient; public class ModuleException extends Exception { /** * Constructs an ModuleException with no detail message. A detail * message is a String that describes this particular exception. */ public ModuleException() { super(); } /** * Constructs an ModuleException class with the specified detail message. * A detail message is a String that describes this particular exception. * * @param msg the String containing a detail message */ public ModuleException(String msg) { super(msg); } }
# -*- encoding: utf-8 -*- class ContainerManager CONTAINER_PREFIX = 'cf'.freeze attr_reader :backend, :credentials, :syslog_drain_port, :<API key> def initialize(attrs) validate_attrs(attrs) @backend = attrs.fetch('backend') @credentials = Credentials.new(attrs.fetch('credentials', {})) @syslog_drain_port = attrs.fetch('syslog_drain_port', nil) @<API key> = attrs.fetch('<API key>', 'syslog') end def find(guid) raise Exceptions::NotImplemented, "`find' is not implemented by `#{self.class}'" end def can_allocate?(max_containers, max_plan_containers) raise Exceptions::NotImplemented, "`can_allocate?' is not implemented by `#{self.class}'" end def create(guid) raise Exceptions::NotImplemented, "`create' is not implemented by `#{self.class}'" end def destroy(guid) raise Exceptions::NotImplemented, "`destroy' is not implemented by `#{self.class}'" end def fetch_image raise Exceptions::NotImplemented, "`fetch_image' is not implemented by `#{self.class}'" end def service_credentials(guid) raise Exceptions::NotImplemented, "`service_credentials' is not implemented by `#{self.class}'" end def syslog_drain_url(guid) nil end def details(guid) nil end def processes(guid) nil end def stdout(guid) nil end def stderr(guid) nil end private def container_name(guid) "#{CONTAINER_PREFIX}-#{guid}" end def validate_attrs(attrs) required_keys = %w(backend) missing_keys = [] required_keys.each do |key| missing_keys << "#{key}" unless attrs.key?(key) end unless missing_keys.empty? raise Exceptions::ArgumentError, "Missing Container parameters: #{missing_keys.join(', ')}" end end end
<?xml version="1.0" encoding="UTF-8"?> <html xmlns="http: <body> <wicket:extend> <wicket:child/> <span wicket:id="addBranchPanel"></span> <div wicket:id="branchesTable"></div> <form wicket:id="findMergesForm"> <button wicket:id="findMerges" type="submit" wicket:message="value:findMerges">Find merges</button> </form> <div wicket:id="result"></div> </wicket:extend> </body> </html>
package com.antonyjekov.nevix.common; import android.os.AsyncTask; import com.antonyjekov.nevix.common.contracts.FailCallback; import org.apache.http.client.methods.HttpGet; import org.apache.http.client.methods.HttpPost; import org.apache.http.client.methods.HttpPut; import org.apache.http.util.ByteArrayBuffer; import java.io.BufferedReader; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.io.OutputStreamWriter; import java.io.Writer; import java.net.HttpURLConnection; import java.net.URL; public class HttpAsyncRequest extends AsyncTask<Void, Void, String> { private boolean <API key> = true; private final OnResultCallBack callBack; private final FailCallback error; public static interface OnResultCallBack { void onResult(String result); } private HttpRequestType requestType; private String sessionKey; private String requestAddress; private String requestBody; public HttpAsyncRequest(OnResultCallBack callBack, FailCallback error) { this.callBack = callBack; this.error = error; } @Override protected String doInBackground(Void... strings) { String responseStorage; //storage of the response try { //Uses URL and HttpURLConnection for server connection. URL targetURL = new URL(requestAddress); HttpURLConnection httpCon = (HttpURLConnection) targetURL.openConnection(); httpCon.setDoInput(true); httpCon.setUseCaches(false); httpCon.<API key>(0); //properties of SOAPAction header httpCon.addRequestProperty("Content-Type", "application/json; charset=utf-8"); httpCon.addRequestProperty(PersisterManager.SESSION_KEY_HEADER, "" + sessionKey); if (requestType != HttpRequestType.GET) { httpCon.setDoOutput(true); httpCon.addRequestProperty("Content-Length", "" + requestBody.length()); switch (requestType) { case PUT: httpCon.setRequestMethod(HttpPut.METHOD_NAME); break; case POST: httpCon.setRequestMethod(HttpPost.METHOD_NAME); break; } //sending request to the server. OutputStream outputStream = httpCon.getOutputStream(); Writer writer = new OutputStreamWriter(outputStream); writer.write(requestBody); writer.flush(); writer.close(); } else httpCon.setRequestMethod(HttpGet.METHOD_NAME); //getting the response from the server InputStream inputStream = httpCon.getInputStream(); BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inputStream)); ByteArrayBuffer byteArrayBuffer = new ByteArrayBuffer(50); int intResponse; while ((intResponse = bufferedReader.read()) != -1) { byteArrayBuffer.append(intResponse); } responseStorage = new String(byteArrayBuffer.toByteArray()); } catch (Exception aException) { responseStorage = aException.getMessage(); this.<API key> = false; } return responseStorage; } public void getRequest(String url, String sessionKey) { requestAddress = url; this.sessionKey = sessionKey; requestType = HttpRequestType.GET; } public void putRequest(String url, String json, String sessionKey) { requestAddress = url; this.sessionKey = sessionKey; requestType = HttpRequestType.PUT; requestBody = json; } public void postRequest(String url, String json, String sessionKey) { requestAddress = url; this.sessionKey = sessionKey; requestType = HttpRequestType.POST; requestBody = json; } @Override protected void onPostExecute(String result) { if (<API key>) { result = trimString(result); callBack.onResult(result); } else { error.onFail(); } } private String trimString(String result) { if (result == null || result.length() == 0) { return ""; } StringBuilder stringBuilder = new StringBuilder(); for (int i = 1, len = result.length() - 1; i < len; i++) { stringBuilder.append(result.charAt(i)); } return stringBuilder.toString(); } }
#ifndef DATA_SOURCE_H #define DATA_SOURCE_H #include <vector> class ConfigFile; class Mesh; class DataSource { public: DataSource(const ConfigFile& config_); ~DataSource(); void populate(Mesh * const mesh_); private: const ConfigFile& _config; bool _debug; int _n_dimensions; std::vector<double> _subregions; }; #endif
#!/usr/bin/env python # -*- coding: utf-8 -*- # function: import os import os.path import sys import argparse from PIL import Image def CutImage(filein, fileout, width, height, type): ''' # width*height filein: fileout: width: height: type:png, gif, jpeg... ''' img = Image.open(filein) out = img.crop((1, 1, width, height)) out.save(fileout, type) if __name__ == "__main__": argc = len(sys.argv) cmdargs = str(sys.argv) parser = argparse.ArgumentParser(description="Tool for change the picture to custom size") parser.add_argument('-f', '--file', required=True, help='the file path of the input file') parser.add_argument('-H', '--height', type=int, required=True, help='height of the output file') parser.add_argument('-W', '--width', type=int, required=True, help='width of the output file') parser.add_argument('-T', '--type', required=False, help='the type of the output file: jpeg, git, png ,etc') args = parser.parse_args() filein = args.file width = args.width height = args.height f, e = os.path.splitext(filein) if args.type is None: type = 'png' else: type = args.type fileout = f + "_" + str(width) + "_" + str(height) + '.' + type CutImage(filein, fileout, width, height, type)
package name.marmac.bankanalyzer.importers.statements.ch.bcv.processors; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.<API key>; import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; import name.marmac.bankanalyzer.model.to.transactions.TransactionTOType; import name.marmac.bankanalyzer.model.to.transactions.TransactionsTOType; import org.apache.camel.Exchange; import org.apache.camel.Message; import org.apache.camel.Processor; import java.io.OutputStream; import java.io.StringWriter; import java.io.Writer; public class <API key> implements Processor { @Override public void process(Exchange exchange) throws Exception { Message in = exchange.getIn(); TransactionsTOType transactionsTOType = (TransactionsTOType) in.getBody(); ObjectMapper mapper = new ObjectMapper(); mapper.registerModule(new JavaTimeModule()); mapper.configure(<API key>.<API key>, false); String transactionsTOJSON = mapper.<API key>().writeValueAsString(transactionsTOType); exchange.getOut().setBody(transactionsTOJSON); } }
# AUTOGENERATED FILE FROM balenalib/odroid-ux3-ubuntu:bionic-build # remove several traces of debian python RUN apt-get purge -y python.* # > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK. ENV LANG C.UTF-8 # key 63C7CC90: public key "Simon McVittie <smcv@pseudorandom.co.uk>" imported # key 3372DCFA: public key "Donald Stufft (dstufft) <donald@stufft.io>" imported RUN gpg --keyserver keyring.debian.org --recv-keys 4DE8FF2A63C7CC90 \ && gpg --keyserver keyserver.ubuntu.com --recv-key 6E3CBCE93372DCFA \ && gpg --keyserver keyserver.ubuntu.com --recv-keys 0x52a43a1e4b77b059 ENV PYTHON_VERSION 3.9.10 # if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value '<VERSION>'" ENV PYTHON_PIP_VERSION 21.3.1 ENV SETUPTOOLS_VERSION 60.5.4 RUN set -x \ && curl -SLO "http://resin-packages.s3.amazonaws.com/python/v$PYTHON_VERSION/Python-$PYTHON_VERSION.<API key>.2.tar.gz" \ && echo "<SHA256-like> Python-$PYTHON_VERSION.<API key>.2.tar.gz" | sha256sum -c - \ && tar -xzf "Python-$PYTHON_VERSION.<API key>.2.tar.gz" --strip-components=1 \ && rm -rf "Python-$PYTHON_VERSION.<API key>.2.tar.gz" \ && ldconfig \ && if [ ! -e /usr/local/bin/pip3 ]; then : \ && curl -SLO "https://raw.githubusercontent.com/pypa/get-pip/<SHA1-like>/get-pip.py" \ && echo "<SHA256-like> get-pip.py" | sha256sum -c - \ && python3 get-pip.py \ && rm get-pip.py \ ; fi \ && pip3 install --no-cache-dir --upgrade --force-reinstall pip=="$PYTHON_PIP_VERSION" setuptools=="$SETUPTOOLS_VERSION" \ && find /usr/local \ \( -type d -a -name test -o -name tests \) \ -o \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \ -exec rm -rf '{}' + \ && cd / \ && rm -rf /usr/src/python ~/.cache # install "virtualenv", since the vast majority of users of this image will want it RUN pip3 install --no-cache-dir virtualenv ENV PYTHON_DBUS_VERSION 1.2.18 # install dbus-python dependencies RUN apt-get update && apt-get install -y --<API key> \ libdbus-1-dev \ libdbus-glib-1-dev \
// <auto-generated/> #nullable disable using System.Collections.Generic; using System.Text.Json; using Azure.Core; namespace Azure.ResourceManager.AppConfiguration.Models { public partial class <API key> { internal static <API key> <API key>(JsonElement element) { IReadOnlyList<OperationDefinition> value = default; string nextLink = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("value")) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } List<OperationDefinition> array = new List<OperationDefinition>(); foreach (var item in property.Value.EnumerateArray()) { if (item.ValueKind == JsonValueKind.Null) { array.Add(null); } else { array.Add(OperationDefinition.<API key>(item)); } } value = array; continue; } if (property.NameEquals("nextLink")) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } nextLink = property.Value.GetString(); continue; } } return new <API key>(value, nextLink); } } }
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http: <html xmlns="http: <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>continue &mdash; CMake 3.3.2 Documentation</title> <link rel="stylesheet" href="../_static/cmake.css" type="text/css" /> <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> <script type="text/javascript"> var <API key> = { URL_ROOT: '../', VERSION: '3.3.2', COLLAPSE_INDEX: false, FILE_SUFFIX: '.html', HAS_SOURCE: true }; </script> <script type="text/javascript" src="../_static/jquery.js"></script> <script type="text/javascript" src="../_static/underscore.js"></script> <script type="text/javascript" src="../_static/doctools.js"></script> <link rel="shortcut icon" href="../_static/cmake-favicon.ico"/> <link rel="top" title="CMake 3.3.2 Documentation" href="../index.html" /> <link rel="up" title="cmake-commands(7)" href="../manual/cmake-commands.7.html" /> <link rel="next" title="<API key>" href="<API key>.html" /> <link rel="prev" title="configure_file" href="configure_file.html" /> </head> <body role="document"> <div class="related" role="navigation" aria-label="related navigation"> <h3>Navigation</h3> <ul> <li class="right" style="margin-right: 10px"> <a href="../genindex.html" title="General Index" accesskey="I">index</a></li> <li class="right" > <a href="<API key>.html" title="<API key>" accesskey="N">next</a> |</li> <li class="right" > <a href="configure_file.html" title="configure_file" accesskey="P">previous</a> |</li> <li> <img src="../_static/cmake-logo-16.png" alt="" style="vertical-align: middle; margin-top: -2px" /> </li> <li> <a href="http: </li> <li> <a href="../index.html">3.3.2 Documentation</a> &raquo; </li> <li class="nav-item nav-item-1"><a href="../manual/cmake-commands.7.html" accesskey="U">cmake-commands(7)</a> &raquo;</li> </ul> </div> <div class="document"> <div class="documentwrapper"> <div class="bodywrapper"> <div class="body" role="main"> <div class="section" id="continue"> <span id="command:continue"></span><h1>continue<a class="headerlink" href=" <p>Continue to the top of enclosing foreach or while loop.</p> <div class="highlight-python"><div class="highlight"><pre>continue() </pre></div> </div> <p>The <code class="docutils literal"><span class="pre">continue</span></code> command allows a cmake script to abort the rest of a block in a <span class="target" id="index-0-command:foreach"></span><a class="reference internal" href="foreach.html#command:foreach" title="foreach"><code class="xref cmake cmake-command docutils literal"><span class="pre">foreach()</span></code></a> or <span class="target" id="index-0-command:while"></span><a class="reference internal" href="while.html#command:while" title="while"><code class="xref cmake cmake-command docutils literal"><span class="pre">while()</span></code></a> loop, and start at the top of the next iteration. See also the <span class="target" id="index-0-command:break"></span><a class="reference internal" href="break.html#command:break" title="break"><code class="xref cmake cmake-command docutils literal"><span class="pre">break()</span></code></a> command.</p> </div> </div> </div> </div> <div class="sphinxsidebar" role="navigation" aria-label="main navigation"> <div class="<API key>"> <h4>Previous topic</h4> <p class="topless"><a href="configure_file.html" title="previous chapter">configure_file</a></p> <h4>Next topic</h4> <p class="topless"><a href="<API key>.html" title="next chapter"><API key></a></p> <div role="note" aria-label="source link"> <h3>This Page</h3> <ul class="this-page-menu"> <li><a href="../_sources/command/continue.txt" rel="nofollow">Show Source</a></li> </ul> </div> <div id="searchbox" style="display: none" role="search"> <h3>Quick search</h3> <form class="search" action="../search.html" method="get"> <input type="text" name="q" /> <input type="submit" value="Go" /> <input type="hidden" name="check_keywords" value="yes" /> <input type="hidden" name="area" value="default" /> </form> <p class="searchtip" style="font-size: 90%"> Enter search terms or a module, class or function name. </p> </div> <script type="text/javascript">$('#searchbox').show(0);</script> </div> </div> <div class="clearer"></div> </div> <div class="related" role="navigation" aria-label="related navigation"> <h3>Navigation</h3> <ul> <li class="right" style="margin-right: 10px"> <a href="../genindex.html" title="General Index" >index</a></li> <li class="right" > <a href="<API key>.html" title="<API key>" >next</a> |</li> <li class="right" > <a href="configure_file.html" title="configure_file" >previous</a> |</li> <li> <img src="../_static/cmake-logo-16.png" alt="" style="vertical-align: middle; margin-top: -2px" /> </li> <li> <a href="http: </li> <li> <a href="../index.html">3.3.2 Documentation</a> &raquo; </li> <li class="nav-item nav-item-1"><a href="../manual/cmake-commands.7.html" >cmake-commands(7)</a> &raquo;</li> </ul> </div> <div class="footer" role="contentinfo"> &copy; Copyright 2000-2015 Kitware, Inc.. Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.4a0+. </div> </body> </html>
body { overflow-x: hidden; font-family: "Roboto Slab","Helvetica Neue",Helvetica,Arial,sans-serif; } .text-muted { color: #1D1E1E; } .text-primary { color: #fed136; } p { font-size: 14px; line-height: 1.75; } p.large { font-size: 16px; } a, a:hover, a:focus, a:active, a.active { outline: 0; } a { color: #fed136; } a:hover, a:focus, a:active, a.active { color: #fec503; } h1, h2, h3, h4, h5, h6 { text-transform: uppercase; font-family: Montserrat,"Helvetica Neue",Helvetica,Arial,sans-serif; font-weight: 700; } .img-centered { margin: 0 auto; } .bg-light-gray { background-color: #f7f7f7; } .bg-darkest-gray { background-color: #222; } .btn-primary { border-color: #fed136; text-transform: uppercase; font-family: Montserrat,"Helvetica Neue",Helvetica,Arial,sans-serif; font-weight: 700; color: #fff; background-color: #fed136; } .btn-primary:hover, .btn-primary:focus, .btn-primary:active, .btn-primary.active, .open .dropdown-toggle.btn-primary { border-color: #f6bf01; color: #fff; background-color: #fec503; } .btn-primary:active, .btn-primary.active, .open .dropdown-toggle.btn-primary { background-image: none; } .btn-primary.disabled, .btn-primary[disabled], fieldset[disabled] .btn-primary, .btn-primary.disabled:hover, .btn-primary[disabled]:hover, fieldset[disabled] .btn-primary:hover, .btn-primary.disabled:focus, .btn-primary[disabled]:focus, fieldset[disabled] .btn-primary:focus, .btn-primary.disabled:active, .btn-primary[disabled]:active, fieldset[disabled] .btn-primary:active, .btn-primary.disabled.active, .btn-primary[disabled].active, fieldset[disabled] .btn-primary.active { border-color: #fed136; background-color: #fed136; } .btn-primary .badge { color: #fed136; background-color: #fff; } .btn-xl { padding: 20px 40px; border-color: #fed136; border-radius: 3px; text-transform: uppercase; font-family: Montserrat,"Helvetica Neue",Helvetica,Arial,sans-serif; font-size: 18px; font-weight: 700; color: #fff; background-color: #fed136; } .btn-xl:hover, .btn-xl:focus, .btn-xl:active, .btn-xl.active, .open .dropdown-toggle.btn-xl { border-color: #f6bf01; color: #fff; background-color: #fec503; } .btn-xl:active, .btn-xl.active, .open .dropdown-toggle.btn-xl { background-image: none; } .btn-xl.disabled, .btn-xl[disabled], fieldset[disabled] .btn-xl, .btn-xl.disabled:hover, .btn-xl[disabled]:hover, fieldset[disabled] .btn-xl:hover, .btn-xl.disabled:focus, .btn-xl[disabled]:focus, fieldset[disabled] .btn-xl:focus, .btn-xl.disabled:active, .btn-xl[disabled]:active, fieldset[disabled] .btn-xl:active, .btn-xl.disabled.active, .btn-xl[disabled].active, fieldset[disabled] .btn-xl.active { border-color: #fed136; background-color: #fed136; } .btn-xl .badge { color: #fed136; background-color: #fff; } .navbar-default { border-color: transparent; background-color: #222; } .navbar-default .navbar-brand { font-family: "Droid Sans","Helvetica Neue",Helvetica,Arial,cursive; color: #fff; font-weight: 700; } .navbar-default .navbar-brand:hover, .navbar-default .navbar-brand:focus, .navbar-default .navbar-brand:active, .navbar-default .navbar-brand.active { color: #fff; } .navbar-default .navbar-collapse { border-color: rgba(255,255,255,.02); } .navbar-default .navbar-toggle { border-color: #fed136; background-color: #fed136; } .navbar-default .navbar-toggle .icon-bar { background-color: #fff; } .navbar-default .navbar-toggle:hover, .navbar-default .navbar-toggle:focus { background-color: #fed136; } .navbar-default .nav li a { text-transform: uppercase; font-family: Montserrat,"Helvetica Neue",Helvetica,Arial,sans-serif; font-weight: 400; letter-spacing: 1px; color: #fff; } .navbar-default .nav li a:hover, .navbar-default .nav li a:focus { outline: 0; color: #ED1C24; } .navbar-default .navbar-nav>.active>a { border-radius: 0; color: #fff; background-color: #ED1C24; } .navbar-default .navbar-nav>.active>a:hover, .navbar-default .navbar-nav>.active>a:focus { color: #fff; background-color: #ED1C24; } @media(min-width:768px) { .navbar-default { padding: 25px 0; border: 0; background-color: transparent; -webkit-transition: padding .3s; -moz-transition: padding .3s; transition: padding .3s; } .navbar-default .navbar-brand { font-size: 2em; -webkit-transition: all .3s; -moz-transition: all .3s; transition: all .3s; } .navbar-default .navbar-nav>.active>a { border-radius: 3px; } .navbar-default.navbar-shrink { padding: 10px 0; background-color: #222; } .navbar-default.navbar-shrink .navbar-brand { font-size: 1.5em; } } header { text-align: center; color: #fff; background-color: #ED1C24; <API key>: scroll; background-image: url(../img/portfolio/<API key>.png); background-position: center center; background-repeat: none; -<API key>: cover; -moz-background-size: cover; background-size: cover; -o-background-size: cover; } header .intro-text { padding-top: 100px; padding-bottom: 50px; } header .intro-text .intro-lead-in { margin-bottom: 25px; font-family: "Droid Serif","Helvetica Neue",Helvetica,Arial,sans-serif; font-size: 22px; font-style: italic; line-height: 22px; } header .intro-text .intro-heading { margin-bottom: 25px; text-transform: uppercase; font-family: Montserrat,"Helvetica Neue",Helvetica,Arial,sans-serif; font-size: 50px; font-weight: 700; line-height: 50px; } @media(min-width:768px) { header .intro-text { padding-top: 300px; padding-bottom: 200px; } header .intro-text .intro-lead-in { margin-bottom: 25px; font-family: "Droid Serif","Helvetica Neue",Helvetica,Arial,sans-serif; font-size: 40px; font-style: italic; line-height: 40px; } header .intro-text .intro-heading { margin-bottom: 50px; text-transform: uppercase; font-family: Montserrat,"Helvetica Neue",Helvetica,Arial,sans-serif; font-size: 75px; font-weight: 700; line-height: 75px; } } section { padding: 100px 0; } section h2.section-heading { margin-top: 20px; margin-bottom: 15px; font-size: 30px; text-align: center; color: #1D1E1E; letter-spacing: 15px; font-weight: 700; font-family: 'Roboto Slab', serif; } section h2.<API key> { margin-top: 20px; margin-bottom: 15px; font-size: 35px; text-align: center; color: #1D1E1E; font-weight: 700; font-family: 'Roboto Slab', serif; } section h2.section-heading-2 { margin-top: 20px; margin-bottom: 15px; font-size: 30px; text-align: center; color: #fff; letter-spacing: 15px; font-weight: 700; font-family: 'Roboto Slab', serif; } section h2.<API key> { margin-top: 20px; margin-bottom: 15px; font-size: 25px; text-align: center; color: #fff; font-weight: 700; font-family: 'Roboto Slab', serif; } section h3.section-subheading { margin-bottom: 35px; margin-left: 20%; text-transform: none; font-family: "Droid Serif","Helvetica Neue",Helvetica,Arial,sans-serif; font-size: 14px; font-style: italic; font-weight: 700; line-height: 20px; max-width: 60%; text-align: center; } section h3.<API key> { margin-bottom: 35px; text-transform: none; font-family: "Droid Serif","Helvetica Neue",Helvetica,Arial,sans-serif; font-size: 14px; font-style: italic; font-weight: 700; line-height: 20px; text-align: center; } section h3.<API key> { margin-bottom: 35px; text-transform: none; font-family: "Droid Serif","Helvetica Neue",Helvetica,Arial,sans-serif; font-size: 14px; font-style: italic; font-weight: 400; line-height: 20px; color: #fff; text-align: center; } @media(min-width:768px) { section { padding: 150px 0; } } .service-heading { margin: 15px 0; text-transform: none; } #portfolio .portfolio-item { right: 0; margin: 0 0 15px; } #portfolio .portfolio-item .portfolio-link { display: block; position: relative; margin: 0 auto; max-width: 400px; } #portfolio .portfolio-item .portfolio-link .portfolio-hover { position: absolute; width: 100%; height: 100%; opacity: 0; background: rgba(254,209,54,.9); -webkit-transition: all ease .5s; -moz-transition: all ease .5s; transition: all ease .5s; } #portfolio .portfolio-item .portfolio-link .portfolio-hover:hover { opacity: 1; } #portfolio .portfolio-item .portfolio-link .portfolio-hover .<API key> { position: absolute; top: 50%; width: 100%; height: 20px; margin-top: -12px; text-align: center; font-size: 20px; color: #fff; } #portfolio .portfolio-item .portfolio-link .portfolio-hover .<API key> i { margin-top: -12px; } #portfolio .portfolio-item .portfolio-link .portfolio-hover .<API key> h3, #portfolio .portfolio-item .portfolio-link .portfolio-hover .<API key> h4 { margin: 0; } #portfolio .portfolio-item .portfolio-caption { margin: 0 auto; padding: 25px; max-width: 400px; text-align: center; background-color: #fff; } #portfolio .portfolio-item .portfolio-caption h4 { margin: 0; text-transform: none; } #portfolio .portfolio-item .portfolio-caption p { margin: 0; font-family: "Droid Serif","Helvetica Neue",Helvetica,Arial,sans-serif; font-size: 16px; font-style: italic; } #portfolio * { z-index: 2; } @media(min-width:767px) { #portfolio .portfolio-item { margin: 0 0 30px; } } .timeline { position: relative; padding: 0; list-style: none; } .timeline:before { content: ""; position: absolute; top: 0; bottom: 0; left: 40px; width: 2px; margin-left: -1.5px; background-color: #f1f1f1; } .timeline>li { position: relative; margin-bottom: 50px; min-height: 50px; } .timeline>li:before, .timeline>li:after { content: " "; display: table; } .timeline>li:after { clear: both; } .timeline>li .timeline-panel { float: right; position: relative; width: 100%; padding: 0 20px 0 100px; text-align: left; } .timeline>li .timeline-panel:before { right: auto; left: -15px; border-right-width: 15px; border-left-width: 0; } .timeline>li .timeline-panel:after { right: auto; left: -14px; border-right-width: 14px; border-left-width: 0; } .timeline>li .timeline-image { z-index: 100; position: absolute; left: 0; width: 80px; height: 80px; margin-left: 0; border: 7px solid #f1f1f1; border-radius: 100%; text-align: center; color: #fff; background-color: #fed136; } .timeline>li .timeline-image h4 { margin-top: 12px; font-size: 10px; line-height: 14px; } .timeline>li.timeline-inverted>.timeline-panel { float: right; padding: 0 20px 0 100px; text-align: left; } .timeline>li.timeline-inverted>.timeline-panel:before { right: auto; left: -15px; border-right-width: 15px; border-left-width: 0; } .timeline>li.timeline-inverted>.timeline-panel:after { right: auto; left: -14px; border-right-width: 14px; border-left-width: 0; } .timeline>li:last-child { margin-bottom: 0; } .timeline .timeline-heading h4 { margin-top: 0; color: inherit; } .timeline .timeline-heading h4.subheading { text-transform: none; } .timeline .timeline-body>p, .timeline .timeline-body>ul { margin-bottom: 0; } @media(min-width:768px) { .timeline:before { left: 50%; } .timeline>li { margin-bottom: 100px; min-height: 100px; } .timeline>li .timeline-panel { float: left; width: 41%; padding: 0 20px 20px 30px; text-align: right; } .timeline>li .timeline-image { left: 50%; width: 100px; height: 100px; margin-left: -50px; } .timeline>li .timeline-image h4 { margin-top: 16px; font-size: 13px; line-height: 18px; } .timeline>li.timeline-inverted>.timeline-panel { float: right; padding: 0 30px 20px 20px; text-align: left; } } @media(min-width:992px) { .timeline>li { min-height: 150px; } .timeline>li .timeline-panel { padding: 0 20px 20px; } .timeline>li .timeline-image { width: 150px; height: 150px; margin-left: -75px; } .timeline>li .timeline-image h4 { margin-top: 30px; font-size: 18px; line-height: 26px; } .timeline>li.timeline-inverted>.timeline-panel { padding: 0 20px 20px; } } @media(min-width:1200px) { .timeline>li { min-height: 170px; } .timeline>li .timeline-panel { padding: 0 20px 20px 100px; } .timeline>li .timeline-image { width: 170px; height: 170px; margin-left: -85px; } .timeline>li .timeline-image h4 { margin-top: 40px; } .timeline>li.timeline-inverted>.timeline-panel { padding: 0 100px 20px 20px; } } .team-member { margin-bottom: 50px; text-align: center; } .team-member img { margin: 0 auto; border: 7px solid #fff; } .team-member h4 { margin-top: 25px; margin-bottom: 0; text-transform: none; } .team-member p { margin-top: 0; } aside.clients img { margin: 50px auto; } section#contact { background-color: #222; background-image: url(../img/map-image.png); background-position: center; background-repeat: no-repeat; } section#contact .section-heading { color: #1D1E1E; } section#contact .form-group { margin-bottom: 25px; } section#contact .form-group input, section#contact .form-group textarea { padding: 20px; } section#contact .form-group input.form-control { height: auto; } section#contact .form-group textarea.form-control { height: 236px; } section#contact .form-control:focus { border-color: #fed136; box-shadow: none; } section#contact::-<API key> { text-transform: uppercase; font-family: Montserrat,"Helvetica Neue",Helvetica,Arial,sans-serif; font-weight: 700; color: #bbb; } section#contact:-moz-placeholder { text-transform: uppercase; font-family: Montserrat,"Helvetica Neue",Helvetica,Arial,sans-serif; font-weight: 700; color: #bbb; } section#contact::-moz-placeholder { text-transform: uppercase; font-family: Montserrat,"Helvetica Neue",Helvetica,Arial,sans-serif; font-weight: 700; color: #bbb; } section#contact:-<API key> { text-transform: uppercase; font-family: Montserrat,"Helvetica Neue",Helvetica,Arial,sans-serif; font-weight: 700; color: #bbb; } section#contact .text-danger { color: #e74c3c; } footer { padding: 25px 0; text-align: center; background-color: #3A3A3C; } footer span.copyright { text-transform: uppercase; text-transform: none; font-family: Montserrat,"Helvetica Neue",Helvetica,Arial,sans-serif; line-height: 40px; } footer ul.quicklinks { margin-bottom: 0; text-transform: uppercase; text-transform: none; font-family: Montserrat,"Helvetica Neue",Helvetica,Arial,sans-serif; line-height: 40px; } ul.social-buttons { margin-bottom: 0; } ul.social-buttons li a { display: block; width: 40px; height: 40px; border-radius: 100%; font-size: 20px; line-height: 40px; outline: 0; color: #fff; background-color: #222; -webkit-transition: all .3s; -moz-transition: all .3s; transition: all .3s; } ul.social-buttons li a:hover, ul.social-buttons li a:focus, ul.social-buttons li a:active { background-color: #fed136; } .btn:focus, .btn:active, .btn.active, .btn:active:focus { outline: 0; } .portfolio-modal .modal-content { padding: 100px 0; min-height: 100%; border: 0; border-radius: 0; text-align: center; background-clip: border-box; -webkit-box-shadow: none; box-shadow: none; } .portfolio-modal .modal-content h2 { margin-bottom: 15px; font-size: 3em; } .portfolio-modal .modal-content p { margin-bottom: 30px; } .portfolio-modal .modal-content p.item-intro { margin: 20px 0 30px; font-family: "Droid Serif","Helvetica Neue",Helvetica,Arial,sans-serif; font-size: 16px; font-style: italic; } .portfolio-modal .modal-content ul.list-inline { margin-top: 0; margin-bottom: 30px; } .portfolio-modal .modal-content img { margin-bottom: 30px; } .portfolio-modal .close-modal { position: absolute; top: 25px; right: 25px; width: 75px; height: 75px; background-color: transparent; cursor: pointer; } .portfolio-modal .close-modal:hover { opacity: .3; } .portfolio-modal .close-modal .lr { z-index: 1051; width: 1px; height: 75px; margin-left: 35px; background-color: #222; -webkit-transform: rotate(45deg); -ms-transform: rotate(45deg); transform: rotate(45deg); } .portfolio-modal .close-modal .lr .rl { z-index: 1052; width: 1px; height: 75px; background-color: #222; -webkit-transform: rotate(90deg); -ms-transform: rotate(90deg); transform: rotate(90deg); } .portfolio-modal .modal-backdrop { display: none; opacity: 0; } ::-moz-selection { text-shadow: none; background: #fed136; } ::selection { text-shadow: none; background: #fed136; } img::selection { background: 0 0; } img::-moz-selection { background: 0 0; } body { <API key>: #fed136; } #About { background-color: #ED1C24; <API key>: scroll; background-image: url(../img/portfolio/bg1.png); background-position: center center; background-repeat: none; -<API key>: cover; -moz-background-size: cover; background-size: cover; -o-background-size: cover; } #Services { background-color: #EAAC1F; <API key>: scroll; background-image: url(../img/portfolio/bg2.png); background-position: center center; background-repeat: none; -<API key>: cover; -moz-background-size: cover; background-size: cover; -o-background-size: cover; } #Contact { background-color: #3A3A3C; <API key>: scroll; background-image: url(../img/portfolio/bg3.png); background-position: center center; background-repeat: none; -<API key>: cover; -moz-background-size: cover; background-size: cover; -o-background-size: cover; }
package com.kris.pojo; import java.util.ArrayList; import java.util.Date; import java.util.List; public class TbItemParamExample { protected String orderByClause; protected boolean distinct; protected List<Criteria> oredCriteria; public TbItemParamExample() { oredCriteria = new ArrayList<Criteria>(); } public void setOrderByClause(String orderByClause) { this.orderByClause = orderByClause; } public String getOrderByClause() { return orderByClause; } public void setDistinct(boolean distinct) { this.distinct = distinct; } public boolean isDistinct() { return distinct; } public List<Criteria> getOredCriteria() { return oredCriteria; } public void or(Criteria criteria) { oredCriteria.add(criteria); } public Criteria or() { Criteria criteria = <API key>(); oredCriteria.add(criteria); return criteria; } public Criteria createCriteria() { Criteria criteria = <API key>(); if (oredCriteria.size() == 0) { oredCriteria.add(criteria); } return criteria; } protected Criteria <API key>() { Criteria criteria = new Criteria(); return criteria; } public void clear() { oredCriteria.clear(); orderByClause = null; distinct = false; } protected abstract static class GeneratedCriteria { protected List<Criterion> criteria; protected GeneratedCriteria() { super(); criteria = new ArrayList<Criterion>(); } public boolean isValid() { return criteria.size() > 0; } public List<Criterion> getAllCriteria() { return criteria; } public List<Criterion> getCriteria() { return criteria; } protected void addCriterion(String condition) { if (condition == null) { throw new RuntimeException("Value for condition cannot be null"); } criteria.add(new Criterion(condition)); } protected void addCriterion(String condition, Object value, String property) { if (value == null) { throw new RuntimeException("Value for " + property + " cannot be null"); } criteria.add(new Criterion(condition, value)); } protected void addCriterion(String condition, Object value1, Object value2, String property) { if (value1 == null || value2 == null) { throw new RuntimeException("Between values for " + property + " cannot be null"); } criteria.add(new Criterion(condition, value1, value2)); } public Criteria andIdIsNull() { addCriterion("id is null"); return (Criteria) this; } public Criteria andIdIsNotNull() { addCriterion("id is not null"); return (Criteria) this; } public Criteria andIdEqualTo(Long value) { addCriterion("id =", value, "id"); return (Criteria) this; } public Criteria andIdNotEqualTo(Long value) { addCriterion("id <>", value, "id"); return (Criteria) this; } public Criteria andIdGreaterThan(Long value) { addCriterion("id >", value, "id"); return (Criteria) this; } public Criteria <API key>(Long value) { addCriterion("id >=", value, "id"); return (Criteria) this; } public Criteria andIdLessThan(Long value) { addCriterion("id <", value, "id"); return (Criteria) this; } public Criteria <API key>(Long value) { addCriterion("id <=", value, "id"); return (Criteria) this; } public Criteria andIdIn(List<Long> values) { addCriterion("id in", values, "id"); return (Criteria) this; } public Criteria andIdNotIn(List<Long> values) { addCriterion("id not in", values, "id"); return (Criteria) this; } public Criteria andIdBetween(Long value1, Long value2) { addCriterion("id between", value1, value2, "id"); return (Criteria) this; } public Criteria andIdNotBetween(Long value1, Long value2) { addCriterion("id not between", value1, value2, "id"); return (Criteria) this; } public Criteria andItemCatIdIsNull() { addCriterion("item_cat_id is null"); return (Criteria) this; } public Criteria <API key>() { addCriterion("item_cat_id is not null"); return (Criteria) this; } public Criteria andItemCatIdEqualTo(Long value) { addCriterion("item_cat_id =", value, "itemCatId"); return (Criteria) this; } public Criteria <API key>(Long value) { addCriterion("item_cat_id <>", value, "itemCatId"); return (Criteria) this; } public Criteria <API key>(Long value) { addCriterion("item_cat_id >", value, "itemCatId"); return (Criteria) this; } public Criteria <API key>(Long value) { addCriterion("item_cat_id >=", value, "itemCatId"); return (Criteria) this; } public Criteria <API key>(Long value) { addCriterion("item_cat_id <", value, "itemCatId"); return (Criteria) this; } public Criteria <API key>(Long value) { addCriterion("item_cat_id <=", value, "itemCatId"); return (Criteria) this; } public Criteria andItemCatIdIn(List<Long> values) { addCriterion("item_cat_id in", values, "itemCatId"); return (Criteria) this; } public Criteria andItemCatIdNotIn(List<Long> values) { addCriterion("item_cat_id not in", values, "itemCatId"); return (Criteria) this; } public Criteria andItemCatIdBetween(Long value1, Long value2) { addCriterion("item_cat_id between", value1, value2, "itemCatId"); return (Criteria) this; } public Criteria <API key>(Long value1, Long value2) { addCriterion("item_cat_id not between", value1, value2, "itemCatId"); return (Criteria) this; } public Criteria andCreatedIsNull() { addCriterion("created is null"); return (Criteria) this; } public Criteria andCreatedIsNotNull() { addCriterion("created is not null"); return (Criteria) this; } public Criteria andCreatedEqualTo(Date value) { addCriterion("created =", value, "created"); return (Criteria) this; } public Criteria <API key>(Date value) { addCriterion("created <>", value, "created"); return (Criteria) this; } public Criteria <API key>(Date value) { addCriterion("created >", value, "created"); return (Criteria) this; } public Criteria <API key>(Date value) { addCriterion("created >=", value, "created"); return (Criteria) this; } public Criteria andCreatedLessThan(Date value) { addCriterion("created <", value, "created"); return (Criteria) this; } public Criteria <API key>(Date value) { addCriterion("created <=", value, "created"); return (Criteria) this; } public Criteria andCreatedIn(List<Date> values) { addCriterion("created in", values, "created"); return (Criteria) this; } public Criteria andCreatedNotIn(List<Date> values) { addCriterion("created not in", values, "created"); return (Criteria) this; } public Criteria andCreatedBetween(Date value1, Date value2) { addCriterion("created between", value1, value2, "created"); return (Criteria) this; } public Criteria <API key>(Date value1, Date value2) { addCriterion("created not between", value1, value2, "created"); return (Criteria) this; } public Criteria andUpdatedIsNull() { addCriterion("updated is null"); return (Criteria) this; } public Criteria andUpdatedIsNotNull() { addCriterion("updated is not null"); return (Criteria) this; } public Criteria andUpdatedEqualTo(Date value) { addCriterion("updated =", value, "updated"); return (Criteria) this; } public Criteria <API key>(Date value) { addCriterion("updated <>", value, "updated"); return (Criteria) this; } public Criteria <API key>(Date value) { addCriterion("updated >", value, "updated"); return (Criteria) this; } public Criteria <API key>(Date value) { addCriterion("updated >=", value, "updated"); return (Criteria) this; } public Criteria andUpdatedLessThan(Date value) { addCriterion("updated <", value, "updated"); return (Criteria) this; } public Criteria <API key>(Date value) { addCriterion("updated <=", value, "updated"); return (Criteria) this; } public Criteria andUpdatedIn(List<Date> values) { addCriterion("updated in", values, "updated"); return (Criteria) this; } public Criteria andUpdatedNotIn(List<Date> values) { addCriterion("updated not in", values, "updated"); return (Criteria) this; } public Criteria andUpdatedBetween(Date value1, Date value2) { addCriterion("updated between", value1, value2, "updated"); return (Criteria) this; } public Criteria <API key>(Date value1, Date value2) { addCriterion("updated not between", value1, value2, "updated"); return (Criteria) this; } } public static class Criteria extends GeneratedCriteria { protected Criteria() { super(); } } public static class Criterion { private String condition; private Object value; private Object secondValue; private boolean noValue; private boolean singleValue; private boolean betweenValue; private boolean listValue; private String typeHandler; public String getCondition() { return condition; } public Object getValue() { return value; } public Object getSecondValue() { return secondValue; } public boolean isNoValue() { return noValue; } public boolean isSingleValue() { return singleValue; } public boolean isBetweenValue() { return betweenValue; } public boolean isListValue() { return listValue; } public String getTypeHandler() { return typeHandler; } protected Criterion(String condition) { super(); this.condition = condition; this.typeHandler = null; this.noValue = true; } protected Criterion(String condition, Object value, String typeHandler) { super(); this.condition = condition; this.value = value; this.typeHandler = typeHandler; if (value instanceof List<?>) { this.listValue = true; } else { this.singleValue = true; } } protected Criterion(String condition, Object value) { this(condition, value, null); } protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { super(); this.condition = condition; this.value = value; this.secondValue = secondValue; this.typeHandler = typeHandler; this.betweenValue = true; } protected Criterion(String condition, Object value, Object secondValue) { this(condition, value, secondValue, null); } } }
<!DOCTYPE html> <html xmlns="http: <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <link rel="SHORTCUT ICON" href="../../../../../img/clover.ico" /> <link rel="stylesheet" href="../../../../../aui/css/aui.min.css" media="all"/> <link rel="stylesheet" href="../../../../../aui/css/aui-experimental.min.css" media="all"/> <!--[if IE 9]><link rel="stylesheet" href="../../../../../aui/css/aui-ie9.min.css" media="all"/><![endif]--> <style type="text/css" media="all"> @import url('../../../../../style.css'); @import url('../../../../../tree.css'); </style> <script src="../../../../../jquery-1.8.3.min.js" type="text/javascript"></script> <script src="../../../../../aui/js/aui.min.js" type="text/javascript"></script> <script src="../../../../../aui/js/aui-experimental.min.js" type="text/javascript"></script> <script src="../../../../../aui/js/aui-soy.min.js" type="text/javascript"></script> <script src="../../../../../package-nodes-tree.js" type="text/javascript"></script> <script src="../../../../../clover-tree.js" type="text/javascript"></script> <script src="../../../../../clover.js" type="text/javascript"></script> <script src="../../../../../clover-descriptions.js" type="text/javascript"></script> <script src="../../../../../cloud.js" type="text/javascript"></script> <title>ABA Route Transit Number Validator 1.0.1-SNAPSHOT</title> </head> <body> <div id="page"> <header id="header" role="banner"> <nav class="aui-header <API key>" role="navigation"> <div class="aui-header-inner"> <div class="aui-header-primary"> <h1 id="logo" class="aui-header-logo <API key>"> <a href="http://openclover.org" title="Visit OpenClover home page"><span class="<API key>">OpenClover</span></a> </h1> </div> <div class="<API key>"> <ul class="aui-nav"> <li id="system-help-menu"> <a class="aui-nav-link" title="Open online documentation" target="_blank" href="http://openclover.org/documentation"> <span class="aui-icon aui-icon-small aui-iconfont-help">&#160;Help</span> </a> </li> </ul> </div> </div> </nav> </header> <div class="aui-page-panel"> <div class="<API key>"> <div class="aui-page-panel-nav <API key>"> <div class="<API key>" style="margin-bottom: 20px;"> <div class="<API key>"> <a href="http://cardatechnologies.com" target="_top"> <div class="aui-avatar aui-avatar-large aui-avatar-project"> <div class="aui-avatar-inner"> <img src="../../../../../img/clover_logo_large.png" alt="Clover icon"/> </div> </div> </a> </div> <div class="<API key>" > <h1> <a href="http://cardatechnologies.com" target="_top"> ABA Route Transit Number Validator 1.0.1-SNAPSHOT </a> </h1> </div> </div> <nav class="aui-navgroup <API key>"> <div class="aui-navgroup-inner"> <ul class="aui-nav"> <li class=""> <a href="../../../../../dashboard.html">Project overview</a> </li> </ul> <div class="aui-nav-heading <API key>"> <strong>Packages</strong> </div> <div class="aui-nav project-packages"> <form method="get" action="#" class="aui <API key>"> <input type="text" autocomplete="off" class="package-filter text" placeholder="Type to filter packages..." name="package-filter" id="package-filter" title="Start typing package name (or part of the name) to search through the tree. Use arrow keys and the Enter key to navigate."/> </form> <p class="<API key> hidden"> <small>No results found.</small> </p> <div class="<API key>" data-root-relative="../../../../../" data-package-name="com.cardatechnologies.utils.validators.abaroutevalidator"> <div class="<API key>"></div> <div class="<API key>"></div> </div> </div> </div> </nav> </div> <section class="<API key>"> <div class="<API key>"> <div class="<API key>"><ol class="aui-nav aui-nav-breadcrumbs"> <li><a href="../../../../../dashboard.html"> Project Clover database Sat Aug 7 2021 12:29:33 MDT</a></li> <li><a href="test-pkg-summary.html">Package com.cardatechnologies.utils.validators.abaroutevalidator</a></li> <li><a href="<API key>.html">Class <API key></a></li> </ol></div> <h1 class="aui-h2-clover"> Test <API key> </h1> <table class="aui"> <thead> <tr> <th>Test</th> <th><label title="The test result. Either a Pass, Fail or Error.">Status</label></th> <th><label title="When the test execution was started">Start time</label></th> <th><label title="The total time in seconds taken to run this test.">Time (seconds)</label></th> <th><label title="A failure or error message if the test is not successful.">Message</label></th> </tr> </thead> <tbody> <tr> <td> <a href="../../../../../com/cardatechnologies/utils/validators/abaroutevalidator/<API key>.html?line=21928#src-21928" ><API key></a> </td> <td> <span class="sortValue">1</span><span class="aui-lozenge aui-lozenge-success">PASS</span> </td> <td> 7 Aug 12:35:36 </td> <td> 0.0 </td> <td> <div></div> <div class="errorMessage"></div> </td> </tr> </tbody> </table> <div>&#160;</div> <table class="aui aui-table-sortable"> <thead> <tr> <th style="white-space:nowrap;"><label title="A class that was directly hit by this test.">Target Class</label></th> <th colspan="4"><label title="The percentage of coverage contributed by each single test.">Coverage contributed by</label> <API key></th> </tr> </thead> <tbody> <tr> <td> <span class="sortValue">com.cardatechnologies.utils.validators.abaroutevalidator.AbaRouteValidator</span> &#160;&#160;<a href="../../../../../com/cardatechnologies/utils/validators/abaroutevalidator/AbaRouteValidator.html?id=30007#AbaRouteValidator" title="AbaRouteValidator" name="sl-47">com.cardatechnologies.utils.validators.abaroutevalidator.AbaRouteValidator</a> </td> <td> <span class="sortValue">0.7352941</span>73.5% </td> <td class="align-middle" style="width: 100%" colspan="3"> <div> <div title="73.5% Covered" style="min-width:40px;" class="barNegative contribBarNegative contribBarNegative"><div class="barPositive contribBarPositive contribBarPositive" style="width:73.5%"></div></div></div> </td> </tr> </tbody> </table> </div> <!-- class="<API key>" --> <footer id="footer" role="contentinfo"> <section class="footer-body"> <ul> <li> Report generated by <a target="_new" href="http://openclover.org">OpenClover</a> v 4.4.1 on Sat Aug 7 2021 12:49:26 MDT using coverage data from Sat Aug 7 2021 12:47:23 MDT. </li> </ul> <ul> <li>OpenClover is free and open-source software. </li> </ul> </section> </footer> </section> <!-- class="<API key>" --> </div> <!-- class="<API key>" --> </div> <!-- class="aui-page-panel" --> </div> <!-- id="page" --> </body> </html>
import { Observable } from '../../Observable'; import { exhaust as higherOrder } from '../../operators/exhaust'; import { ObservableInput } from '../../types'; export function exhaust<T>(this: Observable<ObservableInput<T>>): Observable<T>; export function exhaust<T, R>(this: Observable<T>): Observable<R>; /** * Converts a higher-order Observable into a first-order Observable by dropping * inner Observables while the previous inner Observable has not yet completed. * * <span class="informal">Flattens an <API key> by dropping the * next inner Observables while the current inner is still executing.</span> * * <img src="./img/exhaust.png" width="100%"> * * `exhaust` subscribes to an Observable that emits Observables, also known as a * higher-order Observable. Each time it observes one of these emitted inner * Observables, the output Observable begins emitting the items emitted by that * inner Observable. So far, it behaves like {@link mergeAll}. However, * `exhaust` ignores every new inner Observable if the previous Observable has * not yet completed. Once that one completes, it will accept and flatten the * next inner Observable and repeat this process. * * @example <caption>Run a finite timer for each click, only if there is no currently active timer</caption> * var clicks = Rx.Observable.fromEvent(document, 'click'); * var higherOrder = clicks.map((ev) => Rx.Observable.interval(1000).take(5)); * var result = higherOrder.exhaust(); * result.subscribe(x => console.log(x)); * * @see {@link combineAll} * @see {@link concatAll} * @see {@link switch} * @see {@link mergeAll} * @see {@link exhaustMap} * @see {@link zipAll} * * @return {Observable} An Observable that takes a source of Observables and propagates the first observable * exclusively until it completes before subscribing to the next. * @method exhaust * @owner Observable */ export function exhaust<T>(this: Observable<ObservableInput<T>>): Observable<T> { return higherOrder<T>()(this); }
#ifndef STM32F10X_CL #include "usb_lib.h" void SetCNTR(uint16_t wRegValue) { _SetCNTR(wRegValue); } uint16_t GetCNTR(void) { return(_GetCNTR()); } void SetISTR(uint16_t wRegValue) { _SetISTR(wRegValue); } uint16_t GetISTR(void) { return(_GetISTR()); } uint16_t GetFNR(void) { return(_GetFNR()); } void SetDADDR(uint16_t wRegValue) { _SetDADDR(wRegValue); } uint16_t GetDADDR(void) { return(_GetDADDR()); } void SetBTABLE(uint16_t wRegValue) { _SetBTABLE(wRegValue); } uint16_t GetBTABLE(void) { return(_GetBTABLE()); } void SetENDPOINT(uint8_t bEpNum, uint16_t wRegValue) { _SetENDPOINT(bEpNum, wRegValue); } uint16_t GetENDPOINT(uint8_t bEpNum) { return(_GetENDPOINT(bEpNum)); } void SetEPType(uint8_t bEpNum, uint16_t wType) { _SetEPType(bEpNum, wType); } uint16_t GetEPType(uint8_t bEpNum) { return(_GetEPType(bEpNum)); } void SetEPTxStatus(uint8_t bEpNum, uint16_t wState) { _SetEPTxStatus(bEpNum, wState); } void SetEPRxStatus(uint8_t bEpNum, uint16_t wState) { _SetEPRxStatus(bEpNum, wState); } void <API key>(uint8_t bEpNum, uint8_t bDir) { uint16_t <API key>; <API key> = GetENDPOINT(bEpNum); if (bDir == EP_DBUF_OUT) { /* OUT double buffered endpoint */ _SetENDPOINT(bEpNum, <API key> & ~EPRX_DTOG1); } else if (bDir == EP_DBUF_IN) { /* IN double buffered endpoint */ _SetENDPOINT(bEpNum, <API key> & ~EPTX_DTOG1); } } uint16_t GetEPTxStatus(uint8_t bEpNum) { return(_GetEPTxStatus(bEpNum)); } uint16_t GetEPRxStatus(uint8_t bEpNum) { return(_GetEPRxStatus(bEpNum)); } void SetEPTxValid(uint8_t bEpNum) { _SetEPTxStatus(bEpNum, EP_TX_VALID); } void SetEPRxValid(uint8_t bEpNum) { _SetEPRxStatus(bEpNum, EP_RX_VALID); } void SetEP_KIND(uint8_t bEpNum) { _SetEP_KIND(bEpNum); } void ClearEP_KIND(uint8_t bEpNum) { _ClearEP_KIND(bEpNum); } void Clear_Status_Out(uint8_t bEpNum) { _ClearEP_KIND(bEpNum); } void Set_Status_Out(uint8_t bEpNum) { _SetEP_KIND(bEpNum); } void SetEPDoubleBuff(uint8_t bEpNum) { _SetEP_KIND(bEpNum); } void ClearEPDoubleBuff(uint8_t bEpNum) { _ClearEP_KIND(bEpNum); } uint16_t GetTxStallStatus(uint8_t bEpNum) { return(_GetTxStallStatus(bEpNum)); } uint16_t GetRxStallStatus(uint8_t bEpNum) { return(_GetRxStallStatus(bEpNum)); } void ClearEP_CTR_RX(uint8_t bEpNum) { _ClearEP_CTR_RX(bEpNum); } void ClearEP_CTR_TX(uint8_t bEpNum) { _ClearEP_CTR_TX(bEpNum); } void ToggleDTOG_RX(uint8_t bEpNum) { _ToggleDTOG_RX(bEpNum); } void ToggleDTOG_TX(uint8_t bEpNum) { _ToggleDTOG_TX(bEpNum); } void ClearDTOG_RX(uint8_t bEpNum) { _ClearDTOG_RX(bEpNum); } void ClearDTOG_TX(uint8_t bEpNum) { _ClearDTOG_TX(bEpNum); } void SetEPAddress(uint8_t bEpNum, uint8_t bAddr) { _SetEPAddress(bEpNum, bAddr); } uint8_t GetEPAddress(uint8_t bEpNum) { return(_GetEPAddress(bEpNum)); } void SetEPTxAddr(uint8_t bEpNum, uint16_t wAddr) { _SetEPTxAddr(bEpNum, wAddr); } void SetEPRxAddr(uint8_t bEpNum, uint16_t wAddr) { _SetEPRxAddr(bEpNum, wAddr); } uint16_t GetEPTxAddr(uint8_t bEpNum) { return(_GetEPTxAddr(bEpNum)); } uint16_t GetEPRxAddr(uint8_t bEpNum) { return(_GetEPRxAddr(bEpNum)); } void SetEPTxCount(uint8_t bEpNum, uint16_t wCount) { _SetEPTxCount(bEpNum, wCount); } void SetEPCountRxReg(uint32_t *pdwReg, uint16_t wCount) { _SetEPCountRxReg(dwReg, wCount); } void SetEPRxCount(uint8_t bEpNum, uint16_t wCount) { _SetEPRxCount(bEpNum, wCount); } uint16_t GetEPTxCount(uint8_t bEpNum) { return(_GetEPTxCount(bEpNum)); } uint16_t GetEPRxCount(uint8_t bEpNum) { return(_GetEPRxCount(bEpNum)); } void SetEPDblBuffAddr(uint8_t bEpNum, uint16_t wBuf0Addr, uint16_t wBuf1Addr) { _SetEPDblBuffAddr(bEpNum, wBuf0Addr, wBuf1Addr); } void SetEPDblBuf0Addr(uint8_t bEpNum, uint16_t wBuf0Addr) { _SetEPDblBuf0Addr(bEpNum, wBuf0Addr); } void SetEPDblBuf1Addr(uint8_t bEpNum, uint16_t wBuf1Addr) { _SetEPDblBuf1Addr(bEpNum, wBuf1Addr); } uint16_t GetEPDblBuf0Addr(uint8_t bEpNum) { return(_GetEPDblBuf0Addr(bEpNum)); } uint16_t GetEPDblBuf1Addr(uint8_t bEpNum) { return(_GetEPDblBuf1Addr(bEpNum)); } void SetEPDblBuffCount(uint8_t bEpNum, uint8_t bDir, uint16_t wCount) { _SetEPDblBuffCount(bEpNum, bDir, wCount); } void SetEPDblBuf0Count(uint8_t bEpNum, uint8_t bDir, uint16_t wCount) { _SetEPDblBuf0Count(bEpNum, bDir, wCount); } void SetEPDblBuf1Count(uint8_t bEpNum, uint8_t bDir, uint16_t wCount) { _SetEPDblBuf1Count(bEpNum, bDir, wCount); } uint16_t GetEPDblBuf0Count(uint8_t bEpNum) { return(_GetEPDblBuf0Count(bEpNum)); } uint16_t GetEPDblBuf1Count(uint8_t bEpNum) { return(_GetEPDblBuf1Count(bEpNum)); } EP_DBUF_DIR GetEPDblBufDir(uint8_t bEpNum) { if ((uint16_t)(*_pEPRxCount(bEpNum) & 0xFC00) != 0) return(EP_DBUF_OUT); else if (((uint16_t)(*_pEPTxCount(bEpNum)) & 0x03FF) != 0) return(EP_DBUF_IN); else return(EP_DBUF_ERR); } void FreeUserBuffer(uint8_t bEpNum, uint8_t bDir) { if (bDir == EP_DBUF_OUT) { /* OUT double buffered endpoint */ _ToggleDTOG_TX(bEpNum); } else if (bDir == EP_DBUF_IN) { /* IN double buffered endpoint */ _ToggleDTOG_RX(bEpNum); } } uint16_t ToWord(uint8_t bh, uint8_t bl) { uint16_t wRet; wRet = (uint16_t)bl | ((uint16_t)bh << 8); return(wRet); } uint16_t ByteSwap(uint16_t wSwW) { uint8_t bTemp; uint16_t wRet; bTemp = (uint8_t)(wSwW & 0xff); wRet = (wSwW >> 8) | ((uint16_t)bTemp << 8); return(wRet); } #endif /* STM32F10X_CL */
// <API key>.h // YuWa #import <Foundation/Foundation.h> @interface <API key> : NSObject @property (nonatomic,copy)NSString * fans; @property (nonatomic,copy)NSString * title; @property (nonatomic,copy)NSString * info; @property (nonatomic,copy)NSString * total; @end
.ff0{font-family:sans-serif;visibility:hidden;} @font-face{font-family:ff1;src:url(f1.woff)format("woff");}.ff1{font-family:ff1;line-height:1.589369;font-style:normal;font-weight:normal;visibility:visible;} @font-face{font-family:ff2;src:url(f2.woff)format("woff");}.ff2{font-family:ff2;line-height:1.695312;font-style:normal;font-weight:normal;visibility:visible;} @font-face{font-family:ff3;src:url(f3.woff)format("woff");}.ff3{font-family:ff3;line-height:1.695312;font-style:normal;font-weight:normal;visibility:visible;} .m0{transform:matrix(0.250000,0.000000,0.000000,0.250000,0,0);-ms-transform:matrix(0.250000,0.000000,0.000000,0.250000,0,0);-webkit-transform:matrix(0.250000,0.000000,0.000000,0.250000,0,0);} .m1{transform:none;-ms-transform:none;-webkit-transform:none;} .v0{vertical-align:0.000000px;} .ls0{letter-spacing:0.000000px;} .sc_{text-shadow:none;} .sc0{text-shadow:-0.015em 0 transparent,0 0.015em transparent,0.015em 0 transparent,0 -0.015em transparent;} @media screen and (-<API key>:0){ .sc_{-webkit-text-stroke:0px transparent;} .sc0{-webkit-text-stroke:0.015em transparent;text-shadow:none;} } .ws0{word-spacing:0.000000px;} .fc7{color:rgb(33,78,123);} .fc4{color:rgb(102,0,0);} .fc3{color:rgb(0,0,0);} .fc5{color:rgb(255,0,0);} .fc2{color:rgb(0,0,51);} .fc6{color:rgb(66,184,55);} .fc1{color:rgb(120,0,0);} .fc0{color:rgb(255,255,255);} .fs0{font-size:40.000000px;} .fs4{font-size:48.000000px;} .fs5{font-size:56.000000px;} .fs3{font-size:60.000000px;} .fs2{font-size:80.000000px;} .fs1{font-size:160.000000px;} .ye{bottom:17.000000px;} .y2e{bottom:31.000000px;} .yf{bottom:44.500000px;} .y2a{bottom:61.620000px;} .yb7{bottom:66.000000px;} .y7c{bottom:71.000000px;} .yd6{bottom:73.000000px;} .yb6{bottom:78.000000px;} .y58{bottom:86.500000px;} .y7b{bottom:87.000000px;} .y99{bottom:89.000000px;} .yb5{bottom:90.000000px;} .y2c{bottom:93.120000px;} .yd5{bottom:101.000000px;} .yb4{bottom:102.000000px;} .y7a{bottom:103.000000px;} .y98{bottom:107.000000px;} .yd4{bottom:113.000000px;} .yb3{bottom:118.000000px;} .y79{bottom:119.000000px;} .y56{bottom:120.000000px;} .yd3{bottom:125.000000px;} .y29{bottom:126.620000px;} .y78{bottom:135.000000px;} .y55{bottom:140.000000px;} .yd2{bottom:141.000000px;} .y28{bottom:146.620000px;} .yb9{bottom:149.500000px;} .y77{bottom:151.000000px;} .yd1{bottom:157.000000px;} .y54{bottom:158.000000px;} .y76{bottom:163.000000px;} .y27{bottom:164.620000px;} .y97{bottom:167.000000px;} .y75{bottom:175.000000px;} .y53{bottom:176.000000px;} .y26{bottom:182.620000px;} .y96{bottom:183.000000px;} .y74{bottom:187.000000px;} .y52{bottom:188.000000px;} .yd8{bottom:188.500000px;} .y95{bottom:199.000000px;} .y25{bottom:200.620000px;} .yb2{bottom:203.000000px;} .y51{bottom:204.000000px;} .y94{bottom:215.000000px;} .y7e{bottom:218.500000px;} .y24{bottom:218.620000px;} .y50{bottom:220.000000px;} .yb1{bottom:221.000000px;} .yd0{bottom:222.000000px;} .y93{bottom:231.000000px;} .y4f{bottom:236.000000px;} .y23{bottom:236.620000px;} .yb0{bottom:239.000000px;} .ycf{bottom:242.000000px;} .y92{bottom:247.000000px;} .yaf{bottom:251.000000px;} .y4e{bottom:252.000000px;} .y22{bottom:254.620000px;} .y91{bottom:259.000000px;} .yce{bottom:260.000000px;} .yae{bottom:267.000000px;} .y4d{bottom:268.000000px;} .y90{bottom:271.000000px;} .y73{bottom:272.000000px;} .y21{bottom:272.620000px;} .ycd{bottom:278.000000px;} .y4c{bottom:280.000000px;} .yad{bottom:283.000000px;} .y8f{bottom:287.000000px;} .y72{bottom:290.000000px;} .y20{bottom:290.620000px;} .y4b{bottom:292.000000px;} .yac{bottom:299.000000px;} .y8e{bottom:303.000000px;} .y4a{bottom:304.000000px;} .ycc{bottom:306.000000px;} .y71{bottom:308.000000px;} .yab{bottom:315.000000px;} .y70{bottom:320.000000px;} .ycb{bottom:322.000000px;} .yaa{bottom:331.000000px;} .y9b{bottom:334.500000px;} .y57{bottom:335.500000px;} .y6f{bottom:336.000000px;} .yca{bottom:338.000000px;} .ya9{bottom:343.000000px;} .y6e{bottom:352.000000px;} .yc9{bottom:354.000000px;} .ya8{bottom:355.000000px;} .yc8{bottom:366.000000px;} .ya7{bottom:367.000000px;} .y6d{bottom:368.000000px;} .y49{bottom:369.000000px;} .yc7{bottom:378.000000px;} .ya6{bottom:383.000000px;} .y6c{bottom:384.000000px;} .y8d{bottom:388.000000px;} .yd{bottom:388.500000px;} .y48{bottom:389.000000px;} .yc6{bottom:390.000000px;} .y6b{bottom:400.000000px;} .y8c{bottom:406.000000px;} .yc{bottom:406.500000px;} .y47{bottom:407.000000px;} .y6a{bottom:412.000000px;} .yb8{bottom:414.500000px;} .yc5{bottom:422.000000px;} .y69{bottom:424.000000px;} .y46{bottom:425.000000px;} .y68{bottom:436.000000px;} .yb{bottom:436.500000px;} .y45{bottom:437.000000px;} .ya5{bottom:448.000000px;} .ya{bottom:451.500000px;} .y67{bottom:452.000000px;} .y44{bottom:453.000000px;} .yd7{bottom:453.500000px;} .y9{bottom:461.500000px;} .y8b{bottom:468.000000px;} .y43{bottom:469.000000px;} .y7d{bottom:483.500000px;} .y8{bottom:484.000000px;} .y42{bottom:485.000000px;} .ya4{bottom:486.000000px;} .yc4{bottom:487.000000px;} .y7{bottom:494.000000px;} .y8a{bottom:500.000000px;} .y41{bottom:501.000000px;} .ya3{bottom:504.000000px;} .yc3{bottom:507.000000px;} .y1f{bottom:512.000000px;} .ya2{bottom:516.000000px;} .y40{bottom:517.000000px;} .y6{bottom:524.000000px;} .yc2{bottom:525.000000px;} .y5{bottom:526.000000px;} .y1e{bottom:530.000000px;} .ya1{bottom:532.000000px;} .y3f{bottom:533.000000px;} .y89{bottom:536.000000px;} .y66{bottom:537.000000px;} .yc1{bottom:543.000000px;} .y1d{bottom:548.000000px;} .y3e{bottom:549.000000px;} .y88{bottom:552.000000px;} .y65{bottom:555.000000px;} .yc0{bottom:561.000000px;} .ya0{bottom:564.000000px;} .y3d{bottom:565.000000px;} .y1c{bottom:566.000000px;} .y64{bottom:573.000000px;} .ybf{bottom:579.000000px;} .y9f{bottom:580.000000px;} .y3c{bottom:581.000000px;} .y9a{bottom:583.500000px;} .y1b{bottom:584.000000px;} .y63{bottom:585.000000px;} .y4{bottom:586.000000px;} .y1a{bottom:596.000000px;} .y3b{bottom:597.000000px;} .y62{bottom:601.000000px;} .y19{bottom:612.000000px;} .y3a{bottom:613.000000px;} .ybe{bottom:615.000000px;} .y61{bottom:617.000000px;} .y18{bottom:628.000000px;} .y39{bottom:629.000000px;} .y60{bottom:633.000000px;} .y87{bottom:637.000000px;} .y17{bottom:644.000000px;} .y38{bottom:645.000000px;} .y5f{bottom:649.000000px;} .ybd{bottom:651.000000px;} .y86{bottom:655.000000px;} .y16{bottom:660.000000px;} .y37{bottom:661.000000px;} .y5e{bottom:665.000000px;} .ybc{bottom:669.000000px;} .y85{bottom:673.000000px;} .y15{bottom:676.000000px;} .y36{bottom:677.000000px;} .y5d{bottom:681.000000px;} .y84{bottom:685.000000px;} .y3{bottom:686.000000px;} .ybb{bottom:687.000000px;} .y2{bottom:688.000000px;} .y14{bottom:692.000000px;} .y35{bottom:693.000000px;} .y5c{bottom:697.000000px;} .y83{bottom:701.000000px;} .y1{bottom:703.000000px;} .y13{bottom:704.000000px;} .yba{bottom:705.000000px;} .y9e{bottom:708.000000px;} .y34{bottom:709.000000px;} .y0{bottom:712.500000px;} .y5b{bottom:713.000000px;} .y12{bottom:716.000000px;} .y82{bottom:717.000000px;} .y9d{bottom:720.000000px;} .y33{bottom:725.000000px;} .y11{bottom:728.000000px;} .y5a{bottom:729.000000px;} .y9c{bottom:732.000000px;} .y81{bottom:733.000000px;} .y32{bottom:741.000000px;} .y10{bottom:744.000000px;} .y59{bottom:745.000000px;} .y80{bottom:749.000000px;} .y31{bottom:757.000000px;} .y7f{bottom:765.000000px;} .y30{bottom:769.000000px;} .y2b{bottom:775.500000px;} .y2f{bottom:781.000000px;} .y2d{bottom:799.000000px;} .h2{height:46.973200px;} .h6{height:56.367840px;} .h9{height:59.156250px;} .h7{height:69.015625px;} .h5{height:70.459800px;} .h1{height:84.500000px;} .h4{height:93.946400px;} .h3{height:187.892799px;} .h8{height:752.500000px;} .h0{height:842.000000px;} .w1{width:277.500000px;} .w2{width:485.500000px;} .w0{width:595.000000px;} .x0{left:55.000000px;} .x9{left:57.000000px;} .x6{left:188.700000px;} .xa{left:216.470000px;} .x5{left:231.910000px;} .x3{left:235.240000px;} .x8{left:245.000000px;} .x7{left:269.150000px;} .x1{left:276.080000px;} .x4{left:291.940000px;} .x2{left:296.110000px;} .xb{left:531.330000px;} @media print{ .v0{vertical-align:0.000000pt;} .ls0{letter-spacing:0.000000pt;} .ws0{word-spacing:0.000000pt;} .fs0{font-size:53.333333pt;} .fs4{font-size:64.000000pt;} .fs5{font-size:74.666667pt;} .fs3{font-size:80.000000pt;} .fs2{font-size:106.666667pt;} .fs1{font-size:213.333333pt;} .ye{bottom:22.666667pt;} .y2e{bottom:41.333333pt;} .yf{bottom:59.333333pt;} .y2a{bottom:82.160000pt;} .yb7{bottom:88.000000pt;} .y7c{bottom:94.666667pt;} .yd6{bottom:97.333333pt;} .yb6{bottom:104.000000pt;} .y58{bottom:115.333333pt;} .y7b{bottom:116.000000pt;} .y99{bottom:118.666667pt;} .yb5{bottom:120.000000pt;} .y2c{bottom:124.160000pt;} .yd5{bottom:134.666667pt;} .yb4{bottom:136.000000pt;} .y7a{bottom:137.333333pt;} .y98{bottom:142.666667pt;} .yd4{bottom:150.666667pt;} .yb3{bottom:157.333333pt;} .y79{bottom:158.666667pt;} .y56{bottom:160.000000pt;} .yd3{bottom:166.666667pt;} .y29{bottom:168.826667pt;} .y78{bottom:180.000000pt;} .y55{bottom:186.666667pt;} .yd2{bottom:188.000000pt;} .y28{bottom:195.493333pt;} .yb9{bottom:199.333333pt;} .y77{bottom:201.333333pt;} .yd1{bottom:209.333333pt;} .y54{bottom:210.666667pt;} .y76{bottom:217.333333pt;} .y27{bottom:219.493333pt;} .y97{bottom:222.666667pt;} .y75{bottom:233.333333pt;} .y53{bottom:234.666667pt;} .y26{bottom:243.493333pt;} .y96{bottom:244.000000pt;} .y74{bottom:249.333333pt;} .y52{bottom:250.666667pt;} .yd8{bottom:251.333333pt;} .y95{bottom:265.333333pt;} .y25{bottom:267.493333pt;} .yb2{bottom:270.666667pt;} .y51{bottom:272.000000pt;} .y94{bottom:286.666667pt;} .y7e{bottom:291.333333pt;} .y24{bottom:291.493333pt;} .y50{bottom:293.333333pt;} .yb1{bottom:294.666667pt;} .yd0{bottom:296.000000pt;} .y93{bottom:308.000000pt;} .y4f{bottom:314.666667pt;} .y23{bottom:315.493333pt;} .yb0{bottom:318.666667pt;} .ycf{bottom:322.666667pt;} .y92{bottom:329.333333pt;} .yaf{bottom:334.666667pt;} .y4e{bottom:336.000000pt;} .y22{bottom:339.493333pt;} .y91{bottom:345.333333pt;} .yce{bottom:346.666667pt;} .yae{bottom:356.000000pt;} .y4d{bottom:357.333333pt;} .y90{bottom:361.333333pt;} .y73{bottom:362.666667pt;} .y21{bottom:363.493333pt;} .ycd{bottom:370.666667pt;} .y4c{bottom:373.333333pt;} .yad{bottom:377.333333pt;} .y8f{bottom:382.666667pt;} .y72{bottom:386.666667pt;} .y20{bottom:387.493333pt;} .y4b{bottom:389.333333pt;} .yac{bottom:398.666667pt;} .y8e{bottom:404.000000pt;} .y4a{bottom:405.333333pt;} .ycc{bottom:408.000000pt;} .y71{bottom:410.666667pt;} .yab{bottom:420.000000pt;} .y70{bottom:426.666667pt;} .ycb{bottom:429.333333pt;} .yaa{bottom:441.333333pt;} .y9b{bottom:446.000000pt;} .y57{bottom:447.333333pt;} .y6f{bottom:448.000000pt;} .yca{bottom:450.666667pt;} .ya9{bottom:457.333333pt;} .y6e{bottom:469.333333pt;} .yc9{bottom:472.000000pt;} .ya8{bottom:473.333333pt;} .yc8{bottom:488.000000pt;} .ya7{bottom:489.333333pt;} .y6d{bottom:490.666667pt;} .y49{bottom:492.000000pt;} .yc7{bottom:504.000000pt;} .ya6{bottom:510.666667pt;} .y6c{bottom:512.000000pt;} .y8d{bottom:517.333333pt;} .yd{bottom:518.000000pt;} .y48{bottom:518.666667pt;} .yc6{bottom:520.000000pt;} .y6b{bottom:533.333333pt;} .y8c{bottom:541.333333pt;} .yc{bottom:542.000000pt;} .y47{bottom:542.666667pt;} .y6a{bottom:549.333333pt;} .yb8{bottom:552.666667pt;} .yc5{bottom:562.666667pt;} .y69{bottom:565.333333pt;} .y46{bottom:566.666667pt;} .y68{bottom:581.333333pt;} .yb{bottom:582.000000pt;} .y45{bottom:582.666667pt;} .ya5{bottom:597.333333pt;} .ya{bottom:602.000000pt;} .y67{bottom:602.666667pt;} .y44{bottom:604.000000pt;} .yd7{bottom:604.666667pt;} .y9{bottom:615.333333pt;} .y8b{bottom:624.000000pt;} .y43{bottom:625.333333pt;} .y7d{bottom:644.666667pt;} .y8{bottom:645.333333pt;} .y42{bottom:646.666667pt;} .ya4{bottom:648.000000pt;} .yc4{bottom:649.333333pt;} .y7{bottom:658.666667pt;} .y8a{bottom:666.666667pt;} .y41{bottom:668.000000pt;} .ya3{bottom:672.000000pt;} .yc3{bottom:676.000000pt;} .y1f{bottom:682.666667pt;} .ya2{bottom:688.000000pt;} .y40{bottom:689.333333pt;} .y6{bottom:698.666667pt;} .yc2{bottom:700.000000pt;} .y5{bottom:701.333333pt;} .y1e{bottom:706.666667pt;} .ya1{bottom:709.333333pt;} .y3f{bottom:710.666667pt;} .y89{bottom:714.666667pt;} .y66{bottom:716.000000pt;} .yc1{bottom:724.000000pt;} .y1d{bottom:730.666667pt;} .y3e{bottom:732.000000pt;} .y88{bottom:736.000000pt;} .y65{bottom:740.000000pt;} .yc0{bottom:748.000000pt;} .ya0{bottom:752.000000pt;} .y3d{bottom:753.333333pt;} .y1c{bottom:754.666667pt;} .y64{bottom:764.000000pt;} .ybf{bottom:772.000000pt;} .y9f{bottom:773.333333pt;} .y3c{bottom:774.666667pt;} .y9a{bottom:778.000000pt;} .y1b{bottom:778.666667pt;} .y63{bottom:780.000000pt;} .y4{bottom:781.333333pt;} .y1a{bottom:794.666667pt;} .y3b{bottom:796.000000pt;} .y62{bottom:801.333333pt;} .y19{bottom:816.000000pt;} .y3a{bottom:817.333333pt;} .ybe{bottom:820.000000pt;} .y61{bottom:822.666667pt;} .y18{bottom:837.333333pt;} .y39{bottom:838.666667pt;} .y60{bottom:844.000000pt;} .y87{bottom:849.333333pt;} .y17{bottom:858.666667pt;} .y38{bottom:860.000000pt;} .y5f{bottom:865.333333pt;} .ybd{bottom:868.000000pt;} .y86{bottom:873.333333pt;} .y16{bottom:880.000000pt;} .y37{bottom:881.333333pt;} .y5e{bottom:886.666667pt;} .ybc{bottom:892.000000pt;} .y85{bottom:897.333333pt;} .y15{bottom:901.333333pt;} .y36{bottom:902.666667pt;} .y5d{bottom:908.000000pt;} .y84{bottom:913.333333pt;} .y3{bottom:914.666667pt;} .ybb{bottom:916.000000pt;} .y2{bottom:917.333333pt;} .y14{bottom:922.666667pt;} .y35{bottom:924.000000pt;} .y5c{bottom:929.333333pt;} .y83{bottom:934.666667pt;} .y1{bottom:937.333333pt;} .y13{bottom:938.666667pt;} .yba{bottom:940.000000pt;} .y9e{bottom:944.000000pt;} .y34{bottom:945.333333pt;} .y0{bottom:950.000000pt;} .y5b{bottom:950.666667pt;} .y12{bottom:954.666667pt;} .y82{bottom:956.000000pt;} .y9d{bottom:960.000000pt;} .y33{bottom:966.666667pt;} .y11{bottom:970.666667pt;} .y5a{bottom:972.000000pt;} .y9c{bottom:976.000000pt;} .y81{bottom:977.333333pt;} .y32{bottom:988.000000pt;} .y10{bottom:992.000000pt;} .y59{bottom:993.333333pt;} .y80{bottom:998.666667pt;} .y31{bottom:1009.333333pt;} .y7f{bottom:1020.000000pt;} .y30{bottom:1025.333333pt;} .y2b{bottom:1034.000000pt;} .y2f{bottom:1041.333333pt;} .y2d{bottom:1065.333333pt;} .h2{height:62.630933pt;} .h6{height:75.157120pt;} .h9{height:78.875000pt;} .h7{height:92.020833pt;} .h5{height:93.946400pt;} .h1{height:112.666667pt;} .h4{height:125.261866pt;} .h3{height:250.523733pt;} .h8{height:1003.333333pt;} .h0{height:1122.666667pt;} .w1{width:370.000000pt;} .w2{width:647.333333pt;} .w0{width:793.333333pt;} .x0{left:73.333333pt;} .x9{left:76.000000pt;} .x6{left:251.600000pt;} .xa{left:288.626667pt;} .x5{left:309.213333pt;} .x3{left:313.653333pt;} .x8{left:326.666667pt;} .x7{left:358.866667pt;} .x1{left:368.106667pt;} .x4{left:389.253333pt;} .x2{left:394.813333pt;} .xb{left:708.440000pt;} }
define([ 'flight/lib/component', 'configuration/plugins/registry' ], function(defineComponent, registry) { 'use strict'; return defineComponent(AddItem); function AddItem() { this.after('initialize', function() { this.add(); }); this.add = function() { var self = this; this.$node .addClass('add') .on('click', function() { self.list(); }); }; this.list = function() { var self = this, extensions = registry.extensionsForPoint('org.visallo.dashboard.item'); this.$node .removeClass('add') .addClass('list') .html( $('<ul>').append( $.map(_.sortBy(extensions, function(e) { return e.title.toLowerCase(); }), function(extension) { return $('<li>') .on('click', function() { self.trigger('addItem', { extension: extension }); }) .text(extension.title) .append( $('<span>').text(extension.description) ) }) ) ); }; } });
package org.asterisque; import java.nio.charset.Charset; import java.util.UUID; import java.util.concurrent.ThreadFactory; // Asterisque /** * @author Takami Torao */ public final class Asterisque { private Asterisque() { } /** * URI asterisque */ public static final String ID = "asterisque"; // UTF-8 /** * UTF-8 */ public static final Charset UTF8 = Charset.forName("UTF-8"); /** * asterisque */ public static final ThreadGroup threadGroup = new ThreadGroup(ID); public static Thread newThread(String role, Runnable r){ return new Thread(threadGroup, r, ID + "." + role); } public static ThreadFactory newThreadFactory(String role){ return r -> newThread(role, r); } public static final UUID Zero = new UUID(0, 0); public static final class Protocol { private Protocol(){ } /** * 2 ASCII "*Q" * */ public static final short Signature = 0x2A51; public static final short Version_0_1 = 0x0001; public static final short CurrentVersion = Version_0_1; } public static String logPrefix(){ return "-: public static String logPrefix(boolean isServer){ return logPrefix(isServer, null); } public static String logPrefix(boolean isServer, UUID id){ return (isServer? 'S': 'C') + ":" + (id == null? " } }
package pl.grzegorz2047.survivalcg.mysql; import pl.grzegorz2047.survivalcg.managers.MysqlManager; public abstract class Query { protected final MysqlManager mysql; public Query(MysqlManager mysql){ this.mysql = mysql; } }
# AUTOGENERATED FILE FROM balenalib/artik710-fedora:36-build # > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK. ENV LANG C.UTF-8 RUN dnf install -y \ python3-pip \ python3-dbus \ && dnf clean all # install "virtualenv", since the vast majority of users of this image will want it RUN pip3 install -U --no-cache-dir --ignore-installed pip setuptools \ && pip3 install --no-cache-dir virtualenv RUN [ ! -d /.balena/messages ] && mkdir -p /.balena/messages; echo $'As of January 1st, 2020, Python 2 was end-of-life, we will change the latest tag for Balenalib Python base image to Python 3.x and drop support for Python 2 soon. So after 1st July, 2020, all the balenalib Python latest tag will point to the latest Python 3 version and no changes, or fixes will be made to balenalib Python 2 base image. If you are using Python 2 for your application, please upgrade to Python 3 before 1st July.' > /.balena/messages/<API key> CMD ["echo","'No CMD command was set in Dockerfile! Details about CMD command could be found in Dockerfile Guide section in our Docs. Here's the link: https://balena.io/docs"] RUN curl -SLO "https://raw.githubusercontent.com/balena-io-library/base-images/<SHA1-like>/scripts/assets/tests/test-stack@python.sh" \ && echo "Running test-stack@python" \ && chmod +x test-stack@python.sh \ && bash test-stack@python.sh \ && rm -rf test-stack@python.sh RUN [ ! -d /.balena/messages ] && mkdir -p /.balena/messages; echo $'Here are a few details about this Docker image (For more information please visit https: RUN echo $'#!/bin/sh.real\nbalena-info\nrm -f /bin/sh\ncp /bin/sh.real /bin/sh\n/bin/sh "$@"' > /bin/sh-shim \ && chmod +x /bin/sh-shim \ && cp /bin/sh /bin/sh.real \ && mv /bin/sh-shim /bin/sh
- users - create (assume flexy htpasswd) - delete (assume flexy htpasswd) - login - logout - project - create - delete - check - modify (create secret) - app - build - scale up - scale down - create (not used) - visit - ds and ss - create - delete - scale up - scale down - monitor - openshift - masters - nodes - etcds
# -*- coding:utf-8 -*- import os,sys from unittest import TestCase from tests.utils.utils import utils s = sys.path.append(utils().buildPath(os.getcwd())+"/vagrant/optraj.istic.univ-rennes1.fr/src/") from interfacebdd.ShuttleDAO import ShuttleDAO from interfacebdd.CarDAO import CarDAO from system.Car import Car from interfacebdd.Connexion import Connexion class test_carDAO(TestCase): """Test the stand-alone module functions.""" def test_getUsedCar(self): d = Connexion().connect() try: res = True usedCars = CarDAO().getUsedCar(d, False, []) for c in usedCars: idShuttle = ShuttleDAO().getByFilter(d, False, [], ("car", str(c.num))) if idShuttle == None: res = False self.assertTrue(res) except: Connexion().exception() finally: Connexion().disconnect(d) def test_getUnusedCar(self): d = Connexion().connect() try: res = True unusedCars = CarDAO().getUnUsedCar(d, False, []) for c in unusedCars: idShuttle = ShuttleDAO().getByFilter(d, False, [], ("car", str(c.num))) if idShuttle != None: print idShuttle res = False self.assertTrue(res) except: Connexion().exception() finally: Connexion().disconnect(d) def test_insert(self): d = Connexion().connect() try: carIns = Car(num=-1, plate="test", model="test1", nbPlace=4) res = CarDAO().insert(d, carIns) carRes = CarDAO().getById(d, False, [], res) carIns.num = res utils().equal(self, carIns, carRes) except: Connexion().exception() finally: Connexion().disconnect(d) def test_get(self): d = Connexion().connect() try: carIns = Car(num=-1, plate="test", model="test1", nbPlace=4) res = CarDAO().insert(d, carIns) carRes = CarDAO().getById(d, False, [], res) carIns.num = res utils().equal(self, carIns, carRes) except: Connexion().exception() finally: Connexion().disconnect(d) def test_delete(self): d = Connexion().connect() try: carIns = Car(num=-1, plate="test", model="test1", nbPlace=4) res = CarDAO().insert(d, carIns) CarDAO().deleteById(d, res) carRes =self.assertRaises(AttributeError, CarDAO().getById, d, False, [], res) print(carRes) except: Connexion().exception() finally: Connexion().disconnect(d) def test_update(self): d = Connexion().connect() try: carIns = Car(num=-1, plate="test", model="test1", nbPlace=4) res = CarDAO().insert(d, carIns) carRes = CarDAO().getById(d, False, [], res) carRes.nbPlace = 8 CarDAO().update(d, carRes) carRes2 = CarDAO().getById(d, False, [], res) utils().equal(self, carRes, carRes2) except: Connexion().exception() finally: Connexion().disconnect(d)
"use strict"; var crx = require('crx'); var path = require('path'); var required_properties = ['manifest_version', 'name', 'version']; var homeDir = process.env.HOME || process.env.HOMEPATH || process.env.USERPROFILE; var filename_template = "<%= pkg.name %>-<%= manifest.version %>.crx"; /** * Resolve the home directory of a supposed-path value * * @param {String} value * @returns {String} */ function <API key>(value){ if (homeDir && typeof value === 'string' && value[0] === '~'){ value = value.replace(/^~/, homeDir); } return value; } /** * Initializes the grunt helper * * @param {grunt} grunt * @returns {{build: Function, expandConfiguration: Function, <API key>: Function, <API key>: Function}} */ exports.init = function(grunt){ /** * Builds a pre-configured chrome extension in 3 steps * * @api * @param {crx} ChromeExtension * @param {Function} callback * @return null */ function build(ChromeExtension, callback) { grunt.file.mkdir(path.dirname(ChromeExtension.dest)); grunt.util.async.series([ function <API key>(next){ ChromeExtension.load(next); }, function removeExcludedFiles(next){ if (!Array.isArray(ChromeExtension.exclude) || !ChromeExtension.exclude.length){ return next(); } var files = grunt.file.expand(ChromeExtension.exclude.map(function(pattern){ return path.join(ChromeExtension.path, '/', pattern); })); // deletes all the file in parallel grunt.util.async.forEach(files, function(filepath, done){ grunt.file.delete(filepath, {force: true}); done(); }, next); }, function finallyPackFiles(next){ ChromeExtension.pack(function(err, data){ if (err){ grunt.fail.fatal(err); } grunt.file.write(this.dest, data); next(); }); } ], callback); } function createObject(taskConfig, defaults){ taskConfig = expandConfiguration(taskConfig, defaults); return new crx(taskConfig); } /** * Refines a task configuration (expand settings etc.) * * @param {Object} taskConfig * @param {Object=} defaults * @return {Object} */ function expandConfiguration(taskConfig, defaults){ defaults = defaults || <API key>(); var config = grunt.util._.defaults({}, taskConfig, defaults); ['dest', 'src'].forEach(function(key){ if ((Array.isArray(config[key]) && config[key].length === 0) || !config[key]){ grunt.fail.fatal("You can't specify an empty '"+key+"' configuration value."); } }); // XXX (alexeykuzmin): Is there a better way to get source folder path? var sourceDir = Array.isArray(config.src) ? config.src[0] : config.src; // Eventually expanding `~` in config paths ['privateKey', 'src', 'dest'].forEach(function(key){ config[key] = <API key>(config[key]); }); // Checking availability if (!grunt.file.exists(sourceDir)){ grunt.fail.fatal('Unable to locate source directory.'); } if (!grunt.file.exists(config.privateKey)){ grunt.fail.fatal('Unable to locate your private key.'); } else{ config.privateKey = grunt.file.read(config.privateKey); } // Check extension manifest config.manifest = grunt.file.readJSON(path.join(sourceDir, 'manifest.json')); required_properties.forEach(function(prop) { if ('undefined' === typeof config.manifest[prop]) { grunt.fail.fatal('Invalid manifest: property "' + prop + '" is missing.'); } }); // Expanding destination if (!path.extname(config.dest)){ var filename = config.filename || filename_template; config.dest = path.join(config.dest, filename); } ['dest'].forEach(function(key){ config[key] = grunt.template.process(config[key], { "data": { "manifest": config.manifest, "pkg": grunt.file.readJSON('package.json') } }); }); // Codebase generation (@todo cleanup that with clean separation of grunt and chrome extension config) config.codebase = config.baseURL || config.codebase || null; if (config.codebase && !/.crx$/.test(config.codebase)){ config.codebase = config.codebase.replace(/\/$/, ''); config.codebase += '/' + path.basename(config.dest); } // @todo remove that to better separate grunt config and Chrome Extension config // rootDirectory should be a String, not Array config.rootDirectory = sourceDir; config.maxBuffer = config.options.maxBuffer || config.maxBuffer || undefined; return config; } /** * Returns a task configuration profile * * @param {String=} profile * @return {Object} */ function <API key>(profile){ var config; profile = profile || 'default'; config = grunt.file.readJSON(__dirname + '/../data/config-'+ profile +'.json'); return config; } /* * Blending */ return { "build": build, "createObject": createObject, "expandConfiguration": expandConfiguration, "filename": filename_template, "<API key>": <API key>, "<API key>": <API key> }; };
<ion-view view-title="About"> <ion-content> {{version}} </ion-content> </ion-view>
package com.xinqihd.sns.gameserver.admin.action.game; import java.awt.event.ActionEvent; import javax.swing.AbstractAction; import javax.swing.SwingUtilities; import com.xinqihd.sns.gameserver.admin.gui.MainPanel; import com.xinqihd.sns.gameserver.admin.gui.TaskTipPanel; import com.xinqihd.sns.gameserver.admin.security.PriviledgeKey; import com.xinqihd.sns.gameserver.admin.util.ImageUtil; public class TaskTipAction extends AbstractAction { public TaskTipAction() { super("", ImageUtil.<API key>("Pen.png", "")); } public PriviledgeKey getPriviledge() { return PriviledgeKey.task_game_tips; } @Override public void actionPerformed(ActionEvent e) { SwingUtilities.invokeLater(new Runnable(){ public void run() { MainPanel.getInstance().setCenterPanel(TaskTipPanel.getInstance()); } }); } }
<!DOCTYPE HTML PUBLIC "- <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (1.8.0_112) on Fri Jun 16 09:55:14 MST 2017 --> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>org.wildfly.swarm.topology.jgroups Class Hierarchy (Public javadocs 2017.6.1 API)</title> <meta name="date" content="2017-06-16"> <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.topology.jgroups Class Hierarchy (Public javadocs 2017.6.1 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>Use</li> <li class="navBarCell1Rev">Tree</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.6.1</div> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../../org/wildfly/swarm/topology/deployment/package-tree.html">Prev</a></li> <li><a href="../../../../../org/wildfly/swarm/topology/webapp/package-tree.html">Next</a></li> </ul> <ul class="navList"> <li><a href="../../../../../index.html?org/wildfly/swarm/topology/jgroups/package-tree.html" target="_top">Frames</a></li> <li><a href="package-tree.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 class="title">Hierarchy For Package org.wildfly.swarm.topology.jgroups</h1> <span class="<API key>">Package Hierarchies:</span> <ul class="horizontal"> <li><a href="../../../../../overview-tree.html">All Packages</a></li> </ul> </div> <div class="contentContainer"> <h2 title="Class Hierarchy">Class Hierarchy</h2> <ul> <li type="circle">java.lang.<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang"><span class="typeNameLink">Object</span></a> <ul> <li type="circle">org.wildfly.swarm.topology.jgroups.<a href="../../../../../org/wildfly/swarm/topology/jgroups/<API key>.html" title="class in org.wildfly.swarm.topology.jgroups"><span class="typeNameLink"><API key></span></a> (implements org.wildfly.swarm.spi.api.<a href="../../../../../org/wildfly/swarm/spi/api/Fraction.html" title="interface in org.wildfly.swarm.spi.api">Fraction</a>&lt;T&gt;)</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>Class</li> <li>Use</li> <li class="navBarCell1Rev">Tree</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.6.1</div> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../../org/wildfly/swarm/topology/deployment/package-tree.html">Prev</a></li> <li><a href="../../../../../org/wildfly/swarm/topology/webapp/package-tree.html">Next</a></li> </ul> <ul class="navList"> <li><a href="../../../../../index.html?org/wildfly/swarm/topology/jgroups/package-tree.html" target="_top">Frames</a></li> <li><a href="package-tree.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>
<?php class Surveys extends DashboardController{ protected $gender; function __construct() { parent::__construct(); $this->load->model('M_Dashboard'); $this->gender = $this->M_Dashboard->getGender(); } function index(){ $data = [ 'preferred_kit' => $this->getMostPreferredKit(), 'table' => $this->createAgeKitTable(), 'gender_header' => $this->createGenderHeader(), 'totals' => $this-><API key>() ]; $this->assets ->addCss('dashboard/vendor/datatables.net-bs/css/dataTables.bootstrap.min.css'); $this->assets ->addJs('dashboard/vendor/datatables/media/js/jquery.dataTables.min.js') ->addJs('dashboard/vendor/datatables.net-bs/js/dataTables.bootstrap.min.js') ->addJs('dashboard/vendor/datatables.net-buttons/js/buttons.html5.min.js') ->addJs('dashboard/vendor/datatables.net-buttons/js/buttons.print.min.js') ->addJs('dashboard/vendor/datatables.net-buttons/js/dataTables.buttons.min.js') ->addJs('dashboard/vendor/datatables.net-buttons-bs/js/buttons.bootstrap.min.js') ->addJs('dashboard/vendor/jquery-flot/jquery.flot.js') ->addJs('dashboard/vendor/jquery-flot/jquery.flot.pie.js') ->addJs('dashboard/vendor/chartjs/Chart.min.js') ->setJavascript('Dashboard/surveys/survey_js'); $this->template ->setPartial('Dashboard/surveys/index_v', $data) ->adminTemplate(); } function getTotalSurveys(){ $query = $this->db->get('survey'); } function getMostPreferredKit(){ $numbers = $this->M_Dashboard->getPreferredKit(); if ($numbers) { return $numbers; } show_404(); } function createAgeKitTable(){ $age_kit_numbers = $this->M_Dashboard->getAgeKitNumbers(); $table = []; $age_kit_table = $gender_kit_table = ''; if ($age_kit_numbers) { foreach ($age_kit_numbers as $number) { $age_kit_table .= "<tr> <td>$number->kit</td> <td>$number->oldest</td> <td>$number->youngest</td> </tr>"; } } $kits = $this->db->get('kits')->result(); $gender = $this->db->get('gender')->result(); if ($kits) { foreach ($kits as $kit) { $gender_kit_table .= '<tr>'; $gender_kit_table .= "<td>{$kit->kit}</td>"; foreach ($gender as $sex) { $gender_kit_numbers = $this->M_Dashboard->getGenderKitNumbers($kit->id, $sex->id); if($gender_kit_numbers){ $gender_kit_table .= "<td>{$gender_kit_numbers->numbers}</td>"; }else{ $gender_kit_table .= "<td>0</td>"; } } $gender_kit_table .= '</tr>'; } } $table = [ 'age_kit_table' => $age_kit_table, 'gender_kit_table' => $gender_kit_table ]; return $table; } function createGenderHeader(){ $gender = $this->db->get('gender')->result(); $gender_header = ""; foreach ($gender as $sex) { $gender_header .= "<th>{$sex->gender}</th>"; } return $gender_header; } function <API key>(){ $surveys = $this->db->get('survey')->num_rows(); $this->db->where('gender', 1); $male_count = $this->db->get('survey')->num_rows(); $this->db->where('gender', 2); $female_count = $this->db->get('survey')->num_rows(); return [ 'surveys' => $surveys, 'males' => $male_count, 'females' => $female_count ]; } function getAnalyticsData(){ $response = $monthly_count_data = $gender_data = $average_age_data = $gendernos = $monthly_curve_data = []; // get number of users grouped by gender $this->db->select('g.gender, g.color, count(s.age) as age'); $this->db->from('survey s'); $this->db->join('gender g', 'g.id=s.gender', 'right'); $this->db->group_by('g.gender'); $gender_counts = $this->db->get()->result(); if ($gender_counts) { foreach ($gender_counts as $gender_count) { $count = ($gender_count->age == null) ? 0 : $gender_count->age; $gender_data[] = [ 'label' => $gender_count->gender, 'data' => $count, 'color' => $gender_count->color ]; $gendernos[$gender_count->gender] = $count; } } // getting average age of users grouped by users $this->db->select('g.gender'); $this->db->select_avg('s.age'); $this->db->from('survey s'); $this->db->join('gender g', 'g.id=s.gender', 'right'); $this->db->group_by('g.gender'); $average_ages = $this->db->get()->result(); if ($average_ages) { $total_age_averages = 0; $number_of_gender = 0; foreach ($average_ages as $gender_age) { $average_age = ($gender_age->age == null) ? 0 : $gender_age->age; if($average_age != NULL){ $total_age_averages += $average_age; $number_of_gender++; } $average_age_data[$gender_age->gender] = $average_age; } $number_of_gender = ($number_of_gender == 0) ? 1 : $number_of_gender; $response['data']['overall_average'] = round($total_age_averages / $number_of_gender, 0); } $monthly_counts = $this->db->query("SELECT g.gender, count(s.id) as age FROM survey s RIGHT JOIN gender g ON g.id = s.gender AND MONTH(s.date_of_entry) = " . date('n') ." GROUP BY g.gender")->result(); if ($monthly_counts) { $total_monthly_count = 0; foreach ($monthly_counts as $monthly_count) { $count = ($monthly_count->age == null) ? 0 : $monthly_count->age; $total_monthly_count += $count; $monthly_count_data[$monthly_count->gender] = $count; } $response['data']['monthly_total'] = $total_monthly_count; } // getting data for months $from_date = date("Y-m-01", strtotime("-6months")); $to_date = date('Y-m-d'); $sql = "SELECT DATE_FORMAT(date_of_entry, '%M %Y') as `month`, count(id) as surveys FROM survey GROUP BY DATE_FORMAT(date_of_entry, '%M %Y') ORDER BY date_of_entry ASC LIMIT 12;"; $monthly_data = $this->db->query($sql)->result(); // echo "<pre>";print_r($monthly_data);die; if ($monthly_data) { $outer_key = 0; $data_set = []; foreach ($monthly_data as $month) { $monthly_curve_data['labels'][] = $month->month; $data_set[] = $month->surveys; $outer_key++; } $monthly_curve_data['datasets'][] = [ "label" => "Surveys", "backgroundColor" => "rgba(254,223,0,0.5)", "data" => $data_set, "lineTension" => 0, "pointBorderWidth" => 1, "<API key>" => "rgba(254,223,0,1)", "pointRadius" => 3, "pointBorderColor" => "#ffffff", "borderWidth" => 1 ]; } $response['data']['monthly_curve_data'] = $monthly_curve_data; $response['data']['average_ages'] = $average_age_data; $response['data']['gender_counts'] = $gender_data; $response['data']['gendernos'] = $gendernos; $response['data']['monthly_count'] = $monthly_count_data; $response['data']['median_age'] = $this->M_Dashboard->getSurveyMedianAge()->median_age; //echo "<pre>";print_r($response);echo "</pre>";die(); return $this->output->set_content_type('application/json')->set_output(json_encode($response, JSON_NUMERIC_CHECK)); } }